Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / net / mac80211 / mesh_plink.c
index 08df966320b809ab8f47639196e5a747791b2bcb..937e06fe8f2ac87f0bd640e650877f097b8aa8e5 100644 (file)
@@ -420,7 +420,6 @@ __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr)
                return NULL;
 
        sta->plink_state = NL80211_PLINK_LISTEN;
-       init_timer(&sta->plink_timer);
 
        sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
        sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
@@ -437,8 +436,9 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr,
 {
        struct sta_info *sta = NULL;
 
-       /* Userspace handles peer allocation when security is enabled */
-       if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED)
+       /* Userspace handles station allocation */
+       if (sdata->u.mesh.user_mpm ||
+           sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED)
                cfg80211_notify_new_peer_candidate(sdata->dev, addr,
                                                   elems->ie_start,
                                                   elems->total_len,
@@ -670,6 +670,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
        if (len < IEEE80211_MIN_ACTION_SIZE + 3)
                return;
 
+       if (sdata->u.mesh.user_mpm)
+               /* userspace must register for these */
+               return;
+
        if (is_multicast_ether_addr(mgmt->da)) {
                mpl_dbg(sdata,
                        "Mesh plink: ignore frame from multicast address\n");