Lines Matching refs:ab

187 void ath12k_wmi_init_qcn9274(struct ath12k_base *ab,
190 config->num_vdevs = ab->num_radios * TARGET_NUM_VDEVS;
191 config->num_peers = ab->num_radios *
192 ath12k_core_get_max_peers_per_radio(ab);
193 config->num_tids = ath12k_core_get_max_num_tids(ab);
198 config->tx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1;
199 config->rx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1;
205 if (test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags))
225 config->beacon_tx_offload_max_vdev = ab->num_radios * TARGET_MAX_BCN_OFFLD;
229 config->twt_ap_pdev_count = ab->num_radios;
232 if (test_bit(WMI_TLV_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT, ab->wmi_ab.svc_map))
236 void ath12k_wmi_init_wcn7850(struct ath12k_base *ab,
247 config->tx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1;
248 config->rx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1;
297 ath12k_wmi_tlv_iter(struct ath12k_base *ab, const void *ptr, size_t len,
298 int (*iter)(struct ath12k_base *ab, u16 tag, u16 len,
309 ath12k_err(ab, "wmi tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n",
321 ath12k_err(ab, "wmi tlv parse failure of tag %u at byte %zd (%zu bytes left, %u expected)\n",
329 ath12k_err(ab, "wmi tlv parse failure of tag %u at byte %zd (%u bytes is less than min length %zu)\n",
335 ret = iter(ab, tlv_tag, tlv_len, ptr, data);
346 static int ath12k_wmi_tlv_iter_parse(struct ath12k_base *ab, u16 tag, u16 len,
365 ath12k_wmi_tlv_parse_alloc(struct ath12k_base *ab,
375 ret = ath12k_wmi_tlv_parse(ab, tb, skb->data, skb->len);
388 struct ath12k_base *ab = wmi->wmi_ab->ab;
399 ret = ath12k_htc_send(&ab->htc, wmi->eid, skb);
422 if (ret && test_bit(ATH12K_FLAG_CRASH_FLUSH, &wmi_ab->ab->dev_flags))
429 ath12k_warn(wmi_ab->ab, "wmi command %d timeout\n", cmd_id);
471 struct ath12k_base *ab = wmi_handle->wmi_ab->ab;
503 fw_pdev = &ab->fw_pdev[ab->fw_pdev_count];
507 ab->fw_pdev_count++;
633 static int ath12k_pull_service_ready_tlv(struct ath12k_base *ab,
640 ath12k_err(ab, "%s: failed by NULL param\n",
683 static int ath12k_wmi_svc_rdy_parse(struct ath12k_base *ab, u16 tag, u16 len,
687 struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0];
692 if (ath12k_pull_service_ready_tlv(ab, ptr, &ab->target_caps))
700 ath12k_warn(ab, "invalid len %d for the tag 0x%x\n",
717 static int ath12k_service_ready_event(struct ath12k_base *ab, struct sk_buff *skb)
722 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
726 ath12k_warn(ab, "failed to parse tlv %d\n", ret);
736 struct ath12k_base *ab = ar->ab;
739 if (ab->hw_params->single_pdev_only &&
750 struct ath12k_base *ab = wmi_ab->ab;
753 skb = ath12k_htc_alloc_skb(ab, WMI_SKB_HEADROOM + round_len);
759 ath12k_warn(ab, "unaligned WMI skb data\n");
805 ath12k_warn(ar->ab,
876 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
883 ath12k_warn(ar->ab,
907 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "WMI vdev delete id %d\n", vdev_id);
911 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_DELETE_CMDID\n");
935 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "WMI vdev stop id 0x%x\n", vdev_id);
939 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_STOP cmd\n");
963 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "WMI vdev down id 0x%x\n", vdev_id);
967 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_DOWN cmd\n");
1081 ath12k_dbg(ar->ab, ATH12K_DBG_WMI, "vdev %s id 0x%x freq 0x%x mode 0x%x\n",
1092 ath12k_warn(ar->ab, "failed to submit vdev_%s cmd\n",
1120 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1126 ath12k_warn(ar->ab, "failed to submit WMI_VDEV_UP cmd\n");
1153 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1159 ath12k_warn(ar->ab, "failed to submit WMI_PEER_CREATE cmd\n");
1185 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1191 ath12k_warn(ar->ab, "failed to send WMI_PEER_DELETE cmd\n");
1222 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1229 ath12k_warn(ar->ab,
1257 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1263 ath12k_warn(ar->ab, "failed to send WMI_PEER_SET_PARAM cmd\n");
1292 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1298 ath12k_warn(ar->ab,
1333 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1340 ath12k_warn(ar->ab,
1369 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1376 ath12k_warn(ar->ab,
1403 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1409 ath12k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n");
1433 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1439 ath12k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n");
1466 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1471 ath12k_warn(ar->ab, "failed to send WMI_PDEV_SUSPEND cmd\n");
1495 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1500 ath12k_warn(ar->ab, "failed to send WMI_PDEV_RESUME cmd\n");
1529 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1535 ath12k_warn(ar->ab,
1564 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1570 ath12k_warn(ar->ab,
1598 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1604 ath12k_warn(ar->ab, "failed to send WMI_STA_POWERSAVE_PARAM_CMDID");
1634 ath12k_warn(ar->ab, "Failed to send WMI_FORCE_FW_HANG_CMDID");
1660 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1666 ath12k_warn(ar->ab,
1690 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1695 ath12k_warn(ar->ab, "failed to send WMI_PDEV_GET_TEMPERATURE cmd\n");
1721 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1727 ath12k_warn(ar->ab,
1770 ath12k_warn(ar->ab, "failed to send WMI_P2P_GO_SET_BEACON_IE\n");
1822 ath12k_warn(ar->ab, "failed to send WMI_BCN_TMPL_CMDID\n");
1868 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
1874 ath12k_warn(ar->ab,
2016 &ar->ab->dev_flags));
2148 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2166 ath12k_warn(ar->ab,
2323 ath12k_warn(ar->ab, "discard large size %d bytes extraie for scan start\n",
2455 ath12k_warn(ar->ab, "failed to send WMI_START_SCAN_CMDID\n");
2494 ath12k_warn(ar->ab, "invalid scan cancel req_type %d",
2503 ath12k_warn(ar->ab, "failed to send WMI_STOP_SCAN_CMDID\n");
2547 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2605 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2616 ath12k_warn(ar->ab, "failed to send WMI_SCAN_CHAN_LIST cmd\n");
2676 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2685 ath12k_warn(ar->ab,
2712 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2718 ath12k_warn(ar->ab,
2726 int ath12k_wmi_set_bios_cmd(struct ath12k_base *ab, u32 param_id,
2729 struct ath12k_wmi_base *wmi_ab = &ab->wmi_ab;
2761 ath12k_warn(ab,
2770 int ath12k_wmi_set_bios_sar_cmd(struct ath12k_base *ab, const u8 *psar_table)
2772 struct ath12k_wmi_base *wmi_ab = &ab->wmi_ab;
2817 ath12k_warn(ab,
2826 int ath12k_wmi_set_bios_geo_cmd(struct ath12k_base *ab, const u8 *pgeo_table)
2828 struct ath12k_wmi_base *wmi_ab = &ab->wmi_ab;
2860 ath12k_warn(ab,
2890 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2897 ath12k_warn(ar->ab,
2926 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2933 ath12k_warn(ar->ab,
2961 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
2968 ath12k_warn(ar->ab,
2994 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3001 ath12k_warn(ar->ab,
3052 ath12k_warn(ar->ab,
3065 struct ath12k_base *ab = wmi->wmi_ab->ab;
3108 ath12k_warn(ab, "Failed to send WMI_TWT_ENABLE_CMDID");
3118 struct ath12k_base *ab = wmi->wmi_ab->ab;
3137 ath12k_warn(ab, "Failed to send WMI_TWT_DISABLE_CMDID");
3148 struct ath12k_base *ab = wmi->wmi_ab->ab;
3170 ath12k_warn(ab,
3182 struct ath12k_base *ab = wmi->wmi_ab->ab;
3205 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3213 ath12k_warn(ab, "Failed to send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID");
3223 struct ath12k_base *ab = wmi->wmi_ab->ab;
3240 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3247 ath12k_warn(ab, "Failed to send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID");
3266 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3286 ath12k_warn(ar->ab,
3305 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3337 ath12k_warn(ar->ab,
3352 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3372 ath12k_warn(ar->ab,
3486 struct ath12k_base *ab = wmi->wmi_ab->ab;
3536 ath12k_dbg(ab, ATH12K_DBG_WMI,
3584 ath12k_warn(ab, "failed to send WMI_INIT_CMDID\n");
3611 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3616 ath12k_warn(ar->ab,
3627 int ath12k_wmi_wait_for_service_ready(struct ath12k_base *ab)
3631 time_left = wait_for_completion_timeout(&ab->wmi_ab.service_ready,
3639 int ath12k_wmi_wait_for_unified_ready(struct ath12k_base *ab)
3643 time_left = wait_for_completion_timeout(&ab->wmi_ab.unified_ready,
3651 int ath12k_wmi_set_hw_mode(struct ath12k_base *ab,
3656 struct ath12k_wmi_base *wmi_ab = &ab->wmi_ab;
3676 ath12k_warn(ab, "failed to send WMI_PDEV_SET_HW_MODE_CMDID\n");
3683 int ath12k_wmi_cmd_init(struct ath12k_base *ab)
3685 struct ath12k_wmi_base *wmi_ab = &ab->wmi_ab;
3689 ab->wmi_ab.svc_map))
3692 ab->hw_params->wmi_init(ab, &arg.res_cfg);
3698 if (ab->hw_params->single_pdev_only)
3701 arg.num_band_to_mac = ab->num_radios;
3702 ath12k_fill_band_to_mac_param(ab, arg.band_to_mac);
3741 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3748 ath12k_warn(ar->ab,
3778 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3785 ath12k_warn(ar->ab,
3824 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
3831 ath12k_warn(ar->ab,
3875 static int ath12k_wmi_dma_buf_parse(struct ath12k_base *ab,
3896 ret = ath12k_wmi_tlv_iter(ab, ptr, len,
3900 ath12k_warn(ab, "failed to parse dma buf entry tlv %d\n",
3910 ret = ath12k_wmi_tlv_iter(ab, ptr, len,
3914 ath12k_warn(ab, "failed to parse dma buf meta tlv %d\n",
3928 static void ath12k_wmi_pdev_dma_ring_buf_release_event(struct ath12k_base *ab,
3935 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
3939 ath12k_warn(ab, "failed to parse dma buf release tlv %d\n", ret);
3949 ret = ath12k_dbring_buffer_release_event(ab, &param);
3951 ath12k_warn(ab, "failed to handle dma buf release event %d\n", ret);
4167 static int ath12k_wmi_alloc_dbring_caps(struct ath12k_base *ab,
4178 ab->db_caps = ptr;
4179 ab->num_db_cap = num_cap;
4184 static void ath12k_wmi_free_dbring_caps(struct ath12k_base *ab)
4186 kfree(ab->db_caps);
4187 ab->db_caps = NULL;
4188 ab->num_db_cap = 0;
4191 static int ath12k_wmi_dma_ring_caps(struct ath12k_base *ab,
4202 ret = ath12k_wmi_tlv_iter(ab, ptr, len,
4206 ath12k_warn(ab, "failed to parse dma ring caps tlv %d\n", ret);
4213 if (ab->num_db_cap) {
4214 ath12k_warn(ab, "Already processed, so ignoring dma ring caps\n");
4218 ret = ath12k_wmi_alloc_dbring_caps(ab, dma_caps_parse->n_dma_ring_caps);
4222 dir_buff_caps = ab->db_caps;
4225 ath12k_warn(ab, "Invalid module id %d\n",
4242 ath12k_wmi_free_dbring_caps(ab);
4246 static int ath12k_wmi_svc_rdy_ext_parse(struct ath12k_base *ab,
4250 struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0];
4259 ath12k_warn(ab, "unable to extract ext params\n");
4271 ret = ath12k_wmi_ext_soc_hal_reg_caps_parse(ab, len, ptr,
4279 ret = ath12k_wmi_hw_mode_caps(ab, len, ptr, svc_rdy_ext);
4286 ret = ath12k_wmi_tlv_iter(ab, ptr, len,
4290 ath12k_warn(ab, "failed to parse tlv %d\n", ret);
4296 ret = ath12k_wmi_ext_hal_reg_caps(ab, len, ptr, svc_rdy_ext);
4308 ret = ath12k_wmi_dma_ring_caps(ab, len, ptr,
4323 static int ath12k_service_ready_ext_event(struct ath12k_base *ab,
4329 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
4333 ath12k_warn(ab, "failed to parse tlv %d\n", ret);
4337 if (!test_bit(WMI_TLV_SERVICE_EXT2_MSG, ab->wmi_ab.svc_map))
4338 complete(&ab->wmi_ab.service_ready);
4344 ath12k_wmi_free_dbring_caps(ab);
4409 ath12k_wmi_tlv_mac_phy_caps_ext_parse(struct ath12k_base *ab,
4417 if (ab->hw_params->single_pdev_only) {
4426 for (i = 0; i < ab->fw_pdev_count; i++) {
4427 struct ath12k_fw_pdev *fw_pdev = &ab->fw_pdev[i];
4436 if (i == ab->fw_pdev_count)
4470 static int ath12k_wmi_tlv_mac_phy_caps_ext(struct ath12k_base *ab, u16 tag,
4480 if (ab->hw_params->single_pdev_only) {
4481 if (ab->wmi_ab.preferred_hw_mode != le32_to_cpu(caps->hw_mode_id) &&
4485 for (i = 0; i < ab->num_radios; i++) {
4486 if (ab->pdevs[i].pdev_id ==
4491 if (i == ab->num_radios)
4495 ret = ath12k_wmi_tlv_mac_phy_caps_ext_parse(ab, caps, &ab->pdevs[i]);
4497 ath12k_warn(ab,
4499 ret, ab->pdevs[i].pdev_id);
4506 static int ath12k_wmi_svc_rdy_ext2_parse(struct ath12k_base *ab,
4510 struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0];
4519 ath12k_warn(ab,
4528 ret = ath12k_wmi_dma_ring_caps(ab, len, ptr,
4541 ret = ath12k_wmi_tlv_iter(ab, ptr, len,
4545 ath12k_warn(ab, "failed to parse extended MAC PHY capabilities WMI TLV: %d\n",
4560 static int ath12k_service_ready_ext2_event(struct ath12k_base *ab,
4566 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
4570 ath12k_warn(ab, "failed to parse ext2 event tlv %d\n", ret);
4574 complete(&ab->wmi_ab.service_ready);
4579 ath12k_wmi_free_dbring_caps(ab);
4583 static int ath12k_pull_vdev_start_resp_tlv(struct ath12k_base *ab, struct sk_buff *skb,
4590 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
4593 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
4599 ath12k_warn(ab, "failed to fetch vdev start resp ev");
4653 static int ath12k_pull_reg_chan_list_ext_update_ev(struct ath12k_base *ab,
4666 ath12k_dbg(ab, ATH12K_DBG_WMI, "processing regulatory ext channel list\n");
4668 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
4671 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
4677 ath12k_warn(ab, "failed to fetch reg chan list ext update ev\n");
4706 ath12k_warn(ab, "Num reg rules for 2G/5G exceeds max limit (num_2g_reg_rules: %d num_5g_reg_rules: %d max_rules: %d)\n",
4716 ath12k_warn(ab, "Num 6G reg rules for AP mode(%d) exceeds max limit (num_6g_reg_rules_ap: %d, max_rules: %d)\n",
4741 ath12k_warn(ab, "Num 6g client reg rules exceeds max limit, for client(type: %d)\n",
4749 ath12k_warn(ab, "No reg rules available\n");
4826 ath12k_dbg(ab, ATH12K_DBG_WMI,
4833 ath12k_dbg(ab, ATH12K_DBG_WMI,
4837 ath12k_dbg(ab, ATH12K_DBG_WMI,
4843 ath12k_dbg(ab, ATH12K_DBG_WMI,
4849 ath12k_dbg(ab, ATH12K_DBG_WMI,
4867 ath12k_warn(ab, "Unable to Allocate memory for 2g rules\n");
4880 ath12k_warn(ab, "Unable to Allocate memory for 5g rules\n");
4894 ath12k_warn(ab, "Unable to Allocate memory for 6g ap rules\n");
4909 ath12k_warn(ab, "Unable to Allocate memory for 6g client rules\n");
4938 ath12k_dbg(ab, ATH12K_DBG_WMI, "6g client_type: %d domain_code_6g_super_id: %d",
4941 ath12k_dbg(ab, ATH12K_DBG_WMI, "processed regulatory ext channel list\n");
4947 static int ath12k_pull_peer_del_resp_ev(struct ath12k_base *ab, struct sk_buff *skb,
4954 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
4957 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
4963 ath12k_warn(ab, "failed to fetch peer delete resp ev");
4978 static int ath12k_pull_vdev_del_resp_ev(struct ath12k_base *ab,
4986 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
4989 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
4995 ath12k_warn(ab, "failed to fetch vdev delete resp ev");
5006 static int ath12k_pull_bcn_tx_status_ev(struct ath12k_base *ab,
5014 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5017 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5023 ath12k_warn(ab, "failed to fetch bcn tx status ev");
5035 static int ath12k_pull_vdev_stopped_param_tlv(struct ath12k_base *ab, struct sk_buff *skb,
5042 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5045 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5051 ath12k_warn(ab, "failed to fetch vdev stop ev");
5062 static int ath12k_wmi_tlv_mgmt_rx_parse(struct ath12k_base *ab,
5082 static int ath12k_pull_mgmt_rx_params_tlv(struct ath12k_base *ab,
5091 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
5095 ath12k_warn(ab, "failed to parse mgmt rx tlv %d\n", ret);
5103 ath12k_warn(ab, "failed to fetch mgmt rx hdr");
5123 ath12k_warn(ab, "invalid length in mgmt rx hdr ev");
5148 ath12k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n",
5158 dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
5178 static int ath12k_pull_mgmt_tx_compl_param_tlv(struct ath12k_base *ab,
5186 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5189 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5195 ath12k_warn(ab, "failed to fetch mgmt tx compl ev");
5216 ath12k_warn(ar->ab, "received scan started event in an invalid scan state: %s (%d)\n",
5239 ath12k_warn(ar->ab, "received scan start failed event in an invalid scan state: %s (%d)\n",
5265 ath12k_warn(ar->ab, "received scan completed event in an invalid scan state: %s (%d)\n",
5283 ath12k_warn(ar->ab, "received scan bss chan event in an invalid scan state: %s (%d)\n",
5303 ath12k_warn(ar->ab, "received scan foreign chan event in an invalid scan state: %s (%d)\n",
5360 static int ath12k_pull_scan_ev(struct ath12k_base *ab, struct sk_buff *skb,
5367 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5370 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5376 ath12k_warn(ab, "failed to fetch scan ev");
5393 static int ath12k_pull_peer_sta_kickout_ev(struct ath12k_base *ab, struct sk_buff *skb,
5400 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5403 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5409 ath12k_warn(ab, "failed to fetch peer sta kickout ev");
5420 static int ath12k_pull_roam_ev(struct ath12k_base *ab, struct sk_buff *skb,
5427 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5430 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5436 ath12k_warn(ab, "failed to fetch roam ev");
5472 static int ath12k_pull_chan_info_ev(struct ath12k_base *ab, struct sk_buff *skb,
5479 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5482 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5488 ath12k_warn(ab, "failed to fetch chan info ev");
5511 ath12k_pull_pdev_bss_chan_info_ev(struct ath12k_base *ab, struct sk_buff *skb,
5518 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5521 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5527 ath12k_warn(ab, "failed to fetch pdev bss chan info ev");
5551 ath12k_pull_vdev_install_key_compl_ev(struct ath12k_base *ab, struct sk_buff *skb,
5558 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5561 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5567 ath12k_warn(ab, "failed to fetch vdev install key compl ev");
5582 static int ath12k_pull_peer_assoc_conf_ev(struct ath12k_base *ab, struct sk_buff *skb,
5589 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5592 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5598 ath12k_warn(ab, "failed to fetch peer assoc conf ev");
5611 ath12k_pull_pdev_temp_ev(struct ath12k_base *ab, struct sk_buff *skb,
5617 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
5620 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
5626 ath12k_warn(ab, "failed to fetch pdev temp ev");
5635 static void ath12k_wmi_op_ep_tx_credits(struct ath12k_base *ab)
5638 wake_up(&ab->wmi_ab.tx_credits_wq);
5641 static void ath12k_wmi_htc_tx_complete(struct ath12k_base *ab,
5658 static int ath12k_reg_chan_list_event(struct ath12k_base *ab, struct sk_buff *skb)
5672 ret = ath12k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info);
5675 ath12k_warn(ab, "failed to extract regulatory info from received event\n");
5684 ath12k_warn(ab, "Failed to set the requested Country regulatory setting\n");
5690 if (pdev_idx >= ab->num_radios) {
5695 if (ab->hw_params->single_pdev_only &&
5696 pdev_idx < ab->hw_params->num_rxmda_per_pdev)
5705 if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] &&
5706 !memcmp(ab->default_regd[pdev_idx]->alpha2,
5714 if (ab->default_regd[pdev_idx] &&
5716 ab->default_regd[pdev_idx]->alpha2) &&
5720 regd = ath12k_reg_build_regd(ab, reg_info, intersect);
5722 ath12k_warn(ab, "failed to build regd from reg_info\n");
5726 spin_lock(&ab->base_lock);
5727 if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) {
5735 ar = ab->pdevs[pdev_idx].ar;
5736 kfree(ab->new_regd[pdev_idx]);
5737 ab->new_regd[pdev_idx] = regd;
5738 queue_work(ab->workqueue, &ar->regd_update_work);
5745 kfree(ab->default_regd[pdev_idx]);
5747 ab->default_regd[pdev_idx] = regd;
5749 ab->dfs_region = reg_info->dfs_region;
5750 spin_unlock(&ab->base_lock);
5781 static int ath12k_wmi_rdy_parse(struct ath12k_base *ab, u16 tag, u16 len,
5796 ab->wlan_init_status = le32_to_cpu(fixed_param.ready_event_min.status);
5800 ether_addr_copy(ab->mac_addr,
5802 ab->pktlog_defs_checksum = le32_to_cpu(fixed_param.pktlog_defs_checksum);
5803 ab->wmi_ready = true;
5809 if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios))
5812 for (i = 0; i < ab->num_radios; i++) {
5813 pdev = &ab->pdevs[i];
5816 ab->pdevs_macaddr_valid = true;
5825 static int ath12k_ready_event(struct ath12k_base *ab, struct sk_buff *skb)
5830 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
5833 ath12k_warn(ab, "failed to parse tlv %d\n", ret);
5837 complete(&ab->wmi_ab.unified_ready);
5841 static void ath12k_peer_delete_resp_event(struct ath12k_base *ab, struct sk_buff *skb)
5846 if (ath12k_pull_peer_del_resp_ev(ab, skb, &peer_del_resp) != 0) {
5847 ath12k_warn(ab, "failed to extract peer delete resp");
5852 ar = ath12k_mac_get_ar_by_vdev_id(ab, le32_to_cpu(peer_del_resp.vdev_id));
5854 ath12k_warn(ab, "invalid vdev id in peer delete resp ev %d",
5862 ath12k_dbg(ab, ATH12K_DBG_WMI, "peer delete resp for vdev id %d addr %pM\n",
5866 static void ath12k_vdev_delete_resp_event(struct ath12k_base *ab,
5872 if (ath12k_pull_vdev_del_resp_ev(ab, skb, &vdev_id) != 0) {
5873 ath12k_warn(ab, "failed to extract vdev delete resp");
5878 ar = ath12k_mac_get_ar_by_vdev_id(ab, vdev_id);
5880 ath12k_warn(ab, "invalid vdev id in vdev delete resp ev %d",
5890 ath12k_dbg(ab, ATH12K_DBG_WMI, "vdev delete resp for vdev id %d\n",
5910 static void ath12k_vdev_start_resp_event(struct ath12k_base *ab, struct sk_buff *skb)
5916 if (ath12k_pull_vdev_start_resp_tlv(ab, skb, &vdev_start_resp) != 0) {
5917 ath12k_warn(ab, "failed to extract vdev start resp");
5922 ar = ath12k_mac_get_ar_by_vdev_id(ab, le32_to_cpu(vdev_start_resp.vdev_id));
5924 ath12k_warn(ab, "invalid vdev id in vdev start resp ev %d",
5935 ath12k_warn(ab, "vdev start resp error status %d (%s)\n",
5944 ath12k_dbg(ab, ATH12K_DBG_WMI, "vdev start resp for vdev id %d",
5948 static void ath12k_bcn_tx_status_event(struct ath12k_base *ab, struct sk_buff *skb)
5952 if (ath12k_pull_bcn_tx_status_ev(ab, skb, &vdev_id, &tx_status) != 0) {
5953 ath12k_warn(ab, "failed to extract bcn tx status");
5958 static void ath12k_vdev_stopped_event(struct ath12k_base *ab, struct sk_buff *skb)
5963 if (ath12k_pull_vdev_stopped_param_tlv(ab, skb, &vdev_id) != 0) {
5964 ath12k_warn(ab, "failed to extract vdev stopped event");
5969 ar = ath12k_mac_get_ar_by_vdev_id(ab, vdev_id);
5971 ath12k_warn(ab, "invalid vdev id in vdev stopped ev %d",
5981 ath12k_dbg(ab, ATH12K_DBG_WMI, "vdev stopped for vdev id %d", vdev_id);
5984 static void ath12k_mgmt_rx_event(struct ath12k_base *ab, struct sk_buff *skb)
5993 if (ath12k_pull_mgmt_rx_params_tlv(ab, skb, &rx_ev) != 0) {
5994 ath12k_warn(ab, "failed to extract mgmt rx event");
6001 ath12k_dbg(ab, ATH12K_DBG_MGMT, "mgmt rx event status %08x\n",
6005 ar = ath12k_mac_get_ar_by_pdev_id(ab, rx_ev.pdev_id);
6008 ath12k_warn(ab, "invalid pdev_id %d in mgmt_rx_event\n",
6042 ath12k_dbg(ab, ATH12K_DBG_WMI,
6078 ath12k_dbg(ab, ATH12K_DBG_MGMT,
6083 ath12k_dbg(ab, ATH12K_DBG_MGMT,
6094 static void ath12k_mgmt_tx_compl_event(struct ath12k_base *ab, struct sk_buff *skb)
6099 if (ath12k_pull_mgmt_tx_compl_param_tlv(ab, skb, &tx_compl_param) != 0) {
6100 ath12k_warn(ab, "failed to extract mgmt tx compl event");
6105 ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(tx_compl_param.pdev_id));
6107 ath12k_warn(ab, "invalid pdev id %d in mgmt_tx_compl_event\n",
6115 ath12k_dbg(ab, ATH12K_DBG_MGMT,
6124 static struct ath12k *ath12k_get_ar_on_scan_state(struct ath12k_base *ab,
6132 for (i = 0; i < ab->num_radios; i++) {
6133 pdev = rcu_dereference(ab->pdevs_active[i]);
6149 static void ath12k_scan_event(struct ath12k_base *ab, struct sk_buff *skb)
6154 if (ath12k_pull_scan_ev(ab, skb, &scan_ev) != 0) {
6155 ath12k_warn(ab, "failed to extract scan event");
6169 ar = ath12k_get_ar_on_scan_state(ab, le32_to_cpu(scan_ev.vdev_id),
6172 ar = ath12k_get_ar_on_scan_state(ab, le32_to_cpu(scan_ev.vdev_id),
6175 ar = ath12k_mac_get_ar_by_vdev_id(ab, le32_to_cpu(scan_ev.vdev_id));
6179 ath12k_warn(ab, "Received scan event for unknown vdev");
6186 ath12k_dbg(ab, ATH12K_DBG_WMI,
6212 ath12k_warn(ab, "received scan start failure event\n");
6230 static void ath12k_peer_sta_kickout_event(struct ath12k_base *ab, struct sk_buff *skb)
6237 if (ath12k_pull_peer_sta_kickout_ev(ab, skb, &arg) != 0) {
6238 ath12k_warn(ab, "failed to extract peer sta kickout event");
6244 spin_lock_bh(&ab->base_lock);
6246 peer = ath12k_peer_find_by_addr(ab, arg.mac_addr);
6249 ath12k_warn(ab, "peer not found %pM\n",
6254 ar = ath12k_mac_get_ar_by_vdev_id(ab, peer->vdev_id);
6256 ath12k_warn(ab, "invalid vdev id in peer sta kickout ev %d",
6264 ath12k_warn(ab, "Spurious quick kickout for STA %pM\n",
6269 ath12k_dbg(ab, ATH12K_DBG_WMI, "peer sta kickout event %pM",
6275 spin_unlock_bh(&ab->base_lock);
6279 static void ath12k_roam_event(struct ath12k_base *ab, struct sk_buff *skb)
6286 if (ath12k_pull_roam_ev(ab, skb, &roam_ev) != 0) {
6287 ath12k_warn(ab, "failed to extract roam event");
6295 ath12k_dbg(ab, ATH12K_DBG_WMI,
6300 ar = ath12k_mac_get_ar_by_vdev_id(ab, vdev_id);
6302 ath12k_warn(ab, "invalid vdev id in roam ev %d", vdev_id);
6308 ath12k_warn(ab, "ignoring unknown roam event reason %d on vdev %i\n",
6319 ath12k_warn(ab, "ignoring not implemented roam event reason %d on vdev %i\n",
6327 static void ath12k_chan_info_event(struct ath12k_base *ab, struct sk_buff *skb)
6334 u32 cc_freq_hz = ab->cc_freq_hz;
6336 if (ath12k_pull_chan_info_ev(ab, skb, &ch_info_ev) != 0) {
6337 ath12k_warn(ab, "failed to extract chan info event");
6341 ath12k_dbg(ab, ATH12K_DBG_WMI,
6349 ath12k_dbg(ab, ATH12K_DBG_WMI, "chan info report completed\n");
6354 ar = ath12k_mac_get_ar_by_vdev_id(ab, le32_to_cpu(ch_info_ev.vdev_id));
6356 ath12k_warn(ab, "invalid vdev id in chan info ev %d",
6366 ath12k_warn(ab, "received chan info event without a scan request, ignoring\n");
6375 ath12k_warn(ab, "chan info: invalid frequency %d (idx %d out of bounds)\n",
6402 ath12k_pdev_bss_chan_info_event(struct ath12k_base *ab, struct sk_buff *skb)
6407 u32 cc_freq_hz = ab->cc_freq_hz;
6411 if (ath12k_pull_pdev_bss_chan_info_ev(ab, skb, &bss_ch_info_ev) != 0) {
6412 ath12k_warn(ab, "failed to extract pdev bss chan info event");
6431 ath12k_dbg(ab, ATH12K_DBG_WMI,
6438 ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(bss_ch_info_ev.pdev_id));
6441 ath12k_warn(ab, "invalid pdev id %d in bss_chan_info event\n",
6450 ath12k_warn(ab, "bss chan info: invalid frequency %d (idx %d out of bounds)\n",
6474 static void ath12k_vdev_install_key_compl_event(struct ath12k_base *ab,
6480 if (ath12k_pull_vdev_install_key_compl_ev(ab, skb, &install_key_compl) != 0) {
6481 ath12k_warn(ab, "failed to extract install key compl event");
6485 ath12k_dbg(ab, ATH12K_DBG_WMI,
6491 ar = ath12k_mac_get_ar_by_vdev_id(ab, install_key_compl.vdev_id);
6493 ath12k_warn(ab, "invalid vdev id in install key compl ev %d",
6502 ath12k_warn(ab, "install key failed for %pM status %d\n",
6511 static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
6523 ath12k_warn(ab, "invalid length %d for the WMI services available tag 0x%x\n",
6537 set_bit(j, ab->wmi_ab.svc_map);
6541 ath12k_dbg(ab, ATH12K_DBG_WMI,
6556 set_bit(j, ab->wmi_ab.svc_map);
6560 ath12k_dbg(ab, ATH12K_DBG_WMI,
6569 static int ath12k_service_available_event(struct ath12k_base *ab, struct sk_buff *skb)
6573 ret = ath12k_wmi_tlv_iter(ab, skb->data, skb->len,
6579 static void ath12k_peer_assoc_conf_event(struct ath12k_base *ab, struct sk_buff *skb)
6584 if (ath12k_pull_peer_assoc_conf_ev(ab, skb, &peer_assoc_conf) != 0) {
6585 ath12k_warn(ab, "failed to extract peer assoc conf event");
6589 ath12k_dbg(ab, ATH12K_DBG_WMI,
6594 ar = ath12k_mac_get_ar_by_vdev_id(ab, peer_assoc_conf.vdev_id);
6597 ath12k_warn(ab, "invalid vdev id in peer assoc conf ev %d",
6607 static void ath12k_update_stats_event(struct ath12k_base *ab, struct sk_buff *skb)
6614 static void ath12k_pdev_ctl_failsafe_check_event(struct ath12k_base *ab,
6621 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6624 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
6630 ath12k_warn(ab, "failed to fetch pdev ctl failsafe check ev");
6635 ath12k_dbg(ab, ATH12K_DBG_WMI,
6643 ath12k_warn(ab, "pdev ctl failsafe failure status %d",
6650 ath12k_wmi_process_csa_switch_count_event(struct ath12k_base *ab,
6663 arvif = ath12k_mac_get_arvif_by_vdev_id(ab, vdev_ids[i]);
6666 ath12k_warn(ab, "Recvd csa status for unknown vdev %d",
6678 ath12k_wmi_pdev_csa_switch_count_status_event(struct ath12k_base *ab,
6686 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6689 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
6697 ath12k_warn(ab, "failed to fetch pdev csa switch count ev");
6702 ath12k_dbg(ab, ATH12K_DBG_WMI,
6707 ath12k_wmi_process_csa_switch_count_event(ab, ev, vdev_ids);
6713 ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff *skb)
6720 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6723 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
6730 ath12k_warn(ab, "failed to fetch pdev dfs radar detected ev");
6735 ath12k_dbg(ab, ATH12K_DBG_WMI,
6743 ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev->pdev_id));
6746 ath12k_warn(ab, "radar detected in invalid pdev %d\n",
6751 ath12k_dbg(ar->ab, ATH12K_DBG_REG, "DFS Radar Detected in pdev %d\n",
6755 ath12k_info(ab, "DFS Radar detected, but ignored as requested\n");
6766 ath12k_wmi_pdev_temperature_event(struct ath12k_base *ab,
6772 if (ath12k_pull_pdev_temp_ev(ab, skb, &ev) != 0) {
6773 ath12k_warn(ab, "failed to extract pdev temperature event");
6777 ath12k_dbg(ab, ATH12K_DBG_WMI,
6782 ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev.pdev_id));
6784 ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id);
6792 static void ath12k_fils_discovery_event(struct ath12k_base *ab,
6799 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6802 ath12k_warn(ab,
6810 ath12k_warn(ab, "failed to fetch FILS discovery event\n");
6815 ath12k_warn(ab,
6822 static void ath12k_probe_resp_tx_status_event(struct ath12k_base *ab,
6829 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6832 ath12k_warn(ab,
6840 ath12k_warn(ab,
6847 ath12k_warn(ab,
6854 static int ath12k_wmi_p2p_noa_event(struct ath12k_base *ab,
6863 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6866 ath12k_warn(ab, "failed to parse P2P NoA TLV: %d\n", ret);
6880 ath12k_dbg(ab, ATH12K_DBG_WMI,
6885 ar = ath12k_mac_get_ar_by_vdev_id(ab, vdev_id);
6887 ath12k_warn(ab, "invalid vdev id %d in P2P NoA event\n",
6904 static void ath12k_rfkill_state_change_event(struct ath12k_base *ab,
6911 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6914 ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
6924 ath12k_dbg(ab, ATH12K_DBG_MAC,
6930 spin_lock_bh(&ab->base_lock);
6931 ab->rfkill_radio_on = (ev->radio_state == cpu_to_le32(WMI_RFKILL_RADIO_STATE_ON));
6932 spin_unlock_bh(&ab->base_lock);
6934 queue_work(ab->workqueue, &ab->rfkill_work);
6939 ath12k_wmi_diag_event(struct ath12k_base *ab, struct sk_buff *skb)
6941 trace_ath12k_wmi_diag(ab, skb->data, skb->len);
6944 static void ath12k_wmi_twt_enable_event(struct ath12k_base *ab,
6951 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6954 ath12k_warn(ab, "failed to parse wmi twt enable status event tlv: %d\n",
6961 ath12k_warn(ab, "failed to fetch twt enable wmi event\n");
6965 ath12k_dbg(ab, ATH12K_DBG_MAC, "wmi twt enable event pdev id %u status %u\n",
6973 static void ath12k_wmi_twt_disable_event(struct ath12k_base *ab,
6980 tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
6983 ath12k_warn(ab, "failed to parse wmi twt disable status event tlv: %d\n",
6990 ath12k_warn(ab, "failed to fetch twt disable wmi event\n");
6994 ath12k_dbg(ab, ATH12K_DBG_MAC, "wmi twt disable event pdev id %d status %u\n",
7002 static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb)
7016 ath12k_service_ready_event(ab, skb);
7019 ath12k_service_ready_ext_event(ab, skb);
7022 ath12k_service_ready_ext2_event(ab, skb);
7025 ath12k_reg_chan_list_event(ab, skb);
7028 ath12k_ready_event(ab, skb);
7031 ath12k_peer_delete_resp_event(ab, skb);
7034 ath12k_vdev_start_resp_event(ab, skb);
7037 ath12k_bcn_tx_status_event(ab, skb);
7040 ath12k_vdev_stopped_event(ab, skb);
7043 ath12k_mgmt_rx_event(ab, skb);
7047 ath12k_mgmt_tx_compl_event(ab, skb);
7050 ath12k_scan_event(ab, skb);
7053 ath12k_peer_sta_kickout_event(ab, skb);
7056 ath12k_roam_event(ab, skb);
7059 ath12k_chan_info_event(ab, skb);
7062 ath12k_pdev_bss_chan_info_event(ab, skb);
7065 ath12k_vdev_install_key_compl_event(ab, skb);
7068 ath12k_service_available_event(ab, skb);
7071 ath12k_peer_assoc_conf_event(ab, skb);
7074 ath12k_update_stats_event(ab, skb);
7077 ath12k_pdev_ctl_failsafe_check_event(ab, skb);
7080 ath12k_wmi_pdev_csa_switch_count_status_event(ab, skb);
7083 ath12k_wmi_pdev_temperature_event(ab, skb);
7086 ath12k_wmi_pdev_dma_ring_buf_release_event(ab, skb);
7089 ath12k_fils_discovery_event(ab, skb);
7092 ath12k_probe_resp_tx_status_event(ab, skb);
7095 ath12k_rfkill_state_change_event(ab, skb);
7098 ath12k_wmi_twt_enable_event(ab, skb);
7101 ath12k_wmi_twt_disable_event(ab, skb);
7104 ath12k_wmi_p2p_noa_event(ab, skb);
7110 ath12k_dbg(ab, ATH12K_DBG_WMI,
7114 ath12k_wmi_pdev_dfs_radar_detected_event(ab, skb);
7117 ath12k_vdev_delete_resp_event(ab, skb);
7120 ath12k_wmi_diag_event(ab, skb);
7124 ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id);
7132 static int ath12k_connect_pdev_htc_service(struct ath12k_base *ab,
7150 status = ath12k_htc_connect_service(&ab->htc, &conn_req, &conn_resp);
7152 ath12k_warn(ab, "failed to connect to WMI CONTROL service status: %d\n",
7157 ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid;
7158 ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid;
7159 ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len;
7206 ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
7214 ath12k_warn(ar->ab, "failed to send WMI_UNIT_TEST CMD :%d\n",
7252 ath12k_dbg(ar->ab, ATH12K_DBG_REG, "Triggering Radar Simulation\n");
7257 int ath12k_wmi_connect(struct ath12k_base *ab)
7262 wmi_ep_count = ab->htc.wmi_ep_count;
7263 if (wmi_ep_count > ab->hw_params->max_radios)
7267 ath12k_connect_pdev_htc_service(ab, i);
7272 static void ath12k_wmi_pdev_detach(struct ath12k_base *ab, u8 pdev_id)
7280 int ath12k_wmi_pdev_attach(struct ath12k_base *ab,
7285 if (pdev_id >= ab->hw_params->max_radios)
7288 wmi_handle = &ab->wmi_ab.wmi[pdev_id];
7290 wmi_handle->wmi_ab = &ab->wmi_ab;
7292 ab->wmi_ab.ab = ab;
7298 int ath12k_wmi_attach(struct ath12k_base *ab)
7302 ret = ath12k_wmi_pdev_attach(ab, 0);
7306 ab->wmi_ab.ab = ab;
7307 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_MAX;
7310 if (ab->hw_params->single_pdev_only)
7311 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_SINGLE;
7314 init_completion(&ab->wmi_ab.service_ready);
7315 init_completion(&ab->wmi_ab.unified_ready);
7320 void ath12k_wmi_detach(struct ath12k_base *ab)
7326 for (i = 0; i < ab->htc.wmi_ep_count; i++)
7327 ath12k_wmi_pdev_detach(ab, i);
7329 ath12k_wmi_free_dbring_caps(ab);