mac80211: make CALL_TXH a statement
[safe/jmp/linux-2.6] / net / mac80211 / sta_info.c
index d5611d8..594f231 100644 (file)
  * When the insertion fails (sta_info_insert()) returns non-zero), the
  * structure will have been freed by sta_info_insert()!
  *
+ * sta entries are added by mac80211 when you establish a link with a
+ * peer. This means different things for the different type of interfaces
+ * we support. For a regular station this mean we add the AP sta when we
+ * receive an assocation response from the AP. For IBSS this occurs when
+ * we receive a probe response or a beacon from target IBSS network. For
+ * WDS we add the sta for the peer imediately upon device open. When using
+ * AP mode we add stations for each respective station upon request from
+ * userspace through nl80211.
+ *
  * Because there are debugfs entries for each station, and adding those
  * must be able to sleep, it is also possible to "pin" a station entry,
  * that means it can be removed from the hash table but not be freed.
@@ -340,6 +349,7 @@ int sta_info_insert(struct sta_info *sta)
                goto out_free;
        }
        list_add(&sta->list, &local->sta_list);
+       local->sta_generation++;
        local->num_sta++;
        sta_info_hash_add(local, sta);
 
@@ -351,6 +361,7 @@ int sta_info_insert(struct sta_info *sta)
                                             u.ap);
 
                drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, &sta->sta);
+               sdata = sta->sdata;
        }
 
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -476,6 +487,7 @@ static void __sta_info_unlink(struct sta_info **sta)
        }
 
        local->num_sta--;
+       local->sta_generation++;
 
        if (local->ops->sta_notify) {
                if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -485,6 +497,7 @@ static void __sta_info_unlink(struct sta_info **sta)
 
                drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE,
                               &(*sta)->sta);
+               sdata = (*sta)->sdata;
        }
 
        if (ieee80211_vif_is_mesh(&sdata->vif)) {