Lines Matching +full:use +full:- +full:sw +full:- +full:pm
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
215 ptr - begin, len, sizeof(*tlv)); in ath11k_wmi_tlv_iter()
216 return -EINVAL; in ath11k_wmi_tlv_iter()
224 tlv_tag = FIELD_GET(WMI_TLV_TAG, tlv->header); in ath11k_wmi_tlv_iter()
225 tlv_len = FIELD_GET(WMI_TLV_LEN, tlv->header); in ath11k_wmi_tlv_iter()
227 len -= sizeof(*tlv); in ath11k_wmi_tlv_iter()
231 tlv_tag, ptr - begin, len, tlv_len); in ath11k_wmi_tlv_iter()
232 return -EINVAL; in ath11k_wmi_tlv_iter()
239 tlv_tag, ptr - begin, tlv_len, in ath11k_wmi_tlv_iter()
241 return -EINVAL; in ath11k_wmi_tlv_iter()
253 len -= tlv_len; in ath11k_wmi_tlv_iter()
285 return ERR_PTR(-ENOMEM); in ath11k_wmi_tlv_parse_alloc()
300 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_cmd_send_nowait()
306 return -ENOMEM; in ath11k_wmi_cmd_send_nowait()
310 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath11k_wmi_cmd_send_nowait()
311 cmd_hdr->cmd_id = cmd; in ath11k_wmi_cmd_send_nowait()
313 trace_ath11k_wmi_cmd(ab, cmd_id, skb->data, skb->len); in ath11k_wmi_cmd_send_nowait()
316 ret = ath11k_htc_send(&ab->htc, wmi->eid, skb); in ath11k_wmi_cmd_send_nowait()
331 struct ath11k_wmi_base *wmi_sc = wmi->wmi_ab; in ath11k_wmi_cmd_send()
332 int ret = -EOPNOTSUPP; in ath11k_wmi_cmd_send()
333 struct ath11k_base *ab = wmi_sc->ab; in ath11k_wmi_cmd_send()
337 if (ab->hw_params.credit_flow) { in ath11k_wmi_cmd_send()
338 wait_event_timeout(wmi_sc->tx_credits_wq, ({ in ath11k_wmi_cmd_send()
342 &wmi_sc->ab->dev_flags)) in ath11k_wmi_cmd_send()
343 ret = -ESHUTDOWN; in ath11k_wmi_cmd_send()
345 (ret != -EAGAIN); in ath11k_wmi_cmd_send()
348 wait_event_timeout(wmi->tx_ce_desc_wq, ({ in ath11k_wmi_cmd_send()
352 &wmi_sc->ab->dev_flags)) in ath11k_wmi_cmd_send()
353 ret = -ESHUTDOWN; in ath11k_wmi_cmd_send()
355 (ret != -ENOBUFS); in ath11k_wmi_cmd_send()
359 if (ret == -EAGAIN) in ath11k_wmi_cmd_send()
360 ath11k_warn(wmi_sc->ab, "wmi command %d timeout\n", cmd_id); in ath11k_wmi_cmd_send()
362 if (ret == -ENOBUFS) in ath11k_wmi_cmd_send()
363 ath11k_warn(wmi_sc->ab, "ce desc not available for wmi command %d\n", in ath11k_wmi_cmd_send()
376 return -EINVAL; in ath11k_pull_svc_ready_ext()
379 param->default_conc_scan_config_bits = ev->default_conc_scan_config_bits; in ath11k_pull_svc_ready_ext()
380 param->default_fw_config_bits = ev->default_fw_config_bits; in ath11k_pull_svc_ready_ext()
381 param->he_cap_info = ev->he_cap_info; in ath11k_pull_svc_ready_ext()
382 param->mpdu_density = ev->mpdu_density; in ath11k_pull_svc_ready_ext()
383 param->max_bssid_rx_filters = ev->max_bssid_rx_filters; in ath11k_pull_svc_ready_ext()
384 memcpy(¶m->ppet, &ev->ppet, sizeof(param->ppet)); in ath11k_pull_svc_ready_ext()
405 struct ath11k_base *ab = wmi_handle->wmi_ab->ab; in ath11k_pull_mac_phy_cap_svc_ready_ext()
407 struct ath11k_pdev_cap *pdev_cap = &pdev->cap; in ath11k_pull_mac_phy_cap_svc_ready_ext()
412 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
414 for (hw_idx = 0; hw_idx < hw_caps->num_hw_modes; hw_idx++) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
425 if (hw_idx == hw_caps->num_hw_modes) in ath11k_pull_mac_phy_cap_svc_ready_ext()
426 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
429 if (phy_id >= hal_reg_caps->num_phy) in ath11k_pull_mac_phy_cap_svc_ready_ext()
430 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
434 pdev->pdev_id = mac_phy_caps->pdev_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
435 pdev_cap->supported_bands |= mac_phy_caps->supported_bands; in ath11k_pull_mac_phy_cap_svc_ready_ext()
436 pdev_cap->ampdu_density = mac_phy_caps->ampdu_density; in ath11k_pull_mac_phy_cap_svc_ready_ext()
437 ab->target_pdev_ids[ab->target_pdev_count].supported_bands = in ath11k_pull_mac_phy_cap_svc_ready_ext()
438 mac_phy_caps->supported_bands; in ath11k_pull_mac_phy_cap_svc_ready_ext()
439 ab->target_pdev_ids[ab->target_pdev_count].pdev_id = mac_phy_caps->pdev_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
440 ab->target_pdev_count++; in ath11k_pull_mac_phy_cap_svc_ready_ext()
442 if (!(mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) && in ath11k_pull_mac_phy_cap_svc_ready_ext()
443 !(mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP)) in ath11k_pull_mac_phy_cap_svc_ready_ext()
444 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
446 /* Take non-zero tx/rx chainmask. If tx/rx chainmask differs from in ath11k_pull_mac_phy_cap_svc_ready_ext()
450 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
451 pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
452 pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
455 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
456 pdev_cap->vht_cap = mac_phy_caps->vht_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
457 pdev_cap->vht_mcs = mac_phy_caps->vht_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
458 pdev_cap->he_mcs = mac_phy_caps->he_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
459 pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
460 pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
461 pdev_cap->nss_ratio_enabled = in ath11k_pull_mac_phy_cap_svc_ready_ext()
462 WMI_NSS_RATIO_ENABLE_DISABLE_GET(mac_phy_caps->nss_ratio); in ath11k_pull_mac_phy_cap_svc_ready_ext()
463 pdev_cap->nss_ratio_info = in ath11k_pull_mac_phy_cap_svc_ready_ext()
464 WMI_NSS_RATIO_INFO_GET(mac_phy_caps->nss_ratio); in ath11k_pull_mac_phy_cap_svc_ready_ext()
469 * mac and the remaining 4 chains can be used for the second mac or vice-versa. in ath11k_pull_mac_phy_cap_svc_ready_ext()
471 * will be advertised for second mac or vice-versa. Compute the shift value in ath11k_pull_mac_phy_cap_svc_ready_ext()
475 pdev_cap->tx_chain_mask_shift = in ath11k_pull_mac_phy_cap_svc_ready_ext()
476 find_first_bit((unsigned long *)&pdev_cap->tx_chain_mask, 32); in ath11k_pull_mac_phy_cap_svc_ready_ext()
477 pdev_cap->rx_chain_mask_shift = in ath11k_pull_mac_phy_cap_svc_ready_ext()
478 find_first_bit((unsigned long *)&pdev_cap->rx_chain_mask, 32); in ath11k_pull_mac_phy_cap_svc_ready_ext()
480 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
481 cap_band = &pdev_cap->band[NL80211_BAND_2GHZ]; in ath11k_pull_mac_phy_cap_svc_ready_ext()
482 cap_band->phy_id = mac_phy_caps->phy_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
483 cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
484 cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
485 cap_band->he_cap_info[0] = mac_phy_caps->he_cap_info_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
486 cap_band->he_cap_info[1] = mac_phy_caps->he_cap_info_2g_ext; in ath11k_pull_mac_phy_cap_svc_ready_ext()
487 cap_band->he_mcs = mac_phy_caps->he_supp_mcs_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
488 memcpy(cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_2g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
490 memcpy(&cap_band->he_ppet, &mac_phy_caps->he_ppet2g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
494 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
495 cap_band = &pdev_cap->band[NL80211_BAND_5GHZ]; in ath11k_pull_mac_phy_cap_svc_ready_ext()
496 cap_band->phy_id = mac_phy_caps->phy_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
497 cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
498 cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
499 cap_band->he_cap_info[0] = mac_phy_caps->he_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
500 cap_band->he_cap_info[1] = mac_phy_caps->he_cap_info_5g_ext; in ath11k_pull_mac_phy_cap_svc_ready_ext()
501 cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
502 memcpy(cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
504 memcpy(&cap_band->he_ppet, &mac_phy_caps->he_ppet5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
507 cap_band = &pdev_cap->band[NL80211_BAND_6GHZ]; in ath11k_pull_mac_phy_cap_svc_ready_ext()
508 cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
509 cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
510 cap_band->he_cap_info[0] = mac_phy_caps->he_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
511 cap_band->he_cap_info[1] = mac_phy_caps->he_cap_info_5g_ext; in ath11k_pull_mac_phy_cap_svc_ready_ext()
512 cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
513 memcpy(cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
515 memcpy(&cap_band->he_ppet, &mac_phy_caps->he_ppet5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
541 return -EINVAL; in ath11k_pull_reg_cap_svc_rdy_ext()
543 if (phy_idx >= reg_caps->num_phy) in ath11k_pull_reg_cap_svc_rdy_ext()
544 return -EINVAL; in ath11k_pull_reg_cap_svc_rdy_ext()
548 param->phy_id = ext_reg_cap->phy_id; in ath11k_pull_reg_cap_svc_rdy_ext()
549 param->eeprom_reg_domain = ext_reg_cap->eeprom_reg_domain; in ath11k_pull_reg_cap_svc_rdy_ext()
550 param->eeprom_reg_domain_ext = in ath11k_pull_reg_cap_svc_rdy_ext()
551 ext_reg_cap->eeprom_reg_domain_ext; in ath11k_pull_reg_cap_svc_rdy_ext()
552 param->regcap1 = ext_reg_cap->regcap1; in ath11k_pull_reg_cap_svc_rdy_ext()
553 param->regcap2 = ext_reg_cap->regcap2; in ath11k_pull_reg_cap_svc_rdy_ext()
554 /* check if param->wireless_mode is needed */ in ath11k_pull_reg_cap_svc_rdy_ext()
555 param->low_2ghz_chan = ext_reg_cap->low_2ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
556 param->high_2ghz_chan = ext_reg_cap->high_2ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
557 param->low_5ghz_chan = ext_reg_cap->low_5ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
558 param->high_5ghz_chan = ext_reg_cap->high_5ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
572 return -EINVAL; in ath11k_pull_service_ready_tlv()
575 cap->phy_capability = ev->phy_capability; in ath11k_pull_service_ready_tlv()
576 cap->max_frag_entry = ev->max_frag_entry; in ath11k_pull_service_ready_tlv()
577 cap->num_rf_chains = ev->num_rf_chains; in ath11k_pull_service_ready_tlv()
578 cap->ht_cap_info = ev->ht_cap_info; in ath11k_pull_service_ready_tlv()
579 cap->vht_cap_info = ev->vht_cap_info; in ath11k_pull_service_ready_tlv()
580 cap->vht_supp_mcs = ev->vht_supp_mcs; in ath11k_pull_service_ready_tlv()
581 cap->hw_min_tx_power = ev->hw_min_tx_power; in ath11k_pull_service_ready_tlv()
582 cap->hw_max_tx_power = ev->hw_max_tx_power; in ath11k_pull_service_ready_tlv()
583 cap->sys_cap_info = ev->sys_cap_info; in ath11k_pull_service_ready_tlv()
584 cap->min_pkt_size_enable = ev->min_pkt_size_enable; in ath11k_pull_service_ready_tlv()
585 cap->max_bcn_ie_size = ev->max_bcn_ie_size; in ath11k_pull_service_ready_tlv()
586 cap->max_num_scan_channels = ev->max_num_scan_channels; in ath11k_pull_service_ready_tlv()
587 cap->max_supported_macs = ev->max_supported_macs; in ath11k_pull_service_ready_tlv()
588 cap->wmi_fw_sub_feat_caps = ev->wmi_fw_sub_feat_caps; in ath11k_pull_service_ready_tlv()
589 cap->txrx_chainmask = ev->txrx_chainmask; in ath11k_pull_service_ready_tlv()
590 cap->default_dbs_hw_mode_index = ev->default_dbs_hw_mode_index; in ath11k_pull_service_ready_tlv()
591 cap->num_msdu_desc = ev->num_msdu_desc; in ath11k_pull_service_ready_tlv()
597 * wmi_service ready event are advertised in b0-b3 (LSB 4-bits) of each
598 * 4-byte word.
608 set_bit(j, wmi->wmi_ab->svc_map); in ath11k_wmi_service_bitmap_copy()
617 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_parse()
622 if (ath11k_pull_service_ready_tlv(ab, ptr, &ab->target_caps)) in ath11k_wmi_tlv_svc_rdy_parse()
623 return -EINVAL; in ath11k_wmi_tlv_svc_rdy_parse()
627 if (!svc_ready->wmi_svc_bitmap_done) { in ath11k_wmi_tlv_svc_rdy_parse()
632 return -EINVAL; in ath11k_wmi_tlv_svc_rdy_parse()
637 svc_ready->wmi_svc_bitmap_done = true; in ath11k_wmi_tlv_svc_rdy_parse()
652 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_event()
668 struct ath11k_base *ab = wmi_sc->ab; in ath11k_wmi_alloc_skb()
676 if (!IS_ALIGNED((unsigned long)skb->data, 4)) in ath11k_wmi_alloc_skb()
680 memset(skb->data, 0, round_len); in ath11k_wmi_alloc_skb()
688 struct ath11k_base *ab = ar->ab; in ath11k_wmi_mgmt_get_freq()
691 if (ab->hw_params.support_off_channel_tx && in ath11k_wmi_mgmt_get_freq()
692 ar->scan.is_roc && in ath11k_wmi_mgmt_get_freq()
693 (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)) in ath11k_wmi_mgmt_get_freq()
694 freq = ar->scan.roc_freq; in ath11k_wmi_mgmt_get_freq()
702 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_mgmt_send()
710 buf_len = frame->len < WMI_MGMT_SEND_DOWNLD_LEN ? in ath11k_wmi_mgmt_send()
711 frame->len : WMI_MGMT_SEND_DOWNLD_LEN; in ath11k_wmi_mgmt_send()
715 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_mgmt_send()
717 return -ENOMEM; in ath11k_wmi_mgmt_send()
719 cmd = (struct wmi_mgmt_send_cmd *)skb->data; in ath11k_wmi_mgmt_send()
720 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_MGMT_TX_SEND_CMD) | in ath11k_wmi_mgmt_send()
721 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_mgmt_send()
722 cmd->vdev_id = vdev_id; in ath11k_wmi_mgmt_send()
723 cmd->desc_id = buf_id; in ath11k_wmi_mgmt_send()
724 cmd->chanfreq = ath11k_wmi_mgmt_get_freq(ar, info); in ath11k_wmi_mgmt_send()
725 cmd->paddr_lo = lower_32_bits(ATH11K_SKB_CB(frame)->paddr); in ath11k_wmi_mgmt_send()
726 cmd->paddr_hi = upper_32_bits(ATH11K_SKB_CB(frame)->paddr); in ath11k_wmi_mgmt_send()
727 cmd->frame_len = frame->len; in ath11k_wmi_mgmt_send()
728 cmd->buf_len = buf_len; in ath11k_wmi_mgmt_send()
729 cmd->tx_params_valid = 0; in ath11k_wmi_mgmt_send()
731 frame_tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_mgmt_send()
732 frame_tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_mgmt_send()
735 memcpy(frame_tlv->value, frame->data, buf_len); in ath11k_wmi_mgmt_send()
737 ath11k_ce_byte_swap(frame_tlv->value, buf_len); in ath11k_wmi_mgmt_send()
741 ath11k_warn(ar->ab, in ath11k_wmi_mgmt_send()
746 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd mgmt tx send"); in ath11k_wmi_mgmt_send()
754 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_create()
773 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_vdev_create()
775 return -ENOMEM; in ath11k_wmi_vdev_create()
777 cmd = (struct wmi_vdev_create_cmd *)skb->data; in ath11k_wmi_vdev_create()
778 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_CREATE_CMD) | in ath11k_wmi_vdev_create()
779 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_create()
781 cmd->vdev_id = param->if_id; in ath11k_wmi_vdev_create()
782 cmd->vdev_type = param->type; in ath11k_wmi_vdev_create()
783 cmd->vdev_subtype = param->subtype; in ath11k_wmi_vdev_create()
784 cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX; in ath11k_wmi_vdev_create()
785 cmd->pdev_id = param->pdev_id; in ath11k_wmi_vdev_create()
786 cmd->mbssid_flags = param->mbssid_flags; in ath11k_wmi_vdev_create()
787 cmd->mbssid_tx_vdev_id = param->mbssid_tx_vdev_id; in ath11k_wmi_vdev_create()
789 ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); in ath11k_wmi_vdev_create()
791 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_vdev_create()
799 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_vdev_create()
809 txrx_streams->tlv_header = in ath11k_wmi_vdev_create()
811 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_vdev_create()
812 txrx_streams->band = WMI_TPC_CHAINMASK_CONFIG_BAND_2G; in ath11k_wmi_vdev_create()
813 txrx_streams->supported_tx_streams = in ath11k_wmi_vdev_create()
814 param->chains[NL80211_BAND_2GHZ].tx; in ath11k_wmi_vdev_create()
815 txrx_streams->supported_rx_streams = in ath11k_wmi_vdev_create()
816 param->chains[NL80211_BAND_2GHZ].rx; in ath11k_wmi_vdev_create()
819 txrx_streams->tlv_header = in ath11k_wmi_vdev_create()
821 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_vdev_create()
822 txrx_streams->band = WMI_TPC_CHAINMASK_CONFIG_BAND_5G; in ath11k_wmi_vdev_create()
823 txrx_streams->supported_tx_streams = in ath11k_wmi_vdev_create()
824 param->chains[NL80211_BAND_5GHZ].tx; in ath11k_wmi_vdev_create()
825 txrx_streams->supported_rx_streams = in ath11k_wmi_vdev_create()
826 param->chains[NL80211_BAND_5GHZ].rx; in ath11k_wmi_vdev_create()
830 ath11k_warn(ar->ab, in ath11k_wmi_vdev_create()
835 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_create()
836 "cmd vdev create id %d type %d subtype %d macaddr %pM pdevid %d\n", in ath11k_wmi_vdev_create()
837 param->if_id, param->type, param->subtype, in ath11k_wmi_vdev_create()
838 macaddr, param->pdev_id); in ath11k_wmi_vdev_create()
845 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_delete()
850 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_delete()
852 return -ENOMEM; in ath11k_wmi_vdev_delete()
854 cmd = (struct wmi_vdev_delete_cmd *)skb->data; in ath11k_wmi_vdev_delete()
855 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_DELETE_CMD) | in ath11k_wmi_vdev_delete()
856 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_delete()
857 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_delete()
861 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_DELETE_CMDID\n"); in ath11k_wmi_vdev_delete()
865 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev delete id %d\n", vdev_id); in ath11k_wmi_vdev_delete()
872 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_stop()
877 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_stop()
879 return -ENOMEM; in ath11k_wmi_vdev_stop()
881 cmd = (struct wmi_vdev_stop_cmd *)skb->data; in ath11k_wmi_vdev_stop()
883 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_STOP_CMD) | in ath11k_wmi_vdev_stop()
884 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_stop()
885 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_stop()
889 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_STOP cmd\n"); in ath11k_wmi_vdev_stop()
893 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev stop id 0x%x\n", vdev_id); in ath11k_wmi_vdev_stop()
900 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_down()
905 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_down()
907 return -ENOMEM; in ath11k_wmi_vdev_down()
909 cmd = (struct wmi_vdev_down_cmd *)skb->data; in ath11k_wmi_vdev_down()
911 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_DOWN_CMD) | in ath11k_wmi_vdev_down()
912 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_down()
913 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_down()
917 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_DOWN cmd\n"); in ath11k_wmi_vdev_down()
921 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev down id 0x%x\n", vdev_id); in ath11k_wmi_vdev_down()
929 u32 center_freq1 = arg->channel.band_center_freq1; in ath11k_wmi_put_wmi_channel()
933 chan->mhz = arg->channel.freq; in ath11k_wmi_put_wmi_channel()
934 chan->band_center_freq1 = arg->channel.band_center_freq1; in ath11k_wmi_put_wmi_channel()
936 if (arg->channel.mode == MODE_11AX_HE160) { in ath11k_wmi_put_wmi_channel()
937 if (arg->channel.freq > arg->channel.band_center_freq1) in ath11k_wmi_put_wmi_channel()
938 chan->band_center_freq1 = center_freq1 + 40; in ath11k_wmi_put_wmi_channel()
940 chan->band_center_freq1 = center_freq1 - 40; in ath11k_wmi_put_wmi_channel()
942 chan->band_center_freq2 = arg->channel.band_center_freq1; in ath11k_wmi_put_wmi_channel()
944 } else if ((arg->channel.mode == MODE_11AC_VHT80_80) || in ath11k_wmi_put_wmi_channel()
945 (arg->channel.mode == MODE_11AX_HE80_80)) { in ath11k_wmi_put_wmi_channel()
946 chan->band_center_freq2 = arg->channel.band_center_freq2; in ath11k_wmi_put_wmi_channel()
948 chan->band_center_freq2 = 0; in ath11k_wmi_put_wmi_channel()
951 chan->info |= FIELD_PREP(WMI_CHAN_INFO_MODE, arg->channel.mode); in ath11k_wmi_put_wmi_channel()
952 if (arg->channel.passive) in ath11k_wmi_put_wmi_channel()
953 chan->info |= WMI_CHAN_INFO_PASSIVE; in ath11k_wmi_put_wmi_channel()
954 if (arg->channel.allow_ibss) in ath11k_wmi_put_wmi_channel()
955 chan->info |= WMI_CHAN_INFO_ADHOC_ALLOWED; in ath11k_wmi_put_wmi_channel()
956 if (arg->channel.allow_ht) in ath11k_wmi_put_wmi_channel()
957 chan->info |= WMI_CHAN_INFO_ALLOW_HT; in ath11k_wmi_put_wmi_channel()
958 if (arg->channel.allow_vht) in ath11k_wmi_put_wmi_channel()
959 chan->info |= WMI_CHAN_INFO_ALLOW_VHT; in ath11k_wmi_put_wmi_channel()
960 if (arg->channel.allow_he) in ath11k_wmi_put_wmi_channel()
961 chan->info |= WMI_CHAN_INFO_ALLOW_HE; in ath11k_wmi_put_wmi_channel()
962 if (arg->channel.ht40plus) in ath11k_wmi_put_wmi_channel()
963 chan->info |= WMI_CHAN_INFO_HT40_PLUS; in ath11k_wmi_put_wmi_channel()
964 if (arg->channel.chan_radar) in ath11k_wmi_put_wmi_channel()
965 chan->info |= WMI_CHAN_INFO_DFS; in ath11k_wmi_put_wmi_channel()
966 if (arg->channel.freq2_radar) in ath11k_wmi_put_wmi_channel()
967 chan->info |= WMI_CHAN_INFO_DFS_FREQ2; in ath11k_wmi_put_wmi_channel()
969 chan->reg_info_1 = FIELD_PREP(WMI_CHAN_REG_INFO1_MAX_PWR, in ath11k_wmi_put_wmi_channel()
970 arg->channel.max_power) | in ath11k_wmi_put_wmi_channel()
972 arg->channel.max_reg_power); in ath11k_wmi_put_wmi_channel()
974 chan->reg_info_2 = FIELD_PREP(WMI_CHAN_REG_INFO2_ANT_MAX, in ath11k_wmi_put_wmi_channel()
975 arg->channel.max_antenna_gain) | in ath11k_wmi_put_wmi_channel()
977 arg->channel.max_power); in ath11k_wmi_put_wmi_channel()
983 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_start()
995 if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid))) in ath11k_wmi_vdev_start()
996 return -EINVAL; in ath11k_wmi_vdev_start()
1000 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_vdev_start()
1002 return -ENOMEM; in ath11k_wmi_vdev_start()
1004 cmd = (struct wmi_vdev_start_request_cmd *)skb->data; in ath11k_wmi_vdev_start()
1005 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_start()
1007 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_start()
1008 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_vdev_start()
1009 cmd->beacon_interval = arg->bcn_intval; in ath11k_wmi_vdev_start()
1010 cmd->bcn_tx_rate = arg->bcn_tx_rate; in ath11k_wmi_vdev_start()
1011 cmd->dtim_period = arg->dtim_period; in ath11k_wmi_vdev_start()
1012 cmd->num_noa_descriptors = arg->num_noa_descriptors; in ath11k_wmi_vdev_start()
1013 cmd->preferred_rx_streams = arg->pref_rx_streams; in ath11k_wmi_vdev_start()
1014 cmd->preferred_tx_streams = arg->pref_tx_streams; in ath11k_wmi_vdev_start()
1015 cmd->cac_duration_ms = arg->cac_duration_ms; in ath11k_wmi_vdev_start()
1016 cmd->regdomain = arg->regdomain; in ath11k_wmi_vdev_start()
1017 cmd->he_ops = arg->he_ops; in ath11k_wmi_vdev_start()
1018 cmd->mbssid_flags = arg->mbssid_flags; in ath11k_wmi_vdev_start()
1019 cmd->mbssid_tx_vdev_id = arg->mbssid_tx_vdev_id; in ath11k_wmi_vdev_start()
1022 if (arg->ssid) { in ath11k_wmi_vdev_start()
1023 cmd->ssid.ssid_len = arg->ssid_len; in ath11k_wmi_vdev_start()
1024 memcpy(cmd->ssid.ssid, arg->ssid, arg->ssid_len); in ath11k_wmi_vdev_start()
1026 if (arg->hidden_ssid) in ath11k_wmi_vdev_start()
1027 cmd->flags |= WMI_VDEV_START_HIDDEN_SSID; in ath11k_wmi_vdev_start()
1028 if (arg->pmf_enabled) in ath11k_wmi_vdev_start()
1029 cmd->flags |= WMI_VDEV_START_PMF_ENABLED; in ath11k_wmi_vdev_start()
1032 cmd->flags |= WMI_VDEV_START_LDPC_RX_ENABLED; in ath11k_wmi_vdev_start()
1033 if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) in ath11k_wmi_vdev_start()
1034 cmd->flags |= WMI_VDEV_START_HW_ENCRYPTION_DISABLED; in ath11k_wmi_vdev_start()
1036 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_vdev_start()
1045 chan->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_CHANNEL) | in ath11k_wmi_vdev_start()
1047 sizeof(*chan) - TLV_HDR_SIZE); in ath11k_wmi_vdev_start()
1055 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_vdev_start()
1071 ath11k_warn(ar->ab, "failed to submit vdev_%s cmd\n", in ath11k_wmi_vdev_start()
1076 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev %s id 0x%x freq 0x%x mode 0x%x\n", in ath11k_wmi_vdev_start()
1077 restart ? "restart" : "start", arg->vdev_id, in ath11k_wmi_vdev_start()
1078 arg->channel.freq, arg->channel.mode); in ath11k_wmi_vdev_start()
1086 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_up()
1095 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_up()
1097 return -ENOMEM; in ath11k_wmi_vdev_up()
1099 cmd = (struct wmi_vdev_up_cmd *)skb->data; in ath11k_wmi_vdev_up()
1101 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_UP_CMD) | in ath11k_wmi_vdev_up()
1102 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_up()
1103 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_up()
1104 cmd->vdev_assoc_id = aid; in ath11k_wmi_vdev_up()
1106 ether_addr_copy(cmd->vdev_bssid.addr, bssid); in ath11k_wmi_vdev_up()
1108 cmd->nontx_profile_idx = nontx_profile_idx; in ath11k_wmi_vdev_up()
1109 cmd->nontx_profile_cnt = nontx_profile_cnt; in ath11k_wmi_vdev_up()
1111 ether_addr_copy(cmd->tx_vdev_bssid.addr, tx_bssid); in ath11k_wmi_vdev_up()
1113 if (arvif && arvif->vif->type == NL80211_IFTYPE_STATION) { in ath11k_wmi_vdev_up()
1114 bss_conf = &arvif->vif->bss_conf; in ath11k_wmi_vdev_up()
1116 if (bss_conf->nontransmitted) { in ath11k_wmi_vdev_up()
1117 ether_addr_copy(cmd->tx_vdev_bssid.addr, in ath11k_wmi_vdev_up()
1118 bss_conf->transmitter_bssid); in ath11k_wmi_vdev_up()
1119 cmd->nontx_profile_idx = bss_conf->bssid_index; in ath11k_wmi_vdev_up()
1120 cmd->nontx_profile_cnt = bss_conf->bssid_indicator; in ath11k_wmi_vdev_up()
1126 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_UP cmd\n"); in ath11k_wmi_vdev_up()
1130 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_up()
1131 "cmd vdev up id 0x%x assoc id %d bssid %pM\n", in ath11k_wmi_vdev_up()
1140 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_create_cmd()
1145 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_peer_create_cmd()
1147 return -ENOMEM; in ath11k_wmi_send_peer_create_cmd()
1149 cmd = (struct wmi_peer_create_cmd *)skb->data; in ath11k_wmi_send_peer_create_cmd()
1150 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_CREATE_CMD) | in ath11k_wmi_send_peer_create_cmd()
1151 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_create_cmd()
1153 ether_addr_copy(cmd->peer_macaddr.addr, param->peer_addr); in ath11k_wmi_send_peer_create_cmd()
1154 cmd->peer_type = param->peer_type; in ath11k_wmi_send_peer_create_cmd()
1155 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_peer_create_cmd()
1159 ath11k_warn(ar->ab, "failed to submit WMI_PEER_CREATE cmd\n"); in ath11k_wmi_send_peer_create_cmd()
1163 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_create_cmd()
1164 "cmd peer create vdev_id %d peer_addr %pM\n", in ath11k_wmi_send_peer_create_cmd()
1165 param->vdev_id, param->peer_addr); in ath11k_wmi_send_peer_create_cmd()
1173 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_delete_cmd()
1178 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_peer_delete_cmd()
1180 return -ENOMEM; in ath11k_wmi_send_peer_delete_cmd()
1182 cmd = (struct wmi_peer_delete_cmd *)skb->data; in ath11k_wmi_send_peer_delete_cmd()
1183 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_DELETE_CMD) | in ath11k_wmi_send_peer_delete_cmd()
1184 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_delete_cmd()
1186 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_send_peer_delete_cmd()
1187 cmd->vdev_id = vdev_id; in ath11k_wmi_send_peer_delete_cmd()
1191 ath11k_warn(ar->ab, "failed to send WMI_PEER_DELETE cmd\n"); in ath11k_wmi_send_peer_delete_cmd()
1195 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_delete_cmd()
1196 "cmd peer delete vdev_id %d peer_addr %pM\n", in ath11k_wmi_send_peer_delete_cmd()
1205 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_pdev_set_regdomain()
1210 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_pdev_set_regdomain()
1212 return -ENOMEM; in ath11k_wmi_send_pdev_set_regdomain()
1214 cmd = (struct wmi_pdev_set_regdomain_cmd *)skb->data; in ath11k_wmi_send_pdev_set_regdomain()
1215 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_pdev_set_regdomain()
1217 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_pdev_set_regdomain()
1219 cmd->reg_domain = param->current_rd_in_use; in ath11k_wmi_send_pdev_set_regdomain()
1220 cmd->reg_domain_2g = param->current_rd_2g; in ath11k_wmi_send_pdev_set_regdomain()
1221 cmd->reg_domain_5g = param->current_rd_5g; in ath11k_wmi_send_pdev_set_regdomain()
1222 cmd->conformance_test_limit_2g = param->ctl_2g; in ath11k_wmi_send_pdev_set_regdomain()
1223 cmd->conformance_test_limit_5g = param->ctl_5g; in ath11k_wmi_send_pdev_set_regdomain()
1224 cmd->dfs_domain = param->dfs_domain; in ath11k_wmi_send_pdev_set_regdomain()
1225 cmd->pdev_id = param->pdev_id; in ath11k_wmi_send_pdev_set_regdomain()
1229 ath11k_warn(ar->ab, in ath11k_wmi_send_pdev_set_regdomain()
1234 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_pdev_set_regdomain()
1236 param->current_rd_in_use, param->current_rd_2g, in ath11k_wmi_send_pdev_set_regdomain()
1237 param->current_rd_5g, param->dfs_domain, param->pdev_id); in ath11k_wmi_send_pdev_set_regdomain()
1245 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_set_peer_param()
1250 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_set_peer_param()
1252 return -ENOMEM; in ath11k_wmi_set_peer_param()
1254 cmd = (struct wmi_peer_set_param_cmd *)skb->data; in ath11k_wmi_set_peer_param()
1255 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_SET_PARAM_CMD) | in ath11k_wmi_set_peer_param()
1256 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_peer_param()
1257 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_set_peer_param()
1258 cmd->vdev_id = vdev_id; in ath11k_wmi_set_peer_param()
1259 cmd->param_id = param_id; in ath11k_wmi_set_peer_param()
1260 cmd->param_value = param_val; in ath11k_wmi_set_peer_param()
1264 ath11k_warn(ar->ab, "failed to send WMI_PEER_SET_PARAM cmd\n"); in ath11k_wmi_set_peer_param()
1268 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_set_peer_param()
1269 "cmd peer set param vdev %d peer 0x%pM set param %d value %d\n", in ath11k_wmi_set_peer_param()
1279 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_flush_tids_cmd()
1284 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_peer_flush_tids_cmd()
1286 return -ENOMEM; in ath11k_wmi_send_peer_flush_tids_cmd()
1288 cmd = (struct wmi_peer_flush_tids_cmd *)skb->data; in ath11k_wmi_send_peer_flush_tids_cmd()
1289 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_FLUSH_TIDS_CMD) | in ath11k_wmi_send_peer_flush_tids_cmd()
1290 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_flush_tids_cmd()
1292 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_send_peer_flush_tids_cmd()
1293 cmd->peer_tid_bitmap = param->peer_tid_bitmap; in ath11k_wmi_send_peer_flush_tids_cmd()
1294 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_peer_flush_tids_cmd()
1298 ath11k_warn(ar->ab, in ath11k_wmi_send_peer_flush_tids_cmd()
1303 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_flush_tids_cmd()
1304 "cmd peer flush tids vdev_id %d peer_addr %pM tids %08x\n", in ath11k_wmi_send_peer_flush_tids_cmd()
1305 param->vdev_id, peer_addr, param->peer_tid_bitmap); in ath11k_wmi_send_peer_flush_tids_cmd()
1320 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_peer_rx_reorder_queue_setup()
1322 return -ENOMEM; in ath11k_wmi_peer_rx_reorder_queue_setup()
1324 cmd = (struct wmi_peer_reorder_queue_setup_cmd *)skb->data; in ath11k_wmi_peer_rx_reorder_queue_setup()
1325 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_peer_rx_reorder_queue_setup()
1327 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_peer_rx_reorder_queue_setup()
1329 ether_addr_copy(cmd->peer_macaddr.addr, addr); in ath11k_wmi_peer_rx_reorder_queue_setup()
1330 cmd->vdev_id = vdev_id; in ath11k_wmi_peer_rx_reorder_queue_setup()
1331 cmd->tid = tid; in ath11k_wmi_peer_rx_reorder_queue_setup()
1332 cmd->queue_ptr_lo = lower_32_bits(paddr); in ath11k_wmi_peer_rx_reorder_queue_setup()
1333 cmd->queue_ptr_hi = upper_32_bits(paddr); in ath11k_wmi_peer_rx_reorder_queue_setup()
1334 cmd->queue_no = tid; in ath11k_wmi_peer_rx_reorder_queue_setup()
1335 cmd->ba_window_size_valid = ba_window_size_valid; in ath11k_wmi_peer_rx_reorder_queue_setup()
1336 cmd->ba_window_size = ba_window_size; in ath11k_wmi_peer_rx_reorder_queue_setup()
1338 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_peer_rx_reorder_queue_setup()
1341 ath11k_warn(ar->ab, in ath11k_wmi_peer_rx_reorder_queue_setup()
1346 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_peer_rx_reorder_queue_setup()
1347 "cmd peer reorder queue setup addr %pM vdev_id %d tid %d\n", in ath11k_wmi_peer_rx_reorder_queue_setup()
1357 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_rx_reord_queue_remove()
1362 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_rx_reord_queue_remove()
1364 return -ENOMEM; in ath11k_wmi_rx_reord_queue_remove()
1366 cmd = (struct wmi_peer_reorder_queue_remove_cmd *)skb->data; in ath11k_wmi_rx_reord_queue_remove()
1367 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_rx_reord_queue_remove()
1369 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_rx_reord_queue_remove()
1371 ether_addr_copy(cmd->peer_macaddr.addr, param->peer_macaddr); in ath11k_wmi_rx_reord_queue_remove()
1372 cmd->vdev_id = param->vdev_id; in ath11k_wmi_rx_reord_queue_remove()
1373 cmd->tid_mask = param->peer_tid_bitmap; in ath11k_wmi_rx_reord_queue_remove()
1378 ath11k_warn(ar->ab, in ath11k_wmi_rx_reord_queue_remove()
1383 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_rx_reord_queue_remove()
1384 "cmd peer reorder queue remove peer_macaddr %pM vdev_id %d tid_map %d", in ath11k_wmi_rx_reord_queue_remove()
1385 param->peer_macaddr, param->vdev_id, param->peer_tid_bitmap); in ath11k_wmi_rx_reord_queue_remove()
1393 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_param()
1398 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_set_param()
1400 return -ENOMEM; in ath11k_wmi_pdev_set_param()
1402 cmd = (struct wmi_pdev_set_param_cmd *)skb->data; in ath11k_wmi_pdev_set_param()
1403 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_PARAM_CMD) | in ath11k_wmi_pdev_set_param()
1404 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_param()
1405 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_set_param()
1406 cmd->param_id = param_id; in ath11k_wmi_pdev_set_param()
1407 cmd->param_value = param_value; in ath11k_wmi_pdev_set_param()
1411 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath11k_wmi_pdev_set_param()
1415 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_param()
1425 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_ps_mode()
1430 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_set_ps_mode()
1432 return -ENOMEM; in ath11k_wmi_pdev_set_ps_mode()
1434 cmd = (struct wmi_pdev_set_ps_mode_cmd *)skb->data; in ath11k_wmi_pdev_set_ps_mode()
1435 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_STA_POWERSAVE_MODE_CMD) | in ath11k_wmi_pdev_set_ps_mode()
1436 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_ps_mode()
1437 cmd->vdev_id = vdev_id; in ath11k_wmi_pdev_set_ps_mode()
1438 cmd->sta_ps_mode = psmode; in ath11k_wmi_pdev_set_ps_mode()
1442 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath11k_wmi_pdev_set_ps_mode()
1446 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_ps_mode()
1456 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_suspend()
1461 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_suspend()
1463 return -ENOMEM; in ath11k_wmi_pdev_suspend()
1465 cmd = (struct wmi_pdev_suspend_cmd *)skb->data; in ath11k_wmi_pdev_suspend()
1467 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SUSPEND_CMD) | in ath11k_wmi_pdev_suspend()
1468 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_suspend()
1470 cmd->suspend_opt = suspend_opt; in ath11k_wmi_pdev_suspend()
1471 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_suspend()
1475 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SUSPEND cmd\n"); in ath11k_wmi_pdev_suspend()
1479 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_suspend()
1487 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_resume()
1492 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_resume()
1494 return -ENOMEM; in ath11k_wmi_pdev_resume()
1496 cmd = (struct wmi_pdev_resume_cmd *)skb->data; in ath11k_wmi_pdev_resume()
1498 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_RESUME_CMD) | in ath11k_wmi_pdev_resume()
1499 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_resume()
1500 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_resume()
1504 ath11k_warn(ar->ab, "failed to send WMI_PDEV_RESUME cmd\n"); in ath11k_wmi_pdev_resume()
1508 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_resume()
1521 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_bss_chan_info_request()
1526 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_bss_chan_info_request()
1528 return -ENOMEM; in ath11k_wmi_pdev_bss_chan_info_request()
1530 cmd = (struct wmi_pdev_bss_chan_info_req_cmd *)skb->data; in ath11k_wmi_pdev_bss_chan_info_request()
1532 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_pdev_bss_chan_info_request()
1534 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_bss_chan_info_request()
1535 cmd->req_type = type; in ath11k_wmi_pdev_bss_chan_info_request()
1536 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_bss_chan_info_request()
1541 ath11k_warn(ar->ab, in ath11k_wmi_pdev_bss_chan_info_request()
1546 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_bss_chan_info_request()
1555 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_set_ap_ps_param_cmd()
1560 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_set_ap_ps_param_cmd()
1562 return -ENOMEM; in ath11k_wmi_send_set_ap_ps_param_cmd()
1564 cmd = (struct wmi_ap_ps_peer_cmd *)skb->data; in ath11k_wmi_send_set_ap_ps_param_cmd()
1565 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_AP_PS_PEER_CMD) | in ath11k_wmi_send_set_ap_ps_param_cmd()
1566 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_set_ap_ps_param_cmd()
1568 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_set_ap_ps_param_cmd()
1569 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_send_set_ap_ps_param_cmd()
1570 cmd->param = param->param; in ath11k_wmi_send_set_ap_ps_param_cmd()
1571 cmd->value = param->value; in ath11k_wmi_send_set_ap_ps_param_cmd()
1575 ath11k_warn(ar->ab, in ath11k_wmi_send_set_ap_ps_param_cmd()
1580 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_set_ap_ps_param_cmd()
1581 "cmd ap ps peer param vdev id %d peer %pM param %d value %d\n", in ath11k_wmi_send_set_ap_ps_param_cmd()
1582 param->vdev_id, peer_addr, param->param, param->value); in ath11k_wmi_send_set_ap_ps_param_cmd()
1590 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_set_sta_ps_param()
1595 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_set_sta_ps_param()
1597 return -ENOMEM; in ath11k_wmi_set_sta_ps_param()
1599 cmd = (struct wmi_sta_powersave_param_cmd *)skb->data; in ath11k_wmi_set_sta_ps_param()
1600 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_set_sta_ps_param()
1602 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_sta_ps_param()
1604 cmd->vdev_id = vdev_id; in ath11k_wmi_set_sta_ps_param()
1605 cmd->param = param; in ath11k_wmi_set_sta_ps_param()
1606 cmd->value = param_value; in ath11k_wmi_set_sta_ps_param()
1610 ath11k_warn(ar->ab, "failed to send WMI_STA_POWERSAVE_PARAM_CMDID"); in ath11k_wmi_set_sta_ps_param()
1614 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_set_sta_ps_param()
1623 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_force_fw_hang_cmd()
1630 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_force_fw_hang_cmd()
1632 return -ENOMEM; in ath11k_wmi_force_fw_hang_cmd()
1634 cmd = (struct wmi_force_fw_hang_cmd *)skb->data; in ath11k_wmi_force_fw_hang_cmd()
1635 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_FORCE_FW_HANG_CMD) | in ath11k_wmi_force_fw_hang_cmd()
1636 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_force_fw_hang_cmd()
1638 cmd->type = type; in ath11k_wmi_force_fw_hang_cmd()
1639 cmd->delay_time_ms = delay_time_ms; in ath11k_wmi_force_fw_hang_cmd()
1644 ath11k_warn(ar->ab, "Failed to send WMI_FORCE_FW_HANG_CMDID"); in ath11k_wmi_force_fw_hang_cmd()
1648 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd force fw hang"); in ath11k_wmi_force_fw_hang_cmd()
1656 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_set_param_cmd()
1661 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_set_param_cmd()
1663 return -ENOMEM; in ath11k_wmi_vdev_set_param_cmd()
1665 cmd = (struct wmi_vdev_set_param_cmd *)skb->data; in ath11k_wmi_vdev_set_param_cmd()
1666 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_SET_PARAM_CMD) | in ath11k_wmi_vdev_set_param_cmd()
1667 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_set_param_cmd()
1669 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_set_param_cmd()
1670 cmd->param_id = param_id; in ath11k_wmi_vdev_set_param_cmd()
1671 cmd->param_value = param_value; in ath11k_wmi_vdev_set_param_cmd()
1675 ath11k_warn(ar->ab, in ath11k_wmi_vdev_set_param_cmd()
1680 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_set_param_cmd()
1690 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_stats_request_cmd()
1695 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_stats_request_cmd()
1697 return -ENOMEM; in ath11k_wmi_send_stats_request_cmd()
1699 cmd = (struct wmi_request_stats_cmd *)skb->data; in ath11k_wmi_send_stats_request_cmd()
1700 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_REQUEST_STATS_CMD) | in ath11k_wmi_send_stats_request_cmd()
1701 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_stats_request_cmd()
1703 cmd->stats_id = param->stats_id; in ath11k_wmi_send_stats_request_cmd()
1704 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_stats_request_cmd()
1705 cmd->pdev_id = param->pdev_id; in ath11k_wmi_send_stats_request_cmd()
1709 ath11k_warn(ar->ab, "failed to send WMI_REQUEST_STATS cmd\n"); in ath11k_wmi_send_stats_request_cmd()
1713 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_stats_request_cmd()
1715 param->stats_id, param->vdev_id, param->pdev_id); in ath11k_wmi_send_stats_request_cmd()
1722 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_pdev_temperature_cmd()
1727 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_pdev_temperature_cmd()
1729 return -ENOMEM; in ath11k_wmi_send_pdev_temperature_cmd()
1731 cmd = (struct wmi_get_pdev_temperature_cmd *)skb->data; in ath11k_wmi_send_pdev_temperature_cmd()
1732 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_GET_TEMPERATURE_CMD) | in ath11k_wmi_send_pdev_temperature_cmd()
1733 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_pdev_temperature_cmd()
1734 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_pdev_temperature_cmd()
1738 ath11k_warn(ar->ab, "failed to send WMI_PDEV_GET_TEMPERATURE cmd\n"); in ath11k_wmi_send_pdev_temperature_cmd()
1742 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_pdev_temperature_cmd()
1743 "cmd pdev get temperature for pdev_id %d\n", ar->pdev->pdev_id); in ath11k_wmi_send_pdev_temperature_cmd()
1751 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_bcn_offload_control_cmd()
1756 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_bcn_offload_control_cmd()
1758 return -ENOMEM; in ath11k_wmi_send_bcn_offload_control_cmd()
1760 cmd = (struct wmi_bcn_offload_ctrl_cmd *)skb->data; in ath11k_wmi_send_bcn_offload_control_cmd()
1761 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_bcn_offload_control_cmd()
1763 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_bcn_offload_control_cmd()
1765 cmd->vdev_id = vdev_id; in ath11k_wmi_send_bcn_offload_control_cmd()
1766 cmd->bcn_ctrl_op = bcn_ctrl_op; in ath11k_wmi_send_bcn_offload_control_cmd()
1770 ath11k_warn(ar->ab, in ath11k_wmi_send_bcn_offload_control_cmd()
1775 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bcn_offload_control_cmd()
1779 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd bcn tmpl"); in ath11k_wmi_send_bcn_offload_control_cmd()
1788 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_bcn_tmpl()
1799 size_t aligned_len = roundup(bcn->len, 4); in ath11k_wmi_bcn_tmpl()
1804 ath11k_warn(ar->ab, "failed to find arvif with vdev id %d\n", vdev_id); in ath11k_wmi_bcn_tmpl()
1805 return -EINVAL; in ath11k_wmi_bcn_tmpl()
1808 vif = arvif->vif; in ath11k_wmi_bcn_tmpl()
1812 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_bcn_tmpl()
1814 return -ENOMEM; in ath11k_wmi_bcn_tmpl()
1816 cmd = (struct wmi_bcn_tmpl_cmd *)skb->data; in ath11k_wmi_bcn_tmpl()
1817 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_BCN_TMPL_CMD) | in ath11k_wmi_bcn_tmpl()
1818 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_bcn_tmpl()
1819 cmd->vdev_id = vdev_id; in ath11k_wmi_bcn_tmpl()
1820 cmd->tim_ie_offset = offs->tim_offset; in ath11k_wmi_bcn_tmpl()
1822 if (vif->bss_conf.csa_active) { in ath11k_wmi_bcn_tmpl()
1823 cmd->csa_switch_count_offset = offs->cntdwn_counter_offs[0]; in ath11k_wmi_bcn_tmpl()
1824 cmd->ext_csa_switch_count_offset = offs->cntdwn_counter_offs[1]; in ath11k_wmi_bcn_tmpl()
1827 cmd->buf_len = bcn->len; in ath11k_wmi_bcn_tmpl()
1828 cmd->mbssid_ie_offset = offs->mbssid_off; in ath11k_wmi_bcn_tmpl()
1829 cmd->ema_params = ema_params; in ath11k_wmi_bcn_tmpl()
1831 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_bcn_tmpl()
1839 bcn_prb_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_bcn_tmpl()
1841 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_bcn_tmpl()
1842 bcn_prb_info->caps = 0; in ath11k_wmi_bcn_tmpl()
1843 bcn_prb_info->erp = 0; in ath11k_wmi_bcn_tmpl()
1852 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_bcn_tmpl()
1854 memcpy(tlv->value, bcn->data, bcn->len); in ath11k_wmi_bcn_tmpl()
1858 ath11k_warn(ar->ab, "failed to send WMI_BCN_TMPL_CMDID\n"); in ath11k_wmi_bcn_tmpl()
1868 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_install_key()
1873 int key_len_aligned = roundup(arg->key_len, sizeof(uint32_t)); in ath11k_wmi_vdev_install_key()
1877 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_vdev_install_key()
1879 return -ENOMEM; in ath11k_wmi_vdev_install_key()
1881 cmd = (struct wmi_vdev_install_key_cmd *)skb->data; in ath11k_wmi_vdev_install_key()
1882 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_INSTALL_KEY_CMD) | in ath11k_wmi_vdev_install_key()
1883 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_install_key()
1884 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_vdev_install_key()
1885 ether_addr_copy(cmd->peer_macaddr.addr, arg->macaddr); in ath11k_wmi_vdev_install_key()
1886 cmd->key_idx = arg->key_idx; in ath11k_wmi_vdev_install_key()
1887 cmd->key_flags = arg->key_flags; in ath11k_wmi_vdev_install_key()
1888 cmd->key_cipher = arg->key_cipher; in ath11k_wmi_vdev_install_key()
1889 cmd->key_len = arg->key_len; in ath11k_wmi_vdev_install_key()
1890 cmd->key_txmic_len = arg->key_txmic_len; in ath11k_wmi_vdev_install_key()
1891 cmd->key_rxmic_len = arg->key_rxmic_len; in ath11k_wmi_vdev_install_key()
1893 if (arg->key_rsc_counter) in ath11k_wmi_vdev_install_key()
1894 memcpy(&cmd->key_rsc_counter, &arg->key_rsc_counter, in ath11k_wmi_vdev_install_key()
1897 tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_vdev_install_key()
1898 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_vdev_install_key()
1900 if (arg->key_data) in ath11k_wmi_vdev_install_key()
1902 memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); in ath11k_wmi_vdev_install_key()
1904 memcpy(tlv->value, arg->key_data, key_len_aligned); in ath11k_wmi_vdev_install_key()
1909 ath11k_warn(ar->ab, in ath11k_wmi_vdev_install_key()
1914 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_install_key()
1916 arg->key_idx, arg->key_cipher, arg->key_len); in ath11k_wmi_vdev_install_key()
1926 cmd->peer_flags = 0; in ath11k_wmi_copy_peer_flags()
1928 if (param->is_wme_set) { in ath11k_wmi_copy_peer_flags()
1929 if (param->qos_flag) in ath11k_wmi_copy_peer_flags()
1930 cmd->peer_flags |= WMI_PEER_QOS; in ath11k_wmi_copy_peer_flags()
1931 if (param->apsd_flag) in ath11k_wmi_copy_peer_flags()
1932 cmd->peer_flags |= WMI_PEER_APSD; in ath11k_wmi_copy_peer_flags()
1933 if (param->ht_flag) in ath11k_wmi_copy_peer_flags()
1934 cmd->peer_flags |= WMI_PEER_HT; in ath11k_wmi_copy_peer_flags()
1935 if (param->bw_40) in ath11k_wmi_copy_peer_flags()
1936 cmd->peer_flags |= WMI_PEER_40MHZ; in ath11k_wmi_copy_peer_flags()
1937 if (param->bw_80) in ath11k_wmi_copy_peer_flags()
1938 cmd->peer_flags |= WMI_PEER_80MHZ; in ath11k_wmi_copy_peer_flags()
1939 if (param->bw_160) in ath11k_wmi_copy_peer_flags()
1940 cmd->peer_flags |= WMI_PEER_160MHZ; in ath11k_wmi_copy_peer_flags()
1945 if (param->stbc_flag) in ath11k_wmi_copy_peer_flags()
1946 cmd->peer_flags |= WMI_PEER_STBC; in ath11k_wmi_copy_peer_flags()
1951 if (param->ldpc_flag) in ath11k_wmi_copy_peer_flags()
1952 cmd->peer_flags |= WMI_PEER_LDPC; in ath11k_wmi_copy_peer_flags()
1954 if (param->static_mimops_flag) in ath11k_wmi_copy_peer_flags()
1955 cmd->peer_flags |= WMI_PEER_STATIC_MIMOPS; in ath11k_wmi_copy_peer_flags()
1956 if (param->dynamic_mimops_flag) in ath11k_wmi_copy_peer_flags()
1957 cmd->peer_flags |= WMI_PEER_DYN_MIMOPS; in ath11k_wmi_copy_peer_flags()
1958 if (param->spatial_mux_flag) in ath11k_wmi_copy_peer_flags()
1959 cmd->peer_flags |= WMI_PEER_SPATIAL_MUX; in ath11k_wmi_copy_peer_flags()
1960 if (param->vht_flag) in ath11k_wmi_copy_peer_flags()
1961 cmd->peer_flags |= WMI_PEER_VHT; in ath11k_wmi_copy_peer_flags()
1962 if (param->he_flag) in ath11k_wmi_copy_peer_flags()
1963 cmd->peer_flags |= WMI_PEER_HE; in ath11k_wmi_copy_peer_flags()
1964 if (param->twt_requester) in ath11k_wmi_copy_peer_flags()
1965 cmd->peer_flags |= WMI_PEER_TWT_REQ; in ath11k_wmi_copy_peer_flags()
1966 if (param->twt_responder) in ath11k_wmi_copy_peer_flags()
1967 cmd->peer_flags |= WMI_PEER_TWT_RESP; in ath11k_wmi_copy_peer_flags()
1970 /* Suppress authorization for all AUTH modes that need 4-way handshake in ath11k_wmi_copy_peer_flags()
1971 * (during re-association). in ath11k_wmi_copy_peer_flags()
1974 if (param->auth_flag) in ath11k_wmi_copy_peer_flags()
1975 cmd->peer_flags |= WMI_PEER_AUTH; in ath11k_wmi_copy_peer_flags()
1976 if (param->need_ptk_4_way) { in ath11k_wmi_copy_peer_flags()
1977 cmd->peer_flags |= WMI_PEER_NEED_PTK_4_WAY; in ath11k_wmi_copy_peer_flags()
1978 if (!hw_crypto_disabled && param->is_assoc) in ath11k_wmi_copy_peer_flags()
1979 cmd->peer_flags &= ~WMI_PEER_AUTH; in ath11k_wmi_copy_peer_flags()
1981 if (param->need_gtk_2_way) in ath11k_wmi_copy_peer_flags()
1982 cmd->peer_flags |= WMI_PEER_NEED_GTK_2_WAY; in ath11k_wmi_copy_peer_flags()
1983 /* safe mode bypass the 4-way handshake */ in ath11k_wmi_copy_peer_flags()
1984 if (param->safe_mode_enabled) in ath11k_wmi_copy_peer_flags()
1985 cmd->peer_flags &= ~(WMI_PEER_NEED_PTK_4_WAY | in ath11k_wmi_copy_peer_flags()
1988 if (param->is_pmf_enabled) in ath11k_wmi_copy_peer_flags()
1989 cmd->peer_flags |= WMI_PEER_PMF; in ath11k_wmi_copy_peer_flags()
1994 * if (param->amsdu_disable) Add after FW support in ath11k_wmi_copy_peer_flags()
1998 * Mark the node as non-HT if all the mcs rates are disabled through in ath11k_wmi_copy_peer_flags()
2001 if (param->peer_ht_rates.num_rates == 0) in ath11k_wmi_copy_peer_flags()
2002 cmd->peer_flags &= ~WMI_PEER_HT; in ath11k_wmi_copy_peer_flags()
2008 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_assoc_cmd()
2023 peer_legacy_rates_align = roundup(param->peer_legacy_rates.num_rates, in ath11k_wmi_send_peer_assoc_cmd()
2025 peer_ht_rates_align = roundup(param->peer_ht_rates.num_rates, in ath11k_wmi_send_peer_assoc_cmd()
2032 (sizeof(*he_mcs) * param->peer_he_mcs_count); in ath11k_wmi_send_peer_assoc_cmd()
2034 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_peer_assoc_cmd()
2036 return -ENOMEM; in ath11k_wmi_send_peer_assoc_cmd()
2038 ptr = skb->data; in ath11k_wmi_send_peer_assoc_cmd()
2045 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_peer_assoc_cmd()
2047 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_assoc_cmd()
2049 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_peer_assoc_cmd()
2051 cmd->peer_new_assoc = param->peer_new_assoc; in ath11k_wmi_send_peer_assoc_cmd()
2052 cmd->peer_associd = param->peer_associd; in ath11k_wmi_send_peer_assoc_cmd()
2056 &ar->ab->dev_flags)); in ath11k_wmi_send_peer_assoc_cmd()
2058 ether_addr_copy(cmd->peer_macaddr.addr, param->peer_mac); in ath11k_wmi_send_peer_assoc_cmd()
2060 cmd->peer_rate_caps = param->peer_rate_caps; in ath11k_wmi_send_peer_assoc_cmd()
2061 cmd->peer_caps = param->peer_caps; in ath11k_wmi_send_peer_assoc_cmd()
2062 cmd->peer_listen_intval = param->peer_listen_intval; in ath11k_wmi_send_peer_assoc_cmd()
2063 cmd->peer_ht_caps = param->peer_ht_caps; in ath11k_wmi_send_peer_assoc_cmd()
2064 cmd->peer_max_mpdu = param->peer_max_mpdu; in ath11k_wmi_send_peer_assoc_cmd()
2065 cmd->peer_mpdu_density = param->peer_mpdu_density; in ath11k_wmi_send_peer_assoc_cmd()
2066 cmd->peer_vht_caps = param->peer_vht_caps; in ath11k_wmi_send_peer_assoc_cmd()
2067 cmd->peer_phymode = param->peer_phymode; in ath11k_wmi_send_peer_assoc_cmd()
2070 cmd->peer_he_cap_info = param->peer_he_cap_macinfo[0]; in ath11k_wmi_send_peer_assoc_cmd()
2071 cmd->peer_he_cap_info_ext = param->peer_he_cap_macinfo[1]; in ath11k_wmi_send_peer_assoc_cmd()
2072 cmd->peer_he_cap_info_internal = param->peer_he_cap_macinfo_internal; in ath11k_wmi_send_peer_assoc_cmd()
2073 cmd->peer_he_caps_6ghz = param->peer_he_caps_6ghz; in ath11k_wmi_send_peer_assoc_cmd()
2074 cmd->peer_he_ops = param->peer_he_ops; in ath11k_wmi_send_peer_assoc_cmd()
2075 memcpy(&cmd->peer_he_cap_phy, ¶m->peer_he_cap_phyinfo, in ath11k_wmi_send_peer_assoc_cmd()
2076 sizeof(param->peer_he_cap_phyinfo)); in ath11k_wmi_send_peer_assoc_cmd()
2077 memcpy(&cmd->peer_ppet, ¶m->peer_ppet, in ath11k_wmi_send_peer_assoc_cmd()
2078 sizeof(param->peer_ppet)); in ath11k_wmi_send_peer_assoc_cmd()
2088 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_send_peer_assoc_cmd()
2093 cmd->num_peer_legacy_rates = param->peer_legacy_rates.num_rates; in ath11k_wmi_send_peer_assoc_cmd()
2094 memcpy(ptr, param->peer_legacy_rates.rates, in ath11k_wmi_send_peer_assoc_cmd()
2095 param->peer_legacy_rates.num_rates); in ath11k_wmi_send_peer_assoc_cmd()
2105 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_send_peer_assoc_cmd()
2108 cmd->num_peer_ht_rates = param->peer_ht_rates.num_rates; in ath11k_wmi_send_peer_assoc_cmd()
2109 memcpy(ptr, param->peer_ht_rates.rates, in ath11k_wmi_send_peer_assoc_cmd()
2110 param->peer_ht_rates.num_rates); in ath11k_wmi_send_peer_assoc_cmd()
2121 mcs->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VHT_RATE_SET) | in ath11k_wmi_send_peer_assoc_cmd()
2122 FIELD_PREP(WMI_TLV_LEN, sizeof(*mcs) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_assoc_cmd()
2124 cmd->peer_nss = param->peer_nss; in ath11k_wmi_send_peer_assoc_cmd()
2126 /* Update bandwidth-NSS mapping */ in ath11k_wmi_send_peer_assoc_cmd()
2127 cmd->peer_bw_rxnss_override = 0; in ath11k_wmi_send_peer_assoc_cmd()
2128 cmd->peer_bw_rxnss_override |= param->peer_bw_rxnss_override; in ath11k_wmi_send_peer_assoc_cmd()
2130 if (param->vht_capable) { in ath11k_wmi_send_peer_assoc_cmd()
2131 mcs->rx_max_rate = param->rx_max_rate; in ath11k_wmi_send_peer_assoc_cmd()
2132 mcs->rx_mcs_set = param->rx_mcs_set; in ath11k_wmi_send_peer_assoc_cmd()
2133 mcs->tx_max_rate = param->tx_max_rate; in ath11k_wmi_send_peer_assoc_cmd()
2134 mcs->tx_mcs_set = param->tx_mcs_set; in ath11k_wmi_send_peer_assoc_cmd()
2138 cmd->peer_he_mcs = param->peer_he_mcs_count; in ath11k_wmi_send_peer_assoc_cmd()
2139 cmd->min_data_rate = param->min_data_rate; in ath11k_wmi_send_peer_assoc_cmd()
2143 len = param->peer_he_mcs_count * sizeof(*he_mcs); in ath11k_wmi_send_peer_assoc_cmd()
2150 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_peer_assoc_cmd()
2155 for (i = 0; i < param->peer_he_mcs_count; i++) { in ath11k_wmi_send_peer_assoc_cmd()
2161 he_mcs->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_peer_assoc_cmd()
2164 sizeof(*he_mcs) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_assoc_cmd()
2166 he_mcs->rx_mcs_set = param->peer_he_tx_mcs_set[i]; in ath11k_wmi_send_peer_assoc_cmd()
2167 he_mcs->tx_mcs_set = param->peer_he_rx_mcs_set[i]; in ath11k_wmi_send_peer_assoc_cmd()
2173 ath11k_warn(ar->ab, in ath11k_wmi_send_peer_assoc_cmd()
2178 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_assoc_cmd()
2179 …"cmd peer assoc vdev id %d assoc id %d peer mac %pM peer_flags %x rate_caps %x peer_caps %x listen… in ath11k_wmi_send_peer_assoc_cmd()
2180 cmd->vdev_id, cmd->peer_associd, param->peer_mac, in ath11k_wmi_send_peer_assoc_cmd()
2181 cmd->peer_flags, cmd->peer_rate_caps, cmd->peer_caps, in ath11k_wmi_send_peer_assoc_cmd()
2182 cmd->peer_listen_intval, cmd->peer_ht_caps, in ath11k_wmi_send_peer_assoc_cmd()
2183 cmd->peer_max_mpdu, cmd->peer_nss, cmd->peer_phymode, in ath11k_wmi_send_peer_assoc_cmd()
2184 cmd->peer_mpdu_density, in ath11k_wmi_send_peer_assoc_cmd()
2185 cmd->peer_vht_caps, cmd->peer_he_cap_info, in ath11k_wmi_send_peer_assoc_cmd()
2186 cmd->peer_he_ops, cmd->peer_he_cap_info_ext, in ath11k_wmi_send_peer_assoc_cmd()
2187 cmd->peer_he_cap_phy[0], cmd->peer_he_cap_phy[1], in ath11k_wmi_send_peer_assoc_cmd()
2188 cmd->peer_he_cap_phy[2], in ath11k_wmi_send_peer_assoc_cmd()
2189 cmd->peer_bw_rxnss_override); in ath11k_wmi_send_peer_assoc_cmd()
2198 arg->scan_req_id = 1; in ath11k_wmi_start_scan_init()
2199 if (ar->state_11d == ATH11K_11D_PREPARING) in ath11k_wmi_start_scan_init()
2200 arg->scan_priority = WMI_SCAN_PRIORITY_MEDIUM; in ath11k_wmi_start_scan_init()
2202 arg->scan_priority = WMI_SCAN_PRIORITY_LOW; in ath11k_wmi_start_scan_init()
2203 arg->dwell_time_active = 50; in ath11k_wmi_start_scan_init()
2204 arg->dwell_time_active_2g = 0; in ath11k_wmi_start_scan_init()
2205 arg->dwell_time_passive = 150; in ath11k_wmi_start_scan_init()
2206 arg->dwell_time_active_6g = 40; in ath11k_wmi_start_scan_init()
2207 arg->dwell_time_passive_6g = 30; in ath11k_wmi_start_scan_init()
2208 arg->min_rest_time = 50; in ath11k_wmi_start_scan_init()
2209 arg->max_rest_time = 500; in ath11k_wmi_start_scan_init()
2210 arg->repeat_probe_time = 0; in ath11k_wmi_start_scan_init()
2211 arg->probe_spacing_time = 0; in ath11k_wmi_start_scan_init()
2212 arg->idle_time = 0; in ath11k_wmi_start_scan_init()
2213 arg->max_scan_time = 20000; in ath11k_wmi_start_scan_init()
2214 arg->probe_delay = 5; in ath11k_wmi_start_scan_init()
2215 arg->notify_scan_events = WMI_SCAN_EVENT_STARTED | in ath11k_wmi_start_scan_init()
2220 arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT; in ath11k_wmi_start_scan_init()
2223 ar->ab->wmi_ab.svc_map)) in ath11k_wmi_start_scan_init()
2224 arg->scan_ctrl_flags_ext |= in ath11k_wmi_start_scan_init()
2227 arg->num_bssid = 1; in ath11k_wmi_start_scan_init()
2232 eth_broadcast_addr(arg->bssid_list[0].addr); in ath11k_wmi_start_scan_init()
2240 if (param->scan_ev_started) in ath11k_wmi_copy_scan_event_cntrl_flags()
2241 cmd->notify_scan_events |= WMI_SCAN_EVENT_STARTED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2242 if (param->scan_ev_completed) in ath11k_wmi_copy_scan_event_cntrl_flags()
2243 cmd->notify_scan_events |= WMI_SCAN_EVENT_COMPLETED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2244 if (param->scan_ev_bss_chan) in ath11k_wmi_copy_scan_event_cntrl_flags()
2245 cmd->notify_scan_events |= WMI_SCAN_EVENT_BSS_CHANNEL; in ath11k_wmi_copy_scan_event_cntrl_flags()
2246 if (param->scan_ev_foreign_chan) in ath11k_wmi_copy_scan_event_cntrl_flags()
2247 cmd->notify_scan_events |= WMI_SCAN_EVENT_FOREIGN_CHAN; in ath11k_wmi_copy_scan_event_cntrl_flags()
2248 if (param->scan_ev_dequeued) in ath11k_wmi_copy_scan_event_cntrl_flags()
2249 cmd->notify_scan_events |= WMI_SCAN_EVENT_DEQUEUED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2250 if (param->scan_ev_preempted) in ath11k_wmi_copy_scan_event_cntrl_flags()
2251 cmd->notify_scan_events |= WMI_SCAN_EVENT_PREEMPTED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2252 if (param->scan_ev_start_failed) in ath11k_wmi_copy_scan_event_cntrl_flags()
2253 cmd->notify_scan_events |= WMI_SCAN_EVENT_START_FAILED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2254 if (param->scan_ev_restarted) in ath11k_wmi_copy_scan_event_cntrl_flags()
2255 cmd->notify_scan_events |= WMI_SCAN_EVENT_RESTARTED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2256 if (param->scan_ev_foreign_chn_exit) in ath11k_wmi_copy_scan_event_cntrl_flags()
2257 cmd->notify_scan_events |= WMI_SCAN_EVENT_FOREIGN_CHAN_EXIT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2258 if (param->scan_ev_suspended) in ath11k_wmi_copy_scan_event_cntrl_flags()
2259 cmd->notify_scan_events |= WMI_SCAN_EVENT_SUSPENDED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2260 if (param->scan_ev_resumed) in ath11k_wmi_copy_scan_event_cntrl_flags()
2261 cmd->notify_scan_events |= WMI_SCAN_EVENT_RESUMED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2264 cmd->scan_ctrl_flags = 0; in ath11k_wmi_copy_scan_event_cntrl_flags()
2265 if (param->scan_f_passive) in ath11k_wmi_copy_scan_event_cntrl_flags()
2266 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_PASSIVE; in ath11k_wmi_copy_scan_event_cntrl_flags()
2267 if (param->scan_f_strict_passive_pch) in ath11k_wmi_copy_scan_event_cntrl_flags()
2268 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN; in ath11k_wmi_copy_scan_event_cntrl_flags()
2269 if (param->scan_f_promisc_mode) in ath11k_wmi_copy_scan_event_cntrl_flags()
2270 cmd->scan_ctrl_flags |= WMI_SCAN_FILTER_PROMISCUOS; in ath11k_wmi_copy_scan_event_cntrl_flags()
2271 if (param->scan_f_capture_phy_err) in ath11k_wmi_copy_scan_event_cntrl_flags()
2272 cmd->scan_ctrl_flags |= WMI_SCAN_CAPTURE_PHY_ERROR; in ath11k_wmi_copy_scan_event_cntrl_flags()
2273 if (param->scan_f_half_rate) in ath11k_wmi_copy_scan_event_cntrl_flags()
2274 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_HALF_RATE_SUPPORT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2275 if (param->scan_f_quarter_rate) in ath11k_wmi_copy_scan_event_cntrl_flags()
2276 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_QUARTER_RATE_SUPPORT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2277 if (param->scan_f_cck_rates) in ath11k_wmi_copy_scan_event_cntrl_flags()
2278 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_CCK_RATES; in ath11k_wmi_copy_scan_event_cntrl_flags()
2279 if (param->scan_f_ofdm_rates) in ath11k_wmi_copy_scan_event_cntrl_flags()
2280 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_OFDM_RATES; in ath11k_wmi_copy_scan_event_cntrl_flags()
2281 if (param->scan_f_chan_stat_evnt) in ath11k_wmi_copy_scan_event_cntrl_flags()
2282 cmd->scan_ctrl_flags |= WMI_SCAN_CHAN_STAT_EVENT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2283 if (param->scan_f_filter_prb_req) in ath11k_wmi_copy_scan_event_cntrl_flags()
2284 cmd->scan_ctrl_flags |= WMI_SCAN_FILTER_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2285 if (param->scan_f_bcast_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2286 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_BCAST_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2287 if (param->scan_f_offchan_mgmt_tx) in ath11k_wmi_copy_scan_event_cntrl_flags()
2288 cmd->scan_ctrl_flags |= WMI_SCAN_OFFCHAN_MGMT_TX; in ath11k_wmi_copy_scan_event_cntrl_flags()
2289 if (param->scan_f_offchan_data_tx) in ath11k_wmi_copy_scan_event_cntrl_flags()
2290 cmd->scan_ctrl_flags |= WMI_SCAN_OFFCHAN_DATA_TX; in ath11k_wmi_copy_scan_event_cntrl_flags()
2291 if (param->scan_f_force_active_dfs_chn) in ath11k_wmi_copy_scan_event_cntrl_flags()
2292 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_FORCE_ACTIVE_ON_DFS; in ath11k_wmi_copy_scan_event_cntrl_flags()
2293 if (param->scan_f_add_tpc_ie_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2294 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_TPC_IE_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2295 if (param->scan_f_add_ds_ie_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2296 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_DS_IE_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2297 if (param->scan_f_add_spoofed_mac_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2298 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_SPOOF_MAC_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2299 if (param->scan_f_add_rand_seq_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2300 cmd->scan_ctrl_flags |= WMI_SCAN_RANDOM_SEQ_NO_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2301 if (param->scan_f_en_ie_whitelist_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2302 cmd->scan_ctrl_flags |= in ath11k_wmi_copy_scan_event_cntrl_flags()
2305 /* for adaptive scan mode using 3 bits (21 - 23 bits) */ in ath11k_wmi_copy_scan_event_cntrl_flags()
2306 WMI_SCAN_SET_DWELL_MODE(cmd->scan_ctrl_flags, in ath11k_wmi_copy_scan_event_cntrl_flags()
2307 param->adaptive_dwell_time_mode); in ath11k_wmi_copy_scan_event_cntrl_flags()
2309 cmd->scan_ctrl_flags_ext = param->scan_ctrl_flags_ext; in ath11k_wmi_copy_scan_event_cntrl_flags()
2315 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_scan_start_cmd()
2335 if (params->num_chan) in ath11k_wmi_send_scan_start_cmd()
2336 len += params->num_chan * sizeof(u32); in ath11k_wmi_send_scan_start_cmd()
2339 if (params->num_ssids) in ath11k_wmi_send_scan_start_cmd()
2340 len += params->num_ssids * sizeof(*ssid); in ath11k_wmi_send_scan_start_cmd()
2343 if (params->num_bssid) in ath11k_wmi_send_scan_start_cmd()
2344 len += sizeof(*bssid) * params->num_bssid; in ath11k_wmi_send_scan_start_cmd()
2347 if (params->extraie.len && params->extraie.len <= 0xFFFF) in ath11k_wmi_send_scan_start_cmd()
2349 roundup(params->extraie.len, sizeof(u32)); in ath11k_wmi_send_scan_start_cmd()
2352 if (params->num_hint_bssid) in ath11k_wmi_send_scan_start_cmd()
2354 params->num_hint_bssid * sizeof(struct hint_bssid); in ath11k_wmi_send_scan_start_cmd()
2356 if (params->num_hint_s_ssid) in ath11k_wmi_send_scan_start_cmd()
2358 params->num_hint_s_ssid * sizeof(struct hint_short_ssid); in ath11k_wmi_send_scan_start_cmd()
2360 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_scan_start_cmd()
2362 return -ENOMEM; in ath11k_wmi_send_scan_start_cmd()
2364 ptr = skb->data; in ath11k_wmi_send_scan_start_cmd()
2371 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_START_SCAN_CMD) | in ath11k_wmi_send_scan_start_cmd()
2372 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_scan_start_cmd()
2374 cmd->scan_id = params->scan_id; in ath11k_wmi_send_scan_start_cmd()
2375 cmd->scan_req_id = params->scan_req_id; in ath11k_wmi_send_scan_start_cmd()
2376 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_scan_start_cmd()
2377 cmd->scan_priority = params->scan_priority; in ath11k_wmi_send_scan_start_cmd()
2378 cmd->notify_scan_events = params->notify_scan_events; in ath11k_wmi_send_scan_start_cmd()
2382 cmd->dwell_time_active = params->dwell_time_active; in ath11k_wmi_send_scan_start_cmd()
2383 cmd->dwell_time_active_2g = params->dwell_time_active_2g; in ath11k_wmi_send_scan_start_cmd()
2384 cmd->dwell_time_passive = params->dwell_time_passive; in ath11k_wmi_send_scan_start_cmd()
2385 cmd->dwell_time_active_6g = params->dwell_time_active_6g; in ath11k_wmi_send_scan_start_cmd()
2386 cmd->dwell_time_passive_6g = params->dwell_time_passive_6g; in ath11k_wmi_send_scan_start_cmd()
2387 cmd->min_rest_time = params->min_rest_time; in ath11k_wmi_send_scan_start_cmd()
2388 cmd->max_rest_time = params->max_rest_time; in ath11k_wmi_send_scan_start_cmd()
2389 cmd->repeat_probe_time = params->repeat_probe_time; in ath11k_wmi_send_scan_start_cmd()
2390 cmd->probe_spacing_time = params->probe_spacing_time; in ath11k_wmi_send_scan_start_cmd()
2391 cmd->idle_time = params->idle_time; in ath11k_wmi_send_scan_start_cmd()
2392 cmd->max_scan_time = params->max_scan_time; in ath11k_wmi_send_scan_start_cmd()
2393 cmd->probe_delay = params->probe_delay; in ath11k_wmi_send_scan_start_cmd()
2394 cmd->burst_duration = params->burst_duration; in ath11k_wmi_send_scan_start_cmd()
2395 cmd->num_chan = params->num_chan; in ath11k_wmi_send_scan_start_cmd()
2396 cmd->num_bssid = params->num_bssid; in ath11k_wmi_send_scan_start_cmd()
2397 cmd->num_ssids = params->num_ssids; in ath11k_wmi_send_scan_start_cmd()
2398 cmd->ie_len = params->extraie.len; in ath11k_wmi_send_scan_start_cmd()
2399 cmd->n_probes = params->n_probes; in ath11k_wmi_send_scan_start_cmd()
2400 ether_addr_copy(cmd->mac_addr.addr, params->mac_addr.addr); in ath11k_wmi_send_scan_start_cmd()
2401 ether_addr_copy(cmd->mac_mask.addr, params->mac_mask.addr); in ath11k_wmi_send_scan_start_cmd()
2405 len = params->num_chan * sizeof(u32); in ath11k_wmi_send_scan_start_cmd()
2412 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_send_scan_start_cmd()
2417 for (i = 0; i < params->num_chan; ++i) in ath11k_wmi_send_scan_start_cmd()
2418 tmp_ptr[i] = params->chan_list[i]; in ath11k_wmi_send_scan_start_cmd()
2422 len = params->num_ssids * sizeof(*ssid); in ath11k_wmi_send_scan_start_cmd()
2428 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2433 if (params->num_ssids) { in ath11k_wmi_send_scan_start_cmd()
2439 for (i = 0; i < params->num_ssids; ++i) { in ath11k_wmi_send_scan_start_cmd()
2440 ssid->ssid_len = params->ssid[i].length; in ath11k_wmi_send_scan_start_cmd()
2441 memcpy(ssid->ssid, params->ssid[i].ssid, in ath11k_wmi_send_scan_start_cmd()
2442 params->ssid[i].length); in ath11k_wmi_send_scan_start_cmd()
2447 ptr += (params->num_ssids * sizeof(*ssid)); in ath11k_wmi_send_scan_start_cmd()
2448 len = params->num_bssid * sizeof(*bssid); in ath11k_wmi_send_scan_start_cmd()
2454 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2464 if (params->num_bssid) { in ath11k_wmi_send_scan_start_cmd()
2465 for (i = 0; i < params->num_bssid; ++i) { in ath11k_wmi_send_scan_start_cmd()
2466 ether_addr_copy(bssid->addr, in ath11k_wmi_send_scan_start_cmd()
2467 params->bssid_list[i].addr); in ath11k_wmi_send_scan_start_cmd()
2472 ptr += params->num_bssid * sizeof(*bssid); in ath11k_wmi_send_scan_start_cmd()
2480 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_send_scan_start_cmd()
2485 memcpy(ptr, params->extraie.ptr, in ath11k_wmi_send_scan_start_cmd()
2486 params->extraie.len); in ath11k_wmi_send_scan_start_cmd()
2490 if (params->num_hint_s_ssid) { in ath11k_wmi_send_scan_start_cmd()
2491 len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); in ath11k_wmi_send_scan_start_cmd()
2497 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2505 for (i = 0; i < params->num_hint_s_ssid; ++i) { in ath11k_wmi_send_scan_start_cmd()
2506 s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; in ath11k_wmi_send_scan_start_cmd()
2507 s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; in ath11k_wmi_send_scan_start_cmd()
2513 if (params->num_hint_bssid) { in ath11k_wmi_send_scan_start_cmd()
2514 len = params->num_hint_bssid * sizeof(struct hint_bssid); in ath11k_wmi_send_scan_start_cmd()
2520 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2528 for (i = 0; i < params->num_hint_bssid; ++i) { in ath11k_wmi_send_scan_start_cmd()
2529 hint_bssid->freq_flags = in ath11k_wmi_send_scan_start_cmd()
2530 params->hint_bssid[i].freq_flags; in ath11k_wmi_send_scan_start_cmd()
2531 ether_addr_copy(¶ms->hint_bssid[i].bssid.addr[0], in ath11k_wmi_send_scan_start_cmd()
2532 &hint_bssid->bssid.addr[0]); in ath11k_wmi_send_scan_start_cmd()
2540 ath11k_warn(ar->ab, "failed to send WMI_START_SCAN_CMDID\n"); in ath11k_wmi_send_scan_start_cmd()
2544 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd start scan"); in ath11k_wmi_send_scan_start_cmd()
2552 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_scan_stop_cmd()
2557 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_scan_stop_cmd()
2559 return -ENOMEM; in ath11k_wmi_send_scan_stop_cmd()
2561 cmd = (struct wmi_stop_scan_cmd *)skb->data; in ath11k_wmi_send_scan_stop_cmd()
2563 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_STOP_SCAN_CMD) | in ath11k_wmi_send_scan_stop_cmd()
2564 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_scan_stop_cmd()
2566 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_scan_stop_cmd()
2567 cmd->requestor = param->requester; in ath11k_wmi_send_scan_stop_cmd()
2568 cmd->scan_id = param->scan_id; in ath11k_wmi_send_scan_stop_cmd()
2569 cmd->pdev_id = param->pdev_id; in ath11k_wmi_send_scan_stop_cmd()
2571 if (param->req_type == WLAN_SCAN_CANCEL_PDEV_ALL) { in ath11k_wmi_send_scan_stop_cmd()
2573 cmd->req_type = WMI_SCAN_STOP_ALL; in ath11k_wmi_send_scan_stop_cmd()
2574 } else if (param->req_type == WLAN_SCAN_CANCEL_VDEV_ALL) { in ath11k_wmi_send_scan_stop_cmd()
2576 cmd->req_type = WMI_SCN_STOP_VAP_ALL; in ath11k_wmi_send_scan_stop_cmd()
2577 } else if (param->req_type == WLAN_SCAN_CANCEL_SINGLE) { in ath11k_wmi_send_scan_stop_cmd()
2579 cmd->req_type = WMI_SCAN_STOP_ONE; in ath11k_wmi_send_scan_stop_cmd()
2581 ath11k_warn(ar->ab, "invalid scan cancel param %d", in ath11k_wmi_send_scan_stop_cmd()
2582 param->req_type); in ath11k_wmi_send_scan_stop_cmd()
2584 return -EINVAL; in ath11k_wmi_send_scan_stop_cmd()
2590 ath11k_warn(ar->ab, "failed to send WMI_STOP_SCAN_CMDID\n"); in ath11k_wmi_send_scan_stop_cmd()
2594 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd stop scan"); in ath11k_wmi_send_scan_stop_cmd()
2602 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_scan_chan_list_cmd()
2617 tchan_info = chan_list->ch_param; in ath11k_wmi_send_scan_chan_list_cmd()
2618 while (chan_list->nallchans) { in ath11k_wmi_send_scan_chan_list_cmd()
2620 max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) / in ath11k_wmi_send_scan_chan_list_cmd()
2623 if (chan_list->nallchans > max_chan_limit) in ath11k_wmi_send_scan_chan_list_cmd()
2626 num_send_chans = chan_list->nallchans; in ath11k_wmi_send_scan_chan_list_cmd()
2628 chan_list->nallchans -= num_send_chans; in ath11k_wmi_send_scan_chan_list_cmd()
2631 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_scan_chan_list_cmd()
2633 return -ENOMEM; in ath11k_wmi_send_scan_chan_list_cmd()
2635 cmd = (struct wmi_scan_chan_list_cmd *)skb->data; in ath11k_wmi_send_scan_chan_list_cmd()
2636 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_SCAN_CHAN_LIST_CMD) | in ath11k_wmi_send_scan_chan_list_cmd()
2637 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_scan_chan_list_cmd()
2638 cmd->pdev_id = chan_list->pdev_id; in ath11k_wmi_send_scan_chan_list_cmd()
2639 cmd->num_scan_chans = num_send_chans; in ath11k_wmi_send_scan_chan_list_cmd()
2641 cmd->flags |= WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG; in ath11k_wmi_send_scan_chan_list_cmd()
2643 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_scan_chan_list_cmd()
2645 num_send_chans, len, cmd->pdev_id, num_sends); in ath11k_wmi_send_scan_chan_list_cmd()
2647 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_send_scan_chan_list_cmd()
2655 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_scan_chan_list_cmd()
2656 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_scan_chan_list_cmd()
2667 chan_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_scan_chan_list_cmd()
2670 len - TLV_HDR_SIZE); in ath11k_wmi_send_scan_chan_list_cmd()
2672 reg1 = &chan_info->reg_info_1; in ath11k_wmi_send_scan_chan_list_cmd()
2673 reg2 = &chan_info->reg_info_2; in ath11k_wmi_send_scan_chan_list_cmd()
2674 chan_info->mhz = tchan_info->mhz; in ath11k_wmi_send_scan_chan_list_cmd()
2675 chan_info->band_center_freq1 = tchan_info->cfreq1; in ath11k_wmi_send_scan_chan_list_cmd()
2676 chan_info->band_center_freq2 = tchan_info->cfreq2; in ath11k_wmi_send_scan_chan_list_cmd()
2678 if (tchan_info->is_chan_passive) in ath11k_wmi_send_scan_chan_list_cmd()
2679 chan_info->info |= WMI_CHAN_INFO_PASSIVE; in ath11k_wmi_send_scan_chan_list_cmd()
2680 if (tchan_info->allow_he) in ath11k_wmi_send_scan_chan_list_cmd()
2681 chan_info->info |= WMI_CHAN_INFO_ALLOW_HE; in ath11k_wmi_send_scan_chan_list_cmd()
2682 else if (tchan_info->allow_vht) in ath11k_wmi_send_scan_chan_list_cmd()
2683 chan_info->info |= WMI_CHAN_INFO_ALLOW_VHT; in ath11k_wmi_send_scan_chan_list_cmd()
2684 else if (tchan_info->allow_ht) in ath11k_wmi_send_scan_chan_list_cmd()
2685 chan_info->info |= WMI_CHAN_INFO_ALLOW_HT; in ath11k_wmi_send_scan_chan_list_cmd()
2686 if (tchan_info->half_rate) in ath11k_wmi_send_scan_chan_list_cmd()
2687 chan_info->info |= WMI_CHAN_INFO_HALF_RATE; in ath11k_wmi_send_scan_chan_list_cmd()
2688 if (tchan_info->quarter_rate) in ath11k_wmi_send_scan_chan_list_cmd()
2689 chan_info->info |= WMI_CHAN_INFO_QUARTER_RATE; in ath11k_wmi_send_scan_chan_list_cmd()
2690 if (tchan_info->psc_channel) in ath11k_wmi_send_scan_chan_list_cmd()
2691 chan_info->info |= WMI_CHAN_INFO_PSC; in ath11k_wmi_send_scan_chan_list_cmd()
2692 if (tchan_info->dfs_set) in ath11k_wmi_send_scan_chan_list_cmd()
2693 chan_info->info |= WMI_CHAN_INFO_DFS; in ath11k_wmi_send_scan_chan_list_cmd()
2695 chan_info->info |= FIELD_PREP(WMI_CHAN_INFO_MODE, in ath11k_wmi_send_scan_chan_list_cmd()
2696 tchan_info->phy_mode); in ath11k_wmi_send_scan_chan_list_cmd()
2698 tchan_info->minpower); in ath11k_wmi_send_scan_chan_list_cmd()
2700 tchan_info->maxpower); in ath11k_wmi_send_scan_chan_list_cmd()
2702 tchan_info->maxregpower); in ath11k_wmi_send_scan_chan_list_cmd()
2704 tchan_info->reg_class_id); in ath11k_wmi_send_scan_chan_list_cmd()
2706 tchan_info->antennamax); in ath11k_wmi_send_scan_chan_list_cmd()
2708 tchan_info->maxregpower); in ath11k_wmi_send_scan_chan_list_cmd()
2710 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_scan_chan_list_cmd()
2711 "chan scan list chan[%d] = %u, chan_info->info %8x\n", in ath11k_wmi_send_scan_chan_list_cmd()
2712 i, chan_info->mhz, chan_info->info); in ath11k_wmi_send_scan_chan_list_cmd()
2721 ath11k_warn(ar->ab, "failed to send WMI_SCAN_CHAN_LIST cmd\n"); in ath11k_wmi_send_scan_chan_list_cmd()
2726 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd scan chan list channels %d", in ath11k_wmi_send_scan_chan_list_cmd()
2738 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_wmm_update_cmd_tlv()
2745 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_wmm_update_cmd_tlv()
2747 return -ENOMEM; in ath11k_wmi_send_wmm_update_cmd_tlv()
2749 cmd = (struct wmi_vdev_set_wmm_params_cmd *)skb->data; in ath11k_wmi_send_wmm_update_cmd_tlv()
2750 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_wmm_update_cmd_tlv()
2752 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_wmm_update_cmd_tlv()
2754 cmd->vdev_id = vdev_id; in ath11k_wmi_send_wmm_update_cmd_tlv()
2755 cmd->wmm_param_type = 0; in ath11k_wmi_send_wmm_update_cmd_tlv()
2760 wmi_wmm_arg = ¶m->ac_be; in ath11k_wmi_send_wmm_update_cmd_tlv()
2763 wmi_wmm_arg = ¶m->ac_bk; in ath11k_wmi_send_wmm_update_cmd_tlv()
2766 wmi_wmm_arg = ¶m->ac_vi; in ath11k_wmi_send_wmm_update_cmd_tlv()
2769 wmi_wmm_arg = ¶m->ac_vo; in ath11k_wmi_send_wmm_update_cmd_tlv()
2773 wmm_param = (struct wmi_wmm_params *)&cmd->wmm_params[ac]; in ath11k_wmi_send_wmm_update_cmd_tlv()
2774 wmm_param->tlv_header = in ath11k_wmi_send_wmm_update_cmd_tlv()
2778 sizeof(*wmm_param) - TLV_HDR_SIZE); in ath11k_wmi_send_wmm_update_cmd_tlv()
2780 wmm_param->aifs = wmi_wmm_arg->aifs; in ath11k_wmi_send_wmm_update_cmd_tlv()
2781 wmm_param->cwmin = wmi_wmm_arg->cwmin; in ath11k_wmi_send_wmm_update_cmd_tlv()
2782 wmm_param->cwmax = wmi_wmm_arg->cwmax; in ath11k_wmi_send_wmm_update_cmd_tlv()
2783 wmm_param->txoplimit = wmi_wmm_arg->txop; in ath11k_wmi_send_wmm_update_cmd_tlv()
2784 wmm_param->acm = wmi_wmm_arg->acm; in ath11k_wmi_send_wmm_update_cmd_tlv()
2785 wmm_param->no_ack = wmi_wmm_arg->no_ack; in ath11k_wmi_send_wmm_update_cmd_tlv()
2787 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_wmm_update_cmd_tlv()
2789 ac, wmm_param->aifs, wmm_param->cwmin, in ath11k_wmi_send_wmm_update_cmd_tlv()
2790 wmm_param->cwmax, wmm_param->txoplimit, in ath11k_wmi_send_wmm_update_cmd_tlv()
2791 wmm_param->acm, wmm_param->no_ack); in ath11k_wmi_send_wmm_update_cmd_tlv()
2796 ath11k_warn(ar->ab, in ath11k_wmi_send_wmm_update_cmd_tlv()
2801 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev set wmm params"); in ath11k_wmi_send_wmm_update_cmd_tlv()
2809 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2814 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2816 return -ENOMEM; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2818 cmd = (struct wmi_dfs_phyerr_offload_cmd *)skb->data; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2819 cmd->tlv_header = in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2822 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2824 cmd->pdev_id = pdev_id; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2829 ath11k_warn(ar->ab, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2834 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2843 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_delba_send()
2848 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_delba_send()
2850 return -ENOMEM; in ath11k_wmi_delba_send()
2852 cmd = (struct wmi_delba_send_cmd *)skb->data; in ath11k_wmi_delba_send()
2853 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DELBA_SEND_CMD) | in ath11k_wmi_delba_send()
2854 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_delba_send()
2855 cmd->vdev_id = vdev_id; in ath11k_wmi_delba_send()
2856 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_delba_send()
2857 cmd->tid = tid; in ath11k_wmi_delba_send()
2858 cmd->initiator = initiator; in ath11k_wmi_delba_send()
2859 cmd->reasoncode = reason; in ath11k_wmi_delba_send()
2864 ath11k_warn(ar->ab, in ath11k_wmi_delba_send()
2869 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_delba_send()
2870 "cmd delba send vdev_id 0x%X mac_addr %pM tid %u initiator %u reason %u\n", in ath11k_wmi_delba_send()
2879 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_set_resp()
2884 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_set_resp()
2886 return -ENOMEM; in ath11k_wmi_addba_set_resp()
2888 cmd = (struct wmi_addba_setresponse_cmd *)skb->data; in ath11k_wmi_addba_set_resp()
2889 cmd->tlv_header = in ath11k_wmi_addba_set_resp()
2891 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_set_resp()
2892 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_set_resp()
2893 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_set_resp()
2894 cmd->tid = tid; in ath11k_wmi_addba_set_resp()
2895 cmd->statuscode = status; in ath11k_wmi_addba_set_resp()
2900 ath11k_warn(ar->ab, in ath11k_wmi_addba_set_resp()
2905 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_set_resp()
2906 "cmd addba set resp vdev_id 0x%X mac_addr %pM tid %u status %u\n", in ath11k_wmi_addba_set_resp()
2915 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_send()
2920 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_send()
2922 return -ENOMEM; in ath11k_wmi_addba_send()
2924 cmd = (struct wmi_addba_send_cmd *)skb->data; in ath11k_wmi_addba_send()
2925 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ADDBA_SEND_CMD) | in ath11k_wmi_addba_send()
2926 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_send()
2927 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_send()
2928 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_send()
2929 cmd->tid = tid; in ath11k_wmi_addba_send()
2930 cmd->buffersize = buf_size; in ath11k_wmi_addba_send()
2935 ath11k_warn(ar->ab, in ath11k_wmi_addba_send()
2940 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_send()
2941 "cmd addba send vdev_id 0x%X mac_addr %pM tid %u bufsize %u\n", in ath11k_wmi_addba_send()
2949 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_clear_resp()
2954 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_clear_resp()
2956 return -ENOMEM; in ath11k_wmi_addba_clear_resp()
2958 cmd = (struct wmi_addba_clear_resp_cmd *)skb->data; in ath11k_wmi_addba_clear_resp()
2959 cmd->tlv_header = in ath11k_wmi_addba_clear_resp()
2961 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_clear_resp()
2962 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_clear_resp()
2963 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_clear_resp()
2968 ath11k_warn(ar->ab, in ath11k_wmi_addba_clear_resp()
2973 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_clear_resp()
2974 "cmd addba clear resp vdev_id 0x%X mac_addr %pM\n", in ath11k_wmi_addba_clear_resp()
2982 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_peer_pktlog_filter()
2995 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_peer_pktlog_filter()
2997 return -ENOMEM; in ath11k_wmi_pdev_peer_pktlog_filter()
2999 cmd = (struct wmi_pdev_pktlog_filter_cmd *)skb->data; in ath11k_wmi_pdev_peer_pktlog_filter()
3001 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD) | in ath11k_wmi_pdev_peer_pktlog_filter()
3002 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_peer_pktlog_filter()
3004 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_peer_pktlog_filter()
3005 cmd->num_mac = 1; in ath11k_wmi_pdev_peer_pktlog_filter()
3006 cmd->enable = enable; in ath11k_wmi_pdev_peer_pktlog_filter()
3008 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_peer_pktlog_filter()
3015 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_pdev_peer_pktlog_filter()
3025 ether_addr_copy(info->peer_macaddr.addr, addr); in ath11k_wmi_pdev_peer_pktlog_filter()
3026 info->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO) | in ath11k_wmi_pdev_peer_pktlog_filter()
3028 sizeof(*info) - TLV_HDR_SIZE); in ath11k_wmi_pdev_peer_pktlog_filter()
3033 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_peer_pktlog_filter()
3037 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog filter"); in ath11k_wmi_pdev_peer_pktlog_filter()
3046 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_init_country_cmd()
3051 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_init_country_cmd()
3053 return -ENOMEM; in ath11k_wmi_send_init_country_cmd()
3055 cmd = (struct wmi_init_country_cmd *)skb->data; in ath11k_wmi_send_init_country_cmd()
3056 cmd->tlv_header = in ath11k_wmi_send_init_country_cmd()
3059 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_init_country_cmd()
3061 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_init_country_cmd()
3065 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_ALPHA; in ath11k_wmi_send_init_country_cmd()
3066 memcpy((u8 *)&cmd->cc_info.alpha2, in ath11k_wmi_send_init_country_cmd()
3070 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_COUNTRY_CODE; in ath11k_wmi_send_init_country_cmd()
3071 cmd->cc_info.country_code = init_cc_params.cc_info.country_code; in ath11k_wmi_send_init_country_cmd()
3074 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_REGDOMAIN; in ath11k_wmi_send_init_country_cmd()
3075 cmd->cc_info.regdom_id = init_cc_params.cc_info.regdom_id; in ath11k_wmi_send_init_country_cmd()
3078 ath11k_warn(ar->ab, "unknown cc params flags: 0x%x", in ath11k_wmi_send_init_country_cmd()
3080 ret = -EINVAL; in ath11k_wmi_send_init_country_cmd()
3087 ath11k_warn(ar->ab, in ath11k_wmi_send_init_country_cmd()
3093 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd set init country"); in ath11k_wmi_send_init_country_cmd()
3105 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_set_current_country_cmd()
3110 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_set_current_country_cmd()
3112 return -ENOMEM; in ath11k_wmi_send_set_current_country_cmd()
3114 cmd = (struct wmi_set_current_country_cmd *)skb->data; in ath11k_wmi_send_set_current_country_cmd()
3115 cmd->tlv_header = in ath11k_wmi_send_set_current_country_cmd()
3117 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_set_current_country_cmd()
3119 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_set_current_country_cmd()
3120 memcpy(&cmd->new_alpha2, ¶m->alpha2, 3); in ath11k_wmi_send_set_current_country_cmd()
3124 ath11k_warn(ar->ab, in ath11k_wmi_send_set_current_country_cmd()
3129 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_set_current_country_cmd()
3131 ar->pdev->pdev_id, in ath11k_wmi_send_set_current_country_cmd()
3132 param->alpha2[0], in ath11k_wmi_send_set_current_country_cmd()
3133 param->alpha2[1]); in ath11k_wmi_send_set_current_country_cmd()
3142 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3152 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3154 return -ENOMEM; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3156 cmd = (struct wmi_therm_throt_config_request_cmd *)skb->data; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3158 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_THERM_THROT_CONFIG_REQUEST) | in ath11k_wmi_send_thermal_mitigation_param_cmd()
3159 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3161 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3162 cmd->enable = param->enable; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3163 cmd->dc = param->dc; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3164 cmd->dc_per_event = param->dc_per_event; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3165 cmd->therm_throt_levels = THERMAL_LEVELS; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3167 tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3168 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_thermal_mitigation_param_cmd()
3173 lvl_conf = (struct wmi_therm_throt_level_config_info *)(skb->data + in ath11k_wmi_send_thermal_mitigation_param_cmd()
3177 lvl_conf->tlv_header = in ath11k_wmi_send_thermal_mitigation_param_cmd()
3179 FIELD_PREP(WMI_TLV_LEN, sizeof(*lvl_conf) - TLV_HDR_SIZE); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3181 lvl_conf->temp_lwm = param->levelconf[i].tmplwm; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3182 lvl_conf->temp_hwm = param->levelconf[i].tmphwm; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3183 lvl_conf->dc_off_percent = param->levelconf[i].dcoffpercent; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3184 lvl_conf->prio = param->levelconf[i].priority; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3190 ath11k_warn(ar->ab, "failed to send THERM_THROT_SET_CONF cmd\n"); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3194 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_thermal_mitigation_param_cmd()
3196 ar->pdev->pdev_id, param->enable, param->dc, in ath11k_wmi_send_thermal_mitigation_param_cmd()
3197 param->dc_per_event, THERMAL_LEVELS); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3205 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_11d_scan_start_cmd()
3210 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_11d_scan_start_cmd()
3212 return -ENOMEM; in ath11k_wmi_send_11d_scan_start_cmd()
3214 cmd = (struct wmi_11d_scan_start_cmd *)skb->data; in ath11k_wmi_send_11d_scan_start_cmd()
3215 cmd->tlv_header = in ath11k_wmi_send_11d_scan_start_cmd()
3217 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_11d_scan_start_cmd()
3219 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_11d_scan_start_cmd()
3220 cmd->scan_period_msec = param->scan_period_msec; in ath11k_wmi_send_11d_scan_start_cmd()
3221 cmd->start_interval_msec = param->start_interval_msec; in ath11k_wmi_send_11d_scan_start_cmd()
3225 ath11k_warn(ar->ab, in ath11k_wmi_send_11d_scan_start_cmd()
3230 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_11d_scan_start_cmd()
3232 cmd->vdev_id, in ath11k_wmi_send_11d_scan_start_cmd()
3233 cmd->scan_period_msec, in ath11k_wmi_send_11d_scan_start_cmd()
3234 cmd->start_interval_msec); in ath11k_wmi_send_11d_scan_start_cmd()
3241 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_11d_scan_stop_cmd()
3246 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_11d_scan_stop_cmd()
3248 return -ENOMEM; in ath11k_wmi_send_11d_scan_stop_cmd()
3250 cmd = (struct wmi_11d_scan_stop_cmd *)skb->data; in ath11k_wmi_send_11d_scan_stop_cmd()
3251 cmd->tlv_header = in ath11k_wmi_send_11d_scan_stop_cmd()
3253 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_11d_scan_stop_cmd()
3255 cmd->vdev_id = vdev_id; in ath11k_wmi_send_11d_scan_stop_cmd()
3259 ath11k_warn(ar->ab, in ath11k_wmi_send_11d_scan_stop_cmd()
3264 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_11d_scan_stop_cmd()
3266 cmd->vdev_id); in ath11k_wmi_send_11d_scan_stop_cmd()
3273 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_pktlog_enable()
3278 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_pktlog_enable()
3280 return -ENOMEM; in ath11k_wmi_pdev_pktlog_enable()
3282 cmd = (struct wmi_pktlog_enable_cmd *)skb->data; in ath11k_wmi_pdev_pktlog_enable()
3284 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_ENABLE_CMD) | in ath11k_wmi_pdev_pktlog_enable()
3285 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_pktlog_enable()
3287 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_pktlog_enable()
3288 cmd->evlist = pktlog_filter; in ath11k_wmi_pdev_pktlog_enable()
3289 cmd->enable = ATH11K_WMI_PKTLOG_ENABLE_FORCE; in ath11k_wmi_pdev_pktlog_enable()
3294 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_enable()
3298 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog enable"); in ath11k_wmi_pdev_pktlog_enable()
3305 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_pktlog_disable()
3310 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_pktlog_disable()
3312 return -ENOMEM; in ath11k_wmi_pdev_pktlog_disable()
3314 cmd = (struct wmi_pktlog_disable_cmd *)skb->data; in ath11k_wmi_pdev_pktlog_disable()
3316 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_DISABLE_CMD) | in ath11k_wmi_pdev_pktlog_disable()
3317 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_pktlog_disable()
3319 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_pktlog_disable()
3324 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_disable()
3328 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog disable"); in ath11k_wmi_pdev_pktlog_disable()
3335 twt_params->sta_cong_timer_ms = ATH11K_TWT_DEF_STA_CONG_TIMER_MS; in ath11k_wmi_fill_default_twt_params()
3336 twt_params->default_slot_size = ATH11K_TWT_DEF_DEFAULT_SLOT_SIZE; in ath11k_wmi_fill_default_twt_params()
3337 twt_params->congestion_thresh_setup = ATH11K_TWT_DEF_CONGESTION_THRESH_SETUP; in ath11k_wmi_fill_default_twt_params()
3338 twt_params->congestion_thresh_teardown = in ath11k_wmi_fill_default_twt_params()
3340 twt_params->congestion_thresh_critical = in ath11k_wmi_fill_default_twt_params()
3342 twt_params->interference_thresh_teardown = in ath11k_wmi_fill_default_twt_params()
3344 twt_params->interference_thresh_setup = in ath11k_wmi_fill_default_twt_params()
3346 twt_params->min_no_sta_setup = ATH11K_TWT_DEF_MIN_NO_STA_SETUP; in ath11k_wmi_fill_default_twt_params()
3347 twt_params->min_no_sta_teardown = ATH11K_TWT_DEF_MIN_NO_STA_TEARDOWN; in ath11k_wmi_fill_default_twt_params()
3348 twt_params->no_of_bcast_mcast_slots = ATH11K_TWT_DEF_NO_OF_BCAST_MCAST_SLOTS; in ath11k_wmi_fill_default_twt_params()
3349 twt_params->min_no_twt_slots = ATH11K_TWT_DEF_MIN_NO_TWT_SLOTS; in ath11k_wmi_fill_default_twt_params()
3350 twt_params->max_no_sta_twt = ATH11K_TWT_DEF_MAX_NO_STA_TWT; in ath11k_wmi_fill_default_twt_params()
3351 twt_params->mode_check_interval = ATH11K_TWT_DEF_MODE_CHECK_INTERVAL; in ath11k_wmi_fill_default_twt_params()
3352 twt_params->add_sta_slot_interval = ATH11K_TWT_DEF_ADD_STA_SLOT_INTERVAL; in ath11k_wmi_fill_default_twt_params()
3353 twt_params->remove_sta_slot_interval = in ath11k_wmi_fill_default_twt_params()
3356 twt_params->mbss_support = 0; in ath11k_wmi_fill_default_twt_params()
3362 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_enable_cmd()
3363 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_enable_cmd()
3370 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_enable_cmd()
3372 return -ENOMEM; in ath11k_wmi_send_twt_enable_cmd()
3374 cmd = (struct wmi_twt_enable_params_cmd *)skb->data; in ath11k_wmi_send_twt_enable_cmd()
3375 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ENABLE_CMD) | in ath11k_wmi_send_twt_enable_cmd()
3376 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_enable_cmd()
3377 cmd->pdev_id = pdev_id; in ath11k_wmi_send_twt_enable_cmd()
3378 cmd->sta_cong_timer_ms = params->sta_cong_timer_ms; in ath11k_wmi_send_twt_enable_cmd()
3379 cmd->default_slot_size = params->default_slot_size; in ath11k_wmi_send_twt_enable_cmd()
3380 cmd->congestion_thresh_setup = params->congestion_thresh_setup; in ath11k_wmi_send_twt_enable_cmd()
3381 cmd->congestion_thresh_teardown = params->congestion_thresh_teardown; in ath11k_wmi_send_twt_enable_cmd()
3382 cmd->congestion_thresh_critical = params->congestion_thresh_critical; in ath11k_wmi_send_twt_enable_cmd()
3383 cmd->interference_thresh_teardown = params->interference_thresh_teardown; in ath11k_wmi_send_twt_enable_cmd()
3384 cmd->interference_thresh_setup = params->interference_thresh_setup; in ath11k_wmi_send_twt_enable_cmd()
3385 cmd->min_no_sta_setup = params->min_no_sta_setup; in ath11k_wmi_send_twt_enable_cmd()
3386 cmd->min_no_sta_teardown = params->min_no_sta_teardown; in ath11k_wmi_send_twt_enable_cmd()
3387 cmd->no_of_bcast_mcast_slots = params->no_of_bcast_mcast_slots; in ath11k_wmi_send_twt_enable_cmd()
3388 cmd->min_no_twt_slots = params->min_no_twt_slots; in ath11k_wmi_send_twt_enable_cmd()
3389 cmd->max_no_sta_twt = params->max_no_sta_twt; in ath11k_wmi_send_twt_enable_cmd()
3390 cmd->mode_check_interval = params->mode_check_interval; in ath11k_wmi_send_twt_enable_cmd()
3391 cmd->add_sta_slot_interval = params->add_sta_slot_interval; in ath11k_wmi_send_twt_enable_cmd()
3392 cmd->remove_sta_slot_interval = params->remove_sta_slot_interval; in ath11k_wmi_send_twt_enable_cmd()
3393 cmd->mbss_support = params->mbss_support; in ath11k_wmi_send_twt_enable_cmd()
3402 ar->twt_enabled = 1; in ath11k_wmi_send_twt_enable_cmd()
3412 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_disable_cmd()
3413 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_disable_cmd()
3420 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_disable_cmd()
3422 return -ENOMEM; in ath11k_wmi_send_twt_disable_cmd()
3424 cmd = (struct wmi_twt_disable_params_cmd *)skb->data; in ath11k_wmi_send_twt_disable_cmd()
3425 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_DISABLE_CMD) | in ath11k_wmi_send_twt_disable_cmd()
3426 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_disable_cmd()
3427 cmd->pdev_id = pdev_id; in ath11k_wmi_send_twt_disable_cmd()
3438 ar->twt_enabled = 0; in ath11k_wmi_send_twt_disable_cmd()
3446 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_add_dialog_cmd()
3447 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_add_dialog_cmd()
3454 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_add_dialog_cmd()
3456 return -ENOMEM; in ath11k_wmi_send_twt_add_dialog_cmd()
3458 cmd = (struct wmi_twt_add_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_add_dialog_cmd()
3459 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ADD_DIALOG_CMD) | in ath11k_wmi_send_twt_add_dialog_cmd()
3460 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_add_dialog_cmd()
3462 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_add_dialog_cmd()
3463 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_add_dialog_cmd()
3464 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_add_dialog_cmd()
3465 cmd->wake_intvl_us = params->wake_intvl_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3466 cmd->wake_intvl_mantis = params->wake_intvl_mantis; in ath11k_wmi_send_twt_add_dialog_cmd()
3467 cmd->wake_dura_us = params->wake_dura_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3468 cmd->sp_offset_us = params->sp_offset_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3469 cmd->flags = params->twt_cmd; in ath11k_wmi_send_twt_add_dialog_cmd()
3470 if (params->flag_bcast) in ath11k_wmi_send_twt_add_dialog_cmd()
3471 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_BCAST; in ath11k_wmi_send_twt_add_dialog_cmd()
3472 if (params->flag_trigger) in ath11k_wmi_send_twt_add_dialog_cmd()
3473 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_TRIGGER; in ath11k_wmi_send_twt_add_dialog_cmd()
3474 if (params->flag_flow_type) in ath11k_wmi_send_twt_add_dialog_cmd()
3475 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_FLOW_TYPE; in ath11k_wmi_send_twt_add_dialog_cmd()
3476 if (params->flag_protection) in ath11k_wmi_send_twt_add_dialog_cmd()
3477 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_PROTECTION; in ath11k_wmi_send_twt_add_dialog_cmd()
3488 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_add_dialog_cmd()
3490 cmd->vdev_id, cmd->dialog_id, cmd->wake_intvl_us, in ath11k_wmi_send_twt_add_dialog_cmd()
3491 cmd->wake_intvl_mantis, cmd->wake_dura_us, cmd->sp_offset_us, in ath11k_wmi_send_twt_add_dialog_cmd()
3492 cmd->flags); in ath11k_wmi_send_twt_add_dialog_cmd()
3500 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_del_dialog_cmd()
3501 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_del_dialog_cmd()
3508 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_del_dialog_cmd()
3510 return -ENOMEM; in ath11k_wmi_send_twt_del_dialog_cmd()
3512 cmd = (struct wmi_twt_del_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_del_dialog_cmd()
3513 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_DEL_DIALOG_CMD) | in ath11k_wmi_send_twt_del_dialog_cmd()
3514 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_del_dialog_cmd()
3516 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_del_dialog_cmd()
3517 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_del_dialog_cmd()
3518 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_del_dialog_cmd()
3529 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_del_dialog_cmd()
3531 cmd->vdev_id, cmd->dialog_id); in ath11k_wmi_send_twt_del_dialog_cmd()
3539 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_pause_dialog_cmd()
3540 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_pause_dialog_cmd()
3547 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_pause_dialog_cmd()
3549 return -ENOMEM; in ath11k_wmi_send_twt_pause_dialog_cmd()
3551 cmd = (struct wmi_twt_pause_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_pause_dialog_cmd()
3552 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_twt_pause_dialog_cmd()
3554 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_pause_dialog_cmd()
3556 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_pause_dialog_cmd()
3557 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_pause_dialog_cmd()
3558 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_pause_dialog_cmd()
3569 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_pause_dialog_cmd()
3571 cmd->vdev_id, cmd->dialog_id); in ath11k_wmi_send_twt_pause_dialog_cmd()
3579 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_resume_dialog_cmd()
3580 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_resume_dialog_cmd()
3587 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_resume_dialog_cmd()
3589 return -ENOMEM; in ath11k_wmi_send_twt_resume_dialog_cmd()
3591 cmd = (struct wmi_twt_resume_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_resume_dialog_cmd()
3592 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_twt_resume_dialog_cmd()
3594 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_resume_dialog_cmd()
3596 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_resume_dialog_cmd()
3597 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_resume_dialog_cmd()
3598 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_resume_dialog_cmd()
3599 cmd->sp_offset_us = params->sp_offset_us; in ath11k_wmi_send_twt_resume_dialog_cmd()
3600 cmd->next_twt_size = params->next_twt_size; in ath11k_wmi_send_twt_resume_dialog_cmd()
3611 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_resume_dialog_cmd()
3613 cmd->vdev_id, cmd->dialog_id, cmd->sp_offset_us, in ath11k_wmi_send_twt_resume_dialog_cmd()
3614 cmd->next_twt_size); in ath11k_wmi_send_twt_resume_dialog_cmd()
3623 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_obss_spr_cmd()
3624 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_spr_cmd()
3631 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_obss_spr_cmd()
3633 return -ENOMEM; in ath11k_wmi_send_obss_spr_cmd()
3635 cmd = (struct wmi_obss_spatial_reuse_params_cmd *)skb->data; in ath11k_wmi_send_obss_spr_cmd()
3636 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_obss_spr_cmd()
3638 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_obss_spr_cmd()
3639 cmd->vdev_id = vdev_id; in ath11k_wmi_send_obss_spr_cmd()
3640 cmd->enable = he_obss_pd->enable; in ath11k_wmi_send_obss_spr_cmd()
3641 cmd->obss_min = he_obss_pd->min_offset; in ath11k_wmi_send_obss_spr_cmd()
3642 cmd->obss_max = he_obss_pd->max_offset; in ath11k_wmi_send_obss_spr_cmd()
3661 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3662 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3669 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3671 return -ENOMEM; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3673 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3674 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3676 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3677 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3678 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3689 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3691 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3699 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3700 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3707 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3709 return -ENOMEM; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3711 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3712 cmd->tlv_header = in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3715 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3716 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3717 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3728 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3730 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3738 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3739 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3746 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3748 return -ENOMEM; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3750 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3751 cmd->tlv_header = in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3754 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3755 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3756 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3767 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3769 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3777 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3778 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3785 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3787 return -ENOMEM; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3789 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3790 cmd->tlv_header = in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3793 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3794 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3795 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3806 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3808 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3816 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3817 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3824 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3826 return -ENOMEM; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3828 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3829 cmd->tlv_header = in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3832 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3833 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3834 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3845 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3847 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3855 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3856 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3863 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3865 return -ENOMEM; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3867 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3868 cmd->tlv_header = in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3871 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3872 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3873 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3884 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3886 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3896 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3897 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3904 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3906 return -ENOMEM; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3908 cmd = (struct wmi_obss_color_collision_cfg_params_cmd *)skb->data; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3909 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3911 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3912 cmd->vdev_id = vdev_id; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3913 cmd->evt_type = enable ? ATH11K_OBSS_COLOR_COLLISION_DETECTION : in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3915 cmd->current_bss_color = bss_color; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3916 cmd->detection_period_ms = period; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3917 cmd->scan_period_ms = ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3918 cmd->free_slot_expiry_time_ms = 0; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3919 cmd->flags = 0; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3929 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3931 cmd->vdev_id, cmd->evt_type, cmd->current_bss_color, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3932 cmd->detection_period_ms, cmd->scan_period_ms); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3940 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_bss_color_change_enable_cmd()
3941 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_bss_color_change_enable_cmd()
3948 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_bss_color_change_enable_cmd()
3950 return -ENOMEM; in ath11k_wmi_send_bss_color_change_enable_cmd()
3952 cmd = (struct wmi_bss_color_change_enable_params_cmd *)skb->data; in ath11k_wmi_send_bss_color_change_enable_cmd()
3953 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_BSS_COLOR_CHANGE_ENABLE) | in ath11k_wmi_send_bss_color_change_enable_cmd()
3954 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_bss_color_change_enable_cmd()
3955 cmd->vdev_id = vdev_id; in ath11k_wmi_send_bss_color_change_enable_cmd()
3956 cmd->enable = enable ? 1 : 0; in ath11k_wmi_send_bss_color_change_enable_cmd()
3966 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bss_color_change_enable_cmd()
3968 cmd->vdev_id, cmd->enable); in ath11k_wmi_send_bss_color_change_enable_cmd()
3983 aligned_len = roundup(tmpl->len, 4); in ath11k_wmi_fils_discovery_tmpl()
3986 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery_tmpl()
3989 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_fils_discovery_tmpl()
3991 return -ENOMEM; in ath11k_wmi_fils_discovery_tmpl()
3993 cmd = (struct wmi_fils_discovery_tmpl_cmd *)skb->data; in ath11k_wmi_fils_discovery_tmpl()
3994 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_fils_discovery_tmpl()
3996 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_fils_discovery_tmpl()
3997 cmd->vdev_id = vdev_id; in ath11k_wmi_fils_discovery_tmpl()
3998 cmd->buf_len = tmpl->len; in ath11k_wmi_fils_discovery_tmpl()
3999 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_fils_discovery_tmpl()
4002 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_fils_discovery_tmpl()
4004 memcpy(tlv->value, tmpl->data, tmpl->len); in ath11k_wmi_fils_discovery_tmpl()
4006 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_FILS_DISCOVERY_TMPL_CMDID); in ath11k_wmi_fils_discovery_tmpl()
4008 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery_tmpl()
4015 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd fils discovery tmpl"); in ath11k_wmi_fils_discovery_tmpl()
4033 size_t aligned_len = roundup(tmpl->len, 4); in ath11k_wmi_probe_resp_tmpl()
4035 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_probe_resp_tmpl()
4040 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_probe_resp_tmpl()
4042 return -ENOMEM; in ath11k_wmi_probe_resp_tmpl()
4044 cmd = (struct wmi_probe_tmpl_cmd *)skb->data; in ath11k_wmi_probe_resp_tmpl()
4045 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PRB_TMPL_CMD) | in ath11k_wmi_probe_resp_tmpl()
4046 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_probe_resp_tmpl()
4047 cmd->vdev_id = vdev_id; in ath11k_wmi_probe_resp_tmpl()
4048 cmd->buf_len = tmpl->len; in ath11k_wmi_probe_resp_tmpl()
4050 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_probe_resp_tmpl()
4058 probe_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_probe_resp_tmpl()
4060 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_probe_resp_tmpl()
4061 probe_info->caps = 0; in ath11k_wmi_probe_resp_tmpl()
4062 probe_info->erp = 0; in ath11k_wmi_probe_resp_tmpl()
4071 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_probe_resp_tmpl()
4073 memcpy(tlv->value, tmpl->data, tmpl->len); in ath11k_wmi_probe_resp_tmpl()
4075 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_PRB_TMPL_CMDID); in ath11k_wmi_probe_resp_tmpl()
4077 ath11k_warn(ar->ab, in ath11k_wmi_probe_resp_tmpl()
4084 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd "); in ath11k_wmi_probe_resp_tmpl()
4096 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery()
4103 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_fils_discovery()
4105 return -ENOMEM; in ath11k_wmi_fils_discovery()
4107 cmd = (struct wmi_fils_discovery_cmd *)skb->data; in ath11k_wmi_fils_discovery()
4108 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ENABLE_FILS_CMD) | in ath11k_wmi_fils_discovery()
4109 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_fils_discovery()
4110 cmd->vdev_id = vdev_id; in ath11k_wmi_fils_discovery()
4111 cmd->interval = interval; in ath11k_wmi_fils_discovery()
4112 cmd->config = unsol_bcast_probe_resp_enabled; in ath11k_wmi_fils_discovery()
4114 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_ENABLE_FILS_CMDID); in ath11k_wmi_fils_discovery()
4116 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery()
4123 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd enable fils"); in ath11k_wmi_fils_discovery()
4136 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_obss_color_collision_event()
4153 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); in ath11k_wmi_obss_color_collision_event()
4156 ev->vdev_id); in ath11k_wmi_obss_color_collision_event()
4160 switch (ev->evt_type) { in ath11k_wmi_obss_color_collision_event()
4162 ieee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap, in ath11k_wmi_obss_color_collision_event()
4167 ev->vdev_id, ev->evt_type, ev->obss_color_bitmap); in ath11k_wmi_obss_color_collision_event()
4170 ev->vdev_id, ev->evt_type, (uintmax_t)ev->obss_color_bitmap); in ath11k_wmi_obss_color_collision_event()
4194 for (i = 0; i < soc->num_radios; i++) { in ath11k_fill_band_to_mac_param()
4195 pdev = &soc->pdevs[i]; in ath11k_fill_band_to_mac_param()
4196 hal_reg_cap = &soc->hal_reg_cap[i]; in ath11k_fill_band_to_mac_param()
4197 band_to_mac[i].pdev_id = pdev->pdev_id; in ath11k_fill_band_to_mac_param()
4199 switch (pdev->cap.supported_bands) { in ath11k_fill_band_to_mac_param()
4201 band_to_mac[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath11k_fill_band_to_mac_param()
4202 band_to_mac[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath11k_fill_band_to_mac_param()
4205 band_to_mac[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath11k_fill_band_to_mac_param()
4206 band_to_mac[i].end_freq = hal_reg_cap->high_2ghz_chan; in ath11k_fill_band_to_mac_param()
4209 band_to_mac[i].start_freq = hal_reg_cap->low_5ghz_chan; in ath11k_fill_band_to_mac_param()
4210 band_to_mac[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath11k_fill_band_to_mac_param()
4222 wmi_cfg->num_vdevs = tg_cfg->num_vdevs; in ath11k_wmi_copy_resource_config()
4223 wmi_cfg->num_peers = tg_cfg->num_peers; in ath11k_wmi_copy_resource_config()
4224 wmi_cfg->num_offload_peers = tg_cfg->num_offload_peers; in ath11k_wmi_copy_resource_config()
4225 wmi_cfg->num_offload_reorder_buffs = tg_cfg->num_offload_reorder_buffs; in ath11k_wmi_copy_resource_config()
4226 wmi_cfg->num_peer_keys = tg_cfg->num_peer_keys; in ath11k_wmi_copy_resource_config()
4227 wmi_cfg->num_tids = tg_cfg->num_tids; in ath11k_wmi_copy_resource_config()
4228 wmi_cfg->ast_skid_limit = tg_cfg->ast_skid_limit; in ath11k_wmi_copy_resource_config()
4229 wmi_cfg->tx_chain_mask = tg_cfg->tx_chain_mask; in ath11k_wmi_copy_resource_config()
4230 wmi_cfg->rx_chain_mask = tg_cfg->rx_chain_mask; in ath11k_wmi_copy_resource_config()
4231 wmi_cfg->rx_timeout_pri[0] = tg_cfg->rx_timeout_pri[0]; in ath11k_wmi_copy_resource_config()
4232 wmi_cfg->rx_timeout_pri[1] = tg_cfg->rx_timeout_pri[1]; in ath11k_wmi_copy_resource_config()
4233 wmi_cfg->rx_timeout_pri[2] = tg_cfg->rx_timeout_pri[2]; in ath11k_wmi_copy_resource_config()
4234 wmi_cfg->rx_timeout_pri[3] = tg_cfg->rx_timeout_pri[3]; in ath11k_wmi_copy_resource_config()
4235 wmi_cfg->rx_decap_mode = tg_cfg->rx_decap_mode; in ath11k_wmi_copy_resource_config()
4236 wmi_cfg->scan_max_pending_req = tg_cfg->scan_max_pending_req; in ath11k_wmi_copy_resource_config()
4237 wmi_cfg->bmiss_offload_max_vdev = tg_cfg->bmiss_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4238 wmi_cfg->roam_offload_max_vdev = tg_cfg->roam_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4239 wmi_cfg->roam_offload_max_ap_profiles = in ath11k_wmi_copy_resource_config()
4240 tg_cfg->roam_offload_max_ap_profiles; in ath11k_wmi_copy_resource_config()
4241 wmi_cfg->num_mcast_groups = tg_cfg->num_mcast_groups; in ath11k_wmi_copy_resource_config()
4242 wmi_cfg->num_mcast_table_elems = tg_cfg->num_mcast_table_elems; in ath11k_wmi_copy_resource_config()
4243 wmi_cfg->mcast2ucast_mode = tg_cfg->mcast2ucast_mode; in ath11k_wmi_copy_resource_config()
4244 wmi_cfg->tx_dbg_log_size = tg_cfg->tx_dbg_log_size; in ath11k_wmi_copy_resource_config()
4245 wmi_cfg->num_wds_entries = tg_cfg->num_wds_entries; in ath11k_wmi_copy_resource_config()
4246 wmi_cfg->dma_burst_size = tg_cfg->dma_burst_size; in ath11k_wmi_copy_resource_config()
4247 wmi_cfg->mac_aggr_delim = tg_cfg->mac_aggr_delim; in ath11k_wmi_copy_resource_config()
4248 wmi_cfg->rx_skip_defrag_timeout_dup_detection_check = in ath11k_wmi_copy_resource_config()
4249 tg_cfg->rx_skip_defrag_timeout_dup_detection_check; in ath11k_wmi_copy_resource_config()
4250 wmi_cfg->vow_config = tg_cfg->vow_config; in ath11k_wmi_copy_resource_config()
4251 wmi_cfg->gtk_offload_max_vdev = tg_cfg->gtk_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4252 wmi_cfg->num_msdu_desc = tg_cfg->num_msdu_desc; in ath11k_wmi_copy_resource_config()
4253 wmi_cfg->max_frag_entries = tg_cfg->max_frag_entries; in ath11k_wmi_copy_resource_config()
4254 wmi_cfg->num_tdls_vdevs = tg_cfg->num_tdls_vdevs; in ath11k_wmi_copy_resource_config()
4255 wmi_cfg->num_tdls_conn_table_entries = in ath11k_wmi_copy_resource_config()
4256 tg_cfg->num_tdls_conn_table_entries; in ath11k_wmi_copy_resource_config()
4257 wmi_cfg->beacon_tx_offload_max_vdev = in ath11k_wmi_copy_resource_config()
4258 tg_cfg->beacon_tx_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4259 wmi_cfg->num_multicast_filter_entries = in ath11k_wmi_copy_resource_config()
4260 tg_cfg->num_multicast_filter_entries; in ath11k_wmi_copy_resource_config()
4261 wmi_cfg->num_wow_filters = tg_cfg->num_wow_filters; in ath11k_wmi_copy_resource_config()
4262 wmi_cfg->num_keep_alive_pattern = tg_cfg->num_keep_alive_pattern; in ath11k_wmi_copy_resource_config()
4263 wmi_cfg->keep_alive_pattern_size = tg_cfg->keep_alive_pattern_size; in ath11k_wmi_copy_resource_config()
4264 wmi_cfg->max_tdls_concurrent_sleep_sta = in ath11k_wmi_copy_resource_config()
4265 tg_cfg->max_tdls_concurrent_sleep_sta; in ath11k_wmi_copy_resource_config()
4266 wmi_cfg->max_tdls_concurrent_buffer_sta = in ath11k_wmi_copy_resource_config()
4267 tg_cfg->max_tdls_concurrent_buffer_sta; in ath11k_wmi_copy_resource_config()
4268 wmi_cfg->wmi_send_separate = tg_cfg->wmi_send_separate; in ath11k_wmi_copy_resource_config()
4269 wmi_cfg->num_ocb_vdevs = tg_cfg->num_ocb_vdevs; in ath11k_wmi_copy_resource_config()
4270 wmi_cfg->num_ocb_channels = tg_cfg->num_ocb_channels; in ath11k_wmi_copy_resource_config()
4271 wmi_cfg->num_ocb_schedules = tg_cfg->num_ocb_schedules; in ath11k_wmi_copy_resource_config()
4272 wmi_cfg->bpf_instruction_size = tg_cfg->bpf_instruction_size; in ath11k_wmi_copy_resource_config()
4273 wmi_cfg->max_bssid_rx_filters = tg_cfg->max_bssid_rx_filters; in ath11k_wmi_copy_resource_config()
4274 wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id; in ath11k_wmi_copy_resource_config()
4275 wmi_cfg->flag1 = tg_cfg->flag1; in ath11k_wmi_copy_resource_config()
4276 wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support; in ath11k_wmi_copy_resource_config()
4277 wmi_cfg->sched_params = tg_cfg->sched_params; in ath11k_wmi_copy_resource_config()
4278 wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; in ath11k_wmi_copy_resource_config()
4279 wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count; in ath11k_wmi_copy_resource_config()
4280 wmi_cfg->host_service_flags &= in ath11k_wmi_copy_resource_config()
4282 wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported << in ath11k_wmi_copy_resource_config()
4284 wmi_cfg->flags2 = WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET; in ath11k_wmi_copy_resource_config()
4285 wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt; in ath11k_wmi_copy_resource_config()
4286 wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period; in ath11k_wmi_copy_resource_config()
4292 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_init_cmd_send()
4309 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) in ath11k_init_cmd_send()
4311 (param->num_band_to_mac * sizeof(*band_to_mac)); in ath11k_init_cmd_send()
4314 (param->num_mem_chunks ? (sizeof(*host_mem_chunks) * WMI_MAX_MEM_REQS) : 0); in ath11k_init_cmd_send()
4316 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_init_cmd_send()
4318 return -ENOMEM; in ath11k_init_cmd_send()
4320 cmd = (struct wmi_init_cmd *)skb->data; in ath11k_init_cmd_send()
4322 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_INIT_CMD) | in ath11k_init_cmd_send()
4323 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4325 ptr = skb->data + sizeof(*cmd); in ath11k_init_cmd_send()
4332 ath11k_wmi_copy_resource_config(cfg, param->res_cfg); in ath11k_init_cmd_send()
4334 cfg->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_RESOURCE_CONFIG) | in ath11k_init_cmd_send()
4335 FIELD_PREP(WMI_TLV_LEN, sizeof(*cfg) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4345 for (idx = 0; idx < param->num_mem_chunks; ++idx) { in ath11k_init_cmd_send()
4351 host_mem_chunks[idx].ptr = param->mem_chunks[idx].paddr; in ath11k_init_cmd_send()
4352 host_mem_chunks[idx].size = param->mem_chunks[idx].len; in ath11k_init_cmd_send()
4353 host_mem_chunks[idx].req_id = param->mem_chunks[idx].req_id; in ath11k_init_cmd_send()
4358 param->mem_chunks[idx].req_id, in ath11k_init_cmd_send()
4359 (u64)param->mem_chunks[idx].paddr, in ath11k_init_cmd_send()
4362 param->mem_chunks[idx].req_id, in ath11k_init_cmd_send()
4363 (uintmax_t)param->mem_chunks[idx].paddr, in ath11k_init_cmd_send()
4365 param->mem_chunks[idx].len); in ath11k_init_cmd_send()
4367 cmd->num_host_mem_chunks = param->num_mem_chunks; in ath11k_init_cmd_send()
4368 len = sizeof(struct wlan_host_mem_chunk) * param->num_mem_chunks; in ath11k_init_cmd_send()
4376 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_init_cmd_send()
4380 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) { in ath11k_init_cmd_send()
4382 hw_mode->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_init_cmd_send()
4385 sizeof(*hw_mode) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4387 hw_mode->hw_mode_index = param->hw_mode_id; in ath11k_init_cmd_send()
4388 hw_mode->num_band_to_mac = param->num_band_to_mac; in ath11k_init_cmd_send()
4392 len = param->num_band_to_mac * sizeof(*band_to_mac); in ath11k_init_cmd_send()
4398 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_init_cmd_send()
4404 for (idx = 0; idx < param->num_band_to_mac; idx++) { in ath11k_init_cmd_send()
4407 band_to_mac->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_init_cmd_send()
4410 len - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4411 band_to_mac->pdev_id = param->band_to_mac[idx].pdev_id; in ath11k_init_cmd_send()
4412 band_to_mac->start_freq = in ath11k_init_cmd_send()
4413 param->band_to_mac[idx].start_freq; in ath11k_init_cmd_send()
4414 band_to_mac->end_freq = in ath11k_init_cmd_send()
4415 param->band_to_mac[idx].end_freq; in ath11k_init_cmd_send()
4439 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_lro_cfg()
4441 return -ENOMEM; in ath11k_wmi_pdev_lro_cfg()
4443 cmd = (struct ath11k_wmi_pdev_lro_config_cmd *)skb->data; in ath11k_wmi_pdev_lro_cfg()
4444 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_LRO_INFO_CMD) | in ath11k_wmi_pdev_lro_cfg()
4445 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_lro_cfg()
4447 get_random_bytes(cmd->th_4, sizeof(uint32_t) * ATH11K_IPV4_TH_SEED_SIZE); in ath11k_wmi_pdev_lro_cfg()
4448 get_random_bytes(cmd->th_6, sizeof(uint32_t) * ATH11K_IPV6_TH_SEED_SIZE); in ath11k_wmi_pdev_lro_cfg()
4450 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_lro_cfg()
4452 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_LRO_CONFIG_CMDID); in ath11k_wmi_pdev_lro_cfg()
4454 ath11k_warn(ar->ab, in ath11k_wmi_pdev_lro_cfg()
4459 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_lro_cfg()
4471 time_left = wait_for_completion_timeout(&ab->wmi_ab.service_ready, in ath11k_wmi_wait_for_service_ready()
4474 return -ETIMEDOUT; in ath11k_wmi_wait_for_service_ready()
4483 time_left = wait_for_completion_timeout(&ab->wmi_ab.unified_ready, in ath11k_wmi_wait_for_unified_ready()
4486 return -ETIMEDOUT; in ath11k_wmi_wait_for_unified_ready()
4496 struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab; in ath11k_wmi_set_hw_mode()
4504 return -ENOMEM; in ath11k_wmi_set_hw_mode()
4506 cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data; in ath11k_wmi_set_hw_mode()
4508 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) | in ath11k_wmi_set_hw_mode()
4509 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_hw_mode()
4511 cmd->pdev_id = WMI_PDEV_ID_SOC; in ath11k_wmi_set_hw_mode()
4512 cmd->hw_mode_index = mode; in ath11k_wmi_set_hw_mode()
4514 ret = ath11k_wmi_cmd_send(&wmi_ab->wmi[0], skb, WMI_PDEV_SET_HW_MODE_CMDID); in ath11k_wmi_set_hw_mode()
4521 ath11k_dbg(ab, ATH11K_DBG_WMI, "cmd pdev set hw mode %d", cmd->hw_mode_index); in ath11k_wmi_set_hw_mode()
4528 struct ath11k_wmi_base *wmi_sc = &ab->wmi_ab; in ath11k_wmi_cmd_init()
4535 ab->hw_params.hw_ops->wmi_init_config(ab, &config); in ath11k_wmi_cmd_init()
4538 ab->wmi_ab.svc_map)) in ath11k_wmi_cmd_init()
4541 memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config)); in ath11k_wmi_cmd_init()
4543 init_param.res_cfg = &wmi_sc->wlan_resource_config; in ath11k_wmi_cmd_init()
4544 init_param.num_mem_chunks = wmi_sc->num_mem_chunks; in ath11k_wmi_cmd_init()
4545 init_param.hw_mode_id = wmi_sc->preferred_hw_mode; in ath11k_wmi_cmd_init()
4546 init_param.mem_chunks = wmi_sc->mem_chunks; in ath11k_wmi_cmd_init()
4548 if (ab->hw_params.single_pdev_only) in ath11k_wmi_cmd_init()
4551 init_param.num_band_to_mac = ab->num_radios; in ath11k_wmi_cmd_init()
4554 return ath11k_init_cmd_send(&wmi_sc->wmi[0], &init_param); in ath11k_wmi_cmd_init()
4564 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_spectral_conf()
4566 return -ENOMEM; in ath11k_wmi_vdev_spectral_conf()
4568 cmd = (struct ath11k_wmi_vdev_spectral_conf_cmd *)skb->data; in ath11k_wmi_vdev_spectral_conf()
4569 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_spectral_conf()
4571 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_spectral_conf()
4573 memcpy(&cmd->param, param, sizeof(*param)); in ath11k_wmi_vdev_spectral_conf()
4575 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_vdev_spectral_conf()
4578 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_conf()
4583 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_conf()
4585 param->vdev_id); in ath11k_wmi_vdev_spectral_conf()
4600 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_spectral_enable()
4602 return -ENOMEM; in ath11k_wmi_vdev_spectral_enable()
4604 cmd = (struct ath11k_wmi_vdev_spectral_enable_cmd *)skb->data; in ath11k_wmi_vdev_spectral_enable()
4605 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_spectral_enable()
4607 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_spectral_enable()
4609 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_spectral_enable()
4610 cmd->trigger_cmd = trigger; in ath11k_wmi_vdev_spectral_enable()
4611 cmd->enable_cmd = enable; in ath11k_wmi_vdev_spectral_enable()
4613 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_vdev_spectral_enable()
4616 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_enable()
4621 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_enable()
4638 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_dma_ring_cfg()
4640 return -ENOMEM; in ath11k_wmi_pdev_dma_ring_cfg()
4642 cmd = (struct ath11k_wmi_pdev_dma_ring_cfg_req_cmd *)skb->data; in ath11k_wmi_pdev_dma_ring_cfg()
4643 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DMA_RING_CFG_REQ) | in ath11k_wmi_pdev_dma_ring_cfg()
4644 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_dma_ring_cfg()
4646 cmd->pdev_id = param->pdev_id; in ath11k_wmi_pdev_dma_ring_cfg()
4647 cmd->module_id = param->module_id; in ath11k_wmi_pdev_dma_ring_cfg()
4648 cmd->base_paddr_lo = param->base_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4649 cmd->base_paddr_hi = param->base_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4650 cmd->head_idx_paddr_lo = param->head_idx_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4651 cmd->head_idx_paddr_hi = param->head_idx_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4652 cmd->tail_idx_paddr_lo = param->tail_idx_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4653 cmd->tail_idx_paddr_hi = param->tail_idx_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4654 cmd->num_elems = param->num_elems; in ath11k_wmi_pdev_dma_ring_cfg()
4655 cmd->buf_size = param->buf_size; in ath11k_wmi_pdev_dma_ring_cfg()
4656 cmd->num_resp_per_event = param->num_resp_per_event; in ath11k_wmi_pdev_dma_ring_cfg()
4657 cmd->event_timeout_ms = param->event_timeout_ms; in ath11k_wmi_pdev_dma_ring_cfg()
4659 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_pdev_dma_ring_cfg()
4662 ath11k_warn(ar->ab, in ath11k_wmi_pdev_dma_ring_cfg()
4667 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_dma_ring_cfg()
4669 param->pdev_id); in ath11k_wmi_pdev_dma_ring_cfg()
4684 return -EPROTO; in ath11k_wmi_tlv_dma_buf_entry_parse()
4686 if (parse->num_buf_entry >= parse->fixed.num_buf_release_entry) in ath11k_wmi_tlv_dma_buf_entry_parse()
4687 return -ENOBUFS; in ath11k_wmi_tlv_dma_buf_entry_parse()
4689 parse->num_buf_entry++; in ath11k_wmi_tlv_dma_buf_entry_parse()
4700 return -EPROTO; in ath11k_wmi_tlv_dma_buf_meta_parse()
4702 if (parse->num_meta >= parse->fixed.num_meta_data_entry) in ath11k_wmi_tlv_dma_buf_meta_parse()
4703 return -ENOBUFS; in ath11k_wmi_tlv_dma_buf_meta_parse()
4705 parse->num_meta++; in ath11k_wmi_tlv_dma_buf_meta_parse()
4718 memcpy(&parse->fixed, ptr, in ath11k_wmi_tlv_dma_buf_parse()
4720 parse->fixed.pdev_id = DP_HW2SW_MACID(parse->fixed.pdev_id); in ath11k_wmi_tlv_dma_buf_parse()
4723 if (!parse->buf_entry_done) { in ath11k_wmi_tlv_dma_buf_parse()
4724 parse->num_buf_entry = 0; in ath11k_wmi_tlv_dma_buf_parse()
4726 parse->buf_entry = (struct wmi_dma_buf_release_entry *)ptr; in ath11k_wmi_tlv_dma_buf_parse()
4728 parse->buf_entry = ptr; in ath11k_wmi_tlv_dma_buf_parse()
4740 parse->buf_entry_done = true; in ath11k_wmi_tlv_dma_buf_parse()
4741 } else if (!parse->meta_data_done) { in ath11k_wmi_tlv_dma_buf_parse()
4742 parse->num_meta = 0; in ath11k_wmi_tlv_dma_buf_parse()
4744 parse->meta_data = (struct wmi_dma_buf_release_meta_data *)ptr; in ath11k_wmi_tlv_dma_buf_parse()
4746 parse->meta_data = ptr; in ath11k_wmi_tlv_dma_buf_parse()
4758 parse->meta_data_done = true; in ath11k_wmi_tlv_dma_buf_parse()
4774 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pdev_dma_ring_buf_release_event()
4806 return -EPROTO; in ath11k_wmi_tlv_hw_mode_caps_parse()
4808 if (svc_rdy_ext->n_hw_mode_caps >= svc_rdy_ext->param.num_hw_modes) in ath11k_wmi_tlv_hw_mode_caps_parse()
4809 return -ENOBUFS; in ath11k_wmi_tlv_hw_mode_caps_parse()
4813 svc_rdy_ext->n_hw_mode_caps++; in ath11k_wmi_tlv_hw_mode_caps_parse()
4815 phy_map = hw_mode_cap->phy_id_map; in ath11k_wmi_tlv_hw_mode_caps_parse()
4817 svc_rdy_ext->tot_phy_id++; in ath11k_wmi_tlv_hw_mode_caps_parse()
4837 svc_rdy_ext->n_hw_mode_caps = 0; in ath11k_wmi_tlv_hw_mode_caps()
4839 svc_rdy_ext->hw_mode_caps = (struct wmi_hw_mode_capabilities *)ptr; in ath11k_wmi_tlv_hw_mode_caps()
4841 svc_rdy_ext->hw_mode_caps = ptr; in ath11k_wmi_tlv_hw_mode_caps()
4853 while (i < svc_rdy_ext->n_hw_mode_caps) { in ath11k_wmi_tlv_hw_mode_caps()
4854 hw_mode_caps = &svc_rdy_ext->hw_mode_caps[i]; in ath11k_wmi_tlv_hw_mode_caps()
4855 mode = hw_mode_caps->hw_mode_id; in ath11k_wmi_tlv_hw_mode_caps()
4856 pref = soc->wmi_ab.preferred_hw_mode; in ath11k_wmi_tlv_hw_mode_caps()
4859 svc_rdy_ext->pref_hw_mode_caps = *hw_mode_caps; in ath11k_wmi_tlv_hw_mode_caps()
4860 soc->wmi_ab.preferred_hw_mode = mode; in ath11k_wmi_tlv_hw_mode_caps()
4866 soc->wmi_ab.preferred_hw_mode); in ath11k_wmi_tlv_hw_mode_caps()
4867 if (soc->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_MAX) in ath11k_wmi_tlv_hw_mode_caps()
4868 return -EINVAL; in ath11k_wmi_tlv_hw_mode_caps()
4880 return -EPROTO; in ath11k_wmi_tlv_mac_phy_caps_parse()
4882 if (svc_rdy_ext->n_mac_phy_caps >= svc_rdy_ext->tot_phy_id) in ath11k_wmi_tlv_mac_phy_caps_parse()
4883 return -ENOBUFS; in ath11k_wmi_tlv_mac_phy_caps_parse()
4886 if (!svc_rdy_ext->n_mac_phy_caps) { in ath11k_wmi_tlv_mac_phy_caps_parse()
4887 svc_rdy_ext->mac_phy_caps = kcalloc(svc_rdy_ext->tot_phy_id, in ath11k_wmi_tlv_mac_phy_caps_parse()
4889 if (!svc_rdy_ext->mac_phy_caps) in ath11k_wmi_tlv_mac_phy_caps_parse()
4890 return -ENOMEM; in ath11k_wmi_tlv_mac_phy_caps_parse()
4893 memcpy(svc_rdy_ext->mac_phy_caps + svc_rdy_ext->n_mac_phy_caps, ptr, len); in ath11k_wmi_tlv_mac_phy_caps_parse()
4894 svc_rdy_ext->n_mac_phy_caps++; in ath11k_wmi_tlv_mac_phy_caps_parse()
4905 return -EPROTO; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4907 if (svc_rdy_ext->n_ext_hal_reg_caps >= svc_rdy_ext->param.num_phy) in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4908 return -ENOBUFS; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4910 svc_rdy_ext->n_ext_hal_reg_caps++; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4917 struct ath11k_pdev_wmi *wmi_handle = &soc->wmi_ab.wmi[0]; in ath11k_wmi_tlv_ext_hal_reg_caps()
4923 svc_rdy_ext->n_ext_hal_reg_caps = 0; in ath11k_wmi_tlv_ext_hal_reg_caps()
4925 svc_rdy_ext->ext_hal_reg_caps = (struct wmi_hal_reg_capabilities_ext *)ptr; in ath11k_wmi_tlv_ext_hal_reg_caps()
4927 svc_rdy_ext->ext_hal_reg_caps = (const struct wmi_hal_reg_capabilities_ext *)ptr; in ath11k_wmi_tlv_ext_hal_reg_caps()
4937 for (i = 0; i < svc_rdy_ext->param.num_phy; i++) { in ath11k_wmi_tlv_ext_hal_reg_caps()
4939 svc_rdy_ext->soc_hal_reg_caps, in ath11k_wmi_tlv_ext_hal_reg_caps()
4940 svc_rdy_ext->ext_hal_reg_caps, i, in ath11k_wmi_tlv_ext_hal_reg_caps()
4947 memcpy(&soc->hal_reg_cap[reg_cap.phy_id], in ath11k_wmi_tlv_ext_hal_reg_caps()
4957 struct ath11k_pdev_wmi *wmi_handle = &soc->wmi_ab.wmi[0]; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4959 u8 hw_mode_id = svc_rdy_ext->pref_hw_mode_caps.hw_mode_id; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4965 svc_rdy_ext->soc_hal_reg_caps = (struct wmi_soc_hal_reg_capabilities *)ptr; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4967 svc_rdy_ext->soc_hal_reg_caps = (const struct wmi_soc_hal_reg_capabilities *)ptr; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4969 svc_rdy_ext->param.num_phy = svc_rdy_ext->soc_hal_reg_caps->num_phy; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4971 soc->num_radios = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4972 soc->target_pdev_count = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4973 phy_id_map = svc_rdy_ext->pref_hw_mode_caps.phy_id_map; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4975 while (phy_id_map && soc->num_radios < MAX_RADIOS) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4977 svc_rdy_ext->hw_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4978 svc_rdy_ext->hw_mode_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4979 svc_rdy_ext->soc_hal_reg_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4980 svc_rdy_ext->mac_phy_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4981 hw_mode_id, soc->num_radios, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4982 &soc->pdevs[pdev_index]); in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4985 soc->num_radios); in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4989 soc->num_radios++; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4992 if (soc->hw_params.single_pdev_only) in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4995 pdev_index = soc->num_radios; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
5005 if (soc->hw_params.single_pdev_only) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
5006 soc->num_radios = 1; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
5007 soc->pdevs[0].pdev_id = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
5020 return -EPROTO; in ath11k_wmi_tlv_dma_ring_caps_parse()
5022 parse->n_dma_ring_caps++; in ath11k_wmi_tlv_dma_ring_caps_parse()
5035 return -ENOMEM; in ath11k_wmi_alloc_dbring_caps()
5037 ab->db_caps = ptr; in ath11k_wmi_alloc_dbring_caps()
5038 ab->num_db_cap = num_cap; in ath11k_wmi_alloc_dbring_caps()
5045 kfree(ab->db_caps); in ath11k_wmi_free_dbring_caps()
5046 ab->db_caps = NULL; in ath11k_wmi_free_dbring_caps()
5062 dma_caps_parse->n_dma_ring_caps = 0; in ath11k_wmi_tlv_dma_ring_caps()
5076 if (!dma_caps_parse->n_dma_ring_caps) in ath11k_wmi_tlv_dma_ring_caps()
5079 if (ab->num_db_cap) { in ath11k_wmi_tlv_dma_ring_caps()
5084 ret = ath11k_wmi_alloc_dbring_caps(ab, dma_caps_parse->n_dma_ring_caps); in ath11k_wmi_tlv_dma_ring_caps()
5088 dir_buff_caps = ab->db_caps; in ath11k_wmi_tlv_dma_ring_caps()
5089 for (i = 0; i < dma_caps_parse->n_dma_ring_caps; i++) { in ath11k_wmi_tlv_dma_ring_caps()
5092 ret = -EINVAL; in ath11k_wmi_tlv_dma_ring_caps()
5114 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5121 &svc_rdy_ext->param); in ath11k_wmi_tlv_svc_rdy_ext_parse()
5130 svc_rdy_ext->hw_caps = (struct wmi_soc_mac_phy_hw_mode_caps *)ptr; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5132 svc_rdy_ext->hw_caps = (const struct wmi_soc_mac_phy_hw_mode_caps *)ptr; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5134 svc_rdy_ext->param.num_hw_modes = svc_rdy_ext->hw_caps->num_hw_modes; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5145 if (!svc_rdy_ext->hw_mode_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5151 svc_rdy_ext->hw_mode_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5152 } else if (!svc_rdy_ext->mac_phy_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5153 svc_rdy_ext->n_mac_phy_caps = 0; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5162 svc_rdy_ext->mac_phy_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5163 } else if (!svc_rdy_ext->ext_hal_reg_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5169 svc_rdy_ext->ext_hal_reg_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5170 } else if (!svc_rdy_ext->mac_phy_chainmask_combo_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5171 svc_rdy_ext->mac_phy_chainmask_combo_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5172 } else if (!svc_rdy_ext->mac_phy_chainmask_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5173 svc_rdy_ext->mac_phy_chainmask_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5174 } else if (!svc_rdy_ext->oem_dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5175 svc_rdy_ext->oem_dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5176 } else if (!svc_rdy_ext->dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5178 &svc_rdy_ext->dma_caps_parse); in ath11k_wmi_tlv_svc_rdy_ext_parse()
5182 svc_rdy_ext->dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5198 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext_event()
5208 if (!test_bit(WMI_TLV_SERVICE_EXT2_MSG, ab->wmi_ab.svc_map)) in ath11k_service_ready_ext_event()
5209 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext_event()
5228 if (!parse->dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5230 &parse->dma_caps_parse); in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5234 parse->dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5250 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext2_event()
5260 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext2_event()
5276 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_start_resp_tlv()
5287 return -EPROTO; in ath11k_pull_vdev_start_resp_tlv()
5292 vdev_rsp->vdev_id = ev->vdev_id; in ath11k_pull_vdev_start_resp_tlv()
5293 vdev_rsp->requestor_id = ev->requestor_id; in ath11k_pull_vdev_start_resp_tlv()
5294 vdev_rsp->resp_type = ev->resp_type; in ath11k_pull_vdev_start_resp_tlv()
5295 vdev_rsp->status = ev->status; in ath11k_pull_vdev_start_resp_tlv()
5296 vdev_rsp->chain_mask = ev->chain_mask; in ath11k_pull_vdev_start_resp_tlv()
5297 vdev_rsp->smps_mode = ev->smps_mode; in ath11k_pull_vdev_start_resp_tlv()
5298 vdev_rsp->mac_id = ev->mac_id; in ath11k_pull_vdev_start_resp_tlv()
5299 vdev_rsp->cfgd_tx_streams = ev->cfgd_tx_streams; in ath11k_pull_vdev_start_resp_tlv()
5300 vdev_rsp->cfgd_rx_streams = ev->cfgd_rx_streams; in ath11k_pull_vdev_start_resp_tlv()
5318 "reg rule %d: (%d - %d @ %d) (%d, %d) (FLAGS %d)\n", in ath11k_print_reg_rule()
5319 count + 1, reg_rule->start_freq, reg_rule->end_freq, in ath11k_print_reg_rule()
5320 reg_rule->max_bw, reg_rule->ant_gain, in ath11k_print_reg_rule()
5321 reg_rule->reg_power, reg_rule->flags); in ath11k_print_reg_rule()
5383 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_reg_chan_list_update_ev()
5394 return -EPROTO; in ath11k_pull_reg_chan_list_update_ev()
5397 reg_info->num_2ghz_reg_rules = chan_list_event_hdr->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5398 reg_info->num_5ghz_reg_rules = chan_list_event_hdr->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5400 if (!(reg_info->num_2ghz_reg_rules + reg_info->num_5ghz_reg_rules)) { in ath11k_pull_reg_chan_list_update_ev()
5403 return -EINVAL; in ath11k_pull_reg_chan_list_update_ev()
5406 memcpy(reg_info->alpha2, &chan_list_event_hdr->alpha2, in ath11k_pull_reg_chan_list_update_ev()
5408 reg_info->dfs_region = chan_list_event_hdr->dfs_region; in ath11k_pull_reg_chan_list_update_ev()
5409 reg_info->phybitmap = chan_list_event_hdr->phybitmap; in ath11k_pull_reg_chan_list_update_ev()
5410 reg_info->num_phy = chan_list_event_hdr->num_phy; in ath11k_pull_reg_chan_list_update_ev()
5411 reg_info->phy_id = chan_list_event_hdr->phy_id; in ath11k_pull_reg_chan_list_update_ev()
5412 reg_info->ctry_code = chan_list_event_hdr->country_id; in ath11k_pull_reg_chan_list_update_ev()
5413 reg_info->reg_dmn_pair = chan_list_event_hdr->domain_code; in ath11k_pull_reg_chan_list_update_ev()
5417 ath11k_cc_status_to_str(reg_info->status_code)); in ath11k_pull_reg_chan_list_update_ev()
5419 reg_info->status_code = in ath11k_pull_reg_chan_list_update_ev()
5420 ath11k_wmi_cc_setting_code_to_reg(chan_list_event_hdr->status_code); in ath11k_pull_reg_chan_list_update_ev()
5422 reg_info->is_ext_reg_event = false; in ath11k_pull_reg_chan_list_update_ev()
5424 reg_info->min_bw_2ghz = chan_list_event_hdr->min_bw_2ghz; in ath11k_pull_reg_chan_list_update_ev()
5425 reg_info->max_bw_2ghz = chan_list_event_hdr->max_bw_2ghz; in ath11k_pull_reg_chan_list_update_ev()
5426 reg_info->min_bw_5ghz = chan_list_event_hdr->min_bw_5ghz; in ath11k_pull_reg_chan_list_update_ev()
5427 reg_info->max_bw_5ghz = chan_list_event_hdr->max_bw_5ghz; in ath11k_pull_reg_chan_list_update_ev()
5429 num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5430 num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5434 reg_info->alpha2, reg_info->dfs_region, in ath11k_pull_reg_chan_list_update_ev()
5435 reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, in ath11k_pull_reg_chan_list_update_ev()
5436 reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); in ath11k_pull_reg_chan_list_update_ev()
5452 reg_info->reg_rules_2ghz_ptr = in ath11k_pull_reg_chan_list_update_ev()
5455 if (!reg_info->reg_rules_2ghz_ptr) { in ath11k_pull_reg_chan_list_update_ev()
5458 return -ENOMEM; in ath11k_pull_reg_chan_list_update_ev()
5463 reg_info->reg_rules_2ghz_ptr); in ath11k_pull_reg_chan_list_update_ev()
5468 reg_info->reg_rules_5ghz_ptr = in ath11k_pull_reg_chan_list_update_ev()
5471 if (!reg_info->reg_rules_5ghz_ptr) { in ath11k_pull_reg_chan_list_update_ev()
5474 return -ENOMEM; in ath11k_pull_reg_chan_list_update_ev()
5479 reg_info->reg_rules_5ghz_ptr); in ath11k_pull_reg_chan_list_update_ev()
5571 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_reg_chan_list_ext_update_ev()
5582 return -EPROTO; in ath11k_pull_reg_chan_list_ext_update_ev()
5585 reg_info->num_2ghz_reg_rules = ev->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5586 reg_info->num_5ghz_reg_rules = ev->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5587 reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5588 ev->num_6ghz_reg_rules_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5589 reg_info->num_6ghz_rules_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5590 ev->num_6ghz_reg_rules_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5591 reg_info->num_6ghz_rules_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5592 ev->num_6ghz_reg_rules_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5595 reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5596 ev->num_6ghz_reg_rules_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5597 reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5598 ev->num_6ghz_reg_rules_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5599 reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5600 ev->num_6ghz_reg_rules_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5603 num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5604 num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5614 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5618 num_6ghz_reg_rules_ap[i] = reg_info->num_6ghz_rules_ap[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5624 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5632 reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5636 reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5640 reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5652 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5659 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5662 memcpy(reg_info->alpha2, &ev->alpha2, REG_ALPHA2_LEN); in ath11k_pull_reg_chan_list_ext_update_ev()
5664 reg_info->dfs_region = ev->dfs_region; in ath11k_pull_reg_chan_list_ext_update_ev()
5665 reg_info->phybitmap = ev->phybitmap; in ath11k_pull_reg_chan_list_ext_update_ev()
5666 reg_info->num_phy = ev->num_phy; in ath11k_pull_reg_chan_list_ext_update_ev()
5667 reg_info->phy_id = ev->phy_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5668 reg_info->ctry_code = ev->country_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5669 reg_info->reg_dmn_pair = ev->domain_code; in ath11k_pull_reg_chan_list_ext_update_ev()
5673 ath11k_cc_status_to_str(reg_info->status_code)); in ath11k_pull_reg_chan_list_ext_update_ev()
5675 reg_info->status_code = in ath11k_pull_reg_chan_list_ext_update_ev()
5676 ath11k_wmi_cc_setting_code_to_reg(ev->status_code); in ath11k_pull_reg_chan_list_ext_update_ev()
5678 reg_info->is_ext_reg_event = true; in ath11k_pull_reg_chan_list_ext_update_ev()
5680 reg_info->min_bw_2ghz = ev->min_bw_2ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5681 reg_info->max_bw_2ghz = ev->max_bw_2ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5682 reg_info->min_bw_5ghz = ev->min_bw_5ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5683 reg_info->max_bw_5ghz = ev->max_bw_5ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5685 reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5686 ev->min_bw_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5687 reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5688 ev->max_bw_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5689 reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5690 ev->min_bw_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5691 reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5692 ev->max_bw_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5693 reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5694 ev->min_bw_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5695 reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5696 ev->max_bw_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5699 "6 GHz AP BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5700 reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5701 reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5702 reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5703 reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5704 reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5705 reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP]); in ath11k_pull_reg_chan_list_ext_update_ev()
5708 reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5709 ev->min_bw_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5710 reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5711 ev->max_bw_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5712 reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5713 ev->min_bw_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5714 reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5715 ev->max_bw_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5716 reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5717 ev->min_bw_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5718 reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5719 ev->max_bw_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5722 "6 GHz %s BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5724 reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5725 reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5726 reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5727 reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5728 reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5729 reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5734 reg_info->alpha2, reg_info->dfs_region, in ath11k_pull_reg_chan_list_ext_update_ev()
5735 reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, in ath11k_pull_reg_chan_list_ext_update_ev()
5736 reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); in ath11k_pull_reg_chan_list_ext_update_ev()
5770 reg_info->reg_rules_2ghz_ptr = in ath11k_pull_reg_chan_list_ext_update_ev()
5774 if (!reg_info->reg_rules_2ghz_ptr) { in ath11k_pull_reg_chan_list_ext_update_ev()
5777 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5782 reg_info->reg_rules_2ghz_ptr); in ath11k_pull_reg_chan_list_ext_update_ev()
5801 reg_info->alpha2, reg_info->num_5ghz_reg_rules, in ath11k_pull_reg_chan_list_ext_update_ev()
5804 num_5ghz_reg_rules = num_5ghz_reg_rules - num_invalid_5ghz_ext_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5805 reg_info->num_5ghz_reg_rules = num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5809 reg_info->reg_rules_5ghz_ptr = in ath11k_pull_reg_chan_list_ext_update_ev()
5813 if (!reg_info->reg_rules_5ghz_ptr) { in ath11k_pull_reg_chan_list_ext_update_ev()
5816 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5821 reg_info->reg_rules_5ghz_ptr); in ath11k_pull_reg_chan_list_ext_update_ev()
5832 reg_info->reg_rules_6ghz_ap_ptr[i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5836 if (!reg_info->reg_rules_6ghz_ap_ptr[i]) { in ath11k_pull_reg_chan_list_ext_update_ev()
5839 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5844 reg_info->reg_rules_6ghz_ap_ptr[i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5854 reg_info->reg_rules_6ghz_client_ptr[j][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5858 if (!reg_info->reg_rules_6ghz_client_ptr[j][i]) { in ath11k_pull_reg_chan_list_ext_update_ev()
5861 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5867 reg_info->reg_rules_6ghz_client_ptr[j][i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5873 reg_info->client_type = ev->client_type; in ath11k_pull_reg_chan_list_ext_update_ev()
5874 reg_info->rnr_tpe_usable = ev->rnr_tpe_usable; in ath11k_pull_reg_chan_list_ext_update_ev()
5875 reg_info->unspecified_ap_usable = in ath11k_pull_reg_chan_list_ext_update_ev()
5876 ev->unspecified_ap_usable; in ath11k_pull_reg_chan_list_ext_update_ev()
5877 reg_info->domain_code_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5878 ev->domain_code_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5879 reg_info->domain_code_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5880 ev->domain_code_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5881 reg_info->domain_code_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5882 ev->domain_code_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5886 ath11k_6ghz_client_type_to_str(reg_info->client_type), in ath11k_pull_reg_chan_list_ext_update_ev()
5887 reg_info->rnr_tpe_usable, in ath11k_pull_reg_chan_list_ext_update_ev()
5888 reg_info->unspecified_ap_usable, in ath11k_pull_reg_chan_list_ext_update_ev()
5889 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_lpi), in ath11k_pull_reg_chan_list_ext_update_ev()
5890 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_sp), in ath11k_pull_reg_chan_list_ext_update_ev()
5891 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_vlp)); in ath11k_pull_reg_chan_list_ext_update_ev()
5894 reg_info->domain_code_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5895 ev->domain_code_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5896 reg_info->domain_code_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5897 ev->domain_code_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5898 reg_info->domain_code_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5899 ev->domain_code_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5904 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_lpi[i]), in ath11k_pull_reg_chan_list_ext_update_ev()
5905 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_sp[i]), in ath11k_pull_reg_chan_list_ext_update_ev()
5906 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_vlp[i]) in ath11k_pull_reg_chan_list_ext_update_ev()
5910 reg_info->domain_code_6ghz_super_id = ev->domain_code_6ghz_super_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5914 ath11k_6ghz_client_type_to_str(reg_info->client_type), in ath11k_pull_reg_chan_list_ext_update_ev()
5915 ath11k_super_reg_6ghz_to_str(reg_info->domain_code_6ghz_super_id)); in ath11k_pull_reg_chan_list_ext_update_ev()
5930 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_peer_del_resp_ev()
5941 return -EPROTO; in ath11k_pull_peer_del_resp_ev()
5946 peer_del_resp->vdev_id = ev->vdev_id; in ath11k_pull_peer_del_resp_ev()
5947 ether_addr_copy(peer_del_resp->peer_macaddr.addr, in ath11k_pull_peer_del_resp_ev()
5948 ev->peer_macaddr.addr); in ath11k_pull_peer_del_resp_ev()
5962 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_del_resp_ev()
5973 return -EPROTO; in ath11k_pull_vdev_del_resp_ev()
5976 *vdev_id = ev->vdev_id; in ath11k_pull_vdev_del_resp_ev()
6001 return -EPROTO; in ath11k_pull_bcn_tx_status_ev()
6004 *vdev_id = ev->vdev_id; in ath11k_pull_bcn_tx_status_ev()
6005 *tx_status = ev->tx_status; in ath11k_pull_bcn_tx_status_ev()
6018 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_stopped_param_tlv()
6029 return -EPROTO; in ath11k_pull_vdev_stopped_param_tlv()
6032 *vdev_id = ev->vdev_id; in ath11k_pull_vdev_stopped_param_tlv()
6046 parse->fixed = ptr; in ath11k_wmi_tlv_mgmt_rx_parse()
6049 if (!parse->frame_buf_done) { in ath11k_wmi_tlv_mgmt_rx_parse()
6050 parse->frame_buf = ptr; in ath11k_wmi_tlv_mgmt_rx_parse()
6051 parse->frame_buf_done = true; in ath11k_wmi_tlv_mgmt_rx_parse()
6067 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_pull_mgmt_rx_params_tlv()
6081 return -EPROTO; in ath11k_pull_mgmt_rx_params_tlv()
6084 hdr->pdev_id = ev->pdev_id; in ath11k_pull_mgmt_rx_params_tlv()
6085 hdr->chan_freq = ev->chan_freq; in ath11k_pull_mgmt_rx_params_tlv()
6086 hdr->channel = ev->channel; in ath11k_pull_mgmt_rx_params_tlv()
6087 hdr->snr = ev->snr; in ath11k_pull_mgmt_rx_params_tlv()
6088 hdr->rate = ev->rate; in ath11k_pull_mgmt_rx_params_tlv()
6089 hdr->phy_mode = ev->phy_mode; in ath11k_pull_mgmt_rx_params_tlv()
6090 hdr->buf_len = ev->buf_len; in ath11k_pull_mgmt_rx_params_tlv()
6091 hdr->status = ev->status; in ath11k_pull_mgmt_rx_params_tlv()
6092 hdr->flags = ev->flags; in ath11k_pull_mgmt_rx_params_tlv()
6093 hdr->rssi = ev->rssi; in ath11k_pull_mgmt_rx_params_tlv()
6094 hdr->tsf_delta = ev->tsf_delta; in ath11k_pull_mgmt_rx_params_tlv()
6095 memcpy(hdr->rssi_ctl, ev->rssi_ctl, sizeof(hdr->rssi_ctl)); in ath11k_pull_mgmt_rx_params_tlv()
6097 if (skb->len < (frame - skb->data) + hdr->buf_len) { in ath11k_pull_mgmt_rx_params_tlv()
6099 return -EPROTO; in ath11k_pull_mgmt_rx_params_tlv()
6104 skb_put(skb, frame - skb->data); in ath11k_pull_mgmt_rx_params_tlv()
6105 skb_pull(skb, frame - skb->data); in ath11k_pull_mgmt_rx_params_tlv()
6106 skb_put(skb, hdr->buf_len); in ath11k_pull_mgmt_rx_params_tlv()
6108 ath11k_ce_byte_swap(skb->data, hdr->buf_len); in ath11k_pull_mgmt_rx_params_tlv()
6121 spin_lock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
6122 msdu = idr_find(&ar->txmgmt_idr, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
6125 ath11k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n", in wmi_process_mgmt_tx_comp()
6126 tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
6127 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
6128 return -ENOENT; in wmi_process_mgmt_tx_comp()
6131 idr_remove(&ar->txmgmt_idr, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
6132 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
6135 dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); in wmi_process_mgmt_tx_comp()
6138 if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && in wmi_process_mgmt_tx_comp()
6139 !tx_compl_param->status) { in wmi_process_mgmt_tx_comp()
6140 info->flags |= IEEE80211_TX_STAT_ACK; in wmi_process_mgmt_tx_comp()
6142 ar->ab->wmi_ab.svc_map)) in wmi_process_mgmt_tx_comp()
6143 info->status.ack_signal = tx_compl_param->ack_rssi; in wmi_process_mgmt_tx_comp()
6146 ieee80211_tx_status_irqsafe(ar->hw, msdu); in wmi_process_mgmt_tx_comp()
6148 num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx); in wmi_process_mgmt_tx_comp()
6154 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in wmi_process_mgmt_tx_comp()
6156 num_mgmt, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
6159 wake_up(&ar->txmgmt_empty_waitq); in wmi_process_mgmt_tx_comp()
6172 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_mgmt_tx_compl_param_tlv()
6183 return -EPROTO; in ath11k_pull_mgmt_tx_compl_param_tlv()
6186 param->pdev_id = ev->pdev_id; in ath11k_pull_mgmt_tx_compl_param_tlv()
6187 param->desc_id = ev->desc_id; in ath11k_pull_mgmt_tx_compl_param_tlv()
6188 param->status = ev->status; in ath11k_pull_mgmt_tx_compl_param_tlv()
6189 param->ack_rssi = ev->ack_rssi; in ath11k_pull_mgmt_tx_compl_param_tlv()
6197 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_started()
6199 switch (ar->scan.state) { in ath11k_wmi_event_scan_started()
6203 ath11k_warn(ar->ab, "received scan started event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_started()
6204 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_started()
6205 ar->scan.state); in ath11k_wmi_event_scan_started()
6208 ar->scan.state = ATH11K_SCAN_RUNNING; in ath11k_wmi_event_scan_started()
6209 if (ar->scan.is_roc) in ath11k_wmi_event_scan_started()
6210 ieee80211_ready_on_channel(ar->hw); in ath11k_wmi_event_scan_started()
6211 complete(&ar->scan.started); in ath11k_wmi_event_scan_started()
6218 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_start_failed()
6220 switch (ar->scan.state) { in ath11k_wmi_event_scan_start_failed()
6224 ath11k_warn(ar->ab, "received scan start failed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_start_failed()
6225 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_start_failed()
6226 ar->scan.state); in ath11k_wmi_event_scan_start_failed()
6229 complete(&ar->scan.started); in ath11k_wmi_event_scan_start_failed()
6237 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_completed()
6239 switch (ar->scan.state) { in ath11k_wmi_event_scan_completed()
6250 ath11k_warn(ar->ab, "received scan completed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_completed()
6251 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_completed()
6252 ar->scan.state); in ath11k_wmi_event_scan_completed()
6263 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_bss_chan()
6265 switch (ar->scan.state) { in ath11k_wmi_event_scan_bss_chan()
6268 ath11k_warn(ar->ab, "received scan bss chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_bss_chan()
6269 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_bss_chan()
6270 ar->scan.state); in ath11k_wmi_event_scan_bss_chan()
6274 ar->scan_channel = NULL; in ath11k_wmi_event_scan_bss_chan()
6281 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_foreign_chan()
6283 switch (ar->scan.state) { in ath11k_wmi_event_scan_foreign_chan()
6286 ath11k_warn(ar->ab, "received scan foreign chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_foreign_chan()
6287 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_foreign_chan()
6288 ar->scan.state); in ath11k_wmi_event_scan_foreign_chan()
6292 ar->scan_channel = ieee80211_get_channel(ar->hw->wiphy, freq); in ath11k_wmi_event_scan_foreign_chan()
6293 if (ar->scan.is_roc && ar->scan.roc_freq == freq) in ath11k_wmi_event_scan_foreign_chan()
6294 complete(&ar->scan.on_channel); in ath11k_wmi_event_scan_foreign_chan()
6348 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_scan_ev()
6359 return -EPROTO; in ath11k_pull_scan_ev()
6362 scan_evt_param->event_type = ev->event_type; in ath11k_pull_scan_ev()
6363 scan_evt_param->reason = ev->reason; in ath11k_pull_scan_ev()
6364 scan_evt_param->channel_freq = ev->channel_freq; in ath11k_pull_scan_ev()
6365 scan_evt_param->scan_req_id = ev->scan_req_id; in ath11k_pull_scan_ev()
6366 scan_evt_param->scan_id = ev->scan_id; in ath11k_pull_scan_ev()
6367 scan_evt_param->vdev_id = ev->vdev_id; in ath11k_pull_scan_ev()
6368 scan_evt_param->tsf_timestamp = ev->tsf_timestamp; in ath11k_pull_scan_ev()
6381 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_peer_sta_kickout_ev()
6392 return -EPROTO; in ath11k_pull_peer_sta_kickout_ev()
6395 arg->mac_addr = ev->peer_macaddr.addr; in ath11k_pull_peer_sta_kickout_ev()
6408 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_roam_ev()
6419 return -EPROTO; in ath11k_pull_roam_ev()
6422 roam_ev->vdev_id = ev->vdev_id; in ath11k_pull_roam_ev()
6423 roam_ev->reason = ev->reason; in ath11k_pull_roam_ev()
6424 roam_ev->rssi = ev->rssi; in ath11k_pull_roam_ev()
6436 sband = ar->hw->wiphy->bands[band]; in freq_to_idx()
6440 for (ch = 0; ch < sband->n_channels; ch++, idx++) in freq_to_idx()
6441 if (sband->channels[ch].center_freq == freq) in freq_to_idx()
6467 return -EPROTO; in ath11k_pull_chan_info_ev()
6470 ch_info_ev->err_code = ev->err_code; in ath11k_pull_chan_info_ev()
6471 ch_info_ev->freq = ev->freq; in ath11k_pull_chan_info_ev()
6472 ch_info_ev->cmd_flags = ev->cmd_flags; in ath11k_pull_chan_info_ev()
6473 ch_info_ev->noise_floor = ev->noise_floor; in ath11k_pull_chan_info_ev()
6474 ch_info_ev->rx_clear_count = ev->rx_clear_count; in ath11k_pull_chan_info_ev()
6475 ch_info_ev->cycle_count = ev->cycle_count; in ath11k_pull_chan_info_ev()
6476 ch_info_ev->chan_tx_pwr_range = ev->chan_tx_pwr_range; in ath11k_pull_chan_info_ev()
6477 ch_info_ev->chan_tx_pwr_tp = ev->chan_tx_pwr_tp; in ath11k_pull_chan_info_ev()
6478 ch_info_ev->rx_frame_count = ev->rx_frame_count; in ath11k_pull_chan_info_ev()
6479 ch_info_ev->tx_frame_cnt = ev->tx_frame_cnt; in ath11k_pull_chan_info_ev()
6480 ch_info_ev->mac_clk_mhz = ev->mac_clk_mhz; in ath11k_pull_chan_info_ev()
6481 ch_info_ev->vdev_id = ev->vdev_id; in ath11k_pull_chan_info_ev()
6495 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_pdev_bss_chan_info_ev()
6506 return -EPROTO; in ath11k_pull_pdev_bss_chan_info_ev()
6509 bss_ch_info_ev->pdev_id = ev->pdev_id; in ath11k_pull_pdev_bss_chan_info_ev()
6510 bss_ch_info_ev->freq = ev->freq; in ath11k_pull_pdev_bss_chan_info_ev()
6511 bss_ch_info_ev->noise_floor = ev->noise_floor; in ath11k_pull_pdev_bss_chan_info_ev()
6512 bss_ch_info_ev->rx_clear_count_low = ev->rx_clear_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6513 bss_ch_info_ev->rx_clear_count_high = ev->rx_clear_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6514 bss_ch_info_ev->cycle_count_low = ev->cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6515 bss_ch_info_ev->cycle_count_high = ev->cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6516 bss_ch_info_ev->tx_cycle_count_low = ev->tx_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6517 bss_ch_info_ev->tx_cycle_count_high = ev->tx_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6518 bss_ch_info_ev->rx_cycle_count_low = ev->rx_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6519 bss_ch_info_ev->rx_cycle_count_high = ev->rx_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6520 bss_ch_info_ev->rx_bss_cycle_count_low = ev->rx_bss_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6521 bss_ch_info_ev->rx_bss_cycle_count_high = ev->rx_bss_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6535 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_vdev_install_key_compl_ev()
6546 return -EPROTO; in ath11k_pull_vdev_install_key_compl_ev()
6549 arg->vdev_id = ev->vdev_id; in ath11k_pull_vdev_install_key_compl_ev()
6550 arg->macaddr = ev->peer_macaddr.addr; in ath11k_pull_vdev_install_key_compl_ev()
6551 arg->key_idx = ev->key_idx; in ath11k_pull_vdev_install_key_compl_ev()
6552 arg->key_flags = ev->key_flags; in ath11k_pull_vdev_install_key_compl_ev()
6553 arg->status = ev->status; in ath11k_pull_vdev_install_key_compl_ev()
6566 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pull_peer_assoc_conf_ev()
6577 return -EPROTO; in ath11k_pull_peer_assoc_conf_ev()
6580 peer_assoc_conf->vdev_id = ev->vdev_id; in ath11k_pull_peer_assoc_conf_ev()
6581 peer_assoc_conf->macaddr = ev->peer_macaddr.addr; in ath11k_pull_peer_assoc_conf_ev()
6590 dst->ch_noise_floor = src->chan_nf; in ath11k_wmi_pull_pdev_stats_base()
6591 dst->tx_frame_count = src->tx_frame_count; in ath11k_wmi_pull_pdev_stats_base()
6592 dst->rx_frame_count = src->rx_frame_count; in ath11k_wmi_pull_pdev_stats_base()
6593 dst->rx_clear_count = src->rx_clear_count; in ath11k_wmi_pull_pdev_stats_base()
6594 dst->cycle_count = src->cycle_count; in ath11k_wmi_pull_pdev_stats_base()
6595 dst->phy_err_count = src->phy_err_count; in ath11k_wmi_pull_pdev_stats_base()
6596 dst->chan_tx_power = src->chan_tx_pwr; in ath11k_wmi_pull_pdev_stats_base()
6603 dst->comp_queued = src->comp_queued; in ath11k_wmi_pull_pdev_stats_tx()
6604 dst->comp_delivered = src->comp_delivered; in ath11k_wmi_pull_pdev_stats_tx()
6605 dst->msdu_enqued = src->msdu_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6606 dst->mpdu_enqued = src->mpdu_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6607 dst->wmm_drop = src->wmm_drop; in ath11k_wmi_pull_pdev_stats_tx()
6608 dst->local_enqued = src->local_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6609 dst->local_freed = src->local_freed; in ath11k_wmi_pull_pdev_stats_tx()
6610 dst->hw_queued = src->hw_queued; in ath11k_wmi_pull_pdev_stats_tx()
6611 dst->hw_reaped = src->hw_reaped; in ath11k_wmi_pull_pdev_stats_tx()
6612 dst->underrun = src->underrun; in ath11k_wmi_pull_pdev_stats_tx()
6613 dst->hw_paused = src->hw_paused; in ath11k_wmi_pull_pdev_stats_tx()
6614 dst->tx_abort = src->tx_abort; in ath11k_wmi_pull_pdev_stats_tx()
6615 dst->mpdus_requeued = src->mpdus_requeued; in ath11k_wmi_pull_pdev_stats_tx()
6616 dst->tx_ko = src->tx_ko; in ath11k_wmi_pull_pdev_stats_tx()
6617 dst->tx_xretry = src->tx_xretry; in ath11k_wmi_pull_pdev_stats_tx()
6618 dst->data_rc = src->data_rc; in ath11k_wmi_pull_pdev_stats_tx()
6619 dst->self_triggers = src->self_triggers; in ath11k_wmi_pull_pdev_stats_tx()
6620 dst->sw_retry_failure = src->sw_retry_failure; in ath11k_wmi_pull_pdev_stats_tx()
6621 dst->illgl_rate_phy_err = src->illgl_rate_phy_err; in ath11k_wmi_pull_pdev_stats_tx()
6622 dst->pdev_cont_xretry = src->pdev_cont_xretry; in ath11k_wmi_pull_pdev_stats_tx()
6623 dst->pdev_tx_timeout = src->pdev_tx_timeout; in ath11k_wmi_pull_pdev_stats_tx()
6624 dst->pdev_resets = src->pdev_resets; in ath11k_wmi_pull_pdev_stats_tx()
6625 dst->stateless_tid_alloc_failure = src->stateless_tid_alloc_failure; in ath11k_wmi_pull_pdev_stats_tx()
6626 dst->phy_underrun = src->phy_underrun; in ath11k_wmi_pull_pdev_stats_tx()
6627 dst->txop_ovf = src->txop_ovf; in ath11k_wmi_pull_pdev_stats_tx()
6628 dst->seq_posted = src->seq_posted; in ath11k_wmi_pull_pdev_stats_tx()
6629 dst->seq_failed_queueing = src->seq_failed_queueing; in ath11k_wmi_pull_pdev_stats_tx()
6630 dst->seq_completed = src->seq_completed; in ath11k_wmi_pull_pdev_stats_tx()
6631 dst->seq_restarted = src->seq_restarted; in ath11k_wmi_pull_pdev_stats_tx()
6632 dst->mu_seq_posted = src->mu_seq_posted; in ath11k_wmi_pull_pdev_stats_tx()
6633 dst->mpdus_sw_flush = src->mpdus_sw_flush; in ath11k_wmi_pull_pdev_stats_tx()
6634 dst->mpdus_hw_filter = src->mpdus_hw_filter; in ath11k_wmi_pull_pdev_stats_tx()
6635 dst->mpdus_truncated = src->mpdus_truncated; in ath11k_wmi_pull_pdev_stats_tx()
6636 dst->mpdus_ack_failed = src->mpdus_ack_failed; in ath11k_wmi_pull_pdev_stats_tx()
6637 dst->mpdus_expired = src->mpdus_expired; in ath11k_wmi_pull_pdev_stats_tx()
6643 dst->mid_ppdu_route_change = src->mid_ppdu_route_change; in ath11k_wmi_pull_pdev_stats_rx()
6644 dst->status_rcvd = src->status_rcvd; in ath11k_wmi_pull_pdev_stats_rx()
6645 dst->r0_frags = src->r0_frags; in ath11k_wmi_pull_pdev_stats_rx()
6646 dst->r1_frags = src->r1_frags; in ath11k_wmi_pull_pdev_stats_rx()
6647 dst->r2_frags = src->r2_frags; in ath11k_wmi_pull_pdev_stats_rx()
6648 dst->r3_frags = src->r3_frags; in ath11k_wmi_pull_pdev_stats_rx()
6649 dst->htt_msdus = src->htt_msdus; in ath11k_wmi_pull_pdev_stats_rx()
6650 dst->htt_mpdus = src->htt_mpdus; in ath11k_wmi_pull_pdev_stats_rx()
6651 dst->loc_msdus = src->loc_msdus; in ath11k_wmi_pull_pdev_stats_rx()
6652 dst->loc_mpdus = src->loc_mpdus; in ath11k_wmi_pull_pdev_stats_rx()
6653 dst->oversize_amsdu = src->oversize_amsdu; in ath11k_wmi_pull_pdev_stats_rx()
6654 dst->phy_errs = src->phy_errs; in ath11k_wmi_pull_pdev_stats_rx()
6655 dst->phy_err_drop = src->phy_err_drop; in ath11k_wmi_pull_pdev_stats_rx()
6656 dst->mpdu_errs = src->mpdu_errs; in ath11k_wmi_pull_pdev_stats_rx()
6657 dst->rx_ovfl_errs = src->rx_ovfl_errs; in ath11k_wmi_pull_pdev_stats_rx()
6666 dst->vdev_id = src->vdev_id; in ath11k_wmi_pull_vdev_stats()
6667 dst->beacon_snr = src->beacon_snr; in ath11k_wmi_pull_vdev_stats()
6668 dst->data_snr = src->data_snr; in ath11k_wmi_pull_vdev_stats()
6669 dst->num_rx_frames = src->num_rx_frames; in ath11k_wmi_pull_vdev_stats()
6670 dst->num_rts_fail = src->num_rts_fail; in ath11k_wmi_pull_vdev_stats()
6671 dst->num_rts_success = src->num_rts_success; in ath11k_wmi_pull_vdev_stats()
6672 dst->num_rx_err = src->num_rx_err; in ath11k_wmi_pull_vdev_stats()
6673 dst->num_rx_discard = src->num_rx_discard; in ath11k_wmi_pull_vdev_stats()
6674 dst->num_tx_not_acked = src->num_tx_not_acked; in ath11k_wmi_pull_vdev_stats()
6676 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames); i++) in ath11k_wmi_pull_vdev_stats()
6677 dst->num_tx_frames[i] = src->num_tx_frames[i]; in ath11k_wmi_pull_vdev_stats()
6679 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames_retries); i++) in ath11k_wmi_pull_vdev_stats()
6680 dst->num_tx_frames_retries[i] = src->num_tx_frames_retries[i]; in ath11k_wmi_pull_vdev_stats()
6682 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames_failures); i++) in ath11k_wmi_pull_vdev_stats()
6683 dst->num_tx_frames_failures[i] = src->num_tx_frames_failures[i]; in ath11k_wmi_pull_vdev_stats()
6685 for (i = 0; i < ARRAY_SIZE(src->tx_rate_history); i++) in ath11k_wmi_pull_vdev_stats()
6686 dst->tx_rate_history[i] = src->tx_rate_history[i]; in ath11k_wmi_pull_vdev_stats()
6688 for (i = 0; i < ARRAY_SIZE(src->beacon_rssi_history); i++) in ath11k_wmi_pull_vdev_stats()
6689 dst->beacon_rssi_history[i] = src->beacon_rssi_history[i]; in ath11k_wmi_pull_vdev_stats()
6696 dst->vdev_id = src->vdev_id; in ath11k_wmi_pull_bcn_stats()
6697 dst->tx_bcn_succ_cnt = src->tx_bcn_succ_cnt; in ath11k_wmi_pull_bcn_stats()
6698 dst->tx_bcn_outage_cnt = src->tx_bcn_outage_cnt; in ath11k_wmi_pull_bcn_stats()
6706 const struct wmi_stats_event *ev = parse->ev; in ath11k_wmi_tlv_rssi_chain_parse()
6707 struct ath11k_fw_stats *stats = parse->stats; in ath11k_wmi_tlv_rssi_chain_parse()
6716 return -EPROTO; in ath11k_wmi_tlv_rssi_chain_parse()
6720 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6721 stats->stats_id = WMI_REQUEST_RSSI_PER_CHAIN_STAT; in ath11k_wmi_tlv_rssi_chain_parse()
6724 "stats vdev id %d mac %pM\n", in ath11k_wmi_tlv_rssi_chain_parse()
6725 stats_rssi->vdev_id, stats_rssi->peer_macaddr.addr); in ath11k_wmi_tlv_rssi_chain_parse()
6727 arvif = ath11k_mac_get_arvif(ar, stats_rssi->vdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6730 stats_rssi->vdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6731 ret = -EPROTO; in ath11k_wmi_tlv_rssi_chain_parse()
6736 "stats bssid %pM vif %p\n", in ath11k_wmi_tlv_rssi_chain_parse()
6737 arvif->bssid, arvif->vif); in ath11k_wmi_tlv_rssi_chain_parse()
6739 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_wmi_tlv_rssi_chain_parse()
6740 arvif->bssid, in ath11k_wmi_tlv_rssi_chain_parse()
6744 "not found station of bssid %pM for rssi chain\n", in ath11k_wmi_tlv_rssi_chain_parse()
6745 arvif->bssid); in ath11k_wmi_tlv_rssi_chain_parse()
6749 arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_wmi_tlv_rssi_chain_parse()
6751 BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) > in ath11k_wmi_tlv_rssi_chain_parse()
6752 ARRAY_SIZE(stats_rssi->rssi_avg_beacon)); in ath11k_wmi_tlv_rssi_chain_parse()
6754 for (j = 0; j < ARRAY_SIZE(arsta->chain_signal); j++) { in ath11k_wmi_tlv_rssi_chain_parse()
6755 arsta->chain_signal[j] = stats_rssi->rssi_avg_beacon[j]; in ath11k_wmi_tlv_rssi_chain_parse()
6759 stats_rssi->rssi_avg_beacon[j], in ath11k_wmi_tlv_rssi_chain_parse()
6761 stats_rssi->rssi_avg_data[j]); in ath11k_wmi_tlv_rssi_chain_parse()
6774 struct ath11k_fw_stats *stats = parse->stats; in ath11k_wmi_tlv_fw_stats_data_parse()
6775 const struct wmi_stats_event *ev = parse->ev; in ath11k_wmi_tlv_fw_stats_data_parse()
6789 return -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6792 stats->stats_id = 0; in ath11k_wmi_tlv_fw_stats_data_parse()
6796 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_tlv_fw_stats_data_parse()
6798 for (i = 0; i < ev->num_pdev_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6808 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6812 stats->stats_id = WMI_REQUEST_PDEV_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6815 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6821 ath11k_wmi_pull_pdev_stats_base(&src->base, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6822 ath11k_wmi_pull_pdev_stats_tx(&src->tx, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6823 ath11k_wmi_pull_pdev_stats_rx(&src->rx, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6824 list_add_tail(&dst->list, &stats->pdevs); in ath11k_wmi_tlv_fw_stats_data_parse()
6827 for (i = 0; i < ev->num_vdev_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6837 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6841 stats->stats_id = WMI_REQUEST_VDEV_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6843 arvif = ath11k_mac_get_arvif(ar, src->vdev_id); in ath11k_wmi_tlv_fw_stats_data_parse()
6845 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_wmi_tlv_fw_stats_data_parse()
6846 arvif->bssid, in ath11k_wmi_tlv_fw_stats_data_parse()
6849 arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_wmi_tlv_fw_stats_data_parse()
6850 arsta->rssi_beacon = src->beacon_snr; in ath11k_wmi_tlv_fw_stats_data_parse()
6853 src->vdev_id, src->beacon_snr); in ath11k_wmi_tlv_fw_stats_data_parse()
6856 "not found station of bssid %pM for vdev stat\n", in ath11k_wmi_tlv_fw_stats_data_parse()
6857 arvif->bssid); in ath11k_wmi_tlv_fw_stats_data_parse()
6862 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6869 list_add_tail(&dst->list, &stats->vdevs); in ath11k_wmi_tlv_fw_stats_data_parse()
6872 for (i = 0; i < ev->num_bcn_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6882 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6886 stats->stats_id = WMI_REQUEST_BCN_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6889 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6896 list_add_tail(&dst->list, &stats->bcn); in ath11k_wmi_tlv_fw_stats_data_parse()
6914 parse->ev = (struct wmi_stats_event *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6916 parse->ev = (const struct wmi_stats_event *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6918 parse->stats->pdev_id = parse->ev->pdev_id; in ath11k_wmi_tlv_fw_stats_parse()
6925 parse->rssi = (struct wmi_per_chain_rssi_stats *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6927 parse->rssi = (const struct wmi_per_chain_rssi_stats *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6930 if (parse->ev->stats_id & WMI_REQUEST_RSSI_PER_CHAIN_STAT) in ath11k_wmi_tlv_fw_stats_parse()
6931 parse->rssi_num = parse->rssi->num_per_chain_rssi_stats; in ath11k_wmi_tlv_fw_stats_parse()
6935 parse->ev->stats_id, in ath11k_wmi_tlv_fw_stats_parse()
6936 parse->rssi_num); in ath11k_wmi_tlv_fw_stats_parse()
6939 if (parse->rssi_num && !parse->chain_rssi_done) { in ath11k_wmi_tlv_fw_stats_parse()
6948 parse->chain_rssi_done = true; in ath11k_wmi_tlv_fw_stats_parse()
6962 stats->stats_id = 0; in ath11k_wmi_pull_fw_stats()
6965 return ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pull_fw_stats()
6977 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_pdev_base_stats_fill()
6978 len += scnprintf(buf + len, buf_len - len, "%30s\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6980 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6983 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6984 "Channel noise floor", pdev->ch_noise_floor); in ath11k_wmi_fw_pdev_base_stats_fill()
6985 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6986 "Channel TX power", pdev->chan_tx_power); in ath11k_wmi_fw_pdev_base_stats_fill()
6987 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6988 "TX frame count", pdev->tx_frame_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6989 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6990 "RX frame count", pdev->rx_frame_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6991 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6992 "RX clear count", pdev->rx_clear_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6993 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6994 "Cycle count", pdev->cycle_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6995 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6996 "PHY error count", pdev->phy_err_count); in ath11k_wmi_fw_pdev_base_stats_fill()
7008 len += scnprintf(buf + len, buf_len - len, "\n%30s\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7010 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7013 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7014 "HTT cookies queued", pdev->comp_queued); in ath11k_wmi_fw_pdev_tx_stats_fill()
7015 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7016 "HTT cookies disp.", pdev->comp_delivered); in ath11k_wmi_fw_pdev_tx_stats_fill()
7017 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7018 "MSDU queued", pdev->msdu_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
7019 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7020 "MPDU queued", pdev->mpdu_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
7021 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7022 "MSDUs dropped", pdev->wmm_drop); in ath11k_wmi_fw_pdev_tx_stats_fill()
7023 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7024 "Local enqued", pdev->local_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
7025 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7026 "Local freed", pdev->local_freed); in ath11k_wmi_fw_pdev_tx_stats_fill()
7027 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7028 "HW queued", pdev->hw_queued); in ath11k_wmi_fw_pdev_tx_stats_fill()
7029 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7030 "PPDUs reaped", pdev->hw_reaped); in ath11k_wmi_fw_pdev_tx_stats_fill()
7031 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7032 "Num underruns", pdev->underrun); in ath11k_wmi_fw_pdev_tx_stats_fill()
7033 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7034 "Num HW Paused", pdev->hw_paused); in ath11k_wmi_fw_pdev_tx_stats_fill()
7035 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7036 "PPDUs cleaned", pdev->tx_abort); in ath11k_wmi_fw_pdev_tx_stats_fill()
7037 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7038 "MPDUs requeued", pdev->mpdus_requeued); in ath11k_wmi_fw_pdev_tx_stats_fill()
7039 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7040 "PPDU OK", pdev->tx_ko); in ath11k_wmi_fw_pdev_tx_stats_fill()
7041 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7042 "Excessive retries", pdev->tx_xretry); in ath11k_wmi_fw_pdev_tx_stats_fill()
7043 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7044 "HW rate", pdev->data_rc); in ath11k_wmi_fw_pdev_tx_stats_fill()
7045 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7046 "Sched self triggers", pdev->self_triggers); in ath11k_wmi_fw_pdev_tx_stats_fill()
7047 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7048 "Dropped due to SW retries", in ath11k_wmi_fw_pdev_tx_stats_fill()
7049 pdev->sw_retry_failure); in ath11k_wmi_fw_pdev_tx_stats_fill()
7050 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7052 pdev->illgl_rate_phy_err); in ath11k_wmi_fw_pdev_tx_stats_fill()
7053 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7054 "PDEV continuous xretry", pdev->pdev_cont_xretry); in ath11k_wmi_fw_pdev_tx_stats_fill()
7055 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7056 "TX timeout", pdev->pdev_tx_timeout); in ath11k_wmi_fw_pdev_tx_stats_fill()
7057 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7058 "PDEV resets", pdev->pdev_resets); in ath11k_wmi_fw_pdev_tx_stats_fill()
7059 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7061 pdev->stateless_tid_alloc_failure); in ath11k_wmi_fw_pdev_tx_stats_fill()
7062 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7063 "PHY underrun", pdev->phy_underrun); in ath11k_wmi_fw_pdev_tx_stats_fill()
7064 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7065 "MPDU is more than txop limit", pdev->txop_ovf); in ath11k_wmi_fw_pdev_tx_stats_fill()
7066 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7067 "Num sequences posted", pdev->seq_posted); in ath11k_wmi_fw_pdev_tx_stats_fill()
7068 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7069 "Num seq failed queueing ", pdev->seq_failed_queueing); in ath11k_wmi_fw_pdev_tx_stats_fill()
7070 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7071 "Num sequences completed ", pdev->seq_completed); in ath11k_wmi_fw_pdev_tx_stats_fill()
7072 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7073 "Num sequences restarted ", pdev->seq_restarted); in ath11k_wmi_fw_pdev_tx_stats_fill()
7074 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7075 "Num of MU sequences posted ", pdev->mu_seq_posted); in ath11k_wmi_fw_pdev_tx_stats_fill()
7076 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7077 "Num of MPDUS SW flushed ", pdev->mpdus_sw_flush); in ath11k_wmi_fw_pdev_tx_stats_fill()
7078 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7079 "Num of MPDUS HW filtered ", pdev->mpdus_hw_filter); in ath11k_wmi_fw_pdev_tx_stats_fill()
7080 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7081 "Num of MPDUS truncated ", pdev->mpdus_truncated); in ath11k_wmi_fw_pdev_tx_stats_fill()
7082 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7083 "Num of MPDUS ACK failed ", pdev->mpdus_ack_failed); in ath11k_wmi_fw_pdev_tx_stats_fill()
7084 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
7085 "Num of MPDUS expired ", pdev->mpdus_expired); in ath11k_wmi_fw_pdev_tx_stats_fill()
7096 len += scnprintf(buf + len, buf_len - len, "\n%30s\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7098 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7101 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7103 pdev->mid_ppdu_route_change); in ath11k_wmi_fw_pdev_rx_stats_fill()
7104 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7105 "Tot. number of statuses", pdev->status_rcvd); in ath11k_wmi_fw_pdev_rx_stats_fill()
7106 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7107 "Extra frags on rings 0", pdev->r0_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
7108 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7109 "Extra frags on rings 1", pdev->r1_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
7110 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7111 "Extra frags on rings 2", pdev->r2_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
7112 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7113 "Extra frags on rings 3", pdev->r3_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
7114 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7115 "MSDUs delivered to HTT", pdev->htt_msdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
7116 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7117 "MPDUs delivered to HTT", pdev->htt_mpdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
7118 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7119 "MSDUs delivered to stack", pdev->loc_msdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
7120 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7121 "MPDUs delivered to stack", pdev->loc_mpdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
7122 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7123 "Oversized AMSUs", pdev->oversize_amsdu); in ath11k_wmi_fw_pdev_rx_stats_fill()
7124 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7125 "PHY errors", pdev->phy_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
7126 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7127 "PHY errors drops", pdev->phy_err_drop); in ath11k_wmi_fw_pdev_rx_stats_fill()
7128 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7129 "MPDU errors (FCS, MIC, ENC)", pdev->mpdu_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
7130 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
7131 "Overflow errors", pdev->rx_ovfl_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
7142 struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, vdev->vdev_id); in ath11k_wmi_fw_vdev_stats_fill()
7152 vif_macaddr = arvif->vif->addr; in ath11k_wmi_fw_vdev_stats_fill()
7154 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7155 "VDEV ID", vdev->vdev_id); in ath11k_wmi_fw_vdev_stats_fill()
7156 len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", in ath11k_wmi_fw_vdev_stats_fill()
7158 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7159 "beacon snr", vdev->beacon_snr); in ath11k_wmi_fw_vdev_stats_fill()
7160 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7161 "data snr", vdev->data_snr); in ath11k_wmi_fw_vdev_stats_fill()
7162 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7163 "num rx frames", vdev->num_rx_frames); in ath11k_wmi_fw_vdev_stats_fill()
7164 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7165 "num rts fail", vdev->num_rts_fail); in ath11k_wmi_fw_vdev_stats_fill()
7166 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7167 "num rts success", vdev->num_rts_success); in ath11k_wmi_fw_vdev_stats_fill()
7168 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7169 "num rx err", vdev->num_rx_err); in ath11k_wmi_fw_vdev_stats_fill()
7170 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7171 "num rx discard", vdev->num_rx_discard); in ath11k_wmi_fw_vdev_stats_fill()
7172 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
7173 "num tx not acked", vdev->num_tx_not_acked); in ath11k_wmi_fw_vdev_stats_fill()
7175 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames); i++) in ath11k_wmi_fw_vdev_stats_fill()
7176 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7179 vdev->num_tx_frames[i]); in ath11k_wmi_fw_vdev_stats_fill()
7181 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames_retries); i++) in ath11k_wmi_fw_vdev_stats_fill()
7182 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7185 vdev->num_tx_frames_retries[i]); in ath11k_wmi_fw_vdev_stats_fill()
7187 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames_failures); i++) in ath11k_wmi_fw_vdev_stats_fill()
7188 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7191 vdev->num_tx_frames_failures[i]); in ath11k_wmi_fw_vdev_stats_fill()
7193 for (i = 0 ; i < ARRAY_SIZE(vdev->tx_rate_history); i++) in ath11k_wmi_fw_vdev_stats_fill()
7194 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7197 vdev->tx_rate_history[i]); in ath11k_wmi_fw_vdev_stats_fill()
7199 for (i = 0 ; i < ARRAY_SIZE(vdev->beacon_rssi_history); i++) in ath11k_wmi_fw_vdev_stats_fill()
7200 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7203 vdev->beacon_rssi_history[i]); in ath11k_wmi_fw_vdev_stats_fill()
7205 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_vdev_stats_fill()
7216 struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7220 ath11k_warn(ar->ab, "invalid vdev id %d in bcn stats", in ath11k_wmi_fw_bcn_stats_fill()
7221 bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7225 vdev_macaddr = arvif->vif->addr; in ath11k_wmi_fw_bcn_stats_fill()
7227 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7228 "VDEV ID", bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7229 len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", in ath11k_wmi_fw_bcn_stats_fill()
7231 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_bcn_stats_fill()
7233 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7234 "Num of beacon tx success", bcn->tx_bcn_succ_cnt); in ath11k_wmi_fw_bcn_stats_fill()
7235 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7236 "Num of beacon tx failures", bcn->tx_bcn_outage_cnt); in ath11k_wmi_fw_bcn_stats_fill()
7238 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_bcn_stats_fill()
7253 spin_lock_bh(&ar->data_lock); in ath11k_wmi_fw_stats_fill()
7256 pdev = list_first_entry_or_null(&fw_stats->pdevs, in ath11k_wmi_fw_stats_fill()
7259 ath11k_warn(ar->ab, "failed to get pdev stats\n"); in ath11k_wmi_fw_stats_fill()
7269 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_stats_fill()
7270 len += scnprintf(buf + len, buf_len - len, "%30s\n", in ath11k_wmi_fw_stats_fill()
7272 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_stats_fill()
7275 list_for_each_entry(vdev, &fw_stats->vdevs, list) in ath11k_wmi_fw_stats_fill()
7280 num_bcn = list_count_nodes(&fw_stats->bcn); in ath11k_wmi_fw_stats_fill()
7282 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_stats_fill()
7283 len += scnprintf(buf + len, buf_len - len, "%30s (%zu)\n", in ath11k_wmi_fw_stats_fill()
7285 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_stats_fill()
7288 list_for_each_entry(bcn, &fw_stats->bcn, list) in ath11k_wmi_fw_stats_fill()
7293 spin_unlock_bh(&ar->data_lock); in ath11k_wmi_fw_stats_fill()
7296 buf[len - 1] = 0; in ath11k_wmi_fw_stats_fill()
7304 wake_up(&ab->wmi_ab.tx_credits_wq); in ath11k_wmi_op_ep_tx_credits()
7315 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_reg_11d_new_cc_event()
7326 return -EPROTO; in ath11k_reg_11d_new_cc_event()
7329 spin_lock_bh(&ab->base_lock); in ath11k_reg_11d_new_cc_event()
7330 memcpy(&ab->new_alpha2, &ev->new_alpha2, 2); in ath11k_reg_11d_new_cc_event()
7331 spin_unlock_bh(&ab->base_lock); in ath11k_reg_11d_new_cc_event()
7334 ab->new_alpha2[0], in ath11k_reg_11d_new_cc_event()
7335 ab->new_alpha2[1]); in ath11k_reg_11d_new_cc_event()
7339 for (i = 0; i < ab->num_radios; i++) { in ath11k_reg_11d_new_cc_event()
7340 pdev = &ab->pdevs[i]; in ath11k_reg_11d_new_cc_event()
7341 ar = pdev->ar; in ath11k_reg_11d_new_cc_event()
7342 ar->state_11d = ATH11K_11D_IDLE; in ath11k_reg_11d_new_cc_event()
7343 complete(&ar->completed_11d_scan); in ath11k_reg_11d_new_cc_event()
7346 queue_work(ab->workqueue, &ab->update_11d_work); in ath11k_reg_11d_new_cc_event()
7359 eid = ATH11K_SKB_CB(skb)->eid; in ath11k_wmi_htc_tx_complete()
7365 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_htc_tx_complete()
7366 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_htc_tx_complete()
7369 for (i = 0; i < ab->htc.wmi_ep_count; i++) { in ath11k_wmi_htc_tx_complete()
7370 if (ab->wmi_ab.wmi[i].eid == eid) { in ath11k_wmi_htc_tx_complete()
7371 wmi = &ab->wmi_ab.wmi[i]; in ath11k_wmi_htc_tx_complete()
7377 wake_up(&wmi->tx_ce_desc_wq); in ath11k_wmi_htc_tx_complete()
7403 ret = -ENOMEM; in ath11k_reg_chan_list_event()
7419 if (reg_info->status_code != REG_SET_CC_STATUS_PASS) { in ath11k_reg_chan_list_event()
7428 pdev_idx = reg_info->phy_id; in ath11k_reg_chan_list_event()
7433 spin_lock(&ab->base_lock); in ath11k_reg_chan_list_event()
7434 if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags) && in ath11k_reg_chan_list_event()
7435 ab->default_regd[pdev_idx]) { in ath11k_reg_chan_list_event()
7436 spin_unlock(&ab->base_lock); in ath11k_reg_chan_list_event()
7439 spin_unlock(&ab->base_lock); in ath11k_reg_chan_list_event()
7441 if (pdev_idx >= ab->num_radios) { in ath11k_reg_chan_list_event()
7446 if (ab->hw_params.single_pdev_only && in ath11k_reg_chan_list_event()
7447 pdev_idx < ab->hw_params.num_rxmda_per_pdev) in ath11k_reg_chan_list_event()
7454 * stop-start after mac registration. in ath11k_reg_chan_list_event()
7456 if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] && in ath11k_reg_chan_list_event()
7457 !memcmp((char *)ab->default_regd[pdev_idx]->alpha2, in ath11k_reg_chan_list_event()
7458 (char *)reg_info->alpha2, 2)) in ath11k_reg_chan_list_event()
7465 if (ab->default_regd[pdev_idx] && in ath11k_reg_chan_list_event()
7467 ab->default_regd[pdev_idx]->alpha2) && in ath11k_reg_chan_list_event()
7468 !ath11k_reg_is_world_alpha((char *)reg_info->alpha2)) in ath11k_reg_chan_list_event()
7477 spin_lock(&ab->base_lock); in ath11k_reg_chan_list_event()
7478 if (ab->default_regd[pdev_idx]) { in ath11k_reg_chan_list_event()
7486 ar = ab->pdevs[pdev_idx].ar; in ath11k_reg_chan_list_event()
7487 kfree(ab->new_regd[pdev_idx]); in ath11k_reg_chan_list_event()
7488 ab->new_regd[pdev_idx] = regd; in ath11k_reg_chan_list_event()
7489 queue_work(ab->workqueue, &ar->regd_update_work); in ath11k_reg_chan_list_event()
7494 ab->default_regd[pdev_idx] = regd; in ath11k_reg_chan_list_event()
7496 ab->dfs_region = reg_info->dfs_region; in ath11k_reg_chan_list_event()
7497 spin_unlock(&ab->base_lock); in ath11k_reg_chan_list_event()
7513 kfree(reg_info->reg_rules_2ghz_ptr); in ath11k_reg_chan_list_event()
7514 kfree(reg_info->reg_rules_5ghz_ptr); in ath11k_reg_chan_list_event()
7515 if (reg_info->is_ext_reg_event) { in ath11k_reg_chan_list_event()
7517 kfree(reg_info->reg_rules_6ghz_ap_ptr[i]); in ath11k_reg_chan_list_event()
7521 kfree(reg_info->reg_rules_6ghz_client_ptr[j][i]); in ath11k_reg_chan_list_event()
7551 ab->wlan_init_status = fixed_param.ready_event_min.status; in ath11k_wmi_tlv_rdy_parse()
7552 rdy_parse->num_extra_mac_addr = in ath11k_wmi_tlv_rdy_parse()
7555 ether_addr_copy(ab->mac_addr, in ath11k_wmi_tlv_rdy_parse()
7557 ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; in ath11k_wmi_tlv_rdy_parse()
7558 ab->wmi_ready = true; in ath11k_wmi_tlv_rdy_parse()
7566 num_mac_addr = rdy_parse->num_extra_mac_addr; in ath11k_wmi_tlv_rdy_parse()
7568 if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) in ath11k_wmi_tlv_rdy_parse()
7571 for (i = 0; i < ab->num_radios; i++) { in ath11k_wmi_tlv_rdy_parse()
7572 pdev = &ab->pdevs[i]; in ath11k_wmi_tlv_rdy_parse()
7573 ether_addr_copy(pdev->mac_addr, addr_list[i].addr); in ath11k_wmi_tlv_rdy_parse()
7575 ab->pdevs_macaddr_valid = true; in ath11k_wmi_tlv_rdy_parse()
7589 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_ready_event()
7598 complete(&ab->wmi_ab.unified_ready); in ath11k_ready_event()
7623 complete(&ar->peer_delete_done); in ath11k_peer_delete_resp_event()
7625 ath11k_dbg(ab, ATH11K_DBG_WMI, "peer delete resp for vdev id %d addr %pM\n", in ath11k_peer_delete_resp_event()
7649 complete(&ar->vdev_delete_done); in ath11k_vdev_delete_resp_event()
7695 ar->last_wmi_vdev_start_status = 0; in ath11k_vdev_start_resp_event()
7702 ar->last_wmi_vdev_start_status = status; in ath11k_vdev_start_resp_event()
7705 complete(&ar->vdev_setup_done); in ath11k_vdev_start_resp_event()
7718 if (ath11k_pull_bcn_tx_status_ev(ab, skb->data, skb->len, in ath11k_bcn_tx_status_event()
7750 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_event_peer_sta_ps_state_chg()
7765 "event peer sta ps change ev addr %pM state %u sup_bitmap %x ps_valid %u ts %u\n", in ath11k_wmi_event_peer_sta_ps_state_chg()
7766 ev->peer_macaddr.addr, ev->peer_ps_state, in ath11k_wmi_event_peer_sta_ps_state_chg()
7767 ev->ps_supported_bitmap, ev->peer_ps_valid, in ath11k_wmi_event_peer_sta_ps_state_chg()
7768 ev->peer_ps_timestamp); in ath11k_wmi_event_peer_sta_ps_state_chg()
7772 spin_lock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7774 peer = ath11k_peer_find_by_addr(ab, ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7777 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7778 ath11k_warn(ab, "peer not found %pM\n", ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7782 ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); in ath11k_wmi_event_peer_sta_ps_state_chg()
7785 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7787 peer->vdev_id); in ath11k_wmi_event_peer_sta_ps_state_chg()
7792 sta = peer->sta; in ath11k_wmi_event_peer_sta_ps_state_chg()
7794 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7797 ath11k_warn(ab, "failed to find station entry %pM\n", in ath11k_wmi_event_peer_sta_ps_state_chg()
7798 ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7802 arsta = (struct ath11k_sta *)sta->drv_priv; in ath11k_wmi_event_peer_sta_ps_state_chg()
7804 spin_lock_bh(&ar->data_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7806 peer_previous_ps_state = arsta->peer_ps_state; in ath11k_wmi_event_peer_sta_ps_state_chg()
7807 arsta->peer_ps_state = ev->peer_ps_state; in ath11k_wmi_event_peer_sta_ps_state_chg()
7808 arsta->peer_current_ps_valid = !!ev->peer_ps_valid; in ath11k_wmi_event_peer_sta_ps_state_chg()
7811 ar->ab->wmi_ab.svc_map)) { in ath11k_wmi_event_peer_sta_ps_state_chg()
7812 if (!(ev->ps_supported_bitmap & WMI_PEER_PS_VALID) || in ath11k_wmi_event_peer_sta_ps_state_chg()
7813 !(ev->ps_supported_bitmap & WMI_PEER_PS_STATE_TIMESTAMP) || in ath11k_wmi_event_peer_sta_ps_state_chg()
7814 !ev->peer_ps_valid) in ath11k_wmi_event_peer_sta_ps_state_chg()
7817 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON) { in ath11k_wmi_event_peer_sta_ps_state_chg()
7818 arsta->ps_start_time = ev->peer_ps_timestamp; in ath11k_wmi_event_peer_sta_ps_state_chg()
7819 arsta->ps_start_jiffies = jiffies; in ath11k_wmi_event_peer_sta_ps_state_chg()
7820 } else if (arsta->peer_ps_state == WMI_PEER_PS_STATE_OFF && in ath11k_wmi_event_peer_sta_ps_state_chg()
7822 arsta->ps_total_duration = arsta->ps_total_duration + in ath11k_wmi_event_peer_sta_ps_state_chg()
7823 (ev->peer_ps_timestamp - arsta->ps_start_time); in ath11k_wmi_event_peer_sta_ps_state_chg()
7826 if (ar->ps_timekeeper_enable) in ath11k_wmi_event_peer_sta_ps_state_chg()
7827 trace_ath11k_ps_timekeeper(ar, ev->peer_macaddr.addr, in ath11k_wmi_event_peer_sta_ps_state_chg()
7828 ev->peer_ps_timestamp, in ath11k_wmi_event_peer_sta_ps_state_chg()
7829 arsta->peer_ps_state); in ath11k_wmi_event_peer_sta_ps_state_chg()
7833 spin_unlock_bh(&ar->data_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7860 complete(&ar->vdev_setup_done); in ath11k_vdev_stopped_event()
7897 if ((test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) || in ath11k_mgmt_rx_event()
7905 status->flag |= RX_FLAG_MMIC_ERROR; in ath11k_mgmt_rx_event()
7909 status->band = NL80211_BAND_6GHZ; in ath11k_mgmt_rx_event()
7910 status->freq = rx_ev.chan_freq; in ath11k_mgmt_rx_event()
7912 status->band = NL80211_BAND_2GHZ; in ath11k_mgmt_rx_event()
7914 status->band = NL80211_BAND_5GHZ; in ath11k_mgmt_rx_event()
7925 (status->band == NL80211_BAND_5GHZ || status->band == NL80211_BAND_6GHZ)) in ath11k_mgmt_rx_event()
7927 "mgmt rx 11b (CCK) on 5/6GHz, band = %d\n", status->band); in ath11k_mgmt_rx_event()
7929 sband = &ar->mac.sbands[status->band]; in ath11k_mgmt_rx_event()
7931 if (status->band != NL80211_BAND_6GHZ) in ath11k_mgmt_rx_event()
7932 status->freq = ieee80211_channel_to_frequency(rx_ev.channel, in ath11k_mgmt_rx_event()
7933 status->band); in ath11k_mgmt_rx_event()
7935 status->signal = rx_ev.snr + ATH11K_DEFAULT_NOISE_FLOOR; in ath11k_mgmt_rx_event()
7936 status->rate_idx = ath11k_mac_bitrate_to_idx(sband, rx_ev.rate / 100); in ath11k_mgmt_rx_event()
7938 hdr = (struct ieee80211_hdr *)skb->data; in ath11k_mgmt_rx_event()
7939 fc = le16_to_cpu(hdr->frame_control); in ath11k_mgmt_rx_event()
7945 status->flag |= RX_FLAG_SKIP_MONITOR; in ath11k_mgmt_rx_event()
7951 if (ieee80211_has_protected(hdr->frame_control) && in ath11k_mgmt_rx_event()
7953 status->flag |= RX_FLAG_DECRYPTED; in ath11k_mgmt_rx_event()
7956 status->flag |= RX_FLAG_IV_STRIPPED | in ath11k_mgmt_rx_event()
7958 hdr->frame_control = __cpu_to_le16(fc & in ath11k_mgmt_rx_event()
7963 if (ieee80211_is_beacon(hdr->frame_control)) in ath11k_mgmt_rx_event()
7968 skb, skb->len, in ath11k_mgmt_rx_event()
7973 status->freq, status->band, status->signal, in ath11k_mgmt_rx_event()
7974 status->rate_idx); in ath11k_mgmt_rx_event()
7976 ieee80211_rx_ni(ar->hw, skb); in ath11k_mgmt_rx_event()
8019 for (i = 0; i < ab->num_radios; i++) { in ath11k_get_ar_on_scan_state()
8020 pdev = rcu_dereference(ab->pdevs_active[i]); in ath11k_get_ar_on_scan_state()
8021 if (pdev && pdev->ar) { in ath11k_get_ar_on_scan_state()
8022 ar = pdev->ar; in ath11k_get_ar_on_scan_state()
8024 spin_lock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
8025 if (ar->scan.state == state && in ath11k_get_ar_on_scan_state()
8026 ar->scan.vdev_id == vdev_id) { in ath11k_get_ar_on_scan_state()
8027 spin_unlock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
8030 spin_unlock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
8071 spin_lock_bh(&ar->data_lock); in ath11k_scan_event()
8078 ath11k_scan_state_str(ar->scan.state), ar->scan.state); in ath11k_scan_event()
8107 spin_unlock_bh(&ar->data_lock); in ath11k_scan_event()
8127 spin_lock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
8132 ath11k_warn(ab, "peer not found %pM\n", in ath11k_peer_sta_kickout_event()
8134 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
8138 vdev_id = peer->vdev_id; in ath11k_peer_sta_kickout_event()
8140 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
8145 peer->vdev_id); in ath11k_peer_sta_kickout_event()
8149 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_peer_sta_kickout_event()
8152 ath11k_warn(ab, "Spurious quick kickout for STA %pM\n", in ath11k_peer_sta_kickout_event()
8157 ath11k_dbg(ab, ATH11K_DBG_WMI, "event peer sta kickout %pM", in ath11k_peer_sta_kickout_event()
8216 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_chan_info_event()
8218 if (ath11k_pull_chan_info_ev(ab, skb->data, skb->len, &ch_info_ev) != 0) { in ath11k_chan_info_event()
8243 spin_lock_bh(&ar->data_lock); in ath11k_chan_info_event()
8245 switch (ar->scan.state) { in ath11k_chan_info_event()
8256 if (idx >= ARRAY_SIZE(ar->survey)) { in ath11k_chan_info_event()
8269 survey = &ar->survey[idx]; in ath11k_chan_info_event()
8271 survey->noise = ch_info_ev.noise_floor; in ath11k_chan_info_event()
8272 survey->filled = SURVEY_INFO_NOISE_DBM | SURVEY_INFO_TIME | in ath11k_chan_info_event()
8274 survey->time = div_u64(ch_info_ev.cycle_count, cc_freq_hz); in ath11k_chan_info_event()
8275 survey->time_busy = div_u64(ch_info_ev.rx_clear_count, cc_freq_hz); in ath11k_chan_info_event()
8278 spin_unlock_bh(&ar->data_lock); in ath11k_chan_info_event()
8288 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_pdev_bss_chan_info_event()
8335 spin_lock_bh(&ar->data_lock); in ath11k_pdev_bss_chan_info_event()
8337 if (idx >= ARRAY_SIZE(ar->survey)) { in ath11k_pdev_bss_chan_info_event()
8343 survey = &ar->survey[idx]; in ath11k_pdev_bss_chan_info_event()
8345 survey->noise = bss_ch_info_ev.noise_floor; in ath11k_pdev_bss_chan_info_event()
8346 survey->time = div_u64(total, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8347 survey->time_busy = div_u64(busy, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8348 survey->time_rx = div_u64(rx_bss, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8349 survey->time_tx = div_u64(tx, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8350 survey->filled |= (SURVEY_INFO_NOISE_DBM | in ath11k_pdev_bss_chan_info_event()
8356 spin_unlock_bh(&ar->data_lock); in ath11k_pdev_bss_chan_info_event()
8357 complete(&ar->bss_survey_done); in ath11k_pdev_bss_chan_info_event()
8374 "event vdev install key ev idx %d flags %08x macaddr %pM status %d\n", in ath11k_vdev_install_key_compl_event()
8387 ar->install_key_status = 0; in ath11k_vdev_install_key_compl_event()
8390 ath11k_warn(ab, "install key failed for %pM status %d\n", in ath11k_vdev_install_key_compl_event()
8392 ar->install_key_status = install_key_compl.status; in ath11k_vdev_install_key_compl_event()
8395 complete(&ar->install_key_done); in ath11k_vdev_install_key_compl_event()
8422 if (ev->wmi_service_segment_bitmap[i] & in ath11k_wmi_tlv_services_parser()
8424 set_bit(j, ab->wmi_ab.svc_map); in ath11k_wmi_tlv_services_parser()
8430 ev->wmi_service_segment_bitmap[0], in ath11k_wmi_tlv_services_parser()
8431 ev->wmi_service_segment_bitmap[1], in ath11k_wmi_tlv_services_parser()
8432 ev->wmi_service_segment_bitmap[2], in ath11k_wmi_tlv_services_parser()
8433 ev->wmi_service_segment_bitmap[3]); in ath11k_wmi_tlv_services_parser()
8447 set_bit(j, ab->wmi_ab.svc_map); in ath11k_wmi_tlv_services_parser()
8464 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_available_event()
8484 "event peer assoc conf ev vdev id %d macaddr %pM\n", in ath11k_peer_assoc_conf_event()
8497 complete(&ar->peer_assoc_done); in ath11k_peer_assoc_conf_event()
8528 spin_lock_bh(&ar->data_lock); in ath11k_update_stats_event()
8534 list_splice_tail_init(&stats.pdevs, &ar->fw_stats.pdevs); in ath11k_update_stats_event()
8535 ar->fw_stats_done = true; in ath11k_update_stats_event()
8546 complete(&ar->fw_stats_complete); in ath11k_update_stats_event()
8548 spin_unlock_bh(&ar->data_lock); in ath11k_update_stats_event()
8569 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_pdev_ctl_failsafe_check_event()
8585 ev->ctl_failsafe_status); in ath11k_pdev_ctl_failsafe_check_event()
8590 if (ev->ctl_failsafe_status != 0) in ath11k_pdev_ctl_failsafe_check_event()
8592 ev->ctl_failsafe_status); in ath11k_pdev_ctl_failsafe_check_event()
8606 if (ev->current_switch_count) in ath11k_wmi_process_csa_switch_count_event()
8610 for (i = 0; i < ev->num_vdevs; i++) { in ath11k_wmi_process_csa_switch_count_event()
8619 if (arvif->is_up && arvif->vif->bss_conf.csa_active) in ath11k_wmi_process_csa_switch_count_event()
8620 ieee80211_csa_finish(arvif->vif); in ath11k_wmi_process_csa_switch_count_event()
8634 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_pdev_csa_switch_count_status_event()
8652 ev->current_switch_count, ev->pdev_id, in ath11k_wmi_pdev_csa_switch_count_status_event()
8653 ev->num_vdevs); in ath11k_wmi_pdev_csa_switch_count_status_event()
8668 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_pdev_dfs_radar_detected_event()
8685 ev->pdev_id, ev->detection_mode, ev->chan_freq, ev->chan_width, in ath11k_wmi_pdev_dfs_radar_detected_event()
8686 ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, in ath11k_wmi_pdev_dfs_radar_detected_event()
8687 ev->freq_offset, ev->sidx); in ath11k_wmi_pdev_dfs_radar_detected_event()
8689 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8693 ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8697 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "DFS Radar Detected in pdev %d\n", in ath11k_wmi_pdev_dfs_radar_detected_event()
8698 ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8700 if (ar->dfs_block_radar_events) in ath11k_wmi_pdev_dfs_radar_detected_event()
8703 ieee80211_radar_detected(ar->hw); in ath11k_wmi_pdev_dfs_radar_detected_event()
8718 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_pdev_temperature_event()
8733 ev->temp, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8735 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8737 ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8742 ath11k_thermal_event_temperature(ar, ev->temp); in ath11k_wmi_pdev_temperature_event()
8754 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_fils_discovery_event()
8774 ev->vdev_id, ev->fils_tt, ev->tbtt); in ath11k_fils_discovery_event()
8786 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_probe_resp_tx_status_event()
8805 if (ev->tx_status) in ath11k_probe_resp_tx_status_event()
8808 ev->vdev_id, ev->tx_status); in ath11k_probe_resp_tx_status_event()
8825 ev->wake_reason, wow_reason(ev->wake_reason)); in ath11k_wmi_tlv_wow_wakeup_host_parse()
8829 if (ev && ev->wake_reason == WOW_REASON_PAGE_FAULT) { in ath11k_wmi_tlv_wow_wakeup_host_parse()
8859 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_event_wow_wakeup_host()
8869 complete(&ab->wow.wakeup_completed); in ath11k_wmi_event_wow_wakeup_host()
8878 trace_ath11k_wmi_diag(ab, skb->data, skb->len); in ath11k_wmi_diag_event()
8889 return "dialog id in use"; in ath11k_wmi_twt_add_dialog_event_status()
8916 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_twt_add_dialog_event()
8933 if (ev->status) in ath11k_wmi_twt_add_dialog_event()
8936 ev->vdev_id, ev->dialog_id, in ath11k_wmi_twt_add_dialog_event()
8937 ath11k_wmi_twt_add_dialog_event_status(ev->status)); in ath11k_wmi_twt_add_dialog_event()
8953 tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); in ath11k_wmi_gtk_offload_status_event()
8967 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); in ath11k_wmi_gtk_offload_status_event()
8970 ev->vdev_id); in ath11k_wmi_gtk_offload_status_event()
8976 ev->refresh_cnt); in ath11k_wmi_gtk_offload_status_event()
8978 NULL, ev->replay_ctr.counter, GTK_REPLAY_COUNTER_BYTES); in ath11k_wmi_gtk_offload_status_event()
8980 replay_ctr = ev->replay_ctr.word1; in ath11k_wmi_gtk_offload_status_event()
8981 replay_ctr = (replay_ctr << 32) | ev->replay_ctr.word0; in ath11k_wmi_gtk_offload_status_event()
8982 arvif->rekey_data.replay_ctr = replay_ctr; in ath11k_wmi_gtk_offload_status_event()
8984 /* supplicant expects big-endian replay counter */ in ath11k_wmi_gtk_offload_status_event()
8987 ieee80211_gtk_rekey_notify(arvif->vif, arvif->bssid, in ath11k_wmi_gtk_offload_status_event()
8998 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath11k_wmi_tlv_op_rx()
8999 id = FIELD_GET(WMI_CMD_HDR_CMD_ID, (cmd_hdr->cmd_id)); in ath11k_wmi_tlv_op_rx()
9001 trace_ath11k_wmi_event(ab, id, skb->data, skb->len); in ath11k_wmi_tlv_op_rx()
9151 status = ath11k_htc_connect_service(&ab->htc, &conn_req, &conn_resp); in ath11k_connect_pdev_htc_service()
9158 ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid; in ath11k_connect_pdev_htc_service()
9159 ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid; in ath11k_connect_pdev_htc_service()
9160 ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len; in ath11k_connect_pdev_htc_service()
9161 init_waitqueue_head(&ab->wmi_ab.wmi[pdev_idx].tx_ce_desc_wq); in ath11k_connect_pdev_htc_service()
9171 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_unit_test_cmd()
9188 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, buf_len); in ath11k_wmi_send_unit_test_cmd()
9190 return -ENOMEM; in ath11k_wmi_send_unit_test_cmd()
9192 cmd = (struct wmi_unit_test_cmd *)skb->data; in ath11k_wmi_send_unit_test_cmd()
9193 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_UNIT_TEST_CMD) | in ath11k_wmi_send_unit_test_cmd()
9194 FIELD_PREP(WMI_TLV_LEN, sizeof(ut_cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_unit_test_cmd()
9196 cmd->vdev_id = ut_cmd.vdev_id; in ath11k_wmi_send_unit_test_cmd()
9197 cmd->module_id = ut_cmd.module_id; in ath11k_wmi_send_unit_test_cmd()
9198 cmd->num_args = ut_cmd.num_args; in ath11k_wmi_send_unit_test_cmd()
9199 cmd->diag_token = ut_cmd.diag_token; in ath11k_wmi_send_unit_test_cmd()
9201 ptr = skb->data + sizeof(ut_cmd); in ath11k_wmi_send_unit_test_cmd()
9208 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_send_unit_test_cmd()
9224 ath11k_warn(ar->ab, "failed to send WMI_UNIT_TEST CMD :%d\n", in ath11k_wmi_send_unit_test_cmd()
9229 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_unit_test_cmd()
9231 cmd->module_id, cmd->vdev_id, cmd->num_args, in ath11k_wmi_send_unit_test_cmd()
9232 cmd->diag_token); in ath11k_wmi_send_unit_test_cmd()
9244 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wmi_simulate_radar()
9245 if (arvif->is_started && arvif->vdev_type == WMI_VDEV_TYPE_AP) { in ath11k_wmi_simulate_radar()
9252 return -EINVAL; in ath11k_wmi_simulate_radar()
9255 dfs_args[DFS_TEST_PDEV_ID] = ar->pdev->pdev_id; in ath11k_wmi_simulate_radar()
9256 /* Currently we could pass segment_id(b0 - b1), chirp(b2) in ath11k_wmi_simulate_radar()
9257 * freq offset (b3 - b10) to unit test. For simulation in ath11k_wmi_simulate_radar()
9262 wmi_ut.vdev_id = arvif->vdev_id; in ath11k_wmi_simulate_radar()
9267 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "Triggering Radar Simulation\n"); in ath11k_wmi_simulate_radar()
9275 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_fw_dbglog_cfg()
9282 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_fw_dbglog_cfg()
9284 return -ENOMEM; in ath11k_wmi_fw_dbglog_cfg()
9286 cmd = (struct wmi_debug_log_config_cmd_fixed_param *)skb->data; in ath11k_wmi_fw_dbglog_cfg()
9287 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DEBUG_LOG_CONFIG_CMD) | in ath11k_wmi_fw_dbglog_cfg()
9288 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_fw_dbglog_cfg()
9289 cmd->dbg_log_param = dbglog->param; in ath11k_wmi_fw_dbglog_cfg()
9292 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_fw_dbglog_cfg()
9295 switch (dbglog->param) { in ath11k_wmi_fw_dbglog_cfg()
9300 cmd->value = dbglog->value; in ath11k_wmi_fw_dbglog_cfg()
9304 cmd->value = dbglog->value; in ath11k_wmi_fw_dbglog_cfg()
9305 memcpy(tlv->value, module_id_bitmap, in ath11k_wmi_fw_dbglog_cfg()
9313 return -EINVAL; in ath11k_wmi_fw_dbglog_cfg()
9318 ath11k_warn(ar->ab, in ath11k_wmi_fw_dbglog_cfg()
9323 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd dbglog cfg"); in ath11k_wmi_fw_dbglog_cfg()
9333 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_connect()
9334 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_connect()
9335 return -1; in ath11k_wmi_connect()
9356 if (pdev_id >= ab->hw_params.max_radios) in ath11k_wmi_pdev_attach()
9357 return -EINVAL; in ath11k_wmi_pdev_attach()
9359 wmi_handle = &ab->wmi_ab.wmi[pdev_id]; in ath11k_wmi_pdev_attach()
9361 wmi_handle->wmi_ab = &ab->wmi_ab; in ath11k_wmi_pdev_attach()
9363 ab->wmi_ab.ab = ab; in ath11k_wmi_pdev_attach()
9377 ab->wmi_ab.ab = ab; in ath11k_wmi_attach()
9378 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_MAX; in ath11k_wmi_attach()
9381 if (ab->hw_params.single_pdev_only && ab->hw_params.num_rxmda_per_pdev > 1) in ath11k_wmi_attach()
9382 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_SINGLE; in ath11k_wmi_attach()
9385 init_completion(&ab->wmi_ab.service_ready); in ath11k_wmi_attach()
9386 init_completion(&ab->wmi_ab.unified_ready); in ath11k_wmi_attach()
9397 for (i = 0; i < ab->htc.wmi_ep_count; i++) in ath11k_wmi_detach()
9411 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_hw_data_filter_cmd()
9414 return -ENOMEM; in ath11k_wmi_hw_data_filter_cmd()
9416 cmd = (struct wmi_hw_data_filter_cmd *)skb->data; in ath11k_wmi_hw_data_filter_cmd()
9417 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_HW_DATA_FILTER_CMD) | in ath11k_wmi_hw_data_filter_cmd()
9418 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_hw_data_filter_cmd()
9420 cmd->vdev_id = vdev_id; in ath11k_wmi_hw_data_filter_cmd()
9421 cmd->enable = enable; in ath11k_wmi_hw_data_filter_cmd()
9424 if (cmd->enable) in ath11k_wmi_hw_data_filter_cmd()
9425 cmd->hw_filter_bitmap = filter_bitmap; in ath11k_wmi_hw_data_filter_cmd()
9427 cmd->hw_filter_bitmap = ((u32)~0U); in ath11k_wmi_hw_data_filter_cmd()
9429 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_hw_data_filter_cmd()
9433 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_HW_DATA_FILTER_CMDID); in ath11k_wmi_hw_data_filter_cmd()
9443 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_host_wakeup_ind()
9445 return -ENOMEM; in ath11k_wmi_wow_host_wakeup_ind()
9447 cmd = (struct wmi_wow_host_wakeup_ind *)skb->data; in ath11k_wmi_wow_host_wakeup_ind()
9448 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_host_wakeup_ind()
9450 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_host_wakeup_ind()
9452 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow host wakeup ind\n"); in ath11k_wmi_wow_host_wakeup_ind()
9454 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID); in ath11k_wmi_wow_host_wakeup_ind()
9464 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_enable()
9466 return -ENOMEM; in ath11k_wmi_wow_enable()
9468 cmd = (struct wmi_wow_enable_cmd *)skb->data; in ath11k_wmi_wow_enable()
9469 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ENABLE_CMD) | in ath11k_wmi_wow_enable()
9470 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_enable()
9472 cmd->enable = 1; in ath11k_wmi_wow_enable()
9473 cmd->pause_iface_config = WOW_IFACE_PAUSE_ENABLED; in ath11k_wmi_wow_enable()
9474 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow enable\n"); in ath11k_wmi_wow_enable()
9476 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_CMDID); in ath11k_wmi_wow_enable()
9491 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_scan_prob_req_oui()
9493 return -ENOMEM; in ath11k_wmi_scan_prob_req_oui()
9495 cmd = (struct wmi_scan_prob_req_oui_cmd *)skb->data; in ath11k_wmi_scan_prob_req_oui()
9496 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_scan_prob_req_oui()
9498 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_scan_prob_req_oui()
9499 cmd->prob_req_oui = prob_req_oui; in ath11k_wmi_scan_prob_req_oui()
9501 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "scan prob req oui %d\n", in ath11k_wmi_scan_prob_req_oui()
9504 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_SCAN_PROB_REQ_OUI_CMDID); in ath11k_wmi_scan_prob_req_oui()
9516 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_add_wakeup_event()
9518 return -ENOMEM; in ath11k_wmi_wow_add_wakeup_event()
9520 cmd = (struct wmi_wow_add_del_event_cmd *)skb->data; in ath11k_wmi_wow_add_wakeup_event()
9521 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ADD_DEL_EVT_CMD) | in ath11k_wmi_wow_add_wakeup_event()
9522 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_wakeup_event()
9524 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_add_wakeup_event()
9525 cmd->is_add = enable; in ath11k_wmi_wow_add_wakeup_event()
9526 cmd->event_bitmap = (1 << event); in ath11k_wmi_wow_add_wakeup_event()
9528 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow add wakeup event %s enable %d vdev_id %d\n", in ath11k_wmi_wow_add_wakeup_event()
9531 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID); in ath11k_wmi_wow_add_wakeup_event()
9554 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_add_pattern()
9556 return -ENOMEM; in ath11k_wmi_wow_add_pattern()
9559 ptr = (u8 *)skb->data; in ath11k_wmi_wow_add_pattern()
9561 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9563 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_pattern()
9565 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_add_pattern()
9566 cmd->pattern_id = pattern_id; in ath11k_wmi_wow_add_pattern()
9567 cmd->pattern_type = WOW_BITMAP_PATTERN; in ath11k_wmi_wow_add_pattern()
9573 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9580 bitmap->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9582 FIELD_PREP(WMI_TLV_LEN, sizeof(*bitmap) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_pattern()
9584 memcpy(bitmap->patternbuf, pattern, pattern_len); in ath11k_wmi_wow_add_pattern()
9585 ath11k_ce_byte_swap(bitmap->patternbuf, roundup(pattern_len, 4)); in ath11k_wmi_wow_add_pattern()
9586 memcpy(bitmap->bitmaskbuf, mask, pattern_len); in ath11k_wmi_wow_add_pattern()
9587 ath11k_ce_byte_swap(bitmap->bitmaskbuf, roundup(pattern_len, 4)); in ath11k_wmi_wow_add_pattern()
9588 bitmap->pattern_offset = pattern_offset; in ath11k_wmi_wow_add_pattern()
9589 bitmap->pattern_len = pattern_len; in ath11k_wmi_wow_add_pattern()
9590 bitmap->bitmask_len = pattern_len; in ath11k_wmi_wow_add_pattern()
9591 bitmap->pattern_id = pattern_id; in ath11k_wmi_wow_add_pattern()
9597 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9605 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9613 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9621 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9629 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9633 …ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow add pattern vdev_id %d pattern_id %d pattern_offset %d… in ath11k_wmi_wow_add_pattern()
9636 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ADD_WAKE_PATTERN_CMDID); in ath11k_wmi_wow_add_pattern()
9646 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_del_pattern()
9648 return -ENOMEM; in ath11k_wmi_wow_del_pattern()
9650 cmd = (struct wmi_wow_del_pattern_cmd *)skb->data; in ath11k_wmi_wow_del_pattern()
9651 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_del_pattern()
9653 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_del_pattern()
9655 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_del_pattern()
9656 cmd->pattern_id = pattern_id; in ath11k_wmi_wow_del_pattern()
9657 cmd->pattern_type = WOW_BITMAP_PATTERN; in ath11k_wmi_wow_del_pattern()
9659 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow del pattern vdev_id %d pattern_id %d\n", in ath11k_wmi_wow_del_pattern()
9662 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_DEL_WAKE_PATTERN_CMDID); in ath11k_wmi_wow_del_pattern()
9687 channel_list_len = sizeof(u32) * pno->a_networks[0].channel_count; in ath11k_wmi_op_gen_config_pno_start()
9690 nlo_list_len = sizeof(*nlo_list) * pno->uc_networks_count; in ath11k_wmi_op_gen_config_pno_start()
9693 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_op_gen_config_pno_start()
9695 return ERR_PTR(-ENOMEM); in ath11k_wmi_op_gen_config_pno_start()
9697 ptr = (u8 *)skb->data; in ath11k_wmi_op_gen_config_pno_start()
9699 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NLO_CONFIG_CMD) | in ath11k_wmi_op_gen_config_pno_start()
9700 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_op_gen_config_pno_start()
9702 cmd->vdev_id = pno->vdev_id; in ath11k_wmi_op_gen_config_pno_start()
9703 cmd->flags = WMI_NLO_CONFIG_START | WMI_NLO_CONFIG_SSID_HIDE_EN; in ath11k_wmi_op_gen_config_pno_start()
9705 /* current FW does not support min-max range for dwell time */ in ath11k_wmi_op_gen_config_pno_start()
9706 cmd->active_dwell_time = pno->active_max_time; in ath11k_wmi_op_gen_config_pno_start()
9707 cmd->passive_dwell_time = pno->passive_max_time; in ath11k_wmi_op_gen_config_pno_start()
9709 if (pno->do_passive_scan) in ath11k_wmi_op_gen_config_pno_start()
9710 cmd->flags |= WMI_NLO_CONFIG_SCAN_PASSIVE; in ath11k_wmi_op_gen_config_pno_start()
9712 cmd->fast_scan_period = pno->fast_scan_period; in ath11k_wmi_op_gen_config_pno_start()
9713 cmd->slow_scan_period = pno->slow_scan_period; in ath11k_wmi_op_gen_config_pno_start()
9714 cmd->fast_scan_max_cycles = pno->fast_scan_max_cycles; in ath11k_wmi_op_gen_config_pno_start()
9715 cmd->delay_start_time = pno->delay_start_time; in ath11k_wmi_op_gen_config_pno_start()
9717 if (pno->enable_pno_scan_randomization) { in ath11k_wmi_op_gen_config_pno_start()
9718 cmd->flags |= WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ | in ath11k_wmi_op_gen_config_pno_start()
9720 ether_addr_copy(cmd->mac_addr.addr, pno->mac_addr); in ath11k_wmi_op_gen_config_pno_start()
9721 ether_addr_copy(cmd->mac_mask.addr, pno->mac_addr_mask); in ath11k_wmi_op_gen_config_pno_start()
9722 ath11k_ce_byte_swap(cmd->mac_addr.addr, 8); in ath11k_wmi_op_gen_config_pno_start()
9723 ath11k_ce_byte_swap(cmd->mac_mask.addr, 8); in ath11k_wmi_op_gen_config_pno_start()
9729 cmd->no_of_ssids = pno->uc_networks_count; in ath11k_wmi_op_gen_config_pno_start()
9731 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_op_gen_config_pno_start()
9737 for (i = 0; i < cmd->no_of_ssids; i++) { in ath11k_wmi_op_gen_config_pno_start()
9739 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_op_gen_config_pno_start()
9740 FIELD_PREP(WMI_TLV_LEN, sizeof(*nlo_list) - sizeof(*tlv)); in ath11k_wmi_op_gen_config_pno_start()
9743 nlo_list[i].ssid.ssid.ssid_len = pno->a_networks[i].ssid.ssid_len; in ath11k_wmi_op_gen_config_pno_start()
9745 pno->a_networks[i].ssid.ssid, in ath11k_wmi_op_gen_config_pno_start()
9750 if (pno->a_networks[i].rssi_threshold && in ath11k_wmi_op_gen_config_pno_start()
9751 pno->a_networks[i].rssi_threshold > -300) { in ath11k_wmi_op_gen_config_pno_start()
9754 pno->a_networks[i].rssi_threshold; in ath11k_wmi_op_gen_config_pno_start()
9759 pno->a_networks[i].bcast_nw_type; in ath11k_wmi_op_gen_config_pno_start()
9763 cmd->num_of_channels = pno->a_networks[0].channel_count; in ath11k_wmi_op_gen_config_pno_start()
9765 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_op_gen_config_pno_start()
9769 for (i = 0; i < cmd->num_of_channels; i++) in ath11k_wmi_op_gen_config_pno_start()
9770 channel_list[i] = pno->a_networks[0].channels[i]; in ath11k_wmi_op_gen_config_pno_start()
9772 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv start pno config vdev_id %d\n", in ath11k_wmi_op_gen_config_pno_start()
9786 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_op_gen_config_pno_stop()
9788 return ERR_PTR(-ENOMEM); in ath11k_wmi_op_gen_config_pno_stop()
9790 cmd = (struct wmi_wow_nlo_config_cmd *)skb->data; in ath11k_wmi_op_gen_config_pno_stop()
9791 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NLO_CONFIG_CMD) | in ath11k_wmi_op_gen_config_pno_stop()
9792 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_op_gen_config_pno_stop()
9794 cmd->vdev_id = vdev_id; in ath11k_wmi_op_gen_config_pno_stop()
9795 cmd->flags = WMI_NLO_CONFIG_STOP; in ath11k_wmi_op_gen_config_pno_stop()
9797 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_op_gen_config_pno_stop()
9807 if (pno_scan->enable) in ath11k_wmi_wow_config_pno()
9813 return -ENOMEM; in ath11k_wmi_wow_config_pno()
9815 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); in ath11k_wmi_wow_config_pno()
9830 ns_cnt = offload->ipv6_count; in ath11k_wmi_fill_ns_offload()
9835 ns_ext_tuples = offload->ipv6_count - WMI_MAX_NS_OFFLOADS; in ath11k_wmi_fill_ns_offload()
9836 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_ns_offload()
9839 max_offloads = offload->ipv6_count; in ath11k_wmi_fill_ns_offload()
9841 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_ns_offload()
9851 ns->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NS_OFFLOAD_TUPLE) | in ath11k_wmi_fill_ns_offload()
9852 FIELD_PREP(WMI_TLV_LEN, sizeof(*ns) - TLV_HDR_SIZE); in ath11k_wmi_fill_ns_offload()
9856 ns->flags |= WMI_NSOL_FLAGS_VALID; in ath11k_wmi_fill_ns_offload()
9858 memcpy(ns->target_ipaddr[0], offload->ipv6_addr[i], 16); in ath11k_wmi_fill_ns_offload()
9859 memcpy(ns->solicitation_ipaddr, offload->self_ipv6_addr[i], 16); in ath11k_wmi_fill_ns_offload()
9860 ath11k_ce_byte_swap(ns->target_ipaddr[0], 16); in ath11k_wmi_fill_ns_offload()
9861 ath11k_ce_byte_swap(ns->solicitation_ipaddr, 16); in ath11k_wmi_fill_ns_offload()
9863 if (offload->ipv6_type[i]) in ath11k_wmi_fill_ns_offload()
9864 ns->flags |= WMI_NSOL_FLAGS_IS_IPV6_ANYCAST; in ath11k_wmi_fill_ns_offload()
9866 memcpy(ns->target_mac.addr, offload->mac_addr, ETH_ALEN); in ath11k_wmi_fill_ns_offload()
9867 ath11k_ce_byte_swap(ns->target_mac.addr, 8); in ath11k_wmi_fill_ns_offload()
9869 if (ns->target_mac.word0 != 0 || in ath11k_wmi_fill_ns_offload()
9870 ns->target_mac.word1 != 0) { in ath11k_wmi_fill_ns_offload()
9871 ns->flags |= WMI_NSOL_FLAGS_MAC_VALID; in ath11k_wmi_fill_ns_offload()
9874 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fill_ns_offload()
9876 i, ns->solicitation_ipaddr, in ath11k_wmi_fill_ns_offload()
9877 ns->target_ipaddr[0]); in ath11k_wmi_fill_ns_offload()
9898 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_arp_offload()
9904 arp->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARP_OFFLOAD_TUPLE) | in ath11k_wmi_fill_arp_offload()
9905 FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE); in ath11k_wmi_fill_arp_offload()
9907 if (enable && i < offload->ipv4_count) { in ath11k_wmi_fill_arp_offload()
9909 arp->flags = WMI_ARPOL_FLAGS_VALID; in ath11k_wmi_fill_arp_offload()
9910 memcpy(arp->target_ipaddr, offload->ipv4_addr[i], 4); in ath11k_wmi_fill_arp_offload()
9911 ath11k_ce_byte_swap(arp->target_ipaddr, 4); in ath11k_wmi_fill_arp_offload()
9913 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "arp offload address %pI4", in ath11k_wmi_fill_arp_offload()
9914 arp->target_ipaddr); in ath11k_wmi_fill_arp_offload()
9934 offload = &arvif->arp_ns_offload; in ath11k_wmi_arp_ns_offload()
9935 ns_cnt = offload->ipv6_count; in ath11k_wmi_arp_ns_offload()
9944 ns_ext_tuples = ns_cnt - WMI_MAX_NS_OFFLOADS; in ath11k_wmi_arp_ns_offload()
9949 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_arp_ns_offload()
9951 return -ENOMEM; in ath11k_wmi_arp_ns_offload()
9953 buf_ptr = skb->data; in ath11k_wmi_arp_ns_offload()
9955 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_arp_ns_offload()
9957 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_arp_ns_offload()
9959 cmd->flags = 0; in ath11k_wmi_arp_ns_offload()
9960 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_arp_ns_offload()
9961 cmd->num_ns_ext_tuples = ns_ext_tuples; in ath11k_wmi_arp_ns_offload()
9971 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_SET_ARP_NS_OFFLOAD_CMDID); in ath11k_wmi_arp_ns_offload()
9978 struct ath11k_rekey_data *rekey_data = &arvif->rekey_data; in ath11k_wmi_gtk_rekey_offload()
9984 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_gtk_rekey_offload()
9986 return -ENOMEM; in ath11k_wmi_gtk_rekey_offload()
9988 cmd = (struct wmi_gtk_rekey_offload_cmd *)skb->data; in ath11k_wmi_gtk_rekey_offload()
9989 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_GTK_OFFLOAD_CMD) | in ath11k_wmi_gtk_rekey_offload()
9990 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_gtk_rekey_offload()
9992 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_gtk_rekey_offload()
9995 cmd->flags = GTK_OFFLOAD_ENABLE_OPCODE; in ath11k_wmi_gtk_rekey_offload()
9998 memcpy(cmd->kck, rekey_data->kck, sizeof(cmd->kck)); in ath11k_wmi_gtk_rekey_offload()
9999 ath11k_ce_byte_swap(cmd->kck, GTK_OFFLOAD_KEK_BYTES); in ath11k_wmi_gtk_rekey_offload()
10000 memcpy(cmd->kek, rekey_data->kek, sizeof(cmd->kek)); in ath11k_wmi_gtk_rekey_offload()
10001 ath11k_ce_byte_swap(cmd->kek, GTK_OFFLOAD_KEK_BYTES); in ath11k_wmi_gtk_rekey_offload()
10003 replay_ctr = cpu_to_le64(rekey_data->replay_ctr); in ath11k_wmi_gtk_rekey_offload()
10004 memcpy(cmd->replay_ctr, &replay_ctr, in ath11k_wmi_gtk_rekey_offload()
10006 ath11k_ce_byte_swap(cmd->replay_ctr, GTK_REPLAY_COUNTER_BYTES); in ath11k_wmi_gtk_rekey_offload()
10008 cmd->flags = GTK_OFFLOAD_DISABLE_OPCODE; in ath11k_wmi_gtk_rekey_offload()
10011 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "offload gtk rekey vdev: %d %d\n", in ath11k_wmi_gtk_rekey_offload()
10012 arvif->vdev_id, enable); in ath11k_wmi_gtk_rekey_offload()
10013 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_GTK_OFFLOAD_CMDID); in ath11k_wmi_gtk_rekey_offload()
10024 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_gtk_rekey_getinfo()
10026 return -ENOMEM; in ath11k_wmi_gtk_rekey_getinfo()
10028 cmd = (struct wmi_gtk_rekey_offload_cmd *)skb->data; in ath11k_wmi_gtk_rekey_getinfo()
10029 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_GTK_OFFLOAD_CMD) | in ath11k_wmi_gtk_rekey_getinfo()
10030 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_gtk_rekey_getinfo()
10032 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_gtk_rekey_getinfo()
10033 cmd->flags = GTK_OFFLOAD_REQUEST_STATUS_OPCODE; in ath11k_wmi_gtk_rekey_getinfo()
10035 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "get gtk rekey vdev_id: %d\n", in ath11k_wmi_gtk_rekey_getinfo()
10036 arvif->vdev_id); in ath11k_wmi_gtk_rekey_getinfo()
10037 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_GTK_OFFLOAD_CMDID); in ath11k_wmi_gtk_rekey_getinfo()
10041 { struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_bios_sar_table_param()
10054 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_bios_sar_table_param()
10056 return -ENOMEM; in ath11k_wmi_pdev_set_bios_sar_table_param()
10058 cmd = (struct wmi_pdev_set_sar_table_cmd *)skb->data; in ath11k_wmi_pdev_set_bios_sar_table_param()
10059 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_BIOS_SAR_TABLE_CMD) | in ath11k_wmi_pdev_set_bios_sar_table_param()
10060 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_bios_sar_table_param()
10061 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_bios_sar_table_param()
10062 cmd->sar_len = BIOS_SAR_TABLE_LEN; in ath11k_wmi_pdev_set_bios_sar_table_param()
10063 cmd->rsvd_len = BIOS_SAR_RSVD1_LEN; in ath11k_wmi_pdev_set_bios_sar_table_param()
10065 buf_ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_set_bios_sar_table_param()
10067 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_sar_table_param()
10074 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_sar_table_param()
10082 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_bios_geo_table_param()
10092 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_bios_geo_table_param()
10094 return -ENOMEM; in ath11k_wmi_pdev_set_bios_geo_table_param()
10096 cmd = (struct wmi_pdev_set_geo_table_cmd *)skb->data; in ath11k_wmi_pdev_set_bios_geo_table_param()
10097 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_BIOS_GEO_TABLE_CMD) | in ath11k_wmi_pdev_set_bios_geo_table_param()
10098 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_bios_geo_table_param()
10099 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_bios_geo_table_param()
10100 cmd->rsvd_len = BIOS_SAR_RSVD2_LEN; in ath11k_wmi_pdev_set_bios_geo_table_param()
10102 buf_ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_set_bios_geo_table_param()
10104 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_geo_table_param()
10113 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_sta_keepalive()
10120 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_sta_keepalive()
10122 return -ENOMEM; in ath11k_wmi_sta_keepalive()
10124 cmd = (struct wmi_sta_keepalive_cmd *)skb->data; in ath11k_wmi_sta_keepalive()
10125 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_sta_keepalive()
10127 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_sta_keepalive()
10128 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_sta_keepalive()
10129 cmd->enabled = arg->enabled; in ath11k_wmi_sta_keepalive()
10130 cmd->interval = arg->interval; in ath11k_wmi_sta_keepalive()
10131 cmd->method = arg->method; in ath11k_wmi_sta_keepalive()
10134 arp->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_sta_keepalive()
10136 FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE); in ath11k_wmi_sta_keepalive()
10138 if (arg->method == WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE || in ath11k_wmi_sta_keepalive()
10139 arg->method == WMI_STA_KEEPALIVE_METHOD_GRATUITOUS_ARP_REQUEST) { in ath11k_wmi_sta_keepalive()
10140 arp->src_ip4_addr = arg->src_ip4_addr; in ath11k_wmi_sta_keepalive()
10141 arp->dest_ip4_addr = arg->dest_ip4_addr; in ath11k_wmi_sta_keepalive()
10142 ether_addr_copy(arp->dest_mac_addr.addr, arg->dest_mac_addr); in ath11k_wmi_sta_keepalive()
10145 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_sta_keepalive()
10147 arg->vdev_id, arg->enabled, arg->method, arg->interval); in ath11k_wmi_sta_keepalive()