aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sta_cmdresp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmdresp.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 43ede5e58851..e0178c0829d7 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -267,12 +267,10 @@ static int mwifiex_ret_get_log(struct mwifiex_private *priv,
267 * 267 *
268 * Based on the new rate bitmaps, the function re-evaluates if 268 * Based on the new rate bitmaps, the function re-evaluates if
269 * auto data rate has been activated. If not, it sends another 269 * auto data rate has been activated. If not, it sends another
270 * query to the firmware to get the current Tx data rate and updates 270 * query to the firmware to get the current Tx data rate.
271 * the driver value.
272 */ 271 */
273static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv, 272static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
274 struct host_cmd_ds_command *resp, 273 struct host_cmd_ds_command *resp)
275 struct mwifiex_rate_cfg *ds_rate)
276{ 274{
277 struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; 275 struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg;
278 struct mwifiex_rate_scope *rate_scope; 276 struct mwifiex_rate_scope *rate_scope;
@@ -280,7 +278,6 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
280 u16 tlv, tlv_buf_len; 278 u16 tlv, tlv_buf_len;
281 u8 *tlv_buf; 279 u8 *tlv_buf;
282 u32 i; 280 u32 i;
283 int ret = 0;
284 281
285 tlv_buf = (u8 *) ((u8 *) rate_cfg) + 282 tlv_buf = (u8 *) ((u8 *) rate_cfg) +
286 sizeof(struct host_cmd_ds_tx_rate_cfg); 283 sizeof(struct host_cmd_ds_tx_rate_cfg);
@@ -318,33 +315,11 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
318 if (priv->is_data_rate_auto) 315 if (priv->is_data_rate_auto)
319 priv->data_rate = 0; 316 priv->data_rate = 0;
320 else 317 else
321 ret = mwifiex_send_cmd_async(priv, 318 return mwifiex_send_cmd_async(priv,
322 HostCmd_CMD_802_11_TX_RATE_QUERY, 319 HostCmd_CMD_802_11_TX_RATE_QUERY,
323 HostCmd_ACT_GEN_GET, 0, NULL); 320 HostCmd_ACT_GEN_GET, 0, NULL);
324
325 if (!ds_rate)
326 return ret;
327
328 if (le16_to_cpu(rate_cfg->action) == HostCmd_ACT_GEN_GET) {
329 if (priv->is_data_rate_auto) {
330 ds_rate->is_rate_auto = 1;
331 return ret;
332 }
333 ds_rate->rate = mwifiex_get_rate_index(priv->bitmap_rates,
334 sizeof(priv->bitmap_rates));
335
336 if (ds_rate->rate >= MWIFIEX_RATE_BITMAP_OFDM0 &&
337 ds_rate->rate <= MWIFIEX_RATE_BITMAP_OFDM7)
338 ds_rate->rate -= (MWIFIEX_RATE_BITMAP_OFDM0 -
339 MWIFIEX_RATE_INDEX_OFDM0);
340
341 if (ds_rate->rate >= MWIFIEX_RATE_BITMAP_MCS0 &&
342 ds_rate->rate <= MWIFIEX_RATE_BITMAP_MCS127)
343 ds_rate->rate -= (MWIFIEX_RATE_BITMAP_MCS0 -
344 MWIFIEX_RATE_INDEX_MCS0);
345 }
346 321
347 return ret; 322 return 0;
348} 323}
349 324
350/* 325/*
@@ -856,7 +831,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
856 ret = mwifiex_ret_mac_multicast_adr(priv, resp); 831 ret = mwifiex_ret_mac_multicast_adr(priv, resp);
857 break; 832 break;
858 case HostCmd_CMD_TX_RATE_CFG: 833 case HostCmd_CMD_TX_RATE_CFG:
859 ret = mwifiex_ret_tx_rate_cfg(priv, resp, data_buf); 834 ret = mwifiex_ret_tx_rate_cfg(priv, resp);
860 break; 835 break;
861 case HostCmd_CMD_802_11_SCAN: 836 case HostCmd_CMD_802_11_SCAN:
862 ret = mwifiex_ret_802_11_scan(priv, resp); 837 ret = mwifiex_ret_802_11_scan(priv, resp);