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/iwlwifi/iwl4965-base.c | |
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/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 7f65d9123b2a..d6fe0ded59d7 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -2912,6 +2912,9 @@ static void iwl4965_config_ap(struct iwl_priv *priv) | |||
2912 | * clear sta table, add BCAST sta... */ | 2912 | * clear sta table, add BCAST sta... */ |
2913 | } | 2913 | } |
2914 | 2914 | ||
2915 | /* temporary */ | ||
2916 | static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb); | ||
2917 | |||
2915 | static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, | 2918 | static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, |
2916 | struct ieee80211_vif *vif, | 2919 | struct ieee80211_vif *vif, |
2917 | struct ieee80211_if_conf *conf) | 2920 | struct ieee80211_if_conf *conf) |
@@ -2929,8 +2932,18 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, | |||
2929 | return 0; | 2932 | return 0; |
2930 | } | 2933 | } |
2931 | 2934 | ||
2935 | if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS && | ||
2936 | conf->changed & IEEE80211_IFCC_BEACON) { | ||
2937 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | ||
2938 | if (!beacon) | ||
2939 | return -ENOMEM; | ||
2940 | rc = iwl4965_mac_beacon_update(hw, beacon); | ||
2941 | if (rc) | ||
2942 | return rc; | ||
2943 | } | ||
2944 | |||
2932 | if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && | 2945 | if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && |
2933 | (!conf->beacon || !conf->ssid_len)) { | 2946 | (!conf->ssid_len)) { |
2934 | IWL_DEBUG_MAC80211 | 2947 | IWL_DEBUG_MAC80211 |
2935 | ("Leaving in AP mode because HostAPD is not ready.\n"); | 2948 | ("Leaving in AP mode because HostAPD is not ready.\n"); |
2936 | return 0; | 2949 | return 0; |
@@ -2962,7 +2975,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, | |||
2962 | if (priv->ibss_beacon) | 2975 | if (priv->ibss_beacon) |
2963 | dev_kfree_skb(priv->ibss_beacon); | 2976 | dev_kfree_skb(priv->ibss_beacon); |
2964 | 2977 | ||
2965 | priv->ibss_beacon = conf->beacon; | 2978 | priv->ibss_beacon = ieee80211_beacon_get(hw, vif); |
2966 | } | 2979 | } |
2967 | 2980 | ||
2968 | if (iwl_is_rfkill(priv)) | 2981 | if (iwl_is_rfkill(priv)) |
@@ -4090,7 +4103,6 @@ static struct ieee80211_ops iwl4965_hw_ops = { | |||
4090 | .get_tx_stats = iwl4965_mac_get_tx_stats, | 4103 | .get_tx_stats = iwl4965_mac_get_tx_stats, |
4091 | .conf_tx = iwl4965_mac_conf_tx, | 4104 | .conf_tx = iwl4965_mac_conf_tx, |
4092 | .reset_tsf = iwl4965_mac_reset_tsf, | 4105 | .reset_tsf = iwl4965_mac_reset_tsf, |
4093 | .beacon_update = iwl4965_mac_beacon_update, | ||
4094 | .bss_info_changed = iwl4965_bss_info_changed, | 4106 | .bss_info_changed = iwl4965_bss_info_changed, |
4095 | .ampdu_action = iwl4965_mac_ampdu_action, | 4107 | .ampdu_action = iwl4965_mac_ampdu_action, |
4096 | .hw_scan = iwl4965_mac_hw_scan | 4108 | .hw_scan = iwl4965_mac_hw_scan |