Lines Matching +full:- +full:eproto

1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
173 return ath12k_wmi_tlv_hdr(cmd, len - TLV_HDR_SIZE); in ath12k_wmi_tlv_cmd_hdr()
179 config->num_vdevs = ab->num_radios * TARGET_NUM_VDEVS; in ath12k_wmi_init_qcn9274()
181 if (ab->num_radios == 2) { in ath12k_wmi_init_qcn9274()
182 config->num_peers = TARGET_NUM_PEERS(DBS); in ath12k_wmi_init_qcn9274()
183 config->num_tids = TARGET_NUM_TIDS(DBS); in ath12k_wmi_init_qcn9274()
184 } else if (ab->num_radios == 3) { in ath12k_wmi_init_qcn9274()
185 config->num_peers = TARGET_NUM_PEERS(DBS_SBS); in ath12k_wmi_init_qcn9274()
186 config->num_tids = TARGET_NUM_TIDS(DBS_SBS); in ath12k_wmi_init_qcn9274()
189 config->num_peers = TARGET_NUM_PEERS(SINGLE); in ath12k_wmi_init_qcn9274()
190 config->num_tids = TARGET_NUM_TIDS(SINGLE); in ath12k_wmi_init_qcn9274()
192 config->num_offload_peers = TARGET_NUM_OFFLD_PEERS; in ath12k_wmi_init_qcn9274()
193 config->num_offload_reorder_buffs = TARGET_NUM_OFFLD_REORDER_BUFFS; in ath12k_wmi_init_qcn9274()
194 config->num_peer_keys = TARGET_NUM_PEER_KEYS; in ath12k_wmi_init_qcn9274()
195 config->ast_skid_limit = TARGET_AST_SKID_LIMIT; in ath12k_wmi_init_qcn9274()
196 config->tx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1; in ath12k_wmi_init_qcn9274()
197 config->rx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1; in ath12k_wmi_init_qcn9274()
198 config->rx_timeout_pri[0] = TARGET_RX_TIMEOUT_LO_PRI; in ath12k_wmi_init_qcn9274()
199 config->rx_timeout_pri[1] = TARGET_RX_TIMEOUT_LO_PRI; in ath12k_wmi_init_qcn9274()
200 config->rx_timeout_pri[2] = TARGET_RX_TIMEOUT_LO_PRI; in ath12k_wmi_init_qcn9274()
201 config->rx_timeout_pri[3] = TARGET_RX_TIMEOUT_HI_PRI; in ath12k_wmi_init_qcn9274()
203 if (test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags)) in ath12k_wmi_init_qcn9274()
204 config->rx_decap_mode = TARGET_DECAP_MODE_RAW; in ath12k_wmi_init_qcn9274()
206 config->rx_decap_mode = TARGET_DECAP_MODE_NATIVE_WIFI; in ath12k_wmi_init_qcn9274()
208 config->scan_max_pending_req = TARGET_SCAN_MAX_PENDING_REQS; in ath12k_wmi_init_qcn9274()
209 config->bmiss_offload_max_vdev = TARGET_BMISS_OFFLOAD_MAX_VDEV; in ath12k_wmi_init_qcn9274()
210 config->roam_offload_max_vdev = TARGET_ROAM_OFFLOAD_MAX_VDEV; in ath12k_wmi_init_qcn9274()
211 config->roam_offload_max_ap_profiles = TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES; in ath12k_wmi_init_qcn9274()
212 config->num_mcast_groups = TARGET_NUM_MCAST_GROUPS; in ath12k_wmi_init_qcn9274()
213 config->num_mcast_table_elems = TARGET_NUM_MCAST_TABLE_ELEMS; in ath12k_wmi_init_qcn9274()
214 config->mcast2ucast_mode = TARGET_MCAST2UCAST_MODE; in ath12k_wmi_init_qcn9274()
215 config->tx_dbg_log_size = TARGET_TX_DBG_LOG_SIZE; in ath12k_wmi_init_qcn9274()
216 config->num_wds_entries = TARGET_NUM_WDS_ENTRIES; in ath12k_wmi_init_qcn9274()
217 config->dma_burst_size = TARGET_DMA_BURST_SIZE; in ath12k_wmi_init_qcn9274()
218 config->rx_skip_defrag_timeout_dup_detection_check = in ath12k_wmi_init_qcn9274()
220 config->vow_config = TARGET_VOW_CONFIG; in ath12k_wmi_init_qcn9274()
221 config->gtk_offload_max_vdev = TARGET_GTK_OFFLOAD_MAX_VDEV; in ath12k_wmi_init_qcn9274()
222 config->num_msdu_desc = TARGET_NUM_MSDU_DESC; in ath12k_wmi_init_qcn9274()
223 config->beacon_tx_offload_max_vdev = ab->num_radios * TARGET_MAX_BCN_OFFLD; in ath12k_wmi_init_qcn9274()
224 config->rx_batchmode = TARGET_RX_BATCHMODE; in ath12k_wmi_init_qcn9274()
226 config->peer_map_unmap_version = 0x32; in ath12k_wmi_init_qcn9274()
227 config->twt_ap_pdev_count = ab->num_radios; in ath12k_wmi_init_qcn9274()
228 config->twt_ap_sta_count = 1000; in ath12k_wmi_init_qcn9274()
234 config->num_vdevs = 4; in ath12k_wmi_init_wcn7850()
235 config->num_peers = 16; in ath12k_wmi_init_wcn7850()
236 config->num_tids = 32; in ath12k_wmi_init_wcn7850()
238 config->num_offload_peers = 3; in ath12k_wmi_init_wcn7850()
239 config->num_offload_reorder_buffs = 3; in ath12k_wmi_init_wcn7850()
240 config->num_peer_keys = TARGET_NUM_PEER_KEYS; in ath12k_wmi_init_wcn7850()
241 config->ast_skid_limit = TARGET_AST_SKID_LIMIT; in ath12k_wmi_init_wcn7850()
242 config->tx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1; in ath12k_wmi_init_wcn7850()
243 config->rx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1; in ath12k_wmi_init_wcn7850()
244 config->rx_timeout_pri[0] = TARGET_RX_TIMEOUT_LO_PRI; in ath12k_wmi_init_wcn7850()
245 config->rx_timeout_pri[1] = TARGET_RX_TIMEOUT_LO_PRI; in ath12k_wmi_init_wcn7850()
246 config->rx_timeout_pri[2] = TARGET_RX_TIMEOUT_LO_PRI; in ath12k_wmi_init_wcn7850()
247 config->rx_timeout_pri[3] = TARGET_RX_TIMEOUT_HI_PRI; in ath12k_wmi_init_wcn7850()
248 config->rx_decap_mode = TARGET_DECAP_MODE_NATIVE_WIFI; in ath12k_wmi_init_wcn7850()
249 config->scan_max_pending_req = TARGET_SCAN_MAX_PENDING_REQS; in ath12k_wmi_init_wcn7850()
250 config->bmiss_offload_max_vdev = TARGET_BMISS_OFFLOAD_MAX_VDEV; in ath12k_wmi_init_wcn7850()
251 config->roam_offload_max_vdev = TARGET_ROAM_OFFLOAD_MAX_VDEV; in ath12k_wmi_init_wcn7850()
252 config->roam_offload_max_ap_profiles = TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES; in ath12k_wmi_init_wcn7850()
253 config->num_mcast_groups = 0; in ath12k_wmi_init_wcn7850()
254 config->num_mcast_table_elems = 0; in ath12k_wmi_init_wcn7850()
255 config->mcast2ucast_mode = 0; in ath12k_wmi_init_wcn7850()
256 config->tx_dbg_log_size = TARGET_TX_DBG_LOG_SIZE; in ath12k_wmi_init_wcn7850()
257 config->num_wds_entries = 0; in ath12k_wmi_init_wcn7850()
258 config->dma_burst_size = 0; in ath12k_wmi_init_wcn7850()
259 config->rx_skip_defrag_timeout_dup_detection_check = 0; in ath12k_wmi_init_wcn7850()
260 config->vow_config = TARGET_VOW_CONFIG; in ath12k_wmi_init_wcn7850()
261 config->gtk_offload_max_vdev = 2; in ath12k_wmi_init_wcn7850()
262 config->num_msdu_desc = 0x400; in ath12k_wmi_init_wcn7850()
263 config->beacon_tx_offload_max_vdev = 2; in ath12k_wmi_init_wcn7850()
264 config->rx_batchmode = TARGET_RX_BATCHMODE; in ath12k_wmi_init_wcn7850()
266 config->peer_map_unmap_version = 0x1; in ath12k_wmi_init_wcn7850()
267 config->use_pdev_id = 1; in ath12k_wmi_init_wcn7850()
268 config->max_frag_entries = 0xa; in ath12k_wmi_init_wcn7850()
269 config->num_tdls_vdevs = 0x1; in ath12k_wmi_init_wcn7850()
270 config->num_tdls_conn_table_entries = 8; in ath12k_wmi_init_wcn7850()
271 config->beacon_tx_offload_max_vdev = 0x2; in ath12k_wmi_init_wcn7850()
272 config->num_multicast_filter_entries = 0x20; in ath12k_wmi_init_wcn7850()
273 config->num_wow_filters = 0x16; in ath12k_wmi_init_wcn7850()
274 config->num_keep_alive_pattern = 0; in ath12k_wmi_init_wcn7850()
313 ptr - begin, len, sizeof(*tlv)); in ath12k_wmi_tlv_iter()
314 return -EINVAL; in ath12k_wmi_tlv_iter()
322 tlv_tag = le32_get_bits(tlv->header, WMI_TLV_TAG); in ath12k_wmi_tlv_iter()
323 tlv_len = le32_get_bits(tlv->header, WMI_TLV_LEN); in ath12k_wmi_tlv_iter()
325 len -= sizeof(*tlv); in ath12k_wmi_tlv_iter()
329 tlv_tag, ptr - begin, len, tlv_len); in ath12k_wmi_tlv_iter()
330 return -EINVAL; in ath12k_wmi_tlv_iter()
337 tlv_tag, ptr - begin, tlv_len, in ath12k_wmi_tlv_iter()
339 return -EINVAL; in ath12k_wmi_tlv_iter()
347 len -= tlv_len; in ath12k_wmi_tlv_iter()
380 return ERR_PTR(-ENOMEM); in ath12k_wmi_tlv_parse_alloc()
395 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_wmi_cmd_send_nowait()
400 return -ENOMEM; in ath12k_wmi_cmd_send_nowait()
402 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath12k_wmi_cmd_send_nowait()
403 cmd_hdr->cmd_id = le32_encode_bits(cmd_id, WMI_CMD_HDR_CMD_ID); in ath12k_wmi_cmd_send_nowait()
406 ret = ath12k_htc_send(&ab->htc, wmi->eid, skb); in ath12k_wmi_cmd_send_nowait()
421 struct ath12k_wmi_base *wmi_sc = wmi->wmi_ab; in ath12k_wmi_cmd_send()
422 int ret = -EOPNOTSUPP; in ath12k_wmi_cmd_send()
426 wait_event_timeout(wmi_sc->tx_credits_wq, ({ in ath12k_wmi_cmd_send()
429 if (ret && test_bit(ATH12K_FLAG_CRASH_FLUSH, &wmi_sc->ab->dev_flags)) in ath12k_wmi_cmd_send()
430 ret = -ESHUTDOWN; in ath12k_wmi_cmd_send()
432 (ret != -EAGAIN); in ath12k_wmi_cmd_send()
435 if (ret == -EAGAIN) in ath12k_wmi_cmd_send()
436 ath12k_warn(wmi_sc->ab, "wmi command %d timeout\n", cmd_id); in ath12k_wmi_cmd_send()
449 return -EINVAL; in ath12k_pull_svc_ready_ext()
452 arg->default_conc_scan_config_bits = in ath12k_pull_svc_ready_ext()
453 le32_to_cpu(ev->default_conc_scan_config_bits); in ath12k_pull_svc_ready_ext()
454 arg->default_fw_config_bits = le32_to_cpu(ev->default_fw_config_bits); in ath12k_pull_svc_ready_ext()
455 arg->he_cap_info = le32_to_cpu(ev->he_cap_info); in ath12k_pull_svc_ready_ext()
456 arg->mpdu_density = le32_to_cpu(ev->mpdu_density); in ath12k_pull_svc_ready_ext()
457 arg->max_bssid_rx_filters = le32_to_cpu(ev->max_bssid_rx_filters); in ath12k_pull_svc_ready_ext()
458 arg->ppet.numss_m1 = le32_to_cpu(ev->ppet.numss_m1); in ath12k_pull_svc_ready_ext()
459 arg->ppet.ru_bit_mask = le32_to_cpu(ev->ppet.ru_info); in ath12k_pull_svc_ready_ext()
462 arg->ppet.ppet16_ppet8_ru3_ru0[i] = in ath12k_pull_svc_ready_ext()
463 le32_to_cpu(ev->ppet.ppet16_ppet8_ru3_ru0[i]); in ath12k_pull_svc_ready_ext()
475 const struct ath12k_wmi_soc_mac_phy_hw_mode_caps_params *hw_caps = svc->hw_caps; in ath12k_pull_mac_phy_cap_svc_ready_ext()
476 const struct ath12k_wmi_hw_mode_cap_params *wmi_hw_mode_caps = svc->hw_mode_caps; in ath12k_pull_mac_phy_cap_svc_ready_ext()
477 const struct ath12k_wmi_mac_phy_caps_params *wmi_mac_phy_caps = svc->mac_phy_caps; in ath12k_pull_mac_phy_cap_svc_ready_ext()
478 struct ath12k_base *ab = wmi_handle->wmi_ab->ab; in ath12k_pull_mac_phy_cap_svc_ready_ext()
480 struct ath12k_pdev_cap *pdev_cap = &pdev->cap; in ath12k_pull_mac_phy_cap_svc_ready_ext()
486 if (!hw_caps || !wmi_hw_mode_caps || !svc->soc_hal_reg_caps) in ath12k_pull_mac_phy_cap_svc_ready_ext()
487 return -EINVAL; in ath12k_pull_mac_phy_cap_svc_ready_ext()
489 for (hw_idx = 0; hw_idx < le32_to_cpu(hw_caps->num_hw_modes); hw_idx++) { in ath12k_pull_mac_phy_cap_svc_ready_ext()
497 if (hw_idx == le32_to_cpu(hw_caps->num_hw_modes)) in ath12k_pull_mac_phy_cap_svc_ready_ext()
498 return -EINVAL; in ath12k_pull_mac_phy_cap_svc_ready_ext()
501 if (phy_id >= le32_to_cpu(svc->soc_hal_reg_caps->num_phy)) in ath12k_pull_mac_phy_cap_svc_ready_ext()
502 return -EINVAL; in ath12k_pull_mac_phy_cap_svc_ready_ext()
506 pdev->pdev_id = le32_to_cpu(mac_caps->pdev_id); in ath12k_pull_mac_phy_cap_svc_ready_ext()
507 pdev_cap->supported_bands |= le32_to_cpu(mac_caps->supported_bands); in ath12k_pull_mac_phy_cap_svc_ready_ext()
508 pdev_cap->ampdu_density = le32_to_cpu(mac_caps->ampdu_density); in ath12k_pull_mac_phy_cap_svc_ready_ext()
510 fw_pdev = &ab->fw_pdev[ab->fw_pdev_count]; in ath12k_pull_mac_phy_cap_svc_ready_ext()
511 fw_pdev->supported_bands = le32_to_cpu(mac_caps->supported_bands); in ath12k_pull_mac_phy_cap_svc_ready_ext()
512 fw_pdev->pdev_id = le32_to_cpu(mac_caps->pdev_id); in ath12k_pull_mac_phy_cap_svc_ready_ext()
513 fw_pdev->phy_id = le32_to_cpu(mac_caps->phy_id); in ath12k_pull_mac_phy_cap_svc_ready_ext()
514 ab->fw_pdev_count++; in ath12k_pull_mac_phy_cap_svc_ready_ext()
516 /* Take non-zero tx/rx chainmask. If tx/rx chainmask differs from in ath12k_pull_mac_phy_cap_svc_ready_ext()
520 if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_2G_CAP) { in ath12k_pull_mac_phy_cap_svc_ready_ext()
521 pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_2g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
522 pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_2g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
523 } else if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_5G_CAP) { in ath12k_pull_mac_phy_cap_svc_ready_ext()
524 pdev_cap->vht_cap = le32_to_cpu(mac_caps->vht_cap_info_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
525 pdev_cap->vht_mcs = le32_to_cpu(mac_caps->vht_supp_mcs_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
526 pdev_cap->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
527 pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
528 pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
530 return -EINVAL; in ath12k_pull_mac_phy_cap_svc_ready_ext()
535 * mac and the remaining 4 chains can be used for the second mac or vice-versa. in ath12k_pull_mac_phy_cap_svc_ready_ext()
537 * will be advertised for second mac or vice-versa. Compute the shift value in ath12k_pull_mac_phy_cap_svc_ready_ext()
541 pdev_cap->tx_chain_mask_shift = in ath12k_pull_mac_phy_cap_svc_ready_ext()
542 find_first_bit((unsigned long *)&pdev_cap->tx_chain_mask, 32); in ath12k_pull_mac_phy_cap_svc_ready_ext()
543 pdev_cap->rx_chain_mask_shift = in ath12k_pull_mac_phy_cap_svc_ready_ext()
544 find_first_bit((unsigned long *)&pdev_cap->rx_chain_mask, 32); in ath12k_pull_mac_phy_cap_svc_ready_ext()
546 if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_2G_CAP) { in ath12k_pull_mac_phy_cap_svc_ready_ext()
547 cap_band = &pdev_cap->band[NL80211_BAND_2GHZ]; in ath12k_pull_mac_phy_cap_svc_ready_ext()
548 cap_band->phy_id = le32_to_cpu(mac_caps->phy_id); in ath12k_pull_mac_phy_cap_svc_ready_ext()
549 cap_band->max_bw_supported = le32_to_cpu(mac_caps->max_bw_supported_2g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
550 cap_band->ht_cap_info = le32_to_cpu(mac_caps->ht_cap_info_2g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
551 cap_band->he_cap_info[0] = le32_to_cpu(mac_caps->he_cap_info_2g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
552 cap_band->he_cap_info[1] = le32_to_cpu(mac_caps->he_cap_info_2g_ext); in ath12k_pull_mac_phy_cap_svc_ready_ext()
553 cap_band->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_2g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
555 cap_band->he_cap_phy_info[i] = in ath12k_pull_mac_phy_cap_svc_ready_ext()
556 le32_to_cpu(mac_caps->he_cap_phy_info_2g[i]); in ath12k_pull_mac_phy_cap_svc_ready_ext()
558 cap_band->he_ppet.numss_m1 = le32_to_cpu(mac_caps->he_ppet2g.numss_m1); in ath12k_pull_mac_phy_cap_svc_ready_ext()
559 cap_band->he_ppet.ru_bit_mask = le32_to_cpu(mac_caps->he_ppet2g.ru_info); in ath12k_pull_mac_phy_cap_svc_ready_ext()
562 cap_band->he_ppet.ppet16_ppet8_ru3_ru0[i] = in ath12k_pull_mac_phy_cap_svc_ready_ext()
563 le32_to_cpu(mac_caps->he_ppet2g.ppet16_ppet8_ru3_ru0[i]); in ath12k_pull_mac_phy_cap_svc_ready_ext()
566 if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_5G_CAP) { in ath12k_pull_mac_phy_cap_svc_ready_ext()
567 cap_band = &pdev_cap->band[NL80211_BAND_5GHZ]; in ath12k_pull_mac_phy_cap_svc_ready_ext()
568 cap_band->phy_id = le32_to_cpu(mac_caps->phy_id); in ath12k_pull_mac_phy_cap_svc_ready_ext()
569 cap_band->max_bw_supported = in ath12k_pull_mac_phy_cap_svc_ready_ext()
570 le32_to_cpu(mac_caps->max_bw_supported_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
571 cap_band->ht_cap_info = le32_to_cpu(mac_caps->ht_cap_info_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
572 cap_band->he_cap_info[0] = le32_to_cpu(mac_caps->he_cap_info_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
573 cap_band->he_cap_info[1] = le32_to_cpu(mac_caps->he_cap_info_5g_ext); in ath12k_pull_mac_phy_cap_svc_ready_ext()
574 cap_band->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
576 cap_band->he_cap_phy_info[i] = in ath12k_pull_mac_phy_cap_svc_ready_ext()
577 le32_to_cpu(mac_caps->he_cap_phy_info_5g[i]); in ath12k_pull_mac_phy_cap_svc_ready_ext()
579 cap_band->he_ppet.numss_m1 = le32_to_cpu(mac_caps->he_ppet5g.numss_m1); in ath12k_pull_mac_phy_cap_svc_ready_ext()
580 cap_band->he_ppet.ru_bit_mask = le32_to_cpu(mac_caps->he_ppet5g.ru_info); in ath12k_pull_mac_phy_cap_svc_ready_ext()
583 cap_band->he_ppet.ppet16_ppet8_ru3_ru0[i] = in ath12k_pull_mac_phy_cap_svc_ready_ext()
584 le32_to_cpu(mac_caps->he_ppet5g.ppet16_ppet8_ru3_ru0[i]); in ath12k_pull_mac_phy_cap_svc_ready_ext()
586 cap_band = &pdev_cap->band[NL80211_BAND_6GHZ]; in ath12k_pull_mac_phy_cap_svc_ready_ext()
587 cap_band->max_bw_supported = in ath12k_pull_mac_phy_cap_svc_ready_ext()
588 le32_to_cpu(mac_caps->max_bw_supported_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
589 cap_band->ht_cap_info = le32_to_cpu(mac_caps->ht_cap_info_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
590 cap_band->he_cap_info[0] = le32_to_cpu(mac_caps->he_cap_info_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
591 cap_band->he_cap_info[1] = le32_to_cpu(mac_caps->he_cap_info_5g_ext); in ath12k_pull_mac_phy_cap_svc_ready_ext()
592 cap_band->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g); in ath12k_pull_mac_phy_cap_svc_ready_ext()
594 cap_band->he_cap_phy_info[i] = in ath12k_pull_mac_phy_cap_svc_ready_ext()
595 le32_to_cpu(mac_caps->he_cap_phy_info_5g[i]); in ath12k_pull_mac_phy_cap_svc_ready_ext()
597 cap_band->he_ppet.numss_m1 = le32_to_cpu(mac_caps->he_ppet5g.numss_m1); in ath12k_pull_mac_phy_cap_svc_ready_ext()
598 cap_band->he_ppet.ru_bit_mask = le32_to_cpu(mac_caps->he_ppet5g.ru_info); in ath12k_pull_mac_phy_cap_svc_ready_ext()
601 cap_band->he_ppet.ppet16_ppet8_ru3_ru0[i] = in ath12k_pull_mac_phy_cap_svc_ready_ext()
602 le32_to_cpu(mac_caps->he_ppet5g.ppet16_ppet8_ru3_ru0[i]); in ath12k_pull_mac_phy_cap_svc_ready_ext()
618 return -EINVAL; in ath12k_pull_reg_cap_svc_rdy_ext()
620 if (phy_idx >= le32_to_cpu(reg_caps->num_phy)) in ath12k_pull_reg_cap_svc_rdy_ext()
621 return -EINVAL; in ath12k_pull_reg_cap_svc_rdy_ext()
625 param->phy_id = le32_to_cpu(ext_reg_cap->phy_id); in ath12k_pull_reg_cap_svc_rdy_ext()
626 param->eeprom_reg_domain = le32_to_cpu(ext_reg_cap->eeprom_reg_domain); in ath12k_pull_reg_cap_svc_rdy_ext()
627 param->eeprom_reg_domain_ext = in ath12k_pull_reg_cap_svc_rdy_ext()
628 le32_to_cpu(ext_reg_cap->eeprom_reg_domain_ext); in ath12k_pull_reg_cap_svc_rdy_ext()
629 param->regcap1 = le32_to_cpu(ext_reg_cap->regcap1); in ath12k_pull_reg_cap_svc_rdy_ext()
630 param->regcap2 = le32_to_cpu(ext_reg_cap->regcap2); in ath12k_pull_reg_cap_svc_rdy_ext()
631 /* check if param->wireless_mode is needed */ in ath12k_pull_reg_cap_svc_rdy_ext()
632 param->low_2ghz_chan = le32_to_cpu(ext_reg_cap->low_2ghz_chan); in ath12k_pull_reg_cap_svc_rdy_ext()
633 param->high_2ghz_chan = le32_to_cpu(ext_reg_cap->high_2ghz_chan); in ath12k_pull_reg_cap_svc_rdy_ext()
634 param->low_5ghz_chan = le32_to_cpu(ext_reg_cap->low_5ghz_chan); in ath12k_pull_reg_cap_svc_rdy_ext()
635 param->high_5ghz_chan = le32_to_cpu(ext_reg_cap->high_5ghz_chan); in ath12k_pull_reg_cap_svc_rdy_ext()
649 return -EINVAL; in ath12k_pull_service_ready_tlv()
652 cap->phy_capability = le32_to_cpu(ev->phy_capability); in ath12k_pull_service_ready_tlv()
653 cap->max_frag_entry = le32_to_cpu(ev->max_frag_entry); in ath12k_pull_service_ready_tlv()
654 cap->num_rf_chains = le32_to_cpu(ev->num_rf_chains); in ath12k_pull_service_ready_tlv()
655 cap->ht_cap_info = le32_to_cpu(ev->ht_cap_info); in ath12k_pull_service_ready_tlv()
656 cap->vht_cap_info = le32_to_cpu(ev->vht_cap_info); in ath12k_pull_service_ready_tlv()
657 cap->vht_supp_mcs = le32_to_cpu(ev->vht_supp_mcs); in ath12k_pull_service_ready_tlv()
658 cap->hw_min_tx_power = le32_to_cpu(ev->hw_min_tx_power); in ath12k_pull_service_ready_tlv()
659 cap->hw_max_tx_power = le32_to_cpu(ev->hw_max_tx_power); in ath12k_pull_service_ready_tlv()
660 cap->sys_cap_info = le32_to_cpu(ev->sys_cap_info); in ath12k_pull_service_ready_tlv()
661 cap->min_pkt_size_enable = le32_to_cpu(ev->min_pkt_size_enable); in ath12k_pull_service_ready_tlv()
662 cap->max_bcn_ie_size = le32_to_cpu(ev->max_bcn_ie_size); in ath12k_pull_service_ready_tlv()
663 cap->max_num_scan_channels = le32_to_cpu(ev->max_num_scan_channels); in ath12k_pull_service_ready_tlv()
664 cap->max_supported_macs = le32_to_cpu(ev->max_supported_macs); in ath12k_pull_service_ready_tlv()
665 cap->wmi_fw_sub_feat_caps = le32_to_cpu(ev->wmi_fw_sub_feat_caps); in ath12k_pull_service_ready_tlv()
666 cap->txrx_chainmask = le32_to_cpu(ev->txrx_chainmask); in ath12k_pull_service_ready_tlv()
667 cap->default_dbs_hw_mode_index = le32_to_cpu(ev->default_dbs_hw_mode_index); in ath12k_pull_service_ready_tlv()
668 cap->num_msdu_desc = le32_to_cpu(ev->num_msdu_desc); in ath12k_pull_service_ready_tlv()
674 * wmi_service ready event are advertised in b0-b3 (LSB 4-bits) of each
675 * 4-byte word.
685 set_bit(j, wmi->wmi_ab->svc_map); in ath12k_wmi_service_bitmap_copy()
694 struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0]; in ath12k_wmi_svc_rdy_parse()
699 if (ath12k_pull_service_ready_tlv(ab, ptr, &ab->target_caps)) in ath12k_wmi_svc_rdy_parse()
700 return -EINVAL; in ath12k_wmi_svc_rdy_parse()
704 if (!svc_ready->wmi_svc_bitmap_done) { in ath12k_wmi_svc_rdy_parse()
709 return -EINVAL; in ath12k_wmi_svc_rdy_parse()
714 svc_ready->wmi_svc_bitmap_done = true; in ath12k_wmi_svc_rdy_parse()
729 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_service_ready_event()
743 struct ath12k_base *ab = wmi_sc->ab; in ath12k_wmi_alloc_skb()
751 if (!IS_ALIGNED((unsigned long)skb->data, 4)) in ath12k_wmi_alloc_skb()
755 memset(skb->data, 0, round_len); in ath12k_wmi_alloc_skb()
763 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_mgmt_send()
770 buf_len = min_t(int, frame->len, WMI_MGMT_SEND_DOWNLD_LEN); in ath12k_wmi_mgmt_send()
774 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_mgmt_send()
776 return -ENOMEM; in ath12k_wmi_mgmt_send()
778 cmd = (struct wmi_mgmt_send_cmd *)skb->data; in ath12k_wmi_mgmt_send()
779 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_MGMT_TX_SEND_CMD, in ath12k_wmi_mgmt_send()
781 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_mgmt_send()
782 cmd->desc_id = cpu_to_le32(buf_id); in ath12k_wmi_mgmt_send()
783 cmd->chanfreq = 0; in ath12k_wmi_mgmt_send()
784 cmd->paddr_lo = cpu_to_le32(lower_32_bits(ATH12K_SKB_CB(frame)->paddr)); in ath12k_wmi_mgmt_send()
785 cmd->paddr_hi = cpu_to_le32(upper_32_bits(ATH12K_SKB_CB(frame)->paddr)); in ath12k_wmi_mgmt_send()
786 cmd->frame_len = cpu_to_le32(frame->len); in ath12k_wmi_mgmt_send()
787 cmd->buf_len = cpu_to_le32(buf_len); in ath12k_wmi_mgmt_send()
788 cmd->tx_params_valid = 0; in ath12k_wmi_mgmt_send()
790 frame_tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath12k_wmi_mgmt_send()
791 frame_tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, buf_len); in ath12k_wmi_mgmt_send()
793 memcpy(frame_tlv->value, frame->data, buf_len); in ath12k_wmi_mgmt_send()
797 ath12k_warn(ar->ab, in ath12k_wmi_mgmt_send()
808 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_create()
827 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_vdev_create()
829 return -ENOMEM; in ath12k_wmi_vdev_create()
831 cmd = (struct wmi_vdev_create_cmd *)skb->data; in ath12k_wmi_vdev_create()
832 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_CREATE_CMD, in ath12k_wmi_vdev_create()
835 cmd->vdev_id = cpu_to_le32(args->if_id); in ath12k_wmi_vdev_create()
836 cmd->vdev_type = cpu_to_le32(args->type); in ath12k_wmi_vdev_create()
837 cmd->vdev_subtype = cpu_to_le32(args->subtype); in ath12k_wmi_vdev_create()
838 cmd->num_cfg_txrx_streams = cpu_to_le32(WMI_NUM_SUPPORTED_BAND_MAX); in ath12k_wmi_vdev_create()
839 cmd->pdev_id = cpu_to_le32(args->pdev_id); in ath12k_wmi_vdev_create()
840 cmd->vdev_stats_id = cpu_to_le32(args->if_stats_id); in ath12k_wmi_vdev_create()
841 ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); in ath12k_wmi_vdev_create()
843 ptr = skb->data + sizeof(*cmd); in ath12k_wmi_vdev_create()
851 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_wmi_vdev_create()
860 txrx_streams->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_TXRX_STREAMS, in ath12k_wmi_vdev_create()
862 txrx_streams->band = WMI_TPC_CHAINMASK_CONFIG_BAND_2G; in ath12k_wmi_vdev_create()
863 txrx_streams->supported_tx_streams = in ath12k_wmi_vdev_create()
864 args->chains[NL80211_BAND_2GHZ].tx; in ath12k_wmi_vdev_create()
865 txrx_streams->supported_rx_streams = in ath12k_wmi_vdev_create()
866 args->chains[NL80211_BAND_2GHZ].rx; in ath12k_wmi_vdev_create()
869 txrx_streams->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_TXRX_STREAMS, in ath12k_wmi_vdev_create()
871 txrx_streams->band = WMI_TPC_CHAINMASK_CONFIG_BAND_5G; in ath12k_wmi_vdev_create()
872 txrx_streams->supported_tx_streams = in ath12k_wmi_vdev_create()
873 args->chains[NL80211_BAND_5GHZ].tx; in ath12k_wmi_vdev_create()
874 txrx_streams->supported_rx_streams = in ath12k_wmi_vdev_create()
875 args->chains[NL80211_BAND_5GHZ].rx; in ath12k_wmi_vdev_create()
877 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_vdev_create()
879 args->if_id, args->type, args->subtype, in ath12k_wmi_vdev_create()
880 macaddr, args->pdev_id); in ath12k_wmi_vdev_create()
884 ath12k_warn(ar->ab, in ath12k_wmi_vdev_create()
894 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_delete()
899 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_delete()
901 return -ENOMEM; in ath12k_wmi_vdev_delete()
903 cmd = (struct wmi_vdev_delete_cmd *)skb->data; in ath12k_wmi_vdev_delete()
904 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_DELETE_CMD, in ath12k_wmi_vdev_delete()
906 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_vdev_delete()
908 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "WMI vdev delete id %d\n", vdev_id); in ath12k_wmi_vdev_delete()
912 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_DELETE_CMDID\n"); in ath12k_wmi_vdev_delete()
921 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_stop()
926 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_stop()
928 return -ENOMEM; in ath12k_wmi_vdev_stop()
930 cmd = (struct wmi_vdev_stop_cmd *)skb->data; in ath12k_wmi_vdev_stop()
932 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_STOP_CMD, in ath12k_wmi_vdev_stop()
934 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_vdev_stop()
936 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "WMI vdev stop id 0x%x\n", vdev_id); in ath12k_wmi_vdev_stop()
940 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_STOP cmd\n"); in ath12k_wmi_vdev_stop()
949 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_down()
954 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_down()
956 return -ENOMEM; in ath12k_wmi_vdev_down()
958 cmd = (struct wmi_vdev_down_cmd *)skb->data; in ath12k_wmi_vdev_down()
960 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_DOWN_CMD, in ath12k_wmi_vdev_down()
962 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_vdev_down()
964 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "WMI vdev down id 0x%x\n", vdev_id); in ath12k_wmi_vdev_down()
968 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_DOWN cmd\n"); in ath12k_wmi_vdev_down()
980 chan->mhz = cpu_to_le32(arg->freq); in ath12k_wmi_put_wmi_channel()
981 chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1); in ath12k_wmi_put_wmi_channel()
982 if (arg->mode == MODE_11AC_VHT80_80) in ath12k_wmi_put_wmi_channel()
983 chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq2); in ath12k_wmi_put_wmi_channel()
985 chan->band_center_freq2 = 0; in ath12k_wmi_put_wmi_channel()
987 chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE); in ath12k_wmi_put_wmi_channel()
988 if (arg->passive) in ath12k_wmi_put_wmi_channel()
989 chan->info |= cpu_to_le32(WMI_CHAN_INFO_PASSIVE); in ath12k_wmi_put_wmi_channel()
990 if (arg->allow_ibss) in ath12k_wmi_put_wmi_channel()
991 chan->info |= cpu_to_le32(WMI_CHAN_INFO_ADHOC_ALLOWED); in ath12k_wmi_put_wmi_channel()
992 if (arg->allow_ht) in ath12k_wmi_put_wmi_channel()
993 chan->info |= cpu_to_le32(WMI_CHAN_INFO_ALLOW_HT); in ath12k_wmi_put_wmi_channel()
994 if (arg->allow_vht) in ath12k_wmi_put_wmi_channel()
995 chan->info |= cpu_to_le32(WMI_CHAN_INFO_ALLOW_VHT); in ath12k_wmi_put_wmi_channel()
996 if (arg->allow_he) in ath12k_wmi_put_wmi_channel()
997 chan->info |= cpu_to_le32(WMI_CHAN_INFO_ALLOW_HE); in ath12k_wmi_put_wmi_channel()
998 if (arg->ht40plus) in ath12k_wmi_put_wmi_channel()
999 chan->info |= cpu_to_le32(WMI_CHAN_INFO_HT40_PLUS); in ath12k_wmi_put_wmi_channel()
1000 if (arg->chan_radar) in ath12k_wmi_put_wmi_channel()
1001 chan->info |= cpu_to_le32(WMI_CHAN_INFO_DFS); in ath12k_wmi_put_wmi_channel()
1002 if (arg->freq2_radar) in ath12k_wmi_put_wmi_channel()
1003 chan->info |= cpu_to_le32(WMI_CHAN_INFO_DFS_FREQ2); in ath12k_wmi_put_wmi_channel()
1005 chan->reg_info_1 = le32_encode_bits(arg->max_power, in ath12k_wmi_put_wmi_channel()
1007 le32_encode_bits(arg->max_reg_power, in ath12k_wmi_put_wmi_channel()
1010 chan->reg_info_2 = le32_encode_bits(arg->max_antenna_gain, in ath12k_wmi_put_wmi_channel()
1012 le32_encode_bits(arg->max_power, WMI_CHAN_REG_INFO2_MAX_TX_PWR); in ath12k_wmi_put_wmi_channel()
1018 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_start()
1030 if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid))) in ath12k_wmi_vdev_start()
1031 return -EINVAL; in ath12k_wmi_vdev_start()
1035 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_vdev_start()
1037 return -ENOMEM; in ath12k_wmi_vdev_start()
1039 cmd = (struct wmi_vdev_start_request_cmd *)skb->data; in ath12k_wmi_vdev_start()
1040 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_START_REQUEST_CMD, in ath12k_wmi_vdev_start()
1042 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_vdev_start()
1043 cmd->beacon_interval = cpu_to_le32(arg->bcn_intval); in ath12k_wmi_vdev_start()
1044 cmd->bcn_tx_rate = cpu_to_le32(arg->bcn_tx_rate); in ath12k_wmi_vdev_start()
1045 cmd->dtim_period = cpu_to_le32(arg->dtim_period); in ath12k_wmi_vdev_start()
1046 cmd->num_noa_descriptors = cpu_to_le32(arg->num_noa_descriptors); in ath12k_wmi_vdev_start()
1047 cmd->preferred_rx_streams = cpu_to_le32(arg->pref_rx_streams); in ath12k_wmi_vdev_start()
1048 cmd->preferred_tx_streams = cpu_to_le32(arg->pref_tx_streams); in ath12k_wmi_vdev_start()
1049 cmd->cac_duration_ms = cpu_to_le32(arg->cac_duration_ms); in ath12k_wmi_vdev_start()
1050 cmd->regdomain = cpu_to_le32(arg->regdomain); in ath12k_wmi_vdev_start()
1051 cmd->he_ops = cpu_to_le32(arg->he_ops); in ath12k_wmi_vdev_start()
1052 cmd->punct_bitmap = cpu_to_le32(arg->punct_bitmap); in ath12k_wmi_vdev_start()
1055 if (arg->ssid) { in ath12k_wmi_vdev_start()
1056 cmd->ssid.ssid_len = cpu_to_le32(arg->ssid_len); in ath12k_wmi_vdev_start()
1057 memcpy(cmd->ssid.ssid, arg->ssid, arg->ssid_len); in ath12k_wmi_vdev_start()
1059 if (arg->hidden_ssid) in ath12k_wmi_vdev_start()
1060 cmd->flags |= cpu_to_le32(WMI_VDEV_START_HIDDEN_SSID); in ath12k_wmi_vdev_start()
1061 if (arg->pmf_enabled) in ath12k_wmi_vdev_start()
1062 cmd->flags |= cpu_to_le32(WMI_VDEV_START_PMF_ENABLED); in ath12k_wmi_vdev_start()
1065 cmd->flags |= cpu_to_le32(WMI_VDEV_START_LDPC_RX_ENABLED); in ath12k_wmi_vdev_start()
1067 ptr = skb->data + sizeof(*cmd); in ath12k_wmi_vdev_start()
1076 chan->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_CHANNEL, in ath12k_wmi_vdev_start()
1085 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, 0); in ath12k_wmi_vdev_start()
1093 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "vdev %s id 0x%x freq 0x%x mode 0x%x\n", in ath12k_wmi_vdev_start()
1094 restart ? "restart" : "start", arg->vdev_id, in ath12k_wmi_vdev_start()
1095 arg->freq, arg->mode); in ath12k_wmi_vdev_start()
1104 ath12k_warn(ar->ab, "failed to submit vdev_%s cmd\n", in ath12k_wmi_vdev_start()
1114 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_up()
1119 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_up()
1121 return -ENOMEM; in ath12k_wmi_vdev_up()
1123 cmd = (struct wmi_vdev_up_cmd *)skb->data; in ath12k_wmi_vdev_up()
1125 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_UP_CMD, in ath12k_wmi_vdev_up()
1127 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_vdev_up()
1128 cmd->vdev_assoc_id = cpu_to_le32(aid); in ath12k_wmi_vdev_up()
1130 ether_addr_copy(cmd->vdev_bssid.addr, bssid); in ath12k_wmi_vdev_up()
1132 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_vdev_up()
1138 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_UP cmd\n"); in ath12k_wmi_vdev_up()
1148 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_peer_create_cmd()
1153 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_peer_create_cmd()
1155 return -ENOMEM; in ath12k_wmi_send_peer_create_cmd()
1157 cmd = (struct wmi_peer_create_cmd *)skb->data; in ath12k_wmi_send_peer_create_cmd()
1158 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PEER_CREATE_CMD, in ath12k_wmi_send_peer_create_cmd()
1161 ether_addr_copy(cmd->peer_macaddr.addr, arg->peer_addr); in ath12k_wmi_send_peer_create_cmd()
1162 cmd->peer_type = cpu_to_le32(arg->peer_type); in ath12k_wmi_send_peer_create_cmd()
1163 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_send_peer_create_cmd()
1165 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_peer_create_cmd()
1167 arg->vdev_id, arg->peer_addr); in ath12k_wmi_send_peer_create_cmd()
1171 ath12k_warn(ar->ab, "failed to submit WMI_PEER_CREATE cmd\n"); in ath12k_wmi_send_peer_create_cmd()
1181 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_peer_delete_cmd()
1186 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_peer_delete_cmd()
1188 return -ENOMEM; in ath12k_wmi_send_peer_delete_cmd()
1190 cmd = (struct wmi_peer_delete_cmd *)skb->data; in ath12k_wmi_send_peer_delete_cmd()
1191 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PEER_DELETE_CMD, in ath12k_wmi_send_peer_delete_cmd()
1194 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath12k_wmi_send_peer_delete_cmd()
1195 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_send_peer_delete_cmd()
1197 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_peer_delete_cmd()
1203 ath12k_warn(ar->ab, "failed to send WMI_PEER_DELETE cmd\n"); in ath12k_wmi_send_peer_delete_cmd()
1213 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_pdev_set_regdomain()
1218 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_pdev_set_regdomain()
1220 return -ENOMEM; in ath12k_wmi_send_pdev_set_regdomain()
1222 cmd = (struct wmi_pdev_set_regdomain_cmd *)skb->data; in ath12k_wmi_send_pdev_set_regdomain()
1223 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_SET_REGDOMAIN_CMD, in ath12k_wmi_send_pdev_set_regdomain()
1226 cmd->reg_domain = cpu_to_le32(arg->current_rd_in_use); in ath12k_wmi_send_pdev_set_regdomain()
1227 cmd->reg_domain_2g = cpu_to_le32(arg->current_rd_2g); in ath12k_wmi_send_pdev_set_regdomain()
1228 cmd->reg_domain_5g = cpu_to_le32(arg->current_rd_5g); in ath12k_wmi_send_pdev_set_regdomain()
1229 cmd->conformance_test_limit_2g = cpu_to_le32(arg->ctl_2g); in ath12k_wmi_send_pdev_set_regdomain()
1230 cmd->conformance_test_limit_5g = cpu_to_le32(arg->ctl_5g); in ath12k_wmi_send_pdev_set_regdomain()
1231 cmd->dfs_domain = cpu_to_le32(arg->dfs_domain); in ath12k_wmi_send_pdev_set_regdomain()
1232 cmd->pdev_id = cpu_to_le32(arg->pdev_id); in ath12k_wmi_send_pdev_set_regdomain()
1234 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_pdev_set_regdomain()
1236 arg->current_rd_in_use, arg->current_rd_2g, in ath12k_wmi_send_pdev_set_regdomain()
1237 arg->current_rd_5g, arg->dfs_domain, arg->pdev_id); in ath12k_wmi_send_pdev_set_regdomain()
1241 ath12k_warn(ar->ab, in ath12k_wmi_send_pdev_set_regdomain()
1252 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_set_peer_param()
1257 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_set_peer_param()
1259 return -ENOMEM; in ath12k_wmi_set_peer_param()
1261 cmd = (struct wmi_peer_set_param_cmd *)skb->data; in ath12k_wmi_set_peer_param()
1262 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PEER_SET_PARAM_CMD, in ath12k_wmi_set_peer_param()
1264 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath12k_wmi_set_peer_param()
1265 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_set_peer_param()
1266 cmd->param_id = cpu_to_le32(param_id); in ath12k_wmi_set_peer_param()
1267 cmd->param_value = cpu_to_le32(param_val); in ath12k_wmi_set_peer_param()
1269 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_set_peer_param()
1275 ath12k_warn(ar->ab, "failed to send WMI_PEER_SET_PARAM cmd\n"); in ath12k_wmi_set_peer_param()
1287 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_peer_flush_tids_cmd()
1292 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_peer_flush_tids_cmd()
1294 return -ENOMEM; in ath12k_wmi_send_peer_flush_tids_cmd()
1296 cmd = (struct wmi_peer_flush_tids_cmd *)skb->data; in ath12k_wmi_send_peer_flush_tids_cmd()
1297 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PEER_FLUSH_TIDS_CMD, in ath12k_wmi_send_peer_flush_tids_cmd()
1300 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath12k_wmi_send_peer_flush_tids_cmd()
1301 cmd->peer_tid_bitmap = cpu_to_le32(peer_tid_bitmap); in ath12k_wmi_send_peer_flush_tids_cmd()
1302 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_send_peer_flush_tids_cmd()
1304 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_peer_flush_tids_cmd()
1310 ath12k_warn(ar->ab, in ath12k_wmi_send_peer_flush_tids_cmd()
1328 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_peer_rx_reorder_queue_setup()
1330 return -ENOMEM; in ath12k_wmi_peer_rx_reorder_queue_setup()
1332 cmd = (struct wmi_peer_reorder_queue_setup_cmd *)skb->data; in ath12k_wmi_peer_rx_reorder_queue_setup()
1333 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_REORDER_QUEUE_SETUP_CMD, in ath12k_wmi_peer_rx_reorder_queue_setup()
1336 ether_addr_copy(cmd->peer_macaddr.addr, addr); in ath12k_wmi_peer_rx_reorder_queue_setup()
1337 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_peer_rx_reorder_queue_setup()
1338 cmd->tid = cpu_to_le32(tid); in ath12k_wmi_peer_rx_reorder_queue_setup()
1339 cmd->queue_ptr_lo = cpu_to_le32(lower_32_bits(paddr)); in ath12k_wmi_peer_rx_reorder_queue_setup()
1340 cmd->queue_ptr_hi = cpu_to_le32(upper_32_bits(paddr)); in ath12k_wmi_peer_rx_reorder_queue_setup()
1341 cmd->queue_no = cpu_to_le32(tid); in ath12k_wmi_peer_rx_reorder_queue_setup()
1342 cmd->ba_window_size_valid = cpu_to_le32(ba_window_size_valid); in ath12k_wmi_peer_rx_reorder_queue_setup()
1343 cmd->ba_window_size = cpu_to_le32(ba_window_size); in ath12k_wmi_peer_rx_reorder_queue_setup()
1345 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_peer_rx_reorder_queue_setup()
1349 ret = ath12k_wmi_cmd_send(ar->wmi, skb, in ath12k_wmi_peer_rx_reorder_queue_setup()
1352 ath12k_warn(ar->ab, in ath12k_wmi_peer_rx_reorder_queue_setup()
1364 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_rx_reord_queue_remove()
1369 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_rx_reord_queue_remove()
1371 return -ENOMEM; in ath12k_wmi_rx_reord_queue_remove()
1373 cmd = (struct wmi_peer_reorder_queue_remove_cmd *)skb->data; in ath12k_wmi_rx_reord_queue_remove()
1374 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_REORDER_QUEUE_REMOVE_CMD, in ath12k_wmi_rx_reord_queue_remove()
1377 ether_addr_copy(cmd->peer_macaddr.addr, arg->peer_macaddr); in ath12k_wmi_rx_reord_queue_remove()
1378 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_rx_reord_queue_remove()
1379 cmd->tid_mask = cpu_to_le32(arg->peer_tid_bitmap); in ath12k_wmi_rx_reord_queue_remove()
1381 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_rx_reord_queue_remove()
1383 arg->peer_macaddr, arg->vdev_id, arg->peer_tid_bitmap); in ath12k_wmi_rx_reord_queue_remove()
1388 ath12k_warn(ar->ab, in ath12k_wmi_rx_reord_queue_remove()
1399 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_pdev_set_param()
1404 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_set_param()
1406 return -ENOMEM; in ath12k_wmi_pdev_set_param()
1408 cmd = (struct wmi_pdev_set_param_cmd *)skb->data; in ath12k_wmi_pdev_set_param()
1409 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_SET_PARAM_CMD, in ath12k_wmi_pdev_set_param()
1411 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_pdev_set_param()
1412 cmd->param_id = cpu_to_le32(param_id); in ath12k_wmi_pdev_set_param()
1413 cmd->param_value = cpu_to_le32(param_value); in ath12k_wmi_pdev_set_param()
1415 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_set_param()
1421 ath12k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath12k_wmi_pdev_set_param()
1430 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_pdev_set_ps_mode()
1435 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_set_ps_mode()
1437 return -ENOMEM; in ath12k_wmi_pdev_set_ps_mode()
1439 cmd = (struct wmi_pdev_set_ps_mode_cmd *)skb->data; in ath12k_wmi_pdev_set_ps_mode()
1440 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_STA_POWERSAVE_MODE_CMD, in ath12k_wmi_pdev_set_ps_mode()
1442 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_pdev_set_ps_mode()
1443 cmd->sta_ps_mode = cpu_to_le32(enable); in ath12k_wmi_pdev_set_ps_mode()
1445 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_set_ps_mode()
1451 ath12k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath12k_wmi_pdev_set_ps_mode()
1461 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_pdev_suspend()
1466 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_suspend()
1468 return -ENOMEM; in ath12k_wmi_pdev_suspend()
1470 cmd = (struct wmi_pdev_suspend_cmd *)skb->data; in ath12k_wmi_pdev_suspend()
1472 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_SUSPEND_CMD, in ath12k_wmi_pdev_suspend()
1475 cmd->suspend_opt = cpu_to_le32(suspend_opt); in ath12k_wmi_pdev_suspend()
1476 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_pdev_suspend()
1478 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_suspend()
1483 ath12k_warn(ar->ab, "failed to send WMI_PDEV_SUSPEND cmd\n"); in ath12k_wmi_pdev_suspend()
1492 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_pdev_resume()
1497 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_resume()
1499 return -ENOMEM; in ath12k_wmi_pdev_resume()
1501 cmd = (struct wmi_pdev_resume_cmd *)skb->data; in ath12k_wmi_pdev_resume()
1503 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_RESUME_CMD, in ath12k_wmi_pdev_resume()
1505 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_pdev_resume()
1507 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_resume()
1512 ath12k_warn(ar->ab, "failed to send WMI_PDEV_RESUME cmd\n"); in ath12k_wmi_pdev_resume()
1526 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_pdev_bss_chan_info_request()
1531 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_bss_chan_info_request()
1533 return -ENOMEM; in ath12k_wmi_pdev_bss_chan_info_request()
1535 cmd = (struct wmi_pdev_bss_chan_info_req_cmd *)skb->data; in ath12k_wmi_pdev_bss_chan_info_request()
1537 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_BSS_CHAN_INFO_REQUEST, in ath12k_wmi_pdev_bss_chan_info_request()
1539 cmd->req_type = cpu_to_le32(type); in ath12k_wmi_pdev_bss_chan_info_request()
1541 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_bss_chan_info_request()
1547 ath12k_warn(ar->ab, in ath12k_wmi_pdev_bss_chan_info_request()
1558 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_set_ap_ps_param_cmd()
1563 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_set_ap_ps_param_cmd()
1565 return -ENOMEM; in ath12k_wmi_send_set_ap_ps_param_cmd()
1567 cmd = (struct wmi_ap_ps_peer_cmd *)skb->data; in ath12k_wmi_send_set_ap_ps_param_cmd()
1568 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_AP_PS_PEER_CMD, in ath12k_wmi_send_set_ap_ps_param_cmd()
1571 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_send_set_ap_ps_param_cmd()
1572 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath12k_wmi_send_set_ap_ps_param_cmd()
1573 cmd->param = cpu_to_le32(arg->param); in ath12k_wmi_send_set_ap_ps_param_cmd()
1574 cmd->value = cpu_to_le32(arg->value); in ath12k_wmi_send_set_ap_ps_param_cmd()
1576 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_set_ap_ps_param_cmd()
1578 arg->vdev_id, peer_addr, arg->param, arg->value); in ath12k_wmi_send_set_ap_ps_param_cmd()
1582 ath12k_warn(ar->ab, in ath12k_wmi_send_set_ap_ps_param_cmd()
1593 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_set_sta_ps_param()
1598 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_set_sta_ps_param()
1600 return -ENOMEM; in ath12k_wmi_set_sta_ps_param()
1602 cmd = (struct wmi_sta_powersave_param_cmd *)skb->data; in ath12k_wmi_set_sta_ps_param()
1603 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_STA_POWERSAVE_PARAM_CMD, in ath12k_wmi_set_sta_ps_param()
1606 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_set_sta_ps_param()
1607 cmd->param = cpu_to_le32(param); in ath12k_wmi_set_sta_ps_param()
1608 cmd->value = cpu_to_le32(param_value); in ath12k_wmi_set_sta_ps_param()
1610 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_set_sta_ps_param()
1616 ath12k_warn(ar->ab, "failed to send WMI_STA_POWERSAVE_PARAM_CMDID"); in ath12k_wmi_set_sta_ps_param()
1625 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_force_fw_hang_cmd()
1632 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_force_fw_hang_cmd()
1634 return -ENOMEM; in ath12k_wmi_force_fw_hang_cmd()
1636 cmd = (struct wmi_force_fw_hang_cmd *)skb->data; in ath12k_wmi_force_fw_hang_cmd()
1637 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_FORCE_FW_HANG_CMD, in ath12k_wmi_force_fw_hang_cmd()
1640 cmd->type = cpu_to_le32(type); in ath12k_wmi_force_fw_hang_cmd()
1641 cmd->delay_time_ms = cpu_to_le32(delay_time_ms); in ath12k_wmi_force_fw_hang_cmd()
1646 ath12k_warn(ar->ab, "Failed to send WMI_FORCE_FW_HANG_CMDID"); in ath12k_wmi_force_fw_hang_cmd()
1655 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_set_param_cmd()
1660 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_set_param_cmd()
1662 return -ENOMEM; in ath12k_wmi_vdev_set_param_cmd()
1664 cmd = (struct wmi_vdev_set_param_cmd *)skb->data; in ath12k_wmi_vdev_set_param_cmd()
1665 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_SET_PARAM_CMD, in ath12k_wmi_vdev_set_param_cmd()
1668 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_vdev_set_param_cmd()
1669 cmd->param_id = cpu_to_le32(param_id); in ath12k_wmi_vdev_set_param_cmd()
1670 cmd->param_value = cpu_to_le32(param_value); in ath12k_wmi_vdev_set_param_cmd()
1672 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_vdev_set_param_cmd()
1678 ath12k_warn(ar->ab, in ath12k_wmi_vdev_set_param_cmd()
1688 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_pdev_temperature_cmd()
1693 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_pdev_temperature_cmd()
1695 return -ENOMEM; in ath12k_wmi_send_pdev_temperature_cmd()
1697 cmd = (struct wmi_get_pdev_temperature_cmd *)skb->data; in ath12k_wmi_send_pdev_temperature_cmd()
1698 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_GET_TEMPERATURE_CMD, in ath12k_wmi_send_pdev_temperature_cmd()
1700 cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id); in ath12k_wmi_send_pdev_temperature_cmd()
1702 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_pdev_temperature_cmd()
1703 "WMI pdev get temperature for pdev_id %d\n", ar->pdev->pdev_id); in ath12k_wmi_send_pdev_temperature_cmd()
1707 ath12k_warn(ar->ab, "failed to send WMI_PDEV_GET_TEMPERATURE cmd\n"); in ath12k_wmi_send_pdev_temperature_cmd()
1717 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_bcn_offload_control_cmd()
1722 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_bcn_offload_control_cmd()
1724 return -ENOMEM; in ath12k_wmi_send_bcn_offload_control_cmd()
1726 cmd = (struct wmi_bcn_offload_ctrl_cmd *)skb->data; in ath12k_wmi_send_bcn_offload_control_cmd()
1727 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_BCN_OFFLOAD_CTRL_CMD, in ath12k_wmi_send_bcn_offload_control_cmd()
1730 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_send_bcn_offload_control_cmd()
1731 cmd->bcn_ctrl_op = cpu_to_le32(bcn_ctrl_op); in ath12k_wmi_send_bcn_offload_control_cmd()
1733 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_bcn_offload_control_cmd()
1739 ath12k_warn(ar->ab, in ath12k_wmi_send_bcn_offload_control_cmd()
1751 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_bcn_tmpl()
1762 size_t aligned_len = roundup(bcn->len, 4); in ath12k_wmi_bcn_tmpl()
1766 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_bcn_tmpl()
1768 return -ENOMEM; in ath12k_wmi_bcn_tmpl()
1770 cmd = (struct wmi_bcn_tmpl_cmd *)skb->data; in ath12k_wmi_bcn_tmpl()
1771 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_BCN_TMPL_CMD, in ath12k_wmi_bcn_tmpl()
1773 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_bcn_tmpl()
1774 cmd->tim_ie_offset = cpu_to_le32(offs->tim_offset); in ath12k_wmi_bcn_tmpl()
1775 cmd->csa_switch_count_offset = cpu_to_le32(offs->cntdwn_counter_offs[0]); in ath12k_wmi_bcn_tmpl()
1776 cmd->ext_csa_switch_count_offset = cpu_to_le32(offs->cntdwn_counter_offs[1]); in ath12k_wmi_bcn_tmpl()
1777 cmd->buf_len = cpu_to_le32(bcn->len); in ath12k_wmi_bcn_tmpl()
1779 ptr = skb->data + sizeof(*cmd); in ath12k_wmi_bcn_tmpl()
1787 bcn_prb_info->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_BCN_PRB_INFO, in ath12k_wmi_bcn_tmpl()
1789 bcn_prb_info->caps = 0; in ath12k_wmi_bcn_tmpl()
1790 bcn_prb_info->erp = 0; in ath12k_wmi_bcn_tmpl()
1799 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, aligned_len); in ath12k_wmi_bcn_tmpl()
1800 memcpy(tlv->value, bcn->data, bcn->len); in ath12k_wmi_bcn_tmpl()
1804 ath12k_warn(ar->ab, "failed to send WMI_BCN_TMPL_CMDID\n"); in ath12k_wmi_bcn_tmpl()
1814 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_vdev_install_key()
1821 * length is specified in cmd->key_len. in ath12k_wmi_vdev_install_key()
1823 key_len_aligned = roundup(arg->key_len, 4); in ath12k_wmi_vdev_install_key()
1827 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_vdev_install_key()
1829 return -ENOMEM; in ath12k_wmi_vdev_install_key()
1831 cmd = (struct wmi_vdev_install_key_cmd *)skb->data; in ath12k_wmi_vdev_install_key()
1832 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_INSTALL_KEY_CMD, in ath12k_wmi_vdev_install_key()
1834 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_vdev_install_key()
1835 ether_addr_copy(cmd->peer_macaddr.addr, arg->macaddr); in ath12k_wmi_vdev_install_key()
1836 cmd->key_idx = cpu_to_le32(arg->key_idx); in ath12k_wmi_vdev_install_key()
1837 cmd->key_flags = cpu_to_le32(arg->key_flags); in ath12k_wmi_vdev_install_key()
1838 cmd->key_cipher = cpu_to_le32(arg->key_cipher); in ath12k_wmi_vdev_install_key()
1839 cmd->key_len = cpu_to_le32(arg->key_len); in ath12k_wmi_vdev_install_key()
1840 cmd->key_txmic_len = cpu_to_le32(arg->key_txmic_len); in ath12k_wmi_vdev_install_key()
1841 cmd->key_rxmic_len = cpu_to_le32(arg->key_rxmic_len); in ath12k_wmi_vdev_install_key()
1843 if (arg->key_rsc_counter) in ath12k_wmi_vdev_install_key()
1844 cmd->key_rsc_counter = cpu_to_le64(arg->key_rsc_counter); in ath12k_wmi_vdev_install_key()
1846 tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath12k_wmi_vdev_install_key()
1847 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, key_len_aligned); in ath12k_wmi_vdev_install_key()
1848 memcpy(tlv->value, arg->key_data, arg->key_len); in ath12k_wmi_vdev_install_key()
1850 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_vdev_install_key()
1852 arg->key_idx, arg->key_cipher, arg->key_len); in ath12k_wmi_vdev_install_key()
1856 ath12k_warn(ar->ab, in ath12k_wmi_vdev_install_key()
1868 cmd->peer_flags = 0; in ath12k_wmi_copy_peer_flags()
1869 cmd->peer_flags_ext = 0; in ath12k_wmi_copy_peer_flags()
1871 if (arg->is_wme_set) { in ath12k_wmi_copy_peer_flags()
1872 if (arg->qos_flag) in ath12k_wmi_copy_peer_flags()
1873 cmd->peer_flags |= cpu_to_le32(WMI_PEER_QOS); in ath12k_wmi_copy_peer_flags()
1874 if (arg->apsd_flag) in ath12k_wmi_copy_peer_flags()
1875 cmd->peer_flags |= cpu_to_le32(WMI_PEER_APSD); in ath12k_wmi_copy_peer_flags()
1876 if (arg->ht_flag) in ath12k_wmi_copy_peer_flags()
1877 cmd->peer_flags |= cpu_to_le32(WMI_PEER_HT); in ath12k_wmi_copy_peer_flags()
1878 if (arg->bw_40) in ath12k_wmi_copy_peer_flags()
1879 cmd->peer_flags |= cpu_to_le32(WMI_PEER_40MHZ); in ath12k_wmi_copy_peer_flags()
1880 if (arg->bw_80) in ath12k_wmi_copy_peer_flags()
1881 cmd->peer_flags |= cpu_to_le32(WMI_PEER_80MHZ); in ath12k_wmi_copy_peer_flags()
1882 if (arg->bw_160) in ath12k_wmi_copy_peer_flags()
1883 cmd->peer_flags |= cpu_to_le32(WMI_PEER_160MHZ); in ath12k_wmi_copy_peer_flags()
1884 if (arg->bw_320) in ath12k_wmi_copy_peer_flags()
1885 cmd->peer_flags |= cpu_to_le32(WMI_PEER_EXT_320MHZ); in ath12k_wmi_copy_peer_flags()
1890 if (arg->stbc_flag) in ath12k_wmi_copy_peer_flags()
1891 cmd->peer_flags |= cpu_to_le32(WMI_PEER_STBC); in ath12k_wmi_copy_peer_flags()
1896 if (arg->ldpc_flag) in ath12k_wmi_copy_peer_flags()
1897 cmd->peer_flags |= cpu_to_le32(WMI_PEER_LDPC); in ath12k_wmi_copy_peer_flags()
1899 if (arg->static_mimops_flag) in ath12k_wmi_copy_peer_flags()
1900 cmd->peer_flags |= cpu_to_le32(WMI_PEER_STATIC_MIMOPS); in ath12k_wmi_copy_peer_flags()
1901 if (arg->dynamic_mimops_flag) in ath12k_wmi_copy_peer_flags()
1902 cmd->peer_flags |= cpu_to_le32(WMI_PEER_DYN_MIMOPS); in ath12k_wmi_copy_peer_flags()
1903 if (arg->spatial_mux_flag) in ath12k_wmi_copy_peer_flags()
1904 cmd->peer_flags |= cpu_to_le32(WMI_PEER_SPATIAL_MUX); in ath12k_wmi_copy_peer_flags()
1905 if (arg->vht_flag) in ath12k_wmi_copy_peer_flags()
1906 cmd->peer_flags |= cpu_to_le32(WMI_PEER_VHT); in ath12k_wmi_copy_peer_flags()
1907 if (arg->he_flag) in ath12k_wmi_copy_peer_flags()
1908 cmd->peer_flags |= cpu_to_le32(WMI_PEER_HE); in ath12k_wmi_copy_peer_flags()
1909 if (arg->twt_requester) in ath12k_wmi_copy_peer_flags()
1910 cmd->peer_flags |= cpu_to_le32(WMI_PEER_TWT_REQ); in ath12k_wmi_copy_peer_flags()
1911 if (arg->twt_responder) in ath12k_wmi_copy_peer_flags()
1912 cmd->peer_flags |= cpu_to_le32(WMI_PEER_TWT_RESP); in ath12k_wmi_copy_peer_flags()
1913 if (arg->eht_flag) in ath12k_wmi_copy_peer_flags()
1914 cmd->peer_flags_ext |= cpu_to_le32(WMI_PEER_EXT_EHT); in ath12k_wmi_copy_peer_flags()
1917 /* Suppress authorization for all AUTH modes that need 4-way handshake in ath12k_wmi_copy_peer_flags()
1918 * (during re-association). in ath12k_wmi_copy_peer_flags()
1921 if (arg->auth_flag) in ath12k_wmi_copy_peer_flags()
1922 cmd->peer_flags |= cpu_to_le32(WMI_PEER_AUTH); in ath12k_wmi_copy_peer_flags()
1923 if (arg->need_ptk_4_way) { in ath12k_wmi_copy_peer_flags()
1924 cmd->peer_flags |= cpu_to_le32(WMI_PEER_NEED_PTK_4_WAY); in ath12k_wmi_copy_peer_flags()
1926 cmd->peer_flags &= cpu_to_le32(~WMI_PEER_AUTH); in ath12k_wmi_copy_peer_flags()
1928 if (arg->need_gtk_2_way) in ath12k_wmi_copy_peer_flags()
1929 cmd->peer_flags |= cpu_to_le32(WMI_PEER_NEED_GTK_2_WAY); in ath12k_wmi_copy_peer_flags()
1930 /* safe mode bypass the 4-way handshake */ in ath12k_wmi_copy_peer_flags()
1931 if (arg->safe_mode_enabled) in ath12k_wmi_copy_peer_flags()
1932 cmd->peer_flags &= cpu_to_le32(~(WMI_PEER_NEED_PTK_4_WAY | in ath12k_wmi_copy_peer_flags()
1935 if (arg->is_pmf_enabled) in ath12k_wmi_copy_peer_flags()
1936 cmd->peer_flags |= cpu_to_le32(WMI_PEER_PMF); in ath12k_wmi_copy_peer_flags()
1941 * if (arg->amsdu_disable) Add after FW support in ath12k_wmi_copy_peer_flags()
1945 * Mark the node as non-HT if all the mcs rates are disabled through in ath12k_wmi_copy_peer_flags()
1948 if (arg->peer_ht_rates.num_rates == 0) in ath12k_wmi_copy_peer_flags()
1949 cmd->peer_flags &= cpu_to_le32(~WMI_PEER_HT); in ath12k_wmi_copy_peer_flags()
1955 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_peer_assoc_cmd()
1971 peer_legacy_rates_align = roundup(arg->peer_legacy_rates.num_rates, in ath12k_wmi_send_peer_assoc_cmd()
1973 peer_ht_rates_align = roundup(arg->peer_ht_rates.num_rates, in ath12k_wmi_send_peer_assoc_cmd()
1980 (sizeof(*he_mcs) * arg->peer_he_mcs_count) + in ath12k_wmi_send_peer_assoc_cmd()
1981 TLV_HDR_SIZE + (sizeof(*eht_mcs) * arg->peer_eht_mcs_count) + in ath12k_wmi_send_peer_assoc_cmd()
1984 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_peer_assoc_cmd()
1986 return -ENOMEM; in ath12k_wmi_send_peer_assoc_cmd()
1988 ptr = skb->data; in ath12k_wmi_send_peer_assoc_cmd()
1995 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PEER_ASSOC_COMPLETE_CMD, in ath12k_wmi_send_peer_assoc_cmd()
1998 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_send_peer_assoc_cmd()
2000 cmd->peer_new_assoc = cpu_to_le32(arg->peer_new_assoc); in ath12k_wmi_send_peer_assoc_cmd()
2001 cmd->peer_associd = cpu_to_le32(arg->peer_associd); in ath12k_wmi_send_peer_assoc_cmd()
2002 cmd->punct_bitmap = cpu_to_le32(arg->punct_bitmap); in ath12k_wmi_send_peer_assoc_cmd()
2006 &ar->ab->dev_flags)); in ath12k_wmi_send_peer_assoc_cmd()
2008 ether_addr_copy(cmd->peer_macaddr.addr, arg->peer_mac); in ath12k_wmi_send_peer_assoc_cmd()
2010 cmd->peer_rate_caps = cpu_to_le32(arg->peer_rate_caps); in ath12k_wmi_send_peer_assoc_cmd()
2011 cmd->peer_caps = cpu_to_le32(arg->peer_caps); in ath12k_wmi_send_peer_assoc_cmd()
2012 cmd->peer_listen_intval = cpu_to_le32(arg->peer_listen_intval); in ath12k_wmi_send_peer_assoc_cmd()
2013 cmd->peer_ht_caps = cpu_to_le32(arg->peer_ht_caps); in ath12k_wmi_send_peer_assoc_cmd()
2014 cmd->peer_max_mpdu = cpu_to_le32(arg->peer_max_mpdu); in ath12k_wmi_send_peer_assoc_cmd()
2015 cmd->peer_mpdu_density = cpu_to_le32(arg->peer_mpdu_density); in ath12k_wmi_send_peer_assoc_cmd()
2016 cmd->peer_vht_caps = cpu_to_le32(arg->peer_vht_caps); in ath12k_wmi_send_peer_assoc_cmd()
2017 cmd->peer_phymode = cpu_to_le32(arg->peer_phymode); in ath12k_wmi_send_peer_assoc_cmd()
2020 cmd->peer_he_cap_info = cpu_to_le32(arg->peer_he_cap_macinfo[0]); in ath12k_wmi_send_peer_assoc_cmd()
2021 cmd->peer_he_cap_info_ext = cpu_to_le32(arg->peer_he_cap_macinfo[1]); in ath12k_wmi_send_peer_assoc_cmd()
2022 cmd->peer_he_cap_info_internal = cpu_to_le32(arg->peer_he_cap_macinfo_internal); in ath12k_wmi_send_peer_assoc_cmd()
2023 cmd->peer_he_caps_6ghz = cpu_to_le32(arg->peer_he_caps_6ghz); in ath12k_wmi_send_peer_assoc_cmd()
2024 cmd->peer_he_ops = cpu_to_le32(arg->peer_he_ops); in ath12k_wmi_send_peer_assoc_cmd()
2026 cmd->peer_he_cap_phy[i] = in ath12k_wmi_send_peer_assoc_cmd()
2027 cpu_to_le32(arg->peer_he_cap_phyinfo[i]); in ath12k_wmi_send_peer_assoc_cmd()
2028 cmd->peer_ppet.numss_m1 = cpu_to_le32(arg->peer_ppet.numss_m1); in ath12k_wmi_send_peer_assoc_cmd()
2029 cmd->peer_ppet.ru_info = cpu_to_le32(arg->peer_ppet.ru_bit_mask); in ath12k_wmi_send_peer_assoc_cmd()
2031 cmd->peer_ppet.ppet16_ppet8_ru3_ru0[i] = in ath12k_wmi_send_peer_assoc_cmd()
2032 cpu_to_le32(arg->peer_ppet.ppet16_ppet8_ru3_ru0[i]); in ath12k_wmi_send_peer_assoc_cmd()
2035 memcpy_and_pad(cmd->peer_eht_cap_mac, sizeof(cmd->peer_eht_cap_mac), in ath12k_wmi_send_peer_assoc_cmd()
2036 arg->peer_eht_cap_mac, sizeof(arg->peer_eht_cap_mac), in ath12k_wmi_send_peer_assoc_cmd()
2038 memcpy_and_pad(cmd->peer_eht_cap_phy, sizeof(cmd->peer_eht_cap_phy), in ath12k_wmi_send_peer_assoc_cmd()
2039 arg->peer_eht_cap_phy, sizeof(arg->peer_eht_cap_phy), in ath12k_wmi_send_peer_assoc_cmd()
2041 memcpy_and_pad(&cmd->peer_eht_ppet, sizeof(cmd->peer_eht_ppet), in ath12k_wmi_send_peer_assoc_cmd()
2042 &arg->peer_eht_ppet, sizeof(arg->peer_eht_ppet), 0); in ath12k_wmi_send_peer_assoc_cmd()
2052 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, peer_legacy_rates_align); in ath12k_wmi_send_peer_assoc_cmd()
2056 cmd->num_peer_legacy_rates = cpu_to_le32(arg->peer_legacy_rates.num_rates); in ath12k_wmi_send_peer_assoc_cmd()
2057 memcpy(ptr, arg->peer_legacy_rates.rates, in ath12k_wmi_send_peer_assoc_cmd()
2058 arg->peer_legacy_rates.num_rates); in ath12k_wmi_send_peer_assoc_cmd()
2068 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, peer_ht_rates_align); in ath12k_wmi_send_peer_assoc_cmd()
2070 cmd->num_peer_ht_rates = cpu_to_le32(arg->peer_ht_rates.num_rates); in ath12k_wmi_send_peer_assoc_cmd()
2071 memcpy(ptr, arg->peer_ht_rates.rates, in ath12k_wmi_send_peer_assoc_cmd()
2072 arg->peer_ht_rates.num_rates); in ath12k_wmi_send_peer_assoc_cmd()
2083 mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VHT_RATE_SET, in ath12k_wmi_send_peer_assoc_cmd()
2086 cmd->peer_nss = cpu_to_le32(arg->peer_nss); in ath12k_wmi_send_peer_assoc_cmd()
2088 /* Update bandwidth-NSS mapping */ in ath12k_wmi_send_peer_assoc_cmd()
2089 cmd->peer_bw_rxnss_override = 0; in ath12k_wmi_send_peer_assoc_cmd()
2090 cmd->peer_bw_rxnss_override |= cpu_to_le32(arg->peer_bw_rxnss_override); in ath12k_wmi_send_peer_assoc_cmd()
2092 if (arg->vht_capable) { in ath12k_wmi_send_peer_assoc_cmd()
2093 mcs->rx_max_rate = cpu_to_le32(arg->rx_max_rate); in ath12k_wmi_send_peer_assoc_cmd()
2094 mcs->rx_mcs_set = cpu_to_le32(arg->rx_mcs_set); in ath12k_wmi_send_peer_assoc_cmd()
2095 mcs->tx_max_rate = cpu_to_le32(arg->tx_max_rate); in ath12k_wmi_send_peer_assoc_cmd()
2096 mcs->tx_mcs_set = cpu_to_le32(arg->tx_mcs_set); in ath12k_wmi_send_peer_assoc_cmd()
2100 cmd->peer_he_mcs = cpu_to_le32(arg->peer_he_mcs_count); in ath12k_wmi_send_peer_assoc_cmd()
2101 cmd->min_data_rate = cpu_to_le32(arg->min_data_rate); in ath12k_wmi_send_peer_assoc_cmd()
2105 len = arg->peer_he_mcs_count * sizeof(*he_mcs); in ath12k_wmi_send_peer_assoc_cmd()
2112 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_wmi_send_peer_assoc_cmd()
2116 for (i = 0; i < arg->peer_he_mcs_count; i++) { in ath12k_wmi_send_peer_assoc_cmd()
2122 he_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET, in ath12k_wmi_send_peer_assoc_cmd()
2125 he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]); in ath12k_wmi_send_peer_assoc_cmd()
2126 he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]); in ath12k_wmi_send_peer_assoc_cmd()
2137 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_wmi_send_peer_assoc_cmd()
2141 len = arg->peer_eht_mcs_count * sizeof(*eht_mcs); in ath12k_wmi_send_peer_assoc_cmd()
2147 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_wmi_send_peer_assoc_cmd()
2150 for (i = 0; i < arg->peer_eht_mcs_count; i++) { in ath12k_wmi_send_peer_assoc_cmd()
2156 eht_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET, in ath12k_wmi_send_peer_assoc_cmd()
2159 eht_mcs->rx_mcs_set = cpu_to_le32(arg->peer_eht_rx_mcs_set[i]); in ath12k_wmi_send_peer_assoc_cmd()
2160 eht_mcs->tx_mcs_set = cpu_to_le32(arg->peer_eht_tx_mcs_set[i]); in ath12k_wmi_send_peer_assoc_cmd()
2171 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_wmi_send_peer_assoc_cmd()
2174 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_peer_assoc_cmd()
2176 cmd->vdev_id, cmd->peer_associd, arg->peer_mac, in ath12k_wmi_send_peer_assoc_cmd()
2177 cmd->peer_flags, cmd->peer_rate_caps, cmd->peer_caps, in ath12k_wmi_send_peer_assoc_cmd()
2178 cmd->peer_listen_intval, cmd->peer_ht_caps, in ath12k_wmi_send_peer_assoc_cmd()
2179 cmd->peer_max_mpdu, cmd->peer_nss, cmd->peer_phymode, in ath12k_wmi_send_peer_assoc_cmd()
2180 cmd->peer_mpdu_density, in ath12k_wmi_send_peer_assoc_cmd()
2181 cmd->peer_vht_caps, cmd->peer_he_cap_info, in ath12k_wmi_send_peer_assoc_cmd()
2182 cmd->peer_he_ops, cmd->peer_he_cap_info_ext, in ath12k_wmi_send_peer_assoc_cmd()
2183 cmd->peer_he_cap_phy[0], cmd->peer_he_cap_phy[1], in ath12k_wmi_send_peer_assoc_cmd()
2184 cmd->peer_he_cap_phy[2], in ath12k_wmi_send_peer_assoc_cmd()
2185 cmd->peer_bw_rxnss_override, cmd->peer_flags_ext, in ath12k_wmi_send_peer_assoc_cmd()
2186 cmd->peer_eht_cap_mac[0], cmd->peer_eht_cap_mac[1], in ath12k_wmi_send_peer_assoc_cmd()
2187 cmd->peer_eht_cap_phy[0], cmd->peer_eht_cap_phy[1], in ath12k_wmi_send_peer_assoc_cmd()
2188 cmd->peer_eht_cap_phy[2]); in ath12k_wmi_send_peer_assoc_cmd()
2192 ath12k_warn(ar->ab, in ath12k_wmi_send_peer_assoc_cmd()
2204 arg->scan_req_id = 1; in ath12k_wmi_start_scan_init()
2205 arg->scan_priority = WMI_SCAN_PRIORITY_LOW; in ath12k_wmi_start_scan_init()
2206 arg->dwell_time_active = 50; in ath12k_wmi_start_scan_init()
2207 arg->dwell_time_active_2g = 0; in ath12k_wmi_start_scan_init()
2208 arg->dwell_time_passive = 150; in ath12k_wmi_start_scan_init()
2209 arg->dwell_time_active_6g = 40; in ath12k_wmi_start_scan_init()
2210 arg->dwell_time_passive_6g = 30; in ath12k_wmi_start_scan_init()
2211 arg->min_rest_time = 50; in ath12k_wmi_start_scan_init()
2212 arg->max_rest_time = 500; in ath12k_wmi_start_scan_init()
2213 arg->repeat_probe_time = 0; in ath12k_wmi_start_scan_init()
2214 arg->probe_spacing_time = 0; in ath12k_wmi_start_scan_init()
2215 arg->idle_time = 0; in ath12k_wmi_start_scan_init()
2216 arg->max_scan_time = 20000; in ath12k_wmi_start_scan_init()
2217 arg->probe_delay = 5; in ath12k_wmi_start_scan_init()
2218 arg->notify_scan_events = WMI_SCAN_EVENT_STARTED | in ath12k_wmi_start_scan_init()
2223 arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT; in ath12k_wmi_start_scan_init()
2224 arg->num_bssid = 1; in ath12k_wmi_start_scan_init()
2229 eth_broadcast_addr(arg->bssid_list[0].addr); in ath12k_wmi_start_scan_init()
2236 if (arg->scan_ev_started) in ath12k_wmi_copy_scan_event_cntrl_flags()
2237 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_STARTED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2238 if (arg->scan_ev_completed) in ath12k_wmi_copy_scan_event_cntrl_flags()
2239 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_COMPLETED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2240 if (arg->scan_ev_bss_chan) in ath12k_wmi_copy_scan_event_cntrl_flags()
2241 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_BSS_CHANNEL); in ath12k_wmi_copy_scan_event_cntrl_flags()
2242 if (arg->scan_ev_foreign_chan) in ath12k_wmi_copy_scan_event_cntrl_flags()
2243 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_FOREIGN_CHAN); in ath12k_wmi_copy_scan_event_cntrl_flags()
2244 if (arg->scan_ev_dequeued) in ath12k_wmi_copy_scan_event_cntrl_flags()
2245 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_DEQUEUED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2246 if (arg->scan_ev_preempted) in ath12k_wmi_copy_scan_event_cntrl_flags()
2247 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_PREEMPTED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2248 if (arg->scan_ev_start_failed) in ath12k_wmi_copy_scan_event_cntrl_flags()
2249 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_START_FAILED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2250 if (arg->scan_ev_restarted) in ath12k_wmi_copy_scan_event_cntrl_flags()
2251 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_RESTARTED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2252 if (arg->scan_ev_foreign_chn_exit) in ath12k_wmi_copy_scan_event_cntrl_flags()
2253 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_FOREIGN_CHAN_EXIT); in ath12k_wmi_copy_scan_event_cntrl_flags()
2254 if (arg->scan_ev_suspended) in ath12k_wmi_copy_scan_event_cntrl_flags()
2255 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_SUSPENDED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2256 if (arg->scan_ev_resumed) in ath12k_wmi_copy_scan_event_cntrl_flags()
2257 cmd->notify_scan_events |= cpu_to_le32(WMI_SCAN_EVENT_RESUMED); in ath12k_wmi_copy_scan_event_cntrl_flags()
2260 cmd->scan_ctrl_flags = 0; in ath12k_wmi_copy_scan_event_cntrl_flags()
2261 if (arg->scan_f_passive) in ath12k_wmi_copy_scan_event_cntrl_flags()
2262 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FLAG_PASSIVE); in ath12k_wmi_copy_scan_event_cntrl_flags()
2263 if (arg->scan_f_strict_passive_pch) in ath12k_wmi_copy_scan_event_cntrl_flags()
2264 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN); in ath12k_wmi_copy_scan_event_cntrl_flags()
2265 if (arg->scan_f_promisc_mode) in ath12k_wmi_copy_scan_event_cntrl_flags()
2266 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FILTER_PROMISCUOS); in ath12k_wmi_copy_scan_event_cntrl_flags()
2267 if (arg->scan_f_capture_phy_err) in ath12k_wmi_copy_scan_event_cntrl_flags()
2268 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_CAPTURE_PHY_ERROR); in ath12k_wmi_copy_scan_event_cntrl_flags()
2269 if (arg->scan_f_half_rate) in ath12k_wmi_copy_scan_event_cntrl_flags()
2270 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FLAG_HALF_RATE_SUPPORT); in ath12k_wmi_copy_scan_event_cntrl_flags()
2271 if (arg->scan_f_quarter_rate) in ath12k_wmi_copy_scan_event_cntrl_flags()
2272 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FLAG_QUARTER_RATE_SUPPORT); in ath12k_wmi_copy_scan_event_cntrl_flags()
2273 if (arg->scan_f_cck_rates) in ath12k_wmi_copy_scan_event_cntrl_flags()
2274 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_ADD_CCK_RATES); in ath12k_wmi_copy_scan_event_cntrl_flags()
2275 if (arg->scan_f_ofdm_rates) in ath12k_wmi_copy_scan_event_cntrl_flags()
2276 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_ADD_OFDM_RATES); in ath12k_wmi_copy_scan_event_cntrl_flags()
2277 if (arg->scan_f_chan_stat_evnt) in ath12k_wmi_copy_scan_event_cntrl_flags()
2278 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_CHAN_STAT_EVENT); in ath12k_wmi_copy_scan_event_cntrl_flags()
2279 if (arg->scan_f_filter_prb_req) in ath12k_wmi_copy_scan_event_cntrl_flags()
2280 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FILTER_PROBE_REQ); in ath12k_wmi_copy_scan_event_cntrl_flags()
2281 if (arg->scan_f_bcast_probe) in ath12k_wmi_copy_scan_event_cntrl_flags()
2282 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_ADD_BCAST_PROBE_REQ); in ath12k_wmi_copy_scan_event_cntrl_flags()
2283 if (arg->scan_f_offchan_mgmt_tx) in ath12k_wmi_copy_scan_event_cntrl_flags()
2284 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_OFFCHAN_MGMT_TX); in ath12k_wmi_copy_scan_event_cntrl_flags()
2285 if (arg->scan_f_offchan_data_tx) in ath12k_wmi_copy_scan_event_cntrl_flags()
2286 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_OFFCHAN_DATA_TX); in ath12k_wmi_copy_scan_event_cntrl_flags()
2287 if (arg->scan_f_force_active_dfs_chn) in ath12k_wmi_copy_scan_event_cntrl_flags()
2288 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_FLAG_FORCE_ACTIVE_ON_DFS); in ath12k_wmi_copy_scan_event_cntrl_flags()
2289 if (arg->scan_f_add_tpc_ie_in_probe) in ath12k_wmi_copy_scan_event_cntrl_flags()
2290 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_ADD_TPC_IE_IN_PROBE_REQ); in ath12k_wmi_copy_scan_event_cntrl_flags()
2291 if (arg->scan_f_add_ds_ie_in_probe) in ath12k_wmi_copy_scan_event_cntrl_flags()
2292 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_ADD_DS_IE_IN_PROBE_REQ); in ath12k_wmi_copy_scan_event_cntrl_flags()
2293 if (arg->scan_f_add_spoofed_mac_in_probe) in ath12k_wmi_copy_scan_event_cntrl_flags()
2294 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_ADD_SPOOF_MAC_IN_PROBE_REQ); in ath12k_wmi_copy_scan_event_cntrl_flags()
2295 if (arg->scan_f_add_rand_seq_in_probe) in ath12k_wmi_copy_scan_event_cntrl_flags()
2296 cmd->scan_ctrl_flags |= cpu_to_le32(WMI_SCAN_RANDOM_SEQ_NO_IN_PROBE_REQ); in ath12k_wmi_copy_scan_event_cntrl_flags()
2297 if (arg->scan_f_en_ie_whitelist_in_probe) in ath12k_wmi_copy_scan_event_cntrl_flags()
2298 cmd->scan_ctrl_flags |= in ath12k_wmi_copy_scan_event_cntrl_flags()
2301 cmd->scan_ctrl_flags |= le32_encode_bits(arg->adaptive_dwell_time_mode, in ath12k_wmi_copy_scan_event_cntrl_flags()
2308 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_scan_start_cmd()
2327 if (arg->num_chan) in ath12k_wmi_send_scan_start_cmd()
2328 len += arg->num_chan * sizeof(u32); in ath12k_wmi_send_scan_start_cmd()
2331 if (arg->num_ssids) in ath12k_wmi_send_scan_start_cmd()
2332 len += arg->num_ssids * sizeof(*ssid); in ath12k_wmi_send_scan_start_cmd()
2335 if (arg->num_bssid) in ath12k_wmi_send_scan_start_cmd()
2336 len += sizeof(*bssid) * arg->num_bssid; in ath12k_wmi_send_scan_start_cmd()
2339 if (arg->extraie.len) in ath12k_wmi_send_scan_start_cmd()
2341 roundup(arg->extraie.len, sizeof(u32)); in ath12k_wmi_send_scan_start_cmd()
2344 if (arg->num_hint_bssid) in ath12k_wmi_send_scan_start_cmd()
2346 arg->num_hint_bssid * sizeof(*hint_bssid); in ath12k_wmi_send_scan_start_cmd()
2348 if (arg->num_hint_s_ssid) in ath12k_wmi_send_scan_start_cmd()
2350 arg->num_hint_s_ssid * sizeof(*s_ssid); in ath12k_wmi_send_scan_start_cmd()
2352 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_scan_start_cmd()
2354 return -ENOMEM; in ath12k_wmi_send_scan_start_cmd()
2356 ptr = skb->data; in ath12k_wmi_send_scan_start_cmd()
2363 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_START_SCAN_CMD, in ath12k_wmi_send_scan_start_cmd()
2366 cmd->scan_id = cpu_to_le32(arg->scan_id); in ath12k_wmi_send_scan_start_cmd()
2367 cmd->scan_req_id = cpu_to_le32(arg->scan_req_id); in ath12k_wmi_send_scan_start_cmd()
2368 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_send_scan_start_cmd()
2369 cmd->scan_priority = cpu_to_le32(arg->scan_priority); in ath12k_wmi_send_scan_start_cmd()
2370 cmd->notify_scan_events = cpu_to_le32(arg->notify_scan_events); in ath12k_wmi_send_scan_start_cmd()
2374 cmd->dwell_time_active = cpu_to_le32(arg->dwell_time_active); in ath12k_wmi_send_scan_start_cmd()
2375 cmd->dwell_time_active_2g = cpu_to_le32(arg->dwell_time_active_2g); in ath12k_wmi_send_scan_start_cmd()
2376 cmd->dwell_time_passive = cpu_to_le32(arg->dwell_time_passive); in ath12k_wmi_send_scan_start_cmd()
2377 cmd->dwell_time_active_6g = cpu_to_le32(arg->dwell_time_active_6g); in ath12k_wmi_send_scan_start_cmd()
2378 cmd->dwell_time_passive_6g = cpu_to_le32(arg->dwell_time_passive_6g); in ath12k_wmi_send_scan_start_cmd()
2379 cmd->min_rest_time = cpu_to_le32(arg->min_rest_time); in ath12k_wmi_send_scan_start_cmd()
2380 cmd->max_rest_time = cpu_to_le32(arg->max_rest_time); in ath12k_wmi_send_scan_start_cmd()
2381 cmd->repeat_probe_time = cpu_to_le32(arg->repeat_probe_time); in ath12k_wmi_send_scan_start_cmd()
2382 cmd->probe_spacing_time = cpu_to_le32(arg->probe_spacing_time); in ath12k_wmi_send_scan_start_cmd()
2383 cmd->idle_time = cpu_to_le32(arg->idle_time); in ath12k_wmi_send_scan_start_cmd()
2384 cmd->max_scan_time = cpu_to_le32(arg->max_scan_time); in ath12k_wmi_send_scan_start_cmd()
2385 cmd->probe_delay = cpu_to_le32(arg->probe_delay); in ath12k_wmi_send_scan_start_cmd()
2386 cmd->burst_duration = cpu_to_le32(arg->burst_duration); in ath12k_wmi_send_scan_start_cmd()
2387 cmd->num_chan = cpu_to_le32(arg->num_chan); in ath12k_wmi_send_scan_start_cmd()
2388 cmd->num_bssid = cpu_to_le32(arg->num_bssid); in ath12k_wmi_send_scan_start_cmd()
2389 cmd->num_ssids = cpu_to_le32(arg->num_ssids); in ath12k_wmi_send_scan_start_cmd()
2390 cmd->ie_len = cpu_to_le32(arg->extraie.len); in ath12k_wmi_send_scan_start_cmd()
2391 cmd->n_probes = cpu_to_le32(arg->n_probes); in ath12k_wmi_send_scan_start_cmd()
2395 len = arg->num_chan * sizeof(u32); in ath12k_wmi_send_scan_start_cmd()
2402 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_UINT32, len); in ath12k_wmi_send_scan_start_cmd()
2406 memcpy(tmp_ptr, arg->chan_list, arg->num_chan * 4); in ath12k_wmi_send_scan_start_cmd()
2410 len = arg->num_ssids * sizeof(*ssid); in ath12k_wmi_send_scan_start_cmd()
2416 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_FIXED_STRUCT, len); in ath12k_wmi_send_scan_start_cmd()
2420 if (arg->num_ssids) { in ath12k_wmi_send_scan_start_cmd()
2426 for (i = 0; i < arg->num_ssids; ++i) { in ath12k_wmi_send_scan_start_cmd()
2427 ssid->ssid_len = cpu_to_le32(arg->ssid[i].ssid_len); in ath12k_wmi_send_scan_start_cmd()
2428 memcpy(ssid->ssid, arg->ssid[i].ssid, in ath12k_wmi_send_scan_start_cmd()
2429 arg->ssid[i].ssid_len); in ath12k_wmi_send_scan_start_cmd()
2434 ptr += (arg->num_ssids * sizeof(*ssid)); in ath12k_wmi_send_scan_start_cmd()
2435 len = arg->num_bssid * sizeof(*bssid); in ath12k_wmi_send_scan_start_cmd()
2441 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_FIXED_STRUCT, len); in ath12k_wmi_send_scan_start_cmd()
2450 if (arg->num_bssid) { in ath12k_wmi_send_scan_start_cmd()
2451 for (i = 0; i < arg->num_bssid; ++i) { in ath12k_wmi_send_scan_start_cmd()
2452 ether_addr_copy(bssid->addr, in ath12k_wmi_send_scan_start_cmd()
2453 arg->bssid_list[i].addr); in ath12k_wmi_send_scan_start_cmd()
2458 ptr += arg->num_bssid * sizeof(*bssid); in ath12k_wmi_send_scan_start_cmd()
2466 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, len); in ath12k_wmi_send_scan_start_cmd()
2469 if (arg->extraie.len) in ath12k_wmi_send_scan_start_cmd()
2470 memcpy(ptr, arg->extraie.ptr, in ath12k_wmi_send_scan_start_cmd()
2471 arg->extraie.len); in ath12k_wmi_send_scan_start_cmd()
2475 if (arg->num_hint_s_ssid) { in ath12k_wmi_send_scan_start_cmd()
2476 len = arg->num_hint_s_ssid * sizeof(*s_ssid); in ath12k_wmi_send_scan_start_cmd()
2482 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_FIXED_STRUCT, len); in ath12k_wmi_send_scan_start_cmd()
2489 for (i = 0; i < arg->num_hint_s_ssid; ++i) { in ath12k_wmi_send_scan_start_cmd()
2490 s_ssid->freq_flags = arg->hint_s_ssid[i].freq_flags; in ath12k_wmi_send_scan_start_cmd()
2491 s_ssid->short_ssid = arg->hint_s_ssid[i].short_ssid; in ath12k_wmi_send_scan_start_cmd()
2497 if (arg->num_hint_bssid) { in ath12k_wmi_send_scan_start_cmd()
2498 len = arg->num_hint_bssid * sizeof(struct ath12k_wmi_hint_bssid_arg); in ath12k_wmi_send_scan_start_cmd()
2504 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_FIXED_STRUCT, len); in ath12k_wmi_send_scan_start_cmd()
2511 for (i = 0; i < arg->num_hint_bssid; ++i) { in ath12k_wmi_send_scan_start_cmd()
2512 hint_bssid->freq_flags = in ath12k_wmi_send_scan_start_cmd()
2513 arg->hint_bssid[i].freq_flags; in ath12k_wmi_send_scan_start_cmd()
2514 ether_addr_copy(&arg->hint_bssid[i].bssid.addr[0], in ath12k_wmi_send_scan_start_cmd()
2515 &hint_bssid->bssid.addr[0]); in ath12k_wmi_send_scan_start_cmd()
2523 ath12k_warn(ar->ab, "failed to send WMI_START_SCAN_CMDID\n"); in ath12k_wmi_send_scan_start_cmd()
2533 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_scan_stop_cmd()
2538 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_scan_stop_cmd()
2540 return -ENOMEM; in ath12k_wmi_send_scan_stop_cmd()
2542 cmd = (struct wmi_stop_scan_cmd *)skb->data; in ath12k_wmi_send_scan_stop_cmd()
2544 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_STOP_SCAN_CMD, in ath12k_wmi_send_scan_stop_cmd()
2547 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_send_scan_stop_cmd()
2548 cmd->requestor = cpu_to_le32(arg->requester); in ath12k_wmi_send_scan_stop_cmd()
2549 cmd->scan_id = cpu_to_le32(arg->scan_id); in ath12k_wmi_send_scan_stop_cmd()
2550 cmd->pdev_id = cpu_to_le32(arg->pdev_id); in ath12k_wmi_send_scan_stop_cmd()
2552 if (arg->req_type == WLAN_SCAN_CANCEL_PDEV_ALL) { in ath12k_wmi_send_scan_stop_cmd()
2554 cmd->req_type = cpu_to_le32(WMI_SCAN_STOP_ALL); in ath12k_wmi_send_scan_stop_cmd()
2555 } else if (arg->req_type == WLAN_SCAN_CANCEL_VDEV_ALL) { in ath12k_wmi_send_scan_stop_cmd()
2557 cmd->req_type = cpu_to_le32(WMI_SCAN_STOP_VAP_ALL); in ath12k_wmi_send_scan_stop_cmd()
2558 } else if (arg->req_type == WLAN_SCAN_CANCEL_SINGLE) { in ath12k_wmi_send_scan_stop_cmd()
2560 cmd->req_type = WMI_SCAN_STOP_ONE; in ath12k_wmi_send_scan_stop_cmd()
2562 ath12k_warn(ar->ab, "invalid scan cancel req_type %d", in ath12k_wmi_send_scan_stop_cmd()
2563 arg->req_type); in ath12k_wmi_send_scan_stop_cmd()
2565 return -EINVAL; in ath12k_wmi_send_scan_stop_cmd()
2571 ath12k_warn(ar->ab, "failed to send WMI_STOP_SCAN_CMDID\n"); in ath12k_wmi_send_scan_stop_cmd()
2581 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_scan_chan_list_cmd()
2596 channel_arg = &arg->channel[0]; in ath12k_wmi_send_scan_chan_list_cmd()
2597 while (arg->nallchans) { in ath12k_wmi_send_scan_chan_list_cmd()
2599 max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) / in ath12k_wmi_send_scan_chan_list_cmd()
2602 num_send_chans = min(arg->nallchans, max_chan_limit); in ath12k_wmi_send_scan_chan_list_cmd()
2604 arg->nallchans -= num_send_chans; in ath12k_wmi_send_scan_chan_list_cmd()
2607 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_scan_chan_list_cmd()
2609 return -ENOMEM; in ath12k_wmi_send_scan_chan_list_cmd()
2611 cmd = (struct wmi_scan_chan_list_cmd *)skb->data; in ath12k_wmi_send_scan_chan_list_cmd()
2612 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_SCAN_CHAN_LIST_CMD, in ath12k_wmi_send_scan_chan_list_cmd()
2614 cmd->pdev_id = cpu_to_le32(arg->pdev_id); in ath12k_wmi_send_scan_chan_list_cmd()
2615 cmd->num_scan_chans = cpu_to_le32(num_send_chans); in ath12k_wmi_send_scan_chan_list_cmd()
2617 cmd->flags |= cpu_to_le32(WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG); in ath12k_wmi_send_scan_chan_list_cmd()
2619 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_scan_chan_list_cmd()
2621 num_send_chans, len, cmd->pdev_id, num_sends); in ath12k_wmi_send_scan_chan_list_cmd()
2623 ptr = skb->data + sizeof(*cmd); in ath12k_wmi_send_scan_chan_list_cmd()
2631 tlv->header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_ARRAY_STRUCT, in ath12k_wmi_send_scan_chan_list_cmd()
2643 chan_info->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_CHANNEL, in ath12k_wmi_send_scan_chan_list_cmd()
2646 reg1 = &chan_info->reg_info_1; in ath12k_wmi_send_scan_chan_list_cmd()
2647 reg2 = &chan_info->reg_info_2; in ath12k_wmi_send_scan_chan_list_cmd()
2648 chan_info->mhz = cpu_to_le32(channel_arg->mhz); in ath12k_wmi_send_scan_chan_list_cmd()
2649 chan_info->band_center_freq1 = cpu_to_le32(channel_arg->cfreq1); in ath12k_wmi_send_scan_chan_list_cmd()
2650 chan_info->band_center_freq2 = cpu_to_le32(channel_arg->cfreq2); in ath12k_wmi_send_scan_chan_list_cmd()
2652 if (channel_arg->is_chan_passive) in ath12k_wmi_send_scan_chan_list_cmd()
2653 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_PASSIVE); in ath12k_wmi_send_scan_chan_list_cmd()
2654 if (channel_arg->allow_he) in ath12k_wmi_send_scan_chan_list_cmd()
2655 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_ALLOW_HE); in ath12k_wmi_send_scan_chan_list_cmd()
2656 else if (channel_arg->allow_vht) in ath12k_wmi_send_scan_chan_list_cmd()
2657 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_ALLOW_VHT); in ath12k_wmi_send_scan_chan_list_cmd()
2658 else if (channel_arg->allow_ht) in ath12k_wmi_send_scan_chan_list_cmd()
2659 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_ALLOW_HT); in ath12k_wmi_send_scan_chan_list_cmd()
2660 if (channel_arg->half_rate) in ath12k_wmi_send_scan_chan_list_cmd()
2661 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_HALF_RATE); in ath12k_wmi_send_scan_chan_list_cmd()
2662 if (channel_arg->quarter_rate) in ath12k_wmi_send_scan_chan_list_cmd()
2663 chan_info->info |= in ath12k_wmi_send_scan_chan_list_cmd()
2666 if (channel_arg->psc_channel) in ath12k_wmi_send_scan_chan_list_cmd()
2667 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_PSC); in ath12k_wmi_send_scan_chan_list_cmd()
2669 if (channel_arg->dfs_set) in ath12k_wmi_send_scan_chan_list_cmd()
2670 chan_info->info |= cpu_to_le32(WMI_CHAN_INFO_DFS); in ath12k_wmi_send_scan_chan_list_cmd()
2672 chan_info->info |= le32_encode_bits(channel_arg->phy_mode, in ath12k_wmi_send_scan_chan_list_cmd()
2674 *reg1 |= le32_encode_bits(channel_arg->minpower, in ath12k_wmi_send_scan_chan_list_cmd()
2676 *reg1 |= le32_encode_bits(channel_arg->maxpower, in ath12k_wmi_send_scan_chan_list_cmd()
2678 *reg1 |= le32_encode_bits(channel_arg->maxregpower, in ath12k_wmi_send_scan_chan_list_cmd()
2680 *reg1 |= le32_encode_bits(channel_arg->reg_class_id, in ath12k_wmi_send_scan_chan_list_cmd()
2682 *reg2 |= le32_encode_bits(channel_arg->antennamax, in ath12k_wmi_send_scan_chan_list_cmd()
2685 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_scan_chan_list_cmd()
2686 "WMI chan scan list chan[%d] = %u, chan_info->info %8x\n", in ath12k_wmi_send_scan_chan_list_cmd()
2687 i, chan_info->mhz, chan_info->info); in ath12k_wmi_send_scan_chan_list_cmd()
2696 ath12k_warn(ar->ab, "failed to send WMI_SCAN_CHAN_LIST cmd\n"); in ath12k_wmi_send_scan_chan_list_cmd()
2710 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_wmm_update_cmd()
2717 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_wmm_update_cmd()
2719 return -ENOMEM; in ath12k_wmi_send_wmm_update_cmd()
2721 cmd = (struct wmi_vdev_set_wmm_params_cmd *)skb->data; in ath12k_wmi_send_wmm_update_cmd()
2722 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_SET_WMM_PARAMS_CMD, in ath12k_wmi_send_wmm_update_cmd()
2725 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_send_wmm_update_cmd()
2726 cmd->wmm_param_type = 0; in ath12k_wmi_send_wmm_update_cmd()
2731 wmi_wmm_arg = &param->ac_be; in ath12k_wmi_send_wmm_update_cmd()
2734 wmi_wmm_arg = &param->ac_bk; in ath12k_wmi_send_wmm_update_cmd()
2737 wmi_wmm_arg = &param->ac_vi; in ath12k_wmi_send_wmm_update_cmd()
2740 wmi_wmm_arg = &param->ac_vo; in ath12k_wmi_send_wmm_update_cmd()
2744 wmm_param = (struct wmi_wmm_params *)&cmd->wmm_params[ac]; in ath12k_wmi_send_wmm_update_cmd()
2745 wmm_param->tlv_header = in ath12k_wmi_send_wmm_update_cmd()
2749 wmm_param->aifs = cpu_to_le32(wmi_wmm_arg->aifs); in ath12k_wmi_send_wmm_update_cmd()
2750 wmm_param->cwmin = cpu_to_le32(wmi_wmm_arg->cwmin); in ath12k_wmi_send_wmm_update_cmd()
2751 wmm_param->cwmax = cpu_to_le32(wmi_wmm_arg->cwmax); in ath12k_wmi_send_wmm_update_cmd()
2752 wmm_param->txoplimit = cpu_to_le32(wmi_wmm_arg->txop); in ath12k_wmi_send_wmm_update_cmd()
2753 wmm_param->acm = cpu_to_le32(wmi_wmm_arg->acm); in ath12k_wmi_send_wmm_update_cmd()
2754 wmm_param->no_ack = cpu_to_le32(wmi_wmm_arg->no_ack); in ath12k_wmi_send_wmm_update_cmd()
2756 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_wmm_update_cmd()
2758 ac, wmm_param->aifs, wmm_param->cwmin, in ath12k_wmi_send_wmm_update_cmd()
2759 wmm_param->cwmax, wmm_param->txoplimit, in ath12k_wmi_send_wmm_update_cmd()
2760 wmm_param->acm, wmm_param->no_ack); in ath12k_wmi_send_wmm_update_cmd()
2765 ath12k_warn(ar->ab, in ath12k_wmi_send_wmm_update_cmd()
2776 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2781 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2783 return -ENOMEM; in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2785 cmd = (struct wmi_dfs_phyerr_offload_cmd *)skb->data; in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2786 cmd->tlv_header = in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2790 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2792 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2798 ath12k_warn(ar->ab, in ath12k_wmi_send_dfs_phyerr_offload_enable_cmd()
2809 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_delba_send()
2814 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_delba_send()
2816 return -ENOMEM; in ath12k_wmi_delba_send()
2818 cmd = (struct wmi_delba_send_cmd *)skb->data; in ath12k_wmi_delba_send()
2819 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_DELBA_SEND_CMD, in ath12k_wmi_delba_send()
2821 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_delba_send()
2822 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath12k_wmi_delba_send()
2823 cmd->tid = cpu_to_le32(tid); in ath12k_wmi_delba_send()
2824 cmd->initiator = cpu_to_le32(initiator); in ath12k_wmi_delba_send()
2825 cmd->reasoncode = cpu_to_le32(reason); in ath12k_wmi_delba_send()
2827 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_delba_send()
2834 ath12k_warn(ar->ab, in ath12k_wmi_delba_send()
2845 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_addba_set_resp()
2850 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_addba_set_resp()
2852 return -ENOMEM; in ath12k_wmi_addba_set_resp()
2854 cmd = (struct wmi_addba_setresponse_cmd *)skb->data; in ath12k_wmi_addba_set_resp()
2855 cmd->tlv_header = in ath12k_wmi_addba_set_resp()
2858 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_addba_set_resp()
2859 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath12k_wmi_addba_set_resp()
2860 cmd->tid = cpu_to_le32(tid); in ath12k_wmi_addba_set_resp()
2861 cmd->statuscode = cpu_to_le32(status); in ath12k_wmi_addba_set_resp()
2863 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_addba_set_resp()
2870 ath12k_warn(ar->ab, in ath12k_wmi_addba_set_resp()
2881 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_addba_send()
2886 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_addba_send()
2888 return -ENOMEM; in ath12k_wmi_addba_send()
2890 cmd = (struct wmi_addba_send_cmd *)skb->data; in ath12k_wmi_addba_send()
2891 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_ADDBA_SEND_CMD, in ath12k_wmi_addba_send()
2893 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_addba_send()
2894 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath12k_wmi_addba_send()
2895 cmd->tid = cpu_to_le32(tid); in ath12k_wmi_addba_send()
2896 cmd->buffersize = cpu_to_le32(buf_size); in ath12k_wmi_addba_send()
2898 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_addba_send()
2905 ath12k_warn(ar->ab, in ath12k_wmi_addba_send()
2915 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_addba_clear_resp()
2920 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_addba_clear_resp()
2922 return -ENOMEM; in ath12k_wmi_addba_clear_resp()
2924 cmd = (struct wmi_addba_clear_resp_cmd *)skb->data; in ath12k_wmi_addba_clear_resp()
2925 cmd->tlv_header = in ath12k_wmi_addba_clear_resp()
2928 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_addba_clear_resp()
2929 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath12k_wmi_addba_clear_resp()
2931 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_addba_clear_resp()
2938 ath12k_warn(ar->ab, in ath12k_wmi_addba_clear_resp()
2949 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_init_country_cmd()
2954 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_send_init_country_cmd()
2956 return -ENOMEM; in ath12k_wmi_send_init_country_cmd()
2958 cmd = (struct wmi_init_country_cmd *)skb->data; in ath12k_wmi_send_init_country_cmd()
2959 cmd->tlv_header = in ath12k_wmi_send_init_country_cmd()
2963 cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id); in ath12k_wmi_send_init_country_cmd()
2965 switch (arg->flags) { in ath12k_wmi_send_init_country_cmd()
2967 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_ALPHA; in ath12k_wmi_send_init_country_cmd()
2968 memcpy(&cmd->cc_info.alpha2, arg->cc_info.alpha2, 3); in ath12k_wmi_send_init_country_cmd()
2971 cmd->init_cc_type = cpu_to_le32(WMI_COUNTRY_INFO_TYPE_COUNTRY_CODE); in ath12k_wmi_send_init_country_cmd()
2972 cmd->cc_info.country_code = in ath12k_wmi_send_init_country_cmd()
2973 cpu_to_le32(arg->cc_info.country_code); in ath12k_wmi_send_init_country_cmd()
2976 cmd->init_cc_type = cpu_to_le32(WMI_COUNTRY_INFO_TYPE_REGDOMAIN); in ath12k_wmi_send_init_country_cmd()
2977 cmd->cc_info.regdom_id = cpu_to_le32(arg->cc_info.regdom_id); in ath12k_wmi_send_init_country_cmd()
2980 ret = -EINVAL; in ath12k_wmi_send_init_country_cmd()
2989 ath12k_warn(ar->ab, in ath12k_wmi_send_init_country_cmd()
3001 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_twt_enable_cmd()
3002 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_wmi_send_twt_enable_cmd()
3009 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_twt_enable_cmd()
3011 return -ENOMEM; in ath12k_wmi_send_twt_enable_cmd()
3013 cmd = (struct wmi_twt_enable_params_cmd *)skb->data; in ath12k_wmi_send_twt_enable_cmd()
3014 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_TWT_ENABLE_CMD, in ath12k_wmi_send_twt_enable_cmd()
3016 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_send_twt_enable_cmd()
3017 cmd->sta_cong_timer_ms = cpu_to_le32(ATH12K_TWT_DEF_STA_CONG_TIMER_MS); in ath12k_wmi_send_twt_enable_cmd()
3018 cmd->default_slot_size = cpu_to_le32(ATH12K_TWT_DEF_DEFAULT_SLOT_SIZE); in ath12k_wmi_send_twt_enable_cmd()
3019 cmd->congestion_thresh_setup = in ath12k_wmi_send_twt_enable_cmd()
3021 cmd->congestion_thresh_teardown = in ath12k_wmi_send_twt_enable_cmd()
3023 cmd->congestion_thresh_critical = in ath12k_wmi_send_twt_enable_cmd()
3025 cmd->interference_thresh_teardown = in ath12k_wmi_send_twt_enable_cmd()
3027 cmd->interference_thresh_setup = in ath12k_wmi_send_twt_enable_cmd()
3029 cmd->min_no_sta_setup = cpu_to_le32(ATH12K_TWT_DEF_MIN_NO_STA_SETUP); in ath12k_wmi_send_twt_enable_cmd()
3030 cmd->min_no_sta_teardown = cpu_to_le32(ATH12K_TWT_DEF_MIN_NO_STA_TEARDOWN); in ath12k_wmi_send_twt_enable_cmd()
3031 cmd->no_of_bcast_mcast_slots = in ath12k_wmi_send_twt_enable_cmd()
3033 cmd->min_no_twt_slots = cpu_to_le32(ATH12K_TWT_DEF_MIN_NO_TWT_SLOTS); in ath12k_wmi_send_twt_enable_cmd()
3034 cmd->max_no_sta_twt = cpu_to_le32(ATH12K_TWT_DEF_MAX_NO_STA_TWT); in ath12k_wmi_send_twt_enable_cmd()
3035 cmd->mode_check_interval = cpu_to_le32(ATH12K_TWT_DEF_MODE_CHECK_INTERVAL); in ath12k_wmi_send_twt_enable_cmd()
3036 cmd->add_sta_slot_interval = cpu_to_le32(ATH12K_TWT_DEF_ADD_STA_SLOT_INTERVAL); in ath12k_wmi_send_twt_enable_cmd()
3037 cmd->remove_sta_slot_interval = in ath12k_wmi_send_twt_enable_cmd()
3040 cmd->mbss_support = 0; in ath12k_wmi_send_twt_enable_cmd()
3054 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_twt_disable_cmd()
3055 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_wmi_send_twt_disable_cmd()
3062 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_twt_disable_cmd()
3064 return -ENOMEM; in ath12k_wmi_send_twt_disable_cmd()
3066 cmd = (struct wmi_twt_disable_params_cmd *)skb->data; in ath12k_wmi_send_twt_disable_cmd()
3067 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_TWT_DISABLE_CMD, in ath12k_wmi_send_twt_disable_cmd()
3069 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_send_twt_disable_cmd()
3084 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_obss_spr_cmd()
3085 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_wmi_send_obss_spr_cmd()
3092 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_obss_spr_cmd()
3094 return -ENOMEM; in ath12k_wmi_send_obss_spr_cmd()
3096 cmd = (struct wmi_obss_spatial_reuse_params_cmd *)skb->data; in ath12k_wmi_send_obss_spr_cmd()
3097 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_OBSS_SPATIAL_REUSE_SET_CMD, in ath12k_wmi_send_obss_spr_cmd()
3099 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_send_obss_spr_cmd()
3100 cmd->enable = cpu_to_le32(he_obss_pd->enable); in ath12k_wmi_send_obss_spr_cmd()
3101 cmd->obss_min = a_cpu_to_sle32(he_obss_pd->min_offset); in ath12k_wmi_send_obss_spr_cmd()
3102 cmd->obss_max = a_cpu_to_sle32(he_obss_pd->max_offset); in ath12k_wmi_send_obss_spr_cmd()
3118 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_obss_color_cfg_cmd()
3119 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_wmi_obss_color_cfg_cmd()
3126 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_obss_color_cfg_cmd()
3128 return -ENOMEM; in ath12k_wmi_obss_color_cfg_cmd()
3130 cmd = (struct wmi_obss_color_collision_cfg_params_cmd *)skb->data; in ath12k_wmi_obss_color_cfg_cmd()
3131 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_OBSS_COLOR_COLLISION_DET_CONFIG, in ath12k_wmi_obss_color_cfg_cmd()
3133 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_obss_color_cfg_cmd()
3134 cmd->evt_type = enable ? cpu_to_le32(ATH12K_OBSS_COLOR_COLLISION_DETECTION) : in ath12k_wmi_obss_color_cfg_cmd()
3136 cmd->current_bss_color = cpu_to_le32(bss_color); in ath12k_wmi_obss_color_cfg_cmd()
3137 cmd->detection_period_ms = cpu_to_le32(period); in ath12k_wmi_obss_color_cfg_cmd()
3138 cmd->scan_period_ms = cpu_to_le32(ATH12K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS); in ath12k_wmi_obss_color_cfg_cmd()
3139 cmd->free_slot_expiry_time_ms = 0; in ath12k_wmi_obss_color_cfg_cmd()
3140 cmd->flags = 0; in ath12k_wmi_obss_color_cfg_cmd()
3142 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_obss_color_cfg_cmd()
3144 cmd->vdev_id, cmd->evt_type, cmd->current_bss_color, in ath12k_wmi_obss_color_cfg_cmd()
3145 cmd->detection_period_ms, cmd->scan_period_ms); in ath12k_wmi_obss_color_cfg_cmd()
3159 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_bss_color_change_enable_cmd()
3160 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_wmi_send_bss_color_change_enable_cmd()
3167 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_wmi_send_bss_color_change_enable_cmd()
3169 return -ENOMEM; in ath12k_wmi_send_bss_color_change_enable_cmd()
3171 cmd = (struct wmi_bss_color_change_enable_params_cmd *)skb->data; in ath12k_wmi_send_bss_color_change_enable_cmd()
3172 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_BSS_COLOR_CHANGE_ENABLE, in ath12k_wmi_send_bss_color_change_enable_cmd()
3174 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_send_bss_color_change_enable_cmd()
3175 cmd->enable = enable ? cpu_to_le32(1) : 0; in ath12k_wmi_send_bss_color_change_enable_cmd()
3177 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_bss_color_change_enable_cmd()
3179 cmd->vdev_id, cmd->enable); in ath12k_wmi_send_bss_color_change_enable_cmd()
3200 aligned_len = roundup(tmpl->len, 4); in ath12k_wmi_fils_discovery_tmpl()
3203 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_fils_discovery_tmpl()
3206 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath12k_wmi_fils_discovery_tmpl()
3208 return -ENOMEM; in ath12k_wmi_fils_discovery_tmpl()
3210 cmd = (struct wmi_fils_discovery_tmpl_cmd *)skb->data; in ath12k_wmi_fils_discovery_tmpl()
3211 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_FILS_DISCOVERY_TMPL_CMD, in ath12k_wmi_fils_discovery_tmpl()
3213 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_fils_discovery_tmpl()
3214 cmd->buf_len = cpu_to_le32(tmpl->len); in ath12k_wmi_fils_discovery_tmpl()
3215 ptr = skb->data + sizeof(*cmd); in ath12k_wmi_fils_discovery_tmpl()
3218 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, aligned_len); in ath12k_wmi_fils_discovery_tmpl()
3219 memcpy(tlv->value, tmpl->data, tmpl->len); in ath12k_wmi_fils_discovery_tmpl()
3221 ret = ath12k_wmi_cmd_send(ar->wmi, skb, WMI_FILS_DISCOVERY_TMPL_CMDID); in ath12k_wmi_fils_discovery_tmpl()
3223 ath12k_warn(ar->ab, in ath12k_wmi_fils_discovery_tmpl()
3244 size_t aligned_len = roundup(tmpl->len, 4); in ath12k_wmi_probe_resp_tmpl()
3246 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_probe_resp_tmpl()
3251 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath12k_wmi_probe_resp_tmpl()
3253 return -ENOMEM; in ath12k_wmi_probe_resp_tmpl()
3255 cmd = (struct wmi_probe_tmpl_cmd *)skb->data; in ath12k_wmi_probe_resp_tmpl()
3256 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PRB_TMPL_CMD, in ath12k_wmi_probe_resp_tmpl()
3258 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_probe_resp_tmpl()
3259 cmd->buf_len = cpu_to_le32(tmpl->len); in ath12k_wmi_probe_resp_tmpl()
3261 ptr = skb->data + sizeof(*cmd); in ath12k_wmi_probe_resp_tmpl()
3269 probe_info->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_BCN_PRB_INFO, in ath12k_wmi_probe_resp_tmpl()
3271 probe_info->caps = 0; in ath12k_wmi_probe_resp_tmpl()
3272 probe_info->erp = 0; in ath12k_wmi_probe_resp_tmpl()
3281 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, aligned_len); in ath12k_wmi_probe_resp_tmpl()
3282 memcpy(tlv->value, tmpl->data, tmpl->len); in ath12k_wmi_probe_resp_tmpl()
3284 ret = ath12k_wmi_cmd_send(ar->wmi, skb, WMI_PRB_TMPL_CMDID); in ath12k_wmi_probe_resp_tmpl()
3286 ath12k_warn(ar->ab, in ath12k_wmi_probe_resp_tmpl()
3301 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_fils_discovery()
3308 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath12k_wmi_fils_discovery()
3310 return -ENOMEM; in ath12k_wmi_fils_discovery()
3312 cmd = (struct wmi_fils_discovery_cmd *)skb->data; in ath12k_wmi_fils_discovery()
3313 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_ENABLE_FILS_CMD, in ath12k_wmi_fils_discovery()
3315 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_fils_discovery()
3316 cmd->interval = cpu_to_le32(interval); in ath12k_wmi_fils_discovery()
3317 cmd->config = cpu_to_le32(unsol_bcast_probe_resp_enabled); in ath12k_wmi_fils_discovery()
3319 ret = ath12k_wmi_cmd_send(ar->wmi, skb, WMI_ENABLE_FILS_CMDID); in ath12k_wmi_fils_discovery()
3321 ath12k_warn(ar->ab, in ath12k_wmi_fils_discovery()
3337 for (i = 0; i < soc->num_radios; i++) { in ath12k_fill_band_to_mac_param()
3338 pdev = &soc->pdevs[i]; in ath12k_fill_band_to_mac_param()
3339 hal_reg_cap = &soc->hal_reg_cap[i]; in ath12k_fill_band_to_mac_param()
3340 arg[i].pdev_id = pdev->pdev_id; in ath12k_fill_band_to_mac_param()
3342 switch (pdev->cap.supported_bands) { in ath12k_fill_band_to_mac_param()
3344 arg[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath12k_fill_band_to_mac_param()
3345 arg[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath12k_fill_band_to_mac_param()
3348 arg[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath12k_fill_band_to_mac_param()
3349 arg[i].end_freq = hal_reg_cap->high_2ghz_chan; in ath12k_fill_band_to_mac_param()
3352 arg[i].start_freq = hal_reg_cap->low_5ghz_chan; in ath12k_fill_band_to_mac_param()
3353 arg[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath12k_fill_band_to_mac_param()
3365 wmi_cfg->num_vdevs = cpu_to_le32(tg_cfg->num_vdevs); in ath12k_wmi_copy_resource_config()
3366 wmi_cfg->num_peers = cpu_to_le32(tg_cfg->num_peers); in ath12k_wmi_copy_resource_config()
3367 wmi_cfg->num_offload_peers = cpu_to_le32(tg_cfg->num_offload_peers); in ath12k_wmi_copy_resource_config()
3368 wmi_cfg->num_offload_reorder_buffs = in ath12k_wmi_copy_resource_config()
3369 cpu_to_le32(tg_cfg->num_offload_reorder_buffs); in ath12k_wmi_copy_resource_config()
3370 wmi_cfg->num_peer_keys = cpu_to_le32(tg_cfg->num_peer_keys); in ath12k_wmi_copy_resource_config()
3371 wmi_cfg->num_tids = cpu_to_le32(tg_cfg->num_tids); in ath12k_wmi_copy_resource_config()
3372 wmi_cfg->ast_skid_limit = cpu_to_le32(tg_cfg->ast_skid_limit); in ath12k_wmi_copy_resource_config()
3373 wmi_cfg->tx_chain_mask = cpu_to_le32(tg_cfg->tx_chain_mask); in ath12k_wmi_copy_resource_config()
3374 wmi_cfg->rx_chain_mask = cpu_to_le32(tg_cfg->rx_chain_mask); in ath12k_wmi_copy_resource_config()
3375 wmi_cfg->rx_timeout_pri[0] = cpu_to_le32(tg_cfg->rx_timeout_pri[0]); in ath12k_wmi_copy_resource_config()
3376 wmi_cfg->rx_timeout_pri[1] = cpu_to_le32(tg_cfg->rx_timeout_pri[1]); in ath12k_wmi_copy_resource_config()
3377 wmi_cfg->rx_timeout_pri[2] = cpu_to_le32(tg_cfg->rx_timeout_pri[2]); in ath12k_wmi_copy_resource_config()
3378 wmi_cfg->rx_timeout_pri[3] = cpu_to_le32(tg_cfg->rx_timeout_pri[3]); in ath12k_wmi_copy_resource_config()
3379 wmi_cfg->rx_decap_mode = cpu_to_le32(tg_cfg->rx_decap_mode); in ath12k_wmi_copy_resource_config()
3380 wmi_cfg->scan_max_pending_req = cpu_to_le32(tg_cfg->scan_max_pending_req); in ath12k_wmi_copy_resource_config()
3381 wmi_cfg->bmiss_offload_max_vdev = cpu_to_le32(tg_cfg->bmiss_offload_max_vdev); in ath12k_wmi_copy_resource_config()
3382 wmi_cfg->roam_offload_max_vdev = cpu_to_le32(tg_cfg->roam_offload_max_vdev); in ath12k_wmi_copy_resource_config()
3383 wmi_cfg->roam_offload_max_ap_profiles = in ath12k_wmi_copy_resource_config()
3384 cpu_to_le32(tg_cfg->roam_offload_max_ap_profiles); in ath12k_wmi_copy_resource_config()
3385 wmi_cfg->num_mcast_groups = cpu_to_le32(tg_cfg->num_mcast_groups); in ath12k_wmi_copy_resource_config()
3386 wmi_cfg->num_mcast_table_elems = cpu_to_le32(tg_cfg->num_mcast_table_elems); in ath12k_wmi_copy_resource_config()
3387 wmi_cfg->mcast2ucast_mode = cpu_to_le32(tg_cfg->mcast2ucast_mode); in ath12k_wmi_copy_resource_config()
3388 wmi_cfg->tx_dbg_log_size = cpu_to_le32(tg_cfg->tx_dbg_log_size); in ath12k_wmi_copy_resource_config()
3389 wmi_cfg->num_wds_entries = cpu_to_le32(tg_cfg->num_wds_entries); in ath12k_wmi_copy_resource_config()
3390 wmi_cfg->dma_burst_size = cpu_to_le32(tg_cfg->dma_burst_size); in ath12k_wmi_copy_resource_config()
3391 wmi_cfg->mac_aggr_delim = cpu_to_le32(tg_cfg->mac_aggr_delim); in ath12k_wmi_copy_resource_config()
3392 wmi_cfg->rx_skip_defrag_timeout_dup_detection_check = in ath12k_wmi_copy_resource_config()
3393 cpu_to_le32(tg_cfg->rx_skip_defrag_timeout_dup_detection_check); in ath12k_wmi_copy_resource_config()
3394 wmi_cfg->vow_config = cpu_to_le32(tg_cfg->vow_config); in ath12k_wmi_copy_resource_config()
3395 wmi_cfg->gtk_offload_max_vdev = cpu_to_le32(tg_cfg->gtk_offload_max_vdev); in ath12k_wmi_copy_resource_config()
3396 wmi_cfg->num_msdu_desc = cpu_to_le32(tg_cfg->num_msdu_desc); in ath12k_wmi_copy_resource_config()
3397 wmi_cfg->max_frag_entries = cpu_to_le32(tg_cfg->max_frag_entries); in ath12k_wmi_copy_resource_config()
3398 wmi_cfg->num_tdls_vdevs = cpu_to_le32(tg_cfg->num_tdls_vdevs); in ath12k_wmi_copy_resource_config()
3399 wmi_cfg->num_tdls_conn_table_entries = in ath12k_wmi_copy_resource_config()
3400 cpu_to_le32(tg_cfg->num_tdls_conn_table_entries); in ath12k_wmi_copy_resource_config()
3401 wmi_cfg->beacon_tx_offload_max_vdev = in ath12k_wmi_copy_resource_config()
3402 cpu_to_le32(tg_cfg->beacon_tx_offload_max_vdev); in ath12k_wmi_copy_resource_config()
3403 wmi_cfg->num_multicast_filter_entries = in ath12k_wmi_copy_resource_config()
3404 cpu_to_le32(tg_cfg->num_multicast_filter_entries); in ath12k_wmi_copy_resource_config()
3405 wmi_cfg->num_wow_filters = cpu_to_le32(tg_cfg->num_wow_filters); in ath12k_wmi_copy_resource_config()
3406 wmi_cfg->num_keep_alive_pattern = cpu_to_le32(tg_cfg->num_keep_alive_pattern); in ath12k_wmi_copy_resource_config()
3407 wmi_cfg->keep_alive_pattern_size = cpu_to_le32(tg_cfg->keep_alive_pattern_size); in ath12k_wmi_copy_resource_config()
3408 wmi_cfg->max_tdls_concurrent_sleep_sta = in ath12k_wmi_copy_resource_config()
3409 cpu_to_le32(tg_cfg->max_tdls_concurrent_sleep_sta); in ath12k_wmi_copy_resource_config()
3410 wmi_cfg->max_tdls_concurrent_buffer_sta = in ath12k_wmi_copy_resource_config()
3411 cpu_to_le32(tg_cfg->max_tdls_concurrent_buffer_sta); in ath12k_wmi_copy_resource_config()
3412 wmi_cfg->wmi_send_separate = cpu_to_le32(tg_cfg->wmi_send_separate); in ath12k_wmi_copy_resource_config()
3413 wmi_cfg->num_ocb_vdevs = cpu_to_le32(tg_cfg->num_ocb_vdevs); in ath12k_wmi_copy_resource_config()
3414 wmi_cfg->num_ocb_channels = cpu_to_le32(tg_cfg->num_ocb_channels); in ath12k_wmi_copy_resource_config()
3415 wmi_cfg->num_ocb_schedules = cpu_to_le32(tg_cfg->num_ocb_schedules); in ath12k_wmi_copy_resource_config()
3416 wmi_cfg->bpf_instruction_size = cpu_to_le32(tg_cfg->bpf_instruction_size); in ath12k_wmi_copy_resource_config()
3417 wmi_cfg->max_bssid_rx_filters = cpu_to_le32(tg_cfg->max_bssid_rx_filters); in ath12k_wmi_copy_resource_config()
3418 wmi_cfg->use_pdev_id = cpu_to_le32(tg_cfg->use_pdev_id); in ath12k_wmi_copy_resource_config()
3419 wmi_cfg->flag1 = cpu_to_le32(tg_cfg->atf_config); in ath12k_wmi_copy_resource_config()
3420 wmi_cfg->peer_map_unmap_version = cpu_to_le32(tg_cfg->peer_map_unmap_version); in ath12k_wmi_copy_resource_config()
3421 wmi_cfg->sched_params = cpu_to_le32(tg_cfg->sched_params); in ath12k_wmi_copy_resource_config()
3422 wmi_cfg->twt_ap_pdev_count = cpu_to_le32(tg_cfg->twt_ap_pdev_count); in ath12k_wmi_copy_resource_config()
3423 wmi_cfg->twt_ap_sta_count = cpu_to_le32(tg_cfg->twt_ap_sta_count); in ath12k_wmi_copy_resource_config()
3424 wmi_cfg->host_service_flags = cpu_to_le32(tg_cfg->is_reg_cc_ext_event_supported << in ath12k_wmi_copy_resource_config()
3431 struct ath12k_base *ab = wmi->wmi_ab->ab; in ath12k_init_cmd_send()
3448 if (arg->hw_mode_id != WMI_HOST_HW_MODE_MAX) in ath12k_init_cmd_send()
3450 (arg->num_band_to_mac * sizeof(*band_to_mac)); in ath12k_init_cmd_send()
3453 (arg->num_mem_chunks ? (sizeof(*host_mem_chunks) * WMI_MAX_MEM_REQS) : 0); in ath12k_init_cmd_send()
3455 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); in ath12k_init_cmd_send()
3457 return -ENOMEM; in ath12k_init_cmd_send()
3459 cmd = (struct wmi_init_cmd *)skb->data; in ath12k_init_cmd_send()
3461 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_INIT_CMD, in ath12k_init_cmd_send()
3464 ptr = skb->data + sizeof(*cmd); in ath12k_init_cmd_send()
3471 ath12k_wmi_copy_resource_config(cfg, &arg->res_cfg); in ath12k_init_cmd_send()
3473 cfg->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_RESOURCE_CONFIG, in ath12k_init_cmd_send()
3484 for (idx = 0; idx < arg->num_mem_chunks; ++idx) { in ath12k_init_cmd_send()
3489 host_mem_chunks[idx].ptr = cpu_to_le32(arg->mem_chunks[idx].paddr); in ath12k_init_cmd_send()
3490 host_mem_chunks[idx].size = cpu_to_le32(arg->mem_chunks[idx].len); in ath12k_init_cmd_send()
3491 host_mem_chunks[idx].req_id = cpu_to_le32(arg->mem_chunks[idx].req_id); in ath12k_init_cmd_send()
3499 arg->mem_chunks[idx].req_id, in ath12k_init_cmd_send()
3501 (u64)arg->mem_chunks[idx].paddr, in ath12k_init_cmd_send()
3503 (uintmax_t)arg->mem_chunks[idx].paddr, in ath12k_init_cmd_send()
3505 arg->mem_chunks[idx].len); in ath12k_init_cmd_send()
3507 cmd->num_host_mem_chunks = cpu_to_le32(arg->num_mem_chunks); in ath12k_init_cmd_send()
3508 len = sizeof(struct ath12k_wmi_host_mem_chunk_params) * arg->num_mem_chunks; in ath12k_init_cmd_send()
3516 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_init_cmd_send()
3519 if (arg->hw_mode_id != WMI_HOST_HW_MODE_MAX) { in ath12k_init_cmd_send()
3521 hw_mode->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_SET_HW_MODE_CMD, in ath12k_init_cmd_send()
3524 hw_mode->hw_mode_index = cpu_to_le32(arg->hw_mode_id); in ath12k_init_cmd_send()
3525 hw_mode->num_band_to_mac = cpu_to_le32(arg->num_band_to_mac); in ath12k_init_cmd_send()
3529 len = arg->num_band_to_mac * sizeof(*band_to_mac); in ath12k_init_cmd_send()
3535 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_STRUCT, len); in ath12k_init_cmd_send()
3540 for (idx = 0; idx < arg->num_band_to_mac; idx++) { in ath12k_init_cmd_send()
3543 band_to_mac->tlv_header = in ath12k_init_cmd_send()
3546 band_to_mac->pdev_id = cpu_to_le32(arg->band_to_mac[idx].pdev_id); in ath12k_init_cmd_send()
3547 band_to_mac->start_freq = in ath12k_init_cmd_send()
3548 cpu_to_le32(arg->band_to_mac[idx].start_freq); in ath12k_init_cmd_send()
3549 band_to_mac->end_freq = in ath12k_init_cmd_send()
3550 cpu_to_le32(arg->band_to_mac[idx].end_freq); in ath12k_init_cmd_send()
3571 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_lro_cfg()
3573 return -ENOMEM; in ath12k_wmi_pdev_lro_cfg()
3575 cmd = (struct ath12k_wmi_pdev_lro_config_cmd *)skb->data; in ath12k_wmi_pdev_lro_cfg()
3576 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_LRO_INFO_CMD, in ath12k_wmi_pdev_lro_cfg()
3579 get_random_bytes(cmd->th_4, sizeof(cmd->th_4)); in ath12k_wmi_pdev_lro_cfg()
3580 get_random_bytes(cmd->th_6, sizeof(cmd->th_6)); in ath12k_wmi_pdev_lro_cfg()
3582 cmd->pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_pdev_lro_cfg()
3584 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_lro_cfg()
3587 ret = ath12k_wmi_cmd_send(ar->wmi, skb, WMI_LRO_CONFIG_CMDID); in ath12k_wmi_pdev_lro_cfg()
3589 ath12k_warn(ar->ab, in ath12k_wmi_pdev_lro_cfg()
3604 time_left = wait_for_completion_timeout(&ab->wmi_ab.service_ready, in ath12k_wmi_wait_for_service_ready()
3607 return -ETIMEDOUT; in ath12k_wmi_wait_for_service_ready()
3616 time_left = wait_for_completion_timeout(&ab->wmi_ab.unified_ready, in ath12k_wmi_wait_for_unified_ready()
3619 return -ETIMEDOUT; in ath12k_wmi_wait_for_unified_ready()
3629 struct ath12k_wmi_base *wmi_ab = &ab->wmi_ab; in ath12k_wmi_set_hw_mode()
3637 return -ENOMEM; in ath12k_wmi_set_hw_mode()
3639 cmd = (struct ath12k_wmi_pdev_set_hw_mode_cmd *)skb->data; in ath12k_wmi_set_hw_mode()
3641 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_PDEV_SET_HW_MODE_CMD, in ath12k_wmi_set_hw_mode()
3644 cmd->pdev_id = WMI_PDEV_ID_SOC; in ath12k_wmi_set_hw_mode()
3645 cmd->hw_mode_index = cpu_to_le32(mode); in ath12k_wmi_set_hw_mode()
3647 ret = ath12k_wmi_cmd_send(&wmi_ab->wmi[0], skb, WMI_PDEV_SET_HW_MODE_CMDID); in ath12k_wmi_set_hw_mode()
3658 struct ath12k_wmi_base *wmi_sc = &ab->wmi_ab; in ath12k_wmi_cmd_init()
3662 ab->wmi_ab.svc_map)) in ath12k_wmi_cmd_init()
3665 ab->hw_params->wmi_init(ab, &arg.res_cfg); in ath12k_wmi_cmd_init()
3667 arg.num_mem_chunks = wmi_sc->num_mem_chunks; in ath12k_wmi_cmd_init()
3668 arg.hw_mode_id = wmi_sc->preferred_hw_mode; in ath12k_wmi_cmd_init()
3669 arg.mem_chunks = wmi_sc->mem_chunks; in ath12k_wmi_cmd_init()
3671 if (ab->hw_params->single_pdev_only) in ath12k_wmi_cmd_init()
3674 arg.num_band_to_mac = ab->num_radios; in ath12k_wmi_cmd_init()
3677 return ath12k_init_cmd_send(&wmi_sc->wmi[0], &arg); in ath12k_wmi_cmd_init()
3687 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_spectral_conf()
3689 return -ENOMEM; in ath12k_wmi_vdev_spectral_conf()
3691 cmd = (struct ath12k_wmi_vdev_spectral_conf_cmd *)skb->data; in ath12k_wmi_vdev_spectral_conf()
3692 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_SPECTRAL_CONFIGURE_CMD, in ath12k_wmi_vdev_spectral_conf()
3694 cmd->vdev_id = cpu_to_le32(arg->vdev_id); in ath12k_wmi_vdev_spectral_conf()
3695 cmd->scan_count = cpu_to_le32(arg->scan_count); in ath12k_wmi_vdev_spectral_conf()
3696 cmd->scan_period = cpu_to_le32(arg->scan_period); in ath12k_wmi_vdev_spectral_conf()
3697 cmd->scan_priority = cpu_to_le32(arg->scan_priority); in ath12k_wmi_vdev_spectral_conf()
3698 cmd->scan_fft_size = cpu_to_le32(arg->scan_fft_size); in ath12k_wmi_vdev_spectral_conf()
3699 cmd->scan_gc_ena = cpu_to_le32(arg->scan_gc_ena); in ath12k_wmi_vdev_spectral_conf()
3700 cmd->scan_restart_ena = cpu_to_le32(arg->scan_restart_ena); in ath12k_wmi_vdev_spectral_conf()
3701 cmd->scan_noise_floor_ref = cpu_to_le32(arg->scan_noise_floor_ref); in ath12k_wmi_vdev_spectral_conf()
3702 cmd->scan_init_delay = cpu_to_le32(arg->scan_init_delay); in ath12k_wmi_vdev_spectral_conf()
3703 cmd->scan_nb_tone_thr = cpu_to_le32(arg->scan_nb_tone_thr); in ath12k_wmi_vdev_spectral_conf()
3704 cmd->scan_str_bin_thr = cpu_to_le32(arg->scan_str_bin_thr); in ath12k_wmi_vdev_spectral_conf()
3705 cmd->scan_wb_rpt_mode = cpu_to_le32(arg->scan_wb_rpt_mode); in ath12k_wmi_vdev_spectral_conf()
3706 cmd->scan_rssi_rpt_mode = cpu_to_le32(arg->scan_rssi_rpt_mode); in ath12k_wmi_vdev_spectral_conf()
3707 cmd->scan_rssi_thr = cpu_to_le32(arg->scan_rssi_thr); in ath12k_wmi_vdev_spectral_conf()
3708 cmd->scan_pwr_format = cpu_to_le32(arg->scan_pwr_format); in ath12k_wmi_vdev_spectral_conf()
3709 cmd->scan_rpt_mode = cpu_to_le32(arg->scan_rpt_mode); in ath12k_wmi_vdev_spectral_conf()
3710 cmd->scan_bin_scale = cpu_to_le32(arg->scan_bin_scale); in ath12k_wmi_vdev_spectral_conf()
3711 cmd->scan_dbm_adj = cpu_to_le32(arg->scan_dbm_adj); in ath12k_wmi_vdev_spectral_conf()
3712 cmd->scan_chn_mask = cpu_to_le32(arg->scan_chn_mask); in ath12k_wmi_vdev_spectral_conf()
3714 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_vdev_spectral_conf()
3716 arg->vdev_id); in ath12k_wmi_vdev_spectral_conf()
3718 ret = ath12k_wmi_cmd_send(ar->wmi, skb, in ath12k_wmi_vdev_spectral_conf()
3721 ath12k_warn(ar->ab, in ath12k_wmi_vdev_spectral_conf()
3739 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_vdev_spectral_enable()
3741 return -ENOMEM; in ath12k_wmi_vdev_spectral_enable()
3743 cmd = (struct ath12k_wmi_vdev_spectral_enable_cmd *)skb->data; in ath12k_wmi_vdev_spectral_enable()
3744 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_VDEV_SPECTRAL_ENABLE_CMD, in ath12k_wmi_vdev_spectral_enable()
3747 cmd->vdev_id = cpu_to_le32(vdev_id); in ath12k_wmi_vdev_spectral_enable()
3748 cmd->trigger_cmd = cpu_to_le32(trigger); in ath12k_wmi_vdev_spectral_enable()
3749 cmd->enable_cmd = cpu_to_le32(enable); in ath12k_wmi_vdev_spectral_enable()
3751 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_vdev_spectral_enable()
3755 ret = ath12k_wmi_cmd_send(ar->wmi, skb, in ath12k_wmi_vdev_spectral_enable()
3758 ath12k_warn(ar->ab, in ath12k_wmi_vdev_spectral_enable()
3776 skb = ath12k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath12k_wmi_pdev_dma_ring_cfg()
3778 return -ENOMEM; in ath12k_wmi_pdev_dma_ring_cfg()
3780 cmd = (struct ath12k_wmi_pdev_dma_ring_cfg_req_cmd *)skb->data; in ath12k_wmi_pdev_dma_ring_cfg()
3781 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_DMA_RING_CFG_REQ, in ath12k_wmi_pdev_dma_ring_cfg()
3784 cmd->pdev_id = cpu_to_le32(DP_SW2HW_MACID(arg->pdev_id)); in ath12k_wmi_pdev_dma_ring_cfg()
3785 cmd->module_id = cpu_to_le32(arg->module_id); in ath12k_wmi_pdev_dma_ring_cfg()
3786 cmd->base_paddr_lo = cpu_to_le32(arg->base_paddr_lo); in ath12k_wmi_pdev_dma_ring_cfg()
3787 cmd->base_paddr_hi = cpu_to_le32(arg->base_paddr_hi); in ath12k_wmi_pdev_dma_ring_cfg()
3788 cmd->head_idx_paddr_lo = cpu_to_le32(arg->head_idx_paddr_lo); in ath12k_wmi_pdev_dma_ring_cfg()
3789 cmd->head_idx_paddr_hi = cpu_to_le32(arg->head_idx_paddr_hi); in ath12k_wmi_pdev_dma_ring_cfg()
3790 cmd->tail_idx_paddr_lo = cpu_to_le32(arg->tail_idx_paddr_lo); in ath12k_wmi_pdev_dma_ring_cfg()
3791 cmd->tail_idx_paddr_hi = cpu_to_le32(arg->tail_idx_paddr_hi); in ath12k_wmi_pdev_dma_ring_cfg()
3792 cmd->num_elems = cpu_to_le32(arg->num_elems); in ath12k_wmi_pdev_dma_ring_cfg()
3793 cmd->buf_size = cpu_to_le32(arg->buf_size); in ath12k_wmi_pdev_dma_ring_cfg()
3794 cmd->num_resp_per_event = cpu_to_le32(arg->num_resp_per_event); in ath12k_wmi_pdev_dma_ring_cfg()
3795 cmd->event_timeout_ms = cpu_to_le32(arg->event_timeout_ms); in ath12k_wmi_pdev_dma_ring_cfg()
3797 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_pdev_dma_ring_cfg()
3799 arg->pdev_id); in ath12k_wmi_pdev_dma_ring_cfg()
3801 ret = ath12k_wmi_cmd_send(ar->wmi, skb, in ath12k_wmi_pdev_dma_ring_cfg()
3804 ath12k_warn(ar->ab, in ath12k_wmi_pdev_dma_ring_cfg()
3822 return -EPROTO; in ath12k_wmi_dma_buf_entry_parse()
3824 if (arg->num_buf_entry >= le32_to_cpu(arg->fixed.num_buf_release_entry)) in ath12k_wmi_dma_buf_entry_parse()
3825 return -ENOBUFS; in ath12k_wmi_dma_buf_entry_parse()
3827 arg->num_buf_entry++; in ath12k_wmi_dma_buf_entry_parse()
3838 return -EPROTO; in ath12k_wmi_dma_buf_meta_parse()
3840 if (arg->num_meta >= le32_to_cpu(arg->fixed.num_meta_data_entry)) in ath12k_wmi_dma_buf_meta_parse()
3841 return -ENOBUFS; in ath12k_wmi_dma_buf_meta_parse()
3843 arg->num_meta++; in ath12k_wmi_dma_buf_meta_parse()
3860 arg->fixed = *fixed; in ath12k_wmi_dma_buf_parse()
3861 pdev_id = DP_HW2SW_MACID(le32_to_cpu(fixed->pdev_id)); in ath12k_wmi_dma_buf_parse()
3862 arg->fixed.pdev_id = cpu_to_le32(pdev_id); in ath12k_wmi_dma_buf_parse()
3865 if (!arg->buf_entry_done) { in ath12k_wmi_dma_buf_parse()
3866 arg->num_buf_entry = 0; in ath12k_wmi_dma_buf_parse()
3867 arg->buf_entry = ptr; in ath12k_wmi_dma_buf_parse()
3878 arg->buf_entry_done = true; in ath12k_wmi_dma_buf_parse()
3879 } else if (!arg->meta_data_done) { in ath12k_wmi_dma_buf_parse()
3880 arg->num_meta = 0; in ath12k_wmi_dma_buf_parse()
3881 arg->meta_data = ptr; in ath12k_wmi_dma_buf_parse()
3892 arg->meta_data_done = true; in ath12k_wmi_dma_buf_parse()
3908 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_wmi_pdev_dma_ring_buf_release_event()
3938 return -EPROTO; in ath12k_wmi_hw_mode_caps_parse()
3940 if (svc_rdy_ext->n_hw_mode_caps >= svc_rdy_ext->arg.num_hw_modes) in ath12k_wmi_hw_mode_caps_parse()
3941 return -ENOBUFS; in ath12k_wmi_hw_mode_caps_parse()
3945 svc_rdy_ext->n_hw_mode_caps++; in ath12k_wmi_hw_mode_caps_parse()
3947 phy_map = le32_to_cpu(hw_mode_cap->phy_id_map); in ath12k_wmi_hw_mode_caps_parse()
3948 svc_rdy_ext->tot_phy_id += fls(phy_map); in ath12k_wmi_hw_mode_caps_parse()
3962 svc_rdy_ext->n_hw_mode_caps = 0; in ath12k_wmi_hw_mode_caps()
3963 svc_rdy_ext->hw_mode_caps = ptr; in ath12k_wmi_hw_mode_caps()
3973 for (i = 0 ; i < svc_rdy_ext->n_hw_mode_caps; i++) { in ath12k_wmi_hw_mode_caps()
3974 hw_mode_caps = &svc_rdy_ext->hw_mode_caps[i]; in ath12k_wmi_hw_mode_caps()
3975 mode = le32_to_cpu(hw_mode_caps->hw_mode_id); in ath12k_wmi_hw_mode_caps()
3980 pref = soc->wmi_ab.preferred_hw_mode; in ath12k_wmi_hw_mode_caps()
3983 svc_rdy_ext->pref_hw_mode_caps = *hw_mode_caps; in ath12k_wmi_hw_mode_caps()
3984 soc->wmi_ab.preferred_hw_mode = mode; in ath12k_wmi_hw_mode_caps()
3989 soc->wmi_ab.preferred_hw_mode); in ath12k_wmi_hw_mode_caps()
3990 if (soc->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_MAX) in ath12k_wmi_hw_mode_caps()
3991 return -EINVAL; in ath12k_wmi_hw_mode_caps()
4003 return -EPROTO; in ath12k_wmi_mac_phy_caps_parse()
4005 if (svc_rdy_ext->n_mac_phy_caps >= svc_rdy_ext->tot_phy_id) in ath12k_wmi_mac_phy_caps_parse()
4006 return -ENOBUFS; in ath12k_wmi_mac_phy_caps_parse()
4009 if (!svc_rdy_ext->n_mac_phy_caps) { in ath12k_wmi_mac_phy_caps_parse()
4010 svc_rdy_ext->mac_phy_caps = kzalloc((svc_rdy_ext->tot_phy_id) * len, in ath12k_wmi_mac_phy_caps_parse()
4012 if (!svc_rdy_ext->mac_phy_caps) in ath12k_wmi_mac_phy_caps_parse()
4013 return -ENOMEM; in ath12k_wmi_mac_phy_caps_parse()
4016 memcpy(svc_rdy_ext->mac_phy_caps + svc_rdy_ext->n_mac_phy_caps, ptr, len); in ath12k_wmi_mac_phy_caps_parse()
4017 svc_rdy_ext->n_mac_phy_caps++; in ath12k_wmi_mac_phy_caps_parse()
4028 return -EPROTO; in ath12k_wmi_ext_hal_reg_caps_parse()
4030 if (svc_rdy_ext->n_ext_hal_reg_caps >= svc_rdy_ext->arg.num_phy) in ath12k_wmi_ext_hal_reg_caps_parse()
4031 return -ENOBUFS; in ath12k_wmi_ext_hal_reg_caps_parse()
4033 svc_rdy_ext->n_ext_hal_reg_caps++; in ath12k_wmi_ext_hal_reg_caps_parse()
4040 struct ath12k_wmi_pdev *wmi_handle = &soc->wmi_ab.wmi[0]; in ath12k_wmi_ext_hal_reg_caps()
4046 svc_rdy_ext->n_ext_hal_reg_caps = 0; in ath12k_wmi_ext_hal_reg_caps()
4047 svc_rdy_ext->ext_hal_reg_caps = ptr; in ath12k_wmi_ext_hal_reg_caps()
4056 for (i = 0; i < svc_rdy_ext->arg.num_phy; i++) { in ath12k_wmi_ext_hal_reg_caps()
4058 svc_rdy_ext->soc_hal_reg_caps, in ath12k_wmi_ext_hal_reg_caps()
4059 svc_rdy_ext->ext_hal_reg_caps, i, in ath12k_wmi_ext_hal_reg_caps()
4065 soc->hal_reg_cap[reg_cap.phy_id] = reg_cap; in ath12k_wmi_ext_hal_reg_caps()
4074 struct ath12k_wmi_pdev *wmi_handle = &soc->wmi_ab.wmi[0]; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4076 u8 hw_mode_id = le32_to_cpu(svc_rdy_ext->pref_hw_mode_caps.hw_mode_id); in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4081 svc_rdy_ext->soc_hal_reg_caps = ptr; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4082 svc_rdy_ext->arg.num_phy = le32_to_cpu(svc_rdy_ext->soc_hal_reg_caps->num_phy); in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4084 soc->num_radios = 0; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4085 phy_id_map = le32_to_cpu(svc_rdy_ext->pref_hw_mode_caps.phy_id_map); in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4086 soc->fw_pdev_count = 0; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4088 while (phy_id_map && soc->num_radios < MAX_RADIOS) { in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4091 hw_mode_id, soc->num_radios, in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4092 &soc->pdevs[pdev_index]); in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4095 soc->num_radios); in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4099 soc->num_radios++; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4104 if (soc->hw_params->single_pdev_only) in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4107 pdev_index = soc->num_radios; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4113 if (soc->hw_params->single_pdev_only) { in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4114 soc->num_radios = 1; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4115 soc->pdevs[0].pdev_id = 0; in ath12k_wmi_ext_soc_hal_reg_caps_parse()
4128 return -EPROTO; in ath12k_wmi_dma_ring_caps_parse()
4130 parse->n_dma_ring_caps++; in ath12k_wmi_dma_ring_caps_parse()
4143 return -ENOMEM; in ath12k_wmi_alloc_dbring_caps()
4145 ab->db_caps = ptr; in ath12k_wmi_alloc_dbring_caps()
4146 ab->num_db_cap = num_cap; in ath12k_wmi_alloc_dbring_caps()
4153 kfree(ab->db_caps); in ath12k_wmi_free_dbring_caps()
4154 ab->db_caps = NULL; in ath12k_wmi_free_dbring_caps()
4170 dma_caps_parse->n_dma_ring_caps = 0; in ath12k_wmi_dma_ring_caps()
4184 if (!dma_caps_parse->n_dma_ring_caps) in ath12k_wmi_dma_ring_caps()
4187 if (ab->num_db_cap) { in ath12k_wmi_dma_ring_caps()
4192 ret = ath12k_wmi_alloc_dbring_caps(ab, dma_caps_parse->n_dma_ring_caps); in ath12k_wmi_dma_ring_caps()
4196 dir_buff_caps = ab->db_caps; in ath12k_wmi_dma_ring_caps()
4197 for (i = 0; i < dma_caps_parse->n_dma_ring_caps; i++) { in ath12k_wmi_dma_ring_caps()
4201 ret = -EINVAL; in ath12k_wmi_dma_ring_caps()
4224 struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0]; in ath12k_wmi_svc_rdy_ext_parse()
4231 &svc_rdy_ext->arg); in ath12k_wmi_svc_rdy_ext_parse()
4239 svc_rdy_ext->hw_caps = ptr; in ath12k_wmi_svc_rdy_ext_parse()
4240 svc_rdy_ext->arg.num_hw_modes = in ath12k_wmi_svc_rdy_ext_parse()
4241 le32_to_cpu(svc_rdy_ext->hw_caps->num_hw_modes); in ath12k_wmi_svc_rdy_ext_parse()
4252 if (!svc_rdy_ext->hw_mode_done) { in ath12k_wmi_svc_rdy_ext_parse()
4257 svc_rdy_ext->hw_mode_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4258 } else if (!svc_rdy_ext->mac_phy_done) { in ath12k_wmi_svc_rdy_ext_parse()
4259 svc_rdy_ext->n_mac_phy_caps = 0; in ath12k_wmi_svc_rdy_ext_parse()
4268 svc_rdy_ext->mac_phy_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4269 } else if (!svc_rdy_ext->ext_hal_reg_done) { in ath12k_wmi_svc_rdy_ext_parse()
4274 svc_rdy_ext->ext_hal_reg_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4275 } else if (!svc_rdy_ext->mac_phy_chainmask_combo_done) { in ath12k_wmi_svc_rdy_ext_parse()
4276 svc_rdy_ext->mac_phy_chainmask_combo_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4277 } else if (!svc_rdy_ext->mac_phy_chainmask_cap_done) { in ath12k_wmi_svc_rdy_ext_parse()
4278 svc_rdy_ext->mac_phy_chainmask_cap_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4279 } else if (!svc_rdy_ext->oem_dma_ring_cap_done) { in ath12k_wmi_svc_rdy_ext_parse()
4280 svc_rdy_ext->oem_dma_ring_cap_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4281 } else if (!svc_rdy_ext->dma_ring_cap_done) { in ath12k_wmi_svc_rdy_ext_parse()
4283 &svc_rdy_ext->dma_caps_parse); in ath12k_wmi_svc_rdy_ext_parse()
4287 svc_rdy_ext->dma_ring_cap_done = true; in ath12k_wmi_svc_rdy_ext_parse()
4303 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_service_ready_ext_event()
4311 if (!test_bit(WMI_TLV_SERVICE_EXT2_MSG, ab->wmi_ab.svc_map)) in ath12k_service_ready_ext_event()
4312 complete(&ab->wmi_ab.service_ready); in ath12k_service_ready_ext_event()
4329 return -EINVAL; in ath12k_pull_svc_ready_ext2()
4331 arg->reg_db_version = le32_to_cpu(ev->reg_db_version); in ath12k_pull_svc_ready_ext2()
4332 arg->hw_min_max_tx_power_2ghz = le32_to_cpu(ev->hw_min_max_tx_power_2ghz); in ath12k_pull_svc_ready_ext2()
4333 arg->hw_min_max_tx_power_5ghz = le32_to_cpu(ev->hw_min_max_tx_power_5ghz); in ath12k_pull_svc_ready_ext2()
4334 arg->chwidth_num_peer_caps = le32_to_cpu(ev->chwidth_num_peer_caps); in ath12k_pull_svc_ready_ext2()
4335 arg->preamble_puncture_bw = le32_to_cpu(ev->preamble_puncture_bw); in ath12k_pull_svc_ready_ext2()
4336 arg->max_user_per_ppdu_ofdma = le32_to_cpu(ev->max_user_per_ppdu_ofdma); in ath12k_pull_svc_ready_ext2()
4337 arg->max_user_per_ppdu_mumimo = le32_to_cpu(ev->max_user_per_ppdu_mumimo); in ath12k_pull_svc_ready_ext2()
4338 arg->target_cap_flags = le32_to_cpu(ev->target_cap_flags); in ath12k_pull_svc_ready_ext2()
4349 struct ath12k_band_cap *cap_band = &pdev->cap.band[band]; in ath12k_wmi_eht_caps_parse()
4353 cap_band->eht_cap_mac_info[i] = le32_to_cpu(cap_mac_info[i]); in ath12k_wmi_eht_caps_parse()
4356 cap_band->eht_cap_phy_info[i] = le32_to_cpu(cap_phy_info[i]); in ath12k_wmi_eht_caps_parse()
4358 cap_band->eht_mcs_20_only = le32_to_cpu(supp_mcs[0]); in ath12k_wmi_eht_caps_parse()
4359 cap_band->eht_mcs_80 = le32_to_cpu(supp_mcs[1]); in ath12k_wmi_eht_caps_parse()
4361 cap_band->eht_mcs_160 = le32_to_cpu(supp_mcs[2]); in ath12k_wmi_eht_caps_parse()
4362 cap_band->eht_mcs_320 = le32_to_cpu(supp_mcs[3]); in ath12k_wmi_eht_caps_parse()
4365 cap_band->eht_ppet.numss_m1 = le32_to_cpu(ppet->numss_m1); in ath12k_wmi_eht_caps_parse()
4366 cap_band->eht_ppet.ru_bit_mask = le32_to_cpu(ppet->ru_info); in ath12k_wmi_eht_caps_parse()
4368 cap_band->eht_ppet.ppet16_ppet8_ru3_ru0[i] = in ath12k_wmi_eht_caps_parse()
4369 le32_to_cpu(ppet->ppet16_ppet8_ru3_ru0[i]); in ath12k_wmi_eht_caps_parse()
4371 cap_band->eht_cap_info_internal = le32_to_cpu(cap_info_internal); in ath12k_wmi_eht_caps_parse()
4382 if (ab->hw_params->single_pdev_only) { in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4383 for (i = 0; i < ab->fw_pdev_count; i++) { in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4384 struct ath12k_fw_pdev *fw_pdev = &ab->fw_pdev[i]; in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4386 if (fw_pdev->pdev_id == le32_to_cpu(caps->pdev_id) && in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4387 fw_pdev->phy_id == le32_to_cpu(caps->phy_id)) { in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4388 bands = fw_pdev->supported_bands; in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4393 if (i == ab->fw_pdev_count) in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4394 return -EINVAL; in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4396 bands = pdev->cap.supported_bands; in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4401 caps->eht_cap_mac_info_2ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4402 caps->eht_cap_phy_info_2ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4403 caps->eht_supp_mcs_ext_2ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4404 &caps->eht_ppet_2ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4405 caps->eht_cap_info_internal); in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4410 caps->eht_cap_mac_info_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4411 caps->eht_cap_phy_info_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4412 caps->eht_supp_mcs_ext_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4413 &caps->eht_ppet_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4414 caps->eht_cap_info_internal); in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4417 caps->eht_cap_mac_info_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4418 caps->eht_cap_phy_info_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4419 caps->eht_supp_mcs_ext_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4420 &caps->eht_ppet_5ghz, in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4421 caps->eht_cap_info_internal); in ath12k_wmi_tlv_mac_phy_caps_ext_parse()
4435 return -EPROTO; in ath12k_wmi_tlv_mac_phy_caps_ext()
4437 if (ab->hw_params->single_pdev_only) { in ath12k_wmi_tlv_mac_phy_caps_ext()
4438 if (ab->wmi_ab.preferred_hw_mode != le32_to_cpu(caps->hw_mode_id)) in ath12k_wmi_tlv_mac_phy_caps_ext()
4441 for (i = 0; i < ab->num_radios; i++) { in ath12k_wmi_tlv_mac_phy_caps_ext()
4442 if (ab->pdevs[i].pdev_id == le32_to_cpu(caps->pdev_id)) in ath12k_wmi_tlv_mac_phy_caps_ext()
4446 if (i == ab->num_radios) in ath12k_wmi_tlv_mac_phy_caps_ext()
4447 return -EINVAL; in ath12k_wmi_tlv_mac_phy_caps_ext()
4450 ret = ath12k_wmi_tlv_mac_phy_caps_ext_parse(ab, caps, &ab->pdevs[i]); in ath12k_wmi_tlv_mac_phy_caps_ext()
4454 ret, ab->pdevs[i].pdev_id); in ath12k_wmi_tlv_mac_phy_caps_ext()
4465 struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0]; in ath12k_wmi_svc_rdy_ext2_parse()
4472 &parse->arg); in ath12k_wmi_svc_rdy_ext2_parse()
4482 if (!parse->dma_ring_cap_done) { in ath12k_wmi_svc_rdy_ext2_parse()
4484 &parse->dma_caps_parse); in ath12k_wmi_svc_rdy_ext2_parse()
4488 parse->dma_ring_cap_done = true; in ath12k_wmi_svc_rdy_ext2_parse()
4489 } else if (!parse->spectral_bin_scaling_done) { in ath12k_wmi_svc_rdy_ext2_parse()
4490 /* TODO: This is a place-holder as WMI tag for in ath12k_wmi_svc_rdy_ext2_parse()
4494 parse->spectral_bin_scaling_done = true; in ath12k_wmi_svc_rdy_ext2_parse()
4495 } else if (!parse->mac_phy_caps_ext_done) { in ath12k_wmi_svc_rdy_ext2_parse()
4505 parse->mac_phy_caps_ext_done = true; in ath12k_wmi_svc_rdy_ext2_parse()
4521 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_service_ready_ext2_event()
4529 complete(&ab->wmi_ab.service_ready); in ath12k_service_ready_ext2_event()
4545 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_vdev_start_resp_tlv()
4556 return -EPROTO; in ath12k_pull_vdev_start_resp_tlv()
4631 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_reg_chan_list_ext_update_ev()
4642 return -EPROTO; in ath12k_pull_reg_chan_list_ext_update_ev()
4645 reg_info->num_2g_reg_rules = le32_to_cpu(ev->num_2g_reg_rules); in ath12k_pull_reg_chan_list_ext_update_ev()
4646 reg_info->num_5g_reg_rules = le32_to_cpu(ev->num_5g_reg_rules); in ath12k_pull_reg_chan_list_ext_update_ev()
4647 reg_info->num_6g_reg_rules_ap[WMI_REG_INDOOR_AP] = in ath12k_pull_reg_chan_list_ext_update_ev()
4648 le32_to_cpu(ev->num_6g_reg_rules_ap_lpi); in ath12k_pull_reg_chan_list_ext_update_ev()
4649 reg_info->num_6g_reg_rules_ap[WMI_REG_STD_POWER_AP] = in ath12k_pull_reg_chan_list_ext_update_ev()
4650 le32_to_cpu(ev->num_6g_reg_rules_ap_sp); in ath12k_pull_reg_chan_list_ext_update_ev()
4651 reg_info->num_6g_reg_rules_ap[WMI_REG_VLP_AP] = in ath12k_pull_reg_chan_list_ext_update_ev()
4652 le32_to_cpu(ev->num_6g_reg_rules_ap_vlp); in ath12k_pull_reg_chan_list_ext_update_ev()
4655 reg_info->num_6g_reg_rules_cl[WMI_REG_INDOOR_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4656 le32_to_cpu(ev->num_6g_reg_rules_cl_lpi[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4657 reg_info->num_6g_reg_rules_cl[WMI_REG_STD_POWER_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4658 le32_to_cpu(ev->num_6g_reg_rules_cl_sp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4659 reg_info->num_6g_reg_rules_cl[WMI_REG_VLP_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4660 le32_to_cpu(ev->num_6g_reg_rules_cl_vlp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4663 num_2g_reg_rules = reg_info->num_2g_reg_rules; in ath12k_pull_reg_chan_list_ext_update_ev()
4665 num_5g_reg_rules = reg_info->num_5g_reg_rules; in ath12k_pull_reg_chan_list_ext_update_ev()
4672 return -EINVAL; in ath12k_pull_reg_chan_list_ext_update_ev()
4676 num_6g_reg_rules_ap[i] = reg_info->num_6g_reg_rules_ap[i]; in ath12k_pull_reg_chan_list_ext_update_ev()
4682 return -EINVAL; in ath12k_pull_reg_chan_list_ext_update_ev()
4690 reg_info->num_6g_reg_rules_cl[WMI_REG_INDOOR_AP][i]; in ath12k_pull_reg_chan_list_ext_update_ev()
4694 reg_info->num_6g_reg_rules_cl[WMI_REG_STD_POWER_AP][i]; in ath12k_pull_reg_chan_list_ext_update_ev()
4698 reg_info->num_6g_reg_rules_cl[WMI_REG_VLP_AP][i]; in ath12k_pull_reg_chan_list_ext_update_ev()
4707 return -EINVAL; in ath12k_pull_reg_chan_list_ext_update_ev()
4714 return -EINVAL; in ath12k_pull_reg_chan_list_ext_update_ev()
4717 memcpy(reg_info->alpha2, &ev->alpha2, REG_ALPHA2_LEN); in ath12k_pull_reg_chan_list_ext_update_ev()
4728 if (memcmp(reg_info->alpha2, "US", 2) == 0) { in ath12k_pull_reg_chan_list_ext_update_ev()
4729 reg_info->num_5g_reg_rules = REG_US_5G_NUM_REG_RULES; in ath12k_pull_reg_chan_list_ext_update_ev()
4730 num_5g_reg_rules = reg_info->num_5g_reg_rules; in ath12k_pull_reg_chan_list_ext_update_ev()
4733 reg_info->dfs_region = le32_to_cpu(ev->dfs_region); in ath12k_pull_reg_chan_list_ext_update_ev()
4734 reg_info->phybitmap = le32_to_cpu(ev->phybitmap); in ath12k_pull_reg_chan_list_ext_update_ev()
4735 reg_info->num_phy = le32_to_cpu(ev->num_phy); in ath12k_pull_reg_chan_list_ext_update_ev()
4736 reg_info->phy_id = le32_to_cpu(ev->phy_id); in ath12k_pull_reg_chan_list_ext_update_ev()
4737 reg_info->ctry_code = le32_to_cpu(ev->country_id); in ath12k_pull_reg_chan_list_ext_update_ev()
4738 reg_info->reg_dmn_pair = le32_to_cpu(ev->domain_code); in ath12k_pull_reg_chan_list_ext_update_ev()
4740 switch (le32_to_cpu(ev->status_code)) { in ath12k_pull_reg_chan_list_ext_update_ev()
4742 reg_info->status_code = REG_SET_CC_STATUS_PASS; in ath12k_pull_reg_chan_list_ext_update_ev()
4745 reg_info->status_code = REG_CURRENT_ALPHA2_NOT_FOUND; in ath12k_pull_reg_chan_list_ext_update_ev()
4748 reg_info->status_code = REG_INIT_ALPHA2_NOT_FOUND; in ath12k_pull_reg_chan_list_ext_update_ev()
4751 reg_info->status_code = REG_SET_CC_CHANGE_NOT_ALLOWED; in ath12k_pull_reg_chan_list_ext_update_ev()
4754 reg_info->status_code = REG_SET_CC_STATUS_NO_MEMORY; in ath12k_pull_reg_chan_list_ext_update_ev()
4757 reg_info->status_code = REG_SET_CC_STATUS_FAIL; in ath12k_pull_reg_chan_list_ext_update_ev()
4761 reg_info->is_ext_reg_event = true; in ath12k_pull_reg_chan_list_ext_update_ev()
4763 reg_info->min_bw_2g = le32_to_cpu(ev->min_bw_2g); in ath12k_pull_reg_chan_list_ext_update_ev()
4764 reg_info->max_bw_2g = le32_to_cpu(ev->max_bw_2g); in ath12k_pull_reg_chan_list_ext_update_ev()
4765 reg_info->min_bw_5g = le32_to_cpu(ev->min_bw_5g); in ath12k_pull_reg_chan_list_ext_update_ev()
4766 reg_info->max_bw_5g = le32_to_cpu(ev->max_bw_5g); in ath12k_pull_reg_chan_list_ext_update_ev()
4767 reg_info->min_bw_6g_ap[WMI_REG_INDOOR_AP] = le32_to_cpu(ev->min_bw_6g_ap_lpi); in ath12k_pull_reg_chan_list_ext_update_ev()
4768 reg_info->max_bw_6g_ap[WMI_REG_INDOOR_AP] = le32_to_cpu(ev->max_bw_6g_ap_lpi); in ath12k_pull_reg_chan_list_ext_update_ev()
4769 reg_info->min_bw_6g_ap[WMI_REG_STD_POWER_AP] = le32_to_cpu(ev->min_bw_6g_ap_sp); in ath12k_pull_reg_chan_list_ext_update_ev()
4770 reg_info->max_bw_6g_ap[WMI_REG_STD_POWER_AP] = le32_to_cpu(ev->max_bw_6g_ap_sp); in ath12k_pull_reg_chan_list_ext_update_ev()
4771 reg_info->min_bw_6g_ap[WMI_REG_VLP_AP] = le32_to_cpu(ev->min_bw_6g_ap_vlp); in ath12k_pull_reg_chan_list_ext_update_ev()
4772 reg_info->max_bw_6g_ap[WMI_REG_VLP_AP] = le32_to_cpu(ev->max_bw_6g_ap_vlp); in ath12k_pull_reg_chan_list_ext_update_ev()
4775 reg_info->min_bw_6g_client[WMI_REG_INDOOR_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4776 le32_to_cpu(ev->min_bw_6g_client_lpi[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4777 reg_info->max_bw_6g_client[WMI_REG_INDOOR_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4778 le32_to_cpu(ev->max_bw_6g_client_lpi[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4779 reg_info->min_bw_6g_client[WMI_REG_STD_POWER_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4780 le32_to_cpu(ev->min_bw_6g_client_sp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4781 reg_info->max_bw_6g_client[WMI_REG_STD_POWER_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4782 le32_to_cpu(ev->max_bw_6g_client_sp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4783 reg_info->min_bw_6g_client[WMI_REG_VLP_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4784 le32_to_cpu(ev->min_bw_6g_client_vlp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4785 reg_info->max_bw_6g_client[WMI_REG_VLP_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4786 le32_to_cpu(ev->max_bw_6g_client_vlp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4791 __func__, reg_info->alpha2, reg_info->dfs_region, in ath12k_pull_reg_chan_list_ext_update_ev()
4792 reg_info->min_bw_2g, reg_info->max_bw_2g, in ath12k_pull_reg_chan_list_ext_update_ev()
4793 reg_info->min_bw_5g, reg_info->max_bw_5g); in ath12k_pull_reg_chan_list_ext_update_ev()
4827 reg_info->reg_rules_2g_ptr = in ath12k_pull_reg_chan_list_ext_update_ev()
4831 if (!reg_info->reg_rules_2g_ptr) { in ath12k_pull_reg_chan_list_ext_update_ev()
4834 return -ENOMEM; in ath12k_pull_reg_chan_list_ext_update_ev()
4840 reg_info->reg_rules_5g_ptr = in ath12k_pull_reg_chan_list_ext_update_ev()
4844 if (!reg_info->reg_rules_5g_ptr) { in ath12k_pull_reg_chan_list_ext_update_ev()
4847 return -ENOMEM; in ath12k_pull_reg_chan_list_ext_update_ev()
4854 reg_info->reg_rules_6g_ap_ptr[i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4858 if (!reg_info->reg_rules_6g_ap_ptr[i]) { in ath12k_pull_reg_chan_list_ext_update_ev()
4861 return -ENOMEM; in ath12k_pull_reg_chan_list_ext_update_ev()
4869 reg_info->reg_rules_6g_client_ptr[j][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4873 if (!reg_info->reg_rules_6g_client_ptr[j][i]) { in ath12k_pull_reg_chan_list_ext_update_ev()
4876 return -ENOMEM; in ath12k_pull_reg_chan_list_ext_update_ev()
4883 reg_info->client_type = le32_to_cpu(ev->client_type); in ath12k_pull_reg_chan_list_ext_update_ev()
4884 reg_info->rnr_tpe_usable = ev->rnr_tpe_usable; in ath12k_pull_reg_chan_list_ext_update_ev()
4885 reg_info->unspecified_ap_usable = ev->unspecified_ap_usable; in ath12k_pull_reg_chan_list_ext_update_ev()
4886 reg_info->domain_code_6g_ap[WMI_REG_INDOOR_AP] = in ath12k_pull_reg_chan_list_ext_update_ev()
4887 le32_to_cpu(ev->domain_code_6g_ap_lpi); in ath12k_pull_reg_chan_list_ext_update_ev()
4888 reg_info->domain_code_6g_ap[WMI_REG_STD_POWER_AP] = in ath12k_pull_reg_chan_list_ext_update_ev()
4889 le32_to_cpu(ev->domain_code_6g_ap_sp); in ath12k_pull_reg_chan_list_ext_update_ev()
4890 reg_info->domain_code_6g_ap[WMI_REG_VLP_AP] = in ath12k_pull_reg_chan_list_ext_update_ev()
4891 le32_to_cpu(ev->domain_code_6g_ap_vlp); in ath12k_pull_reg_chan_list_ext_update_ev()
4894 reg_info->domain_code_6g_client[WMI_REG_INDOOR_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4895 le32_to_cpu(ev->domain_code_6g_client_lpi[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4896 reg_info->domain_code_6g_client[WMI_REG_STD_POWER_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4897 le32_to_cpu(ev->domain_code_6g_client_sp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4898 reg_info->domain_code_6g_client[WMI_REG_VLP_AP][i] = in ath12k_pull_reg_chan_list_ext_update_ev()
4899 le32_to_cpu(ev->domain_code_6g_client_vlp[i]); in ath12k_pull_reg_chan_list_ext_update_ev()
4902 reg_info->domain_code_6g_super_id = le32_to_cpu(ev->domain_code_6g_super_id); in ath12k_pull_reg_chan_list_ext_update_ev()
4905 reg_info->client_type, reg_info->domain_code_6g_super_id); in ath12k_pull_reg_chan_list_ext_update_ev()
4920 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_peer_del_resp_ev()
4931 return -EPROTO; in ath12k_pull_peer_del_resp_ev()
4936 peer_del_resp->vdev_id = ev->vdev_id; in ath12k_pull_peer_del_resp_ev()
4937 ether_addr_copy(peer_del_resp->peer_macaddr.addr, in ath12k_pull_peer_del_resp_ev()
4938 ev->peer_macaddr.addr); in ath12k_pull_peer_del_resp_ev()
4952 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_vdev_del_resp_ev()
4963 return -EPROTO; in ath12k_pull_vdev_del_resp_ev()
4966 *vdev_id = le32_to_cpu(ev->vdev_id); in ath12k_pull_vdev_del_resp_ev()
4991 return -EPROTO; in ath12k_pull_bcn_tx_status_ev()
4994 *vdev_id = le32_to_cpu(ev->vdev_id); in ath12k_pull_bcn_tx_status_ev()
4995 *tx_status = le32_to_cpu(ev->tx_status); in ath12k_pull_bcn_tx_status_ev()
5008 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_vdev_stopped_param_tlv()
5019 return -EPROTO; in ath12k_pull_vdev_stopped_param_tlv()
5022 *vdev_id = le32_to_cpu(ev->vdev_id); in ath12k_pull_vdev_stopped_param_tlv()
5036 parse->fixed = ptr; in ath12k_wmi_tlv_mgmt_rx_parse()
5039 if (!parse->frame_buf_done) { in ath12k_wmi_tlv_mgmt_rx_parse()
5040 parse->frame_buf = ptr; in ath12k_wmi_tlv_mgmt_rx_parse()
5041 parse->frame_buf_done = true; in ath12k_wmi_tlv_mgmt_rx_parse()
5057 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_pull_mgmt_rx_params_tlv()
5070 return -EPROTO; in ath12k_pull_mgmt_rx_params_tlv()
5073 hdr->pdev_id = le32_to_cpu(ev->pdev_id); in ath12k_pull_mgmt_rx_params_tlv()
5074 hdr->chan_freq = le32_to_cpu(ev->chan_freq); in ath12k_pull_mgmt_rx_params_tlv()
5075 hdr->channel = le32_to_cpu(ev->channel); in ath12k_pull_mgmt_rx_params_tlv()
5076 hdr->snr = le32_to_cpu(ev->snr); in ath12k_pull_mgmt_rx_params_tlv()
5077 hdr->rate = le32_to_cpu(ev->rate); in ath12k_pull_mgmt_rx_params_tlv()
5078 hdr->phy_mode = le32_to_cpu(ev->phy_mode); in ath12k_pull_mgmt_rx_params_tlv()
5079 hdr->buf_len = le32_to_cpu(ev->buf_len); in ath12k_pull_mgmt_rx_params_tlv()
5080 hdr->status = le32_to_cpu(ev->status); in ath12k_pull_mgmt_rx_params_tlv()
5081 hdr->flags = le32_to_cpu(ev->flags); in ath12k_pull_mgmt_rx_params_tlv()
5082 hdr->rssi = a_sle32_to_cpu(ev->rssi); in ath12k_pull_mgmt_rx_params_tlv()
5083 hdr->tsf_delta = le32_to_cpu(ev->tsf_delta); in ath12k_pull_mgmt_rx_params_tlv()
5086 hdr->rssi_ctl[i] = le32_to_cpu(ev->rssi_ctl[i]); in ath12k_pull_mgmt_rx_params_tlv()
5088 if (skb->len < (frame - skb->data) + hdr->buf_len) { in ath12k_pull_mgmt_rx_params_tlv()
5090 return -EPROTO; in ath12k_pull_mgmt_rx_params_tlv()
5095 skb_put(skb, frame - skb->data); in ath12k_pull_mgmt_rx_params_tlv()
5096 skb_pull(skb, frame - skb->data); in ath12k_pull_mgmt_rx_params_tlv()
5097 skb_put(skb, hdr->buf_len); in ath12k_pull_mgmt_rx_params_tlv()
5110 spin_lock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5111 msdu = idr_find(&ar->txmgmt_idr, desc_id); in wmi_process_mgmt_tx_comp()
5114 ath12k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n", in wmi_process_mgmt_tx_comp()
5116 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5117 return -ENOENT; in wmi_process_mgmt_tx_comp()
5120 idr_remove(&ar->txmgmt_idr, desc_id); in wmi_process_mgmt_tx_comp()
5121 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5124 dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); in wmi_process_mgmt_tx_comp()
5127 if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && !status) in wmi_process_mgmt_tx_comp()
5128 info->flags |= IEEE80211_TX_STAT_ACK; in wmi_process_mgmt_tx_comp()
5130 ieee80211_tx_status_irqsafe(ar->hw, msdu); in wmi_process_mgmt_tx_comp()
5132 num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx); in wmi_process_mgmt_tx_comp()
5139 wake_up(&ar->txmgmt_empty_waitq); in wmi_process_mgmt_tx_comp()
5152 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_mgmt_tx_compl_param_tlv()
5163 return -EPROTO; in ath12k_pull_mgmt_tx_compl_param_tlv()
5166 param->pdev_id = ev->pdev_id; in ath12k_pull_mgmt_tx_compl_param_tlv()
5167 param->desc_id = ev->desc_id; in ath12k_pull_mgmt_tx_compl_param_tlv()
5168 param->status = ev->status; in ath12k_pull_mgmt_tx_compl_param_tlv()
5176 lockdep_assert_held(&ar->data_lock); in ath12k_wmi_event_scan_started()
5178 switch (ar->scan.state) { in ath12k_wmi_event_scan_started()
5182 ath12k_warn(ar->ab, "received scan started event in an invalid scan state: %s (%d)\n", in ath12k_wmi_event_scan_started()
5183 ath12k_scan_state_str(ar->scan.state), in ath12k_wmi_event_scan_started()
5184 ar->scan.state); in ath12k_wmi_event_scan_started()
5187 ar->scan.state = ATH12K_SCAN_RUNNING; in ath12k_wmi_event_scan_started()
5188 complete(&ar->scan.started); in ath12k_wmi_event_scan_started()
5195 lockdep_assert_held(&ar->data_lock); in ath12k_wmi_event_scan_start_failed()
5197 switch (ar->scan.state) { in ath12k_wmi_event_scan_start_failed()
5201 ath12k_warn(ar->ab, "received scan start failed event in an invalid scan state: %s (%d)\n", in ath12k_wmi_event_scan_start_failed()
5202 ath12k_scan_state_str(ar->scan.state), in ath12k_wmi_event_scan_start_failed()
5203 ar->scan.state); in ath12k_wmi_event_scan_start_failed()
5206 complete(&ar->scan.started); in ath12k_wmi_event_scan_start_failed()
5214 lockdep_assert_held(&ar->data_lock); in ath12k_wmi_event_scan_completed()
5216 switch (ar->scan.state) { in ath12k_wmi_event_scan_completed()
5227 ath12k_warn(ar->ab, "received scan completed event in an invalid scan state: %s (%d)\n", in ath12k_wmi_event_scan_completed()
5228 ath12k_scan_state_str(ar->scan.state), in ath12k_wmi_event_scan_completed()
5229 ar->scan.state); in ath12k_wmi_event_scan_completed()
5240 lockdep_assert_held(&ar->data_lock); in ath12k_wmi_event_scan_bss_chan()
5242 switch (ar->scan.state) { in ath12k_wmi_event_scan_bss_chan()
5245 ath12k_warn(ar->ab, "received scan bss chan event in an invalid scan state: %s (%d)\n", in ath12k_wmi_event_scan_bss_chan()
5246 ath12k_scan_state_str(ar->scan.state), in ath12k_wmi_event_scan_bss_chan()
5247 ar->scan.state); in ath12k_wmi_event_scan_bss_chan()
5251 ar->scan_channel = NULL; in ath12k_wmi_event_scan_bss_chan()
5258 lockdep_assert_held(&ar->data_lock); in ath12k_wmi_event_scan_foreign_chan()
5260 switch (ar->scan.state) { in ath12k_wmi_event_scan_foreign_chan()
5263 ath12k_warn(ar->ab, "received scan foreign chan event in an invalid scan state: %s (%d)\n", in ath12k_wmi_event_scan_foreign_chan()
5264 ath12k_scan_state_str(ar->scan.state), in ath12k_wmi_event_scan_foreign_chan()
5265 ar->scan.state); in ath12k_wmi_event_scan_foreign_chan()
5269 ar->scan_channel = ieee80211_get_channel(ar->hw->wiphy, freq); in ath12k_wmi_event_scan_foreign_chan()
5323 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_scan_ev()
5334 return -EPROTO; in ath12k_pull_scan_ev()
5337 scan_evt_param->event_type = ev->event_type; in ath12k_pull_scan_ev()
5338 scan_evt_param->reason = ev->reason; in ath12k_pull_scan_ev()
5339 scan_evt_param->channel_freq = ev->channel_freq; in ath12k_pull_scan_ev()
5340 scan_evt_param->scan_req_id = ev->scan_req_id; in ath12k_pull_scan_ev()
5341 scan_evt_param->scan_id = ev->scan_id; in ath12k_pull_scan_ev()
5342 scan_evt_param->vdev_id = ev->vdev_id; in ath12k_pull_scan_ev()
5343 scan_evt_param->tsf_timestamp = ev->tsf_timestamp; in ath12k_pull_scan_ev()
5356 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_peer_sta_kickout_ev()
5367 return -EPROTO; in ath12k_pull_peer_sta_kickout_ev()
5370 arg->mac_addr = ev->peer_macaddr.addr; in ath12k_pull_peer_sta_kickout_ev()
5383 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_roam_ev()
5394 return -EPROTO; in ath12k_pull_roam_ev()
5397 roam_ev->vdev_id = ev->vdev_id; in ath12k_pull_roam_ev()
5398 roam_ev->reason = ev->reason; in ath12k_pull_roam_ev()
5399 roam_ev->rssi = ev->rssi; in ath12k_pull_roam_ev()
5411 if (!ar->mac.sbands[band].channels) in freq_to_idx()
5414 sband = ar->hw->wiphy->bands[band]; in freq_to_idx()
5418 for (ch = 0; ch < sband->n_channels; ch++, idx++) in freq_to_idx()
5419 if (sband->channels[ch].center_freq == freq) in freq_to_idx()
5445 return -EPROTO; in ath12k_pull_chan_info_ev()
5448 ch_info_ev->err_code = ev->err_code; in ath12k_pull_chan_info_ev()
5449 ch_info_ev->freq = ev->freq; in ath12k_pull_chan_info_ev()
5450 ch_info_ev->cmd_flags = ev->cmd_flags; in ath12k_pull_chan_info_ev()
5451 ch_info_ev->noise_floor = ev->noise_floor; in ath12k_pull_chan_info_ev()
5452 ch_info_ev->rx_clear_count = ev->rx_clear_count; in ath12k_pull_chan_info_ev()
5453 ch_info_ev->cycle_count = ev->cycle_count; in ath12k_pull_chan_info_ev()
5454 ch_info_ev->chan_tx_pwr_range = ev->chan_tx_pwr_range; in ath12k_pull_chan_info_ev()
5455 ch_info_ev->chan_tx_pwr_tp = ev->chan_tx_pwr_tp; in ath12k_pull_chan_info_ev()
5456 ch_info_ev->rx_frame_count = ev->rx_frame_count; in ath12k_pull_chan_info_ev()
5457 ch_info_ev->tx_frame_cnt = ev->tx_frame_cnt; in ath12k_pull_chan_info_ev()
5458 ch_info_ev->mac_clk_mhz = ev->mac_clk_mhz; in ath12k_pull_chan_info_ev()
5459 ch_info_ev->vdev_id = ev->vdev_id; in ath12k_pull_chan_info_ev()
5473 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_pdev_bss_chan_info_ev()
5484 return -EPROTO; in ath12k_pull_pdev_bss_chan_info_ev()
5487 bss_ch_info_ev->pdev_id = ev->pdev_id; in ath12k_pull_pdev_bss_chan_info_ev()
5488 bss_ch_info_ev->freq = ev->freq; in ath12k_pull_pdev_bss_chan_info_ev()
5489 bss_ch_info_ev->noise_floor = ev->noise_floor; in ath12k_pull_pdev_bss_chan_info_ev()
5490 bss_ch_info_ev->rx_clear_count_low = ev->rx_clear_count_low; in ath12k_pull_pdev_bss_chan_info_ev()
5491 bss_ch_info_ev->rx_clear_count_high = ev->rx_clear_count_high; in ath12k_pull_pdev_bss_chan_info_ev()
5492 bss_ch_info_ev->cycle_count_low = ev->cycle_count_low; in ath12k_pull_pdev_bss_chan_info_ev()
5493 bss_ch_info_ev->cycle_count_high = ev->cycle_count_high; in ath12k_pull_pdev_bss_chan_info_ev()
5494 bss_ch_info_ev->tx_cycle_count_low = ev->tx_cycle_count_low; in ath12k_pull_pdev_bss_chan_info_ev()
5495 bss_ch_info_ev->tx_cycle_count_high = ev->tx_cycle_count_high; in ath12k_pull_pdev_bss_chan_info_ev()
5496 bss_ch_info_ev->rx_cycle_count_low = ev->rx_cycle_count_low; in ath12k_pull_pdev_bss_chan_info_ev()
5497 bss_ch_info_ev->rx_cycle_count_high = ev->rx_cycle_count_high; in ath12k_pull_pdev_bss_chan_info_ev()
5498 bss_ch_info_ev->rx_bss_cycle_count_low = ev->rx_bss_cycle_count_low; in ath12k_pull_pdev_bss_chan_info_ev()
5499 bss_ch_info_ev->rx_bss_cycle_count_high = ev->rx_bss_cycle_count_high; in ath12k_pull_pdev_bss_chan_info_ev()
5513 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_vdev_install_key_compl_ev()
5524 return -EPROTO; in ath12k_pull_vdev_install_key_compl_ev()
5527 arg->vdev_id = le32_to_cpu(ev->vdev_id); in ath12k_pull_vdev_install_key_compl_ev()
5528 arg->macaddr = ev->peer_macaddr.addr; in ath12k_pull_vdev_install_key_compl_ev()
5529 arg->key_idx = le32_to_cpu(ev->key_idx); in ath12k_pull_vdev_install_key_compl_ev()
5530 arg->key_flags = le32_to_cpu(ev->key_flags); in ath12k_pull_vdev_install_key_compl_ev()
5531 arg->status = le32_to_cpu(ev->status); in ath12k_pull_vdev_install_key_compl_ev()
5544 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pull_peer_assoc_conf_ev()
5555 return -EPROTO; in ath12k_pull_peer_assoc_conf_ev()
5558 peer_assoc_conf->vdev_id = le32_to_cpu(ev->vdev_id); in ath12k_pull_peer_assoc_conf_ev()
5559 peer_assoc_conf->macaddr = ev->peer_macaddr.addr; in ath12k_pull_peer_assoc_conf_ev()
5583 return -EPROTO; in ath12k_pull_pdev_temp_ev()
5593 wake_up(&ab->wmi_ab.tx_credits_wq); in ath12k_wmi_op_ep_tx_credits()
5617 ret = -ENOMEM; in ath12k_reg_chan_list_event()
5628 if (reg_info->status_code != REG_SET_CC_STATUS_PASS) { in ath12k_reg_chan_list_event()
5637 pdev_idx = reg_info->phy_id; in ath12k_reg_chan_list_event()
5639 if (pdev_idx >= ab->num_radios) { in ath12k_reg_chan_list_event()
5644 if (ab->hw_params->single_pdev_only && in ath12k_reg_chan_list_event()
5645 pdev_idx < ab->hw_params->num_rxmda_per_pdev) in ath12k_reg_chan_list_event()
5652 * stop-start after mac registration. in ath12k_reg_chan_list_event()
5654 if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] && in ath12k_reg_chan_list_event()
5655 !memcmp(ab->default_regd[pdev_idx]->alpha2, in ath12k_reg_chan_list_event()
5656 reg_info->alpha2, 2)) in ath12k_reg_chan_list_event()
5663 if (ab->default_regd[pdev_idx] && in ath12k_reg_chan_list_event()
5665 ab->default_regd[pdev_idx]->alpha2) && in ath12k_reg_chan_list_event()
5666 !ath12k_reg_is_world_alpha((char *)reg_info->alpha2)) in ath12k_reg_chan_list_event()
5675 spin_lock(&ab->base_lock); in ath12k_reg_chan_list_event()
5676 if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) { in ath12k_reg_chan_list_event()
5684 ar = ab->pdevs[pdev_idx].ar; in ath12k_reg_chan_list_event()
5685 kfree(ab->new_regd[pdev_idx]); in ath12k_reg_chan_list_event()
5686 ab->new_regd[pdev_idx] = regd; in ath12k_reg_chan_list_event()
5687 queue_work(ab->workqueue, &ar->regd_update_work); in ath12k_reg_chan_list_event()
5694 kfree(ab->default_regd[pdev_idx]); in ath12k_reg_chan_list_event()
5696 ab->default_regd[pdev_idx] = regd; in ath12k_reg_chan_list_event()
5698 ab->dfs_region = reg_info->dfs_region; in ath12k_reg_chan_list_event()
5699 spin_unlock(&ab->base_lock); in ath12k_reg_chan_list_event()
5715 kfree(reg_info->reg_rules_2g_ptr); in ath12k_reg_chan_list_event()
5716 kfree(reg_info->reg_rules_5g_ptr); in ath12k_reg_chan_list_event()
5717 if (reg_info->is_ext_reg_event) { in ath12k_reg_chan_list_event()
5719 kfree(reg_info->reg_rules_6g_ap_ptr[i]); in ath12k_reg_chan_list_event()
5723 kfree(reg_info->reg_rules_6g_client_ptr[j][i]); in ath12k_reg_chan_list_event()
5753 ab->wlan_init_status = le32_to_cpu(fixed_param.ready_event_min.status); in ath12k_wmi_rdy_parse()
5754 rdy_parse->num_extra_mac_addr = in ath12k_wmi_rdy_parse()
5757 ether_addr_copy(ab->mac_addr, in ath12k_wmi_rdy_parse()
5759 ab->pktlog_defs_checksum = le32_to_cpu(fixed_param.pktlog_defs_checksum); in ath12k_wmi_rdy_parse()
5760 ab->wmi_ready = true; in ath12k_wmi_rdy_parse()
5768 num_mac_addr = rdy_parse->num_extra_mac_addr; in ath12k_wmi_rdy_parse()
5770 if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) in ath12k_wmi_rdy_parse()
5773 for (i = 0; i < ab->num_radios; i++) { in ath12k_wmi_rdy_parse()
5774 pdev = &ab->pdevs[i]; in ath12k_wmi_rdy_parse()
5775 ether_addr_copy(pdev->mac_addr, addr_list[i].addr); in ath12k_wmi_rdy_parse()
5777 ab->pdevs_macaddr_valid = true; in ath12k_wmi_rdy_parse()
5791 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_ready_event()
5798 complete(&ab->wmi_ab.unified_ready); in ath12k_ready_event()
5821 complete(&ar->peer_delete_done); in ath12k_peer_delete_resp_event()
5847 complete(&ar->vdev_delete_done); in ath12k_vdev_delete_resp_event()
5891 ar->last_wmi_vdev_start_status = 0; in ath12k_vdev_start_resp_event()
5898 ar->last_wmi_vdev_start_status = status; in ath12k_vdev_start_resp_event()
5901 complete(&ar->vdev_setup_done); in ath12k_vdev_start_resp_event()
5913 if (ath12k_pull_bcn_tx_status_ev(ab, skb->data, skb->len, in ath12k_bcn_tx_status_event()
5939 complete(&ar->vdev_setup_done); in ath12k_vdev_stopped_event()
5976 if ((test_bit(ATH12K_CAC_RUNNING, &ar->dev_flags)) || in ath12k_mgmt_rx_event()
5985 status->flag |= RX_FLAG_MMIC_ERROR; in ath12k_mgmt_rx_event()
5988 status->band = NL80211_BAND_6GHZ; in ath12k_mgmt_rx_event()
5990 status->band = NL80211_BAND_2GHZ; in ath12k_mgmt_rx_event()
5992 status->band = NL80211_BAND_5GHZ; in ath12k_mgmt_rx_event()
6003 (status->band == NL80211_BAND_5GHZ || status->band == NL80211_BAND_6GHZ)) in ath12k_mgmt_rx_event()
6005 "wmi mgmt rx 11b (CCK) on 5/6GHz, band = %d\n", status->band); in ath12k_mgmt_rx_event()
6007 sband = &ar->mac.sbands[status->band]; in ath12k_mgmt_rx_event()
6009 status->freq = ieee80211_channel_to_frequency(rx_ev.channel, in ath12k_mgmt_rx_event()
6010 status->band); in ath12k_mgmt_rx_event()
6011 status->signal = rx_ev.snr + ATH12K_DEFAULT_NOISE_FLOOR; in ath12k_mgmt_rx_event()
6012 status->rate_idx = ath12k_mac_bitrate_to_idx(sband, rx_ev.rate / 100); in ath12k_mgmt_rx_event()
6014 hdr = (struct ieee80211_hdr *)skb->data; in ath12k_mgmt_rx_event()
6015 fc = le16_to_cpu(hdr->frame_control); in ath12k_mgmt_rx_event()
6021 status->flag |= RX_FLAG_SKIP_MONITOR; in ath12k_mgmt_rx_event()
6026 if (ieee80211_has_protected(hdr->frame_control)) { in ath12k_mgmt_rx_event()
6027 status->flag |= RX_FLAG_DECRYPTED; in ath12k_mgmt_rx_event()
6030 status->flag |= RX_FLAG_IV_STRIPPED | in ath12k_mgmt_rx_event()
6032 hdr->frame_control = __cpu_to_le16(fc & in ath12k_mgmt_rx_event()
6038 *if (ieee80211_is_beacon(hdr->frame_control)) in ath12k_mgmt_rx_event()
6044 skb, skb->len, in ath12k_mgmt_rx_event()
6049 status->freq, status->band, status->signal, in ath12k_mgmt_rx_event()
6050 status->rate_idx); in ath12k_mgmt_rx_event()
6052 ieee80211_rx_ni(ar->hw, skb); in ath12k_mgmt_rx_event()
6095 for (i = 0; i < ab->num_radios; i++) { in ath12k_get_ar_on_scan_abort()
6096 pdev = rcu_dereference(ab->pdevs_active[i]); in ath12k_get_ar_on_scan_abort()
6097 if (pdev && pdev->ar) { in ath12k_get_ar_on_scan_abort()
6098 ar = pdev->ar; in ath12k_get_ar_on_scan_abort()
6100 spin_lock_bh(&ar->data_lock); in ath12k_get_ar_on_scan_abort()
6101 if (ar->scan.state == ATH12K_SCAN_ABORTING && in ath12k_get_ar_on_scan_abort()
6102 ar->scan.vdev_id == vdev_id) { in ath12k_get_ar_on_scan_abort()
6103 spin_unlock_bh(&ar->data_lock); in ath12k_get_ar_on_scan_abort()
6106 spin_unlock_bh(&ar->data_lock); in ath12k_get_ar_on_scan_abort()
6142 spin_lock_bh(&ar->data_lock); in ath12k_scan_event()
6154 ath12k_scan_state_str(ar->scan.state), ar->scan.state); in ath12k_scan_event()
6183 spin_unlock_bh(&ar->data_lock); in ath12k_scan_event()
6202 spin_lock_bh(&ab->base_lock); in ath12k_peer_sta_kickout_event()
6212 ar = ath12k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); in ath12k_peer_sta_kickout_event()
6215 peer->vdev_id); in ath12k_peer_sta_kickout_event()
6219 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath12k_peer_sta_kickout_event()
6233 spin_unlock_bh(&ab->base_lock); in ath12k_peer_sta_kickout_event()
6290 u32 cc_freq_hz = ab->cc_freq_hz; in ath12k_chan_info_event()
6292 if (ath12k_pull_chan_info_ev(ab, skb->data, skb->len, &ch_info_ev) != 0) { in ath12k_chan_info_event()
6317 spin_lock_bh(&ar->data_lock); in ath12k_chan_info_event()
6319 switch (ar->scan.state) { in ath12k_chan_info_event()
6330 if (idx >= ARRAY_SIZE(ar->survey)) { in ath12k_chan_info_event()
6343 survey = &ar->survey[idx]; in ath12k_chan_info_event()
6345 survey->noise = le32_to_cpu(ch_info_ev.noise_floor); in ath12k_chan_info_event()
6346 survey->filled = SURVEY_INFO_NOISE_DBM | SURVEY_INFO_TIME | in ath12k_chan_info_event()
6348 survey->time = div_u64(le32_to_cpu(ch_info_ev.cycle_count), cc_freq_hz); in ath12k_chan_info_event()
6349 survey->time_busy = div_u64(le32_to_cpu(ch_info_ev.rx_clear_count), in ath12k_chan_info_event()
6353 spin_unlock_bh(&ar->data_lock); in ath12k_chan_info_event()
6363 u32 cc_freq_hz = ab->cc_freq_hz; in ath12k_pdev_bss_chan_info_event()
6410 spin_lock_bh(&ar->data_lock); in ath12k_pdev_bss_chan_info_event()
6412 if (idx >= ARRAY_SIZE(ar->survey)) { in ath12k_pdev_bss_chan_info_event()
6418 survey = &ar->survey[idx]; in ath12k_pdev_bss_chan_info_event()
6420 survey->noise = le32_to_cpu(bss_ch_info_ev.noise_floor); in ath12k_pdev_bss_chan_info_event()
6421 survey->time = div_u64(total, cc_freq_hz); in ath12k_pdev_bss_chan_info_event()
6422 survey->time_busy = div_u64(busy, cc_freq_hz); in ath12k_pdev_bss_chan_info_event()
6423 survey->time_rx = div_u64(rx_bss, cc_freq_hz); in ath12k_pdev_bss_chan_info_event()
6424 survey->time_tx = div_u64(tx, cc_freq_hz); in ath12k_pdev_bss_chan_info_event()
6425 survey->filled |= (SURVEY_INFO_NOISE_DBM | in ath12k_pdev_bss_chan_info_event()
6431 spin_unlock_bh(&ar->data_lock); in ath12k_pdev_bss_chan_info_event()
6432 complete(&ar->bss_survey_done); in ath12k_pdev_bss_chan_info_event()
6462 ar->install_key_status = 0; in ath12k_vdev_install_key_compl_event()
6467 ar->install_key_status = install_key_compl.status; in ath12k_vdev_install_key_compl_event()
6470 complete(&ar->install_key_done); in ath12k_vdev_install_key_compl_event()
6492 return -EINVAL; in ath12k_wmi_tlv_services_parser()
6506 if (le32_to_cpu(ev->wmi_service_segment_bitmap[i]) & in ath12k_wmi_tlv_services_parser()
6508 set_bit(j, ab->wmi_ab.svc_map); in ath12k_wmi_tlv_services_parser()
6514 ev->wmi_service_segment_bitmap[0], in ath12k_wmi_tlv_services_parser()
6515 ev->wmi_service_segment_bitmap[1], in ath12k_wmi_tlv_services_parser()
6516 ev->wmi_service_segment_bitmap[2], in ath12k_wmi_tlv_services_parser()
6517 ev->wmi_service_segment_bitmap[3]); in ath12k_wmi_tlv_services_parser()
6531 set_bit(j, ab->wmi_ab.svc_map); in ath12k_wmi_tlv_services_parser()
6548 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len, in ath12k_service_available_event()
6578 complete(&ar->peer_assoc_done); in ath12k_peer_assoc_conf_event()
6596 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_pdev_ctl_failsafe_check_event()
6612 ev->ctl_failsafe_status); in ath12k_pdev_ctl_failsafe_check_event()
6617 if (ev->ctl_failsafe_status != 0) in ath12k_pdev_ctl_failsafe_check_event()
6619 ev->ctl_failsafe_status); in ath12k_pdev_ctl_failsafe_check_event()
6633 if (ev->current_switch_count) in ath12k_wmi_process_csa_switch_count_event()
6637 for (i = 0; i < le32_to_cpu(ev->num_vdevs); i++) { in ath12k_wmi_process_csa_switch_count_event()
6646 if (arvif->is_up && arvif->vif->bss_conf.csa_active) in ath12k_wmi_process_csa_switch_count_event()
6647 ieee80211_csa_finish(arvif->vif); in ath12k_wmi_process_csa_switch_count_event()
6661 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_wmi_pdev_csa_switch_count_status_event()
6679 ev->current_switch_count, ev->pdev_id, in ath12k_wmi_pdev_csa_switch_count_status_event()
6680 ev->num_vdevs); in ath12k_wmi_pdev_csa_switch_count_status_event()
6695 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_wmi_pdev_dfs_radar_detected_event()
6712 ev->pdev_id, ev->detection_mode, ev->chan_freq, ev->chan_width, in ath12k_wmi_pdev_dfs_radar_detected_event()
6713 ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, in ath12k_wmi_pdev_dfs_radar_detected_event()
6714 ev->freq_offset, ev->sidx); in ath12k_wmi_pdev_dfs_radar_detected_event()
6716 ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev->pdev_id)); in ath12k_wmi_pdev_dfs_radar_detected_event()
6720 ev->pdev_id); in ath12k_wmi_pdev_dfs_radar_detected_event()
6724 ath12k_dbg(ar->ab, ATH12K_DBG_REG, "DFS Radar Detected in pdev %d\n", in ath12k_wmi_pdev_dfs_radar_detected_event()
6725 ev->pdev_id); in ath12k_wmi_pdev_dfs_radar_detected_event()
6727 if (ar->dfs_block_radar_events) in ath12k_wmi_pdev_dfs_radar_detected_event()
6730 ieee80211_radar_detected(ar->hw); in ath12k_wmi_pdev_dfs_radar_detected_event()
6743 if (ath12k_pull_pdev_temp_ev(ab, skb->data, skb->len, &ev) != 0) { in ath12k_wmi_pdev_temperature_event()
6765 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_fils_discovery_event()
6783 ev->vdev_id, ev->fils_tt, ev->tbtt); in ath12k_fils_discovery_event()
6795 tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath12k_probe_resp_tx_status_event()
6812 if (ev->tx_status) in ath12k_probe_resp_tx_status_event()
6815 ev->vdev_id, ev->tx_status); in ath12k_probe_resp_tx_status_event()
6825 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath12k_wmi_op_rx()
6826 id = le32_get_bits(cmd_hdr->cmd_id, WMI_CMD_HDR_CMD_ID); in ath12k_wmi_op_rx()
6955 status = ath12k_htc_connect_service(&ab->htc, &conn_req, &conn_resp); in ath12k_connect_pdev_htc_service()
6962 ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid; in ath12k_connect_pdev_htc_service()
6963 ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid; in ath12k_connect_pdev_htc_service()
6964 ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len; in ath12k_connect_pdev_htc_service()
6974 struct ath12k_wmi_pdev *wmi = ar->wmi; in ath12k_wmi_send_unit_test_cmd()
6991 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, buf_len); in ath12k_wmi_send_unit_test_cmd()
6993 return -ENOMEM; in ath12k_wmi_send_unit_test_cmd()
6995 cmd = (struct wmi_unit_test_cmd *)skb->data; in ath12k_wmi_send_unit_test_cmd()
6996 cmd->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_UNIT_TEST_CMD, in ath12k_wmi_send_unit_test_cmd()
6999 cmd->vdev_id = ut_cmd.vdev_id; in ath12k_wmi_send_unit_test_cmd()
7000 cmd->module_id = ut_cmd.module_id; in ath12k_wmi_send_unit_test_cmd()
7001 cmd->num_args = ut_cmd.num_args; in ath12k_wmi_send_unit_test_cmd()
7002 cmd->diag_token = ut_cmd.diag_token; in ath12k_wmi_send_unit_test_cmd()
7004 ptr = skb->data + sizeof(ut_cmd); in ath12k_wmi_send_unit_test_cmd()
7011 tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_UINT32, arg_len); in ath12k_wmi_send_unit_test_cmd()
7023 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, in ath12k_wmi_send_unit_test_cmd()
7025 cmd->module_id, cmd->vdev_id, cmd->num_args, in ath12k_wmi_send_unit_test_cmd()
7026 cmd->diag_token); in ath12k_wmi_send_unit_test_cmd()
7031 ath12k_warn(ar->ab, "failed to send WMI_UNIT_TEST CMD :%d\n", in ath12k_wmi_send_unit_test_cmd()
7046 list_for_each_entry(arvif, &ar->arvifs, list) { in ath12k_wmi_simulate_radar()
7047 if (arvif->is_started && arvif->vdev_type == WMI_VDEV_TYPE_AP) { in ath12k_wmi_simulate_radar()
7054 return -EINVAL; in ath12k_wmi_simulate_radar()
7057 dfs_args[DFS_TEST_PDEV_ID] = ar->pdev->pdev_id; in ath12k_wmi_simulate_radar()
7058 /* Currently we could pass segment_id(b0 - b1), chirp(b2) in ath12k_wmi_simulate_radar()
7059 * freq offset (b3 - b10) to unit test. For simulation in ath12k_wmi_simulate_radar()
7064 wmi_ut.vdev_id = cpu_to_le32(arvif->vdev_id); in ath12k_wmi_simulate_radar()
7069 ath12k_dbg(ar->ab, ATH12K_DBG_REG, "Triggering Radar Simulation\n"); in ath12k_wmi_simulate_radar()
7079 wmi_ep_count = ab->htc.wmi_ep_count; in ath12k_wmi_connect()
7080 if (wmi_ep_count > ab->hw_params->max_radios) in ath12k_wmi_connect()
7081 return -1; in ath12k_wmi_connect()
7102 if (pdev_id >= ab->hw_params->max_radios) in ath12k_wmi_pdev_attach()
7103 return -EINVAL; in ath12k_wmi_pdev_attach()
7105 wmi_handle = &ab->wmi_ab.wmi[pdev_id]; in ath12k_wmi_pdev_attach()
7107 wmi_handle->wmi_ab = &ab->wmi_ab; in ath12k_wmi_pdev_attach()
7109 ab->wmi_ab.ab = ab; in ath12k_wmi_pdev_attach()
7123 ab->wmi_ab.ab = ab; in ath12k_wmi_attach()
7124 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_MAX; in ath12k_wmi_attach()
7127 if (ab->hw_params->single_pdev_only) in ath12k_wmi_attach()
7128 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_SINGLE; in ath12k_wmi_attach()
7131 init_completion(&ab->wmi_ab.service_ready); in ath12k_wmi_attach()
7132 init_completion(&ab->wmi_ab.unified_ready); in ath12k_wmi_attach()
7143 for (i = 0; i < ab->htc.wmi_ep_count; i++) in ath12k_wmi_detach()