]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/sta_info.c
Merge branches 'release' and 'ppc-workaround' into release
[linux-2.6-omap-h63xx.git] / net / mac80211 / sta_info.c
index 60ca07804056c7a00f1d4f6bb2c996347007c7bd..1f74bd296357bd8785acff1816a635dc98e34d2e 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
@@ -163,9 +177,16 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
        list_add(&sta->list, &local->sta_list);
        local->num_sta++;
        sta_info_hash_add(local, sta);
-       if (local->ops->sta_notify)
-               local->ops->sta_notify(local_to_hw(local), dev->ifindex,
-                                       STA_NOTIFY_ADD, addr);
+       if (local->ops->sta_notify) {
+               struct ieee80211_sub_if_data *sdata;
+
+               sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
+                       sdata = sdata->u.vlan.ap;
+
+               local->ops->sta_notify(local_to_hw(local), &sdata->vif,
+                                      STA_NOTIFY_ADD, addr);
+       }
        write_unlock_bh(&local->sta_lock);
 
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -233,9 +254,17 @@ void sta_info_free(struct sta_info *sta)
        ieee80211_key_free(sta->key);
        sta->key = NULL;
 
-       if (local->ops->sta_notify)
-               local->ops->sta_notify(local_to_hw(local), sta->dev->ifindex,
-                                       STA_NOTIFY_REMOVE, sta->addr);
+       if (local->ops->sta_notify) {
+               struct ieee80211_sub_if_data *sdata;
+
+               sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
+
+               if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN)
+                       sdata = sdata->u.vlan.ap;
+
+               local->ops->sta_notify(local_to_hw(local), &sdata->vif,
+                                      STA_NOTIFY_REMOVE, sta->addr);
+       }
 
        rate_control_remove_sta_debugfs(sta);
        ieee80211_sta_debugfs_remove(sta);