Lines Matching +full:power +full:- +full:saving
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2011-2020 NXP
25 * For Power Save command failure, we do not retry enter PS
26 * command in case of Ad-hoc mode.
35 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_process_cmdresp_error()
40 resp->command, resp->result); in mwifiex_process_cmdresp_error()
42 if (adapter->curr_cmd->wait_q_enabled) in mwifiex_process_cmdresp_error()
43 adapter->cmd_wait_q.status = -1; in mwifiex_process_cmdresp_error()
45 switch (le16_to_cpu(resp->command)) { in mwifiex_process_cmdresp_error()
47 pm = &resp->params.psmode_enh; in mwifiex_process_cmdresp_error()
50 resp->result, le16_to_cpu(pm->action)); in mwifiex_process_cmdresp_error()
51 /* We do not re-try enter-ps command in ad-hoc mode. */ in mwifiex_process_cmdresp_error()
52 if (le16_to_cpu(pm->action) == EN_AUTO_PS && in mwifiex_process_cmdresp_error()
53 (le16_to_cpu(pm->params.ps_bitmap) & BITMAP_STA_PS) && in mwifiex_process_cmdresp_error()
54 priv->bss_mode == NL80211_IFTYPE_ADHOC) in mwifiex_process_cmdresp_error()
55 adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_CAM; in mwifiex_process_cmdresp_error()
68 "SDIO RX single-port aggregation Not support\n"); in mwifiex_process_cmdresp_error()
75 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); in mwifiex_process_cmdresp_error()
77 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_process_cmdresp_error()
78 adapter->curr_cmd = NULL; in mwifiex_process_cmdresp_error()
79 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_process_cmdresp_error()
86 * and saving the following parameters in driver -
87 * - Last data and beacon RSSI value
88 * - Average data and beacon RSSI value
89 * - Last data and beacon NF value
90 * - Average data and beacon NF value
99 &resp->params.rssi_info_rsp; in mwifiex_ret_802_11_rssi_info()
101 &priv->async_subsc_evt_storage; in mwifiex_ret_802_11_rssi_info()
103 priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); in mwifiex_ret_802_11_rssi_info()
104 priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); in mwifiex_ret_802_11_rssi_info()
106 priv->data_rssi_avg = le16_to_cpu(rssi_info_rsp->data_rssi_avg); in mwifiex_ret_802_11_rssi_info()
107 priv->data_nf_avg = le16_to_cpu(rssi_info_rsp->data_nf_avg); in mwifiex_ret_802_11_rssi_info()
109 priv->bcn_rssi_last = le16_to_cpu(rssi_info_rsp->bcn_rssi_last); in mwifiex_ret_802_11_rssi_info()
110 priv->bcn_nf_last = le16_to_cpu(rssi_info_rsp->bcn_nf_last); in mwifiex_ret_802_11_rssi_info()
112 priv->bcn_rssi_avg = le16_to_cpu(rssi_info_rsp->bcn_rssi_avg); in mwifiex_ret_802_11_rssi_info()
113 priv->bcn_nf_avg = le16_to_cpu(rssi_info_rsp->bcn_nf_avg); in mwifiex_ret_802_11_rssi_info()
115 if (priv->subsc_evt_rssi_state == EVENT_HANDLED) in mwifiex_ret_802_11_rssi_info()
121 subsc_evt->events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH; in mwifiex_ret_802_11_rssi_info()
122 subsc_evt->action = HostCmd_ACT_BITWISE_SET; in mwifiex_ret_802_11_rssi_info()
123 if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) { in mwifiex_ret_802_11_rssi_info()
124 subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg - in mwifiex_ret_802_11_rssi_info()
125 priv->cqm_rssi_hyst); in mwifiex_ret_802_11_rssi_info()
126 subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); in mwifiex_ret_802_11_rssi_info()
127 } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) { in mwifiex_ret_802_11_rssi_info()
128 subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); in mwifiex_ret_802_11_rssi_info()
129 subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg + in mwifiex_ret_802_11_rssi_info()
130 priv->cqm_rssi_hyst); in mwifiex_ret_802_11_rssi_info()
132 subsc_evt->bcn_l_rssi_cfg.evt_freq = 1; in mwifiex_ret_802_11_rssi_info()
133 subsc_evt->bcn_h_rssi_cfg.evt_freq = 1; in mwifiex_ret_802_11_rssi_info()
135 priv->subsc_evt_rssi_state = EVENT_HANDLED; in mwifiex_ret_802_11_rssi_info()
148 * and saving the parameter in driver.
150 * The following parameters are supported -
151 * - Fragmentation threshold
152 * - RTS threshold
153 * - Short retry limit
159 struct host_cmd_ds_802_11_snmp_mib *smib = &resp->params.smib; in mwifiex_ret_802_11_snmp_mib()
160 u16 oid = le16_to_cpu(smib->oid); in mwifiex_ret_802_11_snmp_mib()
161 u16 query_type = le16_to_cpu(smib->query_type); in mwifiex_ret_802_11_snmp_mib()
164 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_snmp_mib()
167 oid, query_type, le16_to_cpu(smib->buf_size)); in mwifiex_ret_802_11_snmp_mib()
169 ul_temp = get_unaligned_le16(smib->value); in mwifiex_ret_802_11_snmp_mib()
174 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_snmp_mib()
179 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_snmp_mib()
184 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_snmp_mib()
189 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_snmp_mib()
212 &resp->params.get_log; in mwifiex_ret_get_log()
215 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); in mwifiex_ret_get_log()
216 stats->failed = le32_to_cpu(get_log->failed); in mwifiex_ret_get_log()
217 stats->retry = le32_to_cpu(get_log->retry); in mwifiex_ret_get_log()
218 stats->multi_retry = le32_to_cpu(get_log->multi_retry); in mwifiex_ret_get_log()
219 stats->frame_dup = le32_to_cpu(get_log->frame_dup); in mwifiex_ret_get_log()
220 stats->rts_success = le32_to_cpu(get_log->rts_success); in mwifiex_ret_get_log()
221 stats->rts_failure = le32_to_cpu(get_log->rts_failure); in mwifiex_ret_get_log()
222 stats->ack_failure = le32_to_cpu(get_log->ack_failure); in mwifiex_ret_get_log()
223 stats->rx_frag = le32_to_cpu(get_log->rx_frag); in mwifiex_ret_get_log()
224 stats->mcast_rx_frame = le32_to_cpu(get_log->mcast_rx_frame); in mwifiex_ret_get_log()
225 stats->fcs_error = le32_to_cpu(get_log->fcs_error); in mwifiex_ret_get_log()
226 stats->tx_frame = le32_to_cpu(get_log->tx_frame); in mwifiex_ret_get_log()
227 stats->wep_icv_error[0] = in mwifiex_ret_get_log()
228 le32_to_cpu(get_log->wep_icv_err_cnt[0]); in mwifiex_ret_get_log()
229 stats->wep_icv_error[1] = in mwifiex_ret_get_log()
230 le32_to_cpu(get_log->wep_icv_err_cnt[1]); in mwifiex_ret_get_log()
231 stats->wep_icv_error[2] = in mwifiex_ret_get_log()
232 le32_to_cpu(get_log->wep_icv_err_cnt[2]); in mwifiex_ret_get_log()
233 stats->wep_icv_error[3] = in mwifiex_ret_get_log()
234 le32_to_cpu(get_log->wep_icv_err_cnt[3]); in mwifiex_ret_get_log()
235 stats->bcn_rcv_cnt = le32_to_cpu(get_log->bcn_rcv_cnt); in mwifiex_ret_get_log()
236 stats->bcn_miss_cnt = le32_to_cpu(get_log->bcn_miss_cnt); in mwifiex_ret_get_log()
247 * and saving the following parameters in driver -
248 * - DSSS rate bitmap
249 * - OFDM rate bitmap
250 * - HT MCS rate bitmaps
252 * Based on the new rate bitmaps, the function re-evaluates if
259 struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; in mwifiex_ret_tx_rate_cfg()
267 tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*rate_cfg); in mwifiex_ret_tx_rate_cfg()
271 tlv = le16_to_cpu(head->type); in mwifiex_ret_tx_rate_cfg()
272 tlv_buf_len = le16_to_cpu(head->len); in mwifiex_ret_tx_rate_cfg()
280 priv->bitmap_rates[0] = in mwifiex_ret_tx_rate_cfg()
281 le16_to_cpu(rate_scope->hr_dsss_rate_bitmap); in mwifiex_ret_tx_rate_cfg()
282 priv->bitmap_rates[1] = in mwifiex_ret_tx_rate_cfg()
283 le16_to_cpu(rate_scope->ofdm_rate_bitmap); in mwifiex_ret_tx_rate_cfg()
285 i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap); in mwifiex_ret_tx_rate_cfg()
287 priv->bitmap_rates[2 + i] = in mwifiex_ret_tx_rate_cfg()
288 le16_to_cpu(rate_scope-> in mwifiex_ret_tx_rate_cfg()
291 if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) { in mwifiex_ret_tx_rate_cfg()
292 for (i = 0; i < ARRAY_SIZE(rate_scope-> in mwifiex_ret_tx_rate_cfg()
295 priv->bitmap_rates[10 + i] = in mwifiex_ret_tx_rate_cfg()
296 le16_to_cpu(rate_scope-> in mwifiex_ret_tx_rate_cfg()
304 tlv_buf_left -= (sizeof(*head) + tlv_buf_len); in mwifiex_ret_tx_rate_cfg()
307 priv->is_data_rate_auto = mwifiex_is_rate_auto(priv); in mwifiex_ret_tx_rate_cfg()
309 if (priv->is_data_rate_auto) in mwifiex_ret_tx_rate_cfg()
310 priv->data_rate = 0; in mwifiex_ret_tx_rate_cfg()
319 * This function handles the command response of get Tx power level.
321 * Handling includes saving the maximum and minimum Tx power levels
326 int length, max_power = -1, min_power = -1; in mwifiex_get_power_level()
331 return -1; in mwifiex_get_power_level()
336 length = le16_to_cpu(pg_tlv_hdr->length); in mwifiex_get_power_level()
338 /* At least one structure required to update power */ in mwifiex_get_power_level()
342 max_power = pg->power_max; in mwifiex_get_power_level()
343 min_power = pg->power_min; in mwifiex_get_power_level()
344 length -= sizeof(struct mwifiex_power_group); in mwifiex_get_power_level()
348 if (max_power < pg->power_max) in mwifiex_get_power_level()
349 max_power = pg->power_max; in mwifiex_get_power_level()
351 if (min_power > pg->power_min) in mwifiex_get_power_level()
352 min_power = pg->power_min; in mwifiex_get_power_level()
354 length -= sizeof(struct mwifiex_power_group); in mwifiex_get_power_level()
356 priv->min_tx_power_level = (u8) min_power; in mwifiex_get_power_level()
357 priv->max_tx_power_level = (u8) max_power; in mwifiex_get_power_level()
363 * This function handles the command response of set/get Tx power
367 * and saving the current Tx power level in driver.
372 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_tx_power_cfg()
373 struct host_cmd_ds_txpwr_cfg *txp_cfg = &resp->params.txp_cfg; in mwifiex_ret_tx_power_cfg()
376 u16 action = le16_to_cpu(txp_cfg->action); in mwifiex_ret_tx_power_cfg()
387 tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*txp_cfg); in mwifiex_ret_tx_power_cfg()
389 le16_to_cpu(pg_tlv_hdr->length) + sizeof(*pg_tlv_hdr)) in mwifiex_ret_tx_power_cfg()
394 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) in mwifiex_ret_tx_power_cfg()
397 priv->tx_power_level = (u16) pg->power_min; in mwifiex_ret_tx_power_cfg()
401 if (!le32_to_cpu(txp_cfg->mode)) in mwifiex_ret_tx_power_cfg()
404 if (pg->power_max == pg->power_min) in mwifiex_ret_tx_power_cfg()
405 priv->tx_power_level = (u16) pg->power_min; in mwifiex_ret_tx_power_cfg()
414 "info: Current TxPower Level = %d, Max Power=%d, Min Power=%d\n", in mwifiex_ret_tx_power_cfg()
415 priv->tx_power_level, priv->max_tx_power_level, in mwifiex_ret_tx_power_cfg()
416 priv->min_tx_power_level); in mwifiex_ret_tx_power_cfg()
422 * This function handles the command response of get RF Tx power.
427 struct host_cmd_ds_rf_tx_pwr *txp = &resp->params.txp; in mwifiex_ret_rf_tx_power()
428 u16 action = le16_to_cpu(txp->action); in mwifiex_ret_rf_tx_power()
430 priv->tx_power_level = le16_to_cpu(txp->cur_level); in mwifiex_ret_rf_tx_power()
433 priv->max_tx_power_level = txp->max_power; in mwifiex_ret_rf_tx_power()
434 priv->min_tx_power_level = txp->min_power; in mwifiex_ret_rf_tx_power()
437 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_rf_tx_power()
438 "Current TxPower Level=%d, Max Power=%d, Min Power=%d\n", in mwifiex_ret_rf_tx_power()
439 priv->tx_power_level, priv->max_tx_power_level, in mwifiex_ret_rf_tx_power()
440 priv->min_tx_power_level); in mwifiex_ret_rf_tx_power()
451 struct host_cmd_ds_rf_ant_mimo *ant_mimo = &resp->params.ant_mimo; in mwifiex_ret_rf_antenna()
452 struct host_cmd_ds_rf_ant_siso *ant_siso = &resp->params.ant_siso; in mwifiex_ret_rf_antenna()
453 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_rf_antenna()
455 if (adapter->hw_dev_mcs_support == HT_STREAM_2X2) { in mwifiex_ret_rf_antenna()
456 priv->tx_ant = le16_to_cpu(ant_mimo->tx_ant_mode); in mwifiex_ret_rf_antenna()
457 priv->rx_ant = le16_to_cpu(ant_mimo->rx_ant_mode); in mwifiex_ret_rf_antenna()
461 le16_to_cpu(ant_mimo->action_tx), in mwifiex_ret_rf_antenna()
462 le16_to_cpu(ant_mimo->tx_ant_mode), in mwifiex_ret_rf_antenna()
463 le16_to_cpu(ant_mimo->action_rx), in mwifiex_ret_rf_antenna()
464 le16_to_cpu(ant_mimo->rx_ant_mode)); in mwifiex_ret_rf_antenna()
466 priv->tx_ant = le16_to_cpu(ant_siso->ant_mode); in mwifiex_ret_rf_antenna()
467 priv->rx_ant = le16_to_cpu(ant_siso->ant_mode); in mwifiex_ret_rf_antenna()
470 le16_to_cpu(ant_siso->action), in mwifiex_ret_rf_antenna()
471 le16_to_cpu(ant_siso->ant_mode)); in mwifiex_ret_rf_antenna()
479 * Handling includes saving the MAC address in driver.
485 &resp->params.mac_addr; in mwifiex_ret_802_11_mac_address()
487 memcpy(priv->curr_addr, cmd_mac_addr->mac_addr, ETH_ALEN); in mwifiex_ret_802_11_mac_address()
489 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_mac_address()
490 "info: set mac address: %pM\n", priv->curr_addr); in mwifiex_ret_802_11_mac_address()
509 * and saving the Tx rate and HT information parameters in driver.
517 priv->tx_rate = resp->params.tx_rate.tx_rate; in mwifiex_ret_802_11_tx_rate_query()
518 priv->tx_htinfo = resp->params.tx_rate.ht_info; in mwifiex_ret_802_11_tx_rate_query()
519 if (!priv->is_data_rate_auto) in mwifiex_ret_802_11_tx_rate_query()
520 priv->data_rate = in mwifiex_ret_802_11_tx_rate_query()
521 mwifiex_index_to_data_rate(priv, priv->tx_rate, in mwifiex_ret_802_11_tx_rate_query()
522 priv->tx_htinfo); in mwifiex_ret_802_11_tx_rate_query()
537 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_deauthenticate()
539 adapter->dbg.num_cmd_deauth++; in mwifiex_ret_802_11_deauthenticate()
540 if (!memcmp(resp->params.deauth.mac_addr, in mwifiex_ret_802_11_deauthenticate()
541 &priv->curr_bss_params.bss_descriptor.mac_address, in mwifiex_ret_802_11_deauthenticate()
542 sizeof(resp->params.deauth.mac_addr))) in mwifiex_ret_802_11_deauthenticate()
550 * This function handles the command response of ad-hoc stop.
571 &resp->params.key_material; in mwifiex_ret_802_11_key_material_v1()
574 len = le16_to_cpu(key->key_param_set.key_len); in mwifiex_ret_802_11_key_material_v1()
575 if (len > sizeof(key->key_param_set.key)) in mwifiex_ret_802_11_key_material_v1()
576 return -EINVAL; in mwifiex_ret_802_11_key_material_v1()
578 if (le16_to_cpu(key->action) == HostCmd_ACT_GEN_SET) { in mwifiex_ret_802_11_key_material_v1()
579 if ((le16_to_cpu(key->key_param_set.key_info) & KEY_MCAST)) { in mwifiex_ret_802_11_key_material_v1()
580 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11_key_material_v1()
582 priv->wpa_is_gtk_set = true; in mwifiex_ret_802_11_key_material_v1()
583 priv->scan_block = false; in mwifiex_ret_802_11_key_material_v1()
584 priv->port_open = true; in mwifiex_ret_802_11_key_material_v1()
588 memset(priv->aes_key.key_param_set.key, 0, in mwifiex_ret_802_11_key_material_v1()
589 sizeof(key->key_param_set.key)); in mwifiex_ret_802_11_key_material_v1()
590 priv->aes_key.key_param_set.key_len = cpu_to_le16(len); in mwifiex_ret_802_11_key_material_v1()
591 memcpy(priv->aes_key.key_param_set.key, key->key_param_set.key, len); in mwifiex_ret_802_11_key_material_v1()
608 key_v2 = &resp->params.key_material_v2; in mwifiex_ret_802_11_key_material_v2()
610 len = le16_to_cpu(key_v2->key_param_set.key_params.aes.key_len); in mwifiex_ret_802_11_key_material_v2()
611 if (len > sizeof(key_v2->key_param_set.key_params.aes.key)) in mwifiex_ret_802_11_key_material_v2()
612 return -EINVAL; in mwifiex_ret_802_11_key_material_v2()
614 if (le16_to_cpu(key_v2->action) == HostCmd_ACT_GEN_SET) { in mwifiex_ret_802_11_key_material_v2()
615 if ((le16_to_cpu(key_v2->key_param_set.key_info) & KEY_MCAST)) { in mwifiex_ret_802_11_key_material_v2()
616 mwifiex_dbg(priv->adapter, INFO, "info: key: GTK is set\n"); in mwifiex_ret_802_11_key_material_v2()
617 priv->wpa_is_gtk_set = true; in mwifiex_ret_802_11_key_material_v2()
618 priv->scan_block = false; in mwifiex_ret_802_11_key_material_v2()
619 priv->port_open = true; in mwifiex_ret_802_11_key_material_v2()
623 if (key_v2->key_param_set.key_type != KEY_TYPE_ID_AES) in mwifiex_ret_802_11_key_material_v2()
626 memset(priv->aes_key_v2.key_param_set.key_params.aes.key, 0, in mwifiex_ret_802_11_key_material_v2()
627 sizeof(key_v2->key_param_set.key_params.aes.key)); in mwifiex_ret_802_11_key_material_v2()
628 priv->aes_key_v2.key_param_set.key_params.aes.key_len = in mwifiex_ret_802_11_key_material_v2()
630 memcpy(priv->aes_key_v2.key_param_set.key_params.aes.key, in mwifiex_ret_802_11_key_material_v2()
631 key_v2->key_param_set.key_params.aes.key, len); in mwifiex_ret_802_11_key_material_v2()
640 if (priv->adapter->key_api_major_ver == KEY_API_VER_MAJOR_V2) in mwifiex_ret_802_11_key_material()
653 &resp->params.domain_info_resp; in mwifiex_ret_802_11d_domain_info()
654 struct mwifiex_ietypes_domain_param_set *domain = &domain_info->domain; in mwifiex_ret_802_11d_domain_info()
655 u16 action = le16_to_cpu(domain_info->action); in mwifiex_ret_802_11d_domain_info()
658 no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) in mwifiex_ret_802_11d_domain_info()
659 - IEEE80211_COUNTRY_STRING_LEN) in mwifiex_ret_802_11d_domain_info()
662 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_802_11d_domain_info()
667 mwifiex_dbg(priv->adapter, FATAL, in mwifiex_ret_802_11d_domain_info()
670 return -1; in mwifiex_ret_802_11d_domain_info()
679 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_ret_802_11d_domain_info()
680 "11D: invalid action:%d\n", domain_info->action); in mwifiex_ret_802_11d_domain_info()
681 return -1; in mwifiex_ret_802_11d_domain_info()
697 struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext; in mwifiex_ret_ver_ext()
699 if (test_and_clear_bit(MWIFIEX_IS_REQUESTING_FW_VEREXT, &priv->adapter->work_flags)) { in mwifiex_ret_ver_ext()
700 if (strncmp(ver_ext->version_str, "ChipRev:20, BB:9b(10.00), RF:40(21)", in mwifiex_ret_ver_ext()
706 mwifiex_dbg(priv->adapter, MSG, in mwifiex_ret_ver_ext()
711 mwifiex_dbg(priv->adapter, MSG, in mwifiex_ret_ver_ext()
720 version_ext->version_str_sel = ver_ext->version_str_sel; in mwifiex_ret_ver_ext()
721 memcpy(version_ext->version_str, ver_ext->version_str, in mwifiex_ret_ver_ext()
723 memcpy(priv->version_str, ver_ext->version_str, in mwifiex_ret_ver_ext()
726 /* Ensure the version string from the firmware is 0-terminated */ in mwifiex_ret_ver_ext()
727 priv->version_str[MWIFIEX_VERSION_STR_LENGTH - 1] = '\0'; in mwifiex_ret_ver_ext()
740 struct host_cmd_ds_remain_on_chan *resp_cfg = &resp->params.roc_cfg; in mwifiex_ret_remain_on_chan()
756 struct host_cmd_ds_p2p_mode_cfg *mode_cfg = &resp->params.mode_cfg; in mwifiex_ret_p2p_mode_cfg()
759 put_unaligned_le16(le16_to_cpu(mode_cfg->mode), data_buf); in mwifiex_ret_p2p_mode_cfg()
770 struct host_cmd_ds_mem_access *mem = (void *)&resp->params.mem; in mwifiex_ret_mem_access()
772 priv->mem_rw.addr = le32_to_cpu(mem->addr); in mwifiex_ret_mem_access()
773 priv->mem_rw.value = le32_to_cpu(mem->value); in mwifiex_ret_mem_access()
803 r.mac = &resp->params.mac_reg; in mwifiex_ret_reg_access()
804 reg_rw->offset = (u32) le16_to_cpu(r.mac->offset); in mwifiex_ret_reg_access()
805 reg_rw->value = le32_to_cpu(r.mac->value); in mwifiex_ret_reg_access()
808 r.bbp = &resp->params.bbp_reg; in mwifiex_ret_reg_access()
809 reg_rw->offset = (u32) le16_to_cpu(r.bbp->offset); in mwifiex_ret_reg_access()
810 reg_rw->value = (u32) r.bbp->value; in mwifiex_ret_reg_access()
814 r.rf = &resp->params.rf_reg; in mwifiex_ret_reg_access()
815 reg_rw->offset = (u32) le16_to_cpu(r.rf->offset); in mwifiex_ret_reg_access()
816 reg_rw->value = (u32) r.bbp->value; in mwifiex_ret_reg_access()
819 r.pmic = &resp->params.pmic_reg; in mwifiex_ret_reg_access()
820 reg_rw->offset = (u32) le16_to_cpu(r.pmic->offset); in mwifiex_ret_reg_access()
821 reg_rw->value = (u32) r.pmic->value; in mwifiex_ret_reg_access()
824 r.rf = &resp->params.rf_reg; in mwifiex_ret_reg_access()
825 reg_rw->offset = (u32) le16_to_cpu(r.rf->offset); in mwifiex_ret_reg_access()
826 reg_rw->value = (u32) r.rf->value; in mwifiex_ret_reg_access()
829 r.eeprom = &resp->params.eeprom; in mwifiex_ret_reg_access()
831 le16_to_cpu(r.eeprom->byte_count)); in mwifiex_ret_reg_access()
832 if (eeprom->byte_count < le16_to_cpu(r.eeprom->byte_count)) { in mwifiex_ret_reg_access()
833 eeprom->byte_count = 0; in mwifiex_ret_reg_access()
835 return -1; in mwifiex_ret_reg_access()
837 eeprom->offset = le16_to_cpu(r.eeprom->offset); in mwifiex_ret_reg_access()
838 eeprom->byte_count = le16_to_cpu(r.eeprom->byte_count); in mwifiex_ret_reg_access()
839 if (eeprom->byte_count > 0) in mwifiex_ret_reg_access()
840 memcpy(&eeprom->value, &r.eeprom->value, in mwifiex_ret_reg_access()
841 min((u16)MAX_EEPROM_DATA, eeprom->byte_count)); in mwifiex_ret_reg_access()
844 return -1; in mwifiex_ret_reg_access()
854 * changing the ad-hoc state accordingly.
860 &(resp->params.ibss_coalescing); in mwifiex_ret_ibss_coalescing_status()
862 if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET) in mwifiex_ret_ibss_coalescing_status()
865 mwifiex_dbg(priv->adapter, INFO, in mwifiex_ret_ibss_coalescing_status()
866 "info: new BSSID %pM\n", ibss_coal_resp->bssid); in mwifiex_ret_ibss_coalescing_status()
869 if (is_zero_ether_addr(ibss_coal_resp->bssid)) { in mwifiex_ret_ibss_coalescing_status()
870 mwifiex_dbg(priv->adapter, FATAL, "new BSSID is NULL\n"); in mwifiex_ret_ibss_coalescing_status()
875 if (!ether_addr_equal(priv->curr_bss_params.bss_descriptor.mac_address, ibss_coal_resp->bssid)) { in mwifiex_ret_ibss_coalescing_status()
877 memcpy(priv->curr_bss_params.bss_descriptor.mac_address, in mwifiex_ret_ibss_coalescing_status()
878 ibss_coal_resp->bssid, ETH_ALEN); in mwifiex_ret_ibss_coalescing_status()
881 priv->curr_bss_params.bss_descriptor.beacon_period in mwifiex_ret_ibss_coalescing_status()
882 = le16_to_cpu(ibss_coal_resp->beacon_interval); in mwifiex_ret_ibss_coalescing_status()
885 priv->curr_bss_params.bss_descriptor.erp_flags = in mwifiex_ret_ibss_coalescing_status()
886 (u8) le16_to_cpu(ibss_coal_resp->use_g_rate_protect); in mwifiex_ret_ibss_coalescing_status()
888 priv->adhoc_state = ADHOC_COALESCED; in mwifiex_ret_ibss_coalescing_status()
896 struct host_cmd_ds_tdls_oper *cmd_tdls_oper = &resp->params.tdls_oper; in mwifiex_ret_tdls_oper()
897 u16 reason = le16_to_cpu(cmd_tdls_oper->reason); in mwifiex_ret_tdls_oper()
898 u16 action = le16_to_cpu(cmd_tdls_oper->tdls_action); in mwifiex_ret_tdls_oper()
900 mwifiex_get_sta_entry(priv, cmd_tdls_oper->peer_mac); in mwifiex_ret_tdls_oper()
906 mwifiex_dbg(priv->adapter, MSG, in mwifiex_ret_tdls_oper()
908 cmd_tdls_oper->peer_mac, reason); in mwifiex_ret_tdls_oper()
910 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_ret_tdls_oper()
912 cmd_tdls_oper->peer_mac, reason); in mwifiex_ret_tdls_oper()
914 mwifiex_dbg(priv->adapter, MSG, in mwifiex_ret_tdls_oper()
916 cmd_tdls_oper->peer_mac); in mwifiex_ret_tdls_oper()
921 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_ret_tdls_oper()
923 cmd_tdls_oper->peer_mac, reason); in mwifiex_ret_tdls_oper()
925 node->tdls_status = TDLS_SETUP_FAILURE; in mwifiex_ret_tdls_oper()
927 mwifiex_dbg(priv->adapter, MSG, in mwifiex_ret_tdls_oper()
929 cmd_tdls_oper->peer_mac); in mwifiex_ret_tdls_oper()
934 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_ret_tdls_oper()
936 cmd_tdls_oper->peer_mac, reason); in mwifiex_ret_tdls_oper()
938 node->tdls_status = TDLS_SETUP_FAILURE; in mwifiex_ret_tdls_oper()
940 mwifiex_dbg(priv->adapter, MSG, in mwifiex_ret_tdls_oper()
942 cmd_tdls_oper->peer_mac); in mwifiex_ret_tdls_oper()
946 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_ret_tdls_oper()
948 return -1; in mwifiex_ret_tdls_oper()
960 &resp->params.subsc_evt; in mwifiex_ret_subsc_evt()
964 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_ret_subsc_evt()
966 le16_to_cpu(cmd_sub_event->events)); in mwifiex_ret_subsc_evt()
975 &resp->params.sta_list; in mwifiex_ret_uap_sta_list()
976 struct mwifiex_ie_types_sta_info *sta_info = (void *)&sta_list->tlv; in mwifiex_ret_uap_sta_list()
980 for (i = 0; i < (le16_to_cpu(sta_list->sta_count)); i++) { in mwifiex_ret_uap_sta_list()
981 sta_node = mwifiex_get_sta_entry(priv, sta_info->mac); in mwifiex_ret_uap_sta_list()
985 sta_node->stats.rssi = sta_info->rssi; in mwifiex_ret_uap_sta_list()
996 if (resp->result != HostCmd_RESULT_OK) { in mwifiex_ret_cfg_data()
997 mwifiex_dbg(priv->adapter, ERROR, "Cal data cmd resp failed\n"); in mwifiex_ret_cfg_data()
998 return -1; in mwifiex_ret_cfg_data()
1008 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_sdio_rx_aggr_cfg()
1010 &resp->params.sdio_rx_aggr_cfg; in mwifiex_ret_sdio_rx_aggr_cfg()
1012 adapter->sdio_rx_aggr_enable = cfg->enable; in mwifiex_ret_sdio_rx_aggr_cfg()
1013 adapter->sdio_rx_block_size = le16_to_cpu(cfg->block_size); in mwifiex_ret_sdio_rx_aggr_cfg()
1022 struct host_cmd_ds_robust_coex *coex = &resp->params.coex; in mwifiex_ret_robust_coex()
1024 u16 action = le16_to_cpu(coex->action); in mwifiex_ret_robust_coex()
1030 mode = le32_to_cpu(coex_tlv->mode); in mwifiex_ret_robust_coex()
1053 return ERR_PTR(-EINVAL); in mwifiex_create_custom_regdomain()
1057 return ERR_PTR(-ENOMEM); in mwifiex_create_custom_regdomain()
1091 freq - prev_freq > 20) { in mwifiex_create_custom_regdomain()
1096 rule = ®d->reg_rules[valid_rules - 1]; in mwifiex_create_custom_regdomain()
1098 rule->freq_range.end_freq_khz = MHZ_TO_KHZ(freq + 10); in mwifiex_create_custom_regdomain()
1107 rule->freq_range.start_freq_khz = MHZ_TO_KHZ(freq - 10); in mwifiex_create_custom_regdomain()
1108 rule->power_rule.max_eirp = DBM_TO_MBM(19); in mwifiex_create_custom_regdomain()
1111 rule->flags = NL80211_RRF_NO_IR; in mwifiex_create_custom_regdomain()
1114 rule->flags = NL80211_RRF_DFS; in mwifiex_create_custom_regdomain()
1116 rule->freq_range.max_bandwidth_khz = bw; in mwifiex_create_custom_regdomain()
1119 regd->n_reg_rules = valid_rules; in mwifiex_create_custom_regdomain()
1120 regd->alpha2[0] = '9'; in mwifiex_create_custom_regdomain()
1121 regd->alpha2[1] = '9'; in mwifiex_create_custom_regdomain()
1129 struct host_cmd_ds_chan_region_cfg *reg = &resp->params.reg_cfg; in mwifiex_ret_chan_region_cfg()
1130 u16 action = le16_to_cpu(reg->action); in mwifiex_ret_chan_region_cfg()
1140 tlv_buf_left = le16_to_cpu(resp->size) - S_DS_GEN - sizeof(*reg); in mwifiex_ret_chan_region_cfg()
1144 tlv = le16_to_cpu(head->type); in mwifiex_ret_chan_region_cfg()
1145 tlv_buf_len = le16_to_cpu(head->len); in mwifiex_ret_chan_region_cfg()
1152 mwifiex_dbg_dump(priv->adapter, CMD_D, "CHAN:", in mwifiex_ret_chan_region_cfg()
1158 priv->adapter->regd = regd; in mwifiex_ret_chan_region_cfg()
1163 tlv_buf_left -= (sizeof(*head) + tlv_buf_len); in mwifiex_ret_chan_region_cfg()
1173 &resp->params.pkt_aggr_ctrl; in mwifiex_ret_pkt_aggr_ctrl()
1174 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_pkt_aggr_ctrl()
1176 adapter->bus_aggr.enable = le16_to_cpu(pkt_aggr_ctrl->enable); in mwifiex_ret_pkt_aggr_ctrl()
1177 if (adapter->bus_aggr.enable) in mwifiex_ret_pkt_aggr_ctrl()
1178 adapter->intf_hdr_len = INTF_HEADER_LEN; in mwifiex_ret_pkt_aggr_ctrl()
1179 adapter->bus_aggr.mode = MWIFIEX_BUS_AGGR_MODE_LEN_V2; in mwifiex_ret_pkt_aggr_ctrl()
1180 adapter->bus_aggr.tx_aggr_max_size = in mwifiex_ret_pkt_aggr_ctrl()
1181 le16_to_cpu(pkt_aggr_ctrl->tx_aggr_max_size); in mwifiex_ret_pkt_aggr_ctrl()
1182 adapter->bus_aggr.tx_aggr_max_num = in mwifiex_ret_pkt_aggr_ctrl()
1183 le16_to_cpu(pkt_aggr_ctrl->tx_aggr_max_num); in mwifiex_ret_pkt_aggr_ctrl()
1184 adapter->bus_aggr.tx_aggr_align = in mwifiex_ret_pkt_aggr_ctrl()
1185 le16_to_cpu(pkt_aggr_ctrl->tx_aggr_align); in mwifiex_ret_pkt_aggr_ctrl()
1194 struct host_cmd_ds_sta_configure *sta_cfg_cmd = &resp->params.sta_cfg; in mwifiex_ret_get_chan_info()
1198 (struct host_cmd_tlv_channel_band *)sta_cfg_cmd->tlv_buffer; in mwifiex_ret_get_chan_info()
1199 memcpy(&channel_band->band_config, &tlv_band_channel->band_config, in mwifiex_ret_get_chan_info()
1201 channel_band->channel = tlv_band_channel->channel; in mwifiex_ret_get_chan_info()
1216 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_process_sta_cmdresp()
1217 void *data_buf = adapter->curr_cmd->data_buf; in mwifiex_process_sta_cmdresp()
1220 if (resp->result != HostCmd_RESULT_OK) { in mwifiex_process_sta_cmdresp()
1222 return -1; in mwifiex_process_sta_cmdresp()
1245 adapter->curr_cmd->wait_q_enabled = false; in mwifiex_process_sta_cmdresp()
1249 adapter->curr_cmd->wait_q_enabled = false; in mwifiex_process_sta_cmdresp()
1253 cfg80211_sched_scan_results(priv->wdev.wiphy, 0); in mwifiex_process_sta_cmdresp()
1333 if (0xffff == (u16)le16_to_cpu(resp->params.tx_buf.buff_size)) { in mwifiex_process_sta_cmdresp()
1334 if (adapter->iface_type == MWIFIEX_USB && in mwifiex_process_sta_cmdresp()
1335 adapter->usb_mc_setup) { in mwifiex_process_sta_cmdresp()
1336 if (adapter->if_ops.multi_port_resync) in mwifiex_process_sta_cmdresp()
1337 adapter->if_ops. in mwifiex_process_sta_cmdresp()
1339 adapter->usb_mc_setup = false; in mwifiex_process_sta_cmdresp()
1340 adapter->tx_lock_flag = false; in mwifiex_process_sta_cmdresp()
1344 adapter->tx_buf_size = (u16) le16_to_cpu(resp->params. in mwifiex_process_sta_cmdresp()
1346 adapter->tx_buf_size = (adapter->tx_buf_size in mwifiex_process_sta_cmdresp()
1349 adapter->curr_tx_buf_size = adapter->tx_buf_size; in mwifiex_process_sta_cmdresp()
1351 adapter->curr_tx_buf_size); in mwifiex_process_sta_cmdresp()
1353 if (adapter->if_ops.update_mp_end_port) in mwifiex_process_sta_cmdresp()
1354 adapter->if_ops.update_mp_end_port(adapter, in mwifiex_process_sta_cmdresp()
1355 le16_to_cpu(resp->params.tx_buf.mp_end_port)); in mwifiex_process_sta_cmdresp()
1391 adapter->tx_lock_flag = false; in mwifiex_process_sta_cmdresp()
1392 adapter->pps_uapsd_mode = false; in mwifiex_process_sta_cmdresp()
1393 adapter->delay_null_pkt = false; in mwifiex_process_sta_cmdresp()
1394 priv->bss_started = 1; in mwifiex_process_sta_cmdresp()
1397 priv->bss_started = 0; in mwifiex_process_sta_cmdresp()
1438 resp->command); in mwifiex_process_sta_cmdresp()