aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-09 06:18:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:07 -0400
commite8975581f63870be42ff4662b293d1b0c8c21350 (patch)
tree3d0d67e73d009ea6480b459585c0a70fc35fa9da /drivers/net
parent0f4ac38b5999c3d51adad52d61c56c1b99c247ec (diff)
mac80211: introduce hw config change flags
This makes mac80211 notify the driver which configuration actually changed, e.g. channel etc. No driver changes, this is just plumbing, driver authors are expected to act on this if they want to. Also remove the HW CONFIG debug printk, it's incorrect, often we configure something else. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/adm8211.c3
-rw-r--r--drivers/net/wireless/ath5k/base.c7
-rw-r--r--drivers/net/wireless/ath9k/main.c4
-rw-r--r--drivers/net/wireless/b43/main.c3
-rw-r--r--drivers/net/wireless/b43legacy/main.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c7
-rw-r--r--drivers/net/wireless/libertas_tf/main.c4
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c4
-rw-r--r--drivers/net/wireless/p54/p54common.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c3
-rw-r--r--drivers/net/wireless/rtl8180_dev.c3
-rw-r--r--drivers/net/wireless/rtl8187_dev.c3
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c4
16 files changed, 35 insertions, 23 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 6e18c9d36787..9a1e0c514c08 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1314,9 +1314,10 @@ static int adm8211_set_ssid(struct ieee80211_hw *dev, u8 *ssid, size_t ssid_len)
1314 return 0; 1314 return 0;
1315} 1315}
1316 1316
1317static int adm8211_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) 1317static int adm8211_config(struct ieee80211_hw *dev, u32 changed)
1318{ 1318{
1319 struct adm8211_priv *priv = dev->priv; 1319 struct adm8211_priv *priv = dev->priv;
1320 struct ieee80211_conf *conf = &dev->conf;
1320 int channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 1321 int channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
1321 1322
1322 if (channel != priv->channel) { 1323 if (channel != priv->channel) {
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 9e47d727e220..fcd688765d04 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -219,8 +219,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
219 struct ieee80211_if_init_conf *conf); 219 struct ieee80211_if_init_conf *conf);
220static void ath5k_remove_interface(struct ieee80211_hw *hw, 220static void ath5k_remove_interface(struct ieee80211_hw *hw,
221 struct ieee80211_if_init_conf *conf); 221 struct ieee80211_if_init_conf *conf);
222static int ath5k_config(struct ieee80211_hw *hw, 222static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
223 struct ieee80211_conf *conf);
224static int ath5k_config_interface(struct ieee80211_hw *hw, 223static int ath5k_config_interface(struct ieee80211_hw *hw,
225 struct ieee80211_vif *vif, 224 struct ieee80211_vif *vif,
226 struct ieee80211_if_conf *conf); 225 struct ieee80211_if_conf *conf);
@@ -2780,10 +2779,10 @@ end:
2780 * TODO: Phy disable/diversity etc 2779 * TODO: Phy disable/diversity etc
2781 */ 2780 */
2782static int 2781static int
2783ath5k_config(struct ieee80211_hw *hw, 2782ath5k_config(struct ieee80211_hw *hw, u32 changed)
2784 struct ieee80211_conf *conf)
2785{ 2783{
2786 struct ath5k_softc *sc = hw->priv; 2784 struct ath5k_softc *sc = hw->priv;
2785 struct ieee80211_conf *conf = &hw->conf;
2787 2786
2788 sc->bintval = conf->beacon_int; 2787 sc->bintval = conf->beacon_int;
2789 sc->power_level = conf->power_level; 2788 sc->power_level = conf->power_level;
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 5e087c92a6d9..f49910799ede 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1230,11 +1230,11 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1230 __func__, error); 1230 __func__, error);
1231} 1231}
1232 1232
1233static int ath9k_config(struct ieee80211_hw *hw, 1233static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1234 struct ieee80211_conf *conf)
1235{ 1234{
1236 struct ath_softc *sc = hw->priv; 1235 struct ath_softc *sc = hw->priv;
1237 struct ieee80211_channel *curchan = hw->conf.channel; 1236 struct ieee80211_channel *curchan = hw->conf.channel;
1237 struct ieee80211_conf *conf = &hw->conf;
1238 int pos; 1238 int pos;
1239 1239
1240 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n", 1240 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n",
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 6b85428b0e1d..2e81af1022e4 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3320,11 +3320,12 @@ init_failure:
3320 return err; 3320 return err;
3321} 3321}
3322 3322
3323static int b43_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) 3323static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3324{ 3324{
3325 struct b43_wl *wl = hw_to_b43_wl(hw); 3325 struct b43_wl *wl = hw_to_b43_wl(hw);
3326 struct b43_wldev *dev; 3326 struct b43_wldev *dev;
3327 struct b43_phy *phy; 3327 struct b43_phy *phy;
3328 struct ieee80211_conf *conf = &hw->conf;
3328 unsigned long flags; 3329 unsigned long flags;
3329 int antenna; 3330 int antenna;
3330 int err = 0; 3331 int err = 0;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 867f01ce45c7..793cc396562f 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2557,11 +2557,12 @@ init_failure:
2557} 2557}
2558 2558
2559static int b43legacy_op_dev_config(struct ieee80211_hw *hw, 2559static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2560 struct ieee80211_conf *conf) 2560 u32 changed)
2561{ 2561{
2562 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 2562 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
2563 struct b43legacy_wldev *dev; 2563 struct b43legacy_wldev *dev;
2564 struct b43legacy_phy *phy; 2564 struct b43legacy_phy *phy;
2565 struct ieee80211_conf *conf = &hw->conf;
2565 unsigned long flags; 2566 unsigned long flags;
2566 unsigned int new_phymode = 0xFFFF; 2567 unsigned int new_phymode = 0xFFFF;
2567 int antenna_tx; 2568 int antenna_tx;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e6695e80fb53..79a24410dd0a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2734,10 +2734,11 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw,
2734 * be set inappropriately and the driver currently sets the hardware up to 2734 * be set inappropriately and the driver currently sets the hardware up to
2735 * use it whenever needed. 2735 * use it whenever needed.
2736 */ 2736 */
2737static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) 2737static int iwl4965_mac_config(struct ieee80211_hw *hw, u32 changed)
2738{ 2738{
2739 struct iwl_priv *priv = hw->priv; 2739 struct iwl_priv *priv = hw->priv;
2740 const struct iwl_channel_info *ch_info; 2740 const struct iwl_channel_info *ch_info;
2741 struct ieee80211_conf *conf = &hw->conf;
2741 unsigned long flags; 2742 unsigned long flags;
2742 int ret = 0; 2743 int ret = 0;
2743 u16 channel; 2744 u16 channel;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index d3a2966d9181..b1464c71ea0a 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6415,7 +6415,7 @@ static void iwl3945_bg_abort_scan(struct work_struct *work)
6415 mutex_unlock(&priv->mutex); 6415 mutex_unlock(&priv->mutex);
6416} 6416}
6417 6417
6418static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 6418static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed);
6419 6419
6420static void iwl3945_bg_scan_completed(struct work_struct *work) 6420static void iwl3945_bg_scan_completed(struct work_struct *work)
6421{ 6421{
@@ -6428,7 +6428,7 @@ static void iwl3945_bg_scan_completed(struct work_struct *work)
6428 return; 6428 return;
6429 6429
6430 if (test_bit(STATUS_CONF_PENDING, &priv->status)) 6430 if (test_bit(STATUS_CONF_PENDING, &priv->status))
6431 iwl3945_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw)); 6431 iwl3945_mac_config(priv->hw, 0);
6432 6432
6433 ieee80211_scan_completed(priv->hw); 6433 ieee80211_scan_completed(priv->hw);
6434 6434
@@ -6616,10 +6616,11 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
6616 * be set inappropriately and the driver currently sets the hardware up to 6616 * be set inappropriately and the driver currently sets the hardware up to
6617 * use it whenever needed. 6617 * use it whenever needed.
6618 */ 6618 */
6619static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) 6619static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
6620{ 6620{
6621 struct iwl3945_priv *priv = hw->priv; 6621 struct iwl3945_priv *priv = hw->priv;
6622 const struct iwl3945_channel_info *ch_info; 6622 const struct iwl3945_channel_info *ch_info;
6623 struct ieee80211_conf *conf = &hw->conf;
6623 unsigned long flags; 6624 unsigned long flags;
6624 int ret = 0; 6625 int ret = 0;
6625 6626
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index feff945ad856..241ddcfa352e 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -354,9 +354,11 @@ static void lbtf_op_remove_interface(struct ieee80211_hw *hw,
354 priv->vif = NULL; 354 priv->vif = NULL;
355} 355}
356 356
357static int lbtf_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) 357static int lbtf_op_config(struct ieee80211_hw *hw, u32 changed)
358{ 358{
359 struct lbtf_private *priv = hw->priv; 359 struct lbtf_private *priv = hw->priv;
360 struct ieee80211_conf *conf = &hw->conf;
361
360 if (conf->channel->center_freq != priv->cur_freq) { 362 if (conf->channel->center_freq != priv->cur_freq) {
361 priv->cur_freq = conf->channel->center_freq; 363 priv->cur_freq = conf->channel->center_freq;
362 lbtf_set_channel(priv, conf->channel->hw_value); 364 lbtf_set_channel(priv, conf->channel->hw_value);
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 3f236b546683..e2aeef8de707 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -359,10 +359,10 @@ static void mac80211_hwsim_beacon(unsigned long arg)
359} 359}
360 360
361 361
362static int mac80211_hwsim_config(struct ieee80211_hw *hw, 362static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
363 struct ieee80211_conf *conf)
364{ 363{
365 struct mac80211_hwsim_data *data = hw->priv; 364 struct mac80211_hwsim_data *data = hw->priv;
365 struct ieee80211_conf *conf = &hw->conf;
366 366
367 printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d beacon_int=%d)\n", 367 printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d beacon_int=%d)\n",
368 wiphy_name(hw->wiphy), __func__, 368 wiphy_name(hw->wiphy), __func__,
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index b3e75eb4d5ba..b3c297ed00cd 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -1192,10 +1192,11 @@ static void p54_remove_interface(struct ieee80211_hw *dev,
1192 p54_set_filter(dev, 0, NULL); 1192 p54_set_filter(dev, 0, NULL);
1193} 1193}
1194 1194
1195static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) 1195static int p54_config(struct ieee80211_hw *dev, u32 changed)
1196{ 1196{
1197 int ret; 1197 int ret;
1198 struct p54_common *priv = dev->priv; 1198 struct p54_common *priv = dev->priv;
1199 struct ieee80211_conf *conf = &dev->conf;
1199 1200
1200 mutex_lock(&priv->conf_mutex); 1201 mutex_lock(&priv->conf_mutex);
1201 priv->rx_antenna = 2; /* automatic */ 1202 priv->rx_antenna = 2; /* automatic */
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 1359a3768404..8ec8f7e9ec64 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -997,7 +997,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
997 struct ieee80211_if_init_conf *conf); 997 struct ieee80211_if_init_conf *conf);
998void rt2x00mac_remove_interface(struct ieee80211_hw *hw, 998void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
999 struct ieee80211_if_init_conf *conf); 999 struct ieee80211_if_init_conf *conf);
1000int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1000int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed);
1001int rt2x00mac_config_interface(struct ieee80211_hw *hw, 1001int rt2x00mac_config_interface(struct ieee80211_hw *hw,
1002 struct ieee80211_vif *vif, 1002 struct ieee80211_vif *vif,
1003 struct ieee80211_if_conf *conf); 1003 struct ieee80211_if_conf *conf);
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 9e0472bd1edf..697806cf94e2 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1245,7 +1245,7 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
1245 /* 1245 /*
1246 * Reconfigure device. 1246 * Reconfigure device.
1247 */ 1247 */
1248 retval = rt2x00mac_config(rt2x00dev->hw, &rt2x00dev->hw->conf); 1248 retval = rt2x00mac_config(rt2x00dev->hw, ~0);
1249 if (retval) 1249 if (retval)
1250 goto exit; 1250 goto exit;
1251 1251
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 2c6cc5c374ff..da7b49a364ff 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -335,9 +335,10 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
335} 335}
336EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface); 336EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface);
337 337
338int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) 338int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
339{ 339{
340 struct rt2x00_dev *rt2x00dev = hw->priv; 340 struct rt2x00_dev *rt2x00dev = hw->priv;
341 struct ieee80211_conf *conf = &hw->conf;
341 int radio_on; 342 int radio_on;
342 int status; 343 int status;
343 344
diff --git a/drivers/net/wireless/rtl8180_dev.c b/drivers/net/wireless/rtl8180_dev.c
index 9de8f57486df..e8d22393797f 100644
--- a/drivers/net/wireless/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl8180_dev.c
@@ -692,9 +692,10 @@ static void rtl8180_remove_interface(struct ieee80211_hw *dev,
692 priv->vif = NULL; 692 priv->vif = NULL;
693} 693}
694 694
695static int rtl8180_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) 695static int rtl8180_config(struct ieee80211_hw *dev, u32 changed)
696{ 696{
697 struct rtl8180_priv *priv = dev->priv; 697 struct rtl8180_priv *priv = dev->priv;
698 struct ieee80211_conf *conf = &dev->conf;
698 699
699 priv->rf->set_chan(dev, conf); 700 priv->rf->set_chan(dev, conf);
700 701
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 9ceae9017f86..2c69ab37c650 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -873,9 +873,10 @@ static void rtl8187_remove_interface(struct ieee80211_hw *dev,
873 mutex_unlock(&priv->conf_mutex); 873 mutex_unlock(&priv->conf_mutex);
874} 874}
875 875
876static int rtl8187_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) 876static int rtl8187_config(struct ieee80211_hw *dev, u32 changed)
877{ 877{
878 struct rtl8187_priv *priv = dev->priv; 878 struct rtl8187_priv *priv = dev->priv;
879 struct ieee80211_conf *conf = &dev->conf;
879 u32 reg; 880 u32 reg;
880 881
881 mutex_lock(&priv->conf_mutex); 882 mutex_lock(&priv->conf_mutex);
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index de45509d757e..6c3e21887fc8 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -743,9 +743,11 @@ static void zd_op_remove_interface(struct ieee80211_hw *hw,
743 zd_write_mac_addr(&mac->chip, NULL); 743 zd_write_mac_addr(&mac->chip, NULL);
744} 744}
745 745
746static int zd_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) 746static int zd_op_config(struct ieee80211_hw *hw, u32 changed)
747{ 747{
748 struct zd_mac *mac = zd_hw_mac(hw); 748 struct zd_mac *mac = zd_hw_mac(hw);
749 struct ieee80211_conf *conf = &hw->conf;
750
749 return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); 751 return zd_chip_set_channel(&mac->chip, conf->channel->hw_value);
750} 752}
751 753