2 * Marvell Wireless LAN device driver: station command response handling
4 * Copyright (C) 2011-2014, Marvell International Ltd.
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
31 * This function handles the command response error case.
33 * For scan response error, the function cancels all the pending
34 * scan commands and generates an event to inform the applications
35 * of the scan completion.
37 * For Power Save command failure, we do not retry enter PS
38 * command in case of Ad-hoc mode.
40 * For all other response errors, the current command buffer is freed
41 * and returned to the free command queue.
44 mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
45 struct host_cmd_ds_command *resp)
47 struct mwifiex_adapter *adapter = priv->adapter;
48 struct host_cmd_ds_802_11_ps_mode_enh *pm;
51 mwifiex_dbg(adapter, ERROR,
52 "CMD_RESP: cmd %#x error, result=%#x\n",
53 resp->command, resp->result);
55 if (adapter->curr_cmd->wait_q_enabled)
56 adapter->cmd_wait_q.status = -1;
58 switch (le16_to_cpu(resp->command)) {
59 case HostCmd_CMD_802_11_PS_MODE_ENH:
60 pm = &resp->params.psmode_enh;
61 mwifiex_dbg(adapter, ERROR,
62 "PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n",
63 resp->result, le16_to_cpu(pm->action));
64 /* We do not re-try enter-ps command in ad-hoc mode. */
65 if (le16_to_cpu(pm->action) == EN_AUTO_PS &&
66 (le16_to_cpu(pm->params.ps_bitmap) & BITMAP_STA_PS) &&
67 priv->bss_mode == NL80211_IFTYPE_ADHOC)
68 adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM;
71 case HostCmd_CMD_802_11_SCAN:
72 case HostCmd_CMD_802_11_SCAN_EXT:
73 mwifiex_cancel_pending_scan_cmd(adapter);
75 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
76 adapter->scan_processing = false;
77 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
80 case HostCmd_CMD_MAC_CONTROL:
83 case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG:
84 mwifiex_dbg(adapter, MSG,
85 "SDIO RX single-port aggregation Not support\n");
91 /* Handling errors here */
92 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd);
94 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
95 adapter->curr_cmd = NULL;
96 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
100 * This function handles the command response of get RSSI info.
102 * Handling includes changing the header fields into CPU format
103 * and saving the following parameters in driver -
104 * - Last data and beacon RSSI value
105 * - Average data and beacon RSSI value
106 * - Last data and beacon NF value
107 * - Average data and beacon NF value
109 * The parameters are send to the application as well, along with
110 * calculated SNR values.
112 static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv,
113 struct host_cmd_ds_command *resp)
115 struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp =
116 &resp->params.rssi_info_rsp;
117 struct mwifiex_ds_misc_subsc_evt *subsc_evt =
118 &priv->async_subsc_evt_storage;
120 priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last);
121 priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last);
123 priv->data_rssi_avg = le16_to_cpu(rssi_info_rsp->data_rssi_avg);
124 priv->data_nf_avg = le16_to_cpu(rssi_info_rsp->data_nf_avg);
126 priv->bcn_rssi_last = le16_to_cpu(rssi_info_rsp->bcn_rssi_last);
127 priv->bcn_nf_last = le16_to_cpu(rssi_info_rsp->bcn_nf_last);
129 priv->bcn_rssi_avg = le16_to_cpu(rssi_info_rsp->bcn_rssi_avg);
130 priv->bcn_nf_avg = le16_to_cpu(rssi_info_rsp->bcn_nf_avg);
132 if (priv->subsc_evt_rssi_state == EVENT_HANDLED)
135 memset(subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt));
137 /* Resubscribe low and high rssi events with new thresholds */
138 subsc_evt->events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH;
139 subsc_evt->action = HostCmd_ACT_BITWISE_SET;
140 if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) {
141 subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg -
142 priv->cqm_rssi_hyst);
143 subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold);
144 } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) {
145 subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold);
146 subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg +
147 priv->cqm_rssi_hyst);
149 subsc_evt->bcn_l_rssi_cfg.evt_freq = 1;
150 subsc_evt->bcn_h_rssi_cfg.evt_freq = 1;
152 priv->subsc_evt_rssi_state = EVENT_HANDLED;
154 mwifiex_send_cmd(priv, HostCmd_CMD_802_11_SUBSCRIBE_EVENT,
155 0, 0, subsc_evt, false);
161 * This function handles the command response of set/get SNMP
164 * Handling includes changing the header fields into CPU format
165 * and saving the parameter in driver.
167 * The following parameters are supported -
168 * - Fragmentation threshold
170 * - Short retry limit
172 static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv,
173 struct host_cmd_ds_command *resp,
176 struct host_cmd_ds_802_11_snmp_mib *smib = &resp->params.smib;
177 u16 oid = le16_to_cpu(smib->oid);
178 u16 query_type = le16_to_cpu(smib->query_type);
181 mwifiex_dbg(priv->adapter, INFO,
182 "info: SNMP_RESP: oid value = %#x,\t"
183 "query_type = %#x, buf size = %#x\n",
184 oid, query_type, le16_to_cpu(smib->buf_size));
185 if (query_type == HostCmd_ACT_GEN_GET) {
186 ul_temp = get_unaligned_le16(smib->value);
191 mwifiex_dbg(priv->adapter, INFO,
192 "info: SNMP_RESP: FragThsd =%u\n",
196 mwifiex_dbg(priv->adapter, INFO,
197 "info: SNMP_RESP: RTSThsd =%u\n",
200 case SHORT_RETRY_LIM_I:
201 mwifiex_dbg(priv->adapter, INFO,
202 "info: SNMP_RESP: TxRetryCount=%u\n",
206 mwifiex_dbg(priv->adapter, INFO,
207 "info: SNMP_RESP: DTIM period=%u\n",
218 * This function handles the command response of get log request
220 * Handling includes changing the header fields into CPU format
221 * and sending the received parameters to application.
223 static int mwifiex_ret_get_log(struct mwifiex_private *priv,
224 struct host_cmd_ds_command *resp,
225 struct mwifiex_ds_get_stats *stats)
227 struct host_cmd_ds_802_11_get_log *get_log =
228 &resp->params.get_log;
231 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame);
232 stats->failed = le32_to_cpu(get_log->failed);
233 stats->retry = le32_to_cpu(get_log->retry);
234 stats->multi_retry = le32_to_cpu(get_log->multi_retry);
235 stats->frame_dup = le32_to_cpu(get_log->frame_dup);
236 stats->rts_success = le32_to_cpu(get_log->rts_success);
237 stats->rts_failure = le32_to_cpu(get_log->rts_failure);
238 stats->ack_failure = le32_to_cpu(get_log->ack_failure);
239 stats->rx_frag = le32_to_cpu(get_log->rx_frag);
240 stats->mcast_rx_frame = le32_to_cpu(get_log->mcast_rx_frame);
241 stats->fcs_error = le32_to_cpu(get_log->fcs_error);
242 stats->tx_frame = le32_to_cpu(get_log->tx_frame);
243 stats->wep_icv_error[0] =
244 le32_to_cpu(get_log->wep_icv_err_cnt[0]);
245 stats->wep_icv_error[1] =
246 le32_to_cpu(get_log->wep_icv_err_cnt[1]);
247 stats->wep_icv_error[2] =
248 le32_to_cpu(get_log->wep_icv_err_cnt[2]);
249 stats->wep_icv_error[3] =
250 le32_to_cpu(get_log->wep_icv_err_cnt[3]);
251 stats->bcn_rcv_cnt = le32_to_cpu(get_log->bcn_rcv_cnt);
252 stats->bcn_miss_cnt = le32_to_cpu(get_log->bcn_miss_cnt);
259 * This function handles the command response of set/get Tx rate
262 * Handling includes changing the header fields into CPU format
263 * and saving the following parameters in driver -
266 * - HT MCS rate bitmaps
268 * Based on the new rate bitmaps, the function re-evaluates if
269 * auto data rate has been activated. If not, it sends another
270 * query to the firmware to get the current Tx data rate.
272 static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
273 struct host_cmd_ds_command *resp)
275 struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg;
276 struct mwifiex_rate_scope *rate_scope;
277 struct mwifiex_ie_types_header *head;
278 u16 tlv, tlv_buf_len, tlv_buf_left;
282 tlv_buf = ((u8 *)rate_cfg) + sizeof(struct host_cmd_ds_tx_rate_cfg);
283 tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*rate_cfg);
285 while (tlv_buf_left >= sizeof(*head)) {
286 head = (struct mwifiex_ie_types_header *)tlv_buf;
287 tlv = le16_to_cpu(head->type);
288 tlv_buf_len = le16_to_cpu(head->len);
290 if (tlv_buf_left < (sizeof(*head) + tlv_buf_len))
294 case TLV_TYPE_RATE_SCOPE:
295 rate_scope = (struct mwifiex_rate_scope *) tlv_buf;
296 priv->bitmap_rates[0] =
297 le16_to_cpu(rate_scope->hr_dsss_rate_bitmap);
298 priv->bitmap_rates[1] =
299 le16_to_cpu(rate_scope->ofdm_rate_bitmap);
301 i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap);
303 priv->bitmap_rates[2 + i] =
304 le16_to_cpu(rate_scope->
305 ht_mcs_rate_bitmap[i]);
307 if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) {
308 for (i = 0; i < ARRAY_SIZE(rate_scope->
309 vht_mcs_rate_bitmap);
311 priv->bitmap_rates[10 + i] =
312 le16_to_cpu(rate_scope->
313 vht_mcs_rate_bitmap[i]);
316 /* Add RATE_DROP tlv here */
319 tlv_buf += (sizeof(*head) + tlv_buf_len);
320 tlv_buf_left -= (sizeof(*head) + tlv_buf_len);
323 priv->is_data_rate_auto = mwifiex_is_rate_auto(priv);
325 if (priv->is_data_rate_auto)
328 return mwifiex_send_cmd(priv, HostCmd_CMD_802_11_TX_RATE_QUERY,
329 HostCmd_ACT_GEN_GET, 0, NULL, false);
335 * This function handles the command response of get Tx power level.
337 * Handling includes saving the maximum and minimum Tx power levels
338 * in driver, as well as sending the values to user.
340 static int mwifiex_get_power_level(struct mwifiex_private *priv, void *data_buf)
342 int length, max_power = -1, min_power = -1;
343 struct mwifiex_types_power_group *pg_tlv_hdr;
344 struct mwifiex_power_group *pg;
349 pg_tlv_hdr = (struct mwifiex_types_power_group *)((u8 *)data_buf);
350 pg = (struct mwifiex_power_group *)
351 ((u8 *) pg_tlv_hdr + sizeof(struct mwifiex_types_power_group));
352 length = le16_to_cpu(pg_tlv_hdr->length);
354 /* At least one structure required to update power */
355 if (length < sizeof(struct mwifiex_power_group))
358 max_power = pg->power_max;
359 min_power = pg->power_min;
360 length -= sizeof(struct mwifiex_power_group);
362 while (length >= sizeof(struct mwifiex_power_group)) {
364 if (max_power < pg->power_max)
365 max_power = pg->power_max;
367 if (min_power > pg->power_min)
368 min_power = pg->power_min;
370 length -= sizeof(struct mwifiex_power_group);
372 priv->min_tx_power_level = (u8) min_power;
373 priv->max_tx_power_level = (u8) max_power;
379 * This function handles the command response of set/get Tx power
382 * Handling includes changing the header fields into CPU format
383 * and saving the current Tx power level in driver.
385 static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv,
386 struct host_cmd_ds_command *resp)
388 struct mwifiex_adapter *adapter = priv->adapter;
389 struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg;
390 struct mwifiex_types_power_group *pg_tlv_hdr;
391 struct mwifiex_power_group *pg;
392 u16 action = le16_to_cpu(txp_cfg->action);
395 pg_tlv_hdr = (struct mwifiex_types_power_group *)
397 sizeof(struct host_cmd_ds_txpwr_cfg));
399 pg = (struct mwifiex_power_group *)
401 sizeof(struct mwifiex_types_power_group));
403 tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*txp_cfg);
405 le16_to_cpu(pg_tlv_hdr->length) + sizeof(*pg_tlv_hdr))
409 case HostCmd_ACT_GEN_GET:
410 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
411 mwifiex_get_power_level(priv, pg_tlv_hdr);
413 priv->tx_power_level = (u16) pg->power_min;
416 case HostCmd_ACT_GEN_SET:
417 if (!le32_to_cpu(txp_cfg->mode))
420 if (pg->power_max == pg->power_min)
421 priv->tx_power_level = (u16) pg->power_min;
424 mwifiex_dbg(adapter, ERROR,
425 "CMD_RESP: unknown cmd action %d\n",
429 mwifiex_dbg(adapter, INFO,
430 "info: Current TxPower Level = %d, Max Power=%d, Min Power=%d\n",
431 priv->tx_power_level, priv->max_tx_power_level,
432 priv->min_tx_power_level);
438 * This function handles the command response of get RF Tx power.
440 static int mwifiex_ret_rf_tx_power(struct mwifiex_private *priv,
441 struct host_cmd_ds_command *resp)
443 struct host_cmd_ds_rf_tx_pwr *txp = &resp->params.txp;
444 u16 action = le16_to_cpu(txp->action);
446 priv->tx_power_level = le16_to_cpu(txp->cur_level);
448 if (action == HostCmd_ACT_GEN_GET) {
449 priv->max_tx_power_level = txp->max_power;
450 priv->min_tx_power_level = txp->min_power;
453 mwifiex_dbg(priv->adapter, INFO,
454 "Current TxPower Level=%d, Max Power=%d, Min Power=%d\n",
455 priv->tx_power_level, priv->max_tx_power_level,
456 priv->min_tx_power_level);
462 * This function handles the command response of set rf antenna
464 static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv,
465 struct host_cmd_ds_command *resp)
467 struct host_cmd_ds_rf_ant_mimo *ant_mimo = &resp->params.ant_mimo;
468 struct host_cmd_ds_rf_ant_siso *ant_siso = &resp->params.ant_siso;
469 struct mwifiex_adapter *adapter = priv->adapter;
471 if (adapter->hw_dev_mcs_support == HT_STREAM_2X2) {
472 priv->tx_ant = le16_to_cpu(ant_mimo->tx_ant_mode);
473 priv->rx_ant = le16_to_cpu(ant_mimo->rx_ant_mode);
474 mwifiex_dbg(adapter, INFO,
475 "RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x\t"
476 "Rx action = 0x%x, Rx Mode = 0x%04x\n",
477 le16_to_cpu(ant_mimo->action_tx),
478 le16_to_cpu(ant_mimo->tx_ant_mode),
479 le16_to_cpu(ant_mimo->action_rx),
480 le16_to_cpu(ant_mimo->rx_ant_mode));
482 priv->tx_ant = le16_to_cpu(ant_siso->ant_mode);
483 priv->rx_ant = le16_to_cpu(ant_siso->ant_mode);
484 mwifiex_dbg(adapter, INFO,
485 "RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n",
486 le16_to_cpu(ant_siso->action),
487 le16_to_cpu(ant_siso->ant_mode));
493 * This function handles the command response of set/get MAC address.
495 * Handling includes saving the MAC address in driver.
497 static int mwifiex_ret_802_11_mac_address(struct mwifiex_private *priv,
498 struct host_cmd_ds_command *resp)
500 struct host_cmd_ds_802_11_mac_address *cmd_mac_addr =
501 &resp->params.mac_addr;
503 memcpy(priv->curr_addr, cmd_mac_addr->mac_addr, ETH_ALEN);
505 mwifiex_dbg(priv->adapter, INFO,
506 "info: set mac address: %pM\n", priv->curr_addr);
512 * This function handles the command response of set/get MAC multicast
515 static int mwifiex_ret_mac_multicast_adr(struct mwifiex_private *priv,
516 struct host_cmd_ds_command *resp)
522 * This function handles the command response of get Tx rate query.
524 * Handling includes changing the header fields into CPU format
525 * and saving the Tx rate and HT information parameters in driver.
527 * Both rate configuration and current data rate can be retrieved
530 static int mwifiex_ret_802_11_tx_rate_query(struct mwifiex_private *priv,
531 struct host_cmd_ds_command *resp)
533 priv->tx_rate = resp->params.tx_rate.tx_rate;
534 priv->tx_htinfo = resp->params.tx_rate.ht_info;
535 if (!priv->is_data_rate_auto)
537 mwifiex_index_to_data_rate(priv, priv->tx_rate,
544 * This function handles the command response of a deauthenticate
547 * If the deauthenticated MAC matches the current BSS MAC, the connection
550 static int mwifiex_ret_802_11_deauthenticate(struct mwifiex_private *priv,
551 struct host_cmd_ds_command *resp)
553 struct mwifiex_adapter *adapter = priv->adapter;
555 adapter->dbg.num_cmd_deauth++;
556 if (!memcmp(resp->params.deauth.mac_addr,
557 &priv->curr_bss_params.bss_descriptor.mac_address,
558 sizeof(resp->params.deauth.mac_addr)))
559 mwifiex_reset_connect_state(priv, WLAN_REASON_DEAUTH_LEAVING,
566 * This function handles the command response of ad-hoc stop.
568 * The function resets the connection state in driver.
570 static int mwifiex_ret_802_11_ad_hoc_stop(struct mwifiex_private *priv,
571 struct host_cmd_ds_command *resp)
573 mwifiex_reset_connect_state(priv, WLAN_REASON_DEAUTH_LEAVING, false);
578 * This function handles the command response of set/get v1 key material.
580 * Handling includes updating the driver parameters to reflect the
583 static int mwifiex_ret_802_11_key_material_v1(struct mwifiex_private *priv,
584 struct host_cmd_ds_command *resp)
586 struct host_cmd_ds_802_11_key_material *key =
587 &resp->params.key_material;
590 len = le16_to_cpu(key->key_param_set.key_len);
591 if (len > sizeof(key->key_param_set.key))
594 if (le16_to_cpu(key->action) == HostCmd_ACT_GEN_SET) {
595 if ((le16_to_cpu(key->key_param_set.key_info) & KEY_MCAST)) {
596 mwifiex_dbg(priv->adapter, INFO,
597 "info: key: GTK is set\n");
598 priv->wpa_is_gtk_set = true;
599 priv->scan_block = false;
600 priv->port_open = true;
604 memset(priv->aes_key.key_param_set.key, 0,
605 sizeof(key->key_param_set.key));
606 priv->aes_key.key_param_set.key_len = cpu_to_le16(len);
607 memcpy(priv->aes_key.key_param_set.key, key->key_param_set.key, len);
613 * This function handles the command response of set/get v2 key material.
615 * Handling includes updating the driver parameters to reflect the
618 static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv,
619 struct host_cmd_ds_command *resp)
621 struct host_cmd_ds_802_11_key_material_v2 *key_v2;
624 key_v2 = &resp->params.key_material_v2;
626 len = le16_to_cpu(key_v2->key_param_set.key_params.aes.key_len);
627 if (len > sizeof(key_v2->key_param_set.key_params.aes.key))
630 if (le16_to_cpu(key_v2->action) == HostCmd_ACT_GEN_SET) {
631 if ((le16_to_cpu(key_v2->key_param_set.key_info) & KEY_MCAST)) {
632 mwifiex_dbg(priv->adapter, INFO, "info: key: GTK is set\n");
633 priv->wpa_is_gtk_set = true;
634 priv->scan_block = false;
635 priv->port_open = true;
639 if (key_v2->key_param_set.key_type != KEY_TYPE_ID_AES)
642 memset(priv->aes_key_v2.key_param_set.key_params.aes.key, 0,
643 sizeof(key_v2->key_param_set.key_params.aes.key));
644 priv->aes_key_v2.key_param_set.key_params.aes.key_len =
646 memcpy(priv->aes_key_v2.key_param_set.key_params.aes.key,
647 key_v2->key_param_set.key_params.aes.key, len);
652 /* Wrapper function for processing response of key material command */
653 static int mwifiex_ret_802_11_key_material(struct mwifiex_private *priv,
654 struct host_cmd_ds_command *resp)
656 if (priv->adapter->key_api_major_ver == KEY_API_VER_MAJOR_V2)
657 return mwifiex_ret_802_11_key_material_v2(priv, resp);
659 return mwifiex_ret_802_11_key_material_v1(priv, resp);
663 * This function handles the command response of get 11d domain information.
665 static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
666 struct host_cmd_ds_command *resp)
668 struct host_cmd_ds_802_11d_domain_info_rsp *domain_info =
669 &resp->params.domain_info_resp;
670 struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain;
671 u16 action = le16_to_cpu(domain_info->action);
674 no_of_triplet = (u8) ((le16_to_cpu(domain->header.len)
675 - IEEE80211_COUNTRY_STRING_LEN)
676 / sizeof(struct ieee80211_country_ie_triplet));
678 mwifiex_dbg(priv->adapter, INFO,
679 "info: 11D Domain Info Resp: no_of_triplet=%d\n",
682 if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) {
683 mwifiex_dbg(priv->adapter, FATAL,
684 "11D: invalid number of triplets %d returned\n",
690 case HostCmd_ACT_GEN_SET: /* Proc Set Action */
692 case HostCmd_ACT_GEN_GET:
695 mwifiex_dbg(priv->adapter, ERROR,
696 "11D: invalid action:%d\n", domain_info->action);
704 * This function handles the command response of get extended version.
706 * Handling includes forming the extended version string and sending it
709 static int mwifiex_ret_ver_ext(struct mwifiex_private *priv,
710 struct host_cmd_ds_command *resp,
711 struct host_cmd_ds_version_ext *version_ext)
713 struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext;
716 version_ext->version_str_sel = ver_ext->version_str_sel;
717 memcpy(version_ext->version_str, ver_ext->version_str,
719 memcpy(priv->version_str, ver_ext->version_str, 128);
725 * This function handles the command response of remain on channel.
728 mwifiex_ret_remain_on_chan(struct mwifiex_private *priv,
729 struct host_cmd_ds_command *resp,
730 struct host_cmd_ds_remain_on_chan *roc_cfg)
732 struct host_cmd_ds_remain_on_chan *resp_cfg = &resp->params.roc_cfg;
735 memcpy(roc_cfg, resp_cfg, sizeof(*roc_cfg));
741 * This function handles the command response of P2P mode cfg.
744 mwifiex_ret_p2p_mode_cfg(struct mwifiex_private *priv,
745 struct host_cmd_ds_command *resp,
748 struct host_cmd_ds_p2p_mode_cfg *mode_cfg = &resp->params.mode_cfg;
751 put_unaligned_le16(le16_to_cpu(mode_cfg->mode), data_buf);
756 /* This function handles the command response of mem_access command
759 mwifiex_ret_mem_access(struct mwifiex_private *priv,
760 struct host_cmd_ds_command *resp, void *pioctl_buf)
762 struct host_cmd_ds_mem_access *mem = (void *)&resp->params.mem;
764 priv->mem_rw.addr = le32_to_cpu(mem->addr);
765 priv->mem_rw.value = le32_to_cpu(mem->value);
770 * This function handles the command response of register access.
772 * The register value and offset are returned to the user. For EEPROM
773 * access, the byte count is also returned.
775 static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp,
778 struct mwifiex_ds_reg_rw *reg_rw;
779 struct mwifiex_ds_read_eeprom *eeprom;
781 struct host_cmd_ds_mac_reg_access *mac;
782 struct host_cmd_ds_bbp_reg_access *bbp;
783 struct host_cmd_ds_rf_reg_access *rf;
784 struct host_cmd_ds_pmic_reg_access *pmic;
785 struct host_cmd_ds_802_11_eeprom_access *eeprom;
794 case HostCmd_CMD_MAC_REG_ACCESS:
795 r.mac = &resp->params.mac_reg;
796 reg_rw->offset = (u32) le16_to_cpu(r.mac->offset);
797 reg_rw->value = le32_to_cpu(r.mac->value);
799 case HostCmd_CMD_BBP_REG_ACCESS:
800 r.bbp = &resp->params.bbp_reg;
801 reg_rw->offset = (u32) le16_to_cpu(r.bbp->offset);
802 reg_rw->value = (u32) r.bbp->value;
805 case HostCmd_CMD_RF_REG_ACCESS:
806 r.rf = &resp->params.rf_reg;
807 reg_rw->offset = (u32) le16_to_cpu(r.rf->offset);
808 reg_rw->value = (u32) r.bbp->value;
810 case HostCmd_CMD_PMIC_REG_ACCESS:
811 r.pmic = &resp->params.pmic_reg;
812 reg_rw->offset = (u32) le16_to_cpu(r.pmic->offset);
813 reg_rw->value = (u32) r.pmic->value;
815 case HostCmd_CMD_CAU_REG_ACCESS:
816 r.rf = &resp->params.rf_reg;
817 reg_rw->offset = (u32) le16_to_cpu(r.rf->offset);
818 reg_rw->value = (u32) r.rf->value;
820 case HostCmd_CMD_802_11_EEPROM_ACCESS:
821 r.eeprom = &resp->params.eeprom;
822 pr_debug("info: EEPROM read len=%x\n",
823 le16_to_cpu(r.eeprom->byte_count));
824 if (eeprom->byte_count < le16_to_cpu(r.eeprom->byte_count)) {
825 eeprom->byte_count = 0;
826 pr_debug("info: EEPROM read length is too big\n");
829 eeprom->offset = le16_to_cpu(r.eeprom->offset);
830 eeprom->byte_count = le16_to_cpu(r.eeprom->byte_count);
831 if (eeprom->byte_count > 0)
832 memcpy(&eeprom->value, &r.eeprom->value,
833 min((u16)MAX_EEPROM_DATA, eeprom->byte_count));
842 * This function handles the command response of get IBSS coalescing status.
844 * If the received BSSID is different than the current one, the current BSSID,
845 * beacon interval, ATIM window and ERP information are updated, along with
846 * changing the ad-hoc state accordingly.
848 static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv,
849 struct host_cmd_ds_command *resp)
851 struct host_cmd_ds_802_11_ibss_status *ibss_coal_resp =
852 &(resp->params.ibss_coalescing);
854 if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET)
857 mwifiex_dbg(priv->adapter, INFO,
858 "info: new BSSID %pM\n", ibss_coal_resp->bssid);
860 /* If rsp has NULL BSSID, Just return..... No Action */
861 if (is_zero_ether_addr(ibss_coal_resp->bssid)) {
862 mwifiex_dbg(priv->adapter, FATAL, "new BSSID is NULL\n");
866 /* If BSSID is diff, modify current BSS parameters */
867 if (!ether_addr_equal(priv->curr_bss_params.bss_descriptor.mac_address, ibss_coal_resp->bssid)) {
869 memcpy(priv->curr_bss_params.bss_descriptor.mac_address,
870 ibss_coal_resp->bssid, ETH_ALEN);
872 /* Beacon Interval */
873 priv->curr_bss_params.bss_descriptor.beacon_period
874 = le16_to_cpu(ibss_coal_resp->beacon_interval);
876 /* ERP Information */
877 priv->curr_bss_params.bss_descriptor.erp_flags =
878 (u8) le16_to_cpu(ibss_coal_resp->use_g_rate_protect);
880 priv->adhoc_state = ADHOC_COALESCED;
885 static int mwifiex_ret_tdls_oper(struct mwifiex_private *priv,
886 struct host_cmd_ds_command *resp)
888 struct host_cmd_ds_tdls_oper *cmd_tdls_oper = &resp->params.tdls_oper;
889 u16 reason = le16_to_cpu(cmd_tdls_oper->reason);
890 u16 action = le16_to_cpu(cmd_tdls_oper->tdls_action);
891 struct mwifiex_sta_node *node =
892 mwifiex_get_sta_entry(priv, cmd_tdls_oper->peer_mac);
895 case ACT_TDLS_DELETE:
897 if (!node || reason == TDLS_ERR_LINK_NONEXISTENT)
898 mwifiex_dbg(priv->adapter, MSG,
899 "TDLS link delete for %pM failed: reason %d\n",
900 cmd_tdls_oper->peer_mac, reason);
902 mwifiex_dbg(priv->adapter, ERROR,
903 "TDLS link delete for %pM failed: reason %d\n",
904 cmd_tdls_oper->peer_mac, reason);
906 mwifiex_dbg(priv->adapter, MSG,
907 "TDLS link delete for %pM successful\n",
908 cmd_tdls_oper->peer_mac);
911 case ACT_TDLS_CREATE:
913 mwifiex_dbg(priv->adapter, ERROR,
914 "TDLS link creation for %pM failed: reason %d",
915 cmd_tdls_oper->peer_mac, reason);
916 if (node && reason != TDLS_ERR_LINK_EXISTS)
917 node->tdls_status = TDLS_SETUP_FAILURE;
919 mwifiex_dbg(priv->adapter, MSG,
920 "TDLS link creation for %pM successful",
921 cmd_tdls_oper->peer_mac);
924 case ACT_TDLS_CONFIG:
926 mwifiex_dbg(priv->adapter, ERROR,
927 "TDLS link config for %pM failed, reason %d\n",
928 cmd_tdls_oper->peer_mac, reason);
930 node->tdls_status = TDLS_SETUP_FAILURE;
932 mwifiex_dbg(priv->adapter, MSG,
933 "TDLS link config for %pM successful\n",
934 cmd_tdls_oper->peer_mac);
938 mwifiex_dbg(priv->adapter, ERROR,
939 "Unknown TDLS command action response %d", action);
946 * This function handles the command response for subscribe event command.
948 static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv,
949 struct host_cmd_ds_command *resp)
951 struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event =
952 &resp->params.subsc_evt;
954 /* For every subscribe event command (Get/Set/Clear), FW reports the
955 * current set of subscribed events*/
956 mwifiex_dbg(priv->adapter, EVENT,
957 "Bitmap of currently subscribed events: %16x\n",
958 le16_to_cpu(cmd_sub_event->events));
963 static int mwifiex_ret_uap_sta_list(struct mwifiex_private *priv,
964 struct host_cmd_ds_command *resp)
966 struct host_cmd_ds_sta_list *sta_list =
967 &resp->params.sta_list;
968 struct mwifiex_ie_types_sta_info *sta_info = (void *)&sta_list->tlv;
970 struct mwifiex_sta_node *sta_node;
972 for (i = 0; i < (le16_to_cpu(sta_list->sta_count)); i++) {
973 sta_node = mwifiex_get_sta_entry(priv, sta_info->mac);
974 if (unlikely(!sta_node))
977 sta_node->stats.rssi = sta_info->rssi;
984 /* This function handles the command response of set_cfg_data */
985 static int mwifiex_ret_cfg_data(struct mwifiex_private *priv,
986 struct host_cmd_ds_command *resp)
988 if (resp->result != HostCmd_RESULT_OK) {
989 mwifiex_dbg(priv->adapter, ERROR, "Cal data cmd resp failed\n");
996 /** This Function handles the command response of sdio rx aggr */
997 static int mwifiex_ret_sdio_rx_aggr_cfg(struct mwifiex_private *priv,
998 struct host_cmd_ds_command *resp)
1000 struct mwifiex_adapter *adapter = priv->adapter;
1001 struct host_cmd_sdio_sp_rx_aggr_cfg *cfg =
1002 &resp->params.sdio_rx_aggr_cfg;
1004 adapter->sdio_rx_aggr_enable = cfg->enable;
1005 adapter->sdio_rx_block_size = le16_to_cpu(cfg->block_size);
1010 static int mwifiex_ret_robust_coex(struct mwifiex_private *priv,
1011 struct host_cmd_ds_command *resp,
1014 struct host_cmd_ds_robust_coex *coex = &resp->params.coex;
1015 struct mwifiex_ie_types_robust_coex *coex_tlv;
1016 u16 action = le16_to_cpu(coex->action);
1019 coex_tlv = (struct mwifiex_ie_types_robust_coex
1020 *)((u8 *)coex + sizeof(struct host_cmd_ds_robust_coex));
1021 if (action == HostCmd_ACT_GEN_GET) {
1022 mode = le32_to_cpu(coex_tlv->mode);
1023 if (mode == MWIFIEX_COEX_MODE_TIMESHARE)
1024 *is_timeshare = true;
1026 *is_timeshare = false;
1032 static struct ieee80211_regdomain *
1033 mwifiex_create_custom_regdomain(struct mwifiex_private *priv,
1034 u8 *buf, u16 buf_len)
1036 u16 num_chan = buf_len / 2;
1037 struct ieee80211_regdomain *regd;
1038 struct ieee80211_reg_rule *rule;
1040 int regd_size, idx, freq, prev_freq = 0;
1041 u32 bw, prev_bw = 0;
1042 u8 chflags, prev_chflags = 0, valid_rules = 0;
1044 if (WARN_ON_ONCE(num_chan > NL80211_MAX_SUPP_REG_RULES))
1045 return ERR_PTR(-EINVAL);
1047 regd_size = sizeof(struct ieee80211_regdomain) +
1048 num_chan * sizeof(struct ieee80211_reg_rule);
1050 regd = kzalloc(regd_size, GFP_KERNEL);
1052 return ERR_PTR(-ENOMEM);
1054 for (idx = 0; idx < num_chan; idx++) {
1056 enum nl80211_band band;
1064 band = (chan <= 14) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
1065 freq = ieee80211_channel_to_frequency(chan, band);
1068 if (chflags & MWIFIEX_CHANNEL_DISABLED)
1071 if (band == NL80211_BAND_5GHZ) {
1072 if (!(chflags & MWIFIEX_CHANNEL_NOHT80))
1073 bw = MHZ_TO_KHZ(80);
1074 else if (!(chflags & MWIFIEX_CHANNEL_NOHT40))
1075 bw = MHZ_TO_KHZ(40);
1077 bw = MHZ_TO_KHZ(20);
1079 if (!(chflags & MWIFIEX_CHANNEL_NOHT40))
1080 bw = MHZ_TO_KHZ(40);
1082 bw = MHZ_TO_KHZ(20);
1085 if (idx == 0 || prev_chflags != chflags || prev_bw != bw ||
1086 freq - prev_freq > 20) {
1091 rule = ®d->reg_rules[valid_rules - 1];
1093 rule->freq_range.end_freq_khz = MHZ_TO_KHZ(freq + 10);
1095 prev_chflags = chflags;
1102 rule->freq_range.start_freq_khz = MHZ_TO_KHZ(freq - 10);
1103 rule->power_rule.max_eirp = DBM_TO_MBM(19);
1105 if (chflags & MWIFIEX_CHANNEL_PASSIVE)
1106 rule->flags = NL80211_RRF_NO_IR;
1108 if (chflags & MWIFIEX_CHANNEL_DFS)
1109 rule->flags = NL80211_RRF_DFS;
1111 rule->freq_range.max_bandwidth_khz = bw;
1114 regd->n_reg_rules = valid_rules;
1115 regd->alpha2[0] = '9';
1116 regd->alpha2[1] = '9';
1121 static int mwifiex_ret_chan_region_cfg(struct mwifiex_private *priv,
1122 struct host_cmd_ds_command *resp)
1124 struct host_cmd_ds_chan_region_cfg *reg = &resp->params.reg_cfg;
1125 u16 action = le16_to_cpu(reg->action);
1126 u16 tlv, tlv_buf_len, tlv_buf_left;
1127 struct mwifiex_ie_types_header *head;
1128 struct ieee80211_regdomain *regd;
1131 if (action != HostCmd_ACT_GEN_GET)
1134 tlv_buf = (u8 *)reg + sizeof(*reg);
1135 tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*reg);
1137 while (tlv_buf_left >= sizeof(*head)) {
1138 head = (struct mwifiex_ie_types_header *)tlv_buf;
1139 tlv = le16_to_cpu(head->type);
1140 tlv_buf_len = le16_to_cpu(head->len);
1142 if (tlv_buf_left < (sizeof(*head) + tlv_buf_len))
1146 case TLV_TYPE_CHAN_ATTR_CFG:
1147 mwifiex_dbg_dump(priv->adapter, CMD_D, "CHAN:",
1148 (u8 *)head + sizeof(*head),
1150 regd = mwifiex_create_custom_regdomain(priv,
1151 (u8 *)head + sizeof(*head), tlv_buf_len);
1153 priv->adapter->regd = regd;
1157 tlv_buf += (sizeof(*head) + tlv_buf_len);
1158 tlv_buf_left -= (sizeof(*head) + tlv_buf_len);
1164 static int mwifiex_ret_pkt_aggr_ctrl(struct mwifiex_private *priv,
1165 struct host_cmd_ds_command *resp)
1167 struct host_cmd_ds_pkt_aggr_ctrl *pkt_aggr_ctrl =
1168 &resp->params.pkt_aggr_ctrl;
1169 struct mwifiex_adapter *adapter = priv->adapter;
1171 adapter->bus_aggr.enable = le16_to_cpu(pkt_aggr_ctrl->enable);
1172 if (adapter->bus_aggr.enable)
1173 adapter->intf_hdr_len = INTF_HEADER_LEN;
1174 adapter->bus_aggr.mode = MWIFIEX_BUS_AGGR_MODE_LEN_V2;
1175 adapter->bus_aggr.tx_aggr_max_size =
1176 le16_to_cpu(pkt_aggr_ctrl->tx_aggr_max_size);
1177 adapter->bus_aggr.tx_aggr_max_num =
1178 le16_to_cpu(pkt_aggr_ctrl->tx_aggr_max_num);
1179 adapter->bus_aggr.tx_aggr_align =
1180 le16_to_cpu(pkt_aggr_ctrl->tx_aggr_align);
1186 * This function handles the command responses.
1188 * This is a generic function, which calls command specific
1189 * response handlers based on the command ID.
1191 int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
1192 struct host_cmd_ds_command *resp)
1195 struct mwifiex_adapter *adapter = priv->adapter;
1196 void *data_buf = adapter->curr_cmd->data_buf;
1198 /* If the command is not successful, cleanup and return failure */
1199 if (resp->result != HostCmd_RESULT_OK) {
1200 mwifiex_process_cmdresp_error(priv, resp);
1203 /* Command successful, handle response */
1204 switch (cmdresp_no) {
1205 case HostCmd_CMD_GET_HW_SPEC:
1206 ret = mwifiex_ret_get_hw_spec(priv, resp);
1208 case HostCmd_CMD_CFG_DATA:
1209 ret = mwifiex_ret_cfg_data(priv, resp);
1211 case HostCmd_CMD_MAC_CONTROL:
1213 case HostCmd_CMD_802_11_MAC_ADDRESS:
1214 ret = mwifiex_ret_802_11_mac_address(priv, resp);
1216 case HostCmd_CMD_MAC_MULTICAST_ADR:
1217 ret = mwifiex_ret_mac_multicast_adr(priv, resp);
1219 case HostCmd_CMD_TX_RATE_CFG:
1220 ret = mwifiex_ret_tx_rate_cfg(priv, resp);
1222 case HostCmd_CMD_802_11_SCAN:
1223 ret = mwifiex_ret_802_11_scan(priv, resp);
1224 adapter->curr_cmd->wait_q_enabled = false;
1226 case HostCmd_CMD_802_11_SCAN_EXT:
1227 ret = mwifiex_ret_802_11_scan_ext(priv, resp);
1228 adapter->curr_cmd->wait_q_enabled = false;
1230 case HostCmd_CMD_802_11_BG_SCAN_QUERY:
1231 ret = mwifiex_ret_802_11_scan(priv, resp);
1232 cfg80211_sched_scan_results(priv->wdev.wiphy, 0);
1233 mwifiex_dbg(adapter, CMD,
1234 "info: CMD_RESP: BG_SCAN result is ready!\n");
1236 case HostCmd_CMD_802_11_BG_SCAN_CONFIG:
1238 case HostCmd_CMD_TXPWR_CFG:
1239 ret = mwifiex_ret_tx_power_cfg(priv, resp);
1241 case HostCmd_CMD_RF_TX_PWR:
1242 ret = mwifiex_ret_rf_tx_power(priv, resp);
1244 case HostCmd_CMD_RF_ANTENNA:
1245 ret = mwifiex_ret_rf_antenna(priv, resp);
1247 case HostCmd_CMD_802_11_PS_MODE_ENH:
1248 ret = mwifiex_ret_enh_power_mode(priv, resp, data_buf);
1250 case HostCmd_CMD_802_11_HS_CFG_ENH:
1251 ret = mwifiex_ret_802_11_hs_cfg(priv, resp);
1253 case HostCmd_CMD_802_11_ASSOCIATE:
1254 ret = mwifiex_ret_802_11_associate(priv, resp);
1256 case HostCmd_CMD_802_11_DEAUTHENTICATE:
1257 ret = mwifiex_ret_802_11_deauthenticate(priv, resp);
1259 case HostCmd_CMD_802_11_AD_HOC_START:
1260 case HostCmd_CMD_802_11_AD_HOC_JOIN:
1261 ret = mwifiex_ret_802_11_ad_hoc(priv, resp);
1263 case HostCmd_CMD_802_11_AD_HOC_STOP:
1264 ret = mwifiex_ret_802_11_ad_hoc_stop(priv, resp);
1266 case HostCmd_CMD_802_11_GET_LOG:
1267 ret = mwifiex_ret_get_log(priv, resp, data_buf);
1269 case HostCmd_CMD_RSSI_INFO:
1270 ret = mwifiex_ret_802_11_rssi_info(priv, resp);
1272 case HostCmd_CMD_802_11_SNMP_MIB:
1273 ret = mwifiex_ret_802_11_snmp_mib(priv, resp, data_buf);
1275 case HostCmd_CMD_802_11_TX_RATE_QUERY:
1276 ret = mwifiex_ret_802_11_tx_rate_query(priv, resp);
1278 case HostCmd_CMD_VERSION_EXT:
1279 ret = mwifiex_ret_ver_ext(priv, resp, data_buf);
1281 case HostCmd_CMD_REMAIN_ON_CHAN:
1282 ret = mwifiex_ret_remain_on_chan(priv, resp, data_buf);
1284 case HostCmd_CMD_11AC_CFG:
1286 case HostCmd_CMD_PACKET_AGGR_CTRL:
1287 ret = mwifiex_ret_pkt_aggr_ctrl(priv, resp);
1289 case HostCmd_CMD_P2P_MODE_CFG:
1290 ret = mwifiex_ret_p2p_mode_cfg(priv, resp, data_buf);
1292 case HostCmd_CMD_MGMT_FRAME_REG:
1293 case HostCmd_CMD_FUNC_INIT:
1294 case HostCmd_CMD_FUNC_SHUTDOWN:
1296 case HostCmd_CMD_802_11_KEY_MATERIAL:
1297 ret = mwifiex_ret_802_11_key_material(priv, resp);
1299 case HostCmd_CMD_802_11D_DOMAIN_INFO:
1300 ret = mwifiex_ret_802_11d_domain_info(priv, resp);
1302 case HostCmd_CMD_11N_ADDBA_REQ:
1303 ret = mwifiex_ret_11n_addba_req(priv, resp);
1305 case HostCmd_CMD_11N_DELBA:
1306 ret = mwifiex_ret_11n_delba(priv, resp);
1308 case HostCmd_CMD_11N_ADDBA_RSP:
1309 ret = mwifiex_ret_11n_addba_resp(priv, resp);
1311 case HostCmd_CMD_RECONFIGURE_TX_BUFF:
1312 if (0xffff == (u16)le16_to_cpu(resp->params.tx_buf.buff_size)) {
1313 if (adapter->iface_type == MWIFIEX_USB &&
1314 adapter->usb_mc_setup) {
1315 if (adapter->if_ops.multi_port_resync)
1317 multi_port_resync(adapter);
1318 adapter->usb_mc_setup = false;
1319 adapter->tx_lock_flag = false;
1323 adapter->tx_buf_size = (u16) le16_to_cpu(resp->params.
1325 adapter->tx_buf_size = (adapter->tx_buf_size
1326 / MWIFIEX_SDIO_BLOCK_SIZE)
1327 * MWIFIEX_SDIO_BLOCK_SIZE;
1328 adapter->curr_tx_buf_size = adapter->tx_buf_size;
1329 mwifiex_dbg(adapter, CMD, "cmd: curr_tx_buf_size=%d\n",
1330 adapter->curr_tx_buf_size);
1332 if (adapter->if_ops.update_mp_end_port)
1333 adapter->if_ops.update_mp_end_port(adapter,
1334 le16_to_cpu(resp->params.tx_buf.mp_end_port));
1336 case HostCmd_CMD_AMSDU_AGGR_CTRL:
1338 case HostCmd_CMD_WMM_GET_STATUS:
1339 ret = mwifiex_ret_wmm_get_status(priv, resp);
1341 case HostCmd_CMD_802_11_IBSS_COALESCING_STATUS:
1342 ret = mwifiex_ret_ibss_coalescing_status(priv, resp);
1344 case HostCmd_CMD_MEM_ACCESS:
1345 ret = mwifiex_ret_mem_access(priv, resp, data_buf);
1347 case HostCmd_CMD_MAC_REG_ACCESS:
1348 case HostCmd_CMD_BBP_REG_ACCESS:
1349 case HostCmd_CMD_RF_REG_ACCESS:
1350 case HostCmd_CMD_PMIC_REG_ACCESS:
1351 case HostCmd_CMD_CAU_REG_ACCESS:
1352 case HostCmd_CMD_802_11_EEPROM_ACCESS:
1353 ret = mwifiex_ret_reg_access(cmdresp_no, resp, data_buf);
1355 case HostCmd_CMD_SET_BSS_MODE:
1357 case HostCmd_CMD_11N_CFG:
1359 case HostCmd_CMD_PCIE_DESC_DETAILS:
1361 case HostCmd_CMD_802_11_SUBSCRIBE_EVENT:
1362 ret = mwifiex_ret_subsc_evt(priv, resp);
1364 case HostCmd_CMD_UAP_SYS_CONFIG:
1366 case HOST_CMD_APCMD_STA_LIST:
1367 ret = mwifiex_ret_uap_sta_list(priv, resp);
1369 case HostCmd_CMD_UAP_BSS_START:
1370 adapter->tx_lock_flag = false;
1371 adapter->pps_uapsd_mode = false;
1372 adapter->delay_null_pkt = false;
1373 priv->bss_started = 1;
1375 case HostCmd_CMD_UAP_BSS_STOP:
1376 priv->bss_started = 0;
1378 case HostCmd_CMD_UAP_STA_DEAUTH:
1380 case HOST_CMD_APCMD_SYS_RESET:
1382 case HostCmd_CMD_MEF_CFG:
1384 case HostCmd_CMD_COALESCE_CFG:
1386 case HostCmd_CMD_TDLS_OPER:
1387 ret = mwifiex_ret_tdls_oper(priv, resp);
1388 case HostCmd_CMD_MC_POLICY:
1390 case HostCmd_CMD_CHAN_REPORT_REQUEST:
1392 case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG:
1393 ret = mwifiex_ret_sdio_rx_aggr_cfg(priv, resp);
1395 case HostCmd_CMD_HS_WAKEUP_REASON:
1396 ret = mwifiex_ret_wakeup_reason(priv, resp, data_buf);
1398 case HostCmd_CMD_TDLS_CONFIG:
1400 case HostCmd_CMD_ROBUST_COEX:
1401 ret = mwifiex_ret_robust_coex(priv, resp, data_buf);
1403 case HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG:
1405 case HostCmd_CMD_CHAN_REGION_CFG:
1406 ret = mwifiex_ret_chan_region_cfg(priv, resp);
1409 mwifiex_dbg(adapter, ERROR,
1410 "CMD_RESP: unknown cmd response %#x\n",