diff options
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r-- | net/mac80211/sta_info.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index b4810f6aa94f..c8208236e896 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -403,9 +403,34 @@ static inline u32 get_sta_flags(struct sta_info *sta) | |||
403 | #define STA_INFO_CLEANUP_INTERVAL (10 * HZ) | 403 | #define STA_INFO_CLEANUP_INTERVAL (10 * HZ) |
404 | 404 | ||
405 | /* | 405 | /* |
406 | * Get a STA info, must have be under RCU read lock. | 406 | * Get a STA info, must be under RCU read lock. |
407 | */ | 407 | */ |
408 | struct sta_info *sta_info_get(struct ieee80211_local *local, const u8 *addr); | 408 | struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, |
409 | const u8 *addr); | ||
410 | |||
411 | static inline | ||
412 | void for_each_sta_info_type_check(struct ieee80211_local *local, | ||
413 | const u8 *addr, | ||
414 | struct sta_info *sta, | ||
415 | struct sta_info *nxt) | ||
416 | { | ||
417 | } | ||
418 | |||
419 | #define for_each_sta_info(local, _addr, sta, nxt) \ | ||
420 | for ( /* initialise loop */ \ | ||
421 | sta = rcu_dereference(local->sta_hash[STA_HASH(_addr)]),\ | ||
422 | nxt = sta ? rcu_dereference(sta->hnext) : NULL; \ | ||
423 | /* typecheck */ \ | ||
424 | for_each_sta_info_type_check(local, (_addr), sta, nxt), \ | ||
425 | /* continue condition */ \ | ||
426 | sta; \ | ||
427 | /* advance loop */ \ | ||
428 | sta = nxt, \ | ||
429 | nxt = sta ? rcu_dereference(sta->hnext) : NULL \ | ||
430 | ) \ | ||
431 | /* compare address and run code only if it matches */ \ | ||
432 | if (memcmp(sta->sta.addr, (_addr), ETH_ALEN) == 0) | ||
433 | |||
409 | /* | 434 | /* |
410 | * Get STA info by index, BROKEN! | 435 | * Get STA info by index, BROKEN! |
411 | */ | 436 | */ |