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 07d396d57079f921b8d314968a581d3a4fed2400..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,
@@ -534,10 +534,8 @@ static void mesh_plink_timer(unsigned long data)
         */
        sta = (struct sta_info *) data;
 
-       if (sta->sdata->local->quiescing) {
-               sta->plink_timer_was_running = true;
+       if (sta->sdata->local->quiescing)
                return;
-       }
 
        spin_lock_bh(&sta->lock);
        if (sta->ignore_plink_timer) {
@@ -598,29 +596,6 @@ static void mesh_plink_timer(unsigned long data)
        }
 }
 
-#ifdef CONFIG_PM
-void mesh_plink_quiesce(struct sta_info *sta)
-{
-       if (!ieee80211_vif_is_mesh(&sta->sdata->vif))
-               return;
-
-       /* no kernel mesh sta timers have been initialized */
-       if (sta->sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)
-               return;
-
-       if (del_timer_sync(&sta->plink_timer))
-               sta->plink_timer_was_running = true;
-}
-
-void mesh_plink_restart(struct sta_info *sta)
-{
-       if (sta->plink_timer_was_running) {
-               add_timer(&sta->plink_timer);
-               sta->plink_timer_was_running = false;
-       }
-}
-#endif
-
 static inline void mesh_plink_timer_set(struct sta_info *sta, int timeout)
 {
        sta->plink_timer.expires = jiffies + (HZ * timeout / 1000);
@@ -695,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");