diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 10:13:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:36 -0400 |
commit | 2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (patch) | |
tree | 9bf3cdfcbbefcb34f5984e6d797f488ebe358196 /drivers/net/wireless/zd1211rw/zd_mac.c | |
parent | 57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (diff) |
mac80211: unify config_interface and bss_info_changed
The config_interface method is a little strange, it contains the
BSSID and beacon updates, while bss_info_changed contains most
other BSS information for each interface. This patch removes
config_interface and rolls all the information it previously
passed to drivers into bss_info_changed.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_mac.c')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 80 |
1 files changed, 33 insertions, 47 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index c3a51266de20..6bdb1704083b 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -755,52 +755,6 @@ static int zd_op_config(struct ieee80211_hw *hw, u32 changed) | |||
755 | return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); | 755 | return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); |
756 | } | 756 | } |
757 | 757 | ||
758 | static int zd_op_config_interface(struct ieee80211_hw *hw, | ||
759 | struct ieee80211_vif *vif, | ||
760 | struct ieee80211_if_conf *conf) | ||
761 | { | ||
762 | struct zd_mac *mac = zd_hw_mac(hw); | ||
763 | int associated; | ||
764 | int r; | ||
765 | |||
766 | if (mac->type == NL80211_IFTYPE_MESH_POINT || | ||
767 | mac->type == NL80211_IFTYPE_ADHOC) { | ||
768 | associated = true; | ||
769 | if (conf->changed & IEEE80211_IFCC_BEACON) { | ||
770 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | ||
771 | |||
772 | if (!beacon) | ||
773 | return -ENOMEM; | ||
774 | r = zd_mac_config_beacon(hw, beacon); | ||
775 | kfree_skb(beacon); | ||
776 | |||
777 | if (r < 0) | ||
778 | return r; | ||
779 | } | ||
780 | |||
781 | if (conf->changed & IEEE80211_IFCC_BEACON_ENABLED) { | ||
782 | u32 interval; | ||
783 | |||
784 | if (conf->enable_beacon) | ||
785 | interval = BCN_MODE_IBSS | hw->conf.beacon_int; | ||
786 | else | ||
787 | interval = 0; | ||
788 | |||
789 | r = zd_set_beacon_interval(&mac->chip, interval); | ||
790 | if (r < 0) | ||
791 | return r; | ||
792 | } | ||
793 | } else | ||
794 | associated = is_valid_ether_addr(conf->bssid); | ||
795 | |||
796 | spin_lock_irq(&mac->lock); | ||
797 | mac->associated = associated; | ||
798 | spin_unlock_irq(&mac->lock); | ||
799 | |||
800 | /* TODO: do hardware bssid filtering */ | ||
801 | return 0; | ||
802 | } | ||
803 | |||
804 | static void zd_process_intr(struct work_struct *work) | 758 | static void zd_process_intr(struct work_struct *work) |
805 | { | 759 | { |
806 | u16 int_status; | 760 | u16 int_status; |
@@ -923,9 +877,42 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw, | |||
923 | { | 877 | { |
924 | struct zd_mac *mac = zd_hw_mac(hw); | 878 | struct zd_mac *mac = zd_hw_mac(hw); |
925 | unsigned long flags; | 879 | unsigned long flags; |
880 | int associated; | ||
926 | 881 | ||
927 | dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes); | 882 | dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes); |
928 | 883 | ||
884 | if (mac->type == NL80211_IFTYPE_MESH_POINT || | ||
885 | mac->type == NL80211_IFTYPE_ADHOC) { | ||
886 | associated = true; | ||
887 | if (changes & BSS_CHANGED_BEACON) { | ||
888 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | ||
889 | |||
890 | if (beacon) { | ||
891 | zd_mac_config_beacon(hw, beacon); | ||
892 | kfree_skb(beacon); | ||
893 | } | ||
894 | } | ||
895 | |||
896 | if (changes & BSS_CHANGED_BEACON_ENABLED) { | ||
897 | u32 interval; | ||
898 | |||
899 | if (bss_conf->enable_beacon) | ||
900 | interval = BCN_MODE_IBSS | | ||
901 | bss_conf->beacon_int; | ||
902 | else | ||
903 | interval = 0; | ||
904 | |||
905 | zd_set_beacon_interval(&mac->chip, interval); | ||
906 | } | ||
907 | } else | ||
908 | associated = is_valid_ether_addr(bss_conf->bssid); | ||
909 | |||
910 | spin_lock_irq(&mac->lock); | ||
911 | mac->associated = associated; | ||
912 | spin_unlock_irq(&mac->lock); | ||
913 | |||
914 | /* TODO: do hardware bssid filtering */ | ||
915 | |||
929 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { | 916 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { |
930 | spin_lock_irqsave(&mac->lock, flags); | 917 | spin_lock_irqsave(&mac->lock, flags); |
931 | mac->short_preamble = bss_conf->use_short_preamble; | 918 | mac->short_preamble = bss_conf->use_short_preamble; |
@@ -952,7 +939,6 @@ static const struct ieee80211_ops zd_ops = { | |||
952 | .add_interface = zd_op_add_interface, | 939 | .add_interface = zd_op_add_interface, |
953 | .remove_interface = zd_op_remove_interface, | 940 | .remove_interface = zd_op_remove_interface, |
954 | .config = zd_op_config, | 941 | .config = zd_op_config, |
955 | .config_interface = zd_op_config_interface, | ||
956 | .configure_filter = zd_op_configure_filter, | 942 | .configure_filter = zd_op_configure_filter, |
957 | .bss_info_changed = zd_op_bss_info_changed, | 943 | .bss_info_changed = zd_op_bss_info_changed, |
958 | .get_tsf = zd_op_get_tsf, | 944 | .get_tsf = zd_op_get_tsf, |