Lines Matching +full:rx +full:- +full:sched +full:- +full:sp

1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
192 ptr - begin, len, sizeof(*tlv)); in ath11k_wmi_tlv_iter()
193 return -EINVAL; in ath11k_wmi_tlv_iter()
197 tlv_tag = FIELD_GET(WMI_TLV_TAG, tlv->header); in ath11k_wmi_tlv_iter()
198 tlv_len = FIELD_GET(WMI_TLV_LEN, tlv->header); in ath11k_wmi_tlv_iter()
200 len -= sizeof(*tlv); in ath11k_wmi_tlv_iter()
204 tlv_tag, ptr - begin, len, tlv_len); in ath11k_wmi_tlv_iter()
205 return -EINVAL; in ath11k_wmi_tlv_iter()
212 tlv_tag, ptr - begin, tlv_len, in ath11k_wmi_tlv_iter()
214 return -EINVAL; in ath11k_wmi_tlv_iter()
222 len -= tlv_len; in ath11k_wmi_tlv_iter()
254 return ERR_PTR(-ENOMEM); in ath11k_wmi_tlv_parse_alloc()
256 ret = ath11k_wmi_tlv_parse(ab, tb, skb->data, skb->len); in ath11k_wmi_tlv_parse_alloc()
269 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_cmd_send_nowait()
275 return -ENOMEM; in ath11k_wmi_cmd_send_nowait()
279 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath11k_wmi_cmd_send_nowait()
280 cmd_hdr->cmd_id = cmd; in ath11k_wmi_cmd_send_nowait()
282 trace_ath11k_wmi_cmd(ab, cmd_id, skb->data, skb->len); in ath11k_wmi_cmd_send_nowait()
285 ret = ath11k_htc_send(&ab->htc, wmi->eid, skb); in ath11k_wmi_cmd_send_nowait()
300 struct ath11k_wmi_base *wmi_ab = wmi->wmi_ab; in ath11k_wmi_cmd_send()
301 int ret = -EOPNOTSUPP; in ath11k_wmi_cmd_send()
302 struct ath11k_base *ab = wmi_ab->ab; in ath11k_wmi_cmd_send()
306 if (ab->hw_params.credit_flow) { in ath11k_wmi_cmd_send()
307 wait_event_timeout(wmi_ab->tx_credits_wq, ({ in ath11k_wmi_cmd_send()
311 &wmi_ab->ab->dev_flags)) in ath11k_wmi_cmd_send()
312 ret = -ESHUTDOWN; in ath11k_wmi_cmd_send()
314 (ret != -EAGAIN); in ath11k_wmi_cmd_send()
317 wait_event_timeout(wmi->tx_ce_desc_wq, ({ in ath11k_wmi_cmd_send()
321 &wmi_ab->ab->dev_flags)) in ath11k_wmi_cmd_send()
322 ret = -ESHUTDOWN; in ath11k_wmi_cmd_send()
324 (ret != -ENOBUFS); in ath11k_wmi_cmd_send()
328 if (ret == -EAGAIN) in ath11k_wmi_cmd_send()
329 ath11k_warn(wmi_ab->ab, "wmi command %d timeout\n", cmd_id); in ath11k_wmi_cmd_send()
331 if (ret == -ENOBUFS) in ath11k_wmi_cmd_send()
332 ath11k_warn(wmi_ab->ab, "ce desc not available for wmi command %d\n", in ath11k_wmi_cmd_send()
345 return -EINVAL; in ath11k_pull_svc_ready_ext()
348 param->default_conc_scan_config_bits = ev->default_conc_scan_config_bits; in ath11k_pull_svc_ready_ext()
349 param->default_fw_config_bits = ev->default_fw_config_bits; in ath11k_pull_svc_ready_ext()
350 param->he_cap_info = ev->he_cap_info; in ath11k_pull_svc_ready_ext()
351 param->mpdu_density = ev->mpdu_density; in ath11k_pull_svc_ready_ext()
352 param->max_bssid_rx_filters = ev->max_bssid_rx_filters; in ath11k_pull_svc_ready_ext()
353 memcpy(&param->ppet, &ev->ppet, sizeof(param->ppet)); in ath11k_pull_svc_ready_ext()
368 struct ath11k_base *ab = wmi_handle->wmi_ab->ab; in ath11k_pull_mac_phy_cap_svc_ready_ext()
370 struct ath11k_pdev_cap *pdev_cap = &pdev->cap; in ath11k_pull_mac_phy_cap_svc_ready_ext()
375 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
377 for (hw_idx = 0; hw_idx < hw_caps->num_hw_modes; hw_idx++) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
388 if (hw_idx == hw_caps->num_hw_modes) in ath11k_pull_mac_phy_cap_svc_ready_ext()
389 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
392 if (phy_id >= hal_reg_caps->num_phy) in ath11k_pull_mac_phy_cap_svc_ready_ext()
393 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
397 pdev->pdev_id = mac_phy_caps->pdev_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
398 pdev_cap->supported_bands |= mac_phy_caps->supported_bands; in ath11k_pull_mac_phy_cap_svc_ready_ext()
399 pdev_cap->ampdu_density = mac_phy_caps->ampdu_density; in ath11k_pull_mac_phy_cap_svc_ready_ext()
400 ab->target_pdev_ids[ab->target_pdev_count].supported_bands = in ath11k_pull_mac_phy_cap_svc_ready_ext()
401 mac_phy_caps->supported_bands; in ath11k_pull_mac_phy_cap_svc_ready_ext()
402 ab->target_pdev_ids[ab->target_pdev_count].pdev_id = mac_phy_caps->pdev_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
403 ab->target_pdev_count++; in ath11k_pull_mac_phy_cap_svc_ready_ext()
405 if (!(mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) && in ath11k_pull_mac_phy_cap_svc_ready_ext()
406 !(mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP)) in ath11k_pull_mac_phy_cap_svc_ready_ext()
407 return -EINVAL; in ath11k_pull_mac_phy_cap_svc_ready_ext()
409 /* Take non-zero tx/rx chainmask. If tx/rx chainmask differs from in ath11k_pull_mac_phy_cap_svc_ready_ext()
413 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
414 pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
415 pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
418 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
419 pdev_cap->vht_cap = mac_phy_caps->vht_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
420 pdev_cap->vht_mcs = mac_phy_caps->vht_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
421 pdev_cap->he_mcs = mac_phy_caps->he_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
422 pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
423 pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
424 pdev_cap->nss_ratio_enabled = in ath11k_pull_mac_phy_cap_svc_ready_ext()
425 WMI_NSS_RATIO_ENABLE_DISABLE_GET(mac_phy_caps->nss_ratio); in ath11k_pull_mac_phy_cap_svc_ready_ext()
426 pdev_cap->nss_ratio_info = in ath11k_pull_mac_phy_cap_svc_ready_ext()
427 WMI_NSS_RATIO_INFO_GET(mac_phy_caps->nss_ratio); in ath11k_pull_mac_phy_cap_svc_ready_ext()
430 /* tx/rx chainmask reported from fw depends on the actual hw chains used, in ath11k_pull_mac_phy_cap_svc_ready_ext()
432 * 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()
433 * In this case, tx/rx chainmask 0xf will be advertised for first mac and 0xf0 in ath11k_pull_mac_phy_cap_svc_ready_ext()
434 * will be advertised for second mac or vice-versa. Compute the shift value in ath11k_pull_mac_phy_cap_svc_ready_ext()
435 * for tx/rx chainmask which will be used to advertise supported ht/vht rates to in ath11k_pull_mac_phy_cap_svc_ready_ext()
438 pdev_cap->tx_chain_mask_shift = in ath11k_pull_mac_phy_cap_svc_ready_ext()
439 find_first_bit((unsigned long *)&pdev_cap->tx_chain_mask, 32); in ath11k_pull_mac_phy_cap_svc_ready_ext()
440 pdev_cap->rx_chain_mask_shift = in ath11k_pull_mac_phy_cap_svc_ready_ext()
441 find_first_bit((unsigned long *)&pdev_cap->rx_chain_mask, 32); in ath11k_pull_mac_phy_cap_svc_ready_ext()
443 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
444 cap_band = &pdev_cap->band[NL80211_BAND_2GHZ]; in ath11k_pull_mac_phy_cap_svc_ready_ext()
445 cap_band->phy_id = mac_phy_caps->phy_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
446 cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
447 cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
448 cap_band->he_cap_info[0] = mac_phy_caps->he_cap_info_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
449 cap_band->he_cap_info[1] = mac_phy_caps->he_cap_info_2g_ext; in ath11k_pull_mac_phy_cap_svc_ready_ext()
450 cap_band->he_mcs = mac_phy_caps->he_supp_mcs_2g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
451 memcpy(cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_2g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
453 memcpy(&cap_band->he_ppet, &mac_phy_caps->he_ppet2g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
457 if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP) { in ath11k_pull_mac_phy_cap_svc_ready_ext()
458 cap_band = &pdev_cap->band[NL80211_BAND_5GHZ]; in ath11k_pull_mac_phy_cap_svc_ready_ext()
459 cap_band->phy_id = mac_phy_caps->phy_id; in ath11k_pull_mac_phy_cap_svc_ready_ext()
460 cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
461 cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
462 cap_band->he_cap_info[0] = mac_phy_caps->he_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
463 cap_band->he_cap_info[1] = mac_phy_caps->he_cap_info_5g_ext; in ath11k_pull_mac_phy_cap_svc_ready_ext()
464 cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
465 memcpy(cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
467 memcpy(&cap_band->he_ppet, &mac_phy_caps->he_ppet5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
470 cap_band = &pdev_cap->band[NL80211_BAND_6GHZ]; in ath11k_pull_mac_phy_cap_svc_ready_ext()
471 cap_band->max_bw_supported = mac_phy_caps->max_bw_supported_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
472 cap_band->ht_cap_info = mac_phy_caps->ht_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
473 cap_band->he_cap_info[0] = mac_phy_caps->he_cap_info_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
474 cap_band->he_cap_info[1] = mac_phy_caps->he_cap_info_5g_ext; in ath11k_pull_mac_phy_cap_svc_ready_ext()
475 cap_band->he_mcs = mac_phy_caps->he_supp_mcs_5g; in ath11k_pull_mac_phy_cap_svc_ready_ext()
476 memcpy(cap_band->he_cap_phy_info, &mac_phy_caps->he_cap_phy_info_5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
478 memcpy(&cap_band->he_ppet, &mac_phy_caps->he_ppet5g, in ath11k_pull_mac_phy_cap_svc_ready_ext()
495 return -EINVAL; in ath11k_pull_reg_cap_svc_rdy_ext()
497 if (phy_idx >= reg_caps->num_phy) in ath11k_pull_reg_cap_svc_rdy_ext()
498 return -EINVAL; in ath11k_pull_reg_cap_svc_rdy_ext()
502 param->phy_id = ext_reg_cap->phy_id; in ath11k_pull_reg_cap_svc_rdy_ext()
503 param->eeprom_reg_domain = ext_reg_cap->eeprom_reg_domain; in ath11k_pull_reg_cap_svc_rdy_ext()
504 param->eeprom_reg_domain_ext = in ath11k_pull_reg_cap_svc_rdy_ext()
505 ext_reg_cap->eeprom_reg_domain_ext; in ath11k_pull_reg_cap_svc_rdy_ext()
506 param->regcap1 = ext_reg_cap->regcap1; in ath11k_pull_reg_cap_svc_rdy_ext()
507 param->regcap2 = ext_reg_cap->regcap2; in ath11k_pull_reg_cap_svc_rdy_ext()
508 /* check if param->wireless_mode is needed */ in ath11k_pull_reg_cap_svc_rdy_ext()
509 param->low_2ghz_chan = ext_reg_cap->low_2ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
510 param->high_2ghz_chan = ext_reg_cap->high_2ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
511 param->low_5ghz_chan = ext_reg_cap->low_5ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
512 param->high_5ghz_chan = ext_reg_cap->high_5ghz_chan; in ath11k_pull_reg_cap_svc_rdy_ext()
526 return -EINVAL; in ath11k_pull_service_ready_tlv()
529 cap->phy_capability = ev->phy_capability; in ath11k_pull_service_ready_tlv()
530 cap->max_frag_entry = ev->max_frag_entry; in ath11k_pull_service_ready_tlv()
531 cap->num_rf_chains = ev->num_rf_chains; in ath11k_pull_service_ready_tlv()
532 cap->ht_cap_info = ev->ht_cap_info; in ath11k_pull_service_ready_tlv()
533 cap->vht_cap_info = ev->vht_cap_info; in ath11k_pull_service_ready_tlv()
534 cap->vht_supp_mcs = ev->vht_supp_mcs; in ath11k_pull_service_ready_tlv()
535 cap->hw_min_tx_power = ev->hw_min_tx_power; in ath11k_pull_service_ready_tlv()
536 cap->hw_max_tx_power = ev->hw_max_tx_power; in ath11k_pull_service_ready_tlv()
537 cap->sys_cap_info = ev->sys_cap_info; in ath11k_pull_service_ready_tlv()
538 cap->min_pkt_size_enable = ev->min_pkt_size_enable; in ath11k_pull_service_ready_tlv()
539 cap->max_bcn_ie_size = ev->max_bcn_ie_size; in ath11k_pull_service_ready_tlv()
540 cap->max_num_scan_channels = ev->max_num_scan_channels; in ath11k_pull_service_ready_tlv()
541 cap->max_supported_macs = ev->max_supported_macs; in ath11k_pull_service_ready_tlv()
542 cap->wmi_fw_sub_feat_caps = ev->wmi_fw_sub_feat_caps; in ath11k_pull_service_ready_tlv()
543 cap->txrx_chainmask = ev->txrx_chainmask; in ath11k_pull_service_ready_tlv()
544 cap->default_dbs_hw_mode_index = ev->default_dbs_hw_mode_index; in ath11k_pull_service_ready_tlv()
545 cap->num_msdu_desc = ev->num_msdu_desc; in ath11k_pull_service_ready_tlv()
551 * wmi_service ready event are advertised in b0-b3 (LSB 4-bits) of each
552 * 4-byte word.
562 set_bit(j, wmi->wmi_ab->svc_map); in ath11k_wmi_service_bitmap_copy()
571 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_parse()
576 if (ath11k_pull_service_ready_tlv(ab, ptr, &ab->target_caps)) in ath11k_wmi_tlv_svc_rdy_parse()
577 return -EINVAL; in ath11k_wmi_tlv_svc_rdy_parse()
581 if (!svc_ready->wmi_svc_bitmap_done) { in ath11k_wmi_tlv_svc_rdy_parse()
586 return -EINVAL; in ath11k_wmi_tlv_svc_rdy_parse()
591 svc_ready->wmi_svc_bitmap_done = true; in ath11k_wmi_tlv_svc_rdy_parse()
606 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_event()
622 struct ath11k_base *ab = wmi_ab->ab; in ath11k_wmi_alloc_skb()
630 if (!IS_ALIGNED((unsigned long)skb->data, 4)) in ath11k_wmi_alloc_skb()
634 memset(skb->data, 0, round_len); in ath11k_wmi_alloc_skb()
642 struct ath11k_base *ab = ar->ab; in ath11k_wmi_mgmt_get_freq()
645 if (ab->hw_params.support_off_channel_tx && in ath11k_wmi_mgmt_get_freq()
646 ar->scan.is_roc && in ath11k_wmi_mgmt_get_freq()
647 (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)) in ath11k_wmi_mgmt_get_freq()
648 freq = ar->scan.roc_freq; in ath11k_wmi_mgmt_get_freq()
656 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_mgmt_send()
664 buf_len = frame->len < WMI_MGMT_SEND_DOWNLD_LEN ? in ath11k_wmi_mgmt_send()
665 frame->len : WMI_MGMT_SEND_DOWNLD_LEN; in ath11k_wmi_mgmt_send()
669 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_mgmt_send()
671 return -ENOMEM; in ath11k_wmi_mgmt_send()
673 cmd = (struct wmi_mgmt_send_cmd *)skb->data; in ath11k_wmi_mgmt_send()
674 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_MGMT_TX_SEND_CMD) | in ath11k_wmi_mgmt_send()
675 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_mgmt_send()
676 cmd->vdev_id = vdev_id; in ath11k_wmi_mgmt_send()
677 cmd->desc_id = buf_id; in ath11k_wmi_mgmt_send()
678 cmd->chanfreq = ath11k_wmi_mgmt_get_freq(ar, info); in ath11k_wmi_mgmt_send()
679 cmd->paddr_lo = lower_32_bits(ATH11K_SKB_CB(frame)->paddr); in ath11k_wmi_mgmt_send()
680 cmd->paddr_hi = upper_32_bits(ATH11K_SKB_CB(frame)->paddr); in ath11k_wmi_mgmt_send()
681 cmd->frame_len = frame->len; in ath11k_wmi_mgmt_send()
682 cmd->buf_len = buf_len; in ath11k_wmi_mgmt_send()
683 cmd->tx_params_valid = 0; in ath11k_wmi_mgmt_send()
685 frame_tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_mgmt_send()
686 frame_tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_mgmt_send()
689 memcpy(frame_tlv->value, frame->data, buf_len); in ath11k_wmi_mgmt_send()
691 ath11k_ce_byte_swap(frame_tlv->value, buf_len); in ath11k_wmi_mgmt_send()
695 ath11k_warn(ar->ab, in ath11k_wmi_mgmt_send()
700 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd mgmt tx send"); in ath11k_wmi_mgmt_send()
708 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_create()
716 /* It can be optimized my sending tx/rx chain configuration in ath11k_wmi_vdev_create()
723 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_vdev_create()
725 return -ENOMEM; in ath11k_wmi_vdev_create()
727 cmd = (struct wmi_vdev_create_cmd *)skb->data; in ath11k_wmi_vdev_create()
728 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_CREATE_CMD) | in ath11k_wmi_vdev_create()
729 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_create()
731 cmd->vdev_id = param->if_id; in ath11k_wmi_vdev_create()
732 cmd->vdev_type = param->type; in ath11k_wmi_vdev_create()
733 cmd->vdev_subtype = param->subtype; in ath11k_wmi_vdev_create()
734 cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX; in ath11k_wmi_vdev_create()
735 cmd->pdev_id = param->pdev_id; in ath11k_wmi_vdev_create()
736 cmd->mbssid_flags = param->mbssid_flags; in ath11k_wmi_vdev_create()
737 cmd->mbssid_tx_vdev_id = param->mbssid_tx_vdev_id; in ath11k_wmi_vdev_create()
739 ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); in ath11k_wmi_vdev_create()
741 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_vdev_create()
745 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_vdev_create()
751 txrx_streams->tlv_header = in ath11k_wmi_vdev_create()
753 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_vdev_create()
754 txrx_streams->band = WMI_TPC_CHAINMASK_CONFIG_BAND_2G; in ath11k_wmi_vdev_create()
755 txrx_streams->supported_tx_streams = in ath11k_wmi_vdev_create()
756 param->chains[NL80211_BAND_2GHZ].tx; in ath11k_wmi_vdev_create()
757 txrx_streams->supported_rx_streams = in ath11k_wmi_vdev_create()
758 param->chains[NL80211_BAND_2GHZ].rx; in ath11k_wmi_vdev_create()
761 txrx_streams->tlv_header = in ath11k_wmi_vdev_create()
763 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_vdev_create()
764 txrx_streams->band = WMI_TPC_CHAINMASK_CONFIG_BAND_5G; in ath11k_wmi_vdev_create()
765 txrx_streams->supported_tx_streams = in ath11k_wmi_vdev_create()
766 param->chains[NL80211_BAND_5GHZ].tx; in ath11k_wmi_vdev_create()
767 txrx_streams->supported_rx_streams = in ath11k_wmi_vdev_create()
768 param->chains[NL80211_BAND_5GHZ].rx; in ath11k_wmi_vdev_create()
772 ath11k_warn(ar->ab, in ath11k_wmi_vdev_create()
777 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_create()
779 param->if_id, param->type, param->subtype, in ath11k_wmi_vdev_create()
780 macaddr, param->pdev_id); in ath11k_wmi_vdev_create()
787 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_delete()
792 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_delete()
794 return -ENOMEM; in ath11k_wmi_vdev_delete()
796 cmd = (struct wmi_vdev_delete_cmd *)skb->data; in ath11k_wmi_vdev_delete()
797 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_DELETE_CMD) | in ath11k_wmi_vdev_delete()
798 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_delete()
799 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_delete()
803 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_DELETE_CMDID\n"); in ath11k_wmi_vdev_delete()
807 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev delete id %d\n", vdev_id); in ath11k_wmi_vdev_delete()
814 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_stop()
819 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_stop()
821 return -ENOMEM; in ath11k_wmi_vdev_stop()
823 cmd = (struct wmi_vdev_stop_cmd *)skb->data; in ath11k_wmi_vdev_stop()
825 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_STOP_CMD) | in ath11k_wmi_vdev_stop()
826 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_stop()
827 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_stop()
831 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_STOP cmd\n"); in ath11k_wmi_vdev_stop()
835 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev stop id 0x%x\n", vdev_id); in ath11k_wmi_vdev_stop()
842 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_down()
847 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_down()
849 return -ENOMEM; in ath11k_wmi_vdev_down()
851 cmd = (struct wmi_vdev_down_cmd *)skb->data; in ath11k_wmi_vdev_down()
853 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_DOWN_CMD) | in ath11k_wmi_vdev_down()
854 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_down()
855 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_down()
859 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_DOWN cmd\n"); in ath11k_wmi_vdev_down()
863 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev down id 0x%x\n", vdev_id); in ath11k_wmi_vdev_down()
871 u32 center_freq1 = arg->channel.band_center_freq1; in ath11k_wmi_put_wmi_channel()
875 chan->mhz = arg->channel.freq; in ath11k_wmi_put_wmi_channel()
876 chan->band_center_freq1 = arg->channel.band_center_freq1; in ath11k_wmi_put_wmi_channel()
878 if (arg->channel.mode == MODE_11AX_HE160) { in ath11k_wmi_put_wmi_channel()
879 if (arg->channel.freq > arg->channel.band_center_freq1) in ath11k_wmi_put_wmi_channel()
880 chan->band_center_freq1 = center_freq1 + 40; in ath11k_wmi_put_wmi_channel()
882 chan->band_center_freq1 = center_freq1 - 40; in ath11k_wmi_put_wmi_channel()
884 chan->band_center_freq2 = arg->channel.band_center_freq1; in ath11k_wmi_put_wmi_channel()
886 } else if ((arg->channel.mode == MODE_11AC_VHT80_80) || in ath11k_wmi_put_wmi_channel()
887 (arg->channel.mode == MODE_11AX_HE80_80)) { in ath11k_wmi_put_wmi_channel()
888 chan->band_center_freq2 = arg->channel.band_center_freq2; in ath11k_wmi_put_wmi_channel()
890 chan->band_center_freq2 = 0; in ath11k_wmi_put_wmi_channel()
893 chan->info |= FIELD_PREP(WMI_CHAN_INFO_MODE, arg->channel.mode); in ath11k_wmi_put_wmi_channel()
894 if (arg->channel.passive) in ath11k_wmi_put_wmi_channel()
895 chan->info |= WMI_CHAN_INFO_PASSIVE; in ath11k_wmi_put_wmi_channel()
896 if (arg->channel.allow_ibss) in ath11k_wmi_put_wmi_channel()
897 chan->info |= WMI_CHAN_INFO_ADHOC_ALLOWED; in ath11k_wmi_put_wmi_channel()
898 if (arg->channel.allow_ht) in ath11k_wmi_put_wmi_channel()
899 chan->info |= WMI_CHAN_INFO_ALLOW_HT; in ath11k_wmi_put_wmi_channel()
900 if (arg->channel.allow_vht) in ath11k_wmi_put_wmi_channel()
901 chan->info |= WMI_CHAN_INFO_ALLOW_VHT; in ath11k_wmi_put_wmi_channel()
902 if (arg->channel.allow_he) in ath11k_wmi_put_wmi_channel()
903 chan->info |= WMI_CHAN_INFO_ALLOW_HE; in ath11k_wmi_put_wmi_channel()
904 if (arg->channel.ht40plus) in ath11k_wmi_put_wmi_channel()
905 chan->info |= WMI_CHAN_INFO_HT40_PLUS; in ath11k_wmi_put_wmi_channel()
906 if (arg->channel.chan_radar) in ath11k_wmi_put_wmi_channel()
907 chan->info |= WMI_CHAN_INFO_DFS; in ath11k_wmi_put_wmi_channel()
908 if (arg->channel.freq2_radar) in ath11k_wmi_put_wmi_channel()
909 chan->info |= WMI_CHAN_INFO_DFS_FREQ2; in ath11k_wmi_put_wmi_channel()
911 chan->reg_info_1 = FIELD_PREP(WMI_CHAN_REG_INFO1_MAX_PWR, in ath11k_wmi_put_wmi_channel()
912 arg->channel.max_power) | in ath11k_wmi_put_wmi_channel()
914 arg->channel.max_reg_power); in ath11k_wmi_put_wmi_channel()
916 chan->reg_info_2 = FIELD_PREP(WMI_CHAN_REG_INFO2_ANT_MAX, in ath11k_wmi_put_wmi_channel()
917 arg->channel.max_antenna_gain) | in ath11k_wmi_put_wmi_channel()
919 arg->channel.max_power); in ath11k_wmi_put_wmi_channel()
925 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_start()
933 if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid))) in ath11k_wmi_vdev_start()
934 return -EINVAL; in ath11k_wmi_vdev_start()
938 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_vdev_start()
940 return -ENOMEM; in ath11k_wmi_vdev_start()
942 cmd = (struct wmi_vdev_start_request_cmd *)skb->data; in ath11k_wmi_vdev_start()
943 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_start()
945 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_start()
946 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_vdev_start()
947 cmd->beacon_interval = arg->bcn_intval; in ath11k_wmi_vdev_start()
948 cmd->bcn_tx_rate = arg->bcn_tx_rate; in ath11k_wmi_vdev_start()
949 cmd->dtim_period = arg->dtim_period; in ath11k_wmi_vdev_start()
950 cmd->num_noa_descriptors = arg->num_noa_descriptors; in ath11k_wmi_vdev_start()
951 cmd->preferred_rx_streams = arg->pref_rx_streams; in ath11k_wmi_vdev_start()
952 cmd->preferred_tx_streams = arg->pref_tx_streams; in ath11k_wmi_vdev_start()
953 cmd->cac_duration_ms = arg->cac_duration_ms; in ath11k_wmi_vdev_start()
954 cmd->regdomain = arg->regdomain; in ath11k_wmi_vdev_start()
955 cmd->he_ops = arg->he_ops; in ath11k_wmi_vdev_start()
956 cmd->mbssid_flags = arg->mbssid_flags; in ath11k_wmi_vdev_start()
957 cmd->mbssid_tx_vdev_id = arg->mbssid_tx_vdev_id; in ath11k_wmi_vdev_start()
960 if (arg->ssid) { in ath11k_wmi_vdev_start()
961 cmd->ssid.ssid_len = arg->ssid_len; in ath11k_wmi_vdev_start()
962 memcpy(cmd->ssid.ssid, arg->ssid, arg->ssid_len); in ath11k_wmi_vdev_start()
964 if (arg->hidden_ssid) in ath11k_wmi_vdev_start()
965 cmd->flags |= WMI_VDEV_START_HIDDEN_SSID; in ath11k_wmi_vdev_start()
966 if (arg->pmf_enabled) in ath11k_wmi_vdev_start()
967 cmd->flags |= WMI_VDEV_START_PMF_ENABLED; in ath11k_wmi_vdev_start()
970 cmd->flags |= WMI_VDEV_START_LDPC_RX_ENABLED; in ath11k_wmi_vdev_start()
971 if (test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) in ath11k_wmi_vdev_start()
972 cmd->flags |= WMI_VDEV_START_HW_ENCRYPTION_DISABLED; in ath11k_wmi_vdev_start()
974 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_vdev_start()
979 chan->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_CHANNEL) | in ath11k_wmi_vdev_start()
981 sizeof(*chan) - TLV_HDR_SIZE); in ath11k_wmi_vdev_start()
985 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_vdev_start()
1001 ath11k_warn(ar->ab, "failed to submit vdev_%s cmd\n", in ath11k_wmi_vdev_start()
1006 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()
1007 restart ? "restart" : "start", arg->vdev_id, in ath11k_wmi_vdev_start()
1008 arg->channel.freq, arg->channel.mode); in ath11k_wmi_vdev_start()
1016 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_up()
1025 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_up()
1027 return -ENOMEM; in ath11k_wmi_vdev_up()
1029 cmd = (struct wmi_vdev_up_cmd *)skb->data; in ath11k_wmi_vdev_up()
1031 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_UP_CMD) | in ath11k_wmi_vdev_up()
1032 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_up()
1033 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_up()
1034 cmd->vdev_assoc_id = aid; in ath11k_wmi_vdev_up()
1036 ether_addr_copy(cmd->vdev_bssid.addr, bssid); in ath11k_wmi_vdev_up()
1038 cmd->nontx_profile_idx = nontx_profile_idx; in ath11k_wmi_vdev_up()
1039 cmd->nontx_profile_cnt = nontx_profile_cnt; in ath11k_wmi_vdev_up()
1041 ether_addr_copy(cmd->tx_vdev_bssid.addr, tx_bssid); in ath11k_wmi_vdev_up()
1043 if (arvif && arvif->vif->type == NL80211_IFTYPE_STATION) { in ath11k_wmi_vdev_up()
1044 bss_conf = &arvif->vif->bss_conf; in ath11k_wmi_vdev_up()
1046 if (bss_conf->nontransmitted) { in ath11k_wmi_vdev_up()
1047 ether_addr_copy(cmd->tx_vdev_bssid.addr, in ath11k_wmi_vdev_up()
1048 bss_conf->transmitter_bssid); in ath11k_wmi_vdev_up()
1049 cmd->nontx_profile_idx = bss_conf->bssid_index; in ath11k_wmi_vdev_up()
1050 cmd->nontx_profile_cnt = bss_conf->bssid_indicator; in ath11k_wmi_vdev_up()
1056 ath11k_warn(ar->ab, "failed to submit WMI_VDEV_UP cmd\n"); in ath11k_wmi_vdev_up()
1060 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_up()
1070 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_create_cmd()
1075 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_peer_create_cmd()
1077 return -ENOMEM; in ath11k_wmi_send_peer_create_cmd()
1079 cmd = (struct wmi_peer_create_cmd *)skb->data; in ath11k_wmi_send_peer_create_cmd()
1080 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_CREATE_CMD) | in ath11k_wmi_send_peer_create_cmd()
1081 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_create_cmd()
1083 ether_addr_copy(cmd->peer_macaddr.addr, param->peer_addr); in ath11k_wmi_send_peer_create_cmd()
1084 cmd->peer_type = param->peer_type; in ath11k_wmi_send_peer_create_cmd()
1085 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_peer_create_cmd()
1089 ath11k_warn(ar->ab, "failed to submit WMI_PEER_CREATE cmd\n"); in ath11k_wmi_send_peer_create_cmd()
1093 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_create_cmd()
1095 param->vdev_id, param->peer_addr); in ath11k_wmi_send_peer_create_cmd()
1103 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_delete_cmd()
1108 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_peer_delete_cmd()
1110 return -ENOMEM; in ath11k_wmi_send_peer_delete_cmd()
1112 cmd = (struct wmi_peer_delete_cmd *)skb->data; in ath11k_wmi_send_peer_delete_cmd()
1113 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_DELETE_CMD) | in ath11k_wmi_send_peer_delete_cmd()
1114 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_delete_cmd()
1116 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_send_peer_delete_cmd()
1117 cmd->vdev_id = vdev_id; in ath11k_wmi_send_peer_delete_cmd()
1121 ath11k_warn(ar->ab, "failed to send WMI_PEER_DELETE cmd\n"); in ath11k_wmi_send_peer_delete_cmd()
1125 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_delete_cmd()
1135 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_pdev_set_regdomain()
1140 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_pdev_set_regdomain()
1142 return -ENOMEM; in ath11k_wmi_send_pdev_set_regdomain()
1144 cmd = (struct wmi_pdev_set_regdomain_cmd *)skb->data; in ath11k_wmi_send_pdev_set_regdomain()
1145 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_pdev_set_regdomain()
1147 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_pdev_set_regdomain()
1149 cmd->reg_domain = param->current_rd_in_use; in ath11k_wmi_send_pdev_set_regdomain()
1150 cmd->reg_domain_2g = param->current_rd_2g; in ath11k_wmi_send_pdev_set_regdomain()
1151 cmd->reg_domain_5g = param->current_rd_5g; in ath11k_wmi_send_pdev_set_regdomain()
1152 cmd->conformance_test_limit_2g = param->ctl_2g; in ath11k_wmi_send_pdev_set_regdomain()
1153 cmd->conformance_test_limit_5g = param->ctl_5g; in ath11k_wmi_send_pdev_set_regdomain()
1154 cmd->dfs_domain = param->dfs_domain; in ath11k_wmi_send_pdev_set_regdomain()
1155 cmd->pdev_id = param->pdev_id; in ath11k_wmi_send_pdev_set_regdomain()
1159 ath11k_warn(ar->ab, in ath11k_wmi_send_pdev_set_regdomain()
1164 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_pdev_set_regdomain()
1166 param->current_rd_in_use, param->current_rd_2g, in ath11k_wmi_send_pdev_set_regdomain()
1167 param->current_rd_5g, param->dfs_domain, param->pdev_id); in ath11k_wmi_send_pdev_set_regdomain()
1175 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_set_peer_param()
1180 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_set_peer_param()
1182 return -ENOMEM; in ath11k_wmi_set_peer_param()
1184 cmd = (struct wmi_peer_set_param_cmd *)skb->data; in ath11k_wmi_set_peer_param()
1185 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_SET_PARAM_CMD) | in ath11k_wmi_set_peer_param()
1186 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_peer_param()
1187 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_set_peer_param()
1188 cmd->vdev_id = vdev_id; in ath11k_wmi_set_peer_param()
1189 cmd->param_id = param_id; in ath11k_wmi_set_peer_param()
1190 cmd->param_value = param_val; in ath11k_wmi_set_peer_param()
1194 ath11k_warn(ar->ab, "failed to send WMI_PEER_SET_PARAM cmd\n"); in ath11k_wmi_set_peer_param()
1198 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_set_peer_param()
1209 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_flush_tids_cmd()
1214 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_peer_flush_tids_cmd()
1216 return -ENOMEM; in ath11k_wmi_send_peer_flush_tids_cmd()
1218 cmd = (struct wmi_peer_flush_tids_cmd *)skb->data; in ath11k_wmi_send_peer_flush_tids_cmd()
1219 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PEER_FLUSH_TIDS_CMD) | in ath11k_wmi_send_peer_flush_tids_cmd()
1220 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_flush_tids_cmd()
1222 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_send_peer_flush_tids_cmd()
1223 cmd->peer_tid_bitmap = param->peer_tid_bitmap; in ath11k_wmi_send_peer_flush_tids_cmd()
1224 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_peer_flush_tids_cmd()
1228 ath11k_warn(ar->ab, in ath11k_wmi_send_peer_flush_tids_cmd()
1233 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_flush_tids_cmd()
1235 param->vdev_id, peer_addr, param->peer_tid_bitmap); in ath11k_wmi_send_peer_flush_tids_cmd()
1250 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_peer_rx_reorder_queue_setup()
1252 return -ENOMEM; in ath11k_wmi_peer_rx_reorder_queue_setup()
1254 cmd = (struct wmi_peer_reorder_queue_setup_cmd *)skb->data; in ath11k_wmi_peer_rx_reorder_queue_setup()
1255 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_peer_rx_reorder_queue_setup()
1257 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_peer_rx_reorder_queue_setup()
1259 ether_addr_copy(cmd->peer_macaddr.addr, addr); in ath11k_wmi_peer_rx_reorder_queue_setup()
1260 cmd->vdev_id = vdev_id; in ath11k_wmi_peer_rx_reorder_queue_setup()
1261 cmd->tid = tid; in ath11k_wmi_peer_rx_reorder_queue_setup()
1262 cmd->queue_ptr_lo = lower_32_bits(paddr); in ath11k_wmi_peer_rx_reorder_queue_setup()
1263 cmd->queue_ptr_hi = upper_32_bits(paddr); in ath11k_wmi_peer_rx_reorder_queue_setup()
1264 cmd->queue_no = tid; in ath11k_wmi_peer_rx_reorder_queue_setup()
1265 cmd->ba_window_size_valid = ba_window_size_valid; in ath11k_wmi_peer_rx_reorder_queue_setup()
1266 cmd->ba_window_size = ba_window_size; in ath11k_wmi_peer_rx_reorder_queue_setup()
1268 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_peer_rx_reorder_queue_setup()
1271 ath11k_warn(ar->ab, in ath11k_wmi_peer_rx_reorder_queue_setup()
1276 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_peer_rx_reorder_queue_setup()
1287 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_rx_reord_queue_remove()
1292 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_rx_reord_queue_remove()
1294 return -ENOMEM; in ath11k_wmi_rx_reord_queue_remove()
1296 cmd = (struct wmi_peer_reorder_queue_remove_cmd *)skb->data; in ath11k_wmi_rx_reord_queue_remove()
1297 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_rx_reord_queue_remove()
1299 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_rx_reord_queue_remove()
1301 ether_addr_copy(cmd->peer_macaddr.addr, param->peer_macaddr); in ath11k_wmi_rx_reord_queue_remove()
1302 cmd->vdev_id = param->vdev_id; in ath11k_wmi_rx_reord_queue_remove()
1303 cmd->tid_mask = param->peer_tid_bitmap; in ath11k_wmi_rx_reord_queue_remove()
1308 ath11k_warn(ar->ab, in ath11k_wmi_rx_reord_queue_remove()
1313 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_rx_reord_queue_remove()
1315 param->peer_macaddr, param->vdev_id, param->peer_tid_bitmap); in ath11k_wmi_rx_reord_queue_remove()
1323 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_param()
1328 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_set_param()
1330 return -ENOMEM; in ath11k_wmi_pdev_set_param()
1332 cmd = (struct wmi_pdev_set_param_cmd *)skb->data; in ath11k_wmi_pdev_set_param()
1333 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_PARAM_CMD) | in ath11k_wmi_pdev_set_param()
1334 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_param()
1335 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_set_param()
1336 cmd->param_id = param_id; in ath11k_wmi_pdev_set_param()
1337 cmd->param_value = param_value; in ath11k_wmi_pdev_set_param()
1341 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath11k_wmi_pdev_set_param()
1345 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_param()
1355 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_ps_mode()
1360 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_set_ps_mode()
1362 return -ENOMEM; in ath11k_wmi_pdev_set_ps_mode()
1364 cmd = (struct wmi_pdev_set_ps_mode_cmd *)skb->data; in ath11k_wmi_pdev_set_ps_mode()
1365 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_STA_POWERSAVE_MODE_CMD) | in ath11k_wmi_pdev_set_ps_mode()
1366 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_ps_mode()
1367 cmd->vdev_id = vdev_id; in ath11k_wmi_pdev_set_ps_mode()
1368 cmd->sta_ps_mode = psmode; in ath11k_wmi_pdev_set_ps_mode()
1372 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SET_PARAM cmd\n"); in ath11k_wmi_pdev_set_ps_mode()
1376 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_ps_mode()
1386 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_suspend()
1391 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_suspend()
1393 return -ENOMEM; in ath11k_wmi_pdev_suspend()
1395 cmd = (struct wmi_pdev_suspend_cmd *)skb->data; in ath11k_wmi_pdev_suspend()
1397 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SUSPEND_CMD) | in ath11k_wmi_pdev_suspend()
1398 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_suspend()
1400 cmd->suspend_opt = suspend_opt; in ath11k_wmi_pdev_suspend()
1401 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_suspend()
1405 ath11k_warn(ar->ab, "failed to send WMI_PDEV_SUSPEND cmd\n"); in ath11k_wmi_pdev_suspend()
1409 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_suspend()
1417 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_resume()
1422 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_resume()
1424 return -ENOMEM; in ath11k_wmi_pdev_resume()
1426 cmd = (struct wmi_pdev_resume_cmd *)skb->data; in ath11k_wmi_pdev_resume()
1428 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_RESUME_CMD) | in ath11k_wmi_pdev_resume()
1429 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_resume()
1430 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_resume()
1434 ath11k_warn(ar->ab, "failed to send WMI_PDEV_RESUME cmd\n"); in ath11k_wmi_pdev_resume()
1438 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_resume()
1451 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_bss_chan_info_request()
1456 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_bss_chan_info_request()
1458 return -ENOMEM; in ath11k_wmi_pdev_bss_chan_info_request()
1460 cmd = (struct wmi_pdev_bss_chan_info_req_cmd *)skb->data; in ath11k_wmi_pdev_bss_chan_info_request()
1462 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_pdev_bss_chan_info_request()
1464 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_bss_chan_info_request()
1465 cmd->req_type = type; in ath11k_wmi_pdev_bss_chan_info_request()
1466 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_bss_chan_info_request()
1471 ath11k_warn(ar->ab, in ath11k_wmi_pdev_bss_chan_info_request()
1476 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_bss_chan_info_request()
1485 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_set_ap_ps_param_cmd()
1490 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_set_ap_ps_param_cmd()
1492 return -ENOMEM; in ath11k_wmi_send_set_ap_ps_param_cmd()
1494 cmd = (struct wmi_ap_ps_peer_cmd *)skb->data; in ath11k_wmi_send_set_ap_ps_param_cmd()
1495 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_AP_PS_PEER_CMD) | in ath11k_wmi_send_set_ap_ps_param_cmd()
1496 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_set_ap_ps_param_cmd()
1498 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_set_ap_ps_param_cmd()
1499 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr); in ath11k_wmi_send_set_ap_ps_param_cmd()
1500 cmd->param = param->param; in ath11k_wmi_send_set_ap_ps_param_cmd()
1501 cmd->value = param->value; in ath11k_wmi_send_set_ap_ps_param_cmd()
1505 ath11k_warn(ar->ab, in ath11k_wmi_send_set_ap_ps_param_cmd()
1510 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_set_ap_ps_param_cmd()
1512 param->vdev_id, peer_addr, param->param, param->value); in ath11k_wmi_send_set_ap_ps_param_cmd()
1520 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_set_sta_ps_param()
1525 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_set_sta_ps_param()
1527 return -ENOMEM; in ath11k_wmi_set_sta_ps_param()
1529 cmd = (struct wmi_sta_powersave_param_cmd *)skb->data; in ath11k_wmi_set_sta_ps_param()
1530 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_set_sta_ps_param()
1532 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_sta_ps_param()
1534 cmd->vdev_id = vdev_id; in ath11k_wmi_set_sta_ps_param()
1535 cmd->param = param; in ath11k_wmi_set_sta_ps_param()
1536 cmd->value = param_value; in ath11k_wmi_set_sta_ps_param()
1540 ath11k_warn(ar->ab, "failed to send WMI_STA_POWERSAVE_PARAM_CMDID"); in ath11k_wmi_set_sta_ps_param()
1544 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_set_sta_ps_param()
1553 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_force_fw_hang_cmd()
1560 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_force_fw_hang_cmd()
1562 return -ENOMEM; in ath11k_wmi_force_fw_hang_cmd()
1564 cmd = (struct wmi_force_fw_hang_cmd *)skb->data; in ath11k_wmi_force_fw_hang_cmd()
1565 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_FORCE_FW_HANG_CMD) | in ath11k_wmi_force_fw_hang_cmd()
1566 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_force_fw_hang_cmd()
1568 cmd->type = type; in ath11k_wmi_force_fw_hang_cmd()
1569 cmd->delay_time_ms = delay_time_ms; in ath11k_wmi_force_fw_hang_cmd()
1574 ath11k_warn(ar->ab, "Failed to send WMI_FORCE_FW_HANG_CMDID"); in ath11k_wmi_force_fw_hang_cmd()
1578 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd force fw hang"); in ath11k_wmi_force_fw_hang_cmd()
1586 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_set_param_cmd()
1591 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_set_param_cmd()
1593 return -ENOMEM; in ath11k_wmi_vdev_set_param_cmd()
1595 cmd = (struct wmi_vdev_set_param_cmd *)skb->data; in ath11k_wmi_vdev_set_param_cmd()
1596 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_SET_PARAM_CMD) | in ath11k_wmi_vdev_set_param_cmd()
1597 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_set_param_cmd()
1599 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_set_param_cmd()
1600 cmd->param_id = param_id; in ath11k_wmi_vdev_set_param_cmd()
1601 cmd->param_value = param_value; in ath11k_wmi_vdev_set_param_cmd()
1605 ath11k_warn(ar->ab, in ath11k_wmi_vdev_set_param_cmd()
1610 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_set_param_cmd()
1620 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_stats_request_cmd()
1625 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_stats_request_cmd()
1627 return -ENOMEM; in ath11k_wmi_send_stats_request_cmd()
1629 cmd = (struct wmi_request_stats_cmd *)skb->data; in ath11k_wmi_send_stats_request_cmd()
1630 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_REQUEST_STATS_CMD) | in ath11k_wmi_send_stats_request_cmd()
1631 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_stats_request_cmd()
1633 cmd->stats_id = param->stats_id; in ath11k_wmi_send_stats_request_cmd()
1634 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_stats_request_cmd()
1635 cmd->pdev_id = param->pdev_id; in ath11k_wmi_send_stats_request_cmd()
1639 ath11k_warn(ar->ab, "failed to send WMI_REQUEST_STATS cmd\n"); in ath11k_wmi_send_stats_request_cmd()
1643 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_stats_request_cmd()
1645 param->stats_id, param->vdev_id, param->pdev_id); in ath11k_wmi_send_stats_request_cmd()
1652 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_pdev_temperature_cmd()
1657 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_pdev_temperature_cmd()
1659 return -ENOMEM; in ath11k_wmi_send_pdev_temperature_cmd()
1661 cmd = (struct wmi_get_pdev_temperature_cmd *)skb->data; in ath11k_wmi_send_pdev_temperature_cmd()
1662 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_GET_TEMPERATURE_CMD) | in ath11k_wmi_send_pdev_temperature_cmd()
1663 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_pdev_temperature_cmd()
1664 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_pdev_temperature_cmd()
1668 ath11k_warn(ar->ab, "failed to send WMI_PDEV_GET_TEMPERATURE cmd\n"); in ath11k_wmi_send_pdev_temperature_cmd()
1672 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_pdev_temperature_cmd()
1673 "cmd pdev get temperature for pdev_id %d\n", ar->pdev->pdev_id); in ath11k_wmi_send_pdev_temperature_cmd()
1681 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_bcn_offload_control_cmd()
1686 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_bcn_offload_control_cmd()
1688 return -ENOMEM; in ath11k_wmi_send_bcn_offload_control_cmd()
1690 cmd = (struct wmi_bcn_offload_ctrl_cmd *)skb->data; in ath11k_wmi_send_bcn_offload_control_cmd()
1691 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_bcn_offload_control_cmd()
1693 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_bcn_offload_control_cmd()
1695 cmd->vdev_id = vdev_id; in ath11k_wmi_send_bcn_offload_control_cmd()
1696 cmd->bcn_ctrl_op = bcn_ctrl_op; in ath11k_wmi_send_bcn_offload_control_cmd()
1700 ath11k_warn(ar->ab, in ath11k_wmi_send_bcn_offload_control_cmd()
1705 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bcn_offload_control_cmd()
1715 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_p2p_go_bcn_ie()
1727 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_p2p_go_bcn_ie()
1729 return -ENOMEM; in ath11k_wmi_p2p_go_bcn_ie()
1731 cmd = (struct wmi_p2p_go_set_beacon_ie_cmd *)skb->data; in ath11k_wmi_p2p_go_bcn_ie()
1732 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_P2P_GO_SET_BEACON_IE) | in ath11k_wmi_p2p_go_bcn_ie()
1733 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_p2p_go_bcn_ie()
1734 cmd->vdev_id = vdev_id; in ath11k_wmi_p2p_go_bcn_ie()
1735 cmd->ie_buf_len = p2p_ie_len; in ath11k_wmi_p2p_go_bcn_ie()
1737 tlv = (struct wmi_tlv *)cmd->tlv; in ath11k_wmi_p2p_go_bcn_ie()
1738 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_p2p_go_bcn_ie()
1740 memcpy(tlv->value, p2p_ie, p2p_ie_len); in ath11k_wmi_p2p_go_bcn_ie()
1744 ath11k_warn(ar->ab, "failed to send WMI_P2P_GO_SET_BEACON_IE\n"); in ath11k_wmi_p2p_go_bcn_ie()
1755 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_bcn_tmpl()
1762 size_t aligned_len = roundup(bcn->len, 4); in ath11k_wmi_bcn_tmpl()
1767 ath11k_warn(ar->ab, "failed to find arvif with vdev id %d\n", vdev_id); in ath11k_wmi_bcn_tmpl()
1768 return -EINVAL; in ath11k_wmi_bcn_tmpl()
1771 vif = arvif->vif; in ath11k_wmi_bcn_tmpl()
1775 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_bcn_tmpl()
1777 return -ENOMEM; in ath11k_wmi_bcn_tmpl()
1779 cmd = (struct wmi_bcn_tmpl_cmd *)skb->data; in ath11k_wmi_bcn_tmpl()
1780 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_BCN_TMPL_CMD) | in ath11k_wmi_bcn_tmpl()
1781 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_bcn_tmpl()
1782 cmd->vdev_id = vdev_id; in ath11k_wmi_bcn_tmpl()
1783 cmd->tim_ie_offset = offs->tim_offset; in ath11k_wmi_bcn_tmpl()
1785 if (vif->bss_conf.csa_active) { in ath11k_wmi_bcn_tmpl()
1786 cmd->csa_switch_count_offset = offs->cntdwn_counter_offs[0]; in ath11k_wmi_bcn_tmpl()
1787 cmd->ext_csa_switch_count_offset = offs->cntdwn_counter_offs[1]; in ath11k_wmi_bcn_tmpl()
1790 cmd->buf_len = bcn->len; in ath11k_wmi_bcn_tmpl()
1791 cmd->mbssid_ie_offset = offs->mbssid_off; in ath11k_wmi_bcn_tmpl()
1792 cmd->ema_params = ema_params; in ath11k_wmi_bcn_tmpl()
1794 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_bcn_tmpl()
1798 bcn_prb_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_bcn_tmpl()
1800 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_bcn_tmpl()
1801 bcn_prb_info->caps = 0; in ath11k_wmi_bcn_tmpl()
1802 bcn_prb_info->erp = 0; in ath11k_wmi_bcn_tmpl()
1807 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_bcn_tmpl()
1809 memcpy(tlv->value, bcn->data, bcn->len); in ath11k_wmi_bcn_tmpl()
1813 ath11k_warn(ar->ab, "failed to send WMI_BCN_TMPL_CMDID\n"); in ath11k_wmi_bcn_tmpl()
1817 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd bcn tmpl"); in ath11k_wmi_bcn_tmpl()
1825 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_vdev_install_key()
1830 int key_len_aligned = roundup(arg->key_len, sizeof(uint32_t)); in ath11k_wmi_vdev_install_key()
1834 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_vdev_install_key()
1836 return -ENOMEM; in ath11k_wmi_vdev_install_key()
1838 cmd = (struct wmi_vdev_install_key_cmd *)skb->data; in ath11k_wmi_vdev_install_key()
1839 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_INSTALL_KEY_CMD) | in ath11k_wmi_vdev_install_key()
1840 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_install_key()
1841 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_vdev_install_key()
1842 ether_addr_copy(cmd->peer_macaddr.addr, arg->macaddr); in ath11k_wmi_vdev_install_key()
1843 cmd->key_idx = arg->key_idx; in ath11k_wmi_vdev_install_key()
1844 cmd->key_flags = arg->key_flags; in ath11k_wmi_vdev_install_key()
1845 cmd->key_cipher = arg->key_cipher; in ath11k_wmi_vdev_install_key()
1846 cmd->key_len = arg->key_len; in ath11k_wmi_vdev_install_key()
1847 cmd->key_txmic_len = arg->key_txmic_len; in ath11k_wmi_vdev_install_key()
1848 cmd->key_rxmic_len = arg->key_rxmic_len; in ath11k_wmi_vdev_install_key()
1850 if (arg->key_rsc_counter) in ath11k_wmi_vdev_install_key()
1851 memcpy(&cmd->key_rsc_counter, &arg->key_rsc_counter, in ath11k_wmi_vdev_install_key()
1854 tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_vdev_install_key()
1855 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_vdev_install_key()
1857 if (arg->key_data) in ath11k_wmi_vdev_install_key()
1858 memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); in ath11k_wmi_vdev_install_key()
1862 ath11k_warn(ar->ab, in ath11k_wmi_vdev_install_key()
1867 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_install_key()
1869 arg->key_idx, arg->key_cipher, arg->key_len); in ath11k_wmi_vdev_install_key()
1879 cmd->peer_flags = 0; in ath11k_wmi_copy_peer_flags()
1881 if (param->is_wme_set) { in ath11k_wmi_copy_peer_flags()
1882 if (param->qos_flag) in ath11k_wmi_copy_peer_flags()
1883 cmd->peer_flags |= WMI_PEER_QOS; in ath11k_wmi_copy_peer_flags()
1884 if (param->apsd_flag) in ath11k_wmi_copy_peer_flags()
1885 cmd->peer_flags |= WMI_PEER_APSD; in ath11k_wmi_copy_peer_flags()
1886 if (param->ht_flag) in ath11k_wmi_copy_peer_flags()
1887 cmd->peer_flags |= WMI_PEER_HT; in ath11k_wmi_copy_peer_flags()
1888 if (param->bw_40) in ath11k_wmi_copy_peer_flags()
1889 cmd->peer_flags |= WMI_PEER_40MHZ; in ath11k_wmi_copy_peer_flags()
1890 if (param->bw_80) in ath11k_wmi_copy_peer_flags()
1891 cmd->peer_flags |= WMI_PEER_80MHZ; in ath11k_wmi_copy_peer_flags()
1892 if (param->bw_160) in ath11k_wmi_copy_peer_flags()
1893 cmd->peer_flags |= WMI_PEER_160MHZ; in ath11k_wmi_copy_peer_flags()
1898 if (param->stbc_flag) in ath11k_wmi_copy_peer_flags()
1899 cmd->peer_flags |= WMI_PEER_STBC; in ath11k_wmi_copy_peer_flags()
1904 if (param->ldpc_flag) in ath11k_wmi_copy_peer_flags()
1905 cmd->peer_flags |= WMI_PEER_LDPC; in ath11k_wmi_copy_peer_flags()
1907 if (param->static_mimops_flag) in ath11k_wmi_copy_peer_flags()
1908 cmd->peer_flags |= WMI_PEER_STATIC_MIMOPS; in ath11k_wmi_copy_peer_flags()
1909 if (param->dynamic_mimops_flag) in ath11k_wmi_copy_peer_flags()
1910 cmd->peer_flags |= WMI_PEER_DYN_MIMOPS; in ath11k_wmi_copy_peer_flags()
1911 if (param->spatial_mux_flag) in ath11k_wmi_copy_peer_flags()
1912 cmd->peer_flags |= WMI_PEER_SPATIAL_MUX; in ath11k_wmi_copy_peer_flags()
1913 if (param->vht_flag) in ath11k_wmi_copy_peer_flags()
1914 cmd->peer_flags |= WMI_PEER_VHT; in ath11k_wmi_copy_peer_flags()
1915 if (param->he_flag) in ath11k_wmi_copy_peer_flags()
1916 cmd->peer_flags |= WMI_PEER_HE; in ath11k_wmi_copy_peer_flags()
1917 if (param->twt_requester) in ath11k_wmi_copy_peer_flags()
1918 cmd->peer_flags |= WMI_PEER_TWT_REQ; in ath11k_wmi_copy_peer_flags()
1919 if (param->twt_responder) in ath11k_wmi_copy_peer_flags()
1920 cmd->peer_flags |= WMI_PEER_TWT_RESP; in ath11k_wmi_copy_peer_flags()
1923 /* Suppress authorization for all AUTH modes that need 4-way handshake in ath11k_wmi_copy_peer_flags()
1924 * (during re-association). in ath11k_wmi_copy_peer_flags()
1927 if (param->auth_flag) in ath11k_wmi_copy_peer_flags()
1928 cmd->peer_flags |= WMI_PEER_AUTH; in ath11k_wmi_copy_peer_flags()
1929 if (param->need_ptk_4_way) { in ath11k_wmi_copy_peer_flags()
1930 cmd->peer_flags |= WMI_PEER_NEED_PTK_4_WAY; in ath11k_wmi_copy_peer_flags()
1931 if (!hw_crypto_disabled && param->is_assoc) in ath11k_wmi_copy_peer_flags()
1932 cmd->peer_flags &= ~WMI_PEER_AUTH; in ath11k_wmi_copy_peer_flags()
1934 if (param->need_gtk_2_way) in ath11k_wmi_copy_peer_flags()
1935 cmd->peer_flags |= WMI_PEER_NEED_GTK_2_WAY; in ath11k_wmi_copy_peer_flags()
1936 /* safe mode bypass the 4-way handshake */ in ath11k_wmi_copy_peer_flags()
1937 if (param->safe_mode_enabled) in ath11k_wmi_copy_peer_flags()
1938 cmd->peer_flags &= ~(WMI_PEER_NEED_PTK_4_WAY | in ath11k_wmi_copy_peer_flags()
1941 if (param->is_pmf_enabled) in ath11k_wmi_copy_peer_flags()
1942 cmd->peer_flags |= WMI_PEER_PMF; in ath11k_wmi_copy_peer_flags()
1947 * if (param->amsdu_disable) Add after FW support in ath11k_wmi_copy_peer_flags()
1951 * Mark the node as non-HT if all the mcs rates are disabled through in ath11k_wmi_copy_peer_flags()
1954 if (param->peer_ht_rates.num_rates == 0) in ath11k_wmi_copy_peer_flags()
1955 cmd->peer_flags &= ~WMI_PEER_HT; in ath11k_wmi_copy_peer_flags()
1961 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_peer_assoc_cmd()
1972 peer_legacy_rates_align = roundup(param->peer_legacy_rates.num_rates, in ath11k_wmi_send_peer_assoc_cmd()
1974 peer_ht_rates_align = roundup(param->peer_ht_rates.num_rates, in ath11k_wmi_send_peer_assoc_cmd()
1981 (sizeof(*he_mcs) * param->peer_he_mcs_count); in ath11k_wmi_send_peer_assoc_cmd()
1983 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_peer_assoc_cmd()
1985 return -ENOMEM; in ath11k_wmi_send_peer_assoc_cmd()
1987 ptr = skb->data; in ath11k_wmi_send_peer_assoc_cmd()
1990 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_peer_assoc_cmd()
1992 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_assoc_cmd()
1994 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_peer_assoc_cmd()
1996 cmd->peer_new_assoc = param->peer_new_assoc; in ath11k_wmi_send_peer_assoc_cmd()
1997 cmd->peer_associd = param->peer_associd; in ath11k_wmi_send_peer_assoc_cmd()
2001 &ar->ab->dev_flags)); in ath11k_wmi_send_peer_assoc_cmd()
2003 ether_addr_copy(cmd->peer_macaddr.addr, param->peer_mac); in ath11k_wmi_send_peer_assoc_cmd()
2005 cmd->peer_rate_caps = param->peer_rate_caps; in ath11k_wmi_send_peer_assoc_cmd()
2006 cmd->peer_caps = param->peer_caps; in ath11k_wmi_send_peer_assoc_cmd()
2007 cmd->peer_listen_intval = param->peer_listen_intval; in ath11k_wmi_send_peer_assoc_cmd()
2008 cmd->peer_ht_caps = param->peer_ht_caps; in ath11k_wmi_send_peer_assoc_cmd()
2009 cmd->peer_max_mpdu = param->peer_max_mpdu; in ath11k_wmi_send_peer_assoc_cmd()
2010 cmd->peer_mpdu_density = param->peer_mpdu_density; in ath11k_wmi_send_peer_assoc_cmd()
2011 cmd->peer_vht_caps = param->peer_vht_caps; in ath11k_wmi_send_peer_assoc_cmd()
2012 cmd->peer_phymode = param->peer_phymode; in ath11k_wmi_send_peer_assoc_cmd()
2015 cmd->peer_he_cap_info = param->peer_he_cap_macinfo[0]; in ath11k_wmi_send_peer_assoc_cmd()
2016 cmd->peer_he_cap_info_ext = param->peer_he_cap_macinfo[1]; in ath11k_wmi_send_peer_assoc_cmd()
2017 cmd->peer_he_cap_info_internal = param->peer_he_cap_macinfo_internal; in ath11k_wmi_send_peer_assoc_cmd()
2018 cmd->peer_he_caps_6ghz = param->peer_he_caps_6ghz; in ath11k_wmi_send_peer_assoc_cmd()
2019 cmd->peer_he_ops = param->peer_he_ops; in ath11k_wmi_send_peer_assoc_cmd()
2020 memcpy(&cmd->peer_he_cap_phy, &param->peer_he_cap_phyinfo, in ath11k_wmi_send_peer_assoc_cmd()
2021 sizeof(param->peer_he_cap_phyinfo)); in ath11k_wmi_send_peer_assoc_cmd()
2022 memcpy(&cmd->peer_ppet, &param->peer_ppet, in ath11k_wmi_send_peer_assoc_cmd()
2023 sizeof(param->peer_ppet)); in ath11k_wmi_send_peer_assoc_cmd()
2029 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_send_peer_assoc_cmd()
2034 cmd->num_peer_legacy_rates = param->peer_legacy_rates.num_rates; in ath11k_wmi_send_peer_assoc_cmd()
2035 memcpy(ptr, param->peer_legacy_rates.rates, in ath11k_wmi_send_peer_assoc_cmd()
2036 param->peer_legacy_rates.num_rates); in ath11k_wmi_send_peer_assoc_cmd()
2042 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_send_peer_assoc_cmd()
2045 cmd->num_peer_ht_rates = param->peer_ht_rates.num_rates; in ath11k_wmi_send_peer_assoc_cmd()
2046 memcpy(ptr, param->peer_ht_rates.rates, in ath11k_wmi_send_peer_assoc_cmd()
2047 param->peer_ht_rates.num_rates); in ath11k_wmi_send_peer_assoc_cmd()
2054 mcs->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VHT_RATE_SET) | in ath11k_wmi_send_peer_assoc_cmd()
2055 FIELD_PREP(WMI_TLV_LEN, sizeof(*mcs) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_assoc_cmd()
2057 cmd->peer_nss = param->peer_nss; in ath11k_wmi_send_peer_assoc_cmd()
2059 /* Update bandwidth-NSS mapping */ in ath11k_wmi_send_peer_assoc_cmd()
2060 cmd->peer_bw_rxnss_override = 0; in ath11k_wmi_send_peer_assoc_cmd()
2061 cmd->peer_bw_rxnss_override |= param->peer_bw_rxnss_override; in ath11k_wmi_send_peer_assoc_cmd()
2063 if (param->vht_capable) { in ath11k_wmi_send_peer_assoc_cmd()
2064 mcs->rx_max_rate = param->rx_max_rate; in ath11k_wmi_send_peer_assoc_cmd()
2065 mcs->rx_mcs_set = param->rx_mcs_set; in ath11k_wmi_send_peer_assoc_cmd()
2066 mcs->tx_max_rate = param->tx_max_rate; in ath11k_wmi_send_peer_assoc_cmd()
2067 mcs->tx_mcs_set = param->tx_mcs_set; in ath11k_wmi_send_peer_assoc_cmd()
2071 cmd->peer_he_mcs = param->peer_he_mcs_count; in ath11k_wmi_send_peer_assoc_cmd()
2072 cmd->min_data_rate = param->min_data_rate; in ath11k_wmi_send_peer_assoc_cmd()
2076 len = param->peer_he_mcs_count * sizeof(*he_mcs); in ath11k_wmi_send_peer_assoc_cmd()
2079 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_peer_assoc_cmd()
2084 for (i = 0; i < param->peer_he_mcs_count; i++) { in ath11k_wmi_send_peer_assoc_cmd()
2086 he_mcs->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_peer_assoc_cmd()
2089 sizeof(*he_mcs) - TLV_HDR_SIZE); in ath11k_wmi_send_peer_assoc_cmd()
2091 he_mcs->rx_mcs_set = param->peer_he_tx_mcs_set[i]; in ath11k_wmi_send_peer_assoc_cmd()
2092 he_mcs->tx_mcs_set = param->peer_he_rx_mcs_set[i]; in ath11k_wmi_send_peer_assoc_cmd()
2098 ath11k_warn(ar->ab, in ath11k_wmi_send_peer_assoc_cmd()
2103 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_peer_assoc_cmd()
2105 cmd->vdev_id, cmd->peer_associd, param->peer_mac, in ath11k_wmi_send_peer_assoc_cmd()
2106 cmd->peer_flags, cmd->peer_rate_caps, cmd->peer_caps, in ath11k_wmi_send_peer_assoc_cmd()
2107 cmd->peer_listen_intval, cmd->peer_ht_caps, in ath11k_wmi_send_peer_assoc_cmd()
2108 cmd->peer_max_mpdu, cmd->peer_nss, cmd->peer_phymode, in ath11k_wmi_send_peer_assoc_cmd()
2109 cmd->peer_mpdu_density, in ath11k_wmi_send_peer_assoc_cmd()
2110 cmd->peer_vht_caps, cmd->peer_he_cap_info, in ath11k_wmi_send_peer_assoc_cmd()
2111 cmd->peer_he_ops, cmd->peer_he_cap_info_ext, in ath11k_wmi_send_peer_assoc_cmd()
2112 cmd->peer_he_cap_phy[0], cmd->peer_he_cap_phy[1], in ath11k_wmi_send_peer_assoc_cmd()
2113 cmd->peer_he_cap_phy[2], in ath11k_wmi_send_peer_assoc_cmd()
2114 cmd->peer_bw_rxnss_override); in ath11k_wmi_send_peer_assoc_cmd()
2123 arg->scan_req_id = 1; in ath11k_wmi_start_scan_init()
2124 if (ar->state_11d == ATH11K_11D_PREPARING) in ath11k_wmi_start_scan_init()
2125 arg->scan_priority = WMI_SCAN_PRIORITY_MEDIUM; in ath11k_wmi_start_scan_init()
2127 arg->scan_priority = WMI_SCAN_PRIORITY_LOW; in ath11k_wmi_start_scan_init()
2128 arg->dwell_time_active = 50; in ath11k_wmi_start_scan_init()
2129 arg->dwell_time_active_2g = 0; in ath11k_wmi_start_scan_init()
2130 arg->dwell_time_passive = 150; in ath11k_wmi_start_scan_init()
2131 arg->dwell_time_active_6g = 40; in ath11k_wmi_start_scan_init()
2132 arg->dwell_time_passive_6g = 30; in ath11k_wmi_start_scan_init()
2133 arg->min_rest_time = 50; in ath11k_wmi_start_scan_init()
2134 arg->max_rest_time = 500; in ath11k_wmi_start_scan_init()
2135 arg->repeat_probe_time = 0; in ath11k_wmi_start_scan_init()
2136 arg->probe_spacing_time = 0; in ath11k_wmi_start_scan_init()
2137 arg->idle_time = 0; in ath11k_wmi_start_scan_init()
2138 arg->max_scan_time = 20000; in ath11k_wmi_start_scan_init()
2139 arg->probe_delay = 5; in ath11k_wmi_start_scan_init()
2140 arg->notify_scan_events = WMI_SCAN_EVENT_STARTED | in ath11k_wmi_start_scan_init()
2145 arg->scan_f_chan_stat_evnt = 1; in ath11k_wmi_start_scan_init()
2148 ar->ab->wmi_ab.svc_map)) in ath11k_wmi_start_scan_init()
2149 arg->scan_ctrl_flags_ext |= in ath11k_wmi_start_scan_init()
2152 arg->num_bssid = 1; in ath11k_wmi_start_scan_init()
2157 eth_broadcast_addr(arg->bssid_list[0].addr); in ath11k_wmi_start_scan_init()
2165 if (param->scan_ev_started) in ath11k_wmi_copy_scan_event_cntrl_flags()
2166 cmd->notify_scan_events |= WMI_SCAN_EVENT_STARTED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2167 if (param->scan_ev_completed) in ath11k_wmi_copy_scan_event_cntrl_flags()
2168 cmd->notify_scan_events |= WMI_SCAN_EVENT_COMPLETED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2169 if (param->scan_ev_bss_chan) in ath11k_wmi_copy_scan_event_cntrl_flags()
2170 cmd->notify_scan_events |= WMI_SCAN_EVENT_BSS_CHANNEL; in ath11k_wmi_copy_scan_event_cntrl_flags()
2171 if (param->scan_ev_foreign_chan) in ath11k_wmi_copy_scan_event_cntrl_flags()
2172 cmd->notify_scan_events |= WMI_SCAN_EVENT_FOREIGN_CHAN; in ath11k_wmi_copy_scan_event_cntrl_flags()
2173 if (param->scan_ev_dequeued) in ath11k_wmi_copy_scan_event_cntrl_flags()
2174 cmd->notify_scan_events |= WMI_SCAN_EVENT_DEQUEUED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2175 if (param->scan_ev_preempted) in ath11k_wmi_copy_scan_event_cntrl_flags()
2176 cmd->notify_scan_events |= WMI_SCAN_EVENT_PREEMPTED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2177 if (param->scan_ev_start_failed) in ath11k_wmi_copy_scan_event_cntrl_flags()
2178 cmd->notify_scan_events |= WMI_SCAN_EVENT_START_FAILED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2179 if (param->scan_ev_restarted) in ath11k_wmi_copy_scan_event_cntrl_flags()
2180 cmd->notify_scan_events |= WMI_SCAN_EVENT_RESTARTED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2181 if (param->scan_ev_foreign_chn_exit) in ath11k_wmi_copy_scan_event_cntrl_flags()
2182 cmd->notify_scan_events |= WMI_SCAN_EVENT_FOREIGN_CHAN_EXIT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2183 if (param->scan_ev_suspended) in ath11k_wmi_copy_scan_event_cntrl_flags()
2184 cmd->notify_scan_events |= WMI_SCAN_EVENT_SUSPENDED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2185 if (param->scan_ev_resumed) in ath11k_wmi_copy_scan_event_cntrl_flags()
2186 cmd->notify_scan_events |= WMI_SCAN_EVENT_RESUMED; in ath11k_wmi_copy_scan_event_cntrl_flags()
2189 cmd->scan_ctrl_flags = 0; in ath11k_wmi_copy_scan_event_cntrl_flags()
2190 if (param->scan_f_passive) in ath11k_wmi_copy_scan_event_cntrl_flags()
2191 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_PASSIVE; in ath11k_wmi_copy_scan_event_cntrl_flags()
2192 if (param->scan_f_strict_passive_pch) in ath11k_wmi_copy_scan_event_cntrl_flags()
2193 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN; in ath11k_wmi_copy_scan_event_cntrl_flags()
2194 if (param->scan_f_promisc_mode) in ath11k_wmi_copy_scan_event_cntrl_flags()
2195 cmd->scan_ctrl_flags |= WMI_SCAN_FILTER_PROMISCUOS; in ath11k_wmi_copy_scan_event_cntrl_flags()
2196 if (param->scan_f_capture_phy_err) in ath11k_wmi_copy_scan_event_cntrl_flags()
2197 cmd->scan_ctrl_flags |= WMI_SCAN_CAPTURE_PHY_ERROR; in ath11k_wmi_copy_scan_event_cntrl_flags()
2198 if (param->scan_f_half_rate) in ath11k_wmi_copy_scan_event_cntrl_flags()
2199 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_HALF_RATE_SUPPORT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2200 if (param->scan_f_quarter_rate) in ath11k_wmi_copy_scan_event_cntrl_flags()
2201 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_QUARTER_RATE_SUPPORT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2202 if (param->scan_f_cck_rates) in ath11k_wmi_copy_scan_event_cntrl_flags()
2203 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_CCK_RATES; in ath11k_wmi_copy_scan_event_cntrl_flags()
2204 if (param->scan_f_ofdm_rates) in ath11k_wmi_copy_scan_event_cntrl_flags()
2205 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_OFDM_RATES; in ath11k_wmi_copy_scan_event_cntrl_flags()
2206 if (param->scan_f_chan_stat_evnt) in ath11k_wmi_copy_scan_event_cntrl_flags()
2207 cmd->scan_ctrl_flags |= WMI_SCAN_CHAN_STAT_EVENT; in ath11k_wmi_copy_scan_event_cntrl_flags()
2208 if (param->scan_f_filter_prb_req) in ath11k_wmi_copy_scan_event_cntrl_flags()
2209 cmd->scan_ctrl_flags |= WMI_SCAN_FILTER_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2210 if (param->scan_f_bcast_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2211 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_BCAST_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2212 if (param->scan_f_offchan_mgmt_tx) in ath11k_wmi_copy_scan_event_cntrl_flags()
2213 cmd->scan_ctrl_flags |= WMI_SCAN_OFFCHAN_MGMT_TX; in ath11k_wmi_copy_scan_event_cntrl_flags()
2214 if (param->scan_f_offchan_data_tx) in ath11k_wmi_copy_scan_event_cntrl_flags()
2215 cmd->scan_ctrl_flags |= WMI_SCAN_OFFCHAN_DATA_TX; in ath11k_wmi_copy_scan_event_cntrl_flags()
2216 if (param->scan_f_force_active_dfs_chn) in ath11k_wmi_copy_scan_event_cntrl_flags()
2217 cmd->scan_ctrl_flags |= WMI_SCAN_FLAG_FORCE_ACTIVE_ON_DFS; in ath11k_wmi_copy_scan_event_cntrl_flags()
2218 if (param->scan_f_add_tpc_ie_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2219 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_TPC_IE_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2220 if (param->scan_f_add_ds_ie_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2221 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_DS_IE_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2222 if (param->scan_f_add_spoofed_mac_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2223 cmd->scan_ctrl_flags |= WMI_SCAN_ADD_SPOOF_MAC_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2224 if (param->scan_f_add_rand_seq_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2225 cmd->scan_ctrl_flags |= WMI_SCAN_RANDOM_SEQ_NO_IN_PROBE_REQ; in ath11k_wmi_copy_scan_event_cntrl_flags()
2226 if (param->scan_f_en_ie_whitelist_in_probe) in ath11k_wmi_copy_scan_event_cntrl_flags()
2227 cmd->scan_ctrl_flags |= in ath11k_wmi_copy_scan_event_cntrl_flags()
2230 /* for adaptive scan mode using 3 bits (21 - 23 bits) */ in ath11k_wmi_copy_scan_event_cntrl_flags()
2231 WMI_SCAN_SET_DWELL_MODE(cmd->scan_ctrl_flags, in ath11k_wmi_copy_scan_event_cntrl_flags()
2232 param->adaptive_dwell_time_mode); in ath11k_wmi_copy_scan_event_cntrl_flags()
2234 cmd->scan_ctrl_flags_ext = param->scan_ctrl_flags_ext; in ath11k_wmi_copy_scan_event_cntrl_flags()
2240 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_scan_start_cmd()
2256 if (params->num_chan) in ath11k_wmi_send_scan_start_cmd()
2257 len += params->num_chan * sizeof(u32); in ath11k_wmi_send_scan_start_cmd()
2260 if (params->num_ssids) in ath11k_wmi_send_scan_start_cmd()
2261 len += params->num_ssids * sizeof(*ssid); in ath11k_wmi_send_scan_start_cmd()
2264 if (params->num_bssid) in ath11k_wmi_send_scan_start_cmd()
2265 len += sizeof(*bssid) * params->num_bssid; in ath11k_wmi_send_scan_start_cmd()
2268 if (params->extraie.len && params->extraie.len <= 0xFFFF) in ath11k_wmi_send_scan_start_cmd()
2270 roundup(params->extraie.len, sizeof(u32)); in ath11k_wmi_send_scan_start_cmd()
2273 if (params->num_hint_bssid) in ath11k_wmi_send_scan_start_cmd()
2275 params->num_hint_bssid * sizeof(struct hint_bssid); in ath11k_wmi_send_scan_start_cmd()
2277 if (params->num_hint_s_ssid) in ath11k_wmi_send_scan_start_cmd()
2279 params->num_hint_s_ssid * sizeof(struct hint_short_ssid); in ath11k_wmi_send_scan_start_cmd()
2281 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_scan_start_cmd()
2283 return -ENOMEM; in ath11k_wmi_send_scan_start_cmd()
2285 ptr = skb->data; in ath11k_wmi_send_scan_start_cmd()
2288 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_START_SCAN_CMD) | in ath11k_wmi_send_scan_start_cmd()
2289 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_scan_start_cmd()
2291 cmd->scan_id = params->scan_id; in ath11k_wmi_send_scan_start_cmd()
2292 cmd->scan_req_id = params->scan_req_id; in ath11k_wmi_send_scan_start_cmd()
2293 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_scan_start_cmd()
2294 cmd->scan_priority = params->scan_priority; in ath11k_wmi_send_scan_start_cmd()
2295 cmd->notify_scan_events = params->notify_scan_events; in ath11k_wmi_send_scan_start_cmd()
2299 cmd->dwell_time_active = params->dwell_time_active; in ath11k_wmi_send_scan_start_cmd()
2300 cmd->dwell_time_active_2g = params->dwell_time_active_2g; in ath11k_wmi_send_scan_start_cmd()
2301 cmd->dwell_time_passive = params->dwell_time_passive; in ath11k_wmi_send_scan_start_cmd()
2302 cmd->dwell_time_active_6g = params->dwell_time_active_6g; in ath11k_wmi_send_scan_start_cmd()
2303 cmd->dwell_time_passive_6g = params->dwell_time_passive_6g; in ath11k_wmi_send_scan_start_cmd()
2304 cmd->min_rest_time = params->min_rest_time; in ath11k_wmi_send_scan_start_cmd()
2305 cmd->max_rest_time = params->max_rest_time; in ath11k_wmi_send_scan_start_cmd()
2306 cmd->repeat_probe_time = params->repeat_probe_time; in ath11k_wmi_send_scan_start_cmd()
2307 cmd->probe_spacing_time = params->probe_spacing_time; in ath11k_wmi_send_scan_start_cmd()
2308 cmd->idle_time = params->idle_time; in ath11k_wmi_send_scan_start_cmd()
2309 cmd->max_scan_time = params->max_scan_time; in ath11k_wmi_send_scan_start_cmd()
2310 cmd->probe_delay = params->probe_delay; in ath11k_wmi_send_scan_start_cmd()
2311 cmd->burst_duration = params->burst_duration; in ath11k_wmi_send_scan_start_cmd()
2312 cmd->num_chan = params->num_chan; in ath11k_wmi_send_scan_start_cmd()
2313 cmd->num_bssid = params->num_bssid; in ath11k_wmi_send_scan_start_cmd()
2314 cmd->num_ssids = params->num_ssids; in ath11k_wmi_send_scan_start_cmd()
2315 cmd->ie_len = params->extraie.len; in ath11k_wmi_send_scan_start_cmd()
2316 cmd->n_probes = params->n_probes; in ath11k_wmi_send_scan_start_cmd()
2317 ether_addr_copy(cmd->mac_addr.addr, params->mac_addr.addr); in ath11k_wmi_send_scan_start_cmd()
2318 ether_addr_copy(cmd->mac_mask.addr, params->mac_mask.addr); in ath11k_wmi_send_scan_start_cmd()
2322 len = params->num_chan * sizeof(u32); in ath11k_wmi_send_scan_start_cmd()
2325 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_send_scan_start_cmd()
2330 for (i = 0; i < params->num_chan; ++i) in ath11k_wmi_send_scan_start_cmd()
2331 tmp_ptr[i] = params->chan_list[i]; in ath11k_wmi_send_scan_start_cmd()
2335 len = params->num_ssids * sizeof(*ssid); in ath11k_wmi_send_scan_start_cmd()
2337 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2342 if (params->num_ssids) { in ath11k_wmi_send_scan_start_cmd()
2344 for (i = 0; i < params->num_ssids; ++i) { in ath11k_wmi_send_scan_start_cmd()
2345 ssid->ssid_len = params->ssid[i].length; in ath11k_wmi_send_scan_start_cmd()
2346 memcpy(ssid->ssid, params->ssid[i].ssid, in ath11k_wmi_send_scan_start_cmd()
2347 params->ssid[i].length); in ath11k_wmi_send_scan_start_cmd()
2352 ptr += (params->num_ssids * sizeof(*ssid)); in ath11k_wmi_send_scan_start_cmd()
2353 len = params->num_bssid * sizeof(*bssid); in ath11k_wmi_send_scan_start_cmd()
2355 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2361 if (params->num_bssid) { in ath11k_wmi_send_scan_start_cmd()
2362 for (i = 0; i < params->num_bssid; ++i) { in ath11k_wmi_send_scan_start_cmd()
2363 ether_addr_copy(bssid->addr, in ath11k_wmi_send_scan_start_cmd()
2364 params->bssid_list[i].addr); in ath11k_wmi_send_scan_start_cmd()
2369 ptr += params->num_bssid * sizeof(*bssid); in ath11k_wmi_send_scan_start_cmd()
2373 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_send_scan_start_cmd()
2378 memcpy(ptr, params->extraie.ptr, in ath11k_wmi_send_scan_start_cmd()
2379 params->extraie.len); in ath11k_wmi_send_scan_start_cmd()
2383 if (params->num_hint_s_ssid) { in ath11k_wmi_send_scan_start_cmd()
2384 len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); in ath11k_wmi_send_scan_start_cmd()
2386 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2390 for (i = 0; i < params->num_hint_s_ssid; ++i) { in ath11k_wmi_send_scan_start_cmd()
2391 s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; in ath11k_wmi_send_scan_start_cmd()
2392 s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; in ath11k_wmi_send_scan_start_cmd()
2398 if (params->num_hint_bssid) { in ath11k_wmi_send_scan_start_cmd()
2399 len = params->num_hint_bssid * sizeof(struct hint_bssid); in ath11k_wmi_send_scan_start_cmd()
2401 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | in ath11k_wmi_send_scan_start_cmd()
2405 for (i = 0; i < params->num_hint_bssid; ++i) { in ath11k_wmi_send_scan_start_cmd()
2406 hint_bssid->freq_flags = in ath11k_wmi_send_scan_start_cmd()
2407 params->hint_bssid[i].freq_flags; in ath11k_wmi_send_scan_start_cmd()
2408 ether_addr_copy(&params->hint_bssid[i].bssid.addr[0], in ath11k_wmi_send_scan_start_cmd()
2409 &hint_bssid->bssid.addr[0]); in ath11k_wmi_send_scan_start_cmd()
2417 ath11k_warn(ar->ab, "failed to send WMI_START_SCAN_CMDID\n"); in ath11k_wmi_send_scan_start_cmd()
2421 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd start scan"); in ath11k_wmi_send_scan_start_cmd()
2430 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_vdev_set_tpc_power()
2438 array_len = sizeof(*ch) * param->num_pwr_levels; in ath11k_wmi_send_vdev_set_tpc_power()
2441 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_vdev_set_tpc_power()
2443 return -ENOMEM; in ath11k_wmi_send_vdev_set_tpc_power()
2445 ptr = skb->data; in ath11k_wmi_send_vdev_set_tpc_power()
2448 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_SET_TPC_POWER_CMD) | in ath11k_wmi_send_vdev_set_tpc_power()
2449 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_vdev_set_tpc_power()
2450 cmd->vdev_id = vdev_id; in ath11k_wmi_send_vdev_set_tpc_power()
2451 cmd->psd_power = param->is_psd_power; in ath11k_wmi_send_vdev_set_tpc_power()
2452 cmd->eirp_power = param->eirp_power; in ath11k_wmi_send_vdev_set_tpc_power()
2453 cmd->power_type_6ghz = param->ap_power_type; in ath11k_wmi_send_vdev_set_tpc_power()
2455 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_vdev_set_tpc_power()
2457 vdev_id, param->is_psd_power, param->eirp_power, param->ap_power_type); in ath11k_wmi_send_vdev_set_tpc_power()
2461 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_vdev_set_tpc_power()
2467 for (i = 0; i < param->num_pwr_levels; i++, ch++) { in ath11k_wmi_send_vdev_set_tpc_power()
2468 ch->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_vdev_set_tpc_power()
2471 sizeof(*ch) - TLV_HDR_SIZE); in ath11k_wmi_send_vdev_set_tpc_power()
2473 ch->chan_cfreq = param->chan_power_info[i].chan_cfreq; in ath11k_wmi_send_vdev_set_tpc_power()
2474 ch->tx_power = param->chan_power_info[i].tx_power; in ath11k_wmi_send_vdev_set_tpc_power()
2476 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tpc chan freq %d TX power %d\n", in ath11k_wmi_send_vdev_set_tpc_power()
2477 ch->chan_cfreq, ch->tx_power); in ath11k_wmi_send_vdev_set_tpc_power()
2482 ath11k_warn(ar->ab, "failed to send WMI_VDEV_SET_TPC_POWER_CMDID\n"); in ath11k_wmi_send_vdev_set_tpc_power()
2493 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_scan_stop_cmd()
2498 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_scan_stop_cmd()
2500 return -ENOMEM; in ath11k_wmi_send_scan_stop_cmd()
2502 cmd = (struct wmi_stop_scan_cmd *)skb->data; in ath11k_wmi_send_scan_stop_cmd()
2504 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_STOP_SCAN_CMD) | in ath11k_wmi_send_scan_stop_cmd()
2505 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_scan_stop_cmd()
2507 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_scan_stop_cmd()
2508 cmd->requestor = param->requester; in ath11k_wmi_send_scan_stop_cmd()
2509 cmd->scan_id = param->scan_id; in ath11k_wmi_send_scan_stop_cmd()
2510 cmd->pdev_id = param->pdev_id; in ath11k_wmi_send_scan_stop_cmd()
2512 if (param->req_type == WLAN_SCAN_CANCEL_PDEV_ALL) { in ath11k_wmi_send_scan_stop_cmd()
2514 cmd->req_type = WMI_SCAN_STOP_ALL; in ath11k_wmi_send_scan_stop_cmd()
2515 } else if (param->req_type == WLAN_SCAN_CANCEL_VDEV_ALL) { in ath11k_wmi_send_scan_stop_cmd()
2517 cmd->req_type = WMI_SCN_STOP_VAP_ALL; in ath11k_wmi_send_scan_stop_cmd()
2518 } else if (param->req_type == WLAN_SCAN_CANCEL_SINGLE) { in ath11k_wmi_send_scan_stop_cmd()
2520 cmd->req_type = WMI_SCAN_STOP_ONE; in ath11k_wmi_send_scan_stop_cmd()
2522 ath11k_warn(ar->ab, "invalid scan cancel param %d", in ath11k_wmi_send_scan_stop_cmd()
2523 param->req_type); in ath11k_wmi_send_scan_stop_cmd()
2525 return -EINVAL; in ath11k_wmi_send_scan_stop_cmd()
2531 ath11k_warn(ar->ab, "failed to send WMI_STOP_SCAN_CMDID\n"); in ath11k_wmi_send_scan_stop_cmd()
2535 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd stop scan"); in ath11k_wmi_send_scan_stop_cmd()
2543 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_scan_chan_list_cmd()
2554 tchan_info = chan_list->ch_param; in ath11k_wmi_send_scan_chan_list_cmd()
2555 while (chan_list->nallchans) { in ath11k_wmi_send_scan_chan_list_cmd()
2557 max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) / in ath11k_wmi_send_scan_chan_list_cmd()
2560 if (chan_list->nallchans > max_chan_limit) in ath11k_wmi_send_scan_chan_list_cmd()
2563 num_send_chans = chan_list->nallchans; in ath11k_wmi_send_scan_chan_list_cmd()
2565 chan_list->nallchans -= num_send_chans; in ath11k_wmi_send_scan_chan_list_cmd()
2568 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_scan_chan_list_cmd()
2570 return -ENOMEM; in ath11k_wmi_send_scan_chan_list_cmd()
2572 cmd = (struct wmi_scan_chan_list_cmd *)skb->data; in ath11k_wmi_send_scan_chan_list_cmd()
2573 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_SCAN_CHAN_LIST_CMD) | in ath11k_wmi_send_scan_chan_list_cmd()
2574 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_scan_chan_list_cmd()
2575 cmd->pdev_id = chan_list->pdev_id; in ath11k_wmi_send_scan_chan_list_cmd()
2576 cmd->num_scan_chans = num_send_chans; in ath11k_wmi_send_scan_chan_list_cmd()
2578 cmd->flags |= WMI_APPEND_TO_EXISTING_CHAN_LIST_FLAG; in ath11k_wmi_send_scan_chan_list_cmd()
2580 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_scan_chan_list_cmd()
2582 num_send_chans, len, cmd->pdev_id, num_sends); in ath11k_wmi_send_scan_chan_list_cmd()
2584 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_send_scan_chan_list_cmd()
2588 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_scan_chan_list_cmd()
2589 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_scan_chan_list_cmd()
2596 chan_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_scan_chan_list_cmd()
2599 len - TLV_HDR_SIZE); in ath11k_wmi_send_scan_chan_list_cmd()
2601 reg1 = &chan_info->reg_info_1; in ath11k_wmi_send_scan_chan_list_cmd()
2602 reg2 = &chan_info->reg_info_2; in ath11k_wmi_send_scan_chan_list_cmd()
2603 chan_info->mhz = tchan_info->mhz; in ath11k_wmi_send_scan_chan_list_cmd()
2604 chan_info->band_center_freq1 = tchan_info->cfreq1; in ath11k_wmi_send_scan_chan_list_cmd()
2605 chan_info->band_center_freq2 = tchan_info->cfreq2; in ath11k_wmi_send_scan_chan_list_cmd()
2607 if (tchan_info->is_chan_passive) in ath11k_wmi_send_scan_chan_list_cmd()
2608 chan_info->info |= WMI_CHAN_INFO_PASSIVE; in ath11k_wmi_send_scan_chan_list_cmd()
2609 if (tchan_info->allow_he) in ath11k_wmi_send_scan_chan_list_cmd()
2610 chan_info->info |= WMI_CHAN_INFO_ALLOW_HE; in ath11k_wmi_send_scan_chan_list_cmd()
2611 else if (tchan_info->allow_vht) in ath11k_wmi_send_scan_chan_list_cmd()
2612 chan_info->info |= WMI_CHAN_INFO_ALLOW_VHT; in ath11k_wmi_send_scan_chan_list_cmd()
2613 else if (tchan_info->allow_ht) in ath11k_wmi_send_scan_chan_list_cmd()
2614 chan_info->info |= WMI_CHAN_INFO_ALLOW_HT; in ath11k_wmi_send_scan_chan_list_cmd()
2615 if (tchan_info->half_rate) in ath11k_wmi_send_scan_chan_list_cmd()
2616 chan_info->info |= WMI_CHAN_INFO_HALF_RATE; in ath11k_wmi_send_scan_chan_list_cmd()
2617 if (tchan_info->quarter_rate) in ath11k_wmi_send_scan_chan_list_cmd()
2618 chan_info->info |= WMI_CHAN_INFO_QUARTER_RATE; in ath11k_wmi_send_scan_chan_list_cmd()
2619 if (tchan_info->psc_channel) in ath11k_wmi_send_scan_chan_list_cmd()
2620 chan_info->info |= WMI_CHAN_INFO_PSC; in ath11k_wmi_send_scan_chan_list_cmd()
2621 if (tchan_info->dfs_set) in ath11k_wmi_send_scan_chan_list_cmd()
2622 chan_info->info |= WMI_CHAN_INFO_DFS; in ath11k_wmi_send_scan_chan_list_cmd()
2624 chan_info->info |= FIELD_PREP(WMI_CHAN_INFO_MODE, in ath11k_wmi_send_scan_chan_list_cmd()
2625 tchan_info->phy_mode); in ath11k_wmi_send_scan_chan_list_cmd()
2627 tchan_info->minpower); in ath11k_wmi_send_scan_chan_list_cmd()
2629 tchan_info->maxpower); in ath11k_wmi_send_scan_chan_list_cmd()
2631 tchan_info->maxregpower); in ath11k_wmi_send_scan_chan_list_cmd()
2633 tchan_info->reg_class_id); in ath11k_wmi_send_scan_chan_list_cmd()
2635 tchan_info->antennamax); in ath11k_wmi_send_scan_chan_list_cmd()
2637 tchan_info->maxregpower); in ath11k_wmi_send_scan_chan_list_cmd()
2639 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_scan_chan_list_cmd()
2640 "chan scan list chan[%d] = %u, chan_info->info %8x\n", in ath11k_wmi_send_scan_chan_list_cmd()
2641 i, chan_info->mhz, chan_info->info); in ath11k_wmi_send_scan_chan_list_cmd()
2650 ath11k_warn(ar->ab, "failed to send WMI_SCAN_CHAN_LIST cmd\n"); in ath11k_wmi_send_scan_chan_list_cmd()
2655 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd scan chan list channels %d", in ath11k_wmi_send_scan_chan_list_cmd()
2667 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_wmm_update_cmd_tlv()
2674 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_wmm_update_cmd_tlv()
2676 return -ENOMEM; in ath11k_wmi_send_wmm_update_cmd_tlv()
2678 cmd = (struct wmi_vdev_set_wmm_params_cmd *)skb->data; in ath11k_wmi_send_wmm_update_cmd_tlv()
2679 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_wmm_update_cmd_tlv()
2681 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_wmm_update_cmd_tlv()
2683 cmd->vdev_id = vdev_id; in ath11k_wmi_send_wmm_update_cmd_tlv()
2684 cmd->wmm_param_type = 0; in ath11k_wmi_send_wmm_update_cmd_tlv()
2689 wmi_wmm_arg = &param->ac_be; in ath11k_wmi_send_wmm_update_cmd_tlv()
2692 wmi_wmm_arg = &param->ac_bk; in ath11k_wmi_send_wmm_update_cmd_tlv()
2695 wmi_wmm_arg = &param->ac_vi; in ath11k_wmi_send_wmm_update_cmd_tlv()
2698 wmi_wmm_arg = &param->ac_vo; in ath11k_wmi_send_wmm_update_cmd_tlv()
2702 wmm_param = (struct wmi_wmm_params *)&cmd->wmm_params[ac]; in ath11k_wmi_send_wmm_update_cmd_tlv()
2703 wmm_param->tlv_header = in ath11k_wmi_send_wmm_update_cmd_tlv()
2707 sizeof(*wmm_param) - TLV_HDR_SIZE); in ath11k_wmi_send_wmm_update_cmd_tlv()
2709 wmm_param->aifs = wmi_wmm_arg->aifs; in ath11k_wmi_send_wmm_update_cmd_tlv()
2710 wmm_param->cwmin = wmi_wmm_arg->cwmin; in ath11k_wmi_send_wmm_update_cmd_tlv()
2711 wmm_param->cwmax = wmi_wmm_arg->cwmax; in ath11k_wmi_send_wmm_update_cmd_tlv()
2712 wmm_param->txoplimit = wmi_wmm_arg->txop; in ath11k_wmi_send_wmm_update_cmd_tlv()
2713 wmm_param->acm = wmi_wmm_arg->acm; in ath11k_wmi_send_wmm_update_cmd_tlv()
2714 wmm_param->no_ack = wmi_wmm_arg->no_ack; in ath11k_wmi_send_wmm_update_cmd_tlv()
2716 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_wmm_update_cmd_tlv()
2718 ac, wmm_param->aifs, wmm_param->cwmin, in ath11k_wmi_send_wmm_update_cmd_tlv()
2719 wmm_param->cwmax, wmm_param->txoplimit, in ath11k_wmi_send_wmm_update_cmd_tlv()
2720 wmm_param->acm, wmm_param->no_ack); in ath11k_wmi_send_wmm_update_cmd_tlv()
2725 ath11k_warn(ar->ab, in ath11k_wmi_send_wmm_update_cmd_tlv()
2730 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev set wmm params"); in ath11k_wmi_send_wmm_update_cmd_tlv()
2738 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2743 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2745 return -ENOMEM; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2747 cmd = (struct wmi_dfs_phyerr_offload_cmd *)skb->data; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2748 cmd->tlv_header = in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2751 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2753 cmd->pdev_id = pdev_id; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2758 ath11k_warn(ar->ab, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2763 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2772 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_delba_send()
2777 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_delba_send()
2779 return -ENOMEM; in ath11k_wmi_delba_send()
2781 cmd = (struct wmi_delba_send_cmd *)skb->data; in ath11k_wmi_delba_send()
2782 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DELBA_SEND_CMD) | in ath11k_wmi_delba_send()
2783 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_delba_send()
2784 cmd->vdev_id = vdev_id; in ath11k_wmi_delba_send()
2785 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_delba_send()
2786 cmd->tid = tid; in ath11k_wmi_delba_send()
2787 cmd->initiator = initiator; in ath11k_wmi_delba_send()
2788 cmd->reasoncode = reason; in ath11k_wmi_delba_send()
2793 ath11k_warn(ar->ab, in ath11k_wmi_delba_send()
2798 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_delba_send()
2808 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_set_resp()
2813 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_set_resp()
2815 return -ENOMEM; in ath11k_wmi_addba_set_resp()
2817 cmd = (struct wmi_addba_setresponse_cmd *)skb->data; in ath11k_wmi_addba_set_resp()
2818 cmd->tlv_header = in ath11k_wmi_addba_set_resp()
2820 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_set_resp()
2821 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_set_resp()
2822 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_set_resp()
2823 cmd->tid = tid; in ath11k_wmi_addba_set_resp()
2824 cmd->statuscode = status; in ath11k_wmi_addba_set_resp()
2829 ath11k_warn(ar->ab, in ath11k_wmi_addba_set_resp()
2834 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_set_resp()
2844 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_send()
2849 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_send()
2851 return -ENOMEM; in ath11k_wmi_addba_send()
2853 cmd = (struct wmi_addba_send_cmd *)skb->data; in ath11k_wmi_addba_send()
2854 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ADDBA_SEND_CMD) | in ath11k_wmi_addba_send()
2855 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_send()
2856 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_send()
2857 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_send()
2858 cmd->tid = tid; in ath11k_wmi_addba_send()
2859 cmd->buffersize = buf_size; in ath11k_wmi_addba_send()
2864 ath11k_warn(ar->ab, in ath11k_wmi_addba_send()
2869 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_send()
2878 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_clear_resp()
2883 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_clear_resp()
2885 return -ENOMEM; in ath11k_wmi_addba_clear_resp()
2887 cmd = (struct wmi_addba_clear_resp_cmd *)skb->data; in ath11k_wmi_addba_clear_resp()
2888 cmd->tlv_header = in ath11k_wmi_addba_clear_resp()
2890 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_clear_resp()
2891 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_clear_resp()
2892 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_clear_resp()
2897 ath11k_warn(ar->ab, in ath11k_wmi_addba_clear_resp()
2902 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_clear_resp()
2911 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_peer_pktlog_filter()
2920 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_peer_pktlog_filter()
2922 return -ENOMEM; in ath11k_wmi_pdev_peer_pktlog_filter()
2924 cmd = (struct wmi_pdev_pktlog_filter_cmd *)skb->data; in ath11k_wmi_pdev_peer_pktlog_filter()
2926 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD) | in ath11k_wmi_pdev_peer_pktlog_filter()
2927 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_peer_pktlog_filter()
2929 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_peer_pktlog_filter()
2930 cmd->num_mac = 1; in ath11k_wmi_pdev_peer_pktlog_filter()
2931 cmd->enable = enable; in ath11k_wmi_pdev_peer_pktlog_filter()
2933 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_peer_pktlog_filter()
2936 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_pdev_peer_pktlog_filter()
2942 ether_addr_copy(info->peer_macaddr.addr, addr); in ath11k_wmi_pdev_peer_pktlog_filter()
2943 info->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO) | in ath11k_wmi_pdev_peer_pktlog_filter()
2945 sizeof(*info) - TLV_HDR_SIZE); in ath11k_wmi_pdev_peer_pktlog_filter()
2950 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_peer_pktlog_filter()
2954 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog filter"); in ath11k_wmi_pdev_peer_pktlog_filter()
2963 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_init_country_cmd()
2968 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_init_country_cmd()
2970 return -ENOMEM; in ath11k_wmi_send_init_country_cmd()
2972 cmd = (struct wmi_init_country_cmd *)skb->data; in ath11k_wmi_send_init_country_cmd()
2973 cmd->tlv_header = in ath11k_wmi_send_init_country_cmd()
2976 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_init_country_cmd()
2978 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_init_country_cmd()
2982 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_ALPHA; in ath11k_wmi_send_init_country_cmd()
2983 memcpy((u8 *)&cmd->cc_info.alpha2, in ath11k_wmi_send_init_country_cmd()
2987 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_COUNTRY_CODE; in ath11k_wmi_send_init_country_cmd()
2988 cmd->cc_info.country_code = init_cc_params.cc_info.country_code; in ath11k_wmi_send_init_country_cmd()
2991 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_REGDOMAIN; in ath11k_wmi_send_init_country_cmd()
2992 cmd->cc_info.regdom_id = init_cc_params.cc_info.regdom_id; in ath11k_wmi_send_init_country_cmd()
2995 ath11k_warn(ar->ab, "unknown cc params flags: 0x%x", in ath11k_wmi_send_init_country_cmd()
2997 ret = -EINVAL; in ath11k_wmi_send_init_country_cmd()
3004 ath11k_warn(ar->ab, in ath11k_wmi_send_init_country_cmd()
3010 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd set init country"); in ath11k_wmi_send_init_country_cmd()
3022 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_set_current_country_cmd()
3027 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_set_current_country_cmd()
3029 return -ENOMEM; in ath11k_wmi_send_set_current_country_cmd()
3031 cmd = (struct wmi_set_current_country_cmd *)skb->data; in ath11k_wmi_send_set_current_country_cmd()
3032 cmd->tlv_header = in ath11k_wmi_send_set_current_country_cmd()
3034 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_set_current_country_cmd()
3036 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_set_current_country_cmd()
3037 memcpy(&cmd->new_alpha2, &param->alpha2, 3); in ath11k_wmi_send_set_current_country_cmd()
3041 ath11k_warn(ar->ab, in ath11k_wmi_send_set_current_country_cmd()
3046 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_set_current_country_cmd()
3048 ar->pdev->pdev_id, in ath11k_wmi_send_set_current_country_cmd()
3049 param->alpha2[0], in ath11k_wmi_send_set_current_country_cmd()
3050 param->alpha2[1]); in ath11k_wmi_send_set_current_country_cmd()
3059 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3069 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3071 return -ENOMEM; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3073 cmd = (struct wmi_therm_throt_config_request_cmd *)skb->data; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3075 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_THERM_THROT_CONFIG_REQUEST) | in ath11k_wmi_send_thermal_mitigation_param_cmd()
3076 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3078 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3079 cmd->enable = param->enable; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3080 cmd->dc = param->dc; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3081 cmd->dc_per_event = param->dc_per_event; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3082 cmd->therm_throt_levels = THERMAL_LEVELS; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3084 tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3085 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_thermal_mitigation_param_cmd()
3090 lvl_conf = (struct wmi_therm_throt_level_config_info *)(skb->data + in ath11k_wmi_send_thermal_mitigation_param_cmd()
3094 lvl_conf->tlv_header = in ath11k_wmi_send_thermal_mitigation_param_cmd()
3096 FIELD_PREP(WMI_TLV_LEN, sizeof(*lvl_conf) - TLV_HDR_SIZE); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3098 lvl_conf->temp_lwm = param->levelconf[i].tmplwm; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3099 lvl_conf->temp_hwm = param->levelconf[i].tmphwm; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3100 lvl_conf->dc_off_percent = param->levelconf[i].dcoffpercent; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3101 lvl_conf->prio = param->levelconf[i].priority; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3107 ath11k_warn(ar->ab, "failed to send THERM_THROT_SET_CONF cmd\n"); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3111 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_thermal_mitigation_param_cmd()
3113 ar->pdev->pdev_id, param->enable, param->dc, in ath11k_wmi_send_thermal_mitigation_param_cmd()
3114 param->dc_per_event, THERMAL_LEVELS); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3122 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_11d_scan_start_cmd()
3127 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_11d_scan_start_cmd()
3129 return -ENOMEM; in ath11k_wmi_send_11d_scan_start_cmd()
3131 cmd = (struct wmi_11d_scan_start_cmd *)skb->data; in ath11k_wmi_send_11d_scan_start_cmd()
3132 cmd->tlv_header = in ath11k_wmi_send_11d_scan_start_cmd()
3134 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_11d_scan_start_cmd()
3136 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_11d_scan_start_cmd()
3137 cmd->scan_period_msec = param->scan_period_msec; in ath11k_wmi_send_11d_scan_start_cmd()
3138 cmd->start_interval_msec = param->start_interval_msec; in ath11k_wmi_send_11d_scan_start_cmd()
3142 ath11k_warn(ar->ab, in ath11k_wmi_send_11d_scan_start_cmd()
3147 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_11d_scan_start_cmd()
3149 cmd->vdev_id, in ath11k_wmi_send_11d_scan_start_cmd()
3150 cmd->scan_period_msec, in ath11k_wmi_send_11d_scan_start_cmd()
3151 cmd->start_interval_msec); in ath11k_wmi_send_11d_scan_start_cmd()
3158 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_11d_scan_stop_cmd()
3163 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_11d_scan_stop_cmd()
3165 return -ENOMEM; in ath11k_wmi_send_11d_scan_stop_cmd()
3167 cmd = (struct wmi_11d_scan_stop_cmd *)skb->data; in ath11k_wmi_send_11d_scan_stop_cmd()
3168 cmd->tlv_header = in ath11k_wmi_send_11d_scan_stop_cmd()
3170 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_11d_scan_stop_cmd()
3172 cmd->vdev_id = vdev_id; in ath11k_wmi_send_11d_scan_stop_cmd()
3176 ath11k_warn(ar->ab, in ath11k_wmi_send_11d_scan_stop_cmd()
3181 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_11d_scan_stop_cmd()
3183 cmd->vdev_id); in ath11k_wmi_send_11d_scan_stop_cmd()
3190 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_pktlog_enable()
3195 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_pktlog_enable()
3197 return -ENOMEM; in ath11k_wmi_pdev_pktlog_enable()
3199 cmd = (struct wmi_pktlog_enable_cmd *)skb->data; in ath11k_wmi_pdev_pktlog_enable()
3201 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_ENABLE_CMD) | in ath11k_wmi_pdev_pktlog_enable()
3202 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_pktlog_enable()
3204 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_pktlog_enable()
3205 cmd->evlist = pktlog_filter; in ath11k_wmi_pdev_pktlog_enable()
3206 cmd->enable = ATH11K_WMI_PKTLOG_ENABLE_FORCE; in ath11k_wmi_pdev_pktlog_enable()
3211 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_enable()
3215 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog enable"); in ath11k_wmi_pdev_pktlog_enable()
3222 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_pktlog_disable()
3227 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_pktlog_disable()
3229 return -ENOMEM; in ath11k_wmi_pdev_pktlog_disable()
3231 cmd = (struct wmi_pktlog_disable_cmd *)skb->data; in ath11k_wmi_pdev_pktlog_disable()
3233 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_DISABLE_CMD) | in ath11k_wmi_pdev_pktlog_disable()
3234 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_pktlog_disable()
3236 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_pktlog_disable()
3241 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_disable()
3245 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog disable"); in ath11k_wmi_pdev_pktlog_disable()
3252 twt_params->sta_cong_timer_ms = ATH11K_TWT_DEF_STA_CONG_TIMER_MS; in ath11k_wmi_fill_default_twt_params()
3253 twt_params->default_slot_size = ATH11K_TWT_DEF_DEFAULT_SLOT_SIZE; in ath11k_wmi_fill_default_twt_params()
3254 twt_params->congestion_thresh_setup = ATH11K_TWT_DEF_CONGESTION_THRESH_SETUP; in ath11k_wmi_fill_default_twt_params()
3255 twt_params->congestion_thresh_teardown = in ath11k_wmi_fill_default_twt_params()
3257 twt_params->congestion_thresh_critical = in ath11k_wmi_fill_default_twt_params()
3259 twt_params->interference_thresh_teardown = in ath11k_wmi_fill_default_twt_params()
3261 twt_params->interference_thresh_setup = in ath11k_wmi_fill_default_twt_params()
3263 twt_params->min_no_sta_setup = ATH11K_TWT_DEF_MIN_NO_STA_SETUP; in ath11k_wmi_fill_default_twt_params()
3264 twt_params->min_no_sta_teardown = ATH11K_TWT_DEF_MIN_NO_STA_TEARDOWN; in ath11k_wmi_fill_default_twt_params()
3265 twt_params->no_of_bcast_mcast_slots = ATH11K_TWT_DEF_NO_OF_BCAST_MCAST_SLOTS; in ath11k_wmi_fill_default_twt_params()
3266 twt_params->min_no_twt_slots = ATH11K_TWT_DEF_MIN_NO_TWT_SLOTS; in ath11k_wmi_fill_default_twt_params()
3267 twt_params->max_no_sta_twt = ATH11K_TWT_DEF_MAX_NO_STA_TWT; in ath11k_wmi_fill_default_twt_params()
3268 twt_params->mode_check_interval = ATH11K_TWT_DEF_MODE_CHECK_INTERVAL; in ath11k_wmi_fill_default_twt_params()
3269 twt_params->add_sta_slot_interval = ATH11K_TWT_DEF_ADD_STA_SLOT_INTERVAL; in ath11k_wmi_fill_default_twt_params()
3270 twt_params->remove_sta_slot_interval = in ath11k_wmi_fill_default_twt_params()
3273 twt_params->mbss_support = 0; in ath11k_wmi_fill_default_twt_params()
3279 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_enable_cmd()
3280 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_enable_cmd()
3287 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_enable_cmd()
3289 return -ENOMEM; in ath11k_wmi_send_twt_enable_cmd()
3291 cmd = (struct wmi_twt_enable_params_cmd *)skb->data; in ath11k_wmi_send_twt_enable_cmd()
3292 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ENABLE_CMD) | in ath11k_wmi_send_twt_enable_cmd()
3293 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_enable_cmd()
3294 cmd->pdev_id = pdev_id; in ath11k_wmi_send_twt_enable_cmd()
3295 cmd->sta_cong_timer_ms = params->sta_cong_timer_ms; in ath11k_wmi_send_twt_enable_cmd()
3296 cmd->default_slot_size = params->default_slot_size; in ath11k_wmi_send_twt_enable_cmd()
3297 cmd->congestion_thresh_setup = params->congestion_thresh_setup; in ath11k_wmi_send_twt_enable_cmd()
3298 cmd->congestion_thresh_teardown = params->congestion_thresh_teardown; in ath11k_wmi_send_twt_enable_cmd()
3299 cmd->congestion_thresh_critical = params->congestion_thresh_critical; in ath11k_wmi_send_twt_enable_cmd()
3300 cmd->interference_thresh_teardown = params->interference_thresh_teardown; in ath11k_wmi_send_twt_enable_cmd()
3301 cmd->interference_thresh_setup = params->interference_thresh_setup; in ath11k_wmi_send_twt_enable_cmd()
3302 cmd->min_no_sta_setup = params->min_no_sta_setup; in ath11k_wmi_send_twt_enable_cmd()
3303 cmd->min_no_sta_teardown = params->min_no_sta_teardown; in ath11k_wmi_send_twt_enable_cmd()
3304 cmd->no_of_bcast_mcast_slots = params->no_of_bcast_mcast_slots; in ath11k_wmi_send_twt_enable_cmd()
3305 cmd->min_no_twt_slots = params->min_no_twt_slots; in ath11k_wmi_send_twt_enable_cmd()
3306 cmd->max_no_sta_twt = params->max_no_sta_twt; in ath11k_wmi_send_twt_enable_cmd()
3307 cmd->mode_check_interval = params->mode_check_interval; in ath11k_wmi_send_twt_enable_cmd()
3308 cmd->add_sta_slot_interval = params->add_sta_slot_interval; in ath11k_wmi_send_twt_enable_cmd()
3309 cmd->remove_sta_slot_interval = params->remove_sta_slot_interval; in ath11k_wmi_send_twt_enable_cmd()
3310 cmd->mbss_support = params->mbss_support; in ath11k_wmi_send_twt_enable_cmd()
3319 ar->twt_enabled = 1; in ath11k_wmi_send_twt_enable_cmd()
3329 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_disable_cmd()
3330 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_disable_cmd()
3337 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_disable_cmd()
3339 return -ENOMEM; in ath11k_wmi_send_twt_disable_cmd()
3341 cmd = (struct wmi_twt_disable_params_cmd *)skb->data; in ath11k_wmi_send_twt_disable_cmd()
3342 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_DISABLE_CMD) | in ath11k_wmi_send_twt_disable_cmd()
3343 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_disable_cmd()
3344 cmd->pdev_id = pdev_id; in ath11k_wmi_send_twt_disable_cmd()
3355 ar->twt_enabled = 0; in ath11k_wmi_send_twt_disable_cmd()
3363 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_add_dialog_cmd()
3364 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_add_dialog_cmd()
3371 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_add_dialog_cmd()
3373 return -ENOMEM; in ath11k_wmi_send_twt_add_dialog_cmd()
3375 cmd = (struct wmi_twt_add_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_add_dialog_cmd()
3376 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ADD_DIALOG_CMD) | in ath11k_wmi_send_twt_add_dialog_cmd()
3377 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_add_dialog_cmd()
3379 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_add_dialog_cmd()
3380 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_add_dialog_cmd()
3381 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_add_dialog_cmd()
3382 cmd->wake_intvl_us = params->wake_intvl_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3383 cmd->wake_intvl_mantis = params->wake_intvl_mantis; in ath11k_wmi_send_twt_add_dialog_cmd()
3384 cmd->wake_dura_us = params->wake_dura_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3385 cmd->sp_offset_us = params->sp_offset_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3386 cmd->flags = params->twt_cmd; in ath11k_wmi_send_twt_add_dialog_cmd()
3387 if (params->flag_bcast) in ath11k_wmi_send_twt_add_dialog_cmd()
3388 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_BCAST; in ath11k_wmi_send_twt_add_dialog_cmd()
3389 if (params->flag_trigger) in ath11k_wmi_send_twt_add_dialog_cmd()
3390 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_TRIGGER; in ath11k_wmi_send_twt_add_dialog_cmd()
3391 if (params->flag_flow_type) in ath11k_wmi_send_twt_add_dialog_cmd()
3392 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_FLOW_TYPE; in ath11k_wmi_send_twt_add_dialog_cmd()
3393 if (params->flag_protection) in ath11k_wmi_send_twt_add_dialog_cmd()
3394 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_PROTECTION; in ath11k_wmi_send_twt_add_dialog_cmd()
3405 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_add_dialog_cmd()
3407 cmd->vdev_id, cmd->dialog_id, cmd->wake_intvl_us, in ath11k_wmi_send_twt_add_dialog_cmd()
3408 cmd->wake_intvl_mantis, cmd->wake_dura_us, cmd->sp_offset_us, in ath11k_wmi_send_twt_add_dialog_cmd()
3409 cmd->flags); in ath11k_wmi_send_twt_add_dialog_cmd()
3417 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_del_dialog_cmd()
3418 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_del_dialog_cmd()
3425 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_del_dialog_cmd()
3427 return -ENOMEM; in ath11k_wmi_send_twt_del_dialog_cmd()
3429 cmd = (struct wmi_twt_del_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_del_dialog_cmd()
3430 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_DEL_DIALOG_CMD) | in ath11k_wmi_send_twt_del_dialog_cmd()
3431 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_del_dialog_cmd()
3433 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_del_dialog_cmd()
3434 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_del_dialog_cmd()
3435 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_del_dialog_cmd()
3446 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_del_dialog_cmd()
3448 cmd->vdev_id, cmd->dialog_id); in ath11k_wmi_send_twt_del_dialog_cmd()
3456 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_pause_dialog_cmd()
3457 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_pause_dialog_cmd()
3464 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_pause_dialog_cmd()
3466 return -ENOMEM; in ath11k_wmi_send_twt_pause_dialog_cmd()
3468 cmd = (struct wmi_twt_pause_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_pause_dialog_cmd()
3469 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_twt_pause_dialog_cmd()
3471 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_pause_dialog_cmd()
3473 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_pause_dialog_cmd()
3474 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_pause_dialog_cmd()
3475 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_pause_dialog_cmd()
3486 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_pause_dialog_cmd()
3488 cmd->vdev_id, cmd->dialog_id); in ath11k_wmi_send_twt_pause_dialog_cmd()
3496 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_resume_dialog_cmd()
3497 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_resume_dialog_cmd()
3504 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_resume_dialog_cmd()
3506 return -ENOMEM; in ath11k_wmi_send_twt_resume_dialog_cmd()
3508 cmd = (struct wmi_twt_resume_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_resume_dialog_cmd()
3509 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_twt_resume_dialog_cmd()
3511 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_resume_dialog_cmd()
3513 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_resume_dialog_cmd()
3514 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_resume_dialog_cmd()
3515 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_resume_dialog_cmd()
3516 cmd->sp_offset_us = params->sp_offset_us; in ath11k_wmi_send_twt_resume_dialog_cmd()
3517 cmd->next_twt_size = params->next_twt_size; in ath11k_wmi_send_twt_resume_dialog_cmd()
3528 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_resume_dialog_cmd()
3530 cmd->vdev_id, cmd->dialog_id, cmd->sp_offset_us, in ath11k_wmi_send_twt_resume_dialog_cmd()
3531 cmd->next_twt_size); in ath11k_wmi_send_twt_resume_dialog_cmd()
3540 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_obss_spr_cmd()
3541 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_spr_cmd()
3548 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_obss_spr_cmd()
3550 return -ENOMEM; in ath11k_wmi_send_obss_spr_cmd()
3552 cmd = (struct wmi_obss_spatial_reuse_params_cmd *)skb->data; in ath11k_wmi_send_obss_spr_cmd()
3553 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_obss_spr_cmd()
3555 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_obss_spr_cmd()
3556 cmd->vdev_id = vdev_id; in ath11k_wmi_send_obss_spr_cmd()
3557 cmd->enable = he_obss_pd->enable; in ath11k_wmi_send_obss_spr_cmd()
3558 cmd->obss_min = he_obss_pd->min_offset; in ath11k_wmi_send_obss_spr_cmd()
3559 cmd->obss_max = he_obss_pd->max_offset; in ath11k_wmi_send_obss_spr_cmd()
3578 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3579 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3586 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3588 return -ENOMEM; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3590 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3591 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3593 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3594 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3595 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3606 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3608 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3616 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3617 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3624 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3626 return -ENOMEM; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3628 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3629 cmd->tlv_header = in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3632 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3633 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3634 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3645 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3647 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3655 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3656 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3663 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3665 return -ENOMEM; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3667 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3668 cmd->tlv_header = in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3671 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3672 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3673 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3684 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3686 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3694 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3695 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3702 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3704 return -ENOMEM; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3706 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3707 cmd->tlv_header = in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3710 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3711 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3712 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3723 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3725 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3733 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3734 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3741 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3743 return -ENOMEM; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3745 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3746 cmd->tlv_header = in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3749 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3750 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3751 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3762 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3764 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3772 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3773 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3780 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3782 return -ENOMEM; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3784 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3785 cmd->tlv_header = in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3788 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3789 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3790 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3801 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3803 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3813 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3814 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3821 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3823 return -ENOMEM; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3825 cmd = (struct wmi_obss_color_collision_cfg_params_cmd *)skb->data; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3826 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3828 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3829 cmd->vdev_id = vdev_id; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3830 cmd->evt_type = enable ? ATH11K_OBSS_COLOR_COLLISION_DETECTION : in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3832 cmd->current_bss_color = bss_color; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3833 cmd->detection_period_ms = period; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3834 cmd->scan_period_ms = ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3835 cmd->free_slot_expiry_time_ms = 0; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3836 cmd->flags = 0; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3846 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3848 cmd->vdev_id, cmd->evt_type, cmd->current_bss_color, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3849 cmd->detection_period_ms, cmd->scan_period_ms); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3857 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_bss_color_change_enable_cmd()
3858 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_bss_color_change_enable_cmd()
3865 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_bss_color_change_enable_cmd()
3867 return -ENOMEM; in ath11k_wmi_send_bss_color_change_enable_cmd()
3869 cmd = (struct wmi_bss_color_change_enable_params_cmd *)skb->data; in ath11k_wmi_send_bss_color_change_enable_cmd()
3870 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_BSS_COLOR_CHANGE_ENABLE) | in ath11k_wmi_send_bss_color_change_enable_cmd()
3871 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_bss_color_change_enable_cmd()
3872 cmd->vdev_id = vdev_id; in ath11k_wmi_send_bss_color_change_enable_cmd()
3873 cmd->enable = enable ? 1 : 0; in ath11k_wmi_send_bss_color_change_enable_cmd()
3883 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bss_color_change_enable_cmd()
3885 cmd->vdev_id, cmd->enable); in ath11k_wmi_send_bss_color_change_enable_cmd()
3900 aligned_len = roundup(tmpl->len, 4); in ath11k_wmi_fils_discovery_tmpl()
3903 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery_tmpl()
3906 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_fils_discovery_tmpl()
3908 return -ENOMEM; in ath11k_wmi_fils_discovery_tmpl()
3910 cmd = (struct wmi_fils_discovery_tmpl_cmd *)skb->data; in ath11k_wmi_fils_discovery_tmpl()
3911 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_fils_discovery_tmpl()
3913 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_fils_discovery_tmpl()
3914 cmd->vdev_id = vdev_id; in ath11k_wmi_fils_discovery_tmpl()
3915 cmd->buf_len = tmpl->len; in ath11k_wmi_fils_discovery_tmpl()
3916 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_fils_discovery_tmpl()
3919 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_fils_discovery_tmpl()
3921 memcpy(tlv->value, tmpl->data, tmpl->len); in ath11k_wmi_fils_discovery_tmpl()
3923 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_FILS_DISCOVERY_TMPL_CMDID); in ath11k_wmi_fils_discovery_tmpl()
3925 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery_tmpl()
3932 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd fils discovery tmpl"); in ath11k_wmi_fils_discovery_tmpl()
3946 size_t aligned_len = roundup(tmpl->len, 4); in ath11k_wmi_probe_resp_tmpl()
3948 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_probe_resp_tmpl()
3953 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_probe_resp_tmpl()
3955 return -ENOMEM; in ath11k_wmi_probe_resp_tmpl()
3957 cmd = (struct wmi_probe_tmpl_cmd *)skb->data; in ath11k_wmi_probe_resp_tmpl()
3958 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PRB_TMPL_CMD) | in ath11k_wmi_probe_resp_tmpl()
3959 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_probe_resp_tmpl()
3960 cmd->vdev_id = vdev_id; in ath11k_wmi_probe_resp_tmpl()
3961 cmd->buf_len = tmpl->len; in ath11k_wmi_probe_resp_tmpl()
3963 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_probe_resp_tmpl()
3967 probe_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_probe_resp_tmpl()
3969 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_probe_resp_tmpl()
3970 probe_info->caps = 0; in ath11k_wmi_probe_resp_tmpl()
3971 probe_info->erp = 0; in ath11k_wmi_probe_resp_tmpl()
3976 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_probe_resp_tmpl()
3978 memcpy(tlv->value, tmpl->data, tmpl->len); in ath11k_wmi_probe_resp_tmpl()
3980 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_PRB_TMPL_CMDID); in ath11k_wmi_probe_resp_tmpl()
3982 ath11k_warn(ar->ab, in ath11k_wmi_probe_resp_tmpl()
3989 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd "); in ath11k_wmi_probe_resp_tmpl()
4001 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery()
4008 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_fils_discovery()
4010 return -ENOMEM; in ath11k_wmi_fils_discovery()
4012 cmd = (struct wmi_fils_discovery_cmd *)skb->data; in ath11k_wmi_fils_discovery()
4013 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ENABLE_FILS_CMD) | in ath11k_wmi_fils_discovery()
4014 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_fils_discovery()
4015 cmd->vdev_id = vdev_id; in ath11k_wmi_fils_discovery()
4016 cmd->interval = interval; in ath11k_wmi_fils_discovery()
4017 cmd->config = unsol_bcast_probe_resp_enabled; in ath11k_wmi_fils_discovery()
4019 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_ENABLE_FILS_CMDID); in ath11k_wmi_fils_discovery()
4021 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery()
4028 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd enable fils"); in ath11k_wmi_fils_discovery()
4058 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); in ath11k_wmi_obss_color_collision_event()
4061 ev->vdev_id); in ath11k_wmi_obss_color_collision_event()
4065 switch (ev->evt_type) { in ath11k_wmi_obss_color_collision_event()
4067 ieee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap, in ath11k_wmi_obss_color_collision_event()
4071 ev->vdev_id, ev->evt_type, ev->obss_color_bitmap); in ath11k_wmi_obss_color_collision_event()
4094 for (i = 0; i < soc->num_radios; i++) { in ath11k_fill_band_to_mac_param()
4095 pdev = &soc->pdevs[i]; in ath11k_fill_band_to_mac_param()
4096 hal_reg_cap = &soc->hal_reg_cap[i]; in ath11k_fill_band_to_mac_param()
4097 band_to_mac[i].pdev_id = pdev->pdev_id; in ath11k_fill_band_to_mac_param()
4099 switch (pdev->cap.supported_bands) { in ath11k_fill_band_to_mac_param()
4101 band_to_mac[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath11k_fill_band_to_mac_param()
4102 band_to_mac[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath11k_fill_band_to_mac_param()
4105 band_to_mac[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath11k_fill_band_to_mac_param()
4106 band_to_mac[i].end_freq = hal_reg_cap->high_2ghz_chan; in ath11k_fill_band_to_mac_param()
4109 band_to_mac[i].start_freq = hal_reg_cap->low_5ghz_chan; in ath11k_fill_band_to_mac_param()
4110 band_to_mac[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath11k_fill_band_to_mac_param()
4122 wmi_cfg->num_vdevs = tg_cfg->num_vdevs; in ath11k_wmi_copy_resource_config()
4123 wmi_cfg->num_peers = tg_cfg->num_peers; in ath11k_wmi_copy_resource_config()
4124 wmi_cfg->num_offload_peers = tg_cfg->num_offload_peers; in ath11k_wmi_copy_resource_config()
4125 wmi_cfg->num_offload_reorder_buffs = tg_cfg->num_offload_reorder_buffs; in ath11k_wmi_copy_resource_config()
4126 wmi_cfg->num_peer_keys = tg_cfg->num_peer_keys; in ath11k_wmi_copy_resource_config()
4127 wmi_cfg->num_tids = tg_cfg->num_tids; in ath11k_wmi_copy_resource_config()
4128 wmi_cfg->ast_skid_limit = tg_cfg->ast_skid_limit; in ath11k_wmi_copy_resource_config()
4129 wmi_cfg->tx_chain_mask = tg_cfg->tx_chain_mask; in ath11k_wmi_copy_resource_config()
4130 wmi_cfg->rx_chain_mask = tg_cfg->rx_chain_mask; in ath11k_wmi_copy_resource_config()
4131 wmi_cfg->rx_timeout_pri[0] = tg_cfg->rx_timeout_pri[0]; in ath11k_wmi_copy_resource_config()
4132 wmi_cfg->rx_timeout_pri[1] = tg_cfg->rx_timeout_pri[1]; in ath11k_wmi_copy_resource_config()
4133 wmi_cfg->rx_timeout_pri[2] = tg_cfg->rx_timeout_pri[2]; in ath11k_wmi_copy_resource_config()
4134 wmi_cfg->rx_timeout_pri[3] = tg_cfg->rx_timeout_pri[3]; in ath11k_wmi_copy_resource_config()
4135 wmi_cfg->rx_decap_mode = tg_cfg->rx_decap_mode; in ath11k_wmi_copy_resource_config()
4136 wmi_cfg->scan_max_pending_req = tg_cfg->scan_max_pending_req; in ath11k_wmi_copy_resource_config()
4137 wmi_cfg->bmiss_offload_max_vdev = tg_cfg->bmiss_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4138 wmi_cfg->roam_offload_max_vdev = tg_cfg->roam_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4139 wmi_cfg->roam_offload_max_ap_profiles = in ath11k_wmi_copy_resource_config()
4140 tg_cfg->roam_offload_max_ap_profiles; in ath11k_wmi_copy_resource_config()
4141 wmi_cfg->num_mcast_groups = tg_cfg->num_mcast_groups; in ath11k_wmi_copy_resource_config()
4142 wmi_cfg->num_mcast_table_elems = tg_cfg->num_mcast_table_elems; in ath11k_wmi_copy_resource_config()
4143 wmi_cfg->mcast2ucast_mode = tg_cfg->mcast2ucast_mode; in ath11k_wmi_copy_resource_config()
4144 wmi_cfg->tx_dbg_log_size = tg_cfg->tx_dbg_log_size; in ath11k_wmi_copy_resource_config()
4145 wmi_cfg->num_wds_entries = tg_cfg->num_wds_entries; in ath11k_wmi_copy_resource_config()
4146 wmi_cfg->dma_burst_size = tg_cfg->dma_burst_size; in ath11k_wmi_copy_resource_config()
4147 wmi_cfg->mac_aggr_delim = tg_cfg->mac_aggr_delim; in ath11k_wmi_copy_resource_config()
4148 wmi_cfg->rx_skip_defrag_timeout_dup_detection_check = in ath11k_wmi_copy_resource_config()
4149 tg_cfg->rx_skip_defrag_timeout_dup_detection_check; in ath11k_wmi_copy_resource_config()
4150 wmi_cfg->vow_config = tg_cfg->vow_config; in ath11k_wmi_copy_resource_config()
4151 wmi_cfg->gtk_offload_max_vdev = tg_cfg->gtk_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4152 wmi_cfg->num_msdu_desc = tg_cfg->num_msdu_desc; in ath11k_wmi_copy_resource_config()
4153 wmi_cfg->max_frag_entries = tg_cfg->max_frag_entries; in ath11k_wmi_copy_resource_config()
4154 wmi_cfg->num_tdls_vdevs = tg_cfg->num_tdls_vdevs; in ath11k_wmi_copy_resource_config()
4155 wmi_cfg->num_tdls_conn_table_entries = in ath11k_wmi_copy_resource_config()
4156 tg_cfg->num_tdls_conn_table_entries; in ath11k_wmi_copy_resource_config()
4157 wmi_cfg->beacon_tx_offload_max_vdev = in ath11k_wmi_copy_resource_config()
4158 tg_cfg->beacon_tx_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4159 wmi_cfg->num_multicast_filter_entries = in ath11k_wmi_copy_resource_config()
4160 tg_cfg->num_multicast_filter_entries; in ath11k_wmi_copy_resource_config()
4161 wmi_cfg->num_wow_filters = tg_cfg->num_wow_filters; in ath11k_wmi_copy_resource_config()
4162 wmi_cfg->num_keep_alive_pattern = tg_cfg->num_keep_alive_pattern; in ath11k_wmi_copy_resource_config()
4163 wmi_cfg->keep_alive_pattern_size = tg_cfg->keep_alive_pattern_size; in ath11k_wmi_copy_resource_config()
4164 wmi_cfg->max_tdls_concurrent_sleep_sta = in ath11k_wmi_copy_resource_config()
4165 tg_cfg->max_tdls_concurrent_sleep_sta; in ath11k_wmi_copy_resource_config()
4166 wmi_cfg->max_tdls_concurrent_buffer_sta = in ath11k_wmi_copy_resource_config()
4167 tg_cfg->max_tdls_concurrent_buffer_sta; in ath11k_wmi_copy_resource_config()
4168 wmi_cfg->wmi_send_separate = tg_cfg->wmi_send_separate; in ath11k_wmi_copy_resource_config()
4169 wmi_cfg->num_ocb_vdevs = tg_cfg->num_ocb_vdevs; in ath11k_wmi_copy_resource_config()
4170 wmi_cfg->num_ocb_channels = tg_cfg->num_ocb_channels; in ath11k_wmi_copy_resource_config()
4171 wmi_cfg->num_ocb_schedules = tg_cfg->num_ocb_schedules; in ath11k_wmi_copy_resource_config()
4172 wmi_cfg->bpf_instruction_size = tg_cfg->bpf_instruction_size; in ath11k_wmi_copy_resource_config()
4173 wmi_cfg->max_bssid_rx_filters = tg_cfg->max_bssid_rx_filters; in ath11k_wmi_copy_resource_config()
4174 wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id; in ath11k_wmi_copy_resource_config()
4175 wmi_cfg->flag1 = tg_cfg->flag1; in ath11k_wmi_copy_resource_config()
4176 wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support; in ath11k_wmi_copy_resource_config()
4177 wmi_cfg->sched_params = tg_cfg->sched_params; in ath11k_wmi_copy_resource_config()
4178 wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; in ath11k_wmi_copy_resource_config()
4179 wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count; in ath11k_wmi_copy_resource_config()
4180 wmi_cfg->host_service_flags &= in ath11k_wmi_copy_resource_config()
4182 wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported << in ath11k_wmi_copy_resource_config()
4184 wmi_cfg->flags2 = WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET; in ath11k_wmi_copy_resource_config()
4185 wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt; in ath11k_wmi_copy_resource_config()
4186 wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period; in ath11k_wmi_copy_resource_config()
4192 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_init_cmd_send()
4205 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) in ath11k_init_cmd_send()
4207 (param->num_band_to_mac * sizeof(*band_to_mac)); in ath11k_init_cmd_send()
4210 (param->num_mem_chunks ? (sizeof(*host_mem_chunks) * WMI_MAX_MEM_REQS) : 0); in ath11k_init_cmd_send()
4212 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_init_cmd_send()
4214 return -ENOMEM; in ath11k_init_cmd_send()
4216 cmd = (struct wmi_init_cmd *)skb->data; in ath11k_init_cmd_send()
4218 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_INIT_CMD) | in ath11k_init_cmd_send()
4219 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4221 ptr = skb->data + sizeof(*cmd); in ath11k_init_cmd_send()
4224 ath11k_wmi_copy_resource_config(cfg, param->res_cfg); in ath11k_init_cmd_send()
4226 cfg->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_RESOURCE_CONFIG) | in ath11k_init_cmd_send()
4227 FIELD_PREP(WMI_TLV_LEN, sizeof(*cfg) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4233 for (idx = 0; idx < param->num_mem_chunks; ++idx) { in ath11k_init_cmd_send()
4239 host_mem_chunks[idx].ptr = param->mem_chunks[idx].paddr; in ath11k_init_cmd_send()
4240 host_mem_chunks[idx].size = param->mem_chunks[idx].len; in ath11k_init_cmd_send()
4241 host_mem_chunks[idx].req_id = param->mem_chunks[idx].req_id; in ath11k_init_cmd_send()
4245 param->mem_chunks[idx].req_id, in ath11k_init_cmd_send()
4246 (u64)param->mem_chunks[idx].paddr, in ath11k_init_cmd_send()
4247 param->mem_chunks[idx].len); in ath11k_init_cmd_send()
4249 cmd->num_host_mem_chunks = param->num_mem_chunks; in ath11k_init_cmd_send()
4250 len = sizeof(struct wlan_host_mem_chunk) * param->num_mem_chunks; in ath11k_init_cmd_send()
4254 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_init_cmd_send()
4258 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) { in ath11k_init_cmd_send()
4260 hw_mode->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_init_cmd_send()
4263 sizeof(*hw_mode) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4265 hw_mode->hw_mode_index = param->hw_mode_id; in ath11k_init_cmd_send()
4266 hw_mode->num_band_to_mac = param->num_band_to_mac; in ath11k_init_cmd_send()
4270 len = param->num_band_to_mac * sizeof(*band_to_mac); in ath11k_init_cmd_send()
4272 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_init_cmd_send()
4278 for (idx = 0; idx < param->num_band_to_mac; idx++) { in ath11k_init_cmd_send()
4281 band_to_mac->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_init_cmd_send()
4284 len - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4285 band_to_mac->pdev_id = param->band_to_mac[idx].pdev_id; in ath11k_init_cmd_send()
4286 band_to_mac->start_freq = in ath11k_init_cmd_send()
4287 param->band_to_mac[idx].start_freq; in ath11k_init_cmd_send()
4288 band_to_mac->end_freq = in ath11k_init_cmd_send()
4289 param->band_to_mac[idx].end_freq; in ath11k_init_cmd_send()
4313 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_lro_cfg()
4315 return -ENOMEM; in ath11k_wmi_pdev_lro_cfg()
4317 cmd = (struct ath11k_wmi_pdev_lro_config_cmd *)skb->data; in ath11k_wmi_pdev_lro_cfg()
4318 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_LRO_INFO_CMD) | in ath11k_wmi_pdev_lro_cfg()
4319 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_lro_cfg()
4321 get_random_bytes(cmd->th_4, sizeof(uint32_t) * ATH11K_IPV4_TH_SEED_SIZE); in ath11k_wmi_pdev_lro_cfg()
4322 get_random_bytes(cmd->th_6, sizeof(uint32_t) * ATH11K_IPV6_TH_SEED_SIZE); in ath11k_wmi_pdev_lro_cfg()
4324 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_lro_cfg()
4326 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_LRO_CONFIG_CMDID); in ath11k_wmi_pdev_lro_cfg()
4328 ath11k_warn(ar->ab, in ath11k_wmi_pdev_lro_cfg()
4333 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_lro_cfg()
4345 time_left = wait_for_completion_timeout(&ab->wmi_ab.service_ready, in ath11k_wmi_wait_for_service_ready()
4348 return -ETIMEDOUT; in ath11k_wmi_wait_for_service_ready()
4357 time_left = wait_for_completion_timeout(&ab->wmi_ab.unified_ready, in ath11k_wmi_wait_for_unified_ready()
4360 return -ETIMEDOUT; in ath11k_wmi_wait_for_unified_ready()
4370 struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab; in ath11k_wmi_set_hw_mode()
4378 return -ENOMEM; in ath11k_wmi_set_hw_mode()
4380 cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data; in ath11k_wmi_set_hw_mode()
4382 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) | in ath11k_wmi_set_hw_mode()
4383 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_hw_mode()
4385 cmd->pdev_id = WMI_PDEV_ID_SOC; in ath11k_wmi_set_hw_mode()
4386 cmd->hw_mode_index = mode; in ath11k_wmi_set_hw_mode()
4388 ret = ath11k_wmi_cmd_send(&wmi_ab->wmi[0], skb, WMI_PDEV_SET_HW_MODE_CMDID); in ath11k_wmi_set_hw_mode()
4395 ath11k_dbg(ab, ATH11K_DBG_WMI, "cmd pdev set hw mode %d", cmd->hw_mode_index); in ath11k_wmi_set_hw_mode()
4402 struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab; in ath11k_wmi_cmd_init()
4409 ab->hw_params.hw_ops->wmi_init_config(ab, &config); in ath11k_wmi_cmd_init()
4412 ab->wmi_ab.svc_map)) in ath11k_wmi_cmd_init()
4415 memcpy(&wmi_ab->wlan_resource_config, &config, sizeof(config)); in ath11k_wmi_cmd_init()
4417 init_param.res_cfg = &wmi_ab->wlan_resource_config; in ath11k_wmi_cmd_init()
4418 init_param.num_mem_chunks = wmi_ab->num_mem_chunks; in ath11k_wmi_cmd_init()
4419 init_param.hw_mode_id = wmi_ab->preferred_hw_mode; in ath11k_wmi_cmd_init()
4420 init_param.mem_chunks = wmi_ab->mem_chunks; in ath11k_wmi_cmd_init()
4422 if (ab->hw_params.single_pdev_only) in ath11k_wmi_cmd_init()
4425 init_param.num_band_to_mac = ab->num_radios; in ath11k_wmi_cmd_init()
4428 return ath11k_init_cmd_send(&wmi_ab->wmi[0], &init_param); in ath11k_wmi_cmd_init()
4438 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_spectral_conf()
4440 return -ENOMEM; in ath11k_wmi_vdev_spectral_conf()
4442 cmd = (struct ath11k_wmi_vdev_spectral_conf_cmd *)skb->data; in ath11k_wmi_vdev_spectral_conf()
4443 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_spectral_conf()
4445 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_spectral_conf()
4447 memcpy(&cmd->param, param, sizeof(*param)); in ath11k_wmi_vdev_spectral_conf()
4449 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_vdev_spectral_conf()
4452 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_conf()
4457 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_conf()
4459 param->vdev_id); in ath11k_wmi_vdev_spectral_conf()
4474 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_spectral_enable()
4476 return -ENOMEM; in ath11k_wmi_vdev_spectral_enable()
4478 cmd = (struct ath11k_wmi_vdev_spectral_enable_cmd *)skb->data; in ath11k_wmi_vdev_spectral_enable()
4479 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_spectral_enable()
4481 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_spectral_enable()
4483 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_spectral_enable()
4484 cmd->trigger_cmd = trigger; in ath11k_wmi_vdev_spectral_enable()
4485 cmd->enable_cmd = enable; in ath11k_wmi_vdev_spectral_enable()
4487 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_vdev_spectral_enable()
4490 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_enable()
4495 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_enable()
4512 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_dma_ring_cfg()
4514 return -ENOMEM; in ath11k_wmi_pdev_dma_ring_cfg()
4516 cmd = (struct ath11k_wmi_pdev_dma_ring_cfg_req_cmd *)skb->data; in ath11k_wmi_pdev_dma_ring_cfg()
4517 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DMA_RING_CFG_REQ) | in ath11k_wmi_pdev_dma_ring_cfg()
4518 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_dma_ring_cfg()
4520 cmd->pdev_id = param->pdev_id; in ath11k_wmi_pdev_dma_ring_cfg()
4521 cmd->module_id = param->module_id; in ath11k_wmi_pdev_dma_ring_cfg()
4522 cmd->base_paddr_lo = param->base_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4523 cmd->base_paddr_hi = param->base_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4524 cmd->head_idx_paddr_lo = param->head_idx_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4525 cmd->head_idx_paddr_hi = param->head_idx_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4526 cmd->tail_idx_paddr_lo = param->tail_idx_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4527 cmd->tail_idx_paddr_hi = param->tail_idx_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4528 cmd->num_elems = param->num_elems; in ath11k_wmi_pdev_dma_ring_cfg()
4529 cmd->buf_size = param->buf_size; in ath11k_wmi_pdev_dma_ring_cfg()
4530 cmd->num_resp_per_event = param->num_resp_per_event; in ath11k_wmi_pdev_dma_ring_cfg()
4531 cmd->event_timeout_ms = param->event_timeout_ms; in ath11k_wmi_pdev_dma_ring_cfg()
4533 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_pdev_dma_ring_cfg()
4536 ath11k_warn(ar->ab, in ath11k_wmi_pdev_dma_ring_cfg()
4541 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_dma_ring_cfg()
4543 param->pdev_id); in ath11k_wmi_pdev_dma_ring_cfg()
4558 return -EPROTO; in ath11k_wmi_tlv_dma_buf_entry_parse()
4560 if (parse->num_buf_entry >= parse->fixed.num_buf_release_entry) in ath11k_wmi_tlv_dma_buf_entry_parse()
4561 return -ENOBUFS; in ath11k_wmi_tlv_dma_buf_entry_parse()
4563 parse->num_buf_entry++; in ath11k_wmi_tlv_dma_buf_entry_parse()
4574 return -EPROTO; in ath11k_wmi_tlv_dma_buf_meta_parse()
4576 if (parse->num_meta >= parse->fixed.num_meta_data_entry) in ath11k_wmi_tlv_dma_buf_meta_parse()
4577 return -ENOBUFS; in ath11k_wmi_tlv_dma_buf_meta_parse()
4579 parse->num_meta++; in ath11k_wmi_tlv_dma_buf_meta_parse()
4592 memcpy(&parse->fixed, ptr, in ath11k_wmi_tlv_dma_buf_parse()
4594 parse->fixed.pdev_id = DP_HW2SW_MACID(parse->fixed.pdev_id); in ath11k_wmi_tlv_dma_buf_parse()
4597 if (!parse->buf_entry_done) { in ath11k_wmi_tlv_dma_buf_parse()
4598 parse->num_buf_entry = 0; in ath11k_wmi_tlv_dma_buf_parse()
4599 parse->buf_entry = (struct wmi_dma_buf_release_entry *)ptr; in ath11k_wmi_tlv_dma_buf_parse()
4610 parse->buf_entry_done = true; in ath11k_wmi_tlv_dma_buf_parse()
4611 } else if (!parse->meta_data_done) { in ath11k_wmi_tlv_dma_buf_parse()
4612 parse->num_meta = 0; in ath11k_wmi_tlv_dma_buf_parse()
4613 parse->meta_data = (struct wmi_dma_buf_release_meta_data *)ptr; in ath11k_wmi_tlv_dma_buf_parse()
4624 parse->meta_data_done = true; in ath11k_wmi_tlv_dma_buf_parse()
4640 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pdev_dma_ring_buf_release_event()
4672 return -EPROTO; in ath11k_wmi_tlv_hw_mode_caps_parse()
4674 if (svc_rdy_ext->n_hw_mode_caps >= svc_rdy_ext->param.num_hw_modes) in ath11k_wmi_tlv_hw_mode_caps_parse()
4675 return -ENOBUFS; in ath11k_wmi_tlv_hw_mode_caps_parse()
4679 svc_rdy_ext->n_hw_mode_caps++; in ath11k_wmi_tlv_hw_mode_caps_parse()
4681 phy_map = hw_mode_cap->phy_id_map; in ath11k_wmi_tlv_hw_mode_caps_parse()
4683 svc_rdy_ext->tot_phy_id++; in ath11k_wmi_tlv_hw_mode_caps_parse()
4699 svc_rdy_ext->n_hw_mode_caps = 0; in ath11k_wmi_tlv_hw_mode_caps()
4700 svc_rdy_ext->hw_mode_caps = (struct wmi_hw_mode_capabilities *)ptr; in ath11k_wmi_tlv_hw_mode_caps()
4711 while (i < svc_rdy_ext->n_hw_mode_caps) { in ath11k_wmi_tlv_hw_mode_caps()
4712 hw_mode_caps = &svc_rdy_ext->hw_mode_caps[i]; in ath11k_wmi_tlv_hw_mode_caps()
4713 mode = hw_mode_caps->hw_mode_id; in ath11k_wmi_tlv_hw_mode_caps()
4714 pref = soc->wmi_ab.preferred_hw_mode; in ath11k_wmi_tlv_hw_mode_caps()
4717 svc_rdy_ext->pref_hw_mode_caps = *hw_mode_caps; in ath11k_wmi_tlv_hw_mode_caps()
4718 soc->wmi_ab.preferred_hw_mode = mode; in ath11k_wmi_tlv_hw_mode_caps()
4724 soc->wmi_ab.preferred_hw_mode); in ath11k_wmi_tlv_hw_mode_caps()
4725 if (soc->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_MAX) in ath11k_wmi_tlv_hw_mode_caps()
4726 return -EINVAL; in ath11k_wmi_tlv_hw_mode_caps()
4738 return -EPROTO; in ath11k_wmi_tlv_mac_phy_caps_parse()
4740 if (svc_rdy_ext->n_mac_phy_caps >= svc_rdy_ext->tot_phy_id) in ath11k_wmi_tlv_mac_phy_caps_parse()
4741 return -ENOBUFS; in ath11k_wmi_tlv_mac_phy_caps_parse()
4744 if (!svc_rdy_ext->n_mac_phy_caps) { in ath11k_wmi_tlv_mac_phy_caps_parse()
4745 svc_rdy_ext->mac_phy_caps = kcalloc(svc_rdy_ext->tot_phy_id, in ath11k_wmi_tlv_mac_phy_caps_parse()
4747 if (!svc_rdy_ext->mac_phy_caps) in ath11k_wmi_tlv_mac_phy_caps_parse()
4748 return -ENOMEM; in ath11k_wmi_tlv_mac_phy_caps_parse()
4751 memcpy(svc_rdy_ext->mac_phy_caps + svc_rdy_ext->n_mac_phy_caps, ptr, len); in ath11k_wmi_tlv_mac_phy_caps_parse()
4752 svc_rdy_ext->n_mac_phy_caps++; in ath11k_wmi_tlv_mac_phy_caps_parse()
4763 return -EPROTO; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4765 if (svc_rdy_ext->n_ext_hal_reg_caps >= svc_rdy_ext->param.num_phy) in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4766 return -ENOBUFS; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4768 svc_rdy_ext->n_ext_hal_reg_caps++; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4775 struct ath11k_pdev_wmi *wmi_handle = &soc->wmi_ab.wmi[0]; in ath11k_wmi_tlv_ext_hal_reg_caps()
4781 svc_rdy_ext->n_ext_hal_reg_caps = 0; in ath11k_wmi_tlv_ext_hal_reg_caps()
4782 svc_rdy_ext->ext_hal_reg_caps = (struct wmi_hal_reg_capabilities_ext *)ptr; in ath11k_wmi_tlv_ext_hal_reg_caps()
4791 for (i = 0; i < svc_rdy_ext->param.num_phy; i++) { in ath11k_wmi_tlv_ext_hal_reg_caps()
4793 svc_rdy_ext->soc_hal_reg_caps, in ath11k_wmi_tlv_ext_hal_reg_caps()
4794 svc_rdy_ext->ext_hal_reg_caps, i, in ath11k_wmi_tlv_ext_hal_reg_caps()
4801 memcpy(&soc->hal_reg_cap[reg_cap.phy_id], in ath11k_wmi_tlv_ext_hal_reg_caps()
4811 struct ath11k_pdev_wmi *wmi_handle = &soc->wmi_ab.wmi[0]; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4813 u8 hw_mode_id = svc_rdy_ext->pref_hw_mode_caps.hw_mode_id; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4818 svc_rdy_ext->soc_hal_reg_caps = (struct wmi_soc_hal_reg_capabilities *)ptr; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4819 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()
4821 soc->num_radios = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4822 soc->target_pdev_count = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4823 phy_id_map = svc_rdy_ext->pref_hw_mode_caps.phy_id_map; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4825 while (phy_id_map && soc->num_radios < MAX_RADIOS) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4827 svc_rdy_ext->hw_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4828 svc_rdy_ext->hw_mode_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4829 svc_rdy_ext->soc_hal_reg_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4830 svc_rdy_ext->mac_phy_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4831 hw_mode_id, soc->num_radios, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4832 &soc->pdevs[pdev_index]); in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4835 soc->num_radios); in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4839 soc->num_radios++; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4842 if (soc->hw_params.single_pdev_only) in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4845 pdev_index = soc->num_radios; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4855 if (soc->hw_params.single_pdev_only) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4856 soc->num_radios = 1; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4857 soc->pdevs[0].pdev_id = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4860 if (!soc->reg_info_store) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4861 soc->reg_info_store = kcalloc(soc->num_radios, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4862 sizeof(*soc->reg_info_store), in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4864 if (!soc->reg_info_store) in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4865 return -ENOMEM; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4878 return -EPROTO; in ath11k_wmi_tlv_dma_ring_caps_parse()
4880 parse->n_dma_ring_caps++; in ath11k_wmi_tlv_dma_ring_caps_parse()
4893 return -ENOMEM; in ath11k_wmi_alloc_dbring_caps()
4895 ab->db_caps = ptr; in ath11k_wmi_alloc_dbring_caps()
4896 ab->num_db_cap = num_cap; in ath11k_wmi_alloc_dbring_caps()
4903 kfree(ab->db_caps); in ath11k_wmi_free_dbring_caps()
4904 ab->db_caps = NULL; in ath11k_wmi_free_dbring_caps()
4905 ab->num_db_cap = 0; in ath11k_wmi_free_dbring_caps()
4917 dma_caps_parse->n_dma_ring_caps = 0; in ath11k_wmi_tlv_dma_ring_caps()
4927 if (!dma_caps_parse->n_dma_ring_caps) in ath11k_wmi_tlv_dma_ring_caps()
4930 if (ab->num_db_cap) { in ath11k_wmi_tlv_dma_ring_caps()
4935 ret = ath11k_wmi_alloc_dbring_caps(ab, dma_caps_parse->n_dma_ring_caps); in ath11k_wmi_tlv_dma_ring_caps()
4939 dir_buff_caps = ab->db_caps; in ath11k_wmi_tlv_dma_ring_caps()
4940 for (i = 0; i < dma_caps_parse->n_dma_ring_caps; i++) { in ath11k_wmi_tlv_dma_ring_caps()
4943 ret = -EINVAL; in ath11k_wmi_tlv_dma_ring_caps()
4965 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4972 &svc_rdy_ext->param); in ath11k_wmi_tlv_svc_rdy_ext_parse()
4980 svc_rdy_ext->hw_caps = (struct wmi_soc_mac_phy_hw_mode_caps *)ptr; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4981 svc_rdy_ext->param.num_hw_modes = svc_rdy_ext->hw_caps->num_hw_modes; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4992 if (!svc_rdy_ext->hw_mode_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
4998 svc_rdy_ext->hw_mode_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4999 } else if (!svc_rdy_ext->mac_phy_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5000 svc_rdy_ext->n_mac_phy_caps = 0; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5009 svc_rdy_ext->mac_phy_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5010 } else if (!svc_rdy_ext->ext_hal_reg_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5016 svc_rdy_ext->ext_hal_reg_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5017 } else if (!svc_rdy_ext->mac_phy_chainmask_combo_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5018 svc_rdy_ext->mac_phy_chainmask_combo_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5019 } else if (!svc_rdy_ext->mac_phy_chainmask_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5020 svc_rdy_ext->mac_phy_chainmask_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5021 } else if (!svc_rdy_ext->oem_dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5022 svc_rdy_ext->oem_dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5023 } else if (!svc_rdy_ext->dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5025 &svc_rdy_ext->dma_caps_parse); in ath11k_wmi_tlv_svc_rdy_ext_parse()
5029 svc_rdy_ext->dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5045 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext_event()
5055 if (!test_bit(WMI_TLV_SERVICE_EXT2_MSG, ab->wmi_ab.svc_map)) in ath11k_service_ready_ext_event()
5056 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext_event()
5075 if (!parse->dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5077 &parse->dma_caps_parse); in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5081 parse->dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5097 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext2_event()
5107 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext2_event()
5134 return -EPROTO; in ath11k_pull_vdev_start_resp_tlv()
5139 vdev_rsp->vdev_id = ev->vdev_id; in ath11k_pull_vdev_start_resp_tlv()
5140 vdev_rsp->requestor_id = ev->requestor_id; in ath11k_pull_vdev_start_resp_tlv()
5141 vdev_rsp->resp_type = ev->resp_type; in ath11k_pull_vdev_start_resp_tlv()
5142 vdev_rsp->status = ev->status; in ath11k_pull_vdev_start_resp_tlv()
5143 vdev_rsp->chain_mask = ev->chain_mask; in ath11k_pull_vdev_start_resp_tlv()
5144 vdev_rsp->smps_mode = ev->smps_mode; in ath11k_pull_vdev_start_resp_tlv()
5145 vdev_rsp->mac_id = ev->mac_id; in ath11k_pull_vdev_start_resp_tlv()
5146 vdev_rsp->cfgd_tx_streams = ev->cfgd_tx_streams; in ath11k_pull_vdev_start_resp_tlv()
5147 vdev_rsp->cfgd_rx_streams = ev->cfgd_rx_streams; in ath11k_pull_vdev_start_resp_tlv()
5148 vdev_rsp->max_allowed_tx_power = ev->max_allowed_tx_power; in ath11k_pull_vdev_start_resp_tlv()
5166 "reg rule %d: (%d - %d @ %d) (%d, %d) (FLAGS %d)\n", in ath11k_print_reg_rule()
5167 count + 1, reg_rule->start_freq, reg_rule->end_freq, in ath11k_print_reg_rule()
5168 reg_rule->max_bw, reg_rule->ant_gain, in ath11k_print_reg_rule()
5169 reg_rule->reg_power, reg_rule->flags); in ath11k_print_reg_rule()
5234 return -EPROTO; in ath11k_pull_reg_chan_list_update_ev()
5237 reg_info->num_2ghz_reg_rules = chan_list_event_hdr->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5238 reg_info->num_5ghz_reg_rules = chan_list_event_hdr->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5240 if (!(reg_info->num_2ghz_reg_rules + reg_info->num_5ghz_reg_rules)) { in ath11k_pull_reg_chan_list_update_ev()
5243 return -EINVAL; in ath11k_pull_reg_chan_list_update_ev()
5246 memcpy(reg_info->alpha2, &chan_list_event_hdr->alpha2, in ath11k_pull_reg_chan_list_update_ev()
5248 reg_info->dfs_region = chan_list_event_hdr->dfs_region; in ath11k_pull_reg_chan_list_update_ev()
5249 reg_info->phybitmap = chan_list_event_hdr->phybitmap; in ath11k_pull_reg_chan_list_update_ev()
5250 reg_info->num_phy = chan_list_event_hdr->num_phy; in ath11k_pull_reg_chan_list_update_ev()
5251 reg_info->phy_id = chan_list_event_hdr->phy_id; in ath11k_pull_reg_chan_list_update_ev()
5252 reg_info->ctry_code = chan_list_event_hdr->country_id; in ath11k_pull_reg_chan_list_update_ev()
5253 reg_info->reg_dmn_pair = chan_list_event_hdr->domain_code; in ath11k_pull_reg_chan_list_update_ev()
5257 ath11k_cc_status_to_str(reg_info->status_code)); in ath11k_pull_reg_chan_list_update_ev()
5259 reg_info->status_code = in ath11k_pull_reg_chan_list_update_ev()
5260 ath11k_wmi_cc_setting_code_to_reg(chan_list_event_hdr->status_code); in ath11k_pull_reg_chan_list_update_ev()
5262 reg_info->is_ext_reg_event = false; in ath11k_pull_reg_chan_list_update_ev()
5264 reg_info->min_bw_2ghz = chan_list_event_hdr->min_bw_2ghz; in ath11k_pull_reg_chan_list_update_ev()
5265 reg_info->max_bw_2ghz = chan_list_event_hdr->max_bw_2ghz; in ath11k_pull_reg_chan_list_update_ev()
5266 reg_info->min_bw_5ghz = chan_list_event_hdr->min_bw_5ghz; in ath11k_pull_reg_chan_list_update_ev()
5267 reg_info->max_bw_5ghz = chan_list_event_hdr->max_bw_5ghz; in ath11k_pull_reg_chan_list_update_ev()
5269 num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5270 num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5274 reg_info->alpha2, reg_info->dfs_region, in ath11k_pull_reg_chan_list_update_ev()
5275 reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, in ath11k_pull_reg_chan_list_update_ev()
5276 reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); in ath11k_pull_reg_chan_list_update_ev()
5288 reg_info->reg_rules_2ghz_ptr = in ath11k_pull_reg_chan_list_update_ev()
5291 if (!reg_info->reg_rules_2ghz_ptr) { in ath11k_pull_reg_chan_list_update_ev()
5294 return -ENOMEM; in ath11k_pull_reg_chan_list_update_ev()
5299 reg_info->reg_rules_2ghz_ptr); in ath11k_pull_reg_chan_list_update_ev()
5304 reg_info->reg_rules_5ghz_ptr = in ath11k_pull_reg_chan_list_update_ev()
5307 if (!reg_info->reg_rules_5ghz_ptr) { in ath11k_pull_reg_chan_list_update_ev()
5310 return -ENOMEM; in ath11k_pull_reg_chan_list_update_ev()
5315 reg_info->reg_rules_5ghz_ptr); in ath11k_pull_reg_chan_list_update_ev()
5410 return -EPROTO; in ath11k_pull_reg_chan_list_ext_update_ev()
5413 reg_info->num_2ghz_reg_rules = ev->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5414 reg_info->num_5ghz_reg_rules = ev->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5415 reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5416 ev->num_6ghz_reg_rules_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5417 reg_info->num_6ghz_rules_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5418 ev->num_6ghz_reg_rules_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5419 reg_info->num_6ghz_rules_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5420 ev->num_6ghz_reg_rules_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5423 reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5424 ev->num_6ghz_reg_rules_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5425 reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5426 ev->num_6ghz_reg_rules_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5427 reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5428 ev->num_6ghz_reg_rules_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5431 num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5432 num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5442 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5446 num_6ghz_reg_rules_ap[i] = reg_info->num_6ghz_rules_ap[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5452 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5460 reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5464 reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5468 reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5480 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5487 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5490 memcpy(reg_info->alpha2, &ev->alpha2, REG_ALPHA2_LEN); in ath11k_pull_reg_chan_list_ext_update_ev()
5492 reg_info->dfs_region = ev->dfs_region; in ath11k_pull_reg_chan_list_ext_update_ev()
5493 reg_info->phybitmap = ev->phybitmap; in ath11k_pull_reg_chan_list_ext_update_ev()
5494 reg_info->num_phy = ev->num_phy; in ath11k_pull_reg_chan_list_ext_update_ev()
5495 reg_info->phy_id = ev->phy_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5496 reg_info->ctry_code = ev->country_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5497 reg_info->reg_dmn_pair = ev->domain_code; in ath11k_pull_reg_chan_list_ext_update_ev()
5501 ath11k_cc_status_to_str(reg_info->status_code)); in ath11k_pull_reg_chan_list_ext_update_ev()
5503 reg_info->status_code = in ath11k_pull_reg_chan_list_ext_update_ev()
5504 ath11k_wmi_cc_setting_code_to_reg(ev->status_code); in ath11k_pull_reg_chan_list_ext_update_ev()
5506 reg_info->is_ext_reg_event = true; in ath11k_pull_reg_chan_list_ext_update_ev()
5508 reg_info->min_bw_2ghz = ev->min_bw_2ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5509 reg_info->max_bw_2ghz = ev->max_bw_2ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5510 reg_info->min_bw_5ghz = ev->min_bw_5ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5511 reg_info->max_bw_5ghz = ev->max_bw_5ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5513 reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5514 ev->min_bw_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5515 reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5516 ev->max_bw_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5517 reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5518 ev->min_bw_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5519 reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5520 ev->max_bw_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5521 reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5522 ev->min_bw_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5523 reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5524 ev->max_bw_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5527 "6 GHz AP BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5528 reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5529 reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5530 reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5531 reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5532 reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5533 reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP]); in ath11k_pull_reg_chan_list_ext_update_ev()
5536 reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5537 ev->min_bw_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5538 reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5539 ev->max_bw_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5540 reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5541 ev->min_bw_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5542 reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5543 ev->max_bw_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5544 reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5545 ev->min_bw_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5546 reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5547 ev->max_bw_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5550 "6 GHz %s BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5552 reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5553 reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5554 reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5555 reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5556 reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5557 reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5562 reg_info->alpha2, reg_info->dfs_region, in ath11k_pull_reg_chan_list_ext_update_ev()
5563 reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, in ath11k_pull_reg_chan_list_ext_update_ev()
5564 reg_info->min_bw_5ghz, reg_info->max_bw_5ghz, in ath11k_pull_reg_chan_list_ext_update_ev()
5565 reg_info->phybitmap); in ath11k_pull_reg_chan_list_ext_update_ev()
5595 reg_info->reg_rules_2ghz_ptr = in ath11k_pull_reg_chan_list_ext_update_ev()
5599 if (!reg_info->reg_rules_2ghz_ptr) { in ath11k_pull_reg_chan_list_ext_update_ev()
5602 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5607 reg_info->reg_rules_2ghz_ptr); in ath11k_pull_reg_chan_list_ext_update_ev()
5626 reg_info->alpha2, reg_info->num_5ghz_reg_rules, in ath11k_pull_reg_chan_list_ext_update_ev()
5629 num_5ghz_reg_rules = num_5ghz_reg_rules - num_invalid_5ghz_ext_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5630 reg_info->num_5ghz_reg_rules = num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5634 reg_info->reg_rules_5ghz_ptr = in ath11k_pull_reg_chan_list_ext_update_ev()
5638 if (!reg_info->reg_rules_5ghz_ptr) { in ath11k_pull_reg_chan_list_ext_update_ev()
5641 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5646 reg_info->reg_rules_5ghz_ptr); in ath11k_pull_reg_chan_list_ext_update_ev()
5657 reg_info->reg_rules_6ghz_ap_ptr[i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5661 if (!reg_info->reg_rules_6ghz_ap_ptr[i]) { in ath11k_pull_reg_chan_list_ext_update_ev()
5664 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5669 reg_info->reg_rules_6ghz_ap_ptr[i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5679 reg_info->reg_rules_6ghz_client_ptr[j][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5683 if (!reg_info->reg_rules_6ghz_client_ptr[j][i]) { in ath11k_pull_reg_chan_list_ext_update_ev()
5686 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5692 reg_info->reg_rules_6ghz_client_ptr[j][i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5698 reg_info->client_type = ev->client_type; in ath11k_pull_reg_chan_list_ext_update_ev()
5699 reg_info->rnr_tpe_usable = ev->rnr_tpe_usable; in ath11k_pull_reg_chan_list_ext_update_ev()
5700 reg_info->unspecified_ap_usable = in ath11k_pull_reg_chan_list_ext_update_ev()
5701 ev->unspecified_ap_usable; in ath11k_pull_reg_chan_list_ext_update_ev()
5702 reg_info->domain_code_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5703 ev->domain_code_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5704 reg_info->domain_code_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5705 ev->domain_code_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5706 reg_info->domain_code_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5707 ev->domain_code_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5710 … client type %s rnr_tpe_usable %d unspecified_ap_usable %d AP sub domain: lpi %s, sp %s, vlp %s\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5711 ath11k_6ghz_client_type_to_str(reg_info->client_type), in ath11k_pull_reg_chan_list_ext_update_ev()
5712 reg_info->rnr_tpe_usable, in ath11k_pull_reg_chan_list_ext_update_ev()
5713 reg_info->unspecified_ap_usable, in ath11k_pull_reg_chan_list_ext_update_ev()
5714 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_lpi), in ath11k_pull_reg_chan_list_ext_update_ev()
5715 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_sp), in ath11k_pull_reg_chan_list_ext_update_ev()
5716 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_vlp)); in ath11k_pull_reg_chan_list_ext_update_ev()
5719 reg_info->domain_code_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5720 ev->domain_code_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5721 reg_info->domain_code_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5722 ev->domain_code_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5723 reg_info->domain_code_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5724 ev->domain_code_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5727 "6 GHz client type %s client sub domain: lpi %s, sp %s, vlp %s\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5729 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_lpi[i]), in ath11k_pull_reg_chan_list_ext_update_ev()
5730 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_sp[i]), in ath11k_pull_reg_chan_list_ext_update_ev()
5731 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_vlp[i]) in ath11k_pull_reg_chan_list_ext_update_ev()
5735 reg_info->domain_code_6ghz_super_id = ev->domain_code_6ghz_super_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5739 ath11k_6ghz_client_type_to_str(reg_info->client_type), in ath11k_pull_reg_chan_list_ext_update_ev()
5740 ath11k_super_reg_6ghz_to_str(reg_info->domain_code_6ghz_super_id)); in ath11k_pull_reg_chan_list_ext_update_ev()
5766 return -EPROTO; in ath11k_pull_peer_del_resp_ev()
5771 peer_del_resp->vdev_id = ev->vdev_id; in ath11k_pull_peer_del_resp_ev()
5772 ether_addr_copy(peer_del_resp->peer_macaddr.addr, in ath11k_pull_peer_del_resp_ev()
5773 ev->peer_macaddr.addr); in ath11k_pull_peer_del_resp_ev()
5798 return -EPROTO; in ath11k_pull_vdev_del_resp_ev()
5801 *vdev_id = ev->vdev_id; in ath11k_pull_vdev_del_resp_ev()
5826 return -EPROTO; in ath11k_pull_bcn_tx_status_ev()
5829 *vdev_id = ev->vdev_id; in ath11k_pull_bcn_tx_status_ev()
5830 *tx_status = ev->tx_status; in ath11k_pull_bcn_tx_status_ev()
5854 return -EPROTO; in ath11k_pull_vdev_stopped_param_tlv()
5857 *vdev_id = ev->vdev_id; in ath11k_pull_vdev_stopped_param_tlv()
5871 parse->fixed = ptr; in ath11k_wmi_tlv_mgmt_rx_parse()
5874 if (!parse->frame_buf_done) { in ath11k_wmi_tlv_mgmt_rx_parse()
5875 parse->frame_buf = ptr; in ath11k_wmi_tlv_mgmt_rx_parse()
5876 parse->frame_buf_done = true; in ath11k_wmi_tlv_mgmt_rx_parse()
5892 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_pull_mgmt_rx_params_tlv()
5896 ath11k_warn(ab, "failed to parse mgmt rx tlv %d\n", in ath11k_pull_mgmt_rx_params_tlv()
5905 ath11k_warn(ab, "failed to fetch mgmt rx hdr"); in ath11k_pull_mgmt_rx_params_tlv()
5906 return -EPROTO; in ath11k_pull_mgmt_rx_params_tlv()
5909 hdr->pdev_id = ev->pdev_id; in ath11k_pull_mgmt_rx_params_tlv()
5910 hdr->chan_freq = ev->chan_freq; in ath11k_pull_mgmt_rx_params_tlv()
5911 hdr->channel = ev->channel; in ath11k_pull_mgmt_rx_params_tlv()
5912 hdr->snr = ev->snr; in ath11k_pull_mgmt_rx_params_tlv()
5913 hdr->rate = ev->rate; in ath11k_pull_mgmt_rx_params_tlv()
5914 hdr->phy_mode = ev->phy_mode; in ath11k_pull_mgmt_rx_params_tlv()
5915 hdr->buf_len = ev->buf_len; in ath11k_pull_mgmt_rx_params_tlv()
5916 hdr->status = ev->status; in ath11k_pull_mgmt_rx_params_tlv()
5917 hdr->flags = ev->flags; in ath11k_pull_mgmt_rx_params_tlv()
5918 hdr->rssi = ev->rssi; in ath11k_pull_mgmt_rx_params_tlv()
5919 hdr->tsf_delta = ev->tsf_delta; in ath11k_pull_mgmt_rx_params_tlv()
5920 memcpy(hdr->rssi_ctl, ev->rssi_ctl, sizeof(hdr->rssi_ctl)); in ath11k_pull_mgmt_rx_params_tlv()
5922 if (skb->len < (frame - skb->data) + hdr->buf_len) { in ath11k_pull_mgmt_rx_params_tlv()
5923 ath11k_warn(ab, "invalid length in mgmt rx hdr ev"); in ath11k_pull_mgmt_rx_params_tlv()
5924 return -EPROTO; in ath11k_pull_mgmt_rx_params_tlv()
5929 skb_put(skb, frame - skb->data); in ath11k_pull_mgmt_rx_params_tlv()
5930 skb_pull(skb, frame - skb->data); in ath11k_pull_mgmt_rx_params_tlv()
5931 skb_put(skb, hdr->buf_len); in ath11k_pull_mgmt_rx_params_tlv()
5933 ath11k_ce_byte_swap(skb->data, hdr->buf_len); in ath11k_pull_mgmt_rx_params_tlv()
5946 spin_lock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5947 msdu = idr_find(&ar->txmgmt_idr, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5950 ath11k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n", in wmi_process_mgmt_tx_comp()
5951 tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5952 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5953 return -ENOENT; in wmi_process_mgmt_tx_comp()
5956 idr_remove(&ar->txmgmt_idr, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5957 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5960 dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); in wmi_process_mgmt_tx_comp()
5963 if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && in wmi_process_mgmt_tx_comp()
5964 !tx_compl_param->status) { in wmi_process_mgmt_tx_comp()
5965 info->flags |= IEEE80211_TX_STAT_ACK; in wmi_process_mgmt_tx_comp()
5967 ar->ab->wmi_ab.svc_map)) in wmi_process_mgmt_tx_comp()
5968 info->status.ack_signal = tx_compl_param->ack_rssi; in wmi_process_mgmt_tx_comp()
5971 ieee80211_tx_status_irqsafe(ar->hw, msdu); in wmi_process_mgmt_tx_comp()
5973 num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx); in wmi_process_mgmt_tx_comp()
5979 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in wmi_process_mgmt_tx_comp()
5981 num_mgmt, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5984 wake_up(&ar->txmgmt_empty_waitq); in wmi_process_mgmt_tx_comp()
6008 return -EPROTO; in ath11k_pull_mgmt_tx_compl_param_tlv()
6011 param->pdev_id = ev->pdev_id; in ath11k_pull_mgmt_tx_compl_param_tlv()
6012 param->desc_id = ev->desc_id; in ath11k_pull_mgmt_tx_compl_param_tlv()
6013 param->status = ev->status; in ath11k_pull_mgmt_tx_compl_param_tlv()
6014 param->ack_rssi = ev->ack_rssi; in ath11k_pull_mgmt_tx_compl_param_tlv()
6022 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_started()
6024 switch (ar->scan.state) { in ath11k_wmi_event_scan_started()
6028 ath11k_warn(ar->ab, "received scan started event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_started()
6029 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_started()
6030 ar->scan.state); in ath11k_wmi_event_scan_started()
6033 ar->scan.state = ATH11K_SCAN_RUNNING; in ath11k_wmi_event_scan_started()
6034 if (ar->scan.is_roc) in ath11k_wmi_event_scan_started()
6035 ieee80211_ready_on_channel(ar->hw); in ath11k_wmi_event_scan_started()
6036 complete(&ar->scan.started); in ath11k_wmi_event_scan_started()
6043 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_start_failed()
6045 switch (ar->scan.state) { in ath11k_wmi_event_scan_start_failed()
6049 ath11k_warn(ar->ab, "received scan start failed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_start_failed()
6050 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_start_failed()
6051 ar->scan.state); in ath11k_wmi_event_scan_start_failed()
6054 complete(&ar->scan.started); in ath11k_wmi_event_scan_start_failed()
6062 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_completed()
6064 switch (ar->scan.state) { in ath11k_wmi_event_scan_completed()
6075 ath11k_warn(ar->ab, "received scan completed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_completed()
6076 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_completed()
6077 ar->scan.state); in ath11k_wmi_event_scan_completed()
6088 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_bss_chan()
6090 switch (ar->scan.state) { in ath11k_wmi_event_scan_bss_chan()
6093 ath11k_warn(ar->ab, "received scan bss chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_bss_chan()
6094 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_bss_chan()
6095 ar->scan.state); in ath11k_wmi_event_scan_bss_chan()
6099 ar->scan_channel = NULL; in ath11k_wmi_event_scan_bss_chan()
6106 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_foreign_chan()
6108 switch (ar->scan.state) { in ath11k_wmi_event_scan_foreign_chan()
6111 ath11k_warn(ar->ab, "received scan foreign chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_foreign_chan()
6112 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_foreign_chan()
6113 ar->scan.state); in ath11k_wmi_event_scan_foreign_chan()
6117 ar->scan_channel = ieee80211_get_channel(ar->hw->wiphy, freq); in ath11k_wmi_event_scan_foreign_chan()
6118 if (ar->scan.is_roc && ar->scan.roc_freq == freq) in ath11k_wmi_event_scan_foreign_chan()
6119 complete(&ar->scan.on_channel); in ath11k_wmi_event_scan_foreign_chan()
6184 return -EPROTO; in ath11k_pull_scan_ev()
6187 scan_evt_param->event_type = ev->event_type; in ath11k_pull_scan_ev()
6188 scan_evt_param->reason = ev->reason; in ath11k_pull_scan_ev()
6189 scan_evt_param->channel_freq = ev->channel_freq; in ath11k_pull_scan_ev()
6190 scan_evt_param->scan_req_id = ev->scan_req_id; in ath11k_pull_scan_ev()
6191 scan_evt_param->scan_id = ev->scan_id; in ath11k_pull_scan_ev()
6192 scan_evt_param->vdev_id = ev->vdev_id; in ath11k_pull_scan_ev()
6193 scan_evt_param->tsf_timestamp = ev->tsf_timestamp; in ath11k_pull_scan_ev()
6217 return -EPROTO; in ath11k_pull_peer_sta_kickout_ev()
6220 arg->mac_addr = ev->peer_macaddr.addr; in ath11k_pull_peer_sta_kickout_ev()
6244 return -EPROTO; in ath11k_pull_roam_ev()
6247 roam_ev->vdev_id = ev->vdev_id; in ath11k_pull_roam_ev()
6248 roam_ev->reason = ev->reason; in ath11k_pull_roam_ev()
6249 roam_ev->rssi = ev->rssi; in ath11k_pull_roam_ev()
6261 sband = ar->hw->wiphy->bands[band]; in freq_to_idx()
6265 for (ch = 0; ch < sband->n_channels; ch++, idx++) in freq_to_idx()
6266 if (sband->channels[ch].center_freq == freq) in freq_to_idx()
6292 return -EPROTO; in ath11k_pull_chan_info_ev()
6295 ch_info_ev->err_code = ev->err_code; in ath11k_pull_chan_info_ev()
6296 ch_info_ev->freq = ev->freq; in ath11k_pull_chan_info_ev()
6297 ch_info_ev->cmd_flags = ev->cmd_flags; in ath11k_pull_chan_info_ev()
6298 ch_info_ev->noise_floor = ev->noise_floor; in ath11k_pull_chan_info_ev()
6299 ch_info_ev->rx_clear_count = ev->rx_clear_count; in ath11k_pull_chan_info_ev()
6300 ch_info_ev->cycle_count = ev->cycle_count; in ath11k_pull_chan_info_ev()
6301 ch_info_ev->chan_tx_pwr_range = ev->chan_tx_pwr_range; in ath11k_pull_chan_info_ev()
6302 ch_info_ev->chan_tx_pwr_tp = ev->chan_tx_pwr_tp; in ath11k_pull_chan_info_ev()
6303 ch_info_ev->rx_frame_count = ev->rx_frame_count; in ath11k_pull_chan_info_ev()
6304 ch_info_ev->tx_frame_cnt = ev->tx_frame_cnt; in ath11k_pull_chan_info_ev()
6305 ch_info_ev->mac_clk_mhz = ev->mac_clk_mhz; in ath11k_pull_chan_info_ev()
6306 ch_info_ev->vdev_id = ev->vdev_id; in ath11k_pull_chan_info_ev()
6331 return -EPROTO; in ath11k_pull_pdev_bss_chan_info_ev()
6334 bss_ch_info_ev->pdev_id = ev->pdev_id; in ath11k_pull_pdev_bss_chan_info_ev()
6335 bss_ch_info_ev->freq = ev->freq; in ath11k_pull_pdev_bss_chan_info_ev()
6336 bss_ch_info_ev->noise_floor = ev->noise_floor; in ath11k_pull_pdev_bss_chan_info_ev()
6337 bss_ch_info_ev->rx_clear_count_low = ev->rx_clear_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6338 bss_ch_info_ev->rx_clear_count_high = ev->rx_clear_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6339 bss_ch_info_ev->cycle_count_low = ev->cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6340 bss_ch_info_ev->cycle_count_high = ev->cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6341 bss_ch_info_ev->tx_cycle_count_low = ev->tx_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6342 bss_ch_info_ev->tx_cycle_count_high = ev->tx_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6343 bss_ch_info_ev->rx_cycle_count_low = ev->rx_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6344 bss_ch_info_ev->rx_cycle_count_high = ev->rx_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6345 bss_ch_info_ev->rx_bss_cycle_count_low = ev->rx_bss_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6346 bss_ch_info_ev->rx_bss_cycle_count_high = ev->rx_bss_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6371 return -EPROTO; in ath11k_pull_vdev_install_key_compl_ev()
6374 arg->vdev_id = ev->vdev_id; in ath11k_pull_vdev_install_key_compl_ev()
6375 arg->macaddr = ev->peer_macaddr.addr; in ath11k_pull_vdev_install_key_compl_ev()
6376 arg->key_idx = ev->key_idx; in ath11k_pull_vdev_install_key_compl_ev()
6377 arg->key_flags = ev->key_flags; in ath11k_pull_vdev_install_key_compl_ev()
6378 arg->status = ev->status; in ath11k_pull_vdev_install_key_compl_ev()
6402 return -EPROTO; in ath11k_pull_peer_assoc_conf_ev()
6405 peer_assoc_conf->vdev_id = ev->vdev_id; in ath11k_pull_peer_assoc_conf_ev()
6406 peer_assoc_conf->macaddr = ev->peer_macaddr.addr; in ath11k_pull_peer_assoc_conf_ev()
6415 dst->ch_noise_floor = src->chan_nf; in ath11k_wmi_pull_pdev_stats_base()
6416 dst->tx_frame_count = src->tx_frame_count; in ath11k_wmi_pull_pdev_stats_base()
6417 dst->rx_frame_count = src->rx_frame_count; in ath11k_wmi_pull_pdev_stats_base()
6418 dst->rx_clear_count = src->rx_clear_count; in ath11k_wmi_pull_pdev_stats_base()
6419 dst->cycle_count = src->cycle_count; in ath11k_wmi_pull_pdev_stats_base()
6420 dst->phy_err_count = src->phy_err_count; in ath11k_wmi_pull_pdev_stats_base()
6421 dst->chan_tx_power = src->chan_tx_pwr; in ath11k_wmi_pull_pdev_stats_base()
6428 dst->comp_queued = src->comp_queued; in ath11k_wmi_pull_pdev_stats_tx()
6429 dst->comp_delivered = src->comp_delivered; in ath11k_wmi_pull_pdev_stats_tx()
6430 dst->msdu_enqued = src->msdu_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6431 dst->mpdu_enqued = src->mpdu_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6432 dst->wmm_drop = src->wmm_drop; in ath11k_wmi_pull_pdev_stats_tx()
6433 dst->local_enqued = src->local_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6434 dst->local_freed = src->local_freed; in ath11k_wmi_pull_pdev_stats_tx()
6435 dst->hw_queued = src->hw_queued; in ath11k_wmi_pull_pdev_stats_tx()
6436 dst->hw_reaped = src->hw_reaped; in ath11k_wmi_pull_pdev_stats_tx()
6437 dst->underrun = src->underrun; in ath11k_wmi_pull_pdev_stats_tx()
6438 dst->hw_paused = src->hw_paused; in ath11k_wmi_pull_pdev_stats_tx()
6439 dst->tx_abort = src->tx_abort; in ath11k_wmi_pull_pdev_stats_tx()
6440 dst->mpdus_requeued = src->mpdus_requeued; in ath11k_wmi_pull_pdev_stats_tx()
6441 dst->tx_ko = src->tx_ko; in ath11k_wmi_pull_pdev_stats_tx()
6442 dst->tx_xretry = src->tx_xretry; in ath11k_wmi_pull_pdev_stats_tx()
6443 dst->data_rc = src->data_rc; in ath11k_wmi_pull_pdev_stats_tx()
6444 dst->self_triggers = src->self_triggers; in ath11k_wmi_pull_pdev_stats_tx()
6445 dst->sw_retry_failure = src->sw_retry_failure; in ath11k_wmi_pull_pdev_stats_tx()
6446 dst->illgl_rate_phy_err = src->illgl_rate_phy_err; in ath11k_wmi_pull_pdev_stats_tx()
6447 dst->pdev_cont_xretry = src->pdev_cont_xretry; in ath11k_wmi_pull_pdev_stats_tx()
6448 dst->pdev_tx_timeout = src->pdev_tx_timeout; in ath11k_wmi_pull_pdev_stats_tx()
6449 dst->pdev_resets = src->pdev_resets; in ath11k_wmi_pull_pdev_stats_tx()
6450 dst->stateless_tid_alloc_failure = src->stateless_tid_alloc_failure; in ath11k_wmi_pull_pdev_stats_tx()
6451 dst->phy_underrun = src->phy_underrun; in ath11k_wmi_pull_pdev_stats_tx()
6452 dst->txop_ovf = src->txop_ovf; in ath11k_wmi_pull_pdev_stats_tx()
6453 dst->seq_posted = src->seq_posted; in ath11k_wmi_pull_pdev_stats_tx()
6454 dst->seq_failed_queueing = src->seq_failed_queueing; in ath11k_wmi_pull_pdev_stats_tx()
6455 dst->seq_completed = src->seq_completed; in ath11k_wmi_pull_pdev_stats_tx()
6456 dst->seq_restarted = src->seq_restarted; in ath11k_wmi_pull_pdev_stats_tx()
6457 dst->mu_seq_posted = src->mu_seq_posted; in ath11k_wmi_pull_pdev_stats_tx()
6458 dst->mpdus_sw_flush = src->mpdus_sw_flush; in ath11k_wmi_pull_pdev_stats_tx()
6459 dst->mpdus_hw_filter = src->mpdus_hw_filter; in ath11k_wmi_pull_pdev_stats_tx()
6460 dst->mpdus_truncated = src->mpdus_truncated; in ath11k_wmi_pull_pdev_stats_tx()
6461 dst->mpdus_ack_failed = src->mpdus_ack_failed; in ath11k_wmi_pull_pdev_stats_tx()
6462 dst->mpdus_expired = src->mpdus_expired; in ath11k_wmi_pull_pdev_stats_tx()
6468 dst->mid_ppdu_route_change = src->mid_ppdu_route_change; in ath11k_wmi_pull_pdev_stats_rx()
6469 dst->status_rcvd = src->status_rcvd; in ath11k_wmi_pull_pdev_stats_rx()
6470 dst->r0_frags = src->r0_frags; in ath11k_wmi_pull_pdev_stats_rx()
6471 dst->r1_frags = src->r1_frags; in ath11k_wmi_pull_pdev_stats_rx()
6472 dst->r2_frags = src->r2_frags; in ath11k_wmi_pull_pdev_stats_rx()
6473 dst->r3_frags = src->r3_frags; in ath11k_wmi_pull_pdev_stats_rx()
6474 dst->htt_msdus = src->htt_msdus; in ath11k_wmi_pull_pdev_stats_rx()
6475 dst->htt_mpdus = src->htt_mpdus; in ath11k_wmi_pull_pdev_stats_rx()
6476 dst->loc_msdus = src->loc_msdus; in ath11k_wmi_pull_pdev_stats_rx()
6477 dst->loc_mpdus = src->loc_mpdus; in ath11k_wmi_pull_pdev_stats_rx()
6478 dst->oversize_amsdu = src->oversize_amsdu; in ath11k_wmi_pull_pdev_stats_rx()
6479 dst->phy_errs = src->phy_errs; in ath11k_wmi_pull_pdev_stats_rx()
6480 dst->phy_err_drop = src->phy_err_drop; in ath11k_wmi_pull_pdev_stats_rx()
6481 dst->mpdu_errs = src->mpdu_errs; in ath11k_wmi_pull_pdev_stats_rx()
6482 dst->rx_ovfl_errs = src->rx_ovfl_errs; in ath11k_wmi_pull_pdev_stats_rx()
6491 dst->vdev_id = src->vdev_id; in ath11k_wmi_pull_vdev_stats()
6492 dst->beacon_snr = src->beacon_snr; in ath11k_wmi_pull_vdev_stats()
6493 dst->data_snr = src->data_snr; in ath11k_wmi_pull_vdev_stats()
6494 dst->num_rx_frames = src->num_rx_frames; in ath11k_wmi_pull_vdev_stats()
6495 dst->num_rts_fail = src->num_rts_fail; in ath11k_wmi_pull_vdev_stats()
6496 dst->num_rts_success = src->num_rts_success; in ath11k_wmi_pull_vdev_stats()
6497 dst->num_rx_err = src->num_rx_err; in ath11k_wmi_pull_vdev_stats()
6498 dst->num_rx_discard = src->num_rx_discard; in ath11k_wmi_pull_vdev_stats()
6499 dst->num_tx_not_acked = src->num_tx_not_acked; in ath11k_wmi_pull_vdev_stats()
6501 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames); i++) in ath11k_wmi_pull_vdev_stats()
6502 dst->num_tx_frames[i] = src->num_tx_frames[i]; in ath11k_wmi_pull_vdev_stats()
6504 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames_retries); i++) in ath11k_wmi_pull_vdev_stats()
6505 dst->num_tx_frames_retries[i] = src->num_tx_frames_retries[i]; in ath11k_wmi_pull_vdev_stats()
6507 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames_failures); i++) in ath11k_wmi_pull_vdev_stats()
6508 dst->num_tx_frames_failures[i] = src->num_tx_frames_failures[i]; in ath11k_wmi_pull_vdev_stats()
6510 for (i = 0; i < ARRAY_SIZE(src->tx_rate_history); i++) in ath11k_wmi_pull_vdev_stats()
6511 dst->tx_rate_history[i] = src->tx_rate_history[i]; in ath11k_wmi_pull_vdev_stats()
6513 for (i = 0; i < ARRAY_SIZE(src->beacon_rssi_history); i++) in ath11k_wmi_pull_vdev_stats()
6514 dst->beacon_rssi_history[i] = src->beacon_rssi_history[i]; in ath11k_wmi_pull_vdev_stats()
6521 dst->vdev_id = src->vdev_id; in ath11k_wmi_pull_bcn_stats()
6522 dst->tx_bcn_succ_cnt = src->tx_bcn_succ_cnt; in ath11k_wmi_pull_bcn_stats()
6523 dst->tx_bcn_outage_cnt = src->tx_bcn_outage_cnt; in ath11k_wmi_pull_bcn_stats()
6531 const struct wmi_stats_event *ev = parse->ev; in ath11k_wmi_tlv_rssi_chain_parse()
6532 struct ath11k_fw_stats *stats = parse->stats; in ath11k_wmi_tlv_rssi_chain_parse()
6541 return -EPROTO; in ath11k_wmi_tlv_rssi_chain_parse()
6545 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6546 stats->stats_id = WMI_REQUEST_RSSI_PER_CHAIN_STAT; in ath11k_wmi_tlv_rssi_chain_parse()
6550 stats_rssi->vdev_id, stats_rssi->peer_macaddr.addr); in ath11k_wmi_tlv_rssi_chain_parse()
6552 arvif = ath11k_mac_get_arvif(ar, stats_rssi->vdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6555 stats_rssi->vdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6556 ret = -EPROTO; in ath11k_wmi_tlv_rssi_chain_parse()
6562 arvif->bssid, arvif->vif); in ath11k_wmi_tlv_rssi_chain_parse()
6564 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_wmi_tlv_rssi_chain_parse()
6565 arvif->bssid, in ath11k_wmi_tlv_rssi_chain_parse()
6570 arvif->bssid); in ath11k_wmi_tlv_rssi_chain_parse()
6576 BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) > in ath11k_wmi_tlv_rssi_chain_parse()
6577 ARRAY_SIZE(stats_rssi->rssi_avg_beacon)); in ath11k_wmi_tlv_rssi_chain_parse()
6579 for (j = 0; j < ARRAY_SIZE(arsta->chain_signal); j++) { in ath11k_wmi_tlv_rssi_chain_parse()
6580 arsta->chain_signal[j] = stats_rssi->rssi_avg_beacon[j]; in ath11k_wmi_tlv_rssi_chain_parse()
6584 stats_rssi->rssi_avg_beacon[j], in ath11k_wmi_tlv_rssi_chain_parse()
6586 stats_rssi->rssi_avg_data[j]); in ath11k_wmi_tlv_rssi_chain_parse()
6599 struct ath11k_fw_stats *stats = parse->stats; in ath11k_wmi_tlv_fw_stats_data_parse()
6600 const struct wmi_stats_event *ev = parse->ev; in ath11k_wmi_tlv_fw_stats_data_parse()
6610 return -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6613 stats->stats_id = 0; in ath11k_wmi_tlv_fw_stats_data_parse()
6617 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_tlv_fw_stats_data_parse()
6619 for (i = 0; i < ev->num_pdev_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6625 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6629 stats->stats_id = WMI_REQUEST_PDEV_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6632 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6638 ath11k_wmi_pull_pdev_stats_base(&src->base, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6639 ath11k_wmi_pull_pdev_stats_tx(&src->tx, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6640 ath11k_wmi_pull_pdev_stats_rx(&src->rx, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6641 list_add_tail(&dst->list, &stats->pdevs); in ath11k_wmi_tlv_fw_stats_data_parse()
6644 for (i = 0; i < ev->num_vdev_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6650 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6654 stats->stats_id = WMI_REQUEST_VDEV_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6656 arvif = ath11k_mac_get_arvif(ar, src->vdev_id); in ath11k_wmi_tlv_fw_stats_data_parse()
6658 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_wmi_tlv_fw_stats_data_parse()
6659 arvif->bssid, in ath11k_wmi_tlv_fw_stats_data_parse()
6663 arsta->rssi_beacon = src->beacon_snr; in ath11k_wmi_tlv_fw_stats_data_parse()
6666 src->vdev_id, src->beacon_snr); in ath11k_wmi_tlv_fw_stats_data_parse()
6670 arvif->bssid); in ath11k_wmi_tlv_fw_stats_data_parse()
6675 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6682 list_add_tail(&dst->list, &stats->vdevs); in ath11k_wmi_tlv_fw_stats_data_parse()
6685 for (i = 0; i < ev->num_bcn_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6691 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6695 stats->stats_id = WMI_REQUEST_BCN_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6698 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6705 list_add_tail(&dst->list, &stats->bcn); in ath11k_wmi_tlv_fw_stats_data_parse()
6722 parse->ev = (struct wmi_stats_event *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6723 parse->stats->pdev_id = parse->ev->pdev_id; in ath11k_wmi_tlv_fw_stats_parse()
6729 parse->rssi = (struct wmi_per_chain_rssi_stats *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6731 if (parse->ev->stats_id & WMI_REQUEST_RSSI_PER_CHAIN_STAT) in ath11k_wmi_tlv_fw_stats_parse()
6732 parse->rssi_num = parse->rssi->num_per_chain_rssi_stats; in ath11k_wmi_tlv_fw_stats_parse()
6736 parse->ev->stats_id, in ath11k_wmi_tlv_fw_stats_parse()
6737 parse->rssi_num); in ath11k_wmi_tlv_fw_stats_parse()
6740 if (parse->rssi_num && !parse->chain_rssi_done) { in ath11k_wmi_tlv_fw_stats_parse()
6749 parse->chain_rssi_done = true; in ath11k_wmi_tlv_fw_stats_parse()
6763 stats->stats_id = 0; in ath11k_wmi_pull_fw_stats()
6766 return ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pull_fw_stats()
6778 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_pdev_base_stats_fill()
6779 len += scnprintf(buf + len, buf_len - len, "%30s\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6781 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6784 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6785 "Channel noise floor", pdev->ch_noise_floor); in ath11k_wmi_fw_pdev_base_stats_fill()
6786 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6787 "Channel TX power", pdev->chan_tx_power); in ath11k_wmi_fw_pdev_base_stats_fill()
6788 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6789 "TX frame count", pdev->tx_frame_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6790 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6791 "RX frame count", pdev->rx_frame_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6792 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6793 "RX clear count", pdev->rx_clear_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6794 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6795 "Cycle count", pdev->cycle_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6796 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6797 "PHY error count", pdev->phy_err_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6809 len += scnprintf(buf + len, buf_len - len, "\n%30s\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6811 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6814 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6815 "HTT cookies queued", pdev->comp_queued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6816 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6817 "HTT cookies disp.", pdev->comp_delivered); in ath11k_wmi_fw_pdev_tx_stats_fill()
6818 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6819 "MSDU queued", pdev->msdu_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6820 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6821 "MPDU queued", pdev->mpdu_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6822 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6823 "MSDUs dropped", pdev->wmm_drop); in ath11k_wmi_fw_pdev_tx_stats_fill()
6824 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6825 "Local enqued", pdev->local_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6826 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6827 "Local freed", pdev->local_freed); in ath11k_wmi_fw_pdev_tx_stats_fill()
6828 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6829 "HW queued", pdev->hw_queued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6830 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6831 "PPDUs reaped", pdev->hw_reaped); in ath11k_wmi_fw_pdev_tx_stats_fill()
6832 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6833 "Num underruns", pdev->underrun); in ath11k_wmi_fw_pdev_tx_stats_fill()
6834 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6835 "Num HW Paused", pdev->hw_paused); in ath11k_wmi_fw_pdev_tx_stats_fill()
6836 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6837 "PPDUs cleaned", pdev->tx_abort); in ath11k_wmi_fw_pdev_tx_stats_fill()
6838 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6839 "MPDUs requeued", pdev->mpdus_requeued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6840 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6841 "PPDU OK", pdev->tx_ko); in ath11k_wmi_fw_pdev_tx_stats_fill()
6842 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6843 "Excessive retries", pdev->tx_xretry); in ath11k_wmi_fw_pdev_tx_stats_fill()
6844 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6845 "HW rate", pdev->data_rc); in ath11k_wmi_fw_pdev_tx_stats_fill()
6846 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6847 "Sched self triggers", pdev->self_triggers); in ath11k_wmi_fw_pdev_tx_stats_fill()
6848 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6850 pdev->sw_retry_failure); in ath11k_wmi_fw_pdev_tx_stats_fill()
6851 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6853 pdev->illgl_rate_phy_err); in ath11k_wmi_fw_pdev_tx_stats_fill()
6854 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6855 "PDEV continuous xretry", pdev->pdev_cont_xretry); in ath11k_wmi_fw_pdev_tx_stats_fill()
6856 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6857 "TX timeout", pdev->pdev_tx_timeout); in ath11k_wmi_fw_pdev_tx_stats_fill()
6858 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6859 "PDEV resets", pdev->pdev_resets); in ath11k_wmi_fw_pdev_tx_stats_fill()
6860 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6862 pdev->stateless_tid_alloc_failure); in ath11k_wmi_fw_pdev_tx_stats_fill()
6863 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6864 "PHY underrun", pdev->phy_underrun); in ath11k_wmi_fw_pdev_tx_stats_fill()
6865 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6866 "MPDU is more than txop limit", pdev->txop_ovf); in ath11k_wmi_fw_pdev_tx_stats_fill()
6867 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6868 "Num sequences posted", pdev->seq_posted); in ath11k_wmi_fw_pdev_tx_stats_fill()
6869 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6870 "Num seq failed queueing ", pdev->seq_failed_queueing); in ath11k_wmi_fw_pdev_tx_stats_fill()
6871 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6872 "Num sequences completed ", pdev->seq_completed); in ath11k_wmi_fw_pdev_tx_stats_fill()
6873 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6874 "Num sequences restarted ", pdev->seq_restarted); in ath11k_wmi_fw_pdev_tx_stats_fill()
6875 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6876 "Num of MU sequences posted ", pdev->mu_seq_posted); in ath11k_wmi_fw_pdev_tx_stats_fill()
6877 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6878 "Num of MPDUS SW flushed ", pdev->mpdus_sw_flush); in ath11k_wmi_fw_pdev_tx_stats_fill()
6879 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6880 "Num of MPDUS HW filtered ", pdev->mpdus_hw_filter); in ath11k_wmi_fw_pdev_tx_stats_fill()
6881 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6882 "Num of MPDUS truncated ", pdev->mpdus_truncated); in ath11k_wmi_fw_pdev_tx_stats_fill()
6883 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6884 "Num of MPDUS ACK failed ", pdev->mpdus_ack_failed); in ath11k_wmi_fw_pdev_tx_stats_fill()
6885 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6886 "Num of MPDUS expired ", pdev->mpdus_expired); in ath11k_wmi_fw_pdev_tx_stats_fill()
6897 len += scnprintf(buf + len, buf_len - len, "\n%30s\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6898 "ath11k PDEV RX stats"); in ath11k_wmi_fw_pdev_rx_stats_fill()
6899 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6902 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6904 pdev->mid_ppdu_route_change); in ath11k_wmi_fw_pdev_rx_stats_fill()
6905 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6906 "Tot. number of statuses", pdev->status_rcvd); in ath11k_wmi_fw_pdev_rx_stats_fill()
6907 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6908 "Extra frags on rings 0", pdev->r0_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6909 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6910 "Extra frags on rings 1", pdev->r1_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6911 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6912 "Extra frags on rings 2", pdev->r2_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6913 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6914 "Extra frags on rings 3", pdev->r3_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6915 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6916 "MSDUs delivered to HTT", pdev->htt_msdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6917 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6918 "MPDUs delivered to HTT", pdev->htt_mpdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6919 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6920 "MSDUs delivered to stack", pdev->loc_msdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6921 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6922 "MPDUs delivered to stack", pdev->loc_mpdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6923 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6924 "Oversized AMSUs", pdev->oversize_amsdu); in ath11k_wmi_fw_pdev_rx_stats_fill()
6925 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6926 "PHY errors", pdev->phy_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
6927 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6928 "PHY errors drops", pdev->phy_err_drop); in ath11k_wmi_fw_pdev_rx_stats_fill()
6929 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6930 "MPDU errors (FCS, MIC, ENC)", pdev->mpdu_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
6931 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6932 "Overflow errors", pdev->rx_ovfl_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
6943 struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, vdev->vdev_id); in ath11k_wmi_fw_vdev_stats_fill()
6953 vif_macaddr = arvif->vif->addr; in ath11k_wmi_fw_vdev_stats_fill()
6955 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6956 "VDEV ID", vdev->vdev_id); in ath11k_wmi_fw_vdev_stats_fill()
6957 len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", in ath11k_wmi_fw_vdev_stats_fill()
6959 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6960 "beacon snr", vdev->beacon_snr); in ath11k_wmi_fw_vdev_stats_fill()
6961 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6962 "data snr", vdev->data_snr); in ath11k_wmi_fw_vdev_stats_fill()
6963 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6964 "num rx frames", vdev->num_rx_frames); in ath11k_wmi_fw_vdev_stats_fill()
6965 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6966 "num rts fail", vdev->num_rts_fail); in ath11k_wmi_fw_vdev_stats_fill()
6967 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6968 "num rts success", vdev->num_rts_success); in ath11k_wmi_fw_vdev_stats_fill()
6969 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6970 "num rx err", vdev->num_rx_err); in ath11k_wmi_fw_vdev_stats_fill()
6971 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6972 "num rx discard", vdev->num_rx_discard); in ath11k_wmi_fw_vdev_stats_fill()
6973 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6974 "num tx not acked", vdev->num_tx_not_acked); in ath11k_wmi_fw_vdev_stats_fill()
6976 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames); i++) in ath11k_wmi_fw_vdev_stats_fill()
6977 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6980 vdev->num_tx_frames[i]); in ath11k_wmi_fw_vdev_stats_fill()
6982 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames_retries); i++) in ath11k_wmi_fw_vdev_stats_fill()
6983 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6986 vdev->num_tx_frames_retries[i]); in ath11k_wmi_fw_vdev_stats_fill()
6988 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames_failures); i++) in ath11k_wmi_fw_vdev_stats_fill()
6989 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6992 vdev->num_tx_frames_failures[i]); in ath11k_wmi_fw_vdev_stats_fill()
6994 for (i = 0 ; i < ARRAY_SIZE(vdev->tx_rate_history); i++) in ath11k_wmi_fw_vdev_stats_fill()
6995 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6998 vdev->tx_rate_history[i]); in ath11k_wmi_fw_vdev_stats_fill()
7000 for (i = 0 ; i < ARRAY_SIZE(vdev->beacon_rssi_history); i++) in ath11k_wmi_fw_vdev_stats_fill()
7001 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7004 vdev->beacon_rssi_history[i]); in ath11k_wmi_fw_vdev_stats_fill()
7006 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_vdev_stats_fill()
7017 struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7021 ath11k_warn(ar->ab, "invalid vdev id %d in bcn stats", in ath11k_wmi_fw_bcn_stats_fill()
7022 bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7026 vdev_macaddr = arvif->vif->addr; in ath11k_wmi_fw_bcn_stats_fill()
7028 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7029 "VDEV ID", bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7030 len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", in ath11k_wmi_fw_bcn_stats_fill()
7032 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_bcn_stats_fill()
7034 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7035 "Num of beacon tx success", bcn->tx_bcn_succ_cnt); in ath11k_wmi_fw_bcn_stats_fill()
7036 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7037 "Num of beacon tx failures", bcn->tx_bcn_outage_cnt); in ath11k_wmi_fw_bcn_stats_fill()
7039 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_bcn_stats_fill()
7054 spin_lock_bh(&ar->data_lock); in ath11k_wmi_fw_stats_fill()
7057 pdev = list_first_entry_or_null(&fw_stats->pdevs, in ath11k_wmi_fw_stats_fill()
7060 ath11k_warn(ar->ab, "failed to get pdev stats\n"); in ath11k_wmi_fw_stats_fill()
7070 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_stats_fill()
7071 len += scnprintf(buf + len, buf_len - len, "%30s\n", in ath11k_wmi_fw_stats_fill()
7073 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_stats_fill()
7076 list_for_each_entry(vdev, &fw_stats->vdevs, list) in ath11k_wmi_fw_stats_fill()
7081 num_bcn = list_count_nodes(&fw_stats->bcn); in ath11k_wmi_fw_stats_fill()
7083 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_stats_fill()
7084 len += scnprintf(buf + len, buf_len - len, "%30s (%zu)\n", in ath11k_wmi_fw_stats_fill()
7086 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_stats_fill()
7089 list_for_each_entry(bcn, &fw_stats->bcn, list) in ath11k_wmi_fw_stats_fill()
7094 spin_unlock_bh(&ar->data_lock); in ath11k_wmi_fw_stats_fill()
7097 buf[len - 1] = 0; in ath11k_wmi_fw_stats_fill()
7105 wake_up(&ab->wmi_ab.tx_credits_wq); in ath11k_wmi_op_ep_tx_credits()
7127 return -EPROTO; in ath11k_reg_11d_new_cc_event()
7130 spin_lock_bh(&ab->base_lock); in ath11k_reg_11d_new_cc_event()
7131 memcpy(&ab->new_alpha2, &ev->new_alpha2, 2); in ath11k_reg_11d_new_cc_event()
7132 spin_unlock_bh(&ab->base_lock); in ath11k_reg_11d_new_cc_event()
7135 ab->new_alpha2[0], in ath11k_reg_11d_new_cc_event()
7136 ab->new_alpha2[1]); in ath11k_reg_11d_new_cc_event()
7140 for (i = 0; i < ab->num_radios; i++) { in ath11k_reg_11d_new_cc_event()
7141 pdev = &ab->pdevs[i]; in ath11k_reg_11d_new_cc_event()
7142 ar = pdev->ar; in ath11k_reg_11d_new_cc_event()
7143 ar->state_11d = ATH11K_11D_IDLE; in ath11k_reg_11d_new_cc_event()
7144 complete(&ar->completed_11d_scan); in ath11k_reg_11d_new_cc_event()
7147 queue_work(ab->workqueue, &ab->update_11d_work); in ath11k_reg_11d_new_cc_event()
7160 eid = ATH11K_SKB_CB(skb)->eid; in ath11k_wmi_htc_tx_complete()
7166 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_htc_tx_complete()
7167 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_htc_tx_complete()
7170 for (i = 0; i < ab->htc.wmi_ep_count; i++) { in ath11k_wmi_htc_tx_complete()
7171 if (ab->wmi_ab.wmi[i].eid == eid) { in ath11k_wmi_htc_tx_complete()
7172 wmi = &ab->wmi_ab.wmi[i]; in ath11k_wmi_htc_tx_complete()
7178 wake_up(&wmi->tx_ce_desc_wq); in ath11k_wmi_htc_tx_complete()
7189 return -ENOMEM; in ath11k_reg_chan_list_event()
7231 rdy_parse->num_extra_mac_addr = in ath11k_wmi_tlv_rdy_parse()
7234 ether_addr_copy(ab->mac_addr, in ath11k_wmi_tlv_rdy_parse()
7236 ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; in ath11k_wmi_tlv_rdy_parse()
7240 num_mac_addr = rdy_parse->num_extra_mac_addr; in ath11k_wmi_tlv_rdy_parse()
7242 if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) in ath11k_wmi_tlv_rdy_parse()
7245 for (i = 0; i < ab->num_radios; i++) { in ath11k_wmi_tlv_rdy_parse()
7246 pdev = &ab->pdevs[i]; in ath11k_wmi_tlv_rdy_parse()
7247 ether_addr_copy(pdev->mac_addr, addr_list[i].addr); in ath11k_wmi_tlv_rdy_parse()
7249 ab->pdevs_macaddr_valid = true; in ath11k_wmi_tlv_rdy_parse()
7263 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_ready_event()
7272 complete(&ab->wmi_ab.unified_ready); in ath11k_ready_event()
7297 complete(&ar->peer_delete_done); in ath11k_peer_delete_resp_event()
7323 complete(&ar->vdev_delete_done); in ath11k_vdev_delete_resp_event()
7369 ar->last_wmi_vdev_start_status = 0; in ath11k_vdev_start_resp_event()
7370 ar->max_allowed_tx_power = vdev_start_resp.max_allowed_tx_power; in ath11k_vdev_start_resp_event()
7376 ar->last_wmi_vdev_start_status = status; in ath11k_vdev_start_resp_event()
7379 complete(&ar->vdev_setup_done); in ath11k_vdev_start_resp_event()
7408 queue_work(ab->workqueue, &arvif->bcn_tx_work); in ath11k_bcn_tx_status_event()
7441 ev->peer_macaddr.addr, ev->peer_ps_state, in ath11k_wmi_event_peer_sta_ps_state_chg()
7442 ev->ps_supported_bitmap, ev->peer_ps_valid, in ath11k_wmi_event_peer_sta_ps_state_chg()
7443 ev->peer_ps_timestamp); in ath11k_wmi_event_peer_sta_ps_state_chg()
7447 spin_lock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7449 peer = ath11k_peer_find_by_addr(ab, ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7452 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7453 ath11k_warn(ab, "peer not found %pM\n", ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7457 ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); in ath11k_wmi_event_peer_sta_ps_state_chg()
7460 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7462 peer->vdev_id); in ath11k_wmi_event_peer_sta_ps_state_chg()
7467 sta = peer->sta; in ath11k_wmi_event_peer_sta_ps_state_chg()
7469 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7473 ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7479 spin_lock_bh(&ar->data_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7481 peer_previous_ps_state = arsta->peer_ps_state; in ath11k_wmi_event_peer_sta_ps_state_chg()
7482 arsta->peer_ps_state = ev->peer_ps_state; in ath11k_wmi_event_peer_sta_ps_state_chg()
7483 arsta->peer_current_ps_valid = !!ev->peer_ps_valid; in ath11k_wmi_event_peer_sta_ps_state_chg()
7486 ar->ab->wmi_ab.svc_map)) { in ath11k_wmi_event_peer_sta_ps_state_chg()
7487 if (!(ev->ps_supported_bitmap & WMI_PEER_PS_VALID) || in ath11k_wmi_event_peer_sta_ps_state_chg()
7488 !(ev->ps_supported_bitmap & WMI_PEER_PS_STATE_TIMESTAMP) || in ath11k_wmi_event_peer_sta_ps_state_chg()
7489 !ev->peer_ps_valid) in ath11k_wmi_event_peer_sta_ps_state_chg()
7492 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON) { in ath11k_wmi_event_peer_sta_ps_state_chg()
7493 arsta->ps_start_time = ev->peer_ps_timestamp; in ath11k_wmi_event_peer_sta_ps_state_chg()
7494 arsta->ps_start_jiffies = jiffies; in ath11k_wmi_event_peer_sta_ps_state_chg()
7495 } else if (arsta->peer_ps_state == WMI_PEER_PS_STATE_OFF && in ath11k_wmi_event_peer_sta_ps_state_chg()
7497 arsta->ps_total_duration = arsta->ps_total_duration + in ath11k_wmi_event_peer_sta_ps_state_chg()
7498 (ev->peer_ps_timestamp - arsta->ps_start_time); in ath11k_wmi_event_peer_sta_ps_state_chg()
7501 if (ar->ps_timekeeper_enable) in ath11k_wmi_event_peer_sta_ps_state_chg()
7502 trace_ath11k_ps_timekeeper(ar, ev->peer_macaddr.addr, in ath11k_wmi_event_peer_sta_ps_state_chg()
7503 ev->peer_ps_timestamp, in ath11k_wmi_event_peer_sta_ps_state_chg()
7504 arsta->peer_ps_state); in ath11k_wmi_event_peer_sta_ps_state_chg()
7508 spin_unlock_bh(&ar->data_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7535 complete(&ar->vdev_setup_done); in ath11k_vdev_stopped_event()
7552 ath11k_warn(ab, "failed to extract mgmt rx event"); in ath11k_mgmt_rx_event()
7559 ath11k_dbg(ab, ATH11K_DBG_MGMT, "event mgmt rx status %08x\n", in ath11k_mgmt_rx_event()
7572 if ((test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) || in ath11k_mgmt_rx_event()
7580 status->flag |= RX_FLAG_MMIC_ERROR; in ath11k_mgmt_rx_event()
7584 status->band = NL80211_BAND_6GHZ; in ath11k_mgmt_rx_event()
7585 status->freq = rx_ev.chan_freq; in ath11k_mgmt_rx_event()
7587 status->band = NL80211_BAND_2GHZ; in ath11k_mgmt_rx_event()
7589 status->band = NL80211_BAND_5GHZ; in ath11k_mgmt_rx_event()
7600 (status->band == NL80211_BAND_5GHZ || status->band == NL80211_BAND_6GHZ)) in ath11k_mgmt_rx_event()
7602 "mgmt rx 11b (CCK) on 5/6GHz, band = %d\n", status->band); in ath11k_mgmt_rx_event()
7604 sband = &ar->mac.sbands[status->band]; in ath11k_mgmt_rx_event()
7606 if (status->band != NL80211_BAND_6GHZ) in ath11k_mgmt_rx_event()
7607 status->freq = ieee80211_channel_to_frequency(rx_ev.channel, in ath11k_mgmt_rx_event()
7608 status->band); in ath11k_mgmt_rx_event()
7610 status->signal = rx_ev.snr + ATH11K_DEFAULT_NOISE_FLOOR; in ath11k_mgmt_rx_event()
7611 status->rate_idx = ath11k_mac_bitrate_to_idx(sband, rx_ev.rate / 100); in ath11k_mgmt_rx_event()
7613 hdr = (struct ieee80211_hdr *)skb->data; in ath11k_mgmt_rx_event()
7614 fc = le16_to_cpu(hdr->frame_control); in ath11k_mgmt_rx_event()
7620 status->flag |= RX_FLAG_SKIP_MONITOR; in ath11k_mgmt_rx_event()
7626 if (ieee80211_has_protected(hdr->frame_control) && in ath11k_mgmt_rx_event()
7628 status->flag |= RX_FLAG_DECRYPTED; in ath11k_mgmt_rx_event()
7631 status->flag |= RX_FLAG_IV_STRIPPED | in ath11k_mgmt_rx_event()
7633 hdr->frame_control = __cpu_to_le16(fc & in ath11k_mgmt_rx_event()
7638 if (ieee80211_is_beacon(hdr->frame_control)) in ath11k_mgmt_rx_event()
7642 "event mgmt rx skb %p len %d ftype %02x stype %02x\n", in ath11k_mgmt_rx_event()
7643 skb, skb->len, in ath11k_mgmt_rx_event()
7647 "event mgmt rx freq %d band %d snr %d, rate_idx %d\n", in ath11k_mgmt_rx_event()
7648 status->freq, status->band, status->signal, in ath11k_mgmt_rx_event()
7649 status->rate_idx); in ath11k_mgmt_rx_event()
7651 ieee80211_rx_ni(ar->hw, skb); in ath11k_mgmt_rx_event()
7694 for (i = 0; i < ab->num_radios; i++) { in ath11k_get_ar_on_scan_state()
7695 pdev = rcu_dereference(ab->pdevs_active[i]); in ath11k_get_ar_on_scan_state()
7696 if (pdev && pdev->ar) { in ath11k_get_ar_on_scan_state()
7697 ar = pdev->ar; in ath11k_get_ar_on_scan_state()
7699 spin_lock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
7700 if (ar->scan.state == state && in ath11k_get_ar_on_scan_state()
7701 ar->scan.vdev_id == vdev_id) { in ath11k_get_ar_on_scan_state()
7702 spin_unlock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
7705 spin_unlock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
7746 spin_lock_bh(&ar->data_lock); in ath11k_scan_event()
7753 ath11k_scan_state_str(ar->scan.state), ar->scan.state); in ath11k_scan_event()
7782 spin_unlock_bh(&ar->data_lock); in ath11k_scan_event()
7802 spin_lock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
7809 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
7813 vdev_id = peer->vdev_id; in ath11k_peer_sta_kickout_event()
7815 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
7820 peer->vdev_id); in ath11k_peer_sta_kickout_event()
7824 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_peer_sta_kickout_event()
7891 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_chan_info_event()
7918 spin_lock_bh(&ar->data_lock); in ath11k_chan_info_event()
7920 switch (ar->scan.state) { in ath11k_chan_info_event()
7931 if (idx >= ARRAY_SIZE(ar->survey)) { in ath11k_chan_info_event()
7944 survey = &ar->survey[idx]; in ath11k_chan_info_event()
7946 survey->noise = ch_info_ev.noise_floor; in ath11k_chan_info_event()
7947 survey->filled = SURVEY_INFO_NOISE_DBM | SURVEY_INFO_TIME | in ath11k_chan_info_event()
7949 survey->time = div_u64(ch_info_ev.cycle_count, cc_freq_hz); in ath11k_chan_info_event()
7950 survey->time_busy = div_u64(ch_info_ev.rx_clear_count, cc_freq_hz); in ath11k_chan_info_event()
7953 spin_unlock_bh(&ar->data_lock); in ath11k_chan_info_event()
7963 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_pdev_bss_chan_info_event()
7964 u64 busy, total, tx, rx, rx_bss; in ath11k_pdev_bss_chan_info_event() local
7981 rx = (u64)(bss_ch_info_ev.rx_cycle_count_high) << 32 | in ath11k_pdev_bss_chan_info_event()
7988 … info:\n pdev_id: %d freq: %d noise: %d cycle: busy %llu total %llu tx %llu rx %llu rx_bss %llu\n", in ath11k_pdev_bss_chan_info_event()
7991 tx, rx, rx_bss); in ath11k_pdev_bss_chan_info_event()
8003 spin_lock_bh(&ar->data_lock); in ath11k_pdev_bss_chan_info_event()
8005 if (idx >= ARRAY_SIZE(ar->survey)) { in ath11k_pdev_bss_chan_info_event()
8011 survey = &ar->survey[idx]; in ath11k_pdev_bss_chan_info_event()
8013 survey->noise = bss_ch_info_ev.noise_floor; in ath11k_pdev_bss_chan_info_event()
8014 survey->time = div_u64(total, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8015 survey->time_busy = div_u64(busy, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8016 survey->time_rx = div_u64(rx_bss, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8017 survey->time_tx = div_u64(tx, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8018 survey->filled |= (SURVEY_INFO_NOISE_DBM | in ath11k_pdev_bss_chan_info_event()
8024 spin_unlock_bh(&ar->data_lock); in ath11k_pdev_bss_chan_info_event()
8025 complete(&ar->bss_survey_done); in ath11k_pdev_bss_chan_info_event()
8055 ar->install_key_status = 0; in ath11k_vdev_install_key_compl_event()
8060 ar->install_key_status = install_key_compl.status; in ath11k_vdev_install_key_compl_event()
8063 complete(&ar->install_key_done); in ath11k_vdev_install_key_compl_event()
8082 if (ev->wmi_service_segment_bitmap[i] & in ath11k_wmi_tlv_services_parser()
8084 set_bit(j, ab->wmi_ab.svc_map); in ath11k_wmi_tlv_services_parser()
8090 ev->wmi_service_segment_bitmap[0], in ath11k_wmi_tlv_services_parser()
8091 ev->wmi_service_segment_bitmap[1], in ath11k_wmi_tlv_services_parser()
8092 ev->wmi_service_segment_bitmap[2], in ath11k_wmi_tlv_services_parser()
8093 ev->wmi_service_segment_bitmap[3]); in ath11k_wmi_tlv_services_parser()
8103 set_bit(j, ab->wmi_ab.svc_map); in ath11k_wmi_tlv_services_parser()
8120 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_available_event()
8153 complete(&ar->peer_assoc_done); in ath11k_peer_assoc_conf_event()
8184 spin_lock_bh(&ar->data_lock); in ath11k_update_stats_event()
8190 list_splice_tail_init(&stats.pdevs, &ar->fw_stats.pdevs); in ath11k_update_stats_event()
8191 ar->fw_stats_done = true; in ath11k_update_stats_event()
8202 complete(&ar->fw_stats_complete); in ath11k_update_stats_event()
8204 spin_unlock_bh(&ar->data_lock); in ath11k_update_stats_event()
8241 ev->ctl_failsafe_status); in ath11k_pdev_ctl_failsafe_check_event()
8246 if (ev->ctl_failsafe_status != 0) in ath11k_pdev_ctl_failsafe_check_event()
8248 ev->ctl_failsafe_status); in ath11k_pdev_ctl_failsafe_check_event()
8262 if (ev->current_switch_count) in ath11k_wmi_process_csa_switch_count_event()
8266 for (i = 0; i < ev->num_vdevs; i++) { in ath11k_wmi_process_csa_switch_count_event()
8275 if (arvif->is_up && arvif->vif->bss_conf.csa_active) in ath11k_wmi_process_csa_switch_count_event()
8276 ieee80211_csa_finish(arvif->vif, 0); in ath11k_wmi_process_csa_switch_count_event()
8308 ev->current_switch_count, ev->pdev_id, in ath11k_wmi_pdev_csa_switch_count_status_event()
8309 ev->num_vdevs); in ath11k_wmi_pdev_csa_switch_count_status_event()
8341 ev->pdev_id, ev->detection_mode, ev->chan_freq, ev->chan_width, in ath11k_wmi_pdev_dfs_radar_detected_event()
8342 ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, in ath11k_wmi_pdev_dfs_radar_detected_event()
8343 ev->freq_offset, ev->sidx); in ath11k_wmi_pdev_dfs_radar_detected_event()
8347 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8351 ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8355 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "DFS Radar Detected in pdev %d\n", in ath11k_wmi_pdev_dfs_radar_detected_event()
8356 ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8358 if (ar->dfs_block_radar_events) in ath11k_wmi_pdev_dfs_radar_detected_event()
8361 ieee80211_radar_detected(ar->hw, NULL); in ath11k_wmi_pdev_dfs_radar_detected_event()
8393 ev->temp, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8397 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8399 ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8403 ath11k_thermal_event_temperature(ar, ev->temp); in ath11k_wmi_pdev_temperature_event()
8438 ev->vdev_id, ev->fils_tt, ev->tbtt); in ath11k_fils_discovery_event()
8469 if (ev->tx_status) in ath11k_probe_resp_tx_status_event()
8472 ev->vdev_id, ev->tx_status); in ath11k_probe_resp_tx_status_event()
8489 ev->wake_reason, wow_reason(ev->wake_reason)); in ath11k_wmi_tlv_wow_wakeup_host_parse()
8493 if (ev && ev->wake_reason == WOW_REASON_PAGE_FAULT) { in ath11k_wmi_tlv_wow_wakeup_host_parse()
8519 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_event_wow_wakeup_host()
8529 complete(&ab->wow.wakeup_completed); in ath11k_wmi_event_wow_wakeup_host()
8538 trace_ath11k_wmi_diag(ab, skb->data, skb->len); in ath11k_wmi_diag_event()
8593 if (ev->status) in ath11k_wmi_twt_add_dialog_event()
8596 ev->vdev_id, ev->dialog_id, in ath11k_wmi_twt_add_dialog_event()
8597 ath11k_wmi_twt_add_dialog_event_status(ev->status)); in ath11k_wmi_twt_add_dialog_event()
8629 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); in ath11k_wmi_gtk_offload_status_event()
8632 ev->vdev_id); in ath11k_wmi_gtk_offload_status_event()
8637 ev->refresh_cnt); in ath11k_wmi_gtk_offload_status_event()
8639 NULL, ev->replay_ctr.counter, GTK_REPLAY_COUNTER_BYTES); in ath11k_wmi_gtk_offload_status_event()
8641 replay_ctr = ev->replay_ctr.word1; in ath11k_wmi_gtk_offload_status_event()
8642 replay_ctr = (replay_ctr << 32) | ev->replay_ctr.word0; in ath11k_wmi_gtk_offload_status_event()
8643 arvif->rekey_data.replay_ctr = replay_ctr; in ath11k_wmi_gtk_offload_status_event()
8645 /* supplicant expects big-endian replay counter */ in ath11k_wmi_gtk_offload_status_event()
8648 ieee80211_gtk_rekey_notify(arvif->vif, arvif->bssid, in ath11k_wmi_gtk_offload_status_event()
8678 vdev_id = ev->vdev_id; in ath11k_wmi_p2p_noa_event()
8679 noa_descriptors = u32_get_bits(noa->noa_attr, in ath11k_wmi_p2p_noa_event()
8713 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath11k_wmi_tlv_op_rx()
8714 id = FIELD_GET(WMI_CMD_HDR_CMD_ID, (cmd_hdr->cmd_id)); in ath11k_wmi_tlv_op_rx()
8716 trace_ath11k_wmi_event(ab, id, skb->data, skb->len); in ath11k_wmi_tlv_op_rx()
8869 status = ath11k_htc_connect_service(&ab->htc, &conn_req, &conn_resp); in ath11k_connect_pdev_htc_service()
8876 ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid; in ath11k_connect_pdev_htc_service()
8877 ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid; in ath11k_connect_pdev_htc_service()
8878 ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len; in ath11k_connect_pdev_htc_service()
8879 init_waitqueue_head(&ab->wmi_ab.wmi[pdev_idx].tx_ce_desc_wq); in ath11k_connect_pdev_htc_service()
8889 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_unit_test_cmd()
8902 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, buf_len); in ath11k_wmi_send_unit_test_cmd()
8904 return -ENOMEM; in ath11k_wmi_send_unit_test_cmd()
8906 cmd = (struct wmi_unit_test_cmd *)skb->data; in ath11k_wmi_send_unit_test_cmd()
8907 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_UNIT_TEST_CMD) | in ath11k_wmi_send_unit_test_cmd()
8908 FIELD_PREP(WMI_TLV_LEN, sizeof(ut_cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_unit_test_cmd()
8910 cmd->vdev_id = ut_cmd.vdev_id; in ath11k_wmi_send_unit_test_cmd()
8911 cmd->module_id = ut_cmd.module_id; in ath11k_wmi_send_unit_test_cmd()
8912 cmd->num_args = ut_cmd.num_args; in ath11k_wmi_send_unit_test_cmd()
8913 cmd->diag_token = ut_cmd.diag_token; in ath11k_wmi_send_unit_test_cmd()
8915 ptr = skb->data + sizeof(ut_cmd); in ath11k_wmi_send_unit_test_cmd()
8918 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_send_unit_test_cmd()
8930 ath11k_warn(ar->ab, "failed to send WMI_UNIT_TEST CMD :%d\n", in ath11k_wmi_send_unit_test_cmd()
8935 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_unit_test_cmd()
8937 cmd->module_id, cmd->vdev_id, cmd->num_args, in ath11k_wmi_send_unit_test_cmd()
8938 cmd->diag_token); in ath11k_wmi_send_unit_test_cmd()
8950 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wmi_simulate_radar()
8951 if (arvif->is_started && arvif->vdev_type == WMI_VDEV_TYPE_AP) { in ath11k_wmi_simulate_radar()
8958 return -EINVAL; in ath11k_wmi_simulate_radar()
8961 dfs_args[DFS_TEST_PDEV_ID] = ar->pdev->pdev_id; in ath11k_wmi_simulate_radar()
8962 /* Currently we could pass segment_id(b0 - b1), chirp(b2) in ath11k_wmi_simulate_radar()
8963 * freq offset (b3 - b10) to unit test. For simulation in ath11k_wmi_simulate_radar()
8968 wmi_ut.vdev_id = arvif->vdev_id; in ath11k_wmi_simulate_radar()
8973 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "Triggering Radar Simulation\n"); in ath11k_wmi_simulate_radar()
8981 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_fw_dbglog_cfg()
8988 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_fw_dbglog_cfg()
8990 return -ENOMEM; in ath11k_wmi_fw_dbglog_cfg()
8992 cmd = (struct wmi_debug_log_config_cmd_fixed_param *)skb->data; in ath11k_wmi_fw_dbglog_cfg()
8993 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DEBUG_LOG_CONFIG_CMD) | in ath11k_wmi_fw_dbglog_cfg()
8994 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_fw_dbglog_cfg()
8995 cmd->dbg_log_param = dbglog->param; in ath11k_wmi_fw_dbglog_cfg()
8998 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_fw_dbglog_cfg()
9001 switch (dbglog->param) { in ath11k_wmi_fw_dbglog_cfg()
9006 cmd->value = dbglog->value; in ath11k_wmi_fw_dbglog_cfg()
9010 cmd->value = dbglog->value; in ath11k_wmi_fw_dbglog_cfg()
9011 memcpy(tlv->value, module_id_bitmap, in ath11k_wmi_fw_dbglog_cfg()
9019 return -EINVAL; in ath11k_wmi_fw_dbglog_cfg()
9024 ath11k_warn(ar->ab, in ath11k_wmi_fw_dbglog_cfg()
9029 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd dbglog cfg"); in ath11k_wmi_fw_dbglog_cfg()
9039 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_connect()
9040 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_connect()
9041 return -1; in ath11k_wmi_connect()
9062 if (pdev_id >= ab->hw_params.max_radios) in ath11k_wmi_pdev_attach()
9063 return -EINVAL; in ath11k_wmi_pdev_attach()
9065 wmi_handle = &ab->wmi_ab.wmi[pdev_id]; in ath11k_wmi_pdev_attach()
9067 wmi_handle->wmi_ab = &ab->wmi_ab; in ath11k_wmi_pdev_attach()
9069 ab->wmi_ab.ab = ab; in ath11k_wmi_pdev_attach()
9083 ab->wmi_ab.ab = ab; in ath11k_wmi_attach()
9084 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_MAX; in ath11k_wmi_attach()
9087 if (ab->hw_params.single_pdev_only && ab->hw_params.num_rxdma_per_pdev > 1) in ath11k_wmi_attach()
9088 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_SINGLE; in ath11k_wmi_attach()
9091 init_completion(&ab->wmi_ab.service_ready); in ath11k_wmi_attach()
9092 init_completion(&ab->wmi_ab.unified_ready); in ath11k_wmi_attach()
9103 for (i = 0; i < ab->htc.wmi_ep_count; i++) in ath11k_wmi_detach()
9117 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_hw_data_filter_cmd()
9120 return -ENOMEM; in ath11k_wmi_hw_data_filter_cmd()
9122 cmd = (struct wmi_hw_data_filter_cmd *)skb->data; in ath11k_wmi_hw_data_filter_cmd()
9123 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_HW_DATA_FILTER_CMD) | in ath11k_wmi_hw_data_filter_cmd()
9124 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_hw_data_filter_cmd()
9126 cmd->vdev_id = vdev_id; in ath11k_wmi_hw_data_filter_cmd()
9127 cmd->enable = enable; in ath11k_wmi_hw_data_filter_cmd()
9130 if (cmd->enable) in ath11k_wmi_hw_data_filter_cmd()
9131 cmd->hw_filter_bitmap = filter_bitmap; in ath11k_wmi_hw_data_filter_cmd()
9133 cmd->hw_filter_bitmap = ((u32)~0U); in ath11k_wmi_hw_data_filter_cmd()
9135 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_hw_data_filter_cmd()
9139 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_HW_DATA_FILTER_CMDID); in ath11k_wmi_hw_data_filter_cmd()
9149 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_host_wakeup_ind()
9151 return -ENOMEM; in ath11k_wmi_wow_host_wakeup_ind()
9153 cmd = (struct wmi_wow_host_wakeup_ind *)skb->data; in ath11k_wmi_wow_host_wakeup_ind()
9154 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_host_wakeup_ind()
9156 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_host_wakeup_ind()
9158 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow host wakeup ind\n"); in ath11k_wmi_wow_host_wakeup_ind()
9160 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID); in ath11k_wmi_wow_host_wakeup_ind()
9170 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_enable()
9172 return -ENOMEM; in ath11k_wmi_wow_enable()
9174 cmd = (struct wmi_wow_enable_cmd *)skb->data; in ath11k_wmi_wow_enable()
9175 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ENABLE_CMD) | in ath11k_wmi_wow_enable()
9176 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_enable()
9178 cmd->enable = 1; in ath11k_wmi_wow_enable()
9179 cmd->pause_iface_config = WOW_IFACE_PAUSE_ENABLED; in ath11k_wmi_wow_enable()
9180 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow enable\n"); in ath11k_wmi_wow_enable()
9182 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_CMDID); in ath11k_wmi_wow_enable()
9197 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_scan_prob_req_oui()
9199 return -ENOMEM; in ath11k_wmi_scan_prob_req_oui()
9201 cmd = (struct wmi_scan_prob_req_oui_cmd *)skb->data; in ath11k_wmi_scan_prob_req_oui()
9202 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_scan_prob_req_oui()
9204 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_scan_prob_req_oui()
9205 cmd->prob_req_oui = prob_req_oui; in ath11k_wmi_scan_prob_req_oui()
9207 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "scan prob req oui %d\n", in ath11k_wmi_scan_prob_req_oui()
9210 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_SCAN_PROB_REQ_OUI_CMDID); in ath11k_wmi_scan_prob_req_oui()
9222 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_add_wakeup_event()
9224 return -ENOMEM; in ath11k_wmi_wow_add_wakeup_event()
9226 cmd = (struct wmi_wow_add_del_event_cmd *)skb->data; in ath11k_wmi_wow_add_wakeup_event()
9227 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ADD_DEL_EVT_CMD) | in ath11k_wmi_wow_add_wakeup_event()
9228 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_wakeup_event()
9230 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_add_wakeup_event()
9231 cmd->is_add = enable; in ath11k_wmi_wow_add_wakeup_event()
9232 cmd->event_bitmap = (1 << event); in ath11k_wmi_wow_add_wakeup_event()
9234 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()
9237 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID); in ath11k_wmi_wow_add_wakeup_event()
9260 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_add_pattern()
9262 return -ENOMEM; in ath11k_wmi_wow_add_pattern()
9265 ptr = (u8 *)skb->data; in ath11k_wmi_wow_add_pattern()
9267 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9269 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_pattern()
9271 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_add_pattern()
9272 cmd->pattern_id = pattern_id; in ath11k_wmi_wow_add_pattern()
9273 cmd->pattern_type = WOW_BITMAP_PATTERN; in ath11k_wmi_wow_add_pattern()
9279 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9286 bitmap->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9288 FIELD_PREP(WMI_TLV_LEN, sizeof(*bitmap) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_pattern()
9290 memcpy(bitmap->patternbuf, pattern, pattern_len); in ath11k_wmi_wow_add_pattern()
9291 ath11k_ce_byte_swap(bitmap->patternbuf, roundup(pattern_len, 4)); in ath11k_wmi_wow_add_pattern()
9292 memcpy(bitmap->bitmaskbuf, mask, pattern_len); in ath11k_wmi_wow_add_pattern()
9293 ath11k_ce_byte_swap(bitmap->bitmaskbuf, roundup(pattern_len, 4)); in ath11k_wmi_wow_add_pattern()
9294 bitmap->pattern_offset = pattern_offset; in ath11k_wmi_wow_add_pattern()
9295 bitmap->pattern_len = pattern_len; in ath11k_wmi_wow_add_pattern()
9296 bitmap->bitmask_len = pattern_len; in ath11k_wmi_wow_add_pattern()
9297 bitmap->pattern_id = pattern_id; in ath11k_wmi_wow_add_pattern()
9303 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9311 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9319 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9327 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9335 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9339 …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()
9342 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ADD_WAKE_PATTERN_CMDID); in ath11k_wmi_wow_add_pattern()
9352 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_del_pattern()
9354 return -ENOMEM; in ath11k_wmi_wow_del_pattern()
9356 cmd = (struct wmi_wow_del_pattern_cmd *)skb->data; in ath11k_wmi_wow_del_pattern()
9357 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_del_pattern()
9359 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_del_pattern()
9361 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_del_pattern()
9362 cmd->pattern_id = pattern_id; in ath11k_wmi_wow_del_pattern()
9363 cmd->pattern_type = WOW_BITMAP_PATTERN; in ath11k_wmi_wow_del_pattern()
9365 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow del pattern vdev_id %d pattern_id %d\n", in ath11k_wmi_wow_del_pattern()
9368 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_DEL_WAKE_PATTERN_CMDID); in ath11k_wmi_wow_del_pattern()
9393 channel_list_len = sizeof(u32) * pno->a_networks[0].channel_count; in ath11k_wmi_op_gen_config_pno_start()
9396 nlo_list_len = sizeof(*nlo_list) * pno->uc_networks_count; in ath11k_wmi_op_gen_config_pno_start()
9399 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_op_gen_config_pno_start()
9401 return ERR_PTR(-ENOMEM); in ath11k_wmi_op_gen_config_pno_start()
9403 ptr = (u8 *)skb->data; in ath11k_wmi_op_gen_config_pno_start()
9405 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NLO_CONFIG_CMD) | in ath11k_wmi_op_gen_config_pno_start()
9406 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_op_gen_config_pno_start()
9408 cmd->vdev_id = pno->vdev_id; in ath11k_wmi_op_gen_config_pno_start()
9409 cmd->flags = WMI_NLO_CONFIG_START | WMI_NLO_CONFIG_SSID_HIDE_EN; in ath11k_wmi_op_gen_config_pno_start()
9411 /* current FW does not support min-max range for dwell time */ in ath11k_wmi_op_gen_config_pno_start()
9412 cmd->active_dwell_time = pno->active_max_time; in ath11k_wmi_op_gen_config_pno_start()
9413 cmd->passive_dwell_time = pno->passive_max_time; in ath11k_wmi_op_gen_config_pno_start()
9415 if (pno->do_passive_scan) in ath11k_wmi_op_gen_config_pno_start()
9416 cmd->flags |= WMI_NLO_CONFIG_SCAN_PASSIVE; in ath11k_wmi_op_gen_config_pno_start()
9418 cmd->fast_scan_period = pno->fast_scan_period; in ath11k_wmi_op_gen_config_pno_start()
9419 cmd->slow_scan_period = pno->slow_scan_period; in ath11k_wmi_op_gen_config_pno_start()
9420 cmd->fast_scan_max_cycles = pno->fast_scan_max_cycles; in ath11k_wmi_op_gen_config_pno_start()
9421 cmd->delay_start_time = pno->delay_start_time; in ath11k_wmi_op_gen_config_pno_start()
9423 if (pno->enable_pno_scan_randomization) { in ath11k_wmi_op_gen_config_pno_start()
9424 cmd->flags |= WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ | in ath11k_wmi_op_gen_config_pno_start()
9426 ether_addr_copy(cmd->mac_addr.addr, pno->mac_addr); in ath11k_wmi_op_gen_config_pno_start()
9427 ether_addr_copy(cmd->mac_mask.addr, pno->mac_addr_mask); in ath11k_wmi_op_gen_config_pno_start()
9428 ath11k_ce_byte_swap(cmd->mac_addr.addr, 8); in ath11k_wmi_op_gen_config_pno_start()
9429 ath11k_ce_byte_swap(cmd->mac_mask.addr, 8); in ath11k_wmi_op_gen_config_pno_start()
9435 cmd->no_of_ssids = pno->uc_networks_count; in ath11k_wmi_op_gen_config_pno_start()
9437 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_op_gen_config_pno_start()
9443 for (i = 0; i < cmd->no_of_ssids; i++) { in ath11k_wmi_op_gen_config_pno_start()
9445 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_op_gen_config_pno_start()
9446 FIELD_PREP(WMI_TLV_LEN, sizeof(*nlo_list) - sizeof(*tlv)); in ath11k_wmi_op_gen_config_pno_start()
9449 nlo_list[i].ssid.ssid.ssid_len = pno->a_networks[i].ssid.ssid_len; in ath11k_wmi_op_gen_config_pno_start()
9451 pno->a_networks[i].ssid.ssid, in ath11k_wmi_op_gen_config_pno_start()
9456 if (pno->a_networks[i].rssi_threshold && in ath11k_wmi_op_gen_config_pno_start()
9457 pno->a_networks[i].rssi_threshold > -300) { in ath11k_wmi_op_gen_config_pno_start()
9460 pno->a_networks[i].rssi_threshold; in ath11k_wmi_op_gen_config_pno_start()
9465 pno->a_networks[i].bcast_nw_type; in ath11k_wmi_op_gen_config_pno_start()
9469 cmd->num_of_channels = pno->a_networks[0].channel_count; in ath11k_wmi_op_gen_config_pno_start()
9471 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_op_gen_config_pno_start()
9475 for (i = 0; i < cmd->num_of_channels; i++) in ath11k_wmi_op_gen_config_pno_start()
9476 channel_list[i] = pno->a_networks[0].channels[i]; in ath11k_wmi_op_gen_config_pno_start()
9478 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv start pno config vdev_id %d\n", in ath11k_wmi_op_gen_config_pno_start()
9492 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_op_gen_config_pno_stop()
9494 return ERR_PTR(-ENOMEM); in ath11k_wmi_op_gen_config_pno_stop()
9496 cmd = (struct wmi_wow_nlo_config_cmd *)skb->data; in ath11k_wmi_op_gen_config_pno_stop()
9497 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NLO_CONFIG_CMD) | in ath11k_wmi_op_gen_config_pno_stop()
9498 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_op_gen_config_pno_stop()
9500 cmd->vdev_id = vdev_id; in ath11k_wmi_op_gen_config_pno_stop()
9501 cmd->flags = WMI_NLO_CONFIG_STOP; in ath11k_wmi_op_gen_config_pno_stop()
9503 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_op_gen_config_pno_stop()
9513 if (pno_scan->enable) in ath11k_wmi_wow_config_pno()
9519 return -ENOMEM; in ath11k_wmi_wow_config_pno()
9521 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); in ath11k_wmi_wow_config_pno()
9536 ns_cnt = offload->ipv6_count; in ath11k_wmi_fill_ns_offload()
9541 ns_ext_tuples = offload->ipv6_count - WMI_MAX_NS_OFFLOADS; in ath11k_wmi_fill_ns_offload()
9542 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_ns_offload()
9545 max_offloads = offload->ipv6_count; in ath11k_wmi_fill_ns_offload()
9547 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_ns_offload()
9557 ns->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NS_OFFLOAD_TUPLE) | in ath11k_wmi_fill_ns_offload()
9558 FIELD_PREP(WMI_TLV_LEN, sizeof(*ns) - TLV_HDR_SIZE); in ath11k_wmi_fill_ns_offload()
9562 ns->flags |= WMI_NSOL_FLAGS_VALID; in ath11k_wmi_fill_ns_offload()
9564 memcpy(ns->target_ipaddr[0], offload->ipv6_addr[i], 16); in ath11k_wmi_fill_ns_offload()
9565 memcpy(ns->solicitation_ipaddr, offload->self_ipv6_addr[i], 16); in ath11k_wmi_fill_ns_offload()
9566 ath11k_ce_byte_swap(ns->target_ipaddr[0], 16); in ath11k_wmi_fill_ns_offload()
9567 ath11k_ce_byte_swap(ns->solicitation_ipaddr, 16); in ath11k_wmi_fill_ns_offload()
9569 if (offload->ipv6_type[i]) in ath11k_wmi_fill_ns_offload()
9570 ns->flags |= WMI_NSOL_FLAGS_IS_IPV6_ANYCAST; in ath11k_wmi_fill_ns_offload()
9572 memcpy(ns->target_mac.addr, offload->mac_addr, ETH_ALEN); in ath11k_wmi_fill_ns_offload()
9573 ath11k_ce_byte_swap(ns->target_mac.addr, 8); in ath11k_wmi_fill_ns_offload()
9575 if (ns->target_mac.word0 != 0 || in ath11k_wmi_fill_ns_offload()
9576 ns->target_mac.word1 != 0) { in ath11k_wmi_fill_ns_offload()
9577 ns->flags |= WMI_NSOL_FLAGS_MAC_VALID; in ath11k_wmi_fill_ns_offload()
9580 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fill_ns_offload()
9582 i, ns->solicitation_ipaddr, in ath11k_wmi_fill_ns_offload()
9583 ns->target_ipaddr[0]); in ath11k_wmi_fill_ns_offload()
9604 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_arp_offload()
9610 arp->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARP_OFFLOAD_TUPLE) | in ath11k_wmi_fill_arp_offload()
9611 FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE); in ath11k_wmi_fill_arp_offload()
9613 if (enable && i < offload->ipv4_count) { in ath11k_wmi_fill_arp_offload()
9615 arp->flags = WMI_ARPOL_FLAGS_VALID; in ath11k_wmi_fill_arp_offload()
9616 memcpy(arp->target_ipaddr, offload->ipv4_addr[i], 4); in ath11k_wmi_fill_arp_offload()
9617 ath11k_ce_byte_swap(arp->target_ipaddr, 4); in ath11k_wmi_fill_arp_offload()
9619 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "arp offload address %pI4", in ath11k_wmi_fill_arp_offload()
9620 arp->target_ipaddr); in ath11k_wmi_fill_arp_offload()
9640 offload = &arvif->arp_ns_offload; in ath11k_wmi_arp_ns_offload()
9641 ns_cnt = offload->ipv6_count; in ath11k_wmi_arp_ns_offload()
9650 ns_ext_tuples = ns_cnt - WMI_MAX_NS_OFFLOADS; in ath11k_wmi_arp_ns_offload()
9655 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_arp_ns_offload()
9657 return -ENOMEM; in ath11k_wmi_arp_ns_offload()
9659 buf_ptr = skb->data; in ath11k_wmi_arp_ns_offload()
9661 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_arp_ns_offload()
9663 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_arp_ns_offload()
9665 cmd->flags = 0; in ath11k_wmi_arp_ns_offload()
9666 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_arp_ns_offload()
9667 cmd->num_ns_ext_tuples = ns_ext_tuples; in ath11k_wmi_arp_ns_offload()
9677 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_SET_ARP_NS_OFFLOAD_CMDID); in ath11k_wmi_arp_ns_offload()
9684 struct ath11k_rekey_data *rekey_data = &arvif->rekey_data; in ath11k_wmi_gtk_rekey_offload()
9690 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_gtk_rekey_offload()
9692 return -ENOMEM; in ath11k_wmi_gtk_rekey_offload()
9694 cmd = (struct wmi_gtk_rekey_offload_cmd *)skb->data; in ath11k_wmi_gtk_rekey_offload()
9695 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_GTK_OFFLOAD_CMD) | in ath11k_wmi_gtk_rekey_offload()
9696 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_gtk_rekey_offload()
9698 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_gtk_rekey_offload()
9701 cmd->flags = GTK_OFFLOAD_ENABLE_OPCODE; in ath11k_wmi_gtk_rekey_offload()
9704 memcpy(cmd->kck, rekey_data->kck, sizeof(cmd->kck)); in ath11k_wmi_gtk_rekey_offload()
9705 ath11k_ce_byte_swap(cmd->kck, GTK_OFFLOAD_KEK_BYTES); in ath11k_wmi_gtk_rekey_offload()
9706 memcpy(cmd->kek, rekey_data->kek, sizeof(cmd->kek)); in ath11k_wmi_gtk_rekey_offload()
9707 ath11k_ce_byte_swap(cmd->kek, GTK_OFFLOAD_KEK_BYTES); in ath11k_wmi_gtk_rekey_offload()
9709 replay_ctr = cpu_to_le64(rekey_data->replay_ctr); in ath11k_wmi_gtk_rekey_offload()
9710 memcpy(cmd->replay_ctr, &replay_ctr, in ath11k_wmi_gtk_rekey_offload()
9712 ath11k_ce_byte_swap(cmd->replay_ctr, GTK_REPLAY_COUNTER_BYTES); in ath11k_wmi_gtk_rekey_offload()
9714 cmd->flags = GTK_OFFLOAD_DISABLE_OPCODE; in ath11k_wmi_gtk_rekey_offload()
9717 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "offload gtk rekey vdev: %d %d\n", in ath11k_wmi_gtk_rekey_offload()
9718 arvif->vdev_id, enable); in ath11k_wmi_gtk_rekey_offload()
9719 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_GTK_OFFLOAD_CMDID); in ath11k_wmi_gtk_rekey_offload()
9730 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_gtk_rekey_getinfo()
9732 return -ENOMEM; in ath11k_wmi_gtk_rekey_getinfo()
9734 cmd = (struct wmi_gtk_rekey_offload_cmd *)skb->data; in ath11k_wmi_gtk_rekey_getinfo()
9735 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_GTK_OFFLOAD_CMD) | in ath11k_wmi_gtk_rekey_getinfo()
9736 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_gtk_rekey_getinfo()
9738 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_gtk_rekey_getinfo()
9739 cmd->flags = GTK_OFFLOAD_REQUEST_STATUS_OPCODE; in ath11k_wmi_gtk_rekey_getinfo()
9741 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "get gtk rekey vdev_id: %d\n", in ath11k_wmi_gtk_rekey_getinfo()
9742 arvif->vdev_id); in ath11k_wmi_gtk_rekey_getinfo()
9743 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_GTK_OFFLOAD_CMDID); in ath11k_wmi_gtk_rekey_getinfo()
9747 { struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_bios_sar_table_param()
9760 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_bios_sar_table_param()
9762 return -ENOMEM; in ath11k_wmi_pdev_set_bios_sar_table_param()
9764 cmd = (struct wmi_pdev_set_sar_table_cmd *)skb->data; in ath11k_wmi_pdev_set_bios_sar_table_param()
9765 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()
9766 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_bios_sar_table_param()
9767 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_bios_sar_table_param()
9768 cmd->sar_len = BIOS_SAR_TABLE_LEN; in ath11k_wmi_pdev_set_bios_sar_table_param()
9769 cmd->rsvd_len = BIOS_SAR_RSVD1_LEN; in ath11k_wmi_pdev_set_bios_sar_table_param()
9771 buf_ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_set_bios_sar_table_param()
9773 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_sar_table_param()
9780 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_sar_table_param()
9788 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_bios_geo_table_param()
9798 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_bios_geo_table_param()
9800 return -ENOMEM; in ath11k_wmi_pdev_set_bios_geo_table_param()
9802 cmd = (struct wmi_pdev_set_geo_table_cmd *)skb->data; in ath11k_wmi_pdev_set_bios_geo_table_param()
9803 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()
9804 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_bios_geo_table_param()
9805 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_bios_geo_table_param()
9806 cmd->rsvd_len = BIOS_SAR_RSVD2_LEN; in ath11k_wmi_pdev_set_bios_geo_table_param()
9808 buf_ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_set_bios_geo_table_param()
9810 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_geo_table_param()
9819 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_sta_keepalive()
9826 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_sta_keepalive()
9828 return -ENOMEM; in ath11k_wmi_sta_keepalive()
9830 cmd = (struct wmi_sta_keepalive_cmd *)skb->data; in ath11k_wmi_sta_keepalive()
9831 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_sta_keepalive()
9833 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_sta_keepalive()
9834 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_sta_keepalive()
9835 cmd->enabled = arg->enabled; in ath11k_wmi_sta_keepalive()
9836 cmd->interval = arg->interval; in ath11k_wmi_sta_keepalive()
9837 cmd->method = arg->method; in ath11k_wmi_sta_keepalive()
9840 arp->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_sta_keepalive()
9842 FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE); in ath11k_wmi_sta_keepalive()
9844 if (arg->method == WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE || in ath11k_wmi_sta_keepalive()
9845 arg->method == WMI_STA_KEEPALIVE_METHOD_GRATUITOUS_ARP_REQUEST) { in ath11k_wmi_sta_keepalive()
9846 arp->src_ip4_addr = arg->src_ip4_addr; in ath11k_wmi_sta_keepalive()
9847 arp->dest_ip4_addr = arg->dest_ip4_addr; in ath11k_wmi_sta_keepalive()
9848 ether_addr_copy(arp->dest_mac_addr.addr, arg->dest_mac_addr); in ath11k_wmi_sta_keepalive()
9851 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_sta_keepalive()
9853 arg->vdev_id, arg->enabled, arg->method, arg->interval); in ath11k_wmi_sta_keepalive()
9861 ar->ab->wmi_ab.svc_map) && ar->supports_6ghz; in ath11k_wmi_supports_6ghz_cc_ext()