aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 10:10:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:33 -0400
commit57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (patch)
treebcd24a127b4c79891f45799a20867f49c0f7f949 /drivers/net/wireless/mac80211_hwsim.c
parentf3b85252f081581a8f257545ed748062dce7798b (diff)
mac80211: clean up beacon interval settings
We currently have two beacon interval configuration knobs: hw.conf.beacon_int and vif.bss_info.beacon_int. This is rather confusing, even though the former is used when we beacon ourselves and the latter when we are associated to an AP. This just deprecates the hw.conf.beacon_int setting in favour of always using vif.bss_info.beacon_int. Since it touches all the beaconing IBSS code anyway, we can also add support for the cfg80211 IBSS beacon interval configuration easily. NOTE: The hw.conf.beacon_int setting is retained for now due to drivers still using it -- I couldn't untangle all drivers, some are updated in this patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index d4fdc8b7d7d8..24c95a619e4c 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -553,18 +553,13 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
553 struct mac80211_hwsim_data *data = hw->priv; 553 struct mac80211_hwsim_data *data = hw->priv;
554 struct ieee80211_conf *conf = &hw->conf; 554 struct ieee80211_conf *conf = &hw->conf;
555 555
556 printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d beacon_int=%d)\n", 556 printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d)\n",
557 wiphy_name(hw->wiphy), __func__, 557 wiphy_name(hw->wiphy), __func__,
558 conf->channel->center_freq, conf->radio_enabled, 558 conf->channel->center_freq, conf->radio_enabled);
559 conf->beacon_int);
560 559
561 data->channel = conf->channel; 560 data->channel = conf->channel;
562 data->radio_enabled = conf->radio_enabled; 561 data->radio_enabled = conf->radio_enabled;
563 data->beacon_int = 1024 * conf->beacon_int / 1000 * HZ / 1000; 562 if (!data->started || !data->radio_enabled || !data->beacon_int)
564 if (data->beacon_int < 1)
565 data->beacon_int = 1;
566
567 if (!data->started || !data->radio_enabled)
568 del_timer(&data->beacon_timer); 563 del_timer(&data->beacon_timer);
569 else 564 else
570 mod_timer(&data->beacon_timer, jiffies + data->beacon_int); 565 mod_timer(&data->beacon_timer, jiffies + data->beacon_int);
@@ -615,6 +610,7 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
615 u32 changed) 610 u32 changed)
616{ 611{
617 struct hwsim_vif_priv *vp = (void *)vif->drv_priv; 612 struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
613 struct mac80211_hwsim_data *data = hw->priv;
618 614
619 hwsim_check_magic(vif); 615 hwsim_check_magic(vif);
620 616
@@ -628,6 +624,14 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
628 vp->aid = info->aid; 624 vp->aid = info->aid;
629 } 625 }
630 626
627 if (changed & BSS_CHANGED_BEACON_INT) {
628 printk(KERN_DEBUG " %s: BCNINT: %d\n",
629 wiphy_name(hw->wiphy), info->beacon_int);
630 data->beacon_int = 1024 * info->beacon_int / 1000 * HZ / 1000;
631 if (WARN_ON(data->beacon_int))
632 data->beacon_int = 1;
633 }
634
631 if (changed & BSS_CHANGED_ERP_CTS_PROT) { 635 if (changed & BSS_CHANGED_ERP_CTS_PROT) {
632 printk(KERN_DEBUG " %s: ERP_CTS_PROT: %d\n", 636 printk(KERN_DEBUG " %s: ERP_CTS_PROT: %d\n",
633 wiphy_name(hw->wiphy), info->use_cts_prot); 637 wiphy_name(hw->wiphy), info->use_cts_prot);