diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2012-07-02 22:32:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:36:21 -0400 |
commit | 8a279d5b4dc128a4fcc3f8c545603adbce59bcfa (patch) | |
tree | d7527ea95cda67b13b73ef30ae475c3eeae1da66 /drivers/net/wireless/mwifiex/sta_cmd.c | |
parent | 83bfea42190b72acc1a1653bc10b21e741490087 (diff) |
mwifiex: add set_antenna handler support
This enables user to set mode of Tx/Rx path using "iw set antenna"
command. For non MIMO chips, the command will be used for selecting
specific antenna or configuring antenna diversity mode.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmd.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmd.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c index 2d4319a8941f..75eaa6f877fa 100644 --- a/drivers/net/wireless/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/mwifiex/sta_cmd.c | |||
@@ -277,6 +277,39 @@ static int mwifiex_cmd_rf_tx_power(struct mwifiex_private *priv, | |||
277 | } | 277 | } |
278 | 278 | ||
279 | /* | 279 | /* |
280 | * This function prepares command to set rf antenna. | ||
281 | */ | ||
282 | static int mwifiex_cmd_rf_antenna(struct mwifiex_private *priv, | ||
283 | struct host_cmd_ds_command *cmd, | ||
284 | u16 cmd_action, | ||
285 | struct mwifiex_ds_ant_cfg *ant_cfg) | ||
286 | { | ||
287 | struct host_cmd_ds_rf_ant_mimo *ant_mimo = &cmd->params.ant_mimo; | ||
288 | struct host_cmd_ds_rf_ant_siso *ant_siso = &cmd->params.ant_siso; | ||
289 | |||
290 | cmd->command = cpu_to_le16(HostCmd_CMD_RF_ANTENNA); | ||
291 | |||
292 | if (cmd_action != HostCmd_ACT_GEN_SET) | ||
293 | return 0; | ||
294 | |||
295 | if (priv->adapter->hw_dev_mcs_support == HT_STREAM_2X2) { | ||
296 | cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_rf_ant_mimo) + | ||
297 | S_DS_GEN); | ||
298 | ant_mimo->action_tx = cpu_to_le16(HostCmd_ACT_SET_TX); | ||
299 | ant_mimo->tx_ant_mode = cpu_to_le16((u16)ant_cfg->tx_ant); | ||
300 | ant_mimo->action_rx = cpu_to_le16(HostCmd_ACT_SET_RX); | ||
301 | ant_mimo->rx_ant_mode = cpu_to_le16((u16)ant_cfg->rx_ant); | ||
302 | } else { | ||
303 | cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_rf_ant_siso) + | ||
304 | S_DS_GEN); | ||
305 | ant_siso->action = cpu_to_le16(HostCmd_ACT_SET_BOTH); | ||
306 | ant_siso->ant_mode = cpu_to_le16((u16)ant_cfg->tx_ant); | ||
307 | } | ||
308 | |||
309 | return 0; | ||
310 | } | ||
311 | |||
312 | /* | ||
280 | * This function prepares command to set Host Sleep configuration. | 313 | * This function prepares command to set Host Sleep configuration. |
281 | * | 314 | * |
282 | * Preparation includes - | 315 | * Preparation includes - |
@@ -1076,6 +1109,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, | |||
1076 | ret = mwifiex_cmd_rf_tx_power(priv, cmd_ptr, cmd_action, | 1109 | ret = mwifiex_cmd_rf_tx_power(priv, cmd_ptr, cmd_action, |
1077 | data_buf); | 1110 | data_buf); |
1078 | break; | 1111 | break; |
1112 | case HostCmd_CMD_RF_ANTENNA: | ||
1113 | ret = mwifiex_cmd_rf_antenna(priv, cmd_ptr, cmd_action, | ||
1114 | data_buf); | ||
1115 | break; | ||
1079 | case HostCmd_CMD_802_11_PS_MODE_ENH: | 1116 | case HostCmd_CMD_802_11_PS_MODE_ENH: |
1080 | ret = mwifiex_cmd_enh_power_mode(priv, cmd_ptr, cmd_action, | 1117 | ret = mwifiex_cmd_enh_power_mode(priv, cmd_ptr, cmd_action, |
1081 | (uint16_t)cmd_oid, data_buf); | 1118 | (uint16_t)cmd_oid, data_buf); |