aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/net/wireless/ath/ar9170/mac.c6
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c5
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c22
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c2
-rw-r--r--drivers/net/wireless/b43/main.c12
-rw-r--r--drivers/net/wireless/b43legacy/main.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c5
-rw-r--r--drivers/net/wireless/libertas_tf/main.c2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c20
14 files changed, 59 insertions, 47 deletions
diff --git a/drivers/net/wireless/ath/ar9170/mac.c b/drivers/net/wireless/ath/ar9170/mac.c
index c8fa3073169f..0e5967dd119c 100644
--- a/drivers/net/wireless/ath/ar9170/mac.c
+++ b/drivers/net/wireless/ath/ar9170/mac.c
@@ -316,9 +316,9 @@ int ar9170_set_beacon_timers(struct ar9170 *ar)
316 u32 v = 0; 316 u32 v = 0;
317 u32 pretbtt = 0; 317 u32 pretbtt = 0;
318 318
319 v |= ar->hw->conf.beacon_int;
320
321 if (ar->vif) { 319 if (ar->vif) {
320 v |= ar->vif->bss_conf.beacon_int;
321
322 switch (ar->vif->type) { 322 switch (ar->vif->type) {
323 case NL80211_IFTYPE_MESH_POINT: 323 case NL80211_IFTYPE_MESH_POINT:
324 case NL80211_IFTYPE_ADHOC: 324 case NL80211_IFTYPE_ADHOC:
@@ -326,7 +326,7 @@ int ar9170_set_beacon_timers(struct ar9170 *ar)
326 break; 326 break;
327 case NL80211_IFTYPE_AP: 327 case NL80211_IFTYPE_AP:
328 v |= BIT(24); 328 v |= BIT(24);
329 pretbtt = (ar->hw->conf.beacon_int - 6) << 16; 329 pretbtt = (ar->vif->bss_conf.beacon_int - 6) << 16;
330 break; 330 break;
331 default: 331 default:
332 break; 332 break;
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 1b60906b80c9..49c729bc7147 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1337,7 +1337,7 @@ static int ar9170_op_config(struct ieee80211_hw *hw, u32 changed)
1337 goto out; 1337 goto out;
1338 } 1338 }
1339 1339
1340 if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) { 1340 if (changed & BSS_CHANGED_BEACON_INT) {
1341 err = ar9170_set_beacon_timers(ar); 1341 err = ar9170_set_beacon_timers(ar);
1342 if (err) 1342 if (err)
1343 goto out; 1343 goto out;
@@ -1499,6 +1499,9 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
1499#endif /* CONFIG_AR9170_LEDS */ 1499#endif /* CONFIG_AR9170_LEDS */
1500 } 1500 }
1501 1501
1502 if (changed & BSS_CHANGED_BEACON_INT)
1503 err = ar9170_set_beacon_timers(ar);
1504
1502 if (changed & BSS_CHANGED_HT) { 1505 if (changed & BSS_CHANGED_HT) {
1503 /* TODO */ 1506 /* TODO */
1504 err = 0; 1507 err = 0;
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index c8c658bfcf9d..e4b1d9efa42e 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2756,7 +2756,6 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
2756 2756
2757 mutex_lock(&sc->lock); 2757 mutex_lock(&sc->lock);
2758 2758
2759 sc->bintval = conf->beacon_int;
2760 sc->power_level = conf->power_level; 2759 sc->power_level = conf->power_level;
2761 2760
2762 ret = ath5k_chan_set(sc, conf->channel); 2761 ret = ath5k_chan_set(sc, conf->channel);
@@ -3083,6 +3082,10 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
3083 u32 changes) 3082 u32 changes)
3084{ 3083{
3085 struct ath5k_softc *sc = hw->priv; 3084 struct ath5k_softc *sc = hw->priv;
3085
3086 if (changes & BSS_CHANGED_BEACON_INT)
3087 sc->bintval = bss_conf->beacon_int;
3088
3086 if (changes & BSS_CHANGED_ASSOC) { 3089 if (changes & BSS_CHANGED_ASSOC) {
3087 mutex_lock(&sc->lock); 3090 mutex_lock(&sc->lock);
3088 sc->assoc = bss_conf->assoc; 3091 sc->assoc = bss_conf->assoc;
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index c92d46fa9d51..d5084ddf44ff 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -590,6 +590,8 @@ struct ath_softc {
590 int led_on_cnt; 590 int led_on_cnt;
591 int led_off_cnt; 591 int led_off_cnt;
592 592
593 int beacon_interval;
594
593 struct ath_rfkill rf_kill; 595 struct ath_rfkill rf_kill;
594 struct ath_ani ani; 596 struct ath_ani ani;
595 struct ath9k_node_stats nodestats; 597 struct ath9k_node_stats nodestats;
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index eb4759fc6a0d..c17b8382e328 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -320,8 +320,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
320 u64 tsfadjust; 320 u64 tsfadjust;
321 int intval; 321 int intval;
322 322
323 intval = sc->hw->conf.beacon_int ? 323 intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
324 sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
325 324
326 /* 325 /*
327 * Calculate the TSF offset for this beacon slot, i.e., the 326 * Calculate the TSF offset for this beacon slot, i.e., the
@@ -431,8 +430,7 @@ void ath_beacon_tasklet(unsigned long data)
431 * on the tsf to safeguard against missing an swba. 430 * on the tsf to safeguard against missing an swba.
432 */ 431 */
433 432
434 intval = sc->hw->conf.beacon_int ? 433 intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
435 sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
436 434
437 tsf = ath9k_hw_gettsf64(ah); 435 tsf = ath9k_hw_gettsf64(ah);
438 tsftu = TSF_TO_TU(tsf>>32, tsf); 436 tsftu = TSF_TO_TU(tsf>>32, tsf);
@@ -711,8 +709,7 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
711 /* Setup the beacon configuration parameters */ 709 /* Setup the beacon configuration parameters */
712 710
713 memset(&conf, 0, sizeof(struct ath_beacon_config)); 711 memset(&conf, 0, sizeof(struct ath_beacon_config));
714 conf.beacon_interval = sc->hw->conf.beacon_int ? 712 conf.beacon_interval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
715 sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
716 conf.listen_interval = 1; 713 conf.listen_interval = 1;
717 conf.dtim_period = conf.beacon_interval; 714 conf.dtim_period = conf.beacon_interval;
718 conf.dtim_count = 1; 715 conf.dtim_count = 1;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2398d4f45f28..28cc9cd52f32 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2358,16 +2358,6 @@ skip_chan_change:
2358 if (changed & IEEE80211_CONF_CHANGE_POWER) 2358 if (changed & IEEE80211_CONF_CHANGE_POWER)
2359 sc->config.txpowlimit = 2 * conf->power_level; 2359 sc->config.txpowlimit = 2 * conf->power_level;
2360 2360
2361 /*
2362 * The HW TSF has to be reset when the beacon interval changes.
2363 * We set the flag here, and ath_beacon_config_ap() would take this
2364 * into account when it gets called through the subsequent
2365 * config_interface() call - with IFCC_BEACON in the changed field.
2366 */
2367
2368 if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL)
2369 sc->sc_flags |= SC_OP_TSF_RESET;
2370
2371 mutex_unlock(&sc->mutex); 2361 mutex_unlock(&sc->mutex);
2372 2362
2373 return 0; 2363 return 0;
@@ -2635,6 +2625,18 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
2635 ath9k_bss_assoc_info(sc, vif, bss_conf); 2625 ath9k_bss_assoc_info(sc, vif, bss_conf);
2636 } 2626 }
2637 2627
2628 /*
2629 * The HW TSF has to be reset when the beacon interval changes.
2630 * We set the flag here, and ath_beacon_config_ap() would take this
2631 * into account when it gets called through the subsequent
2632 * config_interface() call - with IFCC_BEACON in the changed field.
2633 */
2634
2635 if (changed & BSS_CHANGED_BEACON_INT) {
2636 sc->sc_flags |= SC_OP_TSF_RESET;
2637 sc->beacon_interval = bss_conf->beacon_int;
2638 }
2639
2638 mutex_unlock(&sc->mutex); 2640 mutex_unlock(&sc->mutex);
2639} 2641}
2640 2642
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index faf2cab49ea3..501493ffc3a7 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -971,7 +971,7 @@ int ath_cabq_update(struct ath_softc *sc)
971 else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND) 971 else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND)
972 sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND; 972 sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND;
973 973
974 qi.tqi_readyTime = (sc->hw->conf.beacon_int * 974 qi.tqi_readyTime = (sc->beacon_interval *
975 sc->config.cabqReadytime) / 100; 975 sc->config.cabqReadytime) / 100;
976 ath_txq_update(sc, qnum, &qi); 976 ath_txq_update(sc, qnum, &qi);
977 977
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index a97c6ff0f12e..3c693e6ec904 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3468,11 +3468,6 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3468 if (phy->ops->set_rx_antenna) 3468 if (phy->ops->set_rx_antenna)
3469 phy->ops->set_rx_antenna(dev, antenna); 3469 phy->ops->set_rx_antenna(dev, antenna);
3470 3470
3471 /* Update templates for AP/mesh mode. */
3472 if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3473 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT))
3474 b43_set_beacon_int(dev, conf->beacon_int);
3475
3476 if (!!conf->radio_enabled != phy->radio_on) { 3471 if (!!conf->radio_enabled != phy->radio_on) {
3477 if (conf->radio_enabled) { 3472 if (conf->radio_enabled) {
3478 b43_software_rfkill(dev, RFKILL_STATE_UNBLOCKED); 3473 b43_software_rfkill(dev, RFKILL_STATE_UNBLOCKED);
@@ -3556,6 +3551,13 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
3556 goto out_unlock_mutex; 3551 goto out_unlock_mutex;
3557 b43_mac_suspend(dev); 3552 b43_mac_suspend(dev);
3558 3553
3554 /* Update templates for AP/mesh mode. */
3555 if (changed & BSS_CHANGED_BEACON_INT &&
3556 (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3557 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
3558 b43_is_mode(wl, NL80211_IFTYPE_ADHOC)))
3559 b43_set_beacon_int(dev, conf->beacon_int);
3560
3559 if (changed & BSS_CHANGED_BASIC_RATES) 3561 if (changed & BSS_CHANGED_BASIC_RATES)
3560 b43_update_basic_rates(dev, conf->basic_rates); 3562 b43_update_basic_rates(dev, conf->basic_rates);
3561 3563
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index ee202b4f77b5..276f314688f7 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2721,11 +2721,6 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2721 /* Antennas for RX and management frame TX. */ 2721 /* Antennas for RX and management frame TX. */
2722 b43legacy_mgmtframe_txantenna(dev, antenna_tx); 2722 b43legacy_mgmtframe_txantenna(dev, antenna_tx);
2723 2723
2724 /* Update templates for AP mode. */
2725 if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP))
2726 b43legacy_set_beacon_int(dev, conf->beacon_int);
2727
2728
2729 if (!!conf->radio_enabled != phy->radio_on) { 2724 if (!!conf->radio_enabled != phy->radio_on) {
2730 if (conf->radio_enabled) { 2725 if (conf->radio_enabled) {
2731 b43legacy_radio_turn_on(dev); 2726 b43legacy_radio_turn_on(dev);
@@ -2827,6 +2822,11 @@ static void b43legacy_op_bss_info_changed(struct ieee80211_hw *hw,
2827 2822
2828 b43legacy_mac_suspend(dev); 2823 b43legacy_mac_suspend(dev);
2829 2824
2825 if (changed & BSS_CHANGED_BEACON_INT &&
2826 (b43legacy_is_mode(wl, NL80211_IFTYPE_AP) ||
2827 b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)))
2828 b43legacy_set_beacon_int(dev, conf->beacon_int);
2829
2830 if (changed & BSS_CHANGED_BASIC_RATES) 2830 if (changed & BSS_CHANGED_BASIC_RATES)
2831 b43legacy_update_basic_rates(dev, conf->basic_rates); 2831 b43legacy_update_basic_rates(dev, conf->basic_rates);
2832 2832
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 277dfc57fde9..4920dcf7d7b0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -567,7 +567,8 @@ static void iwl_setup_rxon_timing(struct iwl_priv *priv)
567 beacon_int = iwl_adjust_beacon_interval(priv->beacon_int); 567 beacon_int = iwl_adjust_beacon_interval(priv->beacon_int);
568 priv->rxon_timing.atim_window = 0; 568 priv->rxon_timing.atim_window = 0;
569 } else { 569 } else {
570 beacon_int = iwl_adjust_beacon_interval(conf->beacon_int); 570 beacon_int = iwl_adjust_beacon_interval(
571 priv->vif->bss_conf.beacon_int);
571 572
572 /* TODO: we need to get atim_window from upper stack 573 /* TODO: we need to get atim_window from upper stack
573 * for now we set to 0 */ 574 * for now we set to 0 */
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 3dec2d25fa3d..cd8a5ed97c4f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1313,7 +1313,6 @@ int iwl_setup_mac(struct iwl_priv *priv)
1313 /* Default value; 4 EDCA QOS priorities */ 1313 /* Default value; 4 EDCA QOS priorities */
1314 hw->queues = 4; 1314 hw->queues = 4;
1315 1315
1316 hw->conf.beacon_int = 100;
1317 hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; 1316 hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
1318 1317
1319 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels) 1318 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
@@ -2751,7 +2750,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
2751 2750
2752 priv->ibss_beacon = NULL; 2751 priv->ibss_beacon = NULL;
2753 2752
2754 priv->beacon_int = priv->hw->conf.beacon_int; 2753 priv->beacon_int = priv->vif->bss_conf.beacon_int;
2755 priv->timestamp = 0; 2754 priv->timestamp = 0;
2756 if ((priv->iw_mode == NL80211_IFTYPE_STATION)) 2755 if ((priv->iw_mode == NL80211_IFTYPE_STATION))
2757 priv->beacon_int = 0; 2756 priv->beacon_int = 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a782292ed435..f9d9b65ef300 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -551,7 +551,8 @@ static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
551 priv->rxon_timing.atim_window = 0; 551 priv->rxon_timing.atim_window = 0;
552 } else { 552 } else {
553 priv->rxon_timing.beacon_interval = 553 priv->rxon_timing.beacon_interval =
554 iwl3945_adjust_beacon_interval(conf->beacon_int); 554 iwl3945_adjust_beacon_interval(
555 priv->vif->bss_conf.beacon_int);
555 /* TODO: we need to get atim_window from upper stack 556 /* TODO: we need to get atim_window from upper stack
556 * for now we set to 0 */ 557 * for now we set to 0 */
557 priv->rxon_timing.atim_window = 0; 558 priv->rxon_timing.atim_window = 0;
@@ -4211,8 +4212,6 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
4211 /* Default value; 4 EDCA QOS priorities */ 4212 /* Default value; 4 EDCA QOS priorities */
4212 hw->queues = 4; 4213 hw->queues = 4;
4213 4214
4214 hw->conf.beacon_int = 100;
4215
4216 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels) 4215 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
4217 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 4216 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
4218 &priv->bands[IEEE80211_BAND_2GHZ]; 4217 &priv->bands[IEEE80211_BAND_2GHZ];
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index e7289e2e7f16..68e47fb47a1e 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -380,7 +380,7 @@ static int lbtf_op_config_interface(struct ieee80211_hw *hw,
380 if (beacon) { 380 if (beacon) {
381 lbtf_beacon_set(priv, beacon); 381 lbtf_beacon_set(priv, beacon);
382 kfree_skb(beacon); 382 kfree_skb(beacon);
383 lbtf_beacon_ctrl(priv, 1, hw->conf.beacon_int); 383 lbtf_beacon_ctrl(priv, 1, vif->bss_conf.beacon_int);
384 } 384 }
385 break; 385 break;
386 default: 386 default:
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);