mwl8k: allow setting HT channels
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
9e1b17ead8
commit
610677d2f0
|
@ -2030,8 +2030,9 @@ struct mwl8k_cmd_set_rf_channel {
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
|
static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
|
||||||
struct ieee80211_channel *channel)
|
struct ieee80211_conf *conf)
|
||||||
{
|
{
|
||||||
|
struct ieee80211_channel *channel = conf->channel;
|
||||||
struct mwl8k_cmd_set_rf_channel *cmd;
|
struct mwl8k_cmd_set_rf_channel *cmd;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -2043,10 +2044,17 @@ static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
|
||||||
cmd->header.length = cpu_to_le16(sizeof(*cmd));
|
cmd->header.length = cpu_to_le16(sizeof(*cmd));
|
||||||
cmd->action = cpu_to_le16(MWL8K_CMD_SET);
|
cmd->action = cpu_to_le16(MWL8K_CMD_SET);
|
||||||
cmd->current_channel = channel->hw_value;
|
cmd->current_channel = channel->hw_value;
|
||||||
|
|
||||||
if (channel->band == IEEE80211_BAND_2GHZ)
|
if (channel->band == IEEE80211_BAND_2GHZ)
|
||||||
cmd->channel_flags = cpu_to_le32(0x00000081);
|
cmd->channel_flags |= cpu_to_le32(0x00000001);
|
||||||
else
|
|
||||||
cmd->channel_flags = cpu_to_le32(0x00000000);
|
if (conf->channel_type == NL80211_CHAN_NO_HT ||
|
||||||
|
conf->channel_type == NL80211_CHAN_HT20)
|
||||||
|
cmd->channel_flags |= cpu_to_le32(0x00000080);
|
||||||
|
else if (conf->channel_type == NL80211_CHAN_HT40MINUS)
|
||||||
|
cmd->channel_flags |= cpu_to_le32(0x000001900);
|
||||||
|
else if (conf->channel_type == NL80211_CHAN_HT40PLUS)
|
||||||
|
cmd->channel_flags |= cpu_to_le32(0x000000900);
|
||||||
|
|
||||||
rc = mwl8k_post_cmd(hw, &cmd->header);
|
rc = mwl8k_post_cmd(hw, &cmd->header);
|
||||||
kfree(cmd);
|
kfree(cmd);
|
||||||
|
@ -2926,7 +2934,7 @@ static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
|
||||||
if (rc)
|
if (rc)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rc = mwl8k_cmd_set_rf_channel(hw, conf->channel);
|
rc = mwl8k_cmd_set_rf_channel(hw, conf);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue