diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-07-09 08:40:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-14 14:30:07 -0400 |
commit | 9d139c810a2aa17365cc548d0cd2a189d8433c65 (patch) | |
tree | ef10ca55f93689ab97368376d277102d2527c961 /drivers/net/wireless/zd1211rw | |
parent | f3947e2dfa3b18f375b7acd03b7ee2877d0751fc (diff) |
mac80211: revamp beacon configuration
This patch changes mac80211's beacon configuration handling
to never pass skbs to the driver directly but rather always
require the driver to use ieee80211_beacon_get(). Additionally,
it introduces "change flags" on the config_interface() call
to enable drivers to figure out what is changing. Finally, it
removes the beacon_update() driver callback in favour of
having IBSS beacon delivered by ieee80211_beacon_get() as well.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 665f76af2fec..68e2749b2ce8 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -727,15 +727,19 @@ static int zd_op_config_interface(struct ieee80211_hw *hw, | |||
727 | if (mac->type == IEEE80211_IF_TYPE_MESH_POINT || | 727 | if (mac->type == IEEE80211_IF_TYPE_MESH_POINT || |
728 | mac->type == IEEE80211_IF_TYPE_IBSS) { | 728 | mac->type == IEEE80211_IF_TYPE_IBSS) { |
729 | associated = true; | 729 | associated = true; |
730 | if (conf->beacon) { | 730 | if (conf->changed & IEEE80211_IFCC_BEACON) { |
731 | r = zd_mac_config_beacon(hw, conf->beacon); | 731 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); |
732 | |||
733 | if (!beacon) | ||
734 | return -ENOMEM; | ||
735 | r = zd_mac_config_beacon(hw, beacon); | ||
732 | if (r < 0) | 736 | if (r < 0) |
733 | return r; | 737 | return r; |
734 | r = zd_set_beacon_interval(&mac->chip, BCN_MODE_IBSS | | 738 | r = zd_set_beacon_interval(&mac->chip, BCN_MODE_IBSS | |
735 | hw->conf.beacon_int); | 739 | hw->conf.beacon_int); |
736 | if (r < 0) | 740 | if (r < 0) |
737 | return r; | 741 | return r; |
738 | kfree_skb(conf->beacon); | 742 | kfree_skb(beacon); |
739 | } | 743 | } |
740 | } else | 744 | } else |
741 | associated = is_valid_ether_addr(conf->bssid); | 745 | associated = is_valid_ether_addr(conf->bssid); |
@@ -889,17 +893,6 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw, | |||
889 | } | 893 | } |
890 | } | 894 | } |
891 | 895 | ||
892 | static int zd_op_beacon_update(struct ieee80211_hw *hw, | ||
893 | struct sk_buff *skb) | ||
894 | { | ||
895 | struct zd_mac *mac = zd_hw_mac(hw); | ||
896 | zd_mac_config_beacon(hw, skb); | ||
897 | kfree_skb(skb); | ||
898 | zd_set_beacon_interval(&mac->chip, BCN_MODE_IBSS | | ||
899 | hw->conf.beacon_int); | ||
900 | return 0; | ||
901 | } | ||
902 | |||
903 | static const struct ieee80211_ops zd_ops = { | 896 | static const struct ieee80211_ops zd_ops = { |
904 | .tx = zd_op_tx, | 897 | .tx = zd_op_tx, |
905 | .start = zd_op_start, | 898 | .start = zd_op_start, |
@@ -910,7 +903,6 @@ static const struct ieee80211_ops zd_ops = { | |||
910 | .config_interface = zd_op_config_interface, | 903 | .config_interface = zd_op_config_interface, |
911 | .configure_filter = zd_op_configure_filter, | 904 | .configure_filter = zd_op_configure_filter, |
912 | .bss_info_changed = zd_op_bss_info_changed, | 905 | .bss_info_changed = zd_op_bss_info_changed, |
913 | .beacon_update = zd_op_beacon_update, | ||
914 | }; | 906 | }; |
915 | 907 | ||
916 | struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf) | 908 | struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf) |