]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
mac80211: move BA session work
authorJohannes Berg <johannes.berg@intel.com>
Thu, 10 Jun 2010 08:21:43 +0000 (10:21 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 14 Jun 2010 19:39:27 +0000 (15:39 -0400)
Move the block-ack session works into common
code, since it will be needed for RX agg too
in the next patches.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/agg-tx.c
net/mac80211/ht.c
net/mac80211/ieee80211_i.h
net/mac80211/sta_info.c

index ee8bfe18b4882a43b046256bf0f062f55fab64fd..9a00a79a868bf5b24c1b87052003b0ae504ff4b8 100644 (file)
@@ -133,9 +133,8 @@ static void kfree_tid_tx(struct rcu_head *rcu_head)
        kfree(tid_tx);
 }
 
-static int ___ieee80211_stop_tx_ba_session(
-               struct sta_info *sta, u16 tid,
-               enum ieee80211_back_parties initiator)
+int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
+                                   enum ieee80211_back_parties initiator)
 {
        struct ieee80211_local *local = sta->local;
        struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid];
@@ -262,7 +261,7 @@ ieee80211_wake_queue_agg(struct ieee80211_local *local, int tid)
        __release(agg_queue);
 }
 
-static void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
+void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
 {
        struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid];
        struct ieee80211_local *local = sta->local;
@@ -318,38 +317,6 @@ static void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
                                     0x40, 5000);
 }
 
-void ieee80211_tx_ba_session_work(struct work_struct *work)
-{
-       struct sta_info *sta =
-               container_of(work, struct sta_info, ampdu_mlme.work);
-       struct tid_ampdu_tx *tid_tx;
-       int tid;
-
-       /*
-        * When this flag is set, new sessions should be
-        * blocked, and existing sessions will be torn
-        * down by the code that set the flag, so this
-        * need not run.
-        */
-       if (test_sta_flags(sta, WLAN_STA_BLOCK_BA))
-               return;
-
-       spin_lock_bh(&sta->lock);
-       for (tid = 0; tid < STA_TID_NUM; tid++) {
-               tid_tx = sta->ampdu_mlme.tid_tx[tid];
-               if (!tid_tx)
-                       continue;
-
-               if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state))
-                       ieee80211_tx_ba_session_handle_start(sta, tid);
-               else if (test_and_clear_bit(HT_AGG_STATE_WANT_STOP,
-                                           &tid_tx->state))
-                       ___ieee80211_stop_tx_ba_session(sta, tid,
-                                                       WLAN_BACK_INITIATOR);
-       }
-       spin_unlock_bh(&sta->lock);
-}
-
 int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
 {
        struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
index 4dfba7808a24f8003e79e2be12f6ef8723fd9a76..531a19d358df4e8bf4e55e6fd8c25ea6c939f37f 100644 (file)
@@ -114,6 +114,38 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta)
        }
 }
 
+void ieee80211_ba_session_work(struct work_struct *work)
+{
+       struct sta_info *sta =
+               container_of(work, struct sta_info, ampdu_mlme.work);
+       struct tid_ampdu_tx *tid_tx;
+       int tid;
+
+       /*
+        * When this flag is set, new sessions should be
+        * blocked, and existing sessions will be torn
+        * down by the code that set the flag, so this
+        * need not run.
+        */
+       if (test_sta_flags(sta, WLAN_STA_BLOCK_BA))
+               return;
+
+       spin_lock_bh(&sta->lock);
+       for (tid = 0; tid < STA_TID_NUM; tid++) {
+               tid_tx = sta->ampdu_mlme.tid_tx[tid];
+               if (!tid_tx)
+                       continue;
+
+               if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state))
+                       ieee80211_tx_ba_session_handle_start(sta, tid);
+               else if (test_and_clear_bit(HT_AGG_STATE_WANT_STOP,
+                                           &tid_tx->state))
+                       ___ieee80211_stop_tx_ba_session(sta, tid,
+                                                       WLAN_BACK_INITIATOR);
+       }
+       spin_unlock_bh(&sta->lock);
+}
+
 void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
                          const u8 *da, u16 tid,
                          u16 initiator, u16 reason_code)
index aec84c36c4c110782934fce163d1e9b4538a18f2..628a53db9f7e1a5eab4f01b3e261de9382ef33d6 100644 (file)
@@ -1113,9 +1113,12 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
 
 int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
                                   enum ieee80211_back_parties initiator);
+int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
+                                   enum ieee80211_back_parties initiator);
 void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
 void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
-void ieee80211_tx_ba_session_work(struct work_struct *work);
+void ieee80211_ba_session_work(struct work_struct *work);
+void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
 
 /* Spectrum management */
 void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
index 8aa8558ba21e2b38433a16aba4449d80dea6abce..bd726c6204df557e24719672c111de9675202a41 100644 (file)
@@ -235,7 +235,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
        spin_lock_init(&sta->lock);
        spin_lock_init(&sta->flaglock);
        INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
-       INIT_WORK(&sta->ampdu_mlme.work, ieee80211_tx_ba_session_work);
+       INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
 
        memcpy(sta->sta.addr, addr, ETH_ALEN);
        sta->local = local;