mac80211: A-MPDU Rx MLME data initialization
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Tue, 25 Dec 2007 15:00:34 +0000 (17:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:01:00 +0000 (15:01 -0800)
This patch initialize A-MPDU MLME data for Rx sessions.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mac80211/sta_info.c

index 60ca07804056c7a00f1d4f6bb2c996347007c7bd..1257c7aab2a53774e9c2d5ee057f7781a8ac5d78 100644 (file)
@@ -136,6 +136,7 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
                               struct net_device *dev, u8 *addr, gfp_t gfp)
 {
        struct sta_info *sta;
+       int i;
        DECLARE_MAC_BUF(mac);
 
        sta = kzalloc(sizeof(*sta), gfp);
@@ -155,6 +156,19 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
        memcpy(sta->addr, addr, ETH_ALEN);
        sta->local = local;
        sta->dev = dev;
+       spin_lock_init(&sta->ampdu_mlme.ampdu_rx);
+       for (i = 0; i < STA_TID_NUM; i++) {
+               /* timer_to_tid must be initialized with identity mapping to
+                * enable session_timer's data differentiation. refer to
+                * sta_rx_agg_session_timer_expired for useage */
+               sta->timer_to_tid[i] = i;
+               /* rx timers */
+               sta->ampdu_mlme.tid_rx[i].session_timer.function =
+                       sta_rx_agg_session_timer_expired;
+               sta->ampdu_mlme.tid_rx[i].session_timer.data =
+                       (unsigned long)&sta->timer_to_tid[i];
+               init_timer(&sta->ampdu_mlme.tid_rx[i].session_timer);
+       }
        skb_queue_head_init(&sta->ps_tx_buf);
        skb_queue_head_init(&sta->tx_filtered);
        __sta_info_get(sta);    /* sta used by caller, decremented by