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/iwl3945-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/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 1a7d18fea89..7d015f86ee8 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6907,6 +6907,9 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv) | |||
6907 | * clear sta table, add BCAST sta... */ | 6907 | * clear sta table, add BCAST sta... */ |
6908 | } | 6908 | } |
6909 | 6909 | ||
6910 | /* temporary */ | ||
6911 | static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb); | ||
6912 | |||
6910 | static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | 6913 | static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, |
6911 | struct ieee80211_vif *vif, | 6914 | struct ieee80211_vif *vif, |
6912 | struct ieee80211_if_conf *conf) | 6915 | struct ieee80211_if_conf *conf) |
@@ -6924,10 +6927,21 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | |||
6924 | return 0; | 6927 | return 0; |
6925 | } | 6928 | } |
6926 | 6929 | ||
6930 | /* handle this temporarily here */ | ||
6931 | if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS && | ||
6932 | conf->changed & IEEE80211_IFCC_BEACON) { | ||
6933 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | ||
6934 | if (!beacon) | ||
6935 | return -ENOMEM; | ||
6936 | rc = iwl3945_mac_beacon_update(hw, beacon); | ||
6937 | if (rc) | ||
6938 | return rc; | ||
6939 | } | ||
6940 | |||
6927 | /* XXX: this MUST use conf->mac_addr */ | 6941 | /* XXX: this MUST use conf->mac_addr */ |
6928 | 6942 | ||
6929 | if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && | 6943 | if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && |
6930 | (!conf->beacon || !conf->ssid_len)) { | 6944 | (!conf->ssid_len)) { |
6931 | IWL_DEBUG_MAC80211 | 6945 | IWL_DEBUG_MAC80211 |
6932 | ("Leaving in AP mode because HostAPD is not ready.\n"); | 6946 | ("Leaving in AP mode because HostAPD is not ready.\n"); |
6933 | return 0; | 6947 | return 0; |
@@ -6959,7 +6973,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | |||
6959 | if (priv->ibss_beacon) | 6973 | if (priv->ibss_beacon) |
6960 | dev_kfree_skb(priv->ibss_beacon); | 6974 | dev_kfree_skb(priv->ibss_beacon); |
6961 | 6975 | ||
6962 | priv->ibss_beacon = conf->beacon; | 6976 | priv->ibss_beacon = ieee80211_beacon_get(hw, vif); |
6963 | } | 6977 | } |
6964 | 6978 | ||
6965 | if (iwl3945_is_rfkill(priv)) | 6979 | if (iwl3945_is_rfkill(priv)) |
@@ -7940,7 +7954,6 @@ static struct ieee80211_ops iwl3945_hw_ops = { | |||
7940 | .conf_tx = iwl3945_mac_conf_tx, | 7954 | .conf_tx = iwl3945_mac_conf_tx, |
7941 | .get_tsf = iwl3945_mac_get_tsf, | 7955 | .get_tsf = iwl3945_mac_get_tsf, |
7942 | .reset_tsf = iwl3945_mac_reset_tsf, | 7956 | .reset_tsf = iwl3945_mac_reset_tsf, |
7943 | .beacon_update = iwl3945_mac_beacon_update, | ||
7944 | .hw_scan = iwl3945_mac_hw_scan | 7957 | .hw_scan = iwl3945_mac_hw_scan |
7945 | }; | 7958 | }; |
7946 | 7959 | ||