Lines Matching full:ab

148 ath11k_wmi_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len,  in ath11k_wmi_tlv_iter()  argument
149 int (*iter)(struct ath11k_base *ab, u16 tag, u16 len, in ath11k_wmi_tlv_iter() argument
160 ath11k_err(ab, "wmi tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath11k_wmi_tlv_iter()
172 ath11k_err(ab, "wmi tlv parse failure of tag %u at byte %zd (%zu bytes left, %u expected)\n", in ath11k_wmi_tlv_iter()
180 …ath11k_err(ab, "wmi tlv parse failure of tag %u at byte %zd (%u bytes is less than min length %zu)… in ath11k_wmi_tlv_iter()
186 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath11k_wmi_tlv_iter()
197 static int ath11k_wmi_tlv_iter_parse(struct ath11k_base *ab, u16 tag, u16 len, in ath11k_wmi_tlv_iter_parse() argument
216 ath11k_wmi_tlv_parse_alloc(struct ath11k_base *ab, const void *ptr, in ath11k_wmi_tlv_parse_alloc() argument
226 ret = ath11k_wmi_tlv_parse(ab, tb, ptr, len); in ath11k_wmi_tlv_parse_alloc()
239 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_cmd_send_nowait() local
253 ret = ath11k_htc_send(&ab->htc, wmi->eid, skb); in ath11k_wmi_cmd_send_nowait()
276 if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH, &wmi_sc->ab->dev_flags)) in ath11k_wmi_cmd_send()
283 ath11k_warn(wmi_sc->ab, "wmi command %d timeout\n", cmd_id); in ath11k_wmi_cmd_send()
454 static int ath11k_pull_service_ready_tlv(struct ath11k_base *ab, in ath11k_pull_service_ready_tlv() argument
461 ath11k_err(ab, "%s: failed by NULL param\n", in ath11k_pull_service_ready_tlv()
504 static int ath11k_wmi_tlv_svc_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len, in ath11k_wmi_tlv_svc_rdy_parse() argument
508 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_parse()
513 if (ath11k_pull_service_ready_tlv(ab, ptr, &ab->target_caps)) in ath11k_wmi_tlv_svc_rdy_parse()
521 ath11k_warn(ab, "invalid len %d for the tag 0x%x\n", in ath11k_wmi_tlv_svc_rdy_parse()
538 static int ath11k_service_ready_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_service_ready_event() argument
543 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_event()
547 ath11k_warn(ab, "failed to parse tlv %d\n", ret); in ath11k_service_ready_event()
557 struct ath11k_base *ab = wmi_sc->ab; in ath11k_wmi_alloc_skb() local
560 skb = ath11k_htc_alloc_skb(ab, WMI_SKB_HEADROOM + round_len); in ath11k_wmi_alloc_skb()
566 ath11k_warn(ab, "unaligned WMI skb data\n"); in ath11k_wmi_alloc_skb()
615 ath11k_warn(ar->ab, in ath11k_wmi_mgmt_send()
687 ath11k_warn(ar->ab, in ath11k_wmi_vdev_create()
692 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_create()
718 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_DELETE_CMDID\n"); in ath11k_wmi_vdev_delete()
722 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "WMI vdev delete id %d\n", vdev_id); in ath11k_wmi_vdev_delete()
746 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_STOP cmd\n"); in ath11k_wmi_vdev_stop()
750 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "WMI vdev stop id 0x%x\n", vdev_id); in ath11k_wmi_vdev_stop()
774 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_DOWN cmd\n"); in ath11k_wmi_vdev_down()
778 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "WMI vdev down id 0x%x\n", vdev_id); in ath11k_wmi_vdev_down()
899 ath11k_warn(ar->ab, "failed to submit vdev_%s cmd\n", in ath11k_wmi_vdev_start()
904 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "vdev %s id 0x%x freq 0x%x mode 0x%x\n", in ath11k_wmi_vdev_start()
933 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_UP cmd\n"); in ath11k_wmi_vdev_up()
937 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_up()
966 ath11k_warn(ar->ab, "failed to submit WMI_PEER_CREATE cmd\n"); in ath11k_wmi_send_peer_create_cmd()
970 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_create_cmd()
996 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_delete_cmd()
1002 ath11k_warn(ar->ab, "failed to send WMI_PEER_DELETE cmd\n"); in ath11k_wmi_send_peer_delete_cmd()
1034 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_pdev_set_regdomain()
1041 ath11k_warn(ar->ab, in ath11k_wmi_send_pdev_set_regdomain()
1071 ath11k_warn(ar->ab, "failed to send WMI_PEER_SET_PARAM cmd\n"); in ath11k_wmi_set_peer_param()
1075 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_set_peer_param()
1105 ath11k_warn(ar->ab, in ath11k_wmi_send_peer_flush_tids_cmd()
1110 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_flush_tids_cmd()
1148 ath11k_warn(ar->ab, in ath11k_wmi_peer_rx_reorder_queue_setup()
1153 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_peer_rx_reorder_queue_setup()
1182 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_rx_reord_queue_remove()
1189 ath11k_warn(ar->ab, in ath11k_wmi_rx_reord_queue_remove()
1218 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath11k_wmi_pdev_set_param()
1222 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_param()
1248 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath11k_wmi_pdev_set_ps_mode()
1252 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_ps_mode()
1281 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SUSPEND cmd\n"); in ath11k_wmi_pdev_suspend()
1285 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_suspend()
1308 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_resume()
1313 ath11k_warn(ar->ab, "failed to send WMI_PDEV_RESUME cmd\n"); in ath11k_wmi_pdev_resume()
1343 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_bss_chan_info_request()
1349 ath11k_warn(ar->ab, in ath11k_wmi_pdev_bss_chan_info_request()
1380 ath11k_warn(ar->ab, in ath11k_wmi_send_set_ap_ps_param_cmd()
1385 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_set_ap_ps_param_cmd()
1413 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_set_sta_ps_param()
1419 ath11k_warn(ar->ab, "failed to send WMI_STA_POWERSAVE_PARAM_CMDID"); in ath11k_wmi_set_sta_ps_param()
1449 ath11k_warn(ar->ab, "Failed to send WMI_FORCE_FW_HANG_CMDID"); in ath11k_wmi_force_fw_hang_cmd()
1477 ath11k_warn(ar->ab, in ath11k_wmi_vdev_set_param_cmd()
1482 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_set_param_cmd()
1511 ath11k_warn(ar->ab, "failed to send WMI_REQUEST_STATS cmd\n"); in ath11k_wmi_send_stats_request_cmd()
1515 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_stats_request_cmd()
1540 ath11k_warn(ar->ab, "failed to send WMI_PDEV_GET_TEMPERATURE cmd\n"); in ath11k_wmi_send_pdev_temperature_cmd()
1544 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_pdev_temperature_cmd()
1570 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bcn_offload_control_cmd()
1576 ath11k_warn(ar->ab, in ath11k_wmi_send_bcn_offload_control_cmd()
1631 ath11k_warn(ar->ab, "failed to send WMI_BCN_TMPL_CMDID\n"); in ath11k_wmi_bcn_tmpl()
1677 ath11k_warn(ar->ab, in ath11k_wmi_vdev_install_key()
1682 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_install_key()
1816 &ar->ab->dev_flags)); in ath11k_wmi_send_peer_assoc_cmd()
1913 ath11k_warn(ar->ab, in ath11k_wmi_send_peer_assoc_cmd()
1918 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_assoc_cmd()
2219 ath11k_warn(ar->ab, "failed to send WMI_START_SCAN_CMDID\n"); in ath11k_wmi_send_scan_start_cmd()
2258 ath11k_warn(ar->ab, "invalid scan cancel param %d", in ath11k_wmi_send_scan_stop_cmd()
2267 ath11k_warn(ar->ab, "failed to send WMI_STOP_SCAN_CMDID\n"); in ath11k_wmi_send_scan_stop_cmd()
2314 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_scan_chan_list_cmd()
2369 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_scan_chan_list_cmd()
2380 ath11k_warn(ar->ab, "failed to send WMI_SCAN_CHAN_LIST cmd\n"); in ath11k_wmi_send_scan_chan_list_cmd()
2443 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_wmm_update_cmd_tlv()
2452 ath11k_warn(ar->ab, in ath11k_wmi_send_wmm_update_cmd_tlv()
2480 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2486 ath11k_warn(ar->ab, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2515 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_delba_send()
2522 ath11k_warn(ar->ab, in ath11k_wmi_delba_send()
2551 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_set_resp()
2558 ath11k_warn(ar->ab, in ath11k_wmi_addba_set_resp()
2586 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_send()
2593 ath11k_warn(ar->ab, in ath11k_wmi_addba_send()
2619 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_clear_resp()
2626 ath11k_warn(ar->ab, in ath11k_wmi_addba_clear_resp()
2675 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_peer_pktlog_filter()
2727 ath11k_warn(ar->ab, in ath11k_wmi_send_init_country_cmd()
2788 ath11k_warn(ar->ab, "failed to send THERM_THROT_SET_CONF cmd\n"); in ath11k_wmi_send_thermal_mitigation_param_cmd()
2792 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_thermal_mitigation_param_cmd()
2823 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_enable()
2851 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_disable()
2862 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_enable_cmd() local
2903 ath11k_warn(ab, "Failed to send WMI_TWT_ENABLE_CMDID"); in ath11k_wmi_send_twt_enable_cmd()
2913 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_disable_cmd() local
2932 ath11k_warn(ab, "Failed to send WMI_TWT_DISABLE_CMDID"); in ath11k_wmi_send_twt_disable_cmd()
2943 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_spr_cmd() local
2966 ath11k_warn(ab, in ath11k_wmi_send_obss_spr_cmd()
2977 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_bss_color_bitmap() local
2995 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3002 ath11k_warn(ab, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3014 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap() local
3033 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3040 ath11k_warn(ab, in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3052 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap() local
3071 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3078 ath11k_warn(ab, in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3090 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap() local
3109 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3116 ath11k_warn(ab, in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3128 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap() local
3147 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3154 ath11k_warn(ab, in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3166 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap() local
3185 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3192 ath11k_warn(ab, in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3206 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_color_collision_cfg_cmd() local
3230 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3238 ath11k_warn(ab, "Failed to send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID"); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3248 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_bss_color_change_enable_cmd() local
3265 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bss_color_change_enable_cmd()
3272 ath11k_warn(ab, "Failed to send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID"); in ath11k_wmi_send_bss_color_change_enable_cmd()
3291 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery_tmpl()
3313 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery_tmpl()
3332 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_probe_resp_tmpl()
3366 ath11k_warn(ar->ab, in ath11k_wmi_probe_resp_tmpl()
3381 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery()
3401 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery()
3508 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_init_cmd_send() local
3559 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_init_cmd_send()
3612 ath11k_warn(ab, "failed to send WMI_INIT_CMDID\n"); in ath11k_init_cmd_send()
3641 ath11k_warn(ar->ab, in ath11k_wmi_pdev_lro_cfg()
3646 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_lro_cfg()
3654 int ath11k_wmi_wait_for_service_ready(struct ath11k_base *ab) in ath11k_wmi_wait_for_service_ready() argument
3658 time_left = wait_for_completion_timeout(&ab->wmi_ab.service_ready, in ath11k_wmi_wait_for_service_ready()
3666 int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *ab) in ath11k_wmi_wait_for_unified_ready() argument
3670 time_left = wait_for_completion_timeout(&ab->wmi_ab.unified_ready, in ath11k_wmi_wait_for_unified_ready()
3678 int ath11k_wmi_set_hw_mode(struct ath11k_base *ab, in ath11k_wmi_set_hw_mode() argument
3683 struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab; in ath11k_wmi_set_hw_mode()
3703 ath11k_warn(ab, "failed to send WMI_PDEV_SET_HW_MODE_CMDID\n"); in ath11k_wmi_set_hw_mode()
3710 int ath11k_wmi_cmd_init(struct ath11k_base *ab) in ath11k_wmi_cmd_init() argument
3712 struct ath11k_wmi_base *wmi_sc = &ab->wmi_ab; in ath11k_wmi_cmd_init()
3719 ab->hw_params.hw_ops->wmi_init_config(ab, &config); in ath11k_wmi_cmd_init()
3728 if (ab->hw_params.single_pdev_only) in ath11k_wmi_cmd_init()
3731 init_param.num_band_to_mac = ab->num_radios; in ath11k_wmi_cmd_init()
3732 ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac); in ath11k_wmi_cmd_init()
3758 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_conf()
3763 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_conf()
3796 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_enable()
3801 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_enable()
3842 ath11k_warn(ar->ab, in ath11k_wmi_pdev_dma_ring_cfg()
3847 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_dma_ring_cfg()
3889 static int ath11k_wmi_tlv_dma_buf_parse(struct ath11k_base *ab, in ath11k_wmi_tlv_dma_buf_parse() argument
3907 ret = ath11k_wmi_tlv_iter(ab, ptr, len, in ath11k_wmi_tlv_dma_buf_parse()
3911 ath11k_warn(ab, "failed to parse dma buf entry tlv %d\n", in ath11k_wmi_tlv_dma_buf_parse()
3921 ret = ath11k_wmi_tlv_iter(ab, ptr, len, in ath11k_wmi_tlv_dma_buf_parse()
3925 ath11k_warn(ab, "failed to parse dma buf meta tlv %d\n", in ath11k_wmi_tlv_dma_buf_parse()
3939 static void ath11k_wmi_pdev_dma_ring_buf_release_event(struct ath11k_base *ab, in ath11k_wmi_pdev_dma_ring_buf_release_event() argument
3946 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pdev_dma_ring_buf_release_event()
3950 ath11k_warn(ab, "failed to parse dma buf release tlv %d\n", ret); in ath11k_wmi_pdev_dma_ring_buf_release_event()
3960 ret = ath11k_dbring_buffer_release_event(ab, &param); in ath11k_wmi_pdev_dma_ring_buf_release_event()
3962 ath11k_warn(ab, "failed to handle dma buf release event %d\n", ret); in ath11k_wmi_pdev_dma_ring_buf_release_event()
4179 static int ath11k_wmi_alloc_dbring_caps(struct ath11k_base *ab, in ath11k_wmi_alloc_dbring_caps() argument
4190 ab->db_caps = ptr; in ath11k_wmi_alloc_dbring_caps()
4191 ab->num_db_cap = num_cap; in ath11k_wmi_alloc_dbring_caps()
4196 static void ath11k_wmi_free_dbring_caps(struct ath11k_base *ab) in ath11k_wmi_free_dbring_caps() argument
4198 kfree(ab->db_caps); in ath11k_wmi_free_dbring_caps()
4199 ab->db_caps = NULL; in ath11k_wmi_free_dbring_caps()
4202 static int ath11k_wmi_tlv_dma_ring_caps(struct ath11k_base *ab, in ath11k_wmi_tlv_dma_ring_caps() argument
4213 ret = ath11k_wmi_tlv_iter(ab, ptr, len, in ath11k_wmi_tlv_dma_ring_caps()
4217 ath11k_warn(ab, "failed to parse dma ring caps tlv %d\n", ret); in ath11k_wmi_tlv_dma_ring_caps()
4224 if (ab->num_db_cap) { in ath11k_wmi_tlv_dma_ring_caps()
4225 ath11k_warn(ab, "Already processed, so ignoring dma ring caps\n"); in ath11k_wmi_tlv_dma_ring_caps()
4229 ret = ath11k_wmi_alloc_dbring_caps(ab, dma_caps_parse->n_dma_ring_caps); in ath11k_wmi_tlv_dma_ring_caps()
4233 dir_buff_caps = ab->db_caps; in ath11k_wmi_tlv_dma_ring_caps()
4236 ath11k_warn(ab, "Invalid module id %d\n", dma_caps[i].module_id); in ath11k_wmi_tlv_dma_ring_caps()
4251 ath11k_wmi_free_dbring_caps(ab); in ath11k_wmi_tlv_dma_ring_caps()
4255 static int ath11k_wmi_tlv_svc_rdy_ext_parse(struct ath11k_base *ab, in ath11k_wmi_tlv_svc_rdy_ext_parse() argument
4259 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4268 ath11k_warn(ab, "unable to extract ext params\n"); in ath11k_wmi_tlv_svc_rdy_ext_parse()
4279 ret = ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse(ab, len, ptr, in ath11k_wmi_tlv_svc_rdy_ext_parse()
4287 ret = ath11k_wmi_tlv_hw_mode_caps(ab, len, ptr, in ath11k_wmi_tlv_svc_rdy_ext_parse()
4295 ret = ath11k_wmi_tlv_iter(ab, ptr, len, in ath11k_wmi_tlv_svc_rdy_ext_parse()
4299 ath11k_warn(ab, "failed to parse tlv %d\n", ret); in ath11k_wmi_tlv_svc_rdy_ext_parse()
4305 ret = ath11k_wmi_tlv_ext_hal_reg_caps(ab, len, ptr, in ath11k_wmi_tlv_svc_rdy_ext_parse()
4318 ret = ath11k_wmi_tlv_dma_ring_caps(ab, len, ptr, in ath11k_wmi_tlv_svc_rdy_ext_parse()
4333 static int ath11k_service_ready_ext_event(struct ath11k_base *ab, in ath11k_service_ready_ext_event() argument
4339 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext_event()
4343 ath11k_warn(ab, "failed to parse tlv %d\n", ret); in ath11k_service_ready_ext_event()
4347 if (!test_bit(WMI_TLV_SERVICE_EXT2_MSG, ab->wmi_ab.svc_map)) in ath11k_service_ready_ext_event()
4348 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext_event()
4354 ath11k_wmi_free_dbring_caps(ab); in ath11k_service_ready_ext_event()
4358 static int ath11k_wmi_tlv_svc_rdy_ext2_parse(struct ath11k_base *ab, in ath11k_wmi_tlv_svc_rdy_ext2_parse() argument
4368 ret = ath11k_wmi_tlv_dma_ring_caps(ab, len, ptr, in ath11k_wmi_tlv_svc_rdy_ext2_parse()
4383 static int ath11k_service_ready_ext2_event(struct ath11k_base *ab, in ath11k_service_ready_ext2_event() argument
4389 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext2_event()
4393 ath11k_warn(ab, "failed to parse ext2 event tlv %d\n", ret); in ath11k_service_ready_ext2_event()
4397 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext2_event()
4402 ath11k_wmi_free_dbring_caps(ab); in ath11k_service_ready_ext2_event()
4406 static int ath11k_pull_vdev_start_resp_tlv(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_vdev_start_resp_tlv() argument
4413 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_start_resp_tlv()
4416 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_vdev_start_resp_tlv()
4422 ath11k_warn(ab, "failed to fetch vdev start resp ev"); in ath11k_pull_vdev_start_resp_tlv()
4480 static int ath11k_pull_reg_chan_list_update_ev(struct ath11k_base *ab, in ath11k_pull_reg_chan_list_update_ev() argument
4490 ath11k_dbg(ab, ATH11K_DBG_WMI, "processing regulatory channel list\n"); in ath11k_pull_reg_chan_list_update_ev()
4492 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_reg_chan_list_update_ev()
4495 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_reg_chan_list_update_ev()
4501 ath11k_warn(ab, "failed to fetch reg chan list update ev\n"); in ath11k_pull_reg_chan_list_update_ev()
4510 ath11k_warn(ab, "No regulatory rules available in the event info\n"); in ath11k_pull_reg_chan_list_update_ev()
4544 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_pull_reg_chan_list_update_ev()
4550 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_pull_reg_chan_list_update_ev()
4564 ath11k_warn(ab, "Unable to Allocate memory for 2g rules\n"); in ath11k_pull_reg_chan_list_update_ev()
4575 ath11k_warn(ab, "Unable to Allocate memory for 5g rules\n"); in ath11k_pull_reg_chan_list_update_ev()
4580 ath11k_dbg(ab, ATH11K_DBG_WMI, "processed regulatory channel list\n"); in ath11k_pull_reg_chan_list_update_ev()
4586 static int ath11k_pull_peer_del_resp_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_peer_del_resp_ev() argument
4593 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_peer_del_resp_ev()
4596 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_peer_del_resp_ev()
4602 ath11k_warn(ab, "failed to fetch peer delete resp ev"); in ath11k_pull_peer_del_resp_ev()
4617 static int ath11k_pull_vdev_del_resp_ev(struct ath11k_base *ab, in ath11k_pull_vdev_del_resp_ev() argument
4625 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_del_resp_ev()
4628 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_vdev_del_resp_ev()
4634 ath11k_warn(ab, "failed to fetch vdev delete resp ev"); in ath11k_pull_vdev_del_resp_ev()
4645 static int ath11k_pull_bcn_tx_status_ev(struct ath11k_base *ab, void *evt_buf, in ath11k_pull_bcn_tx_status_ev() argument
4653 tb = ath11k_wmi_tlv_parse_alloc(ab, evt_buf, len, GFP_ATOMIC); in ath11k_pull_bcn_tx_status_ev()
4656 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_bcn_tx_status_ev()
4662 ath11k_warn(ab, "failed to fetch bcn tx status ev"); in ath11k_pull_bcn_tx_status_ev()
4674 static int ath11k_pull_vdev_stopped_param_tlv(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_vdev_stopped_param_tlv() argument
4681 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_stopped_param_tlv()
4684 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_vdev_stopped_param_tlv()
4690 ath11k_warn(ab, "failed to fetch vdev stop ev"); in ath11k_pull_vdev_stopped_param_tlv()
4701 static int ath11k_pull_mgmt_rx_params_tlv(struct ath11k_base *ab, in ath11k_pull_mgmt_rx_params_tlv() argument
4710 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_mgmt_rx_params_tlv()
4713 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_mgmt_rx_params_tlv()
4721 ath11k_warn(ab, "failed to fetch mgmt rx hdr"); in ath11k_pull_mgmt_rx_params_tlv()
4740 ath11k_warn(ab, "invalid length in mgmt rx hdr ev"); in ath11k_pull_mgmt_rx_params_tlv()
4768 ath11k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n", in wmi_process_mgmt_tx_comp()
4778 dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); in wmi_process_mgmt_tx_comp()
4793 static int ath11k_pull_mgmt_tx_compl_param_tlv(struct ath11k_base *ab, in ath11k_pull_mgmt_tx_compl_param_tlv() argument
4801 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_mgmt_tx_compl_param_tlv()
4804 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_mgmt_tx_compl_param_tlv()
4810 ath11k_warn(ab, "failed to fetch mgmt tx compl ev"); in ath11k_pull_mgmt_tx_compl_param_tlv()
4831 ath11k_warn(ar->ab, "received scan started event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_started()
4850 ath11k_warn(ar->ab, "received scan start failed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_start_failed()
4876 ath11k_warn(ar->ab, "received scan completed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_completed()
4894 ath11k_warn(ar->ab, "received scan bss chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_bss_chan()
4912 ath11k_warn(ar->ab, "received scan foreign chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_foreign_chan()
4965 static int ath11k_pull_scan_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_scan_ev() argument
4972 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_scan_ev()
4975 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_scan_ev()
4981 ath11k_warn(ab, "failed to fetch scan ev"); in ath11k_pull_scan_ev()
4998 static int ath11k_pull_peer_sta_kickout_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_peer_sta_kickout_ev() argument
5005 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_peer_sta_kickout_ev()
5008 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_peer_sta_kickout_ev()
5014 ath11k_warn(ab, "failed to fetch peer sta kickout ev"); in ath11k_pull_peer_sta_kickout_ev()
5025 static int ath11k_pull_roam_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_roam_ev() argument
5032 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_roam_ev()
5035 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_roam_ev()
5041 ath11k_warn(ab, "failed to fetch roam ev"); in ath11k_pull_roam_ev()
5073 static int ath11k_pull_chan_info_ev(struct ath11k_base *ab, u8 *evt_buf, in ath11k_pull_chan_info_ev() argument
5080 tb = ath11k_wmi_tlv_parse_alloc(ab, evt_buf, len, GFP_ATOMIC); in ath11k_pull_chan_info_ev()
5083 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_chan_info_ev()
5089 ath11k_warn(ab, "failed to fetch chan info ev"); in ath11k_pull_chan_info_ev()
5112 ath11k_pull_pdev_bss_chan_info_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_pdev_bss_chan_info_ev() argument
5119 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_pdev_bss_chan_info_ev()
5122 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_pdev_bss_chan_info_ev()
5128 ath11k_warn(ab, "failed to fetch pdev bss chan info ev"); in ath11k_pull_pdev_bss_chan_info_ev()
5152 ath11k_pull_vdev_install_key_compl_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_vdev_install_key_compl_ev() argument
5159 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_install_key_compl_ev()
5162 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_vdev_install_key_compl_ev()
5168 ath11k_warn(ab, "failed to fetch vdev install key compl ev"); in ath11k_pull_vdev_install_key_compl_ev()
5183 static int ath11k_pull_peer_assoc_conf_ev(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_pull_peer_assoc_conf_ev() argument
5190 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_peer_assoc_conf_ev()
5193 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pull_peer_assoc_conf_ev()
5199 ath11k_warn(ab, "failed to fetch peer assoc conf ev"); in ath11k_pull_peer_assoc_conf_ev()
5312 int ath11k_wmi_pull_fw_stats(struct ath11k_base *ab, struct sk_buff *skb, in ath11k_wmi_pull_fw_stats() argument
5321 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, len, GFP_ATOMIC); in ath11k_wmi_pull_fw_stats()
5324 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_wmi_pull_fw_stats()
5331 ath11k_warn(ab, "failed to fetch update stats ev"); in ath11k_wmi_pull_fw_stats()
5336 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_wmi_pull_fw_stats()
5666 ath11k_warn(ar->ab, "invalid vdev id %d in bcn stats", in ath11k_wmi_fw_bcn_stats_fill()
5705 ath11k_warn(ar->ab, "failed to get pdev stats\n"); in ath11k_wmi_fw_stats_fill()
5747 static void ath11k_wmi_op_ep_tx_credits(struct ath11k_base *ab) in ath11k_wmi_op_ep_tx_credits() argument
5750 wake_up(&ab->wmi_ab.tx_credits_wq); in ath11k_wmi_op_ep_tx_credits()
5753 static void ath11k_wmi_htc_tx_complete(struct ath11k_base *ab, in ath11k_wmi_htc_tx_complete() argument
5764 static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_reg_chan_list_event() argument
5778 ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info); in ath11k_reg_chan_list_event()
5780 ath11k_warn(ab, "failed to extract regulatory info from received event\n"); in ath11k_reg_chan_list_event()
5789 ath11k_warn(ab, "Failed to set the requested Country regulatory setting\n"); in ath11k_reg_chan_list_event()
5795 if (pdev_idx >= ab->num_radios) { in ath11k_reg_chan_list_event()
5800 if (ab->hw_params.single_pdev_only && in ath11k_reg_chan_list_event()
5801 pdev_idx < ab->hw_params.num_rxmda_per_pdev) in ath11k_reg_chan_list_event()
5810 if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] && in ath11k_reg_chan_list_event()
5811 !memcmp((char *)ab->default_regd[pdev_idx]->alpha2, in ath11k_reg_chan_list_event()
5819 if (ab->default_regd[pdev_idx] && in ath11k_reg_chan_list_event()
5821 ab->default_regd[pdev_idx]->alpha2) && in ath11k_reg_chan_list_event()
5825 regd = ath11k_reg_build_regd(ab, reg_info, intersect); in ath11k_reg_chan_list_event()
5827 ath11k_warn(ab, "failed to build regd from reg_info\n"); in ath11k_reg_chan_list_event()
5831 spin_lock(&ab->base_lock); in ath11k_reg_chan_list_event()
5832 if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) { in ath11k_reg_chan_list_event()
5840 ar = ab->pdevs[pdev_idx].ar; in ath11k_reg_chan_list_event()
5841 kfree(ab->new_regd[pdev_idx]); in ath11k_reg_chan_list_event()
5842 ab->new_regd[pdev_idx] = regd; in ath11k_reg_chan_list_event()
5850 kfree(ab->default_regd[pdev_idx]); in ath11k_reg_chan_list_event()
5852 ab->default_regd[pdev_idx] = regd; in ath11k_reg_chan_list_event()
5854 ab->dfs_region = reg_info->dfs_region; in ath11k_reg_chan_list_event()
5855 spin_unlock(&ab->base_lock); in ath11k_reg_chan_list_event()
5878 static int ath11k_wmi_tlv_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len, in ath11k_wmi_tlv_rdy_parse() argument
5893 ab->wlan_init_status = fixed_param.ready_event_min.status; in ath11k_wmi_tlv_rdy_parse()
5897 ether_addr_copy(ab->mac_addr, in ath11k_wmi_tlv_rdy_parse()
5899 ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; in ath11k_wmi_tlv_rdy_parse()
5900 ab->wmi_ready = true; in ath11k_wmi_tlv_rdy_parse()
5906 if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) in ath11k_wmi_tlv_rdy_parse()
5909 for (i = 0; i < ab->num_radios; i++) { in ath11k_wmi_tlv_rdy_parse()
5910 pdev = &ab->pdevs[i]; in ath11k_wmi_tlv_rdy_parse()
5913 ab->pdevs_macaddr_valid = true; in ath11k_wmi_tlv_rdy_parse()
5922 static int ath11k_ready_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_ready_event() argument
5927 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_ready_event()
5930 ath11k_warn(ab, "failed to parse tlv %d\n", ret); in ath11k_ready_event()
5934 complete(&ab->wmi_ab.unified_ready); in ath11k_ready_event()
5938 static void ath11k_peer_delete_resp_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_peer_delete_resp_event() argument
5943 if (ath11k_pull_peer_del_resp_ev(ab, skb, &peer_del_resp) != 0) { in ath11k_peer_delete_resp_event()
5944 ath11k_warn(ab, "failed to extract peer delete resp"); in ath11k_peer_delete_resp_event()
5949 ar = ath11k_mac_get_ar_by_vdev_id(ab, peer_del_resp.vdev_id); in ath11k_peer_delete_resp_event()
5951 ath11k_warn(ab, "invalid vdev id in peer delete resp ev %d", in ath11k_peer_delete_resp_event()
5959 ath11k_dbg(ab, ATH11K_DBG_WMI, "peer delete resp for vdev id %d addr %pM\n", in ath11k_peer_delete_resp_event()
5963 static void ath11k_vdev_delete_resp_event(struct ath11k_base *ab, in ath11k_vdev_delete_resp_event() argument
5969 if (ath11k_pull_vdev_del_resp_ev(ab, skb, &vdev_id) != 0) { in ath11k_vdev_delete_resp_event()
5970 ath11k_warn(ab, "failed to extract vdev delete resp"); in ath11k_vdev_delete_resp_event()
5975 ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_id); in ath11k_vdev_delete_resp_event()
5977 ath11k_warn(ab, "invalid vdev id in vdev delete resp ev %d", in ath11k_vdev_delete_resp_event()
5987 ath11k_dbg(ab, ATH11K_DBG_WMI, "vdev delete resp for vdev id %d\n", in ath11k_vdev_delete_resp_event()
6007 static void ath11k_vdev_start_resp_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_vdev_start_resp_event() argument
6013 if (ath11k_pull_vdev_start_resp_tlv(ab, skb, &vdev_start_resp) != 0) { in ath11k_vdev_start_resp_event()
6014 ath11k_warn(ab, "failed to extract vdev start resp"); in ath11k_vdev_start_resp_event()
6019 ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_start_resp.vdev_id); in ath11k_vdev_start_resp_event()
6021 ath11k_warn(ab, "invalid vdev id in vdev start resp ev %d", in ath11k_vdev_start_resp_event()
6032 ath11k_warn(ab, "vdev start resp error status %d (%s)\n", in ath11k_vdev_start_resp_event()
6041 ath11k_dbg(ab, ATH11K_DBG_WMI, "vdev start resp for vdev id %d", in ath11k_vdev_start_resp_event()
6045 static void ath11k_bcn_tx_status_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_bcn_tx_status_event() argument
6049 if (ath11k_pull_bcn_tx_status_ev(ab, skb->data, skb->len, in ath11k_bcn_tx_status_event()
6051 ath11k_warn(ab, "failed to extract bcn tx status"); in ath11k_bcn_tx_status_event()
6056 static void ath11k_vdev_stopped_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_vdev_stopped_event() argument
6061 if (ath11k_pull_vdev_stopped_param_tlv(ab, skb, &vdev_id) != 0) { in ath11k_vdev_stopped_event()
6062 ath11k_warn(ab, "failed to extract vdev stopped event"); in ath11k_vdev_stopped_event()
6067 ar = ath11k_mac_get_ar_by_vdev_id(ab, vdev_id); in ath11k_vdev_stopped_event()
6069 ath11k_warn(ab, "invalid vdev id in vdev stopped ev %d", in ath11k_vdev_stopped_event()
6079 ath11k_dbg(ab, ATH11K_DBG_WMI, "vdev stopped for vdev id %d", vdev_id); in ath11k_vdev_stopped_event()
6082 static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_mgmt_rx_event() argument
6091 if (ath11k_pull_mgmt_rx_params_tlv(ab, skb, &rx_ev) != 0) { in ath11k_mgmt_rx_event()
6092 ath11k_warn(ab, "failed to extract mgmt rx event"); in ath11k_mgmt_rx_event()
6099 ath11k_dbg(ab, ATH11K_DBG_MGMT, "mgmt rx event status %08x\n", in ath11k_mgmt_rx_event()
6103 ar = ath11k_mac_get_ar_by_pdev_id(ab, rx_ev.pdev_id); in ath11k_mgmt_rx_event()
6106 ath11k_warn(ab, "invalid pdev_id %d in mgmt_rx_event\n", in ath11k_mgmt_rx_event()
6139 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_mgmt_rx_event()
6177 ath11k_dbg(ab, ATH11K_DBG_MGMT, in ath11k_mgmt_rx_event()
6182 ath11k_dbg(ab, ATH11K_DBG_MGMT, in ath11k_mgmt_rx_event()
6193 static void ath11k_mgmt_tx_compl_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_mgmt_tx_compl_event() argument
6198 if (ath11k_pull_mgmt_tx_compl_param_tlv(ab, skb, &tx_compl_param) != 0) { in ath11k_mgmt_tx_compl_event()
6199 ath11k_warn(ab, "failed to extract mgmt tx compl event"); in ath11k_mgmt_tx_compl_event()
6204 ar = ath11k_mac_get_ar_by_pdev_id(ab, tx_compl_param.pdev_id); in ath11k_mgmt_tx_compl_event()
6206 ath11k_warn(ab, "invalid pdev id %d in mgmt_tx_compl_event\n", in ath11k_mgmt_tx_compl_event()
6214 ath11k_dbg(ab, ATH11K_DBG_MGMT, in ath11k_mgmt_tx_compl_event()
6223 static struct ath11k *ath11k_get_ar_on_scan_abort(struct ath11k_base *ab, in ath11k_get_ar_on_scan_abort() argument
6230 for (i = 0; i < ab->num_radios; i++) { in ath11k_get_ar_on_scan_abort()
6231 pdev = rcu_dereference(ab->pdevs_active[i]); in ath11k_get_ar_on_scan_abort()
6247 static void ath11k_scan_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_scan_event() argument
6252 if (ath11k_pull_scan_ev(ab, skb, &scan_ev) != 0) { in ath11k_scan_event()
6253 ath11k_warn(ab, "failed to extract scan event"); in ath11k_scan_event()
6267 ar = ath11k_get_ar_on_scan_abort(ab, scan_ev.vdev_id); in ath11k_scan_event()
6269 ar = ath11k_mac_get_ar_by_vdev_id(ab, scan_ev.vdev_id); in ath11k_scan_event()
6272 ath11k_warn(ab, "Received scan event for unknown vdev"); in ath11k_scan_event()
6279 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_scan_event()
6300 ath11k_warn(ab, "received scan start failure event\n"); in ath11k_scan_event()
6316 static void ath11k_peer_sta_kickout_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_peer_sta_kickout_event() argument
6323 if (ath11k_pull_peer_sta_kickout_ev(ab, skb, &arg) != 0) { in ath11k_peer_sta_kickout_event()
6324 ath11k_warn(ab, "failed to extract peer sta kickout event"); in ath11k_peer_sta_kickout_event()
6330 spin_lock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
6332 peer = ath11k_peer_find_by_addr(ab, arg.mac_addr); in ath11k_peer_sta_kickout_event()
6335 ath11k_warn(ab, "peer not found %pM\n", in ath11k_peer_sta_kickout_event()
6340 ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); in ath11k_peer_sta_kickout_event()
6342 ath11k_warn(ab, "invalid vdev id in peer sta kickout ev %d", in ath11k_peer_sta_kickout_event()
6350 ath11k_warn(ab, "Spurious quick kickout for STA %pM\n", in ath11k_peer_sta_kickout_event()
6355 ath11k_dbg(ab, ATH11K_DBG_WMI, "peer sta kickout event %pM", in ath11k_peer_sta_kickout_event()
6361 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
6365 static void ath11k_roam_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_roam_event() argument
6370 if (ath11k_pull_roam_ev(ab, skb, &roam_ev) != 0) { in ath11k_roam_event()
6371 ath11k_warn(ab, "failed to extract roam event"); in ath11k_roam_event()
6375 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_roam_event()
6380 ar = ath11k_mac_get_ar_by_vdev_id(ab, roam_ev.vdev_id); in ath11k_roam_event()
6382 ath11k_warn(ab, "invalid vdev id in roam ev %d", in ath11k_roam_event()
6389 ath11k_warn(ab, "ignoring unknown roam event reason %d on vdev %i\n", in ath11k_roam_event()
6400 ath11k_warn(ab, "ignoring not implemented roam event reason %d on vdev %i\n", in ath11k_roam_event()
6408 static void ath11k_chan_info_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_chan_info_event() argument
6415 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_chan_info_event()
6417 if (ath11k_pull_chan_info_ev(ab, skb->data, skb->len, &ch_info_ev) != 0) { in ath11k_chan_info_event()
6418 ath11k_warn(ab, "failed to extract chan info event"); in ath11k_chan_info_event()
6422 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_chan_info_event()
6430 ath11k_dbg(ab, ATH11K_DBG_WMI, "chan info report completed\n"); in ath11k_chan_info_event()
6435 ar = ath11k_mac_get_ar_by_vdev_id(ab, ch_info_ev.vdev_id); in ath11k_chan_info_event()
6437 ath11k_warn(ab, "invalid vdev id in chan info ev %d", in ath11k_chan_info_event()
6447 ath11k_warn(ab, "received chan info event without a scan request, ignoring\n"); in ath11k_chan_info_event()
6456 ath11k_warn(ab, "chan info: invalid frequency %d (idx %d out of bounds)\n", in ath11k_chan_info_event()
6482 ath11k_pdev_bss_chan_info_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_pdev_bss_chan_info_event() argument
6487 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_pdev_bss_chan_info_event()
6491 if (ath11k_pull_pdev_bss_chan_info_ev(ab, skb, &bss_ch_info_ev) != 0) { in ath11k_pdev_bss_chan_info_event()
6492 ath11k_warn(ab, "failed to extract pdev bss chan info event"); in ath11k_pdev_bss_chan_info_event()
6511 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_pdev_bss_chan_info_event()
6518 ar = ath11k_mac_get_ar_by_pdev_id(ab, bss_ch_info_ev.pdev_id); in ath11k_pdev_bss_chan_info_event()
6521 ath11k_warn(ab, "invalid pdev id %d in bss_chan_info event\n", in ath11k_pdev_bss_chan_info_event()
6530 ath11k_warn(ab, "bss chan info: invalid frequency %d (idx %d out of bounds)\n", in ath11k_pdev_bss_chan_info_event()
6554 static void ath11k_vdev_install_key_compl_event(struct ath11k_base *ab, in ath11k_vdev_install_key_compl_event() argument
6560 if (ath11k_pull_vdev_install_key_compl_ev(ab, skb, &install_key_compl) != 0) { in ath11k_vdev_install_key_compl_event()
6561 ath11k_warn(ab, "failed to extract install key compl event"); in ath11k_vdev_install_key_compl_event()
6565 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_vdev_install_key_compl_event()
6571 ar = ath11k_mac_get_ar_by_vdev_id(ab, install_key_compl.vdev_id); in ath11k_vdev_install_key_compl_event()
6573 ath11k_warn(ab, "invalid vdev id in install key compl ev %d", in ath11k_vdev_install_key_compl_event()
6582 ath11k_warn(ab, "install key failed for %pM status %d\n", in ath11k_vdev_install_key_compl_event()
6591 static void ath11k_service_available_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_service_available_event() argument
6598 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_service_available_event()
6601 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_service_available_event()
6607 ath11k_warn(ab, "failed to fetch svc available ev"); in ath11k_service_available_event()
6622 set_bit(j, ab->wmi_ab.svc_map); in ath11k_service_available_event()
6626 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_service_available_event()
6634 static void ath11k_peer_assoc_conf_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_peer_assoc_conf_event() argument
6639 if (ath11k_pull_peer_assoc_conf_ev(ab, skb, &peer_assoc_conf) != 0) { in ath11k_peer_assoc_conf_event()
6640 ath11k_warn(ab, "failed to extract peer assoc conf event"); in ath11k_peer_assoc_conf_event()
6644 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_peer_assoc_conf_event()
6649 ar = ath11k_mac_get_ar_by_vdev_id(ab, peer_assoc_conf.vdev_id); in ath11k_peer_assoc_conf_event()
6652 ath11k_warn(ab, "invalid vdev id in peer assoc conf ev %d", in ath11k_peer_assoc_conf_event()
6662 static void ath11k_update_stats_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_update_stats_event() argument
6664 ath11k_debugfs_fw_stats_process(ab, skb); in ath11k_update_stats_event()
6670 static void ath11k_pdev_ctl_failsafe_check_event(struct ath11k_base *ab, in ath11k_pdev_ctl_failsafe_check_event() argument
6677 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pdev_ctl_failsafe_check_event()
6680 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_pdev_ctl_failsafe_check_event()
6686 ath11k_warn(ab, "failed to fetch pdev ctl failsafe check ev"); in ath11k_pdev_ctl_failsafe_check_event()
6691 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_pdev_ctl_failsafe_check_event()
6699 ath11k_warn(ab, "pdev ctl failsafe failure status %d", in ath11k_pdev_ctl_failsafe_check_event()
6706 ath11k_wmi_process_csa_switch_count_event(struct ath11k_base *ab, in ath11k_wmi_process_csa_switch_count_event() argument
6719 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, vdev_ids[i]); in ath11k_wmi_process_csa_switch_count_event()
6722 ath11k_warn(ab, "Recvd csa status for unknown vdev %d", in ath11k_wmi_process_csa_switch_count_event()
6734 ath11k_wmi_pdev_csa_switch_count_status_event(struct ath11k_base *ab, in ath11k_wmi_pdev_csa_switch_count_status_event() argument
6742 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_pdev_csa_switch_count_status_event()
6745 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_wmi_pdev_csa_switch_count_status_event()
6753 ath11k_warn(ab, "failed to fetch pdev csa switch count ev"); in ath11k_wmi_pdev_csa_switch_count_status_event()
6758 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_csa_switch_count_status_event()
6763 ath11k_wmi_process_csa_switch_count_event(ab, ev, vdev_ids); in ath11k_wmi_pdev_csa_switch_count_status_event()
6769 ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_wmi_pdev_dfs_radar_detected_event() argument
6776 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_pdev_dfs_radar_detected_event()
6779 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_wmi_pdev_dfs_radar_detected_event()
6786 ath11k_warn(ab, "failed to fetch pdev dfs radar detected ev"); in ath11k_wmi_pdev_dfs_radar_detected_event()
6791 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_dfs_radar_detected_event()
6797 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
6800 ath11k_warn(ab, "radar detected in invalid pdev %d\n", in ath11k_wmi_pdev_dfs_radar_detected_event()
6805 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "DFS Radar Detected in pdev %d\n", in ath11k_wmi_pdev_dfs_radar_detected_event()
6809 ath11k_info(ab, "DFS Radar detected, but ignored as requested\n"); in ath11k_wmi_pdev_dfs_radar_detected_event()
6818 ath11k_wmi_pdev_temperature_event(struct ath11k_base *ab, in ath11k_wmi_pdev_temperature_event() argument
6826 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_pdev_temperature_event()
6829 ath11k_warn(ab, "failed to parse tlv: %d\n", ret); in ath11k_wmi_pdev_temperature_event()
6835 ath11k_warn(ab, "failed to fetch pdev temp ev"); in ath11k_wmi_pdev_temperature_event()
6840 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_temperature_event()
6843 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
6845 ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
6855 static void ath11k_fils_discovery_event(struct ath11k_base *ab, in ath11k_fils_discovery_event() argument
6862 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_fils_discovery_event()
6865 ath11k_warn(ab, in ath11k_fils_discovery_event()
6873 ath11k_warn(ab, "failed to fetch FILS discovery event\n"); in ath11k_fils_discovery_event()
6878 ath11k_warn(ab, in ath11k_fils_discovery_event()
6885 static void ath11k_probe_resp_tx_status_event(struct ath11k_base *ab, in ath11k_probe_resp_tx_status_event() argument
6892 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_probe_resp_tx_status_event()
6895 ath11k_warn(ab, in ath11k_probe_resp_tx_status_event()
6903 ath11k_warn(ab, in ath11k_probe_resp_tx_status_event()
6910 ath11k_warn(ab, in ath11k_probe_resp_tx_status_event()
6917 static int ath11k_wmi_tlv_wow_wakeup_host_parse(struct ath11k_base *ab, in ath11k_wmi_tlv_wow_wakeup_host_parse() argument
6928 ath11k_dbg(ab, ATH11K_DBG_WMI, "wow wakeup host reason %d %s\n", in ath11k_wmi_tlv_wow_wakeup_host_parse()
6938 ath11k_dbg(ab, ATH11K_DBG_WMI, "wow data_len = %d\n", in ath11k_wmi_tlv_wow_wakeup_host_parse()
6940 ath11k_dbg_dump(ab, ATH11K_DBG_WMI, in ath11k_wmi_tlv_wow_wakeup_host_parse()
6954 static void ath11k_wmi_event_wow_wakeup_host(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_wmi_event_wow_wakeup_host() argument
6959 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_event_wow_wakeup_host()
6963 ath11k_warn(ab, "failed to parse wmi wow tlv: %d\n", ret); in ath11k_wmi_event_wow_wakeup_host()
6967 complete(&ab->wow.wakeup_completed); in ath11k_wmi_event_wow_wakeup_host()
6970 static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_wmi_tlv_op_rx() argument
6984 ath11k_service_ready_event(ab, skb); in ath11k_wmi_tlv_op_rx()
6987 ath11k_service_ready_ext_event(ab, skb); in ath11k_wmi_tlv_op_rx()
6990 ath11k_service_ready_ext2_event(ab, skb); in ath11k_wmi_tlv_op_rx()
6993 ath11k_reg_chan_list_event(ab, skb); in ath11k_wmi_tlv_op_rx()
6996 ath11k_ready_event(ab, skb); in ath11k_wmi_tlv_op_rx()
6999 ath11k_peer_delete_resp_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7002 ath11k_vdev_start_resp_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7005 ath11k_bcn_tx_status_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7008 ath11k_vdev_stopped_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7011 ath11k_mgmt_rx_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7015 ath11k_mgmt_tx_compl_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7018 ath11k_scan_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7021 ath11k_peer_sta_kickout_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7024 ath11k_roam_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7027 ath11k_chan_info_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7030 ath11k_pdev_bss_chan_info_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7033 ath11k_vdev_install_key_compl_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7036 ath11k_service_available_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7039 ath11k_peer_assoc_conf_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7042 ath11k_update_stats_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7045 ath11k_pdev_ctl_failsafe_check_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7048 ath11k_wmi_pdev_csa_switch_count_status_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7051 ath11k_wmi_pdev_temperature_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7054 ath11k_wmi_pdev_dma_ring_buf_release_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7057 ath11k_fils_discovery_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7060 ath11k_probe_resp_tx_status_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7068 ath11k_dbg(ab, ATH11K_DBG_WMI, in ath11k_wmi_tlv_op_rx()
7072 ath11k_wmi_pdev_dfs_radar_detected_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7075 ath11k_vdev_delete_resp_event(ab, skb); in ath11k_wmi_tlv_op_rx()
7078 ath11k_wmi_event_wow_wakeup_host(ab, skb); in ath11k_wmi_tlv_op_rx()
7082 ath11k_dbg(ab, ATH11K_DBG_WMI, "Unknown eventid: 0x%x\n", id); in ath11k_wmi_tlv_op_rx()
7090 static int ath11k_connect_pdev_htc_service(struct ath11k_base *ab, in ath11k_connect_pdev_htc_service() argument
7112 status = ath11k_htc_connect_service(&ab->htc, &conn_req, &conn_resp); in ath11k_connect_pdev_htc_service()
7114 ath11k_warn(ab, "failed to connect to WMI CONTROL service status: %d\n", in ath11k_connect_pdev_htc_service()
7119 ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid; in ath11k_connect_pdev_htc_service()
7120 ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid; in ath11k_connect_pdev_htc_service()
7121 ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len; in ath11k_connect_pdev_htc_service()
7172 ath11k_warn(ar->ab, "failed to send WMI_UNIT_TEST CMD :%d\n", in ath11k_wmi_send_unit_test_cmd()
7177 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_unit_test_cmd()
7215 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "Triggering Radar Simulation\n"); in ath11k_wmi_simulate_radar()
7220 int ath11k_wmi_connect(struct ath11k_base *ab) in ath11k_wmi_connect() argument
7225 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_connect()
7226 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_connect()
7230 ath11k_connect_pdev_htc_service(ab, i); in ath11k_wmi_connect()
7235 static void ath11k_wmi_pdev_detach(struct ath11k_base *ab, u8 pdev_id) in ath11k_wmi_pdev_detach() argument
7243 int ath11k_wmi_pdev_attach(struct ath11k_base *ab, in ath11k_wmi_pdev_attach() argument
7248 if (pdev_id >= ab->hw_params.max_radios) in ath11k_wmi_pdev_attach()
7251 wmi_handle = &ab->wmi_ab.wmi[pdev_id]; in ath11k_wmi_pdev_attach()
7253 wmi_handle->wmi_ab = &ab->wmi_ab; in ath11k_wmi_pdev_attach()
7255 ab->wmi_ab.ab = ab; in ath11k_wmi_pdev_attach()
7261 int ath11k_wmi_attach(struct ath11k_base *ab) in ath11k_wmi_attach() argument
7265 ret = ath11k_wmi_pdev_attach(ab, 0); in ath11k_wmi_attach()
7269 ab->wmi_ab.ab = ab; in ath11k_wmi_attach()
7270 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_MAX; in ath11k_wmi_attach()
7273 if (ab->hw_params.single_pdev_only) in ath11k_wmi_attach()
7274 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_SINGLE; in ath11k_wmi_attach()
7277 init_completion(&ab->wmi_ab.service_ready); in ath11k_wmi_attach()
7278 init_completion(&ab->wmi_ab.unified_ready); in ath11k_wmi_attach()
7283 void ath11k_wmi_detach(struct ath11k_base *ab) in ath11k_wmi_detach() argument
7289 for (i = 0; i < ab->htc.wmi_ep_count; i++) in ath11k_wmi_detach()
7290 ath11k_wmi_pdev_detach(ab, i); in ath11k_wmi_detach()
7292 ath11k_wmi_free_dbring_caps(ab); in ath11k_wmi_detach()
7311 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "wmi tlv wow host wakeup ind\n"); in ath11k_wmi_wow_host_wakeup_ind()
7333 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "wmi tlv wow enable\n"); in ath11k_wmi_wow_enable()