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>
This commit is contained in:
parent
f3b85252f0
commit
57c4d7b4c4
|
@ -316,9 +316,9 @@ int ar9170_set_beacon_timers(struct ar9170 *ar)
|
||||||
u32 v = 0;
|
u32 v = 0;
|
||||||
u32 pretbtt = 0;
|
u32 pretbtt = 0;
|
||||||
|
|
||||||
v |= ar->hw->conf.beacon_int;
|
|
||||||
|
|
||||||
if (ar->vif) {
|
if (ar->vif) {
|
||||||
|
v |= ar->vif->bss_conf.beacon_int;
|
||||||
|
|
||||||
switch (ar->vif->type) {
|
switch (ar->vif->type) {
|
||||||
case NL80211_IFTYPE_MESH_POINT:
|
case NL80211_IFTYPE_MESH_POINT:
|
||||||
case NL80211_IFTYPE_ADHOC:
|
case NL80211_IFTYPE_ADHOC:
|
||||||
|
@ -326,7 +326,7 @@ int ar9170_set_beacon_timers(struct ar9170 *ar)
|
||||||
break;
|
break;
|
||||||
case NL80211_IFTYPE_AP:
|
case NL80211_IFTYPE_AP:
|
||||||
v |= BIT(24);
|
v |= BIT(24);
|
||||||
pretbtt = (ar->hw->conf.beacon_int - 6) << 16;
|
pretbtt = (ar->vif->bss_conf.beacon_int - 6) << 16;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1337,7 +1337,7 @@ static int ar9170_op_config(struct ieee80211_hw *hw, u32 changed)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) {
|
if (changed & BSS_CHANGED_BEACON_INT) {
|
||||||
err = ar9170_set_beacon_timers(ar);
|
err = ar9170_set_beacon_timers(ar);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1499,6 +1499,9 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
#endif /* CONFIG_AR9170_LEDS */
|
#endif /* CONFIG_AR9170_LEDS */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changed & BSS_CHANGED_BEACON_INT)
|
||||||
|
err = ar9170_set_beacon_timers(ar);
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_HT) {
|
if (changed & BSS_CHANGED_HT) {
|
||||||
/* TODO */
|
/* TODO */
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
|
@ -2756,7 +2756,6 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
|
||||||
|
|
||||||
mutex_lock(&sc->lock);
|
mutex_lock(&sc->lock);
|
||||||
|
|
||||||
sc->bintval = conf->beacon_int;
|
|
||||||
sc->power_level = conf->power_level;
|
sc->power_level = conf->power_level;
|
||||||
|
|
||||||
ret = ath5k_chan_set(sc, conf->channel);
|
ret = ath5k_chan_set(sc, conf->channel);
|
||||||
|
@ -3083,6 +3082,10 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
u32 changes)
|
u32 changes)
|
||||||
{
|
{
|
||||||
struct ath5k_softc *sc = hw->priv;
|
struct ath5k_softc *sc = hw->priv;
|
||||||
|
|
||||||
|
if (changes & BSS_CHANGED_BEACON_INT)
|
||||||
|
sc->bintval = bss_conf->beacon_int;
|
||||||
|
|
||||||
if (changes & BSS_CHANGED_ASSOC) {
|
if (changes & BSS_CHANGED_ASSOC) {
|
||||||
mutex_lock(&sc->lock);
|
mutex_lock(&sc->lock);
|
||||||
sc->assoc = bss_conf->assoc;
|
sc->assoc = bss_conf->assoc;
|
||||||
|
|
|
@ -590,6 +590,8 @@ struct ath_softc {
|
||||||
int led_on_cnt;
|
int led_on_cnt;
|
||||||
int led_off_cnt;
|
int led_off_cnt;
|
||||||
|
|
||||||
|
int beacon_interval;
|
||||||
|
|
||||||
struct ath_rfkill rf_kill;
|
struct ath_rfkill rf_kill;
|
||||||
struct ath_ani ani;
|
struct ath_ani ani;
|
||||||
struct ath9k_node_stats nodestats;
|
struct ath9k_node_stats nodestats;
|
||||||
|
|
|
@ -320,8 +320,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
|
||||||
u64 tsfadjust;
|
u64 tsfadjust;
|
||||||
int intval;
|
int intval;
|
||||||
|
|
||||||
intval = sc->hw->conf.beacon_int ?
|
intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
|
||||||
sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate the TSF offset for this beacon slot, i.e., the
|
* Calculate the TSF offset for this beacon slot, i.e., the
|
||||||
|
@ -431,8 +430,7 @@ void ath_beacon_tasklet(unsigned long data)
|
||||||
* on the tsf to safeguard against missing an swba.
|
* on the tsf to safeguard against missing an swba.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
intval = sc->hw->conf.beacon_int ?
|
intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
|
||||||
sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
|
|
||||||
|
|
||||||
tsf = ath9k_hw_gettsf64(ah);
|
tsf = ath9k_hw_gettsf64(ah);
|
||||||
tsftu = TSF_TO_TU(tsf>>32, tsf);
|
tsftu = TSF_TO_TU(tsf>>32, tsf);
|
||||||
|
@ -711,8 +709,7 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
|
||||||
/* Setup the beacon configuration parameters */
|
/* Setup the beacon configuration parameters */
|
||||||
|
|
||||||
memset(&conf, 0, sizeof(struct ath_beacon_config));
|
memset(&conf, 0, sizeof(struct ath_beacon_config));
|
||||||
conf.beacon_interval = sc->hw->conf.beacon_int ?
|
conf.beacon_interval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
|
||||||
sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
|
|
||||||
conf.listen_interval = 1;
|
conf.listen_interval = 1;
|
||||||
conf.dtim_period = conf.beacon_interval;
|
conf.dtim_period = conf.beacon_interval;
|
||||||
conf.dtim_count = 1;
|
conf.dtim_count = 1;
|
||||||
|
|
|
@ -2358,16 +2358,6 @@ skip_chan_change:
|
||||||
if (changed & IEEE80211_CONF_CHANGE_POWER)
|
if (changed & IEEE80211_CONF_CHANGE_POWER)
|
||||||
sc->config.txpowlimit = 2 * conf->power_level;
|
sc->config.txpowlimit = 2 * conf->power_level;
|
||||||
|
|
||||||
/*
|
|
||||||
* The HW TSF has to be reset when the beacon interval changes.
|
|
||||||
* We set the flag here, and ath_beacon_config_ap() would take this
|
|
||||||
* into account when it gets called through the subsequent
|
|
||||||
* config_interface() call - with IFCC_BEACON in the changed field.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL)
|
|
||||||
sc->sc_flags |= SC_OP_TSF_RESET;
|
|
||||||
|
|
||||||
mutex_unlock(&sc->mutex);
|
mutex_unlock(&sc->mutex);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2635,6 +2625,18 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
ath9k_bss_assoc_info(sc, vif, bss_conf);
|
ath9k_bss_assoc_info(sc, vif, bss_conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The HW TSF has to be reset when the beacon interval changes.
|
||||||
|
* We set the flag here, and ath_beacon_config_ap() would take this
|
||||||
|
* into account when it gets called through the subsequent
|
||||||
|
* config_interface() call - with IFCC_BEACON in the changed field.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (changed & BSS_CHANGED_BEACON_INT) {
|
||||||
|
sc->sc_flags |= SC_OP_TSF_RESET;
|
||||||
|
sc->beacon_interval = bss_conf->beacon_int;
|
||||||
|
}
|
||||||
|
|
||||||
mutex_unlock(&sc->mutex);
|
mutex_unlock(&sc->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -971,7 +971,7 @@ int ath_cabq_update(struct ath_softc *sc)
|
||||||
else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND)
|
else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND)
|
||||||
sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND;
|
sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND;
|
||||||
|
|
||||||
qi.tqi_readyTime = (sc->hw->conf.beacon_int *
|
qi.tqi_readyTime = (sc->beacon_interval *
|
||||||
sc->config.cabqReadytime) / 100;
|
sc->config.cabqReadytime) / 100;
|
||||||
ath_txq_update(sc, qnum, &qi);
|
ath_txq_update(sc, qnum, &qi);
|
||||||
|
|
||||||
|
|
|
@ -3468,11 +3468,6 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
|
||||||
if (phy->ops->set_rx_antenna)
|
if (phy->ops->set_rx_antenna)
|
||||||
phy->ops->set_rx_antenna(dev, antenna);
|
phy->ops->set_rx_antenna(dev, antenna);
|
||||||
|
|
||||||
/* Update templates for AP/mesh mode. */
|
|
||||||
if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
|
|
||||||
b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT))
|
|
||||||
b43_set_beacon_int(dev, conf->beacon_int);
|
|
||||||
|
|
||||||
if (!!conf->radio_enabled != phy->radio_on) {
|
if (!!conf->radio_enabled != phy->radio_on) {
|
||||||
if (conf->radio_enabled) {
|
if (conf->radio_enabled) {
|
||||||
b43_software_rfkill(dev, RFKILL_STATE_UNBLOCKED);
|
b43_software_rfkill(dev, RFKILL_STATE_UNBLOCKED);
|
||||||
|
@ -3556,6 +3551,13 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
goto out_unlock_mutex;
|
goto out_unlock_mutex;
|
||||||
b43_mac_suspend(dev);
|
b43_mac_suspend(dev);
|
||||||
|
|
||||||
|
/* Update templates for AP/mesh mode. */
|
||||||
|
if (changed & BSS_CHANGED_BEACON_INT &&
|
||||||
|
(b43_is_mode(wl, NL80211_IFTYPE_AP) ||
|
||||||
|
b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
|
||||||
|
b43_is_mode(wl, NL80211_IFTYPE_ADHOC)))
|
||||||
|
b43_set_beacon_int(dev, conf->beacon_int);
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_BASIC_RATES)
|
if (changed & BSS_CHANGED_BASIC_RATES)
|
||||||
b43_update_basic_rates(dev, conf->basic_rates);
|
b43_update_basic_rates(dev, conf->basic_rates);
|
||||||
|
|
||||||
|
|
|
@ -2721,11 +2721,6 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
|
||||||
/* Antennas for RX and management frame TX. */
|
/* Antennas for RX and management frame TX. */
|
||||||
b43legacy_mgmtframe_txantenna(dev, antenna_tx);
|
b43legacy_mgmtframe_txantenna(dev, antenna_tx);
|
||||||
|
|
||||||
/* Update templates for AP mode. */
|
|
||||||
if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP))
|
|
||||||
b43legacy_set_beacon_int(dev, conf->beacon_int);
|
|
||||||
|
|
||||||
|
|
||||||
if (!!conf->radio_enabled != phy->radio_on) {
|
if (!!conf->radio_enabled != phy->radio_on) {
|
||||||
if (conf->radio_enabled) {
|
if (conf->radio_enabled) {
|
||||||
b43legacy_radio_turn_on(dev);
|
b43legacy_radio_turn_on(dev);
|
||||||
|
@ -2827,6 +2822,11 @@ static void b43legacy_op_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
|
|
||||||
b43legacy_mac_suspend(dev);
|
b43legacy_mac_suspend(dev);
|
||||||
|
|
||||||
|
if (changed & BSS_CHANGED_BEACON_INT &&
|
||||||
|
(b43legacy_is_mode(wl, NL80211_IFTYPE_AP) ||
|
||||||
|
b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)))
|
||||||
|
b43legacy_set_beacon_int(dev, conf->beacon_int);
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_BASIC_RATES)
|
if (changed & BSS_CHANGED_BASIC_RATES)
|
||||||
b43legacy_update_basic_rates(dev, conf->basic_rates);
|
b43legacy_update_basic_rates(dev, conf->basic_rates);
|
||||||
|
|
||||||
|
|
|
@ -567,7 +567,8 @@ static void iwl_setup_rxon_timing(struct iwl_priv *priv)
|
||||||
beacon_int = iwl_adjust_beacon_interval(priv->beacon_int);
|
beacon_int = iwl_adjust_beacon_interval(priv->beacon_int);
|
||||||
priv->rxon_timing.atim_window = 0;
|
priv->rxon_timing.atim_window = 0;
|
||||||
} else {
|
} else {
|
||||||
beacon_int = iwl_adjust_beacon_interval(conf->beacon_int);
|
beacon_int = iwl_adjust_beacon_interval(
|
||||||
|
priv->vif->bss_conf.beacon_int);
|
||||||
|
|
||||||
/* TODO: we need to get atim_window from upper stack
|
/* TODO: we need to get atim_window from upper stack
|
||||||
* for now we set to 0 */
|
* for now we set to 0 */
|
||||||
|
|
|
@ -1313,7 +1313,6 @@ int iwl_setup_mac(struct iwl_priv *priv)
|
||||||
/* Default value; 4 EDCA QOS priorities */
|
/* Default value; 4 EDCA QOS priorities */
|
||||||
hw->queues = 4;
|
hw->queues = 4;
|
||||||
|
|
||||||
hw->conf.beacon_int = 100;
|
|
||||||
hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
|
hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
|
||||||
|
|
||||||
if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
|
if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
|
||||||
|
@ -2751,7 +2750,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
|
||||||
|
|
||||||
priv->ibss_beacon = NULL;
|
priv->ibss_beacon = NULL;
|
||||||
|
|
||||||
priv->beacon_int = priv->hw->conf.beacon_int;
|
priv->beacon_int = priv->vif->bss_conf.beacon_int;
|
||||||
priv->timestamp = 0;
|
priv->timestamp = 0;
|
||||||
if ((priv->iw_mode == NL80211_IFTYPE_STATION))
|
if ((priv->iw_mode == NL80211_IFTYPE_STATION))
|
||||||
priv->beacon_int = 0;
|
priv->beacon_int = 0;
|
||||||
|
|
|
@ -551,7 +551,8 @@ static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
|
||||||
priv->rxon_timing.atim_window = 0;
|
priv->rxon_timing.atim_window = 0;
|
||||||
} else {
|
} else {
|
||||||
priv->rxon_timing.beacon_interval =
|
priv->rxon_timing.beacon_interval =
|
||||||
iwl3945_adjust_beacon_interval(conf->beacon_int);
|
iwl3945_adjust_beacon_interval(
|
||||||
|
priv->vif->bss_conf.beacon_int);
|
||||||
/* TODO: we need to get atim_window from upper stack
|
/* TODO: we need to get atim_window from upper stack
|
||||||
* for now we set to 0 */
|
* for now we set to 0 */
|
||||||
priv->rxon_timing.atim_window = 0;
|
priv->rxon_timing.atim_window = 0;
|
||||||
|
@ -4211,8 +4212,6 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
|
||||||
/* Default value; 4 EDCA QOS priorities */
|
/* Default value; 4 EDCA QOS priorities */
|
||||||
hw->queues = 4;
|
hw->queues = 4;
|
||||||
|
|
||||||
hw->conf.beacon_int = 100;
|
|
||||||
|
|
||||||
if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
|
if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
|
||||||
priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
|
priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
|
||||||
&priv->bands[IEEE80211_BAND_2GHZ];
|
&priv->bands[IEEE80211_BAND_2GHZ];
|
||||||
|
|
|
@ -380,7 +380,7 @@ static int lbtf_op_config_interface(struct ieee80211_hw *hw,
|
||||||
if (beacon) {
|
if (beacon) {
|
||||||
lbtf_beacon_set(priv, beacon);
|
lbtf_beacon_set(priv, beacon);
|
||||||
kfree_skb(beacon);
|
kfree_skb(beacon);
|
||||||
lbtf_beacon_ctrl(priv, 1, hw->conf.beacon_int);
|
lbtf_beacon_ctrl(priv, 1, vif->bss_conf.beacon_int);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -553,18 +553,13 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
|
||||||
struct mac80211_hwsim_data *data = hw->priv;
|
struct mac80211_hwsim_data *data = hw->priv;
|
||||||
struct ieee80211_conf *conf = &hw->conf;
|
struct ieee80211_conf *conf = &hw->conf;
|
||||||
|
|
||||||
printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d beacon_int=%d)\n",
|
printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d)\n",
|
||||||
wiphy_name(hw->wiphy), __func__,
|
wiphy_name(hw->wiphy), __func__,
|
||||||
conf->channel->center_freq, conf->radio_enabled,
|
conf->channel->center_freq, conf->radio_enabled);
|
||||||
conf->beacon_int);
|
|
||||||
|
|
||||||
data->channel = conf->channel;
|
data->channel = conf->channel;
|
||||||
data->radio_enabled = conf->radio_enabled;
|
data->radio_enabled = conf->radio_enabled;
|
||||||
data->beacon_int = 1024 * conf->beacon_int / 1000 * HZ / 1000;
|
if (!data->started || !data->radio_enabled || !data->beacon_int)
|
||||||
if (data->beacon_int < 1)
|
|
||||||
data->beacon_int = 1;
|
|
||||||
|
|
||||||
if (!data->started || !data->radio_enabled)
|
|
||||||
del_timer(&data->beacon_timer);
|
del_timer(&data->beacon_timer);
|
||||||
else
|
else
|
||||||
mod_timer(&data->beacon_timer, jiffies + data->beacon_int);
|
mod_timer(&data->beacon_timer, jiffies + data->beacon_int);
|
||||||
|
@ -615,6 +610,7 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
u32 changed)
|
u32 changed)
|
||||||
{
|
{
|
||||||
struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
|
struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
|
||||||
|
struct mac80211_hwsim_data *data = hw->priv;
|
||||||
|
|
||||||
hwsim_check_magic(vif);
|
hwsim_check_magic(vif);
|
||||||
|
|
||||||
|
@ -628,6 +624,14 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
vp->aid = info->aid;
|
vp->aid = info->aid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changed & BSS_CHANGED_BEACON_INT) {
|
||||||
|
printk(KERN_DEBUG " %s: BCNINT: %d\n",
|
||||||
|
wiphy_name(hw->wiphy), info->beacon_int);
|
||||||
|
data->beacon_int = 1024 * info->beacon_int / 1000 * HZ / 1000;
|
||||||
|
if (WARN_ON(data->beacon_int))
|
||||||
|
data->beacon_int = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_ERP_CTS_PROT) {
|
if (changed & BSS_CHANGED_ERP_CTS_PROT) {
|
||||||
printk(KERN_DEBUG " %s: ERP_CTS_PROT: %d\n",
|
printk(KERN_DEBUG " %s: ERP_CTS_PROT: %d\n",
|
||||||
wiphy_name(hw->wiphy), info->use_cts_prot);
|
wiphy_name(hw->wiphy), info->use_cts_prot);
|
||||||
|
|
|
@ -149,6 +149,7 @@ struct ieee80211_low_level_stats {
|
||||||
* @BSS_CHANGED_ERP_SLOT: slot timing changed
|
* @BSS_CHANGED_ERP_SLOT: slot timing changed
|
||||||
* @BSS_CHANGED_HT: 802.11n parameters changed
|
* @BSS_CHANGED_HT: 802.11n parameters changed
|
||||||
* @BSS_CHANGED_BASIC_RATES: Basic rateset changed
|
* @BSS_CHANGED_BASIC_RATES: Basic rateset changed
|
||||||
|
* @BSS_CHANGED_BEACON_INT: Beacon interval changed
|
||||||
*/
|
*/
|
||||||
enum ieee80211_bss_change {
|
enum ieee80211_bss_change {
|
||||||
BSS_CHANGED_ASSOC = 1<<0,
|
BSS_CHANGED_ASSOC = 1<<0,
|
||||||
|
@ -157,6 +158,7 @@ enum ieee80211_bss_change {
|
||||||
BSS_CHANGED_ERP_SLOT = 1<<3,
|
BSS_CHANGED_ERP_SLOT = 1<<3,
|
||||||
BSS_CHANGED_HT = 1<<4,
|
BSS_CHANGED_HT = 1<<4,
|
||||||
BSS_CHANGED_BASIC_RATES = 1<<5,
|
BSS_CHANGED_BASIC_RATES = 1<<5,
|
||||||
|
BSS_CHANGED_BEACON_INT = 1<<6,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -529,7 +531,7 @@ enum ieee80211_conf_flags {
|
||||||
* enum ieee80211_conf_changed - denotes which configuration changed
|
* enum ieee80211_conf_changed - denotes which configuration changed
|
||||||
*
|
*
|
||||||
* @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed
|
* @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed
|
||||||
* @IEEE80211_CONF_CHANGE_BEACON_INTERVAL: the beacon interval changed
|
* @_IEEE80211_CONF_CHANGE_BEACON_INTERVAL: DEPRECATED
|
||||||
* @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
|
* @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
|
||||||
* @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
|
* @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
|
||||||
* @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed
|
* @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed
|
||||||
|
@ -539,7 +541,7 @@ enum ieee80211_conf_flags {
|
||||||
*/
|
*/
|
||||||
enum ieee80211_conf_changed {
|
enum ieee80211_conf_changed {
|
||||||
IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
|
IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
|
||||||
IEEE80211_CONF_CHANGE_BEACON_INTERVAL = BIT(1),
|
_IEEE80211_CONF_CHANGE_BEACON_INTERVAL = BIT(1),
|
||||||
IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
|
IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
|
||||||
IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
|
IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
|
||||||
IEEE80211_CONF_CHANGE_PS = BIT(4),
|
IEEE80211_CONF_CHANGE_PS = BIT(4),
|
||||||
|
@ -548,6 +550,14 @@ enum ieee80211_conf_changed {
|
||||||
IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
|
IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline __deprecated enum ieee80211_conf_changed
|
||||||
|
__IEEE80211_CONF_CHANGE_BEACON_INTERVAL(void)
|
||||||
|
{
|
||||||
|
return _IEEE80211_CONF_CHANGE_BEACON_INTERVAL;
|
||||||
|
}
|
||||||
|
#define IEEE80211_CONF_CHANGE_BEACON_INTERVAL \
|
||||||
|
__IEEE80211_CONF_CHANGE_BEACON_INTERVAL()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ieee80211_conf - configuration of the device
|
* struct ieee80211_conf - configuration of the device
|
||||||
*
|
*
|
||||||
|
|
|
@ -451,18 +451,11 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
|
||||||
* This is a kludge. beacon interval should really be part
|
* This is a kludge. beacon interval should really be part
|
||||||
* of the beacon information.
|
* of the beacon information.
|
||||||
*/
|
*/
|
||||||
if (params->interval && (sdata->local->hw.conf.beacon_int !=
|
if (params->interval &&
|
||||||
params->interval)) {
|
(sdata->vif.bss_conf.beacon_int != params->interval)) {
|
||||||
sdata->local->hw.conf.beacon_int = params->interval;
|
sdata->vif.bss_conf.beacon_int = params->interval;
|
||||||
err = ieee80211_hw_config(sdata->local,
|
ieee80211_bss_info_change_notify(sdata,
|
||||||
IEEE80211_CONF_CHANGE_BEACON_INTERVAL);
|
BSS_CHANGED_BEACON_INT);
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
/*
|
|
||||||
* We updated some parameter so if below bails out
|
|
||||||
* it's not an error.
|
|
||||||
*/
|
|
||||||
err = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need to have a beacon head if we don't have one yet */
|
/* Need to have a beacon head if we don't have one yet */
|
||||||
|
|
|
@ -73,6 +73,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||||
struct ieee80211_mgmt *mgmt;
|
struct ieee80211_mgmt *mgmt;
|
||||||
u8 *pos;
|
u8 *pos;
|
||||||
struct ieee80211_supported_band *sband;
|
struct ieee80211_supported_band *sband;
|
||||||
|
u32 bss_change;
|
||||||
|
|
||||||
if (local->ops->reset_tsf) {
|
if (local->ops->reset_tsf) {
|
||||||
/* Reset own TSF to allow time synchronization work. */
|
/* Reset own TSF to allow time synchronization work. */
|
||||||
|
@ -92,8 +93,6 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||||
|
|
||||||
memcpy(ifibss->bssid, bssid, ETH_ALEN);
|
memcpy(ifibss->bssid, bssid, ETH_ALEN);
|
||||||
|
|
||||||
local->hw.conf.beacon_int = beacon_int >= 10 ? beacon_int : 10;
|
|
||||||
|
|
||||||
sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
|
sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
|
||||||
|
|
||||||
ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID);
|
ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID);
|
||||||
|
@ -101,6 +100,12 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||||
local->oper_channel = chan;
|
local->oper_channel = chan;
|
||||||
local->oper_channel_type = NL80211_CHAN_NO_HT;
|
local->oper_channel_type = NL80211_CHAN_NO_HT;
|
||||||
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
|
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
|
||||||
|
|
||||||
|
sdata->vif.bss_conf.beacon_int = beacon_int;
|
||||||
|
bss_change = BSS_CHANGED_BEACON_INT;
|
||||||
|
bss_change |= ieee80211_reset_erp_info(sdata);
|
||||||
|
ieee80211_bss_info_change_notify(sdata, bss_change);
|
||||||
|
|
||||||
sband = local->hw.wiphy->bands[chan->band];
|
sband = local->hw.wiphy->bands[chan->band];
|
||||||
|
|
||||||
/* Build IBSS probe response */
|
/* Build IBSS probe response */
|
||||||
|
@ -111,7 +116,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||||
memset(mgmt->da, 0xff, ETH_ALEN);
|
memset(mgmt->da, 0xff, ETH_ALEN);
|
||||||
memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
|
memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
|
||||||
memcpy(mgmt->bssid, ifibss->bssid, ETH_ALEN);
|
memcpy(mgmt->bssid, ifibss->bssid, ETH_ALEN);
|
||||||
mgmt->u.beacon.beacon_int = cpu_to_le16(local->hw.conf.beacon_int);
|
mgmt->u.beacon.beacon_int = cpu_to_le16(beacon_int);
|
||||||
mgmt->u.beacon.timestamp = cpu_to_le64(tsf);
|
mgmt->u.beacon.timestamp = cpu_to_le64(tsf);
|
||||||
mgmt->u.beacon.capab_info = cpu_to_le16(capability);
|
mgmt->u.beacon.capab_info = cpu_to_le16(capability);
|
||||||
|
|
||||||
|
@ -181,8 +186,13 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||||
static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||||
struct ieee80211_bss *bss)
|
struct ieee80211_bss *bss)
|
||||||
{
|
{
|
||||||
|
u16 beacon_int = bss->cbss.beacon_interval;
|
||||||
|
|
||||||
|
if (beacon_int < 10)
|
||||||
|
beacon_int = 10;
|
||||||
|
|
||||||
__ieee80211_sta_join_ibss(sdata, bss->cbss.bssid,
|
__ieee80211_sta_join_ibss(sdata, bss->cbss.bssid,
|
||||||
bss->cbss.beacon_interval,
|
beacon_int,
|
||||||
bss->cbss.channel,
|
bss->cbss.channel,
|
||||||
bss->supp_rates_len, bss->supp_rates,
|
bss->supp_rates_len, bss->supp_rates,
|
||||||
bss->cbss.capability,
|
bss->cbss.capability,
|
||||||
|
@ -464,9 +474,6 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
|
||||||
|
|
||||||
sband = local->hw.wiphy->bands[ifibss->channel->band];
|
sband = local->hw.wiphy->bands[ifibss->channel->band];
|
||||||
|
|
||||||
if (local->hw.conf.beacon_int == 0)
|
|
||||||
local->hw.conf.beacon_int = 100;
|
|
||||||
|
|
||||||
capability = WLAN_CAPABILITY_IBSS;
|
capability = WLAN_CAPABILITY_IBSS;
|
||||||
|
|
||||||
if (sdata->default_key)
|
if (sdata->default_key)
|
||||||
|
@ -480,7 +487,7 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
|
||||||
*pos++ = (u8) (rate / 5);
|
*pos++ = (u8) (rate / 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
__ieee80211_sta_join_ibss(sdata, bssid, local->hw.conf.beacon_int,
|
__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
|
||||||
ifibss->channel, sband->n_bitrates,
|
ifibss->channel, sband->n_bitrates,
|
||||||
supp_rates, capability, 0);
|
supp_rates, capability, 0);
|
||||||
}
|
}
|
||||||
|
@ -823,6 +830,8 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
|
||||||
} else
|
} else
|
||||||
sdata->u.ibss.fixed_bssid = false;
|
sdata->u.ibss.fixed_bssid = false;
|
||||||
|
|
||||||
|
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
|
||||||
|
|
||||||
sdata->u.ibss.channel = params->channel;
|
sdata->u.ibss.channel = params->channel;
|
||||||
sdata->u.ibss.fixed_channel = params->channel_fixed;
|
sdata->u.ibss.fixed_channel = params->channel_fixed;
|
||||||
|
|
||||||
|
|
|
@ -294,9 +294,6 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
|
||||||
{
|
{
|
||||||
struct ieee80211_local *local = sdata->local;
|
struct ieee80211_local *local = sdata->local;
|
||||||
|
|
||||||
if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!changed)
|
if (!changed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -305,6 +302,17 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
|
||||||
&sdata->vif,
|
&sdata->vif,
|
||||||
&sdata->vif.bss_conf,
|
&sdata->vif.bss_conf,
|
||||||
changed);
|
changed);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DEPRECATED
|
||||||
|
*
|
||||||
|
* ~changed is just there to not do this at resume time
|
||||||
|
*/
|
||||||
|
if (changed & BSS_CHANGED_BEACON_INT && ~changed) {
|
||||||
|
local->hw.conf.beacon_int = sdata->vif.bss_conf.beacon_int;
|
||||||
|
ieee80211_hw_config(local,
|
||||||
|
_IEEE80211_CONF_CHANGE_BEACON_INTERVAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
|
u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
|
||||||
|
@ -971,9 +979,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
|
||||||
|
|
||||||
debugfs_hw_add(local);
|
debugfs_hw_add(local);
|
||||||
|
|
||||||
if (local->hw.conf.beacon_int < 10)
|
|
||||||
local->hw.conf.beacon_int = 100;
|
|
||||||
|
|
||||||
if (local->hw.max_listen_interval == 0)
|
if (local->hw.max_listen_interval == 0)
|
||||||
local->hw.max_listen_interval = 1;
|
local->hw.max_listen_interval = 1;
|
||||||
|
|
||||||
|
|
|
@ -842,6 +842,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
|
||||||
sdata->vif.bss_conf.timestamp = bss->cbss.tsf;
|
sdata->vif.bss_conf.timestamp = bss->cbss.tsf;
|
||||||
sdata->vif.bss_conf.dtim_period = bss->dtim_period;
|
sdata->vif.bss_conf.dtim_period = bss->dtim_period;
|
||||||
|
|
||||||
|
bss_info_changed |= BSS_CHANGED_BEACON_INT;
|
||||||
bss_info_changed |= ieee80211_handle_bss_capability(sdata,
|
bss_info_changed |= ieee80211_handle_bss_capability(sdata,
|
||||||
bss->cbss.capability, bss->has_erp_value, bss->erp_value);
|
bss->cbss.capability, bss->has_erp_value, bss->erp_value);
|
||||||
|
|
||||||
|
|
|
@ -543,8 +543,7 @@ void sta_info_unlink(struct sta_info **sta)
|
||||||
spin_unlock_irqrestore(&local->sta_lock, flags);
|
spin_unlock_irqrestore(&local->sta_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int sta_info_buffer_expired(struct ieee80211_local *local,
|
static int sta_info_buffer_expired(struct sta_info *sta,
|
||||||
struct sta_info *sta,
|
|
||||||
struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ieee80211_tx_info *info;
|
struct ieee80211_tx_info *info;
|
||||||
|
@ -556,8 +555,9 @@ static inline int sta_info_buffer_expired(struct ieee80211_local *local,
|
||||||
info = IEEE80211_SKB_CB(skb);
|
info = IEEE80211_SKB_CB(skb);
|
||||||
|
|
||||||
/* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */
|
/* Timeout: (2 * listen_interval * beacon_int * 1024 / 1000000) sec */
|
||||||
timeout = (sta->listen_interval * local->hw.conf.beacon_int * 32 /
|
timeout = (sta->listen_interval *
|
||||||
15625) * HZ;
|
sta->sdata->vif.bss_conf.beacon_int *
|
||||||
|
32 / 15625) * HZ;
|
||||||
if (timeout < STA_TX_BUFFER_EXPIRE)
|
if (timeout < STA_TX_BUFFER_EXPIRE)
|
||||||
timeout = STA_TX_BUFFER_EXPIRE;
|
timeout = STA_TX_BUFFER_EXPIRE;
|
||||||
return time_after(jiffies, info->control.jiffies + timeout);
|
return time_after(jiffies, info->control.jiffies + timeout);
|
||||||
|
@ -577,7 +577,7 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
|
||||||
for (;;) {
|
for (;;) {
|
||||||
spin_lock_irqsave(&sta->ps_tx_buf.lock, flags);
|
spin_lock_irqsave(&sta->ps_tx_buf.lock, flags);
|
||||||
skb = skb_peek(&sta->ps_tx_buf);
|
skb = skb_peek(&sta->ps_tx_buf);
|
||||||
if (sta_info_buffer_expired(local, sta, skb))
|
if (sta_info_buffer_expired(sta, skb))
|
||||||
skb = __skb_dequeue(&sta->ps_tx_buf);
|
skb = __skb_dequeue(&sta->ps_tx_buf);
|
||||||
else
|
else
|
||||||
skb = NULL;
|
skb = NULL;
|
||||||
|
|
|
@ -2132,7 +2132,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
|
||||||
memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
|
memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
|
||||||
/* BSSID is left zeroed, wildcard value */
|
/* BSSID is left zeroed, wildcard value */
|
||||||
mgmt->u.beacon.beacon_int =
|
mgmt->u.beacon.beacon_int =
|
||||||
cpu_to_le16(local->hw.conf.beacon_int);
|
cpu_to_le16(sdata->vif.bss_conf.beacon_int);
|
||||||
mgmt->u.beacon.capab_info = 0x0; /* 0x0 for MPs */
|
mgmt->u.beacon.capab_info = 0x0; /* 0x0 for MPs */
|
||||||
|
|
||||||
pos = skb_put(skb, 2);
|
pos = skb_put(skb, 2);
|
||||||
|
|
Loading…
Reference in New Issue