diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-11-23 09:09:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-28 14:43:52 -0500 |
commit | bc192f8918ab8e41ba53b9ef881bc425ae92ed1b (patch) | |
tree | a7a0e2e7eefda7fefdd1942821b9d71ab7610a5c /net/mac80211/driver-ops.h | |
parent | 5ccc32ff46065f031075cdbbdfe21b9e3b05aaad (diff) |
mac80211: do not pass AP VLAN vif pointers to drivers
This fixes frequent WARN_ONs when using AP VLAN + aggregation, as these vifs
are virtual and not registered with drivers.
Use sta_info_get_bss instead of sta_info_get in aggregation callbacks, so
that these callbacks can find the station entry when called with the AP vif.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 49cc5e0e8a6a..e8960ae39861 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -10,6 +10,16 @@ static inline void check_sdata_in_driver(struct ieee80211_sub_if_data *sdata) | |||
10 | WARN_ON(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER)); | 10 | WARN_ON(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER)); |
11 | } | 11 | } |
12 | 12 | ||
13 | static inline struct ieee80211_sub_if_data * | ||
14 | get_bss_sdata(struct ieee80211_sub_if_data *sdata) | ||
15 | { | ||
16 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | ||
17 | sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, | ||
18 | u.ap); | ||
19 | |||
20 | return sdata; | ||
21 | } | ||
22 | |||
13 | static inline void drv_tx(struct ieee80211_local *local, struct sk_buff *skb) | 23 | static inline void drv_tx(struct ieee80211_local *local, struct sk_buff *skb) |
14 | { | 24 | { |
15 | local->ops->tx(&local->hw, skb); | 25 | local->ops->tx(&local->hw, skb); |
@@ -421,6 +431,7 @@ static inline void drv_sta_notify(struct ieee80211_local *local, | |||
421 | enum sta_notify_cmd cmd, | 431 | enum sta_notify_cmd cmd, |
422 | struct ieee80211_sta *sta) | 432 | struct ieee80211_sta *sta) |
423 | { | 433 | { |
434 | sdata = get_bss_sdata(sdata); | ||
424 | check_sdata_in_driver(sdata); | 435 | check_sdata_in_driver(sdata); |
425 | 436 | ||
426 | trace_drv_sta_notify(local, sdata, cmd, sta); | 437 | trace_drv_sta_notify(local, sdata, cmd, sta); |
@@ -437,6 +448,7 @@ static inline int drv_sta_add(struct ieee80211_local *local, | |||
437 | 448 | ||
438 | might_sleep(); | 449 | might_sleep(); |
439 | 450 | ||
451 | sdata = get_bss_sdata(sdata); | ||
440 | check_sdata_in_driver(sdata); | 452 | check_sdata_in_driver(sdata); |
441 | 453 | ||
442 | trace_drv_sta_add(local, sdata, sta); | 454 | trace_drv_sta_add(local, sdata, sta); |
@@ -454,6 +466,7 @@ static inline void drv_sta_remove(struct ieee80211_local *local, | |||
454 | { | 466 | { |
455 | might_sleep(); | 467 | might_sleep(); |
456 | 468 | ||
469 | sdata = get_bss_sdata(sdata); | ||
457 | check_sdata_in_driver(sdata); | 470 | check_sdata_in_driver(sdata); |
458 | 471 | ||
459 | trace_drv_sta_remove(local, sdata, sta); | 472 | trace_drv_sta_remove(local, sdata, sta); |
@@ -547,6 +560,7 @@ static inline int drv_ampdu_action(struct ieee80211_local *local, | |||
547 | 560 | ||
548 | might_sleep(); | 561 | might_sleep(); |
549 | 562 | ||
563 | sdata = get_bss_sdata(sdata); | ||
550 | check_sdata_in_driver(sdata); | 564 | check_sdata_in_driver(sdata); |
551 | 565 | ||
552 | trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, buf_size); | 566 | trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, buf_size); |