• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/net/mac80211/

Lines Matching refs:sta

27 			      struct sta_info *sta)
29 sta->hnext = local->sta_hash[STA_HASH(sta->addr)];
30 local->sta_hash[STA_HASH(sta->addr)] = sta;
36 struct sta_info *sta)
40 s = local->sta_hash[STA_HASH(sta->addr)];
43 if (memcmp(s->addr, sta->addr, ETH_ALEN) == 0) {
44 local->sta_hash[STA_HASH(sta->addr)] = s->hnext;
48 while (s->hnext && memcmp(s->hnext->addr, sta->addr, ETH_ALEN) != 0)
54 "hash table\n", local->mdev->name, MAC_ARG(sta->addr));
57 static inline void __sta_info_get(struct sta_info *sta)
59 kref_get(&sta->kref);
64 struct sta_info *sta;
67 sta = local->sta_hash[STA_HASH(addr)];
68 while (sta) {
69 if (memcmp(sta->addr, addr, ETH_ALEN) == 0) {
70 __sta_info_get(sta);
73 sta = sta->hnext;
77 return sta;
83 struct sta_info *sta;
91 sta = local->sta_hash[i];
92 while (sta) {
93 if (sta->txrate < min_txrate)
94 min_txrate = sta->txrate;
95 sta = sta->hnext;
108 struct sta_info *sta = container_of(kref, struct sta_info, kref);
109 struct ieee80211_local *local = sta->local;
112 /* free sta structure; it has already been removed from
116 while ((skb = skb_dequeue(&sta->ps_tx_buf)) != NULL) {
120 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) {
123 rate_control_free_sta(sta->rate_ctrl, sta->rate_ctrl_priv);
124 rate_control_put(sta->rate_ctrl);
125 if (sta->key)
126 ieee80211_debugfs_key_sta_del(sta->key, sta);
127 kfree(sta);
131 void sta_info_put(struct sta_info *sta)
133 kref_put(&sta->kref, sta_info_release);
141 struct sta_info *sta;
143 sta = kzalloc(sizeof(*sta), gfp);
144 if (!sta)
147 kref_init(&sta->kref);
149 sta->rate_ctrl = rate_control_get(local->rate_ctrl);
150 sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, gfp);
151 if (!sta->rate_ctrl_priv) {
152 rate_control_put(sta->rate_ctrl);
153 kref_put(&sta->kref, sta_info_release);
154 kfree(sta);
158 memcpy(sta->addr, addr, ETH_ALEN);
159 sta->local = local;
160 sta->dev = dev;
161 skb_queue_head_init(&sta->ps_tx_buf);
162 skb_queue_head_init(&sta->tx_filtered);
163 __sta_info_get(sta); /* sta used by caller, decremented by
166 list_add(&sta->list, &local->sta_list);
168 sta_info_hash_add(local, sta);
173 sta->key_idx_compression = HW_KEY_IDX_INVALID;
182 sta->debugfs_registered = 1;
183 ieee80211_sta_debugfs_add(sta);
184 rate_control_add_sta_debugfs(sta);
193 return sta;
197 struct sta_info *sta)
201 local->mdev->name, MAC_ARG(sta->addr));
204 if (sta->key) {
205 ieee80211_debugfs_key_remove(sta->key);
206 ieee80211_key_free(sta->key);
207 sta->key = NULL;
210 rate_control_remove_sta_debugfs(sta);
211 ieee80211_sta_debugfs_remove(sta);
213 sta_info_put(sta);
216 static void sta_info_remove(struct sta_info *sta)
218 struct ieee80211_local *local = sta->local;
221 sta_info_hash_del(local, sta);
222 list_del(&sta->list);
223 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
224 if (sta->flags & WLAN_STA_PS) {
225 sta->flags &= ~WLAN_STA_PS;
230 sta_info_remove_aid_ptr(sta);
233 void sta_info_free(struct sta_info *sta, int locked)
236 struct ieee80211_local *local = sta->local;
240 sta_info_remove(sta);
243 sta_info_remove(sta);
249 while ((skb = skb_dequeue(&sta->ps_tx_buf)) != NULL) {
253 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) {
257 if (sta->key) {
260 key = ieee80211_key_data2conf(local, sta->key);
264 sta->addr, key, sta->aid);
268 } else if (sta->key_idx_compression != HW_KEY_IDX_INVALID) {
271 conf.hw_key_idx = sta->key_idx_compression;
275 sta->addr, &conf, sta->aid);
276 sta->key_idx_compression = HW_KEY_IDX_INVALID;
281 list_add(&sta->list, &local->deleted_sta_list);
285 finish_sta_info_free(local, sta);
290 struct sta_info *sta,
302 timeout = (sta->listen_interval * local->hw.conf.beacon_int * 32 /
311 struct sta_info *sta)
316 if (skb_queue_empty(&sta->ps_tx_buf))
320 spin_lock_irqsave(&sta->ps_tx_buf.lock, flags);
321 skb = skb_peek(&sta->ps_tx_buf);
322 if (sta_info_buffer_expired(local, sta, skb)) {
323 skb = __skb_dequeue(&sta->ps_tx_buf);
324 if (skb_queue_empty(&sta->ps_tx_buf))
325 sta->flags &= ~WLAN_STA_TIM;
328 spin_unlock_irqrestore(&sta->ps_tx_buf.lock, flags);
333 MAC_FMT ")\n", MAC_ARG(sta->addr));
344 struct sta_info *sta;
347 list_for_each_entry(sta, &local->sta_list, list) {
348 __sta_info_get(sta);
349 sta_info_cleanup_expire_buffered(local, sta);
350 sta_info_put(sta);
363 struct sta_info *sta, *tmp;
368 sta = list_entry(local->deleted_sta_list.next,
372 sta = NULL;
374 if (!sta)
376 finish_sta_info_free(local, sta);
380 sta = NULL;
384 sta = tmp;
385 __sta_info_get(sta);
391 if (!sta)
394 sta->debugfs_registered = 1;
395 ieee80211_sta_debugfs_add(sta);
396 rate_control_add_sta_debugfs(sta);
397 sta_info_put(sta);
426 struct sta_info *sta, *tmp;
430 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
432 * parameter to ensure all debugfs sta entries are
435 sta_info_free(sta, 0);
439 void sta_info_remove_aid_ptr(struct sta_info *sta)
443 if (sta->aid <= 0)
446 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
450 sta->aid, 0);
452 __bss_tim_clear(sdata->bss, sta->aid);
459 * @dev: matching rule for the net device (sta->dev) or %NULL to match all STAs
463 struct sta_info *sta, *tmp;
466 list_for_each_entry_safe(sta, tmp, &local->sta_list, list)
467 if (!dev || dev == sta->dev)
468 sta_info_free(sta, 1);