mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 12:24:34 +08:00
wl12xx: AP mode config in ieee80211_ops.config
Separate configuration according to mode. AP has different rate set configuration and no handling of idle-state. Signed-off-by: Arik Nemtsov <arik@wizery.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
This commit is contained in:
parent
e78a287ab7
commit
bee0ffec77
@ -1362,7 +1362,7 @@ static void wl1271_set_band_rate(struct wl1271 *wl)
|
|||||||
wl->basic_rate_set = wl->conf.tx.basic_rate_5;
|
wl->basic_rate_set = wl->conf.tx.basic_rate_5;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wl1271_handle_idle(struct wl1271 *wl, bool idle)
|
static int wl1271_sta_handle_idle(struct wl1271 *wl, bool idle)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1403,14 +1403,17 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
|
|||||||
struct wl1271 *wl = hw->priv;
|
struct wl1271 *wl = hw->priv;
|
||||||
struct ieee80211_conf *conf = &hw->conf;
|
struct ieee80211_conf *conf = &hw->conf;
|
||||||
int channel, ret = 0;
|
int channel, ret = 0;
|
||||||
|
bool is_ap;
|
||||||
|
|
||||||
channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
|
channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
|
||||||
|
|
||||||
wl1271_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d %s",
|
wl1271_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d %s"
|
||||||
|
" changed 0x%x",
|
||||||
channel,
|
channel,
|
||||||
conf->flags & IEEE80211_CONF_PS ? "on" : "off",
|
conf->flags & IEEE80211_CONF_PS ? "on" : "off",
|
||||||
conf->power_level,
|
conf->power_level,
|
||||||
conf->flags & IEEE80211_CONF_IDLE ? "idle" : "in use");
|
conf->flags & IEEE80211_CONF_IDLE ? "idle" : "in use",
|
||||||
|
changed);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mac80211 will go to idle nearly immediately after transmitting some
|
* mac80211 will go to idle nearly immediately after transmitting some
|
||||||
@ -1428,6 +1431,8 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_ap = (wl->bss_type == BSS_TYPE_AP_BSS);
|
||||||
|
|
||||||
ret = wl1271_ps_elp_wakeup(wl, false);
|
ret = wl1271_ps_elp_wakeup(wl, false);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
@ -1439,11 +1444,12 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
|
|||||||
wl->band = conf->channel->band;
|
wl->band = conf->channel->band;
|
||||||
wl->channel = channel;
|
wl->channel = channel;
|
||||||
|
|
||||||
|
if (!is_ap) {
|
||||||
/*
|
/*
|
||||||
* FIXME: the mac80211 should really provide a fixed rate
|
* FIXME: the mac80211 should really provide a fixed
|
||||||
* to use here. for now, just use the smallest possible rate
|
* rate to use here. for now, just use the smallest
|
||||||
* for the band as a fixed rate for association frames and
|
* possible rate for the band as a fixed rate for
|
||||||
* other control messages.
|
* association frames and other control messages.
|
||||||
*/
|
*/
|
||||||
if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
|
if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
|
||||||
wl1271_set_band_rate(wl);
|
wl1271_set_band_rate(wl);
|
||||||
@ -1451,19 +1457,21 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
|
|||||||
wl->basic_rate = wl1271_tx_min_rate_get(wl);
|
wl->basic_rate = wl1271_tx_min_rate_get(wl);
|
||||||
ret = wl1271_acx_sta_rate_policies(wl);
|
ret = wl1271_acx_sta_rate_policies(wl);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
wl1271_warning("rate policy for update channel "
|
wl1271_warning("rate policy for channel "
|
||||||
"failed %d", ret);
|
"failed %d", ret);
|
||||||
|
|
||||||
if (test_bit(WL1271_FLAG_JOINED, &wl->flags)) {
|
if (test_bit(WL1271_FLAG_JOINED, &wl->flags)) {
|
||||||
ret = wl1271_join(wl, false);
|
ret = wl1271_join(wl, false);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
wl1271_warning("cmd join to update channel "
|
wl1271_warning("cmd join on channel "
|
||||||
"failed %d", ret);
|
"failed %d", ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
|
if (changed & IEEE80211_CONF_CHANGE_IDLE && !is_ap) {
|
||||||
ret = wl1271_handle_idle(wl, conf->flags & IEEE80211_CONF_IDLE);
|
ret = wl1271_sta_handle_idle(wl,
|
||||||
|
conf->flags & IEEE80211_CONF_IDLE);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
wl1271_warning("idle mode change failed %d", ret);
|
wl1271_warning("idle mode change failed %d", ret);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user