diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-09-17 01:29:23 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:57 -0400 |
commit | 4150c57212ad134765dd78c654a4b9906252b66d (patch) | |
tree | c37ab7a3f75532a623ed00339782d769514422d2 /drivers/net/wireless/rt2x00/rt2x00.h | |
parent | 070ac3a2651e3c1c4d277c5f1981517427c386a7 (diff) |
[PATCH] mac80211: revamp interface and filter configuration
Drivers are currently supposed to keep track of monitor
interfaces if they allow so-called "hard" monitor, and
they are also supposed to keep track of multicast etc.
This patch changes that, replaces the set_multicast_list()
callback with a new configure_filter() callback that takes
filter flags (FIF_*) instead of interface flags (IFF_*).
For a driver, this means it should open the filter as much
as necessary to get all frames requested by the filter flags.
Accordingly, the filter flags are named "positively", e.g.
FIF_ALLMULTI.
Multicast filtering is a bit special in that drivers that
have no multicast address filters need to allow multicast
frames through when either the FIF_ALLMULTI flag is set or
when the mc_count value is positive.
At the same time, drivers are no longer notified about
monitor interfaces at all, this means they now need to
implement the start() and stop() callbacks and the new
change_filter_flags() callback. Also, the start()/stop()
ordering changed, start() is now called *before* any
add_interface() as it really should be, and stop() after
any remove_interface().
The patch also changes the behaviour of setting the bssid
to multicast for scanning when IEEE80211_HW_NO_PROBE_FILTERING
is set; the IEEE80211_HW_NO_PROBE_FILTERING flag is removed
and the filter flag FIF_BCN_PRBRESP_PROMISC introduced.
This is a lot more efficient for hardware like b43 that
supports it and other hardware can still set the BSSID
to all-ones.
Driver modifications by Johannes Berg (b43 & iwlwifi), Michael Wu
(rtl8187, adm8211, and p54), Larry Finger (b43legacy), and
Ivo van Doorn (rt2x00).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 80b079d723d6..046eecfb16c0 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -294,9 +294,6 @@ struct interface { | |||
294 | 294 | ||
295 | /* | 295 | /* |
296 | * Current working type (IEEE80211_IF_TYPE_*). | 296 | * Current working type (IEEE80211_IF_TYPE_*). |
297 | * This excludes the type IEEE80211_IF_TYPE_MNTR | ||
298 | * since that is counted seperately in the monitor_count | ||
299 | * field. | ||
300 | * When set to INVALID_INTERFACE, no interface is configured. | 297 | * When set to INVALID_INTERFACE, no interface is configured. |
301 | */ | 298 | */ |
302 | int type; | 299 | int type; |
@@ -314,18 +311,8 @@ struct interface { | |||
314 | 311 | ||
315 | /* | 312 | /* |
316 | * Store the packet filter mode for the current interface. | 313 | * Store the packet filter mode for the current interface. |
317 | * monitor mode always disabled filtering. But in such | ||
318 | * cases we still need to store the value here in case | ||
319 | * the monitor mode interfaces are removed, while a | ||
320 | * non-monitor mode interface remains. | ||
321 | */ | 314 | */ |
322 | unsigned short filter; | 315 | unsigned int filter; |
323 | |||
324 | /* | ||
325 | * Monitor mode count, the number of interfaces | ||
326 | * in monitor mode that that have been added. | ||
327 | */ | ||
328 | unsigned short monitor_count; | ||
329 | }; | 316 | }; |
330 | 317 | ||
331 | static inline int is_interface_present(struct interface *intf) | 318 | static inline int is_interface_present(struct interface *intf) |
@@ -333,9 +320,9 @@ static inline int is_interface_present(struct interface *intf) | |||
333 | return !!intf->id; | 320 | return !!intf->id; |
334 | } | 321 | } |
335 | 322 | ||
336 | static inline int is_monitor_present(struct interface *intf) | 323 | static inline int is_interface_type(struct interface *intf, int type) |
337 | { | 324 | { |
338 | return !!intf->monitor_count; | 325 | return intf->type == type; |
339 | } | 326 | } |
340 | 327 | ||
341 | /* | 328 | /* |
@@ -402,7 +389,7 @@ struct rt2x00lib_ops { | |||
402 | */ | 389 | */ |
403 | void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, | 390 | void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, |
404 | struct data_desc *txd, | 391 | struct data_desc *txd, |
405 | struct data_entry_desc *desc, | 392 | struct txdata_entry_desc *desc, |
406 | struct ieee80211_hdr *ieee80211hdr, | 393 | struct ieee80211_hdr *ieee80211hdr, |
407 | unsigned int length, | 394 | unsigned int length, |
408 | struct ieee80211_tx_control *control); | 395 | struct ieee80211_tx_control *control); |
@@ -415,8 +402,8 @@ struct rt2x00lib_ops { | |||
415 | /* | 402 | /* |
416 | * RX control handlers | 403 | * RX control handlers |
417 | */ | 404 | */ |
418 | int (*fill_rxdone) (struct data_entry *entry, | 405 | void (*fill_rxdone) (struct data_entry *entry, |
419 | int *signal, int *rssi, int *ofdm, int *size); | 406 | struct rxdata_entry_desc *desc); |
420 | 407 | ||
421 | /* | 408 | /* |
422 | * Configuration handlers. | 409 | * Configuration handlers. |
@@ -511,11 +498,10 @@ struct rt2x00_dev { | |||
511 | #define DEVICE_INITIALIZED 3 | 498 | #define DEVICE_INITIALIZED 3 |
512 | #define DEVICE_INITIALIZED_HW 4 | 499 | #define DEVICE_INITIALIZED_HW 4 |
513 | #define REQUIRE_FIRMWARE 5 | 500 | #define REQUIRE_FIRMWARE 5 |
514 | #define PACKET_FILTER_SCHEDULED 6 | 501 | /* Hole: Add new Flag here */ |
515 | #define PACKET_FILTER_PENDING 7 | ||
516 | #define INTERFACE_RESUME 8 | 502 | #define INTERFACE_RESUME 8 |
517 | #define INTERFACE_ENABLED 9 | 503 | #define INTERFACE_ENABLED 9 |
518 | #define INTERFACE_ENABLED_MONITOR 10 | 504 | /* Hole: Add new Flag here */ |
519 | #define REQUIRE_BEACON_RING 11 | 505 | #define REQUIRE_BEACON_RING 11 |
520 | #define DEVICE_SUPPORT_HW_BUTTON 12 | 506 | #define DEVICE_SUPPORT_HW_BUTTON 12 |
521 | #define CONFIG_FRAME_TYPE 13 | 507 | #define CONFIG_FRAME_TYPE 13 |
@@ -606,9 +592,10 @@ struct rt2x00_dev { | |||
606 | struct ieee80211_rx_status rx_status; | 592 | struct ieee80211_rx_status rx_status; |
607 | 593 | ||
608 | /* | 594 | /* |
609 | * Beacon scheduled work. | 595 | * Scheduled work. |
610 | */ | 596 | */ |
611 | struct work_struct beacon_work; | 597 | struct work_struct beacon_work; |
598 | struct work_struct filter_work; | ||
612 | 599 | ||
613 | /* | 600 | /* |
614 | * Data ring arrays for RX, TX and Beacon. | 601 | * Data ring arrays for RX, TX and Beacon. |
@@ -760,7 +747,7 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev); | |||
760 | void rt2x00lib_txdone(struct data_entry *entry, | 747 | void rt2x00lib_txdone(struct data_entry *entry, |
761 | const int status, const int retry); | 748 | const int status, const int retry); |
762 | void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb, | 749 | void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb, |
763 | const int signal, const int rssi, const int ofdm); | 750 | struct rxdata_entry_desc *desc); |
764 | 751 | ||
765 | /* | 752 | /* |
766 | * TX descriptor initializer | 753 | * TX descriptor initializer |
@@ -785,8 +772,6 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw, | |||
785 | int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf); | 772 | int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf); |
786 | int rt2x00mac_config_interface(struct ieee80211_hw *hw, int if_id, | 773 | int rt2x00mac_config_interface(struct ieee80211_hw *hw, int if_id, |
787 | struct ieee80211_if_conf *conf); | 774 | struct ieee80211_if_conf *conf); |
788 | void rt2x00mac_set_multicast_list(struct ieee80211_hw *hw, | ||
789 | unsigned short flags, int mc_count); | ||
790 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, | 775 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, |
791 | struct ieee80211_low_level_stats *stats); | 776 | struct ieee80211_low_level_stats *stats); |
792 | int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw, | 777 | int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw, |