Lines Matching +full:tx +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-2025 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(¶m->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, ¶m->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, ¶m->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(¶ms->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()
2668 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_wmm_update_cmd_tlv()
2675 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_wmm_update_cmd_tlv()
2677 return -ENOMEM; in ath11k_wmi_send_wmm_update_cmd_tlv()
2679 cmd = (struct wmi_vdev_set_wmm_params_cmd *)skb->data; in ath11k_wmi_send_wmm_update_cmd_tlv()
2680 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_wmm_update_cmd_tlv()
2682 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_wmm_update_cmd_tlv()
2684 cmd->vdev_id = vdev_id; in ath11k_wmi_send_wmm_update_cmd_tlv()
2685 cmd->wmm_param_type = wmm_param_type; in ath11k_wmi_send_wmm_update_cmd_tlv()
2690 wmi_wmm_arg = ¶m->ac_be; in ath11k_wmi_send_wmm_update_cmd_tlv()
2693 wmi_wmm_arg = ¶m->ac_bk; in ath11k_wmi_send_wmm_update_cmd_tlv()
2696 wmi_wmm_arg = ¶m->ac_vi; in ath11k_wmi_send_wmm_update_cmd_tlv()
2699 wmi_wmm_arg = ¶m->ac_vo; in ath11k_wmi_send_wmm_update_cmd_tlv()
2703 wmm_param = (struct wmi_wmm_params *)&cmd->wmm_params[ac]; in ath11k_wmi_send_wmm_update_cmd_tlv()
2704 wmm_param->tlv_header = in ath11k_wmi_send_wmm_update_cmd_tlv()
2708 sizeof(*wmm_param) - TLV_HDR_SIZE); in ath11k_wmi_send_wmm_update_cmd_tlv()
2710 wmm_param->aifs = wmi_wmm_arg->aifs; in ath11k_wmi_send_wmm_update_cmd_tlv()
2711 wmm_param->cwmin = wmi_wmm_arg->cwmin; in ath11k_wmi_send_wmm_update_cmd_tlv()
2712 wmm_param->cwmax = wmi_wmm_arg->cwmax; in ath11k_wmi_send_wmm_update_cmd_tlv()
2713 wmm_param->txoplimit = wmi_wmm_arg->txop; in ath11k_wmi_send_wmm_update_cmd_tlv()
2714 wmm_param->acm = wmi_wmm_arg->acm; in ath11k_wmi_send_wmm_update_cmd_tlv()
2715 wmm_param->no_ack = wmi_wmm_arg->no_ack; in ath11k_wmi_send_wmm_update_cmd_tlv()
2717 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_wmm_update_cmd_tlv()
2719 wmm_param_type, ac, wmm_param->aifs, wmm_param->cwmin, in ath11k_wmi_send_wmm_update_cmd_tlv()
2720 wmm_param->cwmax, wmm_param->txoplimit, in ath11k_wmi_send_wmm_update_cmd_tlv()
2721 wmm_param->acm, wmm_param->no_ack); in ath11k_wmi_send_wmm_update_cmd_tlv()
2726 ath11k_warn(ar->ab, in ath11k_wmi_send_wmm_update_cmd_tlv()
2731 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd vdev set wmm params"); in ath11k_wmi_send_wmm_update_cmd_tlv()
2739 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2744 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2746 return -ENOMEM; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2748 cmd = (struct wmi_dfs_phyerr_offload_cmd *)skb->data; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2749 cmd->tlv_header = in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2752 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2754 cmd->pdev_id = pdev_id; in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2759 ath11k_warn(ar->ab, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2764 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_dfs_phyerr_offload_enable_cmd()
2773 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_delba_send()
2778 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_delba_send()
2780 return -ENOMEM; in ath11k_wmi_delba_send()
2782 cmd = (struct wmi_delba_send_cmd *)skb->data; in ath11k_wmi_delba_send()
2783 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DELBA_SEND_CMD) | in ath11k_wmi_delba_send()
2784 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_delba_send()
2785 cmd->vdev_id = vdev_id; in ath11k_wmi_delba_send()
2786 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_delba_send()
2787 cmd->tid = tid; in ath11k_wmi_delba_send()
2788 cmd->initiator = initiator; in ath11k_wmi_delba_send()
2789 cmd->reasoncode = reason; in ath11k_wmi_delba_send()
2794 ath11k_warn(ar->ab, in ath11k_wmi_delba_send()
2799 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_delba_send()
2809 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_set_resp()
2814 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_set_resp()
2816 return -ENOMEM; in ath11k_wmi_addba_set_resp()
2818 cmd = (struct wmi_addba_setresponse_cmd *)skb->data; in ath11k_wmi_addba_set_resp()
2819 cmd->tlv_header = in ath11k_wmi_addba_set_resp()
2821 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_set_resp()
2822 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_set_resp()
2823 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_set_resp()
2824 cmd->tid = tid; in ath11k_wmi_addba_set_resp()
2825 cmd->statuscode = status; in ath11k_wmi_addba_set_resp()
2830 ath11k_warn(ar->ab, in ath11k_wmi_addba_set_resp()
2835 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_set_resp()
2845 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_send()
2850 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_send()
2852 return -ENOMEM; in ath11k_wmi_addba_send()
2854 cmd = (struct wmi_addba_send_cmd *)skb->data; in ath11k_wmi_addba_send()
2855 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ADDBA_SEND_CMD) | in ath11k_wmi_addba_send()
2856 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_send()
2857 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_send()
2858 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_send()
2859 cmd->tid = tid; in ath11k_wmi_addba_send()
2860 cmd->buffersize = buf_size; in ath11k_wmi_addba_send()
2865 ath11k_warn(ar->ab, in ath11k_wmi_addba_send()
2870 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_send()
2879 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_addba_clear_resp()
2884 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_addba_clear_resp()
2886 return -ENOMEM; in ath11k_wmi_addba_clear_resp()
2888 cmd = (struct wmi_addba_clear_resp_cmd *)skb->data; in ath11k_wmi_addba_clear_resp()
2889 cmd->tlv_header = in ath11k_wmi_addba_clear_resp()
2891 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_addba_clear_resp()
2892 cmd->vdev_id = vdev_id; in ath11k_wmi_addba_clear_resp()
2893 ether_addr_copy(cmd->peer_macaddr.addr, mac); in ath11k_wmi_addba_clear_resp()
2898 ath11k_warn(ar->ab, in ath11k_wmi_addba_clear_resp()
2903 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_addba_clear_resp()
2912 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_peer_pktlog_filter()
2921 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_peer_pktlog_filter()
2923 return -ENOMEM; in ath11k_wmi_pdev_peer_pktlog_filter()
2925 cmd = (struct wmi_pdev_pktlog_filter_cmd *)skb->data; in ath11k_wmi_pdev_peer_pktlog_filter()
2927 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD) | in ath11k_wmi_pdev_peer_pktlog_filter()
2928 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_peer_pktlog_filter()
2930 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_peer_pktlog_filter()
2931 cmd->num_mac = 1; in ath11k_wmi_pdev_peer_pktlog_filter()
2932 cmd->enable = enable; in ath11k_wmi_pdev_peer_pktlog_filter()
2934 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_peer_pktlog_filter()
2937 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_pdev_peer_pktlog_filter()
2943 ether_addr_copy(info->peer_macaddr.addr, addr); in ath11k_wmi_pdev_peer_pktlog_filter()
2944 info->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO) | in ath11k_wmi_pdev_peer_pktlog_filter()
2946 sizeof(*info) - TLV_HDR_SIZE); in ath11k_wmi_pdev_peer_pktlog_filter()
2951 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_peer_pktlog_filter()
2955 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog filter"); in ath11k_wmi_pdev_peer_pktlog_filter()
2964 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_init_country_cmd()
2969 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_init_country_cmd()
2971 return -ENOMEM; in ath11k_wmi_send_init_country_cmd()
2973 cmd = (struct wmi_init_country_cmd *)skb->data; in ath11k_wmi_send_init_country_cmd()
2974 cmd->tlv_header = in ath11k_wmi_send_init_country_cmd()
2977 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_init_country_cmd()
2979 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_init_country_cmd()
2983 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_ALPHA; in ath11k_wmi_send_init_country_cmd()
2984 memcpy((u8 *)&cmd->cc_info.alpha2, in ath11k_wmi_send_init_country_cmd()
2988 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_COUNTRY_CODE; in ath11k_wmi_send_init_country_cmd()
2989 cmd->cc_info.country_code = init_cc_params.cc_info.country_code; in ath11k_wmi_send_init_country_cmd()
2992 cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_REGDOMAIN; in ath11k_wmi_send_init_country_cmd()
2993 cmd->cc_info.regdom_id = init_cc_params.cc_info.regdom_id; in ath11k_wmi_send_init_country_cmd()
2996 ath11k_warn(ar->ab, "unknown cc params flags: 0x%x", in ath11k_wmi_send_init_country_cmd()
2998 ret = -EINVAL; in ath11k_wmi_send_init_country_cmd()
3005 ath11k_warn(ar->ab, in ath11k_wmi_send_init_country_cmd()
3011 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd set init country"); in ath11k_wmi_send_init_country_cmd()
3023 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_set_current_country_cmd()
3028 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_set_current_country_cmd()
3030 return -ENOMEM; in ath11k_wmi_send_set_current_country_cmd()
3032 cmd = (struct wmi_set_current_country_cmd *)skb->data; in ath11k_wmi_send_set_current_country_cmd()
3033 cmd->tlv_header = in ath11k_wmi_send_set_current_country_cmd()
3035 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_set_current_country_cmd()
3037 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_set_current_country_cmd()
3038 memcpy(&cmd->new_alpha2, ¶m->alpha2, 3); in ath11k_wmi_send_set_current_country_cmd()
3042 ath11k_warn(ar->ab, in ath11k_wmi_send_set_current_country_cmd()
3047 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_set_current_country_cmd()
3049 ar->pdev->pdev_id, in ath11k_wmi_send_set_current_country_cmd()
3050 param->alpha2[0], in ath11k_wmi_send_set_current_country_cmd()
3051 param->alpha2[1]); in ath11k_wmi_send_set_current_country_cmd()
3060 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3070 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3072 return -ENOMEM; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3074 cmd = (struct wmi_therm_throt_config_request_cmd *)skb->data; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3076 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_THERM_THROT_CONFIG_REQUEST) | in ath11k_wmi_send_thermal_mitigation_param_cmd()
3077 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3079 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3080 cmd->enable = param->enable; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3081 cmd->dc = param->dc; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3082 cmd->dc_per_event = param->dc_per_event; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3083 cmd->therm_throt_levels = THERMAL_LEVELS; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3085 tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3086 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_send_thermal_mitigation_param_cmd()
3091 lvl_conf = (struct wmi_therm_throt_level_config_info *)(skb->data + in ath11k_wmi_send_thermal_mitigation_param_cmd()
3095 lvl_conf->tlv_header = in ath11k_wmi_send_thermal_mitigation_param_cmd()
3097 FIELD_PREP(WMI_TLV_LEN, sizeof(*lvl_conf) - TLV_HDR_SIZE); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3099 lvl_conf->temp_lwm = param->levelconf[i].tmplwm; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3100 lvl_conf->temp_hwm = param->levelconf[i].tmphwm; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3101 lvl_conf->dc_off_percent = param->levelconf[i].dcoffpercent; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3102 lvl_conf->prio = param->levelconf[i].priority; in ath11k_wmi_send_thermal_mitigation_param_cmd()
3108 ath11k_warn(ar->ab, "failed to send THERM_THROT_SET_CONF cmd\n"); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3112 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_thermal_mitigation_param_cmd()
3114 ar->pdev->pdev_id, param->enable, param->dc, in ath11k_wmi_send_thermal_mitigation_param_cmd()
3115 param->dc_per_event, THERMAL_LEVELS); in ath11k_wmi_send_thermal_mitigation_param_cmd()
3123 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_11d_scan_start_cmd()
3128 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_11d_scan_start_cmd()
3130 return -ENOMEM; in ath11k_wmi_send_11d_scan_start_cmd()
3132 cmd = (struct wmi_11d_scan_start_cmd *)skb->data; in ath11k_wmi_send_11d_scan_start_cmd()
3133 cmd->tlv_header = in ath11k_wmi_send_11d_scan_start_cmd()
3135 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_11d_scan_start_cmd()
3137 cmd->vdev_id = param->vdev_id; in ath11k_wmi_send_11d_scan_start_cmd()
3138 cmd->scan_period_msec = param->scan_period_msec; in ath11k_wmi_send_11d_scan_start_cmd()
3139 cmd->start_interval_msec = param->start_interval_msec; in ath11k_wmi_send_11d_scan_start_cmd()
3143 ath11k_warn(ar->ab, in ath11k_wmi_send_11d_scan_start_cmd()
3148 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_11d_scan_start_cmd()
3150 cmd->vdev_id, in ath11k_wmi_send_11d_scan_start_cmd()
3151 cmd->scan_period_msec, in ath11k_wmi_send_11d_scan_start_cmd()
3152 cmd->start_interval_msec); in ath11k_wmi_send_11d_scan_start_cmd()
3159 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_11d_scan_stop_cmd()
3164 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_send_11d_scan_stop_cmd()
3166 return -ENOMEM; in ath11k_wmi_send_11d_scan_stop_cmd()
3168 cmd = (struct wmi_11d_scan_stop_cmd *)skb->data; in ath11k_wmi_send_11d_scan_stop_cmd()
3169 cmd->tlv_header = in ath11k_wmi_send_11d_scan_stop_cmd()
3171 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_11d_scan_stop_cmd()
3173 cmd->vdev_id = vdev_id; in ath11k_wmi_send_11d_scan_stop_cmd()
3177 ath11k_warn(ar->ab, in ath11k_wmi_send_11d_scan_stop_cmd()
3182 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_11d_scan_stop_cmd()
3184 cmd->vdev_id); in ath11k_wmi_send_11d_scan_stop_cmd()
3191 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_pktlog_enable()
3196 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_pktlog_enable()
3198 return -ENOMEM; in ath11k_wmi_pdev_pktlog_enable()
3200 cmd = (struct wmi_pktlog_enable_cmd *)skb->data; in ath11k_wmi_pdev_pktlog_enable()
3202 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_ENABLE_CMD) | in ath11k_wmi_pdev_pktlog_enable()
3203 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_pktlog_enable()
3205 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_pktlog_enable()
3206 cmd->evlist = pktlog_filter; in ath11k_wmi_pdev_pktlog_enable()
3207 cmd->enable = ATH11K_WMI_PKTLOG_ENABLE_FORCE; in ath11k_wmi_pdev_pktlog_enable()
3212 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_enable()
3216 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog enable"); in ath11k_wmi_pdev_pktlog_enable()
3223 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_pktlog_disable()
3228 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_pktlog_disable()
3230 return -ENOMEM; in ath11k_wmi_pdev_pktlog_disable()
3232 cmd = (struct wmi_pktlog_disable_cmd *)skb->data; in ath11k_wmi_pdev_pktlog_disable()
3234 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_PKTLOG_DISABLE_CMD) | in ath11k_wmi_pdev_pktlog_disable()
3235 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_pktlog_disable()
3237 cmd->pdev_id = DP_HW2SW_MACID(ar->pdev->pdev_id); in ath11k_wmi_pdev_pktlog_disable()
3242 ath11k_warn(ar->ab, "failed to send WMI_PDEV_PKTLOG_ENABLE_CMDID\n"); in ath11k_wmi_pdev_pktlog_disable()
3246 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd pdev pktlog disable"); in ath11k_wmi_pdev_pktlog_disable()
3253 twt_params->sta_cong_timer_ms = ATH11K_TWT_DEF_STA_CONG_TIMER_MS; in ath11k_wmi_fill_default_twt_params()
3254 twt_params->default_slot_size = ATH11K_TWT_DEF_DEFAULT_SLOT_SIZE; in ath11k_wmi_fill_default_twt_params()
3255 twt_params->congestion_thresh_setup = ATH11K_TWT_DEF_CONGESTION_THRESH_SETUP; in ath11k_wmi_fill_default_twt_params()
3256 twt_params->congestion_thresh_teardown = in ath11k_wmi_fill_default_twt_params()
3258 twt_params->congestion_thresh_critical = in ath11k_wmi_fill_default_twt_params()
3260 twt_params->interference_thresh_teardown = in ath11k_wmi_fill_default_twt_params()
3262 twt_params->interference_thresh_setup = in ath11k_wmi_fill_default_twt_params()
3264 twt_params->min_no_sta_setup = ATH11K_TWT_DEF_MIN_NO_STA_SETUP; in ath11k_wmi_fill_default_twt_params()
3265 twt_params->min_no_sta_teardown = ATH11K_TWT_DEF_MIN_NO_STA_TEARDOWN; in ath11k_wmi_fill_default_twt_params()
3266 twt_params->no_of_bcast_mcast_slots = ATH11K_TWT_DEF_NO_OF_BCAST_MCAST_SLOTS; in ath11k_wmi_fill_default_twt_params()
3267 twt_params->min_no_twt_slots = ATH11K_TWT_DEF_MIN_NO_TWT_SLOTS; in ath11k_wmi_fill_default_twt_params()
3268 twt_params->max_no_sta_twt = ATH11K_TWT_DEF_MAX_NO_STA_TWT; in ath11k_wmi_fill_default_twt_params()
3269 twt_params->mode_check_interval = ATH11K_TWT_DEF_MODE_CHECK_INTERVAL; in ath11k_wmi_fill_default_twt_params()
3270 twt_params->add_sta_slot_interval = ATH11K_TWT_DEF_ADD_STA_SLOT_INTERVAL; in ath11k_wmi_fill_default_twt_params()
3271 twt_params->remove_sta_slot_interval = in ath11k_wmi_fill_default_twt_params()
3274 twt_params->mbss_support = 0; in ath11k_wmi_fill_default_twt_params()
3280 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_enable_cmd()
3281 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_enable_cmd()
3288 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_enable_cmd()
3290 return -ENOMEM; in ath11k_wmi_send_twt_enable_cmd()
3292 cmd = (struct wmi_twt_enable_params_cmd *)skb->data; in ath11k_wmi_send_twt_enable_cmd()
3293 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ENABLE_CMD) | in ath11k_wmi_send_twt_enable_cmd()
3294 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_enable_cmd()
3295 cmd->pdev_id = pdev_id; in ath11k_wmi_send_twt_enable_cmd()
3296 cmd->sta_cong_timer_ms = params->sta_cong_timer_ms; in ath11k_wmi_send_twt_enable_cmd()
3297 cmd->default_slot_size = params->default_slot_size; in ath11k_wmi_send_twt_enable_cmd()
3298 cmd->congestion_thresh_setup = params->congestion_thresh_setup; in ath11k_wmi_send_twt_enable_cmd()
3299 cmd->congestion_thresh_teardown = params->congestion_thresh_teardown; in ath11k_wmi_send_twt_enable_cmd()
3300 cmd->congestion_thresh_critical = params->congestion_thresh_critical; in ath11k_wmi_send_twt_enable_cmd()
3301 cmd->interference_thresh_teardown = params->interference_thresh_teardown; in ath11k_wmi_send_twt_enable_cmd()
3302 cmd->interference_thresh_setup = params->interference_thresh_setup; in ath11k_wmi_send_twt_enable_cmd()
3303 cmd->min_no_sta_setup = params->min_no_sta_setup; in ath11k_wmi_send_twt_enable_cmd()
3304 cmd->min_no_sta_teardown = params->min_no_sta_teardown; in ath11k_wmi_send_twt_enable_cmd()
3305 cmd->no_of_bcast_mcast_slots = params->no_of_bcast_mcast_slots; in ath11k_wmi_send_twt_enable_cmd()
3306 cmd->min_no_twt_slots = params->min_no_twt_slots; in ath11k_wmi_send_twt_enable_cmd()
3307 cmd->max_no_sta_twt = params->max_no_sta_twt; in ath11k_wmi_send_twt_enable_cmd()
3308 cmd->mode_check_interval = params->mode_check_interval; in ath11k_wmi_send_twt_enable_cmd()
3309 cmd->add_sta_slot_interval = params->add_sta_slot_interval; in ath11k_wmi_send_twt_enable_cmd()
3310 cmd->remove_sta_slot_interval = params->remove_sta_slot_interval; in ath11k_wmi_send_twt_enable_cmd()
3311 cmd->mbss_support = params->mbss_support; in ath11k_wmi_send_twt_enable_cmd()
3320 ar->twt_enabled = 1; in ath11k_wmi_send_twt_enable_cmd()
3330 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_disable_cmd()
3331 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_disable_cmd()
3338 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_disable_cmd()
3340 return -ENOMEM; in ath11k_wmi_send_twt_disable_cmd()
3342 cmd = (struct wmi_twt_disable_params_cmd *)skb->data; in ath11k_wmi_send_twt_disable_cmd()
3343 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_DISABLE_CMD) | in ath11k_wmi_send_twt_disable_cmd()
3344 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_disable_cmd()
3345 cmd->pdev_id = pdev_id; in ath11k_wmi_send_twt_disable_cmd()
3356 ar->twt_enabled = 0; in ath11k_wmi_send_twt_disable_cmd()
3364 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_add_dialog_cmd()
3365 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_add_dialog_cmd()
3372 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_add_dialog_cmd()
3374 return -ENOMEM; in ath11k_wmi_send_twt_add_dialog_cmd()
3376 cmd = (struct wmi_twt_add_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_add_dialog_cmd()
3377 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_ADD_DIALOG_CMD) | in ath11k_wmi_send_twt_add_dialog_cmd()
3378 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_add_dialog_cmd()
3380 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_add_dialog_cmd()
3381 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_add_dialog_cmd()
3382 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_add_dialog_cmd()
3383 cmd->wake_intvl_us = params->wake_intvl_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3384 cmd->wake_intvl_mantis = params->wake_intvl_mantis; in ath11k_wmi_send_twt_add_dialog_cmd()
3385 cmd->wake_dura_us = params->wake_dura_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3386 cmd->sp_offset_us = params->sp_offset_us; in ath11k_wmi_send_twt_add_dialog_cmd()
3387 cmd->flags = params->twt_cmd; in ath11k_wmi_send_twt_add_dialog_cmd()
3388 if (params->flag_bcast) in ath11k_wmi_send_twt_add_dialog_cmd()
3389 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_BCAST; in ath11k_wmi_send_twt_add_dialog_cmd()
3390 if (params->flag_trigger) in ath11k_wmi_send_twt_add_dialog_cmd()
3391 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_TRIGGER; in ath11k_wmi_send_twt_add_dialog_cmd()
3392 if (params->flag_flow_type) in ath11k_wmi_send_twt_add_dialog_cmd()
3393 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_FLOW_TYPE; in ath11k_wmi_send_twt_add_dialog_cmd()
3394 if (params->flag_protection) in ath11k_wmi_send_twt_add_dialog_cmd()
3395 cmd->flags |= WMI_TWT_ADD_DIALOG_FLAG_PROTECTION; in ath11k_wmi_send_twt_add_dialog_cmd()
3406 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_add_dialog_cmd()
3408 cmd->vdev_id, cmd->dialog_id, cmd->wake_intvl_us, in ath11k_wmi_send_twt_add_dialog_cmd()
3409 cmd->wake_intvl_mantis, cmd->wake_dura_us, cmd->sp_offset_us, in ath11k_wmi_send_twt_add_dialog_cmd()
3410 cmd->flags); in ath11k_wmi_send_twt_add_dialog_cmd()
3418 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_del_dialog_cmd()
3419 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_del_dialog_cmd()
3426 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_del_dialog_cmd()
3428 return -ENOMEM; in ath11k_wmi_send_twt_del_dialog_cmd()
3430 cmd = (struct wmi_twt_del_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_del_dialog_cmd()
3431 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_TWT_DEL_DIALOG_CMD) | in ath11k_wmi_send_twt_del_dialog_cmd()
3432 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_del_dialog_cmd()
3434 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_del_dialog_cmd()
3435 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_del_dialog_cmd()
3436 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_del_dialog_cmd()
3447 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_del_dialog_cmd()
3449 cmd->vdev_id, cmd->dialog_id); in ath11k_wmi_send_twt_del_dialog_cmd()
3457 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_pause_dialog_cmd()
3458 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_pause_dialog_cmd()
3465 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_pause_dialog_cmd()
3467 return -ENOMEM; in ath11k_wmi_send_twt_pause_dialog_cmd()
3469 cmd = (struct wmi_twt_pause_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_pause_dialog_cmd()
3470 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_twt_pause_dialog_cmd()
3472 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_pause_dialog_cmd()
3474 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_pause_dialog_cmd()
3475 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_pause_dialog_cmd()
3476 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_pause_dialog_cmd()
3487 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_pause_dialog_cmd()
3489 cmd->vdev_id, cmd->dialog_id); in ath11k_wmi_send_twt_pause_dialog_cmd()
3497 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_twt_resume_dialog_cmd()
3498 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_twt_resume_dialog_cmd()
3505 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_twt_resume_dialog_cmd()
3507 return -ENOMEM; in ath11k_wmi_send_twt_resume_dialog_cmd()
3509 cmd = (struct wmi_twt_resume_dialog_params_cmd *)skb->data; in ath11k_wmi_send_twt_resume_dialog_cmd()
3510 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_twt_resume_dialog_cmd()
3512 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_twt_resume_dialog_cmd()
3514 cmd->vdev_id = params->vdev_id; in ath11k_wmi_send_twt_resume_dialog_cmd()
3515 ether_addr_copy(cmd->peer_macaddr.addr, params->peer_macaddr); in ath11k_wmi_send_twt_resume_dialog_cmd()
3516 cmd->dialog_id = params->dialog_id; in ath11k_wmi_send_twt_resume_dialog_cmd()
3517 cmd->sp_offset_us = params->sp_offset_us; in ath11k_wmi_send_twt_resume_dialog_cmd()
3518 cmd->next_twt_size = params->next_twt_size; in ath11k_wmi_send_twt_resume_dialog_cmd()
3529 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_twt_resume_dialog_cmd()
3531 cmd->vdev_id, cmd->dialog_id, cmd->sp_offset_us, in ath11k_wmi_send_twt_resume_dialog_cmd()
3532 cmd->next_twt_size); in ath11k_wmi_send_twt_resume_dialog_cmd()
3541 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_obss_spr_cmd()
3542 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_spr_cmd()
3549 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_obss_spr_cmd()
3551 return -ENOMEM; in ath11k_wmi_send_obss_spr_cmd()
3553 cmd = (struct wmi_obss_spatial_reuse_params_cmd *)skb->data; in ath11k_wmi_send_obss_spr_cmd()
3554 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_obss_spr_cmd()
3556 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_obss_spr_cmd()
3557 cmd->vdev_id = vdev_id; in ath11k_wmi_send_obss_spr_cmd()
3558 cmd->enable = he_obss_pd->enable; in ath11k_wmi_send_obss_spr_cmd()
3559 cmd->obss_min = he_obss_pd->min_offset; in ath11k_wmi_send_obss_spr_cmd()
3560 cmd->obss_max = he_obss_pd->max_offset; in ath11k_wmi_send_obss_spr_cmd()
3579 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3580 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3587 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3589 return -ENOMEM; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3591 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3592 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3594 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3595 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3596 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3607 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3609 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_set_srg_bss_color_bitmap()
3617 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3618 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3625 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3627 return -ENOMEM; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3629 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3630 cmd->tlv_header = in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3633 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3634 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3635 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3646 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3648 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_set_srg_patial_bssid_bitmap()
3656 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3657 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3664 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3666 return -ENOMEM; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3668 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3669 cmd->tlv_header = in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3672 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3673 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3674 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3685 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3687 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_srg_obss_color_enable_bitmap()
3695 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3696 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3703 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3705 return -ENOMEM; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3707 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3708 cmd->tlv_header = in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3711 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3712 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3713 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3724 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3726 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap()
3734 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3735 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3742 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3744 return -ENOMEM; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3746 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3747 cmd->tlv_header = in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3750 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3751 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3752 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3763 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3765 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap()
3773 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3774 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3781 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3783 return -ENOMEM; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3785 cmd = (struct wmi_pdev_obss_pd_bitmap_cmd *)skb->data; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3786 cmd->tlv_header = in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3789 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3790 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3791 memcpy(cmd->bitmap, bitmap, sizeof(cmd->bitmap)); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3802 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3804 cmd->pdev_id, cmd->bitmap[0], cmd->bitmap[1]); in ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap()
3814 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3815 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3822 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3824 return -ENOMEM; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3826 cmd = (struct wmi_obss_color_collision_cfg_params_cmd *)skb->data; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3827 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3829 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3830 cmd->vdev_id = vdev_id; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3831 cmd->evt_type = enable ? ATH11K_OBSS_COLOR_COLLISION_DETECTION : in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3833 cmd->current_bss_color = bss_color; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3834 cmd->detection_period_ms = period; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3835 cmd->scan_period_ms = ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3836 cmd->free_slot_expiry_time_ms = 0; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3837 cmd->flags = 0; in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3847 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3849 cmd->vdev_id, cmd->evt_type, cmd->current_bss_color, in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3850 cmd->detection_period_ms, cmd->scan_period_ms); in ath11k_wmi_send_obss_color_collision_cfg_cmd()
3858 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_bss_color_change_enable_cmd()
3859 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_wmi_send_bss_color_change_enable_cmd()
3866 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_send_bss_color_change_enable_cmd()
3868 return -ENOMEM; in ath11k_wmi_send_bss_color_change_enable_cmd()
3870 cmd = (struct wmi_bss_color_change_enable_params_cmd *)skb->data; in ath11k_wmi_send_bss_color_change_enable_cmd()
3871 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_BSS_COLOR_CHANGE_ENABLE) | in ath11k_wmi_send_bss_color_change_enable_cmd()
3872 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_send_bss_color_change_enable_cmd()
3873 cmd->vdev_id = vdev_id; in ath11k_wmi_send_bss_color_change_enable_cmd()
3874 cmd->enable = enable ? 1 : 0; in ath11k_wmi_send_bss_color_change_enable_cmd()
3884 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_bss_color_change_enable_cmd()
3886 cmd->vdev_id, cmd->enable); in ath11k_wmi_send_bss_color_change_enable_cmd()
3901 aligned_len = roundup(tmpl->len, 4); in ath11k_wmi_fils_discovery_tmpl()
3904 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery_tmpl()
3907 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_fils_discovery_tmpl()
3909 return -ENOMEM; in ath11k_wmi_fils_discovery_tmpl()
3911 cmd = (struct wmi_fils_discovery_tmpl_cmd *)skb->data; in ath11k_wmi_fils_discovery_tmpl()
3912 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_fils_discovery_tmpl()
3914 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_fils_discovery_tmpl()
3915 cmd->vdev_id = vdev_id; in ath11k_wmi_fils_discovery_tmpl()
3916 cmd->buf_len = tmpl->len; in ath11k_wmi_fils_discovery_tmpl()
3917 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_fils_discovery_tmpl()
3920 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_fils_discovery_tmpl()
3922 memcpy(tlv->value, tmpl->data, tmpl->len); in ath11k_wmi_fils_discovery_tmpl()
3924 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_FILS_DISCOVERY_TMPL_CMDID); in ath11k_wmi_fils_discovery_tmpl()
3926 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery_tmpl()
3933 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd fils discovery tmpl"); in ath11k_wmi_fils_discovery_tmpl()
3947 size_t aligned_len = roundup(tmpl->len, 4); in ath11k_wmi_probe_resp_tmpl()
3949 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_probe_resp_tmpl()
3954 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_probe_resp_tmpl()
3956 return -ENOMEM; in ath11k_wmi_probe_resp_tmpl()
3958 cmd = (struct wmi_probe_tmpl_cmd *)skb->data; in ath11k_wmi_probe_resp_tmpl()
3959 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PRB_TMPL_CMD) | in ath11k_wmi_probe_resp_tmpl()
3960 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_probe_resp_tmpl()
3961 cmd->vdev_id = vdev_id; in ath11k_wmi_probe_resp_tmpl()
3962 cmd->buf_len = tmpl->len; in ath11k_wmi_probe_resp_tmpl()
3964 ptr = skb->data + sizeof(*cmd); in ath11k_wmi_probe_resp_tmpl()
3968 probe_info->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_probe_resp_tmpl()
3970 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_probe_resp_tmpl()
3971 probe_info->caps = 0; in ath11k_wmi_probe_resp_tmpl()
3972 probe_info->erp = 0; in ath11k_wmi_probe_resp_tmpl()
3977 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_probe_resp_tmpl()
3979 memcpy(tlv->value, tmpl->data, tmpl->len); in ath11k_wmi_probe_resp_tmpl()
3981 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_PRB_TMPL_CMDID); in ath11k_wmi_probe_resp_tmpl()
3983 ath11k_warn(ar->ab, in ath11k_wmi_probe_resp_tmpl()
3990 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd "); in ath11k_wmi_probe_resp_tmpl()
4002 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fils_discovery()
4009 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_fils_discovery()
4011 return -ENOMEM; in ath11k_wmi_fils_discovery()
4013 cmd = (struct wmi_fils_discovery_cmd *)skb->data; in ath11k_wmi_fils_discovery()
4014 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ENABLE_FILS_CMD) | in ath11k_wmi_fils_discovery()
4015 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_fils_discovery()
4016 cmd->vdev_id = vdev_id; in ath11k_wmi_fils_discovery()
4017 cmd->interval = interval; in ath11k_wmi_fils_discovery()
4018 cmd->config = unsol_bcast_probe_resp_enabled; in ath11k_wmi_fils_discovery()
4020 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_ENABLE_FILS_CMDID); in ath11k_wmi_fils_discovery()
4022 ath11k_warn(ar->ab, in ath11k_wmi_fils_discovery()
4029 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd enable fils"); in ath11k_wmi_fils_discovery()
4059 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); in ath11k_wmi_obss_color_collision_event()
4062 ev->vdev_id); in ath11k_wmi_obss_color_collision_event()
4066 switch (ev->evt_type) { in ath11k_wmi_obss_color_collision_event()
4068 ieee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap, in ath11k_wmi_obss_color_collision_event()
4072 ev->vdev_id, ev->evt_type, ev->obss_color_bitmap); in ath11k_wmi_obss_color_collision_event()
4095 for (i = 0; i < soc->num_radios; i++) { in ath11k_fill_band_to_mac_param()
4096 pdev = &soc->pdevs[i]; in ath11k_fill_band_to_mac_param()
4097 hal_reg_cap = &soc->hal_reg_cap[i]; in ath11k_fill_band_to_mac_param()
4098 band_to_mac[i].pdev_id = pdev->pdev_id; in ath11k_fill_band_to_mac_param()
4100 switch (pdev->cap.supported_bands) { in ath11k_fill_band_to_mac_param()
4102 band_to_mac[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath11k_fill_band_to_mac_param()
4103 band_to_mac[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath11k_fill_band_to_mac_param()
4106 band_to_mac[i].start_freq = hal_reg_cap->low_2ghz_chan; in ath11k_fill_band_to_mac_param()
4107 band_to_mac[i].end_freq = hal_reg_cap->high_2ghz_chan; in ath11k_fill_band_to_mac_param()
4110 band_to_mac[i].start_freq = hal_reg_cap->low_5ghz_chan; in ath11k_fill_band_to_mac_param()
4111 band_to_mac[i].end_freq = hal_reg_cap->high_5ghz_chan; in ath11k_fill_band_to_mac_param()
4123 wmi_cfg->num_vdevs = tg_cfg->num_vdevs; in ath11k_wmi_copy_resource_config()
4124 wmi_cfg->num_peers = tg_cfg->num_peers; in ath11k_wmi_copy_resource_config()
4125 wmi_cfg->num_offload_peers = tg_cfg->num_offload_peers; in ath11k_wmi_copy_resource_config()
4126 wmi_cfg->num_offload_reorder_buffs = tg_cfg->num_offload_reorder_buffs; in ath11k_wmi_copy_resource_config()
4127 wmi_cfg->num_peer_keys = tg_cfg->num_peer_keys; in ath11k_wmi_copy_resource_config()
4128 wmi_cfg->num_tids = tg_cfg->num_tids; in ath11k_wmi_copy_resource_config()
4129 wmi_cfg->ast_skid_limit = tg_cfg->ast_skid_limit; in ath11k_wmi_copy_resource_config()
4130 wmi_cfg->tx_chain_mask = tg_cfg->tx_chain_mask; in ath11k_wmi_copy_resource_config()
4131 wmi_cfg->rx_chain_mask = tg_cfg->rx_chain_mask; in ath11k_wmi_copy_resource_config()
4132 wmi_cfg->rx_timeout_pri[0] = tg_cfg->rx_timeout_pri[0]; in ath11k_wmi_copy_resource_config()
4133 wmi_cfg->rx_timeout_pri[1] = tg_cfg->rx_timeout_pri[1]; in ath11k_wmi_copy_resource_config()
4134 wmi_cfg->rx_timeout_pri[2] = tg_cfg->rx_timeout_pri[2]; in ath11k_wmi_copy_resource_config()
4135 wmi_cfg->rx_timeout_pri[3] = tg_cfg->rx_timeout_pri[3]; in ath11k_wmi_copy_resource_config()
4136 wmi_cfg->rx_decap_mode = tg_cfg->rx_decap_mode; in ath11k_wmi_copy_resource_config()
4137 wmi_cfg->scan_max_pending_req = tg_cfg->scan_max_pending_req; in ath11k_wmi_copy_resource_config()
4138 wmi_cfg->bmiss_offload_max_vdev = tg_cfg->bmiss_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4139 wmi_cfg->roam_offload_max_vdev = tg_cfg->roam_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4140 wmi_cfg->roam_offload_max_ap_profiles = in ath11k_wmi_copy_resource_config()
4141 tg_cfg->roam_offload_max_ap_profiles; in ath11k_wmi_copy_resource_config()
4142 wmi_cfg->num_mcast_groups = tg_cfg->num_mcast_groups; in ath11k_wmi_copy_resource_config()
4143 wmi_cfg->num_mcast_table_elems = tg_cfg->num_mcast_table_elems; in ath11k_wmi_copy_resource_config()
4144 wmi_cfg->mcast2ucast_mode = tg_cfg->mcast2ucast_mode; in ath11k_wmi_copy_resource_config()
4145 wmi_cfg->tx_dbg_log_size = tg_cfg->tx_dbg_log_size; in ath11k_wmi_copy_resource_config()
4146 wmi_cfg->num_wds_entries = tg_cfg->num_wds_entries; in ath11k_wmi_copy_resource_config()
4147 wmi_cfg->dma_burst_size = tg_cfg->dma_burst_size; in ath11k_wmi_copy_resource_config()
4148 wmi_cfg->mac_aggr_delim = tg_cfg->mac_aggr_delim; in ath11k_wmi_copy_resource_config()
4149 wmi_cfg->rx_skip_defrag_timeout_dup_detection_check = in ath11k_wmi_copy_resource_config()
4150 tg_cfg->rx_skip_defrag_timeout_dup_detection_check; in ath11k_wmi_copy_resource_config()
4151 wmi_cfg->vow_config = tg_cfg->vow_config; in ath11k_wmi_copy_resource_config()
4152 wmi_cfg->gtk_offload_max_vdev = tg_cfg->gtk_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4153 wmi_cfg->num_msdu_desc = tg_cfg->num_msdu_desc; in ath11k_wmi_copy_resource_config()
4154 wmi_cfg->max_frag_entries = tg_cfg->max_frag_entries; in ath11k_wmi_copy_resource_config()
4155 wmi_cfg->num_tdls_vdevs = tg_cfg->num_tdls_vdevs; in ath11k_wmi_copy_resource_config()
4156 wmi_cfg->num_tdls_conn_table_entries = in ath11k_wmi_copy_resource_config()
4157 tg_cfg->num_tdls_conn_table_entries; in ath11k_wmi_copy_resource_config()
4158 wmi_cfg->beacon_tx_offload_max_vdev = in ath11k_wmi_copy_resource_config()
4159 tg_cfg->beacon_tx_offload_max_vdev; in ath11k_wmi_copy_resource_config()
4160 wmi_cfg->num_multicast_filter_entries = in ath11k_wmi_copy_resource_config()
4161 tg_cfg->num_multicast_filter_entries; in ath11k_wmi_copy_resource_config()
4162 wmi_cfg->num_wow_filters = tg_cfg->num_wow_filters; in ath11k_wmi_copy_resource_config()
4163 wmi_cfg->num_keep_alive_pattern = tg_cfg->num_keep_alive_pattern; in ath11k_wmi_copy_resource_config()
4164 wmi_cfg->keep_alive_pattern_size = tg_cfg->keep_alive_pattern_size; in ath11k_wmi_copy_resource_config()
4165 wmi_cfg->max_tdls_concurrent_sleep_sta = in ath11k_wmi_copy_resource_config()
4166 tg_cfg->max_tdls_concurrent_sleep_sta; in ath11k_wmi_copy_resource_config()
4167 wmi_cfg->max_tdls_concurrent_buffer_sta = in ath11k_wmi_copy_resource_config()
4168 tg_cfg->max_tdls_concurrent_buffer_sta; in ath11k_wmi_copy_resource_config()
4169 wmi_cfg->wmi_send_separate = tg_cfg->wmi_send_separate; in ath11k_wmi_copy_resource_config()
4170 wmi_cfg->num_ocb_vdevs = tg_cfg->num_ocb_vdevs; in ath11k_wmi_copy_resource_config()
4171 wmi_cfg->num_ocb_channels = tg_cfg->num_ocb_channels; in ath11k_wmi_copy_resource_config()
4172 wmi_cfg->num_ocb_schedules = tg_cfg->num_ocb_schedules; in ath11k_wmi_copy_resource_config()
4173 wmi_cfg->bpf_instruction_size = tg_cfg->bpf_instruction_size; in ath11k_wmi_copy_resource_config()
4174 wmi_cfg->max_bssid_rx_filters = tg_cfg->max_bssid_rx_filters; in ath11k_wmi_copy_resource_config()
4175 wmi_cfg->use_pdev_id = tg_cfg->use_pdev_id; in ath11k_wmi_copy_resource_config()
4176 wmi_cfg->flag1 = tg_cfg->flag1; in ath11k_wmi_copy_resource_config()
4177 wmi_cfg->peer_map_unmap_v2_support = tg_cfg->peer_map_unmap_v2_support; in ath11k_wmi_copy_resource_config()
4178 wmi_cfg->sched_params = tg_cfg->sched_params; in ath11k_wmi_copy_resource_config()
4179 wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count; in ath11k_wmi_copy_resource_config()
4180 wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count; in ath11k_wmi_copy_resource_config()
4181 wmi_cfg->host_service_flags &= in ath11k_wmi_copy_resource_config()
4183 wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported << in ath11k_wmi_copy_resource_config()
4185 wmi_cfg->flags2 = WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET; in ath11k_wmi_copy_resource_config()
4186 wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt; in ath11k_wmi_copy_resource_config()
4187 wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period; in ath11k_wmi_copy_resource_config()
4193 struct ath11k_base *ab = wmi->wmi_ab->ab; in ath11k_init_cmd_send()
4206 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) in ath11k_init_cmd_send()
4208 (param->num_band_to_mac * sizeof(*band_to_mac)); in ath11k_init_cmd_send()
4211 (param->num_mem_chunks ? (sizeof(*host_mem_chunks) * WMI_MAX_MEM_REQS) : 0); in ath11k_init_cmd_send()
4213 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_init_cmd_send()
4215 return -ENOMEM; in ath11k_init_cmd_send()
4217 cmd = (struct wmi_init_cmd *)skb->data; in ath11k_init_cmd_send()
4219 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_INIT_CMD) | in ath11k_init_cmd_send()
4220 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4222 ptr = skb->data + sizeof(*cmd); in ath11k_init_cmd_send()
4225 ath11k_wmi_copy_resource_config(cfg, param->res_cfg); in ath11k_init_cmd_send()
4227 cfg->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_RESOURCE_CONFIG) | in ath11k_init_cmd_send()
4228 FIELD_PREP(WMI_TLV_LEN, sizeof(*cfg) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4234 for (idx = 0; idx < param->num_mem_chunks; ++idx) { in ath11k_init_cmd_send()
4240 host_mem_chunks[idx].ptr = param->mem_chunks[idx].paddr; in ath11k_init_cmd_send()
4241 host_mem_chunks[idx].size = param->mem_chunks[idx].len; in ath11k_init_cmd_send()
4242 host_mem_chunks[idx].req_id = param->mem_chunks[idx].req_id; in ath11k_init_cmd_send()
4246 param->mem_chunks[idx].req_id, in ath11k_init_cmd_send()
4247 (u64)param->mem_chunks[idx].paddr, in ath11k_init_cmd_send()
4248 param->mem_chunks[idx].len); in ath11k_init_cmd_send()
4250 cmd->num_host_mem_chunks = param->num_mem_chunks; in ath11k_init_cmd_send()
4251 len = sizeof(struct wlan_host_mem_chunk) * param->num_mem_chunks; in ath11k_init_cmd_send()
4255 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_init_cmd_send()
4259 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) { in ath11k_init_cmd_send()
4261 hw_mode->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_init_cmd_send()
4264 sizeof(*hw_mode) - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4266 hw_mode->hw_mode_index = param->hw_mode_id; in ath11k_init_cmd_send()
4267 hw_mode->num_band_to_mac = param->num_band_to_mac; in ath11k_init_cmd_send()
4271 len = param->num_band_to_mac * sizeof(*band_to_mac); in ath11k_init_cmd_send()
4273 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_init_cmd_send()
4279 for (idx = 0; idx < param->num_band_to_mac; idx++) { in ath11k_init_cmd_send()
4282 band_to_mac->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_init_cmd_send()
4285 len - TLV_HDR_SIZE); in ath11k_init_cmd_send()
4286 band_to_mac->pdev_id = param->band_to_mac[idx].pdev_id; in ath11k_init_cmd_send()
4287 band_to_mac->start_freq = in ath11k_init_cmd_send()
4288 param->band_to_mac[idx].start_freq; in ath11k_init_cmd_send()
4289 band_to_mac->end_freq = in ath11k_init_cmd_send()
4290 param->band_to_mac[idx].end_freq; in ath11k_init_cmd_send()
4314 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_lro_cfg()
4316 return -ENOMEM; in ath11k_wmi_pdev_lro_cfg()
4318 cmd = (struct ath11k_wmi_pdev_lro_config_cmd *)skb->data; in ath11k_wmi_pdev_lro_cfg()
4319 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_LRO_INFO_CMD) | in ath11k_wmi_pdev_lro_cfg()
4320 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_lro_cfg()
4322 get_random_bytes(cmd->th_4, sizeof(uint32_t) * ATH11K_IPV4_TH_SEED_SIZE); in ath11k_wmi_pdev_lro_cfg()
4323 get_random_bytes(cmd->th_6, sizeof(uint32_t) * ATH11K_IPV6_TH_SEED_SIZE); in ath11k_wmi_pdev_lro_cfg()
4325 cmd->pdev_id = pdev_id; in ath11k_wmi_pdev_lro_cfg()
4327 ret = ath11k_wmi_cmd_send(ar->wmi, skb, WMI_LRO_CONFIG_CMDID); in ath11k_wmi_pdev_lro_cfg()
4329 ath11k_warn(ar->ab, in ath11k_wmi_pdev_lro_cfg()
4334 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_lro_cfg()
4346 time_left = wait_for_completion_timeout(&ab->wmi_ab.service_ready, in ath11k_wmi_wait_for_service_ready()
4349 return -ETIMEDOUT; in ath11k_wmi_wait_for_service_ready()
4358 time_left = wait_for_completion_timeout(&ab->wmi_ab.unified_ready, in ath11k_wmi_wait_for_unified_ready()
4361 return -ETIMEDOUT; in ath11k_wmi_wait_for_unified_ready()
4371 struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab; in ath11k_wmi_set_hw_mode()
4379 return -ENOMEM; in ath11k_wmi_set_hw_mode()
4381 cmd = (struct wmi_pdev_set_hw_mode_cmd_param *)skb->data; in ath11k_wmi_set_hw_mode()
4383 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_PDEV_SET_HW_MODE_CMD) | in ath11k_wmi_set_hw_mode()
4384 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_set_hw_mode()
4386 cmd->pdev_id = WMI_PDEV_ID_SOC; in ath11k_wmi_set_hw_mode()
4387 cmd->hw_mode_index = mode; in ath11k_wmi_set_hw_mode()
4389 ret = ath11k_wmi_cmd_send(&wmi_ab->wmi[0], skb, WMI_PDEV_SET_HW_MODE_CMDID); in ath11k_wmi_set_hw_mode()
4396 ath11k_dbg(ab, ATH11K_DBG_WMI, "cmd pdev set hw mode %d", cmd->hw_mode_index); in ath11k_wmi_set_hw_mode()
4403 struct ath11k_wmi_base *wmi_ab = &ab->wmi_ab; in ath11k_wmi_cmd_init()
4410 ab->hw_params.hw_ops->wmi_init_config(ab, &config); in ath11k_wmi_cmd_init()
4413 ab->wmi_ab.svc_map)) in ath11k_wmi_cmd_init()
4416 memcpy(&wmi_ab->wlan_resource_config, &config, sizeof(config)); in ath11k_wmi_cmd_init()
4418 init_param.res_cfg = &wmi_ab->wlan_resource_config; in ath11k_wmi_cmd_init()
4419 init_param.num_mem_chunks = wmi_ab->num_mem_chunks; in ath11k_wmi_cmd_init()
4420 init_param.hw_mode_id = wmi_ab->preferred_hw_mode; in ath11k_wmi_cmd_init()
4421 init_param.mem_chunks = wmi_ab->mem_chunks; in ath11k_wmi_cmd_init()
4423 if (ab->hw_params.single_pdev_only) in ath11k_wmi_cmd_init()
4426 init_param.num_band_to_mac = ab->num_radios; in ath11k_wmi_cmd_init()
4429 return ath11k_init_cmd_send(&wmi_ab->wmi[0], &init_param); in ath11k_wmi_cmd_init()
4439 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_spectral_conf()
4441 return -ENOMEM; in ath11k_wmi_vdev_spectral_conf()
4443 cmd = (struct ath11k_wmi_vdev_spectral_conf_cmd *)skb->data; in ath11k_wmi_vdev_spectral_conf()
4444 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_spectral_conf()
4446 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_spectral_conf()
4448 memcpy(&cmd->param, param, sizeof(*param)); in ath11k_wmi_vdev_spectral_conf()
4450 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_vdev_spectral_conf()
4453 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_conf()
4458 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_conf()
4460 param->vdev_id); in ath11k_wmi_vdev_spectral_conf()
4475 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_vdev_spectral_enable()
4477 return -ENOMEM; in ath11k_wmi_vdev_spectral_enable()
4479 cmd = (struct ath11k_wmi_vdev_spectral_enable_cmd *)skb->data; in ath11k_wmi_vdev_spectral_enable()
4480 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_vdev_spectral_enable()
4482 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_vdev_spectral_enable()
4484 cmd->vdev_id = vdev_id; in ath11k_wmi_vdev_spectral_enable()
4485 cmd->trigger_cmd = trigger; in ath11k_wmi_vdev_spectral_enable()
4486 cmd->enable_cmd = enable; in ath11k_wmi_vdev_spectral_enable()
4488 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_vdev_spectral_enable()
4491 ath11k_warn(ar->ab, in ath11k_wmi_vdev_spectral_enable()
4496 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_vdev_spectral_enable()
4513 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, sizeof(*cmd)); in ath11k_wmi_pdev_dma_ring_cfg()
4515 return -ENOMEM; in ath11k_wmi_pdev_dma_ring_cfg()
4517 cmd = (struct ath11k_wmi_pdev_dma_ring_cfg_req_cmd *)skb->data; in ath11k_wmi_pdev_dma_ring_cfg()
4518 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DMA_RING_CFG_REQ) | in ath11k_wmi_pdev_dma_ring_cfg()
4519 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_dma_ring_cfg()
4521 cmd->pdev_id = param->pdev_id; in ath11k_wmi_pdev_dma_ring_cfg()
4522 cmd->module_id = param->module_id; in ath11k_wmi_pdev_dma_ring_cfg()
4523 cmd->base_paddr_lo = param->base_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4524 cmd->base_paddr_hi = param->base_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4525 cmd->head_idx_paddr_lo = param->head_idx_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4526 cmd->head_idx_paddr_hi = param->head_idx_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4527 cmd->tail_idx_paddr_lo = param->tail_idx_paddr_lo; in ath11k_wmi_pdev_dma_ring_cfg()
4528 cmd->tail_idx_paddr_hi = param->tail_idx_paddr_hi; in ath11k_wmi_pdev_dma_ring_cfg()
4529 cmd->num_elems = param->num_elems; in ath11k_wmi_pdev_dma_ring_cfg()
4530 cmd->buf_size = param->buf_size; in ath11k_wmi_pdev_dma_ring_cfg()
4531 cmd->num_resp_per_event = param->num_resp_per_event; in ath11k_wmi_pdev_dma_ring_cfg()
4532 cmd->event_timeout_ms = param->event_timeout_ms; in ath11k_wmi_pdev_dma_ring_cfg()
4534 ret = ath11k_wmi_cmd_send(ar->wmi, skb, in ath11k_wmi_pdev_dma_ring_cfg()
4537 ath11k_warn(ar->ab, in ath11k_wmi_pdev_dma_ring_cfg()
4542 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_pdev_dma_ring_cfg()
4544 param->pdev_id); in ath11k_wmi_pdev_dma_ring_cfg()
4559 return -EPROTO; in ath11k_wmi_tlv_dma_buf_entry_parse()
4561 if (parse->num_buf_entry >= parse->fixed.num_buf_release_entry) in ath11k_wmi_tlv_dma_buf_entry_parse()
4562 return -ENOBUFS; in ath11k_wmi_tlv_dma_buf_entry_parse()
4564 parse->num_buf_entry++; in ath11k_wmi_tlv_dma_buf_entry_parse()
4575 return -EPROTO; in ath11k_wmi_tlv_dma_buf_meta_parse()
4577 if (parse->num_meta >= parse->fixed.num_meta_data_entry) in ath11k_wmi_tlv_dma_buf_meta_parse()
4578 return -ENOBUFS; in ath11k_wmi_tlv_dma_buf_meta_parse()
4580 parse->num_meta++; in ath11k_wmi_tlv_dma_buf_meta_parse()
4593 memcpy(&parse->fixed, ptr, in ath11k_wmi_tlv_dma_buf_parse()
4595 parse->fixed.pdev_id = DP_HW2SW_MACID(parse->fixed.pdev_id); in ath11k_wmi_tlv_dma_buf_parse()
4598 if (!parse->buf_entry_done) { in ath11k_wmi_tlv_dma_buf_parse()
4599 parse->num_buf_entry = 0; in ath11k_wmi_tlv_dma_buf_parse()
4600 parse->buf_entry = (struct wmi_dma_buf_release_entry *)ptr; in ath11k_wmi_tlv_dma_buf_parse()
4611 parse->buf_entry_done = true; in ath11k_wmi_tlv_dma_buf_parse()
4612 } else if (!parse->meta_data_done) { in ath11k_wmi_tlv_dma_buf_parse()
4613 parse->num_meta = 0; in ath11k_wmi_tlv_dma_buf_parse()
4614 parse->meta_data = (struct wmi_dma_buf_release_meta_data *)ptr; in ath11k_wmi_tlv_dma_buf_parse()
4625 parse->meta_data_done = true; in ath11k_wmi_tlv_dma_buf_parse()
4641 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pdev_dma_ring_buf_release_event()
4673 return -EPROTO; in ath11k_wmi_tlv_hw_mode_caps_parse()
4675 if (svc_rdy_ext->n_hw_mode_caps >= svc_rdy_ext->param.num_hw_modes) in ath11k_wmi_tlv_hw_mode_caps_parse()
4676 return -ENOBUFS; in ath11k_wmi_tlv_hw_mode_caps_parse()
4680 svc_rdy_ext->n_hw_mode_caps++; in ath11k_wmi_tlv_hw_mode_caps_parse()
4682 phy_map = hw_mode_cap->phy_id_map; in ath11k_wmi_tlv_hw_mode_caps_parse()
4684 svc_rdy_ext->tot_phy_id++; in ath11k_wmi_tlv_hw_mode_caps_parse()
4700 svc_rdy_ext->n_hw_mode_caps = 0; in ath11k_wmi_tlv_hw_mode_caps()
4701 svc_rdy_ext->hw_mode_caps = (struct wmi_hw_mode_capabilities *)ptr; in ath11k_wmi_tlv_hw_mode_caps()
4712 while (i < svc_rdy_ext->n_hw_mode_caps) { in ath11k_wmi_tlv_hw_mode_caps()
4713 hw_mode_caps = &svc_rdy_ext->hw_mode_caps[i]; in ath11k_wmi_tlv_hw_mode_caps()
4714 mode = hw_mode_caps->hw_mode_id; in ath11k_wmi_tlv_hw_mode_caps()
4715 pref = soc->wmi_ab.preferred_hw_mode; in ath11k_wmi_tlv_hw_mode_caps()
4718 svc_rdy_ext->pref_hw_mode_caps = *hw_mode_caps; in ath11k_wmi_tlv_hw_mode_caps()
4719 soc->wmi_ab.preferred_hw_mode = mode; in ath11k_wmi_tlv_hw_mode_caps()
4725 soc->wmi_ab.preferred_hw_mode); in ath11k_wmi_tlv_hw_mode_caps()
4726 if (soc->wmi_ab.preferred_hw_mode == WMI_HOST_HW_MODE_MAX) in ath11k_wmi_tlv_hw_mode_caps()
4727 return -EINVAL; in ath11k_wmi_tlv_hw_mode_caps()
4739 return -EPROTO; in ath11k_wmi_tlv_mac_phy_caps_parse()
4741 if (svc_rdy_ext->n_mac_phy_caps >= svc_rdy_ext->tot_phy_id) in ath11k_wmi_tlv_mac_phy_caps_parse()
4742 return -ENOBUFS; in ath11k_wmi_tlv_mac_phy_caps_parse()
4745 if (!svc_rdy_ext->n_mac_phy_caps) { in ath11k_wmi_tlv_mac_phy_caps_parse()
4746 svc_rdy_ext->mac_phy_caps = kcalloc(svc_rdy_ext->tot_phy_id, in ath11k_wmi_tlv_mac_phy_caps_parse()
4748 if (!svc_rdy_ext->mac_phy_caps) in ath11k_wmi_tlv_mac_phy_caps_parse()
4749 return -ENOMEM; in ath11k_wmi_tlv_mac_phy_caps_parse()
4752 memcpy(svc_rdy_ext->mac_phy_caps + svc_rdy_ext->n_mac_phy_caps, ptr, len); in ath11k_wmi_tlv_mac_phy_caps_parse()
4753 svc_rdy_ext->n_mac_phy_caps++; in ath11k_wmi_tlv_mac_phy_caps_parse()
4764 return -EPROTO; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4766 if (svc_rdy_ext->n_ext_hal_reg_caps >= svc_rdy_ext->param.num_phy) in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4767 return -ENOBUFS; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4769 svc_rdy_ext->n_ext_hal_reg_caps++; in ath11k_wmi_tlv_ext_hal_reg_caps_parse()
4776 struct ath11k_pdev_wmi *wmi_handle = &soc->wmi_ab.wmi[0]; in ath11k_wmi_tlv_ext_hal_reg_caps()
4782 svc_rdy_ext->n_ext_hal_reg_caps = 0; in ath11k_wmi_tlv_ext_hal_reg_caps()
4783 svc_rdy_ext->ext_hal_reg_caps = (struct wmi_hal_reg_capabilities_ext *)ptr; in ath11k_wmi_tlv_ext_hal_reg_caps()
4792 for (i = 0; i < svc_rdy_ext->param.num_phy; i++) { in ath11k_wmi_tlv_ext_hal_reg_caps()
4794 svc_rdy_ext->soc_hal_reg_caps, in ath11k_wmi_tlv_ext_hal_reg_caps()
4795 svc_rdy_ext->ext_hal_reg_caps, i, in ath11k_wmi_tlv_ext_hal_reg_caps()
4802 memcpy(&soc->hal_reg_cap[reg_cap.phy_id], in ath11k_wmi_tlv_ext_hal_reg_caps()
4812 struct ath11k_pdev_wmi *wmi_handle = &soc->wmi_ab.wmi[0]; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4814 u8 hw_mode_id = svc_rdy_ext->pref_hw_mode_caps.hw_mode_id; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4819 svc_rdy_ext->soc_hal_reg_caps = (struct wmi_soc_hal_reg_capabilities *)ptr; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4820 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()
4822 soc->num_radios = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4823 soc->target_pdev_count = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4824 phy_id_map = svc_rdy_ext->pref_hw_mode_caps.phy_id_map; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4826 while (phy_id_map && soc->num_radios < MAX_RADIOS) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4828 svc_rdy_ext->hw_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4829 svc_rdy_ext->hw_mode_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4830 svc_rdy_ext->soc_hal_reg_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4831 svc_rdy_ext->mac_phy_caps, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4832 hw_mode_id, soc->num_radios, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4833 &soc->pdevs[pdev_index]); in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4836 soc->num_radios); in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4840 soc->num_radios++; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4843 if (soc->hw_params.single_pdev_only) in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4846 pdev_index = soc->num_radios; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4856 if (soc->hw_params.single_pdev_only) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4857 soc->num_radios = 1; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4858 soc->pdevs[0].pdev_id = 0; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4861 if (!soc->reg_info_store) { in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4862 soc->reg_info_store = kcalloc(soc->num_radios, in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4863 sizeof(*soc->reg_info_store), in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4865 if (!soc->reg_info_store) in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4866 return -ENOMEM; in ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse()
4879 return -EPROTO; in ath11k_wmi_tlv_dma_ring_caps_parse()
4881 parse->n_dma_ring_caps++; in ath11k_wmi_tlv_dma_ring_caps_parse()
4894 return -ENOMEM; in ath11k_wmi_alloc_dbring_caps()
4896 ab->db_caps = ptr; in ath11k_wmi_alloc_dbring_caps()
4897 ab->num_db_cap = num_cap; in ath11k_wmi_alloc_dbring_caps()
4904 kfree(ab->db_caps); in ath11k_wmi_free_dbring_caps()
4905 ab->db_caps = NULL; in ath11k_wmi_free_dbring_caps()
4906 ab->num_db_cap = 0; in ath11k_wmi_free_dbring_caps()
4918 dma_caps_parse->n_dma_ring_caps = 0; in ath11k_wmi_tlv_dma_ring_caps()
4928 if (!dma_caps_parse->n_dma_ring_caps) in ath11k_wmi_tlv_dma_ring_caps()
4931 if (ab->num_db_cap) { in ath11k_wmi_tlv_dma_ring_caps()
4936 ret = ath11k_wmi_alloc_dbring_caps(ab, dma_caps_parse->n_dma_ring_caps); in ath11k_wmi_tlv_dma_ring_caps()
4940 dir_buff_caps = ab->db_caps; in ath11k_wmi_tlv_dma_ring_caps()
4941 for (i = 0; i < dma_caps_parse->n_dma_ring_caps; i++) { in ath11k_wmi_tlv_dma_ring_caps()
4944 ret = -EINVAL; in ath11k_wmi_tlv_dma_ring_caps()
4966 struct ath11k_pdev_wmi *wmi_handle = &ab->wmi_ab.wmi[0]; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4973 &svc_rdy_ext->param); in ath11k_wmi_tlv_svc_rdy_ext_parse()
4981 svc_rdy_ext->hw_caps = (struct wmi_soc_mac_phy_hw_mode_caps *)ptr; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4982 svc_rdy_ext->param.num_hw_modes = svc_rdy_ext->hw_caps->num_hw_modes; in ath11k_wmi_tlv_svc_rdy_ext_parse()
4993 if (!svc_rdy_ext->hw_mode_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
4999 svc_rdy_ext->hw_mode_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5000 } else if (!svc_rdy_ext->mac_phy_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5001 svc_rdy_ext->n_mac_phy_caps = 0; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5010 svc_rdy_ext->mac_phy_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5011 } else if (!svc_rdy_ext->ext_hal_reg_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5017 svc_rdy_ext->ext_hal_reg_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5018 } else if (!svc_rdy_ext->mac_phy_chainmask_combo_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5019 svc_rdy_ext->mac_phy_chainmask_combo_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5020 } else if (!svc_rdy_ext->mac_phy_chainmask_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5021 svc_rdy_ext->mac_phy_chainmask_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5022 } else if (!svc_rdy_ext->oem_dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5023 svc_rdy_ext->oem_dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5024 } else if (!svc_rdy_ext->dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext_parse()
5026 &svc_rdy_ext->dma_caps_parse); in ath11k_wmi_tlv_svc_rdy_ext_parse()
5030 svc_rdy_ext->dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext_parse()
5046 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext_event()
5056 if (!test_bit(WMI_TLV_SERVICE_EXT2_MSG, ab->wmi_ab.svc_map)) in ath11k_service_ready_ext_event()
5057 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext_event()
5076 if (!parse->dma_ring_cap_done) { in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5078 &parse->dma_caps_parse); in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5082 parse->dma_ring_cap_done = true; in ath11k_wmi_tlv_svc_rdy_ext2_parse()
5098 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_ready_ext2_event()
5108 complete(&ab->wmi_ab.service_ready); in ath11k_service_ready_ext2_event()
5135 return -EPROTO; in ath11k_pull_vdev_start_resp_tlv()
5140 vdev_rsp->vdev_id = ev->vdev_id; in ath11k_pull_vdev_start_resp_tlv()
5141 vdev_rsp->requestor_id = ev->requestor_id; in ath11k_pull_vdev_start_resp_tlv()
5142 vdev_rsp->resp_type = ev->resp_type; in ath11k_pull_vdev_start_resp_tlv()
5143 vdev_rsp->status = ev->status; in ath11k_pull_vdev_start_resp_tlv()
5144 vdev_rsp->chain_mask = ev->chain_mask; in ath11k_pull_vdev_start_resp_tlv()
5145 vdev_rsp->smps_mode = ev->smps_mode; in ath11k_pull_vdev_start_resp_tlv()
5146 vdev_rsp->mac_id = ev->mac_id; in ath11k_pull_vdev_start_resp_tlv()
5147 vdev_rsp->cfgd_tx_streams = ev->cfgd_tx_streams; in ath11k_pull_vdev_start_resp_tlv()
5148 vdev_rsp->cfgd_rx_streams = ev->cfgd_rx_streams; in ath11k_pull_vdev_start_resp_tlv()
5149 vdev_rsp->max_allowed_tx_power = ev->max_allowed_tx_power; in ath11k_pull_vdev_start_resp_tlv()
5167 "reg rule %d: (%d - %d @ %d) (%d, %d) (FLAGS %d)\n", in ath11k_print_reg_rule()
5168 count + 1, reg_rule->start_freq, reg_rule->end_freq, in ath11k_print_reg_rule()
5169 reg_rule->max_bw, reg_rule->ant_gain, in ath11k_print_reg_rule()
5170 reg_rule->reg_power, reg_rule->flags); in ath11k_print_reg_rule()
5235 return -EPROTO; in ath11k_pull_reg_chan_list_update_ev()
5238 reg_info->num_2ghz_reg_rules = chan_list_event_hdr->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5239 reg_info->num_5ghz_reg_rules = chan_list_event_hdr->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5241 if (!(reg_info->num_2ghz_reg_rules + reg_info->num_5ghz_reg_rules)) { in ath11k_pull_reg_chan_list_update_ev()
5244 return -EINVAL; in ath11k_pull_reg_chan_list_update_ev()
5247 memcpy(reg_info->alpha2, &chan_list_event_hdr->alpha2, in ath11k_pull_reg_chan_list_update_ev()
5249 reg_info->dfs_region = chan_list_event_hdr->dfs_region; in ath11k_pull_reg_chan_list_update_ev()
5250 reg_info->phybitmap = chan_list_event_hdr->phybitmap; in ath11k_pull_reg_chan_list_update_ev()
5251 reg_info->num_phy = chan_list_event_hdr->num_phy; in ath11k_pull_reg_chan_list_update_ev()
5252 reg_info->phy_id = chan_list_event_hdr->phy_id; in ath11k_pull_reg_chan_list_update_ev()
5253 reg_info->ctry_code = chan_list_event_hdr->country_id; in ath11k_pull_reg_chan_list_update_ev()
5254 reg_info->reg_dmn_pair = chan_list_event_hdr->domain_code; in ath11k_pull_reg_chan_list_update_ev()
5258 ath11k_cc_status_to_str(reg_info->status_code)); in ath11k_pull_reg_chan_list_update_ev()
5260 reg_info->status_code = in ath11k_pull_reg_chan_list_update_ev()
5261 ath11k_wmi_cc_setting_code_to_reg(chan_list_event_hdr->status_code); in ath11k_pull_reg_chan_list_update_ev()
5263 reg_info->is_ext_reg_event = false; in ath11k_pull_reg_chan_list_update_ev()
5265 reg_info->min_bw_2ghz = chan_list_event_hdr->min_bw_2ghz; in ath11k_pull_reg_chan_list_update_ev()
5266 reg_info->max_bw_2ghz = chan_list_event_hdr->max_bw_2ghz; in ath11k_pull_reg_chan_list_update_ev()
5267 reg_info->min_bw_5ghz = chan_list_event_hdr->min_bw_5ghz; in ath11k_pull_reg_chan_list_update_ev()
5268 reg_info->max_bw_5ghz = chan_list_event_hdr->max_bw_5ghz; in ath11k_pull_reg_chan_list_update_ev()
5270 num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5271 num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_update_ev()
5275 reg_info->alpha2, reg_info->dfs_region, in ath11k_pull_reg_chan_list_update_ev()
5276 reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, in ath11k_pull_reg_chan_list_update_ev()
5277 reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); in ath11k_pull_reg_chan_list_update_ev()
5289 reg_info->reg_rules_2ghz_ptr = in ath11k_pull_reg_chan_list_update_ev()
5292 if (!reg_info->reg_rules_2ghz_ptr) { in ath11k_pull_reg_chan_list_update_ev()
5295 return -ENOMEM; in ath11k_pull_reg_chan_list_update_ev()
5300 reg_info->reg_rules_2ghz_ptr); in ath11k_pull_reg_chan_list_update_ev()
5305 reg_info->reg_rules_5ghz_ptr = in ath11k_pull_reg_chan_list_update_ev()
5308 if (!reg_info->reg_rules_5ghz_ptr) { in ath11k_pull_reg_chan_list_update_ev()
5311 return -ENOMEM; in ath11k_pull_reg_chan_list_update_ev()
5316 reg_info->reg_rules_5ghz_ptr); in ath11k_pull_reg_chan_list_update_ev()
5411 return -EPROTO; in ath11k_pull_reg_chan_list_ext_update_ev()
5414 reg_info->num_2ghz_reg_rules = ev->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5415 reg_info->num_5ghz_reg_rules = ev->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5416 reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5417 ev->num_6ghz_reg_rules_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5418 reg_info->num_6ghz_rules_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5419 ev->num_6ghz_reg_rules_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5420 reg_info->num_6ghz_rules_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5421 ev->num_6ghz_reg_rules_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5424 reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5425 ev->num_6ghz_reg_rules_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5426 reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5427 ev->num_6ghz_reg_rules_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5428 reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5429 ev->num_6ghz_reg_rules_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5432 num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5433 num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5443 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5447 num_6ghz_reg_rules_ap[i] = reg_info->num_6ghz_rules_ap[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5453 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5461 reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5465 reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5469 reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5481 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5488 return -EINVAL; in ath11k_pull_reg_chan_list_ext_update_ev()
5491 memcpy(reg_info->alpha2, &ev->alpha2, REG_ALPHA2_LEN); in ath11k_pull_reg_chan_list_ext_update_ev()
5493 reg_info->dfs_region = ev->dfs_region; in ath11k_pull_reg_chan_list_ext_update_ev()
5494 reg_info->phybitmap = ev->phybitmap; in ath11k_pull_reg_chan_list_ext_update_ev()
5495 reg_info->num_phy = ev->num_phy; in ath11k_pull_reg_chan_list_ext_update_ev()
5496 reg_info->phy_id = ev->phy_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5497 reg_info->ctry_code = ev->country_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5498 reg_info->reg_dmn_pair = ev->domain_code; in ath11k_pull_reg_chan_list_ext_update_ev()
5502 ath11k_cc_status_to_str(reg_info->status_code)); in ath11k_pull_reg_chan_list_ext_update_ev()
5504 reg_info->status_code = in ath11k_pull_reg_chan_list_ext_update_ev()
5505 ath11k_wmi_cc_setting_code_to_reg(ev->status_code); in ath11k_pull_reg_chan_list_ext_update_ev()
5507 reg_info->is_ext_reg_event = true; in ath11k_pull_reg_chan_list_ext_update_ev()
5509 reg_info->min_bw_2ghz = ev->min_bw_2ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5510 reg_info->max_bw_2ghz = ev->max_bw_2ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5511 reg_info->min_bw_5ghz = ev->min_bw_5ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5512 reg_info->max_bw_5ghz = ev->max_bw_5ghz; in ath11k_pull_reg_chan_list_ext_update_ev()
5514 reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5515 ev->min_bw_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5516 reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5517 ev->max_bw_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5518 reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5519 ev->min_bw_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5520 reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5521 ev->max_bw_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5522 reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5523 ev->min_bw_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5524 reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5525 ev->max_bw_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5528 "6 GHz AP BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5529 reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5530 reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5531 reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5532 reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5533 reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP], in ath11k_pull_reg_chan_list_ext_update_ev()
5534 reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP]); in ath11k_pull_reg_chan_list_ext_update_ev()
5537 reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5538 ev->min_bw_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5539 reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5540 ev->max_bw_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5541 reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5542 ev->min_bw_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5543 reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5544 ev->max_bw_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5545 reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5546 ev->min_bw_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5547 reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5548 ev->max_bw_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5551 "6 GHz %s BW: LPI (%d - %d), SP (%d - %d), VLP (%d - %d)\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5553 reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5554 reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5555 reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5556 reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5557 reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i], in ath11k_pull_reg_chan_list_ext_update_ev()
5558 reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5563 reg_info->alpha2, reg_info->dfs_region, in ath11k_pull_reg_chan_list_ext_update_ev()
5564 reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, in ath11k_pull_reg_chan_list_ext_update_ev()
5565 reg_info->min_bw_5ghz, reg_info->max_bw_5ghz, in ath11k_pull_reg_chan_list_ext_update_ev()
5566 reg_info->phybitmap); in ath11k_pull_reg_chan_list_ext_update_ev()
5596 reg_info->reg_rules_2ghz_ptr = in ath11k_pull_reg_chan_list_ext_update_ev()
5600 if (!reg_info->reg_rules_2ghz_ptr) { in ath11k_pull_reg_chan_list_ext_update_ev()
5603 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5608 reg_info->reg_rules_2ghz_ptr); in ath11k_pull_reg_chan_list_ext_update_ev()
5627 reg_info->alpha2, reg_info->num_5ghz_reg_rules, in ath11k_pull_reg_chan_list_ext_update_ev()
5630 num_5ghz_reg_rules = num_5ghz_reg_rules - num_invalid_5ghz_ext_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5631 reg_info->num_5ghz_reg_rules = num_5ghz_reg_rules; in ath11k_pull_reg_chan_list_ext_update_ev()
5635 reg_info->reg_rules_5ghz_ptr = in ath11k_pull_reg_chan_list_ext_update_ev()
5639 if (!reg_info->reg_rules_5ghz_ptr) { in ath11k_pull_reg_chan_list_ext_update_ev()
5642 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5647 reg_info->reg_rules_5ghz_ptr); in ath11k_pull_reg_chan_list_ext_update_ev()
5658 reg_info->reg_rules_6ghz_ap_ptr[i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5662 if (!reg_info->reg_rules_6ghz_ap_ptr[i]) { in ath11k_pull_reg_chan_list_ext_update_ev()
5665 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5670 reg_info->reg_rules_6ghz_ap_ptr[i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5680 reg_info->reg_rules_6ghz_client_ptr[j][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5684 if (!reg_info->reg_rules_6ghz_client_ptr[j][i]) { in ath11k_pull_reg_chan_list_ext_update_ev()
5687 return -ENOMEM; in ath11k_pull_reg_chan_list_ext_update_ev()
5693 reg_info->reg_rules_6ghz_client_ptr[j][i]); in ath11k_pull_reg_chan_list_ext_update_ev()
5699 reg_info->client_type = ev->client_type; in ath11k_pull_reg_chan_list_ext_update_ev()
5700 reg_info->rnr_tpe_usable = ev->rnr_tpe_usable; in ath11k_pull_reg_chan_list_ext_update_ev()
5701 reg_info->unspecified_ap_usable = in ath11k_pull_reg_chan_list_ext_update_ev()
5702 ev->unspecified_ap_usable; in ath11k_pull_reg_chan_list_ext_update_ev()
5703 reg_info->domain_code_6ghz_ap[WMI_REG_INDOOR_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5704 ev->domain_code_6ghz_ap_lpi; in ath11k_pull_reg_chan_list_ext_update_ev()
5705 reg_info->domain_code_6ghz_ap[WMI_REG_STANDARD_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5706 ev->domain_code_6ghz_ap_sp; in ath11k_pull_reg_chan_list_ext_update_ev()
5707 reg_info->domain_code_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] = in ath11k_pull_reg_chan_list_ext_update_ev()
5708 ev->domain_code_6ghz_ap_vlp; in ath11k_pull_reg_chan_list_ext_update_ev()
5711 … 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()
5712 ath11k_6ghz_client_type_to_str(reg_info->client_type), in ath11k_pull_reg_chan_list_ext_update_ev()
5713 reg_info->rnr_tpe_usable, in ath11k_pull_reg_chan_list_ext_update_ev()
5714 reg_info->unspecified_ap_usable, in ath11k_pull_reg_chan_list_ext_update_ev()
5715 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_lpi), in ath11k_pull_reg_chan_list_ext_update_ev()
5716 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_sp), in ath11k_pull_reg_chan_list_ext_update_ev()
5717 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_ap_vlp)); in ath11k_pull_reg_chan_list_ext_update_ev()
5720 reg_info->domain_code_6ghz_client[WMI_REG_INDOOR_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5721 ev->domain_code_6ghz_client_lpi[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5722 reg_info->domain_code_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5723 ev->domain_code_6ghz_client_sp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5724 reg_info->domain_code_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] = in ath11k_pull_reg_chan_list_ext_update_ev()
5725 ev->domain_code_6ghz_client_vlp[i]; in ath11k_pull_reg_chan_list_ext_update_ev()
5728 "6 GHz client type %s client sub domain: lpi %s, sp %s, vlp %s\n", in ath11k_pull_reg_chan_list_ext_update_ev()
5730 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_lpi[i]), in ath11k_pull_reg_chan_list_ext_update_ev()
5731 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_sp[i]), in ath11k_pull_reg_chan_list_ext_update_ev()
5732 ath11k_sub_reg_6ghz_to_str(ev->domain_code_6ghz_client_vlp[i]) in ath11k_pull_reg_chan_list_ext_update_ev()
5736 reg_info->domain_code_6ghz_super_id = ev->domain_code_6ghz_super_id; in ath11k_pull_reg_chan_list_ext_update_ev()
5740 ath11k_6ghz_client_type_to_str(reg_info->client_type), in ath11k_pull_reg_chan_list_ext_update_ev()
5741 ath11k_super_reg_6ghz_to_str(reg_info->domain_code_6ghz_super_id)); in ath11k_pull_reg_chan_list_ext_update_ev()
5767 return -EPROTO; in ath11k_pull_peer_del_resp_ev()
5772 peer_del_resp->vdev_id = ev->vdev_id; in ath11k_pull_peer_del_resp_ev()
5773 ether_addr_copy(peer_del_resp->peer_macaddr.addr, in ath11k_pull_peer_del_resp_ev()
5774 ev->peer_macaddr.addr); in ath11k_pull_peer_del_resp_ev()
5799 return -EPROTO; in ath11k_pull_vdev_del_resp_ev()
5802 *vdev_id = ev->vdev_id; in ath11k_pull_vdev_del_resp_ev()
5825 ath11k_warn(ab, "failed to fetch bcn tx status ev"); in ath11k_pull_bcn_tx_status_ev()
5827 return -EPROTO; in ath11k_pull_bcn_tx_status_ev()
5830 *vdev_id = ev->vdev_id; in ath11k_pull_bcn_tx_status_ev()
5831 *tx_status = ev->tx_status; in ath11k_pull_bcn_tx_status_ev()
5855 return -EPROTO; in ath11k_pull_vdev_stopped_param_tlv()
5858 *vdev_id = ev->vdev_id; in ath11k_pull_vdev_stopped_param_tlv()
5872 parse->fixed = ptr; in ath11k_wmi_tlv_mgmt_rx_parse()
5875 if (!parse->frame_buf_done) { in ath11k_wmi_tlv_mgmt_rx_parse()
5876 parse->frame_buf = ptr; in ath11k_wmi_tlv_mgmt_rx_parse()
5877 parse->frame_buf_done = true; in ath11k_wmi_tlv_mgmt_rx_parse()
5893 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_pull_mgmt_rx_params_tlv()
5907 return -EPROTO; in ath11k_pull_mgmt_rx_params_tlv()
5910 hdr->pdev_id = ev->pdev_id; in ath11k_pull_mgmt_rx_params_tlv()
5911 hdr->chan_freq = ev->chan_freq; in ath11k_pull_mgmt_rx_params_tlv()
5912 hdr->channel = ev->channel; in ath11k_pull_mgmt_rx_params_tlv()
5913 hdr->snr = ev->snr; in ath11k_pull_mgmt_rx_params_tlv()
5914 hdr->rate = ev->rate; in ath11k_pull_mgmt_rx_params_tlv()
5915 hdr->phy_mode = ev->phy_mode; in ath11k_pull_mgmt_rx_params_tlv()
5916 hdr->buf_len = ev->buf_len; in ath11k_pull_mgmt_rx_params_tlv()
5917 hdr->status = ev->status; in ath11k_pull_mgmt_rx_params_tlv()
5918 hdr->flags = ev->flags; in ath11k_pull_mgmt_rx_params_tlv()
5919 hdr->rssi = ev->rssi; in ath11k_pull_mgmt_rx_params_tlv()
5920 hdr->tsf_delta = ev->tsf_delta; in ath11k_pull_mgmt_rx_params_tlv()
5921 memcpy(hdr->rssi_ctl, ev->rssi_ctl, sizeof(hdr->rssi_ctl)); in ath11k_pull_mgmt_rx_params_tlv()
5923 if (skb->len < (frame - skb->data) + hdr->buf_len) { in ath11k_pull_mgmt_rx_params_tlv()
5925 return -EPROTO; in ath11k_pull_mgmt_rx_params_tlv()
5930 skb_put(skb, frame - skb->data); in ath11k_pull_mgmt_rx_params_tlv()
5931 skb_pull(skb, frame - skb->data); in ath11k_pull_mgmt_rx_params_tlv()
5932 skb_put(skb, hdr->buf_len); in ath11k_pull_mgmt_rx_params_tlv()
5934 ath11k_ce_byte_swap(skb->data, hdr->buf_len); in ath11k_pull_mgmt_rx_params_tlv()
5947 spin_lock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5948 msdu = idr_find(&ar->txmgmt_idr, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5951 ath11k_warn(ar->ab, "received mgmt tx compl for invalid msdu_id: %d\n", in wmi_process_mgmt_tx_comp()
5952 tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5953 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5954 return -ENOENT; in wmi_process_mgmt_tx_comp()
5957 idr_remove(&ar->txmgmt_idr, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5958 spin_unlock_bh(&ar->txmgmt_idr_lock); in wmi_process_mgmt_tx_comp()
5961 dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); in wmi_process_mgmt_tx_comp()
5964 if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && in wmi_process_mgmt_tx_comp()
5965 !tx_compl_param->status) { in wmi_process_mgmt_tx_comp()
5966 info->flags |= IEEE80211_TX_STAT_ACK; in wmi_process_mgmt_tx_comp()
5968 ar->ab->wmi_ab.svc_map)) in wmi_process_mgmt_tx_comp()
5969 info->status.ack_signal = tx_compl_param->ack_rssi; in wmi_process_mgmt_tx_comp()
5972 ieee80211_tx_status_irqsafe(ar->hw, msdu); in wmi_process_mgmt_tx_comp()
5974 num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx); in wmi_process_mgmt_tx_comp()
5976 /* WARN when we received this event without doing any mgmt tx */ in wmi_process_mgmt_tx_comp()
5980 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in wmi_process_mgmt_tx_comp()
5981 "mgmt tx comp pending %d desc id %d\n", in wmi_process_mgmt_tx_comp()
5982 num_mgmt, tx_compl_param->desc_id); in wmi_process_mgmt_tx_comp()
5985 wake_up(&ar->txmgmt_empty_waitq); in wmi_process_mgmt_tx_comp()
6007 ath11k_warn(ab, "failed to fetch mgmt tx compl ev"); in ath11k_pull_mgmt_tx_compl_param_tlv()
6009 return -EPROTO; in ath11k_pull_mgmt_tx_compl_param_tlv()
6012 param->pdev_id = ev->pdev_id; in ath11k_pull_mgmt_tx_compl_param_tlv()
6013 param->desc_id = ev->desc_id; in ath11k_pull_mgmt_tx_compl_param_tlv()
6014 param->status = ev->status; in ath11k_pull_mgmt_tx_compl_param_tlv()
6015 param->ack_rssi = ev->ack_rssi; in ath11k_pull_mgmt_tx_compl_param_tlv()
6023 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_started()
6025 switch (ar->scan.state) { in ath11k_wmi_event_scan_started()
6029 ath11k_warn(ar->ab, "received scan started event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_started()
6030 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_started()
6031 ar->scan.state); in ath11k_wmi_event_scan_started()
6034 ar->scan.state = ATH11K_SCAN_RUNNING; in ath11k_wmi_event_scan_started()
6035 if (ar->scan.is_roc) in ath11k_wmi_event_scan_started()
6036 ieee80211_ready_on_channel(ar->hw); in ath11k_wmi_event_scan_started()
6037 complete(&ar->scan.started); in ath11k_wmi_event_scan_started()
6044 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_start_failed()
6046 switch (ar->scan.state) { in ath11k_wmi_event_scan_start_failed()
6050 ath11k_warn(ar->ab, "received scan start failed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_start_failed()
6051 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_start_failed()
6052 ar->scan.state); in ath11k_wmi_event_scan_start_failed()
6055 complete(&ar->scan.started); in ath11k_wmi_event_scan_start_failed()
6063 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_completed()
6065 switch (ar->scan.state) { in ath11k_wmi_event_scan_completed()
6076 ath11k_warn(ar->ab, "received scan completed event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_completed()
6077 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_completed()
6078 ar->scan.state); in ath11k_wmi_event_scan_completed()
6089 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_bss_chan()
6091 switch (ar->scan.state) { in ath11k_wmi_event_scan_bss_chan()
6094 ath11k_warn(ar->ab, "received scan bss chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_bss_chan()
6095 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_bss_chan()
6096 ar->scan.state); in ath11k_wmi_event_scan_bss_chan()
6100 ar->scan_channel = NULL; in ath11k_wmi_event_scan_bss_chan()
6107 lockdep_assert_held(&ar->data_lock); in ath11k_wmi_event_scan_foreign_chan()
6109 switch (ar->scan.state) { in ath11k_wmi_event_scan_foreign_chan()
6112 ath11k_warn(ar->ab, "received scan foreign chan event in an invalid scan state: %s (%d)\n", in ath11k_wmi_event_scan_foreign_chan()
6113 ath11k_scan_state_str(ar->scan.state), in ath11k_wmi_event_scan_foreign_chan()
6114 ar->scan.state); in ath11k_wmi_event_scan_foreign_chan()
6118 ar->scan_channel = ieee80211_get_channel(ar->hw->wiphy, freq); in ath11k_wmi_event_scan_foreign_chan()
6119 if (ar->scan.is_roc && ar->scan.roc_freq == freq) in ath11k_wmi_event_scan_foreign_chan()
6120 complete(&ar->scan.on_channel); in ath11k_wmi_event_scan_foreign_chan()
6185 return -EPROTO; in ath11k_pull_scan_ev()
6188 scan_evt_param->event_type = ev->event_type; in ath11k_pull_scan_ev()
6189 scan_evt_param->reason = ev->reason; in ath11k_pull_scan_ev()
6190 scan_evt_param->channel_freq = ev->channel_freq; in ath11k_pull_scan_ev()
6191 scan_evt_param->scan_req_id = ev->scan_req_id; in ath11k_pull_scan_ev()
6192 scan_evt_param->scan_id = ev->scan_id; in ath11k_pull_scan_ev()
6193 scan_evt_param->vdev_id = ev->vdev_id; in ath11k_pull_scan_ev()
6194 scan_evt_param->tsf_timestamp = ev->tsf_timestamp; in ath11k_pull_scan_ev()
6218 return -EPROTO; in ath11k_pull_peer_sta_kickout_ev()
6221 arg->mac_addr = ev->peer_macaddr.addr; in ath11k_pull_peer_sta_kickout_ev()
6245 return -EPROTO; in ath11k_pull_roam_ev()
6248 roam_ev->vdev_id = ev->vdev_id; in ath11k_pull_roam_ev()
6249 roam_ev->reason = ev->reason; in ath11k_pull_roam_ev()
6250 roam_ev->rssi = ev->rssi; in ath11k_pull_roam_ev()
6262 sband = ar->hw->wiphy->bands[band]; in freq_to_idx()
6266 for (ch = 0; ch < sband->n_channels; ch++, idx++) in freq_to_idx()
6267 if (sband->channels[ch].center_freq == freq) in freq_to_idx()
6293 return -EPROTO; in ath11k_pull_chan_info_ev()
6296 ch_info_ev->err_code = ev->err_code; in ath11k_pull_chan_info_ev()
6297 ch_info_ev->freq = ev->freq; in ath11k_pull_chan_info_ev()
6298 ch_info_ev->cmd_flags = ev->cmd_flags; in ath11k_pull_chan_info_ev()
6299 ch_info_ev->noise_floor = ev->noise_floor; in ath11k_pull_chan_info_ev()
6300 ch_info_ev->rx_clear_count = ev->rx_clear_count; in ath11k_pull_chan_info_ev()
6301 ch_info_ev->cycle_count = ev->cycle_count; in ath11k_pull_chan_info_ev()
6302 ch_info_ev->chan_tx_pwr_range = ev->chan_tx_pwr_range; in ath11k_pull_chan_info_ev()
6303 ch_info_ev->chan_tx_pwr_tp = ev->chan_tx_pwr_tp; in ath11k_pull_chan_info_ev()
6304 ch_info_ev->rx_frame_count = ev->rx_frame_count; in ath11k_pull_chan_info_ev()
6305 ch_info_ev->tx_frame_cnt = ev->tx_frame_cnt; in ath11k_pull_chan_info_ev()
6306 ch_info_ev->mac_clk_mhz = ev->mac_clk_mhz; in ath11k_pull_chan_info_ev()
6307 ch_info_ev->vdev_id = ev->vdev_id; in ath11k_pull_chan_info_ev()
6332 return -EPROTO; in ath11k_pull_pdev_bss_chan_info_ev()
6335 bss_ch_info_ev->pdev_id = ev->pdev_id; in ath11k_pull_pdev_bss_chan_info_ev()
6336 bss_ch_info_ev->freq = ev->freq; in ath11k_pull_pdev_bss_chan_info_ev()
6337 bss_ch_info_ev->noise_floor = ev->noise_floor; in ath11k_pull_pdev_bss_chan_info_ev()
6338 bss_ch_info_ev->rx_clear_count_low = ev->rx_clear_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6339 bss_ch_info_ev->rx_clear_count_high = ev->rx_clear_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6340 bss_ch_info_ev->cycle_count_low = ev->cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6341 bss_ch_info_ev->cycle_count_high = ev->cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6342 bss_ch_info_ev->tx_cycle_count_low = ev->tx_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6343 bss_ch_info_ev->tx_cycle_count_high = ev->tx_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6344 bss_ch_info_ev->rx_cycle_count_low = ev->rx_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6345 bss_ch_info_ev->rx_cycle_count_high = ev->rx_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6346 bss_ch_info_ev->rx_bss_cycle_count_low = ev->rx_bss_cycle_count_low; in ath11k_pull_pdev_bss_chan_info_ev()
6347 bss_ch_info_ev->rx_bss_cycle_count_high = ev->rx_bss_cycle_count_high; in ath11k_pull_pdev_bss_chan_info_ev()
6372 return -EPROTO; in ath11k_pull_vdev_install_key_compl_ev()
6375 arg->vdev_id = ev->vdev_id; in ath11k_pull_vdev_install_key_compl_ev()
6376 arg->macaddr = ev->peer_macaddr.addr; in ath11k_pull_vdev_install_key_compl_ev()
6377 arg->key_idx = ev->key_idx; in ath11k_pull_vdev_install_key_compl_ev()
6378 arg->key_flags = ev->key_flags; in ath11k_pull_vdev_install_key_compl_ev()
6379 arg->status = ev->status; in ath11k_pull_vdev_install_key_compl_ev()
6403 return -EPROTO; in ath11k_pull_peer_assoc_conf_ev()
6406 peer_assoc_conf->vdev_id = ev->vdev_id; in ath11k_pull_peer_assoc_conf_ev()
6407 peer_assoc_conf->macaddr = ev->peer_macaddr.addr; in ath11k_pull_peer_assoc_conf_ev()
6416 dst->ch_noise_floor = src->chan_nf; in ath11k_wmi_pull_pdev_stats_base()
6417 dst->tx_frame_count = src->tx_frame_count; in ath11k_wmi_pull_pdev_stats_base()
6418 dst->rx_frame_count = src->rx_frame_count; in ath11k_wmi_pull_pdev_stats_base()
6419 dst->rx_clear_count = src->rx_clear_count; in ath11k_wmi_pull_pdev_stats_base()
6420 dst->cycle_count = src->cycle_count; in ath11k_wmi_pull_pdev_stats_base()
6421 dst->phy_err_count = src->phy_err_count; in ath11k_wmi_pull_pdev_stats_base()
6422 dst->chan_tx_power = src->chan_tx_pwr; in ath11k_wmi_pull_pdev_stats_base()
6429 dst->comp_queued = src->comp_queued; in ath11k_wmi_pull_pdev_stats_tx()
6430 dst->comp_delivered = src->comp_delivered; in ath11k_wmi_pull_pdev_stats_tx()
6431 dst->msdu_enqued = src->msdu_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6432 dst->mpdu_enqued = src->mpdu_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6433 dst->wmm_drop = src->wmm_drop; in ath11k_wmi_pull_pdev_stats_tx()
6434 dst->local_enqued = src->local_enqued; in ath11k_wmi_pull_pdev_stats_tx()
6435 dst->local_freed = src->local_freed; in ath11k_wmi_pull_pdev_stats_tx()
6436 dst->hw_queued = src->hw_queued; in ath11k_wmi_pull_pdev_stats_tx()
6437 dst->hw_reaped = src->hw_reaped; in ath11k_wmi_pull_pdev_stats_tx()
6438 dst->underrun = src->underrun; in ath11k_wmi_pull_pdev_stats_tx()
6439 dst->hw_paused = src->hw_paused; in ath11k_wmi_pull_pdev_stats_tx()
6440 dst->tx_abort = src->tx_abort; in ath11k_wmi_pull_pdev_stats_tx()
6441 dst->mpdus_requeued = src->mpdus_requeued; in ath11k_wmi_pull_pdev_stats_tx()
6442 dst->tx_ko = src->tx_ko; in ath11k_wmi_pull_pdev_stats_tx()
6443 dst->tx_xretry = src->tx_xretry; in ath11k_wmi_pull_pdev_stats_tx()
6444 dst->data_rc = src->data_rc; in ath11k_wmi_pull_pdev_stats_tx()
6445 dst->self_triggers = src->self_triggers; in ath11k_wmi_pull_pdev_stats_tx()
6446 dst->sw_retry_failure = src->sw_retry_failure; in ath11k_wmi_pull_pdev_stats_tx()
6447 dst->illgl_rate_phy_err = src->illgl_rate_phy_err; in ath11k_wmi_pull_pdev_stats_tx()
6448 dst->pdev_cont_xretry = src->pdev_cont_xretry; in ath11k_wmi_pull_pdev_stats_tx()
6449 dst->pdev_tx_timeout = src->pdev_tx_timeout; in ath11k_wmi_pull_pdev_stats_tx()
6450 dst->pdev_resets = src->pdev_resets; in ath11k_wmi_pull_pdev_stats_tx()
6451 dst->stateless_tid_alloc_failure = src->stateless_tid_alloc_failure; in ath11k_wmi_pull_pdev_stats_tx()
6452 dst->phy_underrun = src->phy_underrun; in ath11k_wmi_pull_pdev_stats_tx()
6453 dst->txop_ovf = src->txop_ovf; in ath11k_wmi_pull_pdev_stats_tx()
6454 dst->seq_posted = src->seq_posted; in ath11k_wmi_pull_pdev_stats_tx()
6455 dst->seq_failed_queueing = src->seq_failed_queueing; in ath11k_wmi_pull_pdev_stats_tx()
6456 dst->seq_completed = src->seq_completed; in ath11k_wmi_pull_pdev_stats_tx()
6457 dst->seq_restarted = src->seq_restarted; in ath11k_wmi_pull_pdev_stats_tx()
6458 dst->mu_seq_posted = src->mu_seq_posted; in ath11k_wmi_pull_pdev_stats_tx()
6459 dst->mpdus_sw_flush = src->mpdus_sw_flush; in ath11k_wmi_pull_pdev_stats_tx()
6460 dst->mpdus_hw_filter = src->mpdus_hw_filter; in ath11k_wmi_pull_pdev_stats_tx()
6461 dst->mpdus_truncated = src->mpdus_truncated; in ath11k_wmi_pull_pdev_stats_tx()
6462 dst->mpdus_ack_failed = src->mpdus_ack_failed; in ath11k_wmi_pull_pdev_stats_tx()
6463 dst->mpdus_expired = src->mpdus_expired; in ath11k_wmi_pull_pdev_stats_tx()
6469 dst->mid_ppdu_route_change = src->mid_ppdu_route_change; in ath11k_wmi_pull_pdev_stats_rx()
6470 dst->status_rcvd = src->status_rcvd; in ath11k_wmi_pull_pdev_stats_rx()
6471 dst->r0_frags = src->r0_frags; in ath11k_wmi_pull_pdev_stats_rx()
6472 dst->r1_frags = src->r1_frags; in ath11k_wmi_pull_pdev_stats_rx()
6473 dst->r2_frags = src->r2_frags; in ath11k_wmi_pull_pdev_stats_rx()
6474 dst->r3_frags = src->r3_frags; in ath11k_wmi_pull_pdev_stats_rx()
6475 dst->htt_msdus = src->htt_msdus; in ath11k_wmi_pull_pdev_stats_rx()
6476 dst->htt_mpdus = src->htt_mpdus; in ath11k_wmi_pull_pdev_stats_rx()
6477 dst->loc_msdus = src->loc_msdus; in ath11k_wmi_pull_pdev_stats_rx()
6478 dst->loc_mpdus = src->loc_mpdus; in ath11k_wmi_pull_pdev_stats_rx()
6479 dst->oversize_amsdu = src->oversize_amsdu; in ath11k_wmi_pull_pdev_stats_rx()
6480 dst->phy_errs = src->phy_errs; in ath11k_wmi_pull_pdev_stats_rx()
6481 dst->phy_err_drop = src->phy_err_drop; in ath11k_wmi_pull_pdev_stats_rx()
6482 dst->mpdu_errs = src->mpdu_errs; in ath11k_wmi_pull_pdev_stats_rx()
6483 dst->rx_ovfl_errs = src->rx_ovfl_errs; in ath11k_wmi_pull_pdev_stats_rx()
6492 dst->vdev_id = src->vdev_id; in ath11k_wmi_pull_vdev_stats()
6493 dst->beacon_snr = src->beacon_snr; in ath11k_wmi_pull_vdev_stats()
6494 dst->data_snr = src->data_snr; in ath11k_wmi_pull_vdev_stats()
6495 dst->num_rx_frames = src->num_rx_frames; in ath11k_wmi_pull_vdev_stats()
6496 dst->num_rts_fail = src->num_rts_fail; in ath11k_wmi_pull_vdev_stats()
6497 dst->num_rts_success = src->num_rts_success; in ath11k_wmi_pull_vdev_stats()
6498 dst->num_rx_err = src->num_rx_err; in ath11k_wmi_pull_vdev_stats()
6499 dst->num_rx_discard = src->num_rx_discard; in ath11k_wmi_pull_vdev_stats()
6500 dst->num_tx_not_acked = src->num_tx_not_acked; in ath11k_wmi_pull_vdev_stats()
6502 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames); i++) in ath11k_wmi_pull_vdev_stats()
6503 dst->num_tx_frames[i] = src->num_tx_frames[i]; in ath11k_wmi_pull_vdev_stats()
6505 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames_retries); i++) in ath11k_wmi_pull_vdev_stats()
6506 dst->num_tx_frames_retries[i] = src->num_tx_frames_retries[i]; in ath11k_wmi_pull_vdev_stats()
6508 for (i = 0; i < ARRAY_SIZE(src->num_tx_frames_failures); i++) in ath11k_wmi_pull_vdev_stats()
6509 dst->num_tx_frames_failures[i] = src->num_tx_frames_failures[i]; in ath11k_wmi_pull_vdev_stats()
6511 for (i = 0; i < ARRAY_SIZE(src->tx_rate_history); i++) in ath11k_wmi_pull_vdev_stats()
6512 dst->tx_rate_history[i] = src->tx_rate_history[i]; in ath11k_wmi_pull_vdev_stats()
6514 for (i = 0; i < ARRAY_SIZE(src->beacon_rssi_history); i++) in ath11k_wmi_pull_vdev_stats()
6515 dst->beacon_rssi_history[i] = src->beacon_rssi_history[i]; in ath11k_wmi_pull_vdev_stats()
6522 dst->vdev_id = src->vdev_id; in ath11k_wmi_pull_bcn_stats()
6523 dst->tx_bcn_succ_cnt = src->tx_bcn_succ_cnt; in ath11k_wmi_pull_bcn_stats()
6524 dst->tx_bcn_outage_cnt = src->tx_bcn_outage_cnt; in ath11k_wmi_pull_bcn_stats()
6532 const struct wmi_stats_event *ev = parse->ev; in ath11k_wmi_tlv_rssi_chain_parse()
6533 struct ath11k_fw_stats *stats = parse->stats; in ath11k_wmi_tlv_rssi_chain_parse()
6542 return -EPROTO; in ath11k_wmi_tlv_rssi_chain_parse()
6546 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6547 stats->stats_id = WMI_REQUEST_RSSI_PER_CHAIN_STAT; in ath11k_wmi_tlv_rssi_chain_parse()
6551 stats_rssi->vdev_id, stats_rssi->peer_macaddr.addr); in ath11k_wmi_tlv_rssi_chain_parse()
6553 arvif = ath11k_mac_get_arvif(ar, stats_rssi->vdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6556 stats_rssi->vdev_id); in ath11k_wmi_tlv_rssi_chain_parse()
6557 ret = -EPROTO; in ath11k_wmi_tlv_rssi_chain_parse()
6563 arvif->bssid, arvif->vif); in ath11k_wmi_tlv_rssi_chain_parse()
6565 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_wmi_tlv_rssi_chain_parse()
6566 arvif->bssid, in ath11k_wmi_tlv_rssi_chain_parse()
6571 arvif->bssid); in ath11k_wmi_tlv_rssi_chain_parse()
6577 BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) > in ath11k_wmi_tlv_rssi_chain_parse()
6578 ARRAY_SIZE(stats_rssi->rssi_avg_beacon)); in ath11k_wmi_tlv_rssi_chain_parse()
6580 for (j = 0; j < ARRAY_SIZE(arsta->chain_signal); j++) { in ath11k_wmi_tlv_rssi_chain_parse()
6581 arsta->chain_signal[j] = stats_rssi->rssi_avg_beacon[j]; in ath11k_wmi_tlv_rssi_chain_parse()
6585 stats_rssi->rssi_avg_beacon[j], in ath11k_wmi_tlv_rssi_chain_parse()
6587 stats_rssi->rssi_avg_data[j]); in ath11k_wmi_tlv_rssi_chain_parse()
6600 struct ath11k_fw_stats *stats = parse->stats; in ath11k_wmi_tlv_fw_stats_data_parse()
6601 const struct wmi_stats_event *ev = parse->ev; in ath11k_wmi_tlv_fw_stats_data_parse()
6611 return -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6614 stats->stats_id = 0; in ath11k_wmi_tlv_fw_stats_data_parse()
6618 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_tlv_fw_stats_data_parse()
6620 for (i = 0; i < ev->num_pdev_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6626 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6630 stats->stats_id = WMI_REQUEST_PDEV_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6633 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6639 ath11k_wmi_pull_pdev_stats_base(&src->base, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6640 ath11k_wmi_pull_pdev_stats_tx(&src->tx, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6641 ath11k_wmi_pull_pdev_stats_rx(&src->rx, dst); in ath11k_wmi_tlv_fw_stats_data_parse()
6642 list_add_tail(&dst->list, &stats->pdevs); in ath11k_wmi_tlv_fw_stats_data_parse()
6645 for (i = 0; i < ev->num_vdev_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6651 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6655 stats->stats_id = WMI_REQUEST_VDEV_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6657 arvif = ath11k_mac_get_arvif(ar, src->vdev_id); in ath11k_wmi_tlv_fw_stats_data_parse()
6659 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_wmi_tlv_fw_stats_data_parse()
6660 arvif->bssid, in ath11k_wmi_tlv_fw_stats_data_parse()
6664 arsta->rssi_beacon = src->beacon_snr; in ath11k_wmi_tlv_fw_stats_data_parse()
6667 src->vdev_id, src->beacon_snr); in ath11k_wmi_tlv_fw_stats_data_parse()
6671 arvif->bssid); in ath11k_wmi_tlv_fw_stats_data_parse()
6676 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6683 list_add_tail(&dst->list, &stats->vdevs); in ath11k_wmi_tlv_fw_stats_data_parse()
6686 for (i = 0; i < ev->num_bcn_stats; i++) { in ath11k_wmi_tlv_fw_stats_data_parse()
6692 ret = -EPROTO; in ath11k_wmi_tlv_fw_stats_data_parse()
6696 stats->stats_id = WMI_REQUEST_BCN_STAT; in ath11k_wmi_tlv_fw_stats_data_parse()
6699 len -= sizeof(*src); in ath11k_wmi_tlv_fw_stats_data_parse()
6706 list_add_tail(&dst->list, &stats->bcn); in ath11k_wmi_tlv_fw_stats_data_parse()
6723 parse->ev = (struct wmi_stats_event *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6724 parse->stats->pdev_id = parse->ev->pdev_id; in ath11k_wmi_tlv_fw_stats_parse()
6730 parse->rssi = (struct wmi_per_chain_rssi_stats *)ptr; in ath11k_wmi_tlv_fw_stats_parse()
6732 if (parse->ev->stats_id & WMI_REQUEST_RSSI_PER_CHAIN_STAT) in ath11k_wmi_tlv_fw_stats_parse()
6733 parse->rssi_num = parse->rssi->num_per_chain_rssi_stats; in ath11k_wmi_tlv_fw_stats_parse()
6737 parse->ev->stats_id, in ath11k_wmi_tlv_fw_stats_parse()
6738 parse->rssi_num); in ath11k_wmi_tlv_fw_stats_parse()
6741 if (parse->rssi_num && !parse->chain_rssi_done) { in ath11k_wmi_tlv_fw_stats_parse()
6750 parse->chain_rssi_done = true; in ath11k_wmi_tlv_fw_stats_parse()
6764 stats->stats_id = 0; in ath11k_wmi_pull_fw_stats()
6767 return ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_pull_fw_stats()
6779 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_pdev_base_stats_fill()
6780 len += scnprintf(buf + len, buf_len - len, "%30s\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6782 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6785 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6786 "Channel noise floor", pdev->ch_noise_floor); in ath11k_wmi_fw_pdev_base_stats_fill()
6787 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6788 "Channel TX power", pdev->chan_tx_power); in ath11k_wmi_fw_pdev_base_stats_fill()
6789 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6790 "TX frame count", pdev->tx_frame_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6791 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6792 "RX frame count", pdev->rx_frame_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6793 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6794 "RX clear count", pdev->rx_clear_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6795 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6796 "Cycle count", pdev->cycle_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6797 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_base_stats_fill()
6798 "PHY error count", pdev->phy_err_count); in ath11k_wmi_fw_pdev_base_stats_fill()
6810 len += scnprintf(buf + len, buf_len - len, "\n%30s\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6811 "ath11k PDEV TX stats"); in ath11k_wmi_fw_pdev_tx_stats_fill()
6812 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6815 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6816 "HTT cookies queued", pdev->comp_queued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6817 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6818 "HTT cookies disp.", pdev->comp_delivered); in ath11k_wmi_fw_pdev_tx_stats_fill()
6819 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6820 "MSDU queued", pdev->msdu_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6821 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6822 "MPDU queued", pdev->mpdu_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6823 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6824 "MSDUs dropped", pdev->wmm_drop); in ath11k_wmi_fw_pdev_tx_stats_fill()
6825 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6826 "Local enqued", pdev->local_enqued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6827 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6828 "Local freed", pdev->local_freed); in ath11k_wmi_fw_pdev_tx_stats_fill()
6829 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6830 "HW queued", pdev->hw_queued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6831 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6832 "PPDUs reaped", pdev->hw_reaped); in ath11k_wmi_fw_pdev_tx_stats_fill()
6833 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6834 "Num underruns", pdev->underrun); in ath11k_wmi_fw_pdev_tx_stats_fill()
6835 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6836 "Num HW Paused", pdev->hw_paused); in ath11k_wmi_fw_pdev_tx_stats_fill()
6837 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6838 "PPDUs cleaned", pdev->tx_abort); in ath11k_wmi_fw_pdev_tx_stats_fill()
6839 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6840 "MPDUs requeued", pdev->mpdus_requeued); in ath11k_wmi_fw_pdev_tx_stats_fill()
6841 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6842 "PPDU OK", pdev->tx_ko); in ath11k_wmi_fw_pdev_tx_stats_fill()
6843 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6844 "Excessive retries", pdev->tx_xretry); in ath11k_wmi_fw_pdev_tx_stats_fill()
6845 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6846 "HW rate", pdev->data_rc); in ath11k_wmi_fw_pdev_tx_stats_fill()
6847 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6848 "Sched self triggers", pdev->self_triggers); in ath11k_wmi_fw_pdev_tx_stats_fill()
6849 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6851 pdev->sw_retry_failure); in ath11k_wmi_fw_pdev_tx_stats_fill()
6852 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6854 pdev->illgl_rate_phy_err); in ath11k_wmi_fw_pdev_tx_stats_fill()
6855 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6856 "PDEV continuous xretry", pdev->pdev_cont_xretry); in ath11k_wmi_fw_pdev_tx_stats_fill()
6857 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6858 "TX timeout", pdev->pdev_tx_timeout); in ath11k_wmi_fw_pdev_tx_stats_fill()
6859 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6860 "PDEV resets", pdev->pdev_resets); in ath11k_wmi_fw_pdev_tx_stats_fill()
6861 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6863 pdev->stateless_tid_alloc_failure); in ath11k_wmi_fw_pdev_tx_stats_fill()
6864 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6865 "PHY underrun", pdev->phy_underrun); in ath11k_wmi_fw_pdev_tx_stats_fill()
6866 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6867 "MPDU is more than txop limit", pdev->txop_ovf); in ath11k_wmi_fw_pdev_tx_stats_fill()
6868 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6869 "Num sequences posted", pdev->seq_posted); in ath11k_wmi_fw_pdev_tx_stats_fill()
6870 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6871 "Num seq failed queueing ", pdev->seq_failed_queueing); in ath11k_wmi_fw_pdev_tx_stats_fill()
6872 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6873 "Num sequences completed ", pdev->seq_completed); in ath11k_wmi_fw_pdev_tx_stats_fill()
6874 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6875 "Num sequences restarted ", pdev->seq_restarted); in ath11k_wmi_fw_pdev_tx_stats_fill()
6876 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6877 "Num of MU sequences posted ", pdev->mu_seq_posted); in ath11k_wmi_fw_pdev_tx_stats_fill()
6878 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6879 "Num of MPDUS SW flushed ", pdev->mpdus_sw_flush); in ath11k_wmi_fw_pdev_tx_stats_fill()
6880 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6881 "Num of MPDUS HW filtered ", pdev->mpdus_hw_filter); in ath11k_wmi_fw_pdev_tx_stats_fill()
6882 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6883 "Num of MPDUS truncated ", pdev->mpdus_truncated); in ath11k_wmi_fw_pdev_tx_stats_fill()
6884 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6885 "Num of MPDUS ACK failed ", pdev->mpdus_ack_failed); in ath11k_wmi_fw_pdev_tx_stats_fill()
6886 len += scnprintf(buf + len, buf_len - len, "%30s %10u\n", in ath11k_wmi_fw_pdev_tx_stats_fill()
6887 "Num of MPDUS expired ", pdev->mpdus_expired); in ath11k_wmi_fw_pdev_tx_stats_fill()
6898 len += scnprintf(buf + len, buf_len - len, "\n%30s\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6900 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6903 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6905 pdev->mid_ppdu_route_change); in ath11k_wmi_fw_pdev_rx_stats_fill()
6906 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6907 "Tot. number of statuses", pdev->status_rcvd); in ath11k_wmi_fw_pdev_rx_stats_fill()
6908 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6909 "Extra frags on rings 0", pdev->r0_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6910 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6911 "Extra frags on rings 1", pdev->r1_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6912 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6913 "Extra frags on rings 2", pdev->r2_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6914 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6915 "Extra frags on rings 3", pdev->r3_frags); in ath11k_wmi_fw_pdev_rx_stats_fill()
6916 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6917 "MSDUs delivered to HTT", pdev->htt_msdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6918 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6919 "MPDUs delivered to HTT", pdev->htt_mpdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6920 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6921 "MSDUs delivered to stack", pdev->loc_msdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6922 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6923 "MPDUs delivered to stack", pdev->loc_mpdus); in ath11k_wmi_fw_pdev_rx_stats_fill()
6924 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6925 "Oversized AMSUs", pdev->oversize_amsdu); in ath11k_wmi_fw_pdev_rx_stats_fill()
6926 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6927 "PHY errors", pdev->phy_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
6928 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6929 "PHY errors drops", pdev->phy_err_drop); in ath11k_wmi_fw_pdev_rx_stats_fill()
6930 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6931 "MPDU errors (FCS, MIC, ENC)", pdev->mpdu_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
6932 len += scnprintf(buf + len, buf_len - len, "%30s %10d\n", in ath11k_wmi_fw_pdev_rx_stats_fill()
6933 "Overflow errors", pdev->rx_ovfl_errs); in ath11k_wmi_fw_pdev_rx_stats_fill()
6944 struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, vdev->vdev_id); in ath11k_wmi_fw_vdev_stats_fill()
6954 vif_macaddr = arvif->vif->addr; in ath11k_wmi_fw_vdev_stats_fill()
6956 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6957 "VDEV ID", vdev->vdev_id); in ath11k_wmi_fw_vdev_stats_fill()
6958 len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", in ath11k_wmi_fw_vdev_stats_fill()
6960 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6961 "beacon snr", vdev->beacon_snr); in ath11k_wmi_fw_vdev_stats_fill()
6962 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6963 "data snr", vdev->data_snr); in ath11k_wmi_fw_vdev_stats_fill()
6964 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6965 "num rx frames", vdev->num_rx_frames); in ath11k_wmi_fw_vdev_stats_fill()
6966 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6967 "num rts fail", vdev->num_rts_fail); in ath11k_wmi_fw_vdev_stats_fill()
6968 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6969 "num rts success", vdev->num_rts_success); in ath11k_wmi_fw_vdev_stats_fill()
6970 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6971 "num rx err", vdev->num_rx_err); in ath11k_wmi_fw_vdev_stats_fill()
6972 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6973 "num rx discard", vdev->num_rx_discard); in ath11k_wmi_fw_vdev_stats_fill()
6974 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_vdev_stats_fill()
6975 "num tx not acked", vdev->num_tx_not_acked); in ath11k_wmi_fw_vdev_stats_fill()
6977 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames); i++) in ath11k_wmi_fw_vdev_stats_fill()
6978 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6980 "num tx frames", i, in ath11k_wmi_fw_vdev_stats_fill()
6981 vdev->num_tx_frames[i]); in ath11k_wmi_fw_vdev_stats_fill()
6983 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames_retries); i++) in ath11k_wmi_fw_vdev_stats_fill()
6984 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6986 "num tx frames retries", i, in ath11k_wmi_fw_vdev_stats_fill()
6987 vdev->num_tx_frames_retries[i]); in ath11k_wmi_fw_vdev_stats_fill()
6989 for (i = 0 ; i < ARRAY_SIZE(vdev->num_tx_frames_failures); i++) in ath11k_wmi_fw_vdev_stats_fill()
6990 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6992 "num tx frames failures", i, in ath11k_wmi_fw_vdev_stats_fill()
6993 vdev->num_tx_frames_failures[i]); in ath11k_wmi_fw_vdev_stats_fill()
6995 for (i = 0 ; i < ARRAY_SIZE(vdev->tx_rate_history); i++) in ath11k_wmi_fw_vdev_stats_fill()
6996 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
6998 "tx rate history", i, in ath11k_wmi_fw_vdev_stats_fill()
6999 vdev->tx_rate_history[i]); in ath11k_wmi_fw_vdev_stats_fill()
7001 for (i = 0 ; i < ARRAY_SIZE(vdev->beacon_rssi_history); i++) in ath11k_wmi_fw_vdev_stats_fill()
7002 len += scnprintf(buf + len, buf_len - len, in ath11k_wmi_fw_vdev_stats_fill()
7005 vdev->beacon_rssi_history[i]); in ath11k_wmi_fw_vdev_stats_fill()
7007 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_vdev_stats_fill()
7018 struct ath11k_vif *arvif = ath11k_mac_get_arvif(ar, bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7022 ath11k_warn(ar->ab, "invalid vdev id %d in bcn stats", in ath11k_wmi_fw_bcn_stats_fill()
7023 bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7027 vdev_macaddr = arvif->vif->addr; in ath11k_wmi_fw_bcn_stats_fill()
7029 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7030 "VDEV ID", bcn->vdev_id); in ath11k_wmi_fw_bcn_stats_fill()
7031 len += scnprintf(buf + len, buf_len - len, "%30s %pM\n", in ath11k_wmi_fw_bcn_stats_fill()
7033 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_bcn_stats_fill()
7035 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7036 "Num of beacon tx success", bcn->tx_bcn_succ_cnt); in ath11k_wmi_fw_bcn_stats_fill()
7037 len += scnprintf(buf + len, buf_len - len, "%30s %u\n", in ath11k_wmi_fw_bcn_stats_fill()
7038 "Num of beacon tx failures", bcn->tx_bcn_outage_cnt); in ath11k_wmi_fw_bcn_stats_fill()
7040 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_bcn_stats_fill()
7055 spin_lock_bh(&ar->data_lock); in ath11k_wmi_fw_stats_fill()
7058 pdev = list_first_entry_or_null(&fw_stats->pdevs, in ath11k_wmi_fw_stats_fill()
7061 ath11k_warn(ar->ab, "failed to get pdev stats\n"); in ath11k_wmi_fw_stats_fill()
7071 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_stats_fill()
7072 len += scnprintf(buf + len, buf_len - len, "%30s\n", in ath11k_wmi_fw_stats_fill()
7074 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_stats_fill()
7077 list_for_each_entry(vdev, &fw_stats->vdevs, list) in ath11k_wmi_fw_stats_fill()
7082 num_bcn = list_count_nodes(&fw_stats->bcn); in ath11k_wmi_fw_stats_fill()
7084 len += scnprintf(buf + len, buf_len - len, "\n"); in ath11k_wmi_fw_stats_fill()
7085 len += scnprintf(buf + len, buf_len - len, "%30s (%zu)\n", in ath11k_wmi_fw_stats_fill()
7087 len += scnprintf(buf + len, buf_len - len, "%30s\n\n", in ath11k_wmi_fw_stats_fill()
7090 list_for_each_entry(bcn, &fw_stats->bcn, list) in ath11k_wmi_fw_stats_fill()
7095 spin_unlock_bh(&ar->data_lock); in ath11k_wmi_fw_stats_fill()
7098 buf[len - 1] = 0; in ath11k_wmi_fw_stats_fill()
7106 wake_up(&ab->wmi_ab.tx_credits_wq); in ath11k_wmi_op_ep_tx_credits()
7128 return -EPROTO; in ath11k_reg_11d_new_cc_event()
7131 spin_lock_bh(&ab->base_lock); in ath11k_reg_11d_new_cc_event()
7132 memcpy(&ab->new_alpha2, &ev->new_alpha2, 2); in ath11k_reg_11d_new_cc_event()
7133 spin_unlock_bh(&ab->base_lock); in ath11k_reg_11d_new_cc_event()
7136 ab->new_alpha2[0], in ath11k_reg_11d_new_cc_event()
7137 ab->new_alpha2[1]); in ath11k_reg_11d_new_cc_event()
7141 for (i = 0; i < ab->num_radios; i++) { in ath11k_reg_11d_new_cc_event()
7142 pdev = &ab->pdevs[i]; in ath11k_reg_11d_new_cc_event()
7143 ar = pdev->ar; in ath11k_reg_11d_new_cc_event()
7144 ar->state_11d = ATH11K_11D_IDLE; in ath11k_reg_11d_new_cc_event()
7145 complete(&ar->completed_11d_scan); in ath11k_reg_11d_new_cc_event()
7148 queue_work(ab->workqueue, &ab->update_11d_work); in ath11k_reg_11d_new_cc_event()
7161 eid = ATH11K_SKB_CB(skb)->eid; in ath11k_wmi_htc_tx_complete()
7167 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_htc_tx_complete()
7168 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_htc_tx_complete()
7171 for (i = 0; i < ab->htc.wmi_ep_count; i++) { in ath11k_wmi_htc_tx_complete()
7172 if (ab->wmi_ab.wmi[i].eid == eid) { in ath11k_wmi_htc_tx_complete()
7173 wmi = &ab->wmi_ab.wmi[i]; in ath11k_wmi_htc_tx_complete()
7179 wake_up(&wmi->tx_ce_desc_wq); in ath11k_wmi_htc_tx_complete()
7190 return -ENOMEM; in ath11k_reg_chan_list_event()
7232 rdy_parse->num_extra_mac_addr = in ath11k_wmi_tlv_rdy_parse()
7235 ether_addr_copy(ab->mac_addr, in ath11k_wmi_tlv_rdy_parse()
7237 ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; in ath11k_wmi_tlv_rdy_parse()
7241 num_mac_addr = rdy_parse->num_extra_mac_addr; in ath11k_wmi_tlv_rdy_parse()
7243 if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) in ath11k_wmi_tlv_rdy_parse()
7246 for (i = 0; i < ab->num_radios; i++) { in ath11k_wmi_tlv_rdy_parse()
7247 pdev = &ab->pdevs[i]; in ath11k_wmi_tlv_rdy_parse()
7248 ether_addr_copy(pdev->mac_addr, addr_list[i].addr); in ath11k_wmi_tlv_rdy_parse()
7250 ab->pdevs_macaddr_valid = true; in ath11k_wmi_tlv_rdy_parse()
7264 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_ready_event()
7273 complete(&ab->wmi_ab.unified_ready); in ath11k_ready_event()
7298 complete(&ar->peer_delete_done); in ath11k_peer_delete_resp_event()
7324 complete(&ar->vdev_delete_done); in ath11k_vdev_delete_resp_event()
7370 ar->last_wmi_vdev_start_status = 0; in ath11k_vdev_start_resp_event()
7371 ar->max_allowed_tx_power = vdev_start_resp.max_allowed_tx_power; in ath11k_vdev_start_resp_event()
7377 ar->last_wmi_vdev_start_status = status; in ath11k_vdev_start_resp_event()
7380 complete(&ar->vdev_setup_done); in ath11k_vdev_start_resp_event()
7394 ath11k_warn(ab, "failed to extract bcn tx status"); in ath11k_bcn_tx_status_event()
7398 ath11k_dbg(ab, ATH11K_DBG_WMI, "event offload bcn tx status"); in ath11k_bcn_tx_status_event()
7409 queue_work(ab->workqueue, &arvif->bcn_tx_work); in ath11k_bcn_tx_status_event()
7442 ev->peer_macaddr.addr, ev->peer_ps_state, in ath11k_wmi_event_peer_sta_ps_state_chg()
7443 ev->ps_supported_bitmap, ev->peer_ps_valid, in ath11k_wmi_event_peer_sta_ps_state_chg()
7444 ev->peer_ps_timestamp); in ath11k_wmi_event_peer_sta_ps_state_chg()
7448 spin_lock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7450 peer = ath11k_peer_find_by_addr(ab, ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7453 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7454 ath11k_warn(ab, "peer not found %pM\n", ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7458 ar = ath11k_mac_get_ar_by_vdev_id(ab, peer->vdev_id); in ath11k_wmi_event_peer_sta_ps_state_chg()
7461 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7463 peer->vdev_id); in ath11k_wmi_event_peer_sta_ps_state_chg()
7468 sta = peer->sta; in ath11k_wmi_event_peer_sta_ps_state_chg()
7470 spin_unlock_bh(&ab->base_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7474 ev->peer_macaddr.addr); in ath11k_wmi_event_peer_sta_ps_state_chg()
7480 spin_lock_bh(&ar->data_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7482 peer_previous_ps_state = arsta->peer_ps_state; in ath11k_wmi_event_peer_sta_ps_state_chg()
7483 arsta->peer_ps_state = ev->peer_ps_state; in ath11k_wmi_event_peer_sta_ps_state_chg()
7484 arsta->peer_current_ps_valid = !!ev->peer_ps_valid; in ath11k_wmi_event_peer_sta_ps_state_chg()
7487 ar->ab->wmi_ab.svc_map)) { in ath11k_wmi_event_peer_sta_ps_state_chg()
7488 if (!(ev->ps_supported_bitmap & WMI_PEER_PS_VALID) || in ath11k_wmi_event_peer_sta_ps_state_chg()
7489 !(ev->ps_supported_bitmap & WMI_PEER_PS_STATE_TIMESTAMP) || in ath11k_wmi_event_peer_sta_ps_state_chg()
7490 !ev->peer_ps_valid) in ath11k_wmi_event_peer_sta_ps_state_chg()
7493 if (arsta->peer_ps_state == WMI_PEER_PS_STATE_ON) { in ath11k_wmi_event_peer_sta_ps_state_chg()
7494 arsta->ps_start_time = ev->peer_ps_timestamp; in ath11k_wmi_event_peer_sta_ps_state_chg()
7495 arsta->ps_start_jiffies = jiffies; in ath11k_wmi_event_peer_sta_ps_state_chg()
7496 } else if (arsta->peer_ps_state == WMI_PEER_PS_STATE_OFF && in ath11k_wmi_event_peer_sta_ps_state_chg()
7498 arsta->ps_total_duration = arsta->ps_total_duration + in ath11k_wmi_event_peer_sta_ps_state_chg()
7499 (ev->peer_ps_timestamp - arsta->ps_start_time); in ath11k_wmi_event_peer_sta_ps_state_chg()
7502 if (ar->ps_timekeeper_enable) in ath11k_wmi_event_peer_sta_ps_state_chg()
7503 trace_ath11k_ps_timekeeper(ar, ev->peer_macaddr.addr, in ath11k_wmi_event_peer_sta_ps_state_chg()
7504 ev->peer_ps_timestamp, in ath11k_wmi_event_peer_sta_ps_state_chg()
7505 arsta->peer_ps_state); in ath11k_wmi_event_peer_sta_ps_state_chg()
7509 spin_unlock_bh(&ar->data_lock); in ath11k_wmi_event_peer_sta_ps_state_chg()
7536 complete(&ar->vdev_setup_done); in ath11k_vdev_stopped_event()
7573 if ((test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) || in ath11k_mgmt_rx_event()
7581 status->flag |= RX_FLAG_MMIC_ERROR; in ath11k_mgmt_rx_event()
7585 status->band = NL80211_BAND_6GHZ; in ath11k_mgmt_rx_event()
7586 status->freq = rx_ev.chan_freq; in ath11k_mgmt_rx_event()
7588 status->band = NL80211_BAND_2GHZ; in ath11k_mgmt_rx_event()
7590 status->band = NL80211_BAND_5GHZ; in ath11k_mgmt_rx_event()
7601 (status->band == NL80211_BAND_5GHZ || status->band == NL80211_BAND_6GHZ)) in ath11k_mgmt_rx_event()
7603 "mgmt rx 11b (CCK) on 5/6GHz, band = %d\n", status->band); in ath11k_mgmt_rx_event()
7605 sband = &ar->mac.sbands[status->band]; in ath11k_mgmt_rx_event()
7607 if (status->band != NL80211_BAND_6GHZ) in ath11k_mgmt_rx_event()
7608 status->freq = ieee80211_channel_to_frequency(rx_ev.channel, in ath11k_mgmt_rx_event()
7609 status->band); in ath11k_mgmt_rx_event()
7611 status->signal = rx_ev.snr + ATH11K_DEFAULT_NOISE_FLOOR; in ath11k_mgmt_rx_event()
7612 status->rate_idx = ath11k_mac_bitrate_to_idx(sband, rx_ev.rate / 100); in ath11k_mgmt_rx_event()
7614 hdr = (struct ieee80211_hdr *)skb->data; in ath11k_mgmt_rx_event()
7615 fc = le16_to_cpu(hdr->frame_control); in ath11k_mgmt_rx_event()
7621 status->flag |= RX_FLAG_SKIP_MONITOR; in ath11k_mgmt_rx_event()
7627 if (ieee80211_has_protected(hdr->frame_control) && in ath11k_mgmt_rx_event()
7629 status->flag |= RX_FLAG_DECRYPTED; in ath11k_mgmt_rx_event()
7632 status->flag |= RX_FLAG_IV_STRIPPED | in ath11k_mgmt_rx_event()
7634 hdr->frame_control = __cpu_to_le16(fc & in ath11k_mgmt_rx_event()
7639 if (ieee80211_is_beacon(hdr->frame_control)) in ath11k_mgmt_rx_event()
7644 skb, skb->len, in ath11k_mgmt_rx_event()
7649 status->freq, status->band, status->signal, in ath11k_mgmt_rx_event()
7650 status->rate_idx); in ath11k_mgmt_rx_event()
7652 ieee80211_rx_ni(ar->hw, skb); in ath11k_mgmt_rx_event()
7664 ath11k_warn(ab, "failed to extract mgmt tx compl event"); in ath11k_mgmt_tx_compl_event()
7679 "event mgmt tx compl ev pdev_id %d, desc_id %d, status %d ack_rssi %d", in ath11k_mgmt_tx_compl_event()
7695 for (i = 0; i < ab->num_radios; i++) { in ath11k_get_ar_on_scan_state()
7696 pdev = rcu_dereference(ab->pdevs_active[i]); in ath11k_get_ar_on_scan_state()
7697 if (pdev && pdev->ar) { in ath11k_get_ar_on_scan_state()
7698 ar = pdev->ar; in ath11k_get_ar_on_scan_state()
7700 spin_lock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
7701 if (ar->scan.state == state && in ath11k_get_ar_on_scan_state()
7702 ar->scan.vdev_id == vdev_id) { in ath11k_get_ar_on_scan_state()
7703 spin_unlock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
7706 spin_unlock_bh(&ar->data_lock); in ath11k_get_ar_on_scan_state()
7747 spin_lock_bh(&ar->data_lock); in ath11k_scan_event()
7754 ath11k_scan_state_str(ar->scan.state), ar->scan.state); in ath11k_scan_event()
7783 spin_unlock_bh(&ar->data_lock); in ath11k_scan_event()
7803 spin_lock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
7810 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
7814 vdev_id = peer->vdev_id; in ath11k_peer_sta_kickout_event()
7816 spin_unlock_bh(&ab->base_lock); in ath11k_peer_sta_kickout_event()
7821 peer->vdev_id); in ath11k_peer_sta_kickout_event()
7825 sta = ieee80211_find_sta_by_ifaddr(ar->hw, in ath11k_peer_sta_kickout_event()
7892 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_chan_info_event()
7919 spin_lock_bh(&ar->data_lock); in ath11k_chan_info_event()
7921 switch (ar->scan.state) { in ath11k_chan_info_event()
7932 if (idx >= ARRAY_SIZE(ar->survey)) { in ath11k_chan_info_event()
7945 survey = &ar->survey[idx]; in ath11k_chan_info_event()
7947 survey->noise = ch_info_ev.noise_floor; in ath11k_chan_info_event()
7948 survey->filled = SURVEY_INFO_NOISE_DBM | SURVEY_INFO_TIME | in ath11k_chan_info_event()
7950 survey->time = div_u64(ch_info_ev.cycle_count, cc_freq_hz); in ath11k_chan_info_event()
7951 survey->time_busy = div_u64(ch_info_ev.rx_clear_count, cc_freq_hz); in ath11k_chan_info_event()
7954 spin_unlock_bh(&ar->data_lock); in ath11k_chan_info_event()
7964 u32 cc_freq_hz = ab->cc_freq_hz; in ath11k_pdev_bss_chan_info_event()
7965 u64 busy, total, tx, rx, rx_bss; in ath11k_pdev_bss_chan_info_event() local
7979 tx = (u64)(bss_ch_info_ev.tx_cycle_count_high) << 32 | in ath11k_pdev_bss_chan_info_event()
7989 …"event pdev bss chan info:\n pdev_id: %d freq: %d noise: %d cycle: busy %llu total %llu tx %llu rx… in ath11k_pdev_bss_chan_info_event()
7992 tx, rx, rx_bss); in ath11k_pdev_bss_chan_info_event()
8004 spin_lock_bh(&ar->data_lock); in ath11k_pdev_bss_chan_info_event()
8006 if (idx >= ARRAY_SIZE(ar->survey)) { in ath11k_pdev_bss_chan_info_event()
8012 survey = &ar->survey[idx]; in ath11k_pdev_bss_chan_info_event()
8014 survey->noise = bss_ch_info_ev.noise_floor; in ath11k_pdev_bss_chan_info_event()
8015 survey->time = div_u64(total, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8016 survey->time_busy = div_u64(busy, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8017 survey->time_rx = div_u64(rx_bss, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8018 survey->time_tx = div_u64(tx, cc_freq_hz); in ath11k_pdev_bss_chan_info_event()
8019 survey->filled |= (SURVEY_INFO_NOISE_DBM | in ath11k_pdev_bss_chan_info_event()
8025 spin_unlock_bh(&ar->data_lock); in ath11k_pdev_bss_chan_info_event()
8026 complete(&ar->bss_survey_done); in ath11k_pdev_bss_chan_info_event()
8056 ar->install_key_status = 0; in ath11k_vdev_install_key_compl_event()
8061 ar->install_key_status = install_key_compl.status; in ath11k_vdev_install_key_compl_event()
8064 complete(&ar->install_key_done); in ath11k_vdev_install_key_compl_event()
8083 if (ev->wmi_service_segment_bitmap[i] & in ath11k_wmi_tlv_services_parser()
8085 set_bit(j, ab->wmi_ab.svc_map); in ath11k_wmi_tlv_services_parser()
8091 ev->wmi_service_segment_bitmap[0], in ath11k_wmi_tlv_services_parser()
8092 ev->wmi_service_segment_bitmap[1], in ath11k_wmi_tlv_services_parser()
8093 ev->wmi_service_segment_bitmap[2], in ath11k_wmi_tlv_services_parser()
8094 ev->wmi_service_segment_bitmap[3]); in ath11k_wmi_tlv_services_parser()
8104 set_bit(j, ab->wmi_ab.svc_map); in ath11k_wmi_tlv_services_parser()
8121 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_service_available_event()
8154 complete(&ar->peer_assoc_done); in ath11k_peer_assoc_conf_event()
8190 spin_lock_bh(&ar->data_lock); in ath11k_update_stats_event()
8197 list_splice_tail_init(&stats.pdevs, &ar->fw_stats.pdevs); in ath11k_update_stats_event()
8198 complete(&ar->fw_stats_done); in ath11k_update_stats_event()
8203 complete(&ar->fw_stats_done); in ath11k_update_stats_event()
8215 for (i = 0; i < ab->num_radios; i++) { in ath11k_update_stats_event()
8216 pdev = rcu_dereference(ab->pdevs_active[i]); in ath11k_update_stats_event()
8217 if (pdev && pdev->ar) in ath11k_update_stats_event()
8218 total_vdevs_started += ar->num_started_vdevs; in ath11k_update_stats_event()
8222 is_end = ((++ar->fw_stats.num_vdev_recvd) == in ath11k_update_stats_event()
8226 &ar->fw_stats.vdevs); in ath11k_update_stats_event()
8229 complete(&ar->fw_stats_done); in ath11k_update_stats_event()
8240 complete(&ar->fw_stats_complete); in ath11k_update_stats_event()
8241 spin_unlock_bh(&ar->data_lock); in ath11k_update_stats_event()
8279 ev->ctl_failsafe_status); in ath11k_pdev_ctl_failsafe_check_event()
8284 if (ev->ctl_failsafe_status != 0) in ath11k_pdev_ctl_failsafe_check_event()
8286 ev->ctl_failsafe_status); in ath11k_pdev_ctl_failsafe_check_event()
8300 if (ev->current_switch_count) in ath11k_wmi_process_csa_switch_count_event()
8304 for (i = 0; i < ev->num_vdevs; i++) { in ath11k_wmi_process_csa_switch_count_event()
8313 if (arvif->is_up && arvif->vif->bss_conf.csa_active) in ath11k_wmi_process_csa_switch_count_event()
8314 ieee80211_csa_finish(arvif->vif, 0); in ath11k_wmi_process_csa_switch_count_event()
8346 ev->current_switch_count, ev->pdev_id, in ath11k_wmi_pdev_csa_switch_count_status_event()
8347 ev->num_vdevs); in ath11k_wmi_pdev_csa_switch_count_status_event()
8379 ev->pdev_id, ev->detection_mode, ev->chan_freq, ev->chan_width, in ath11k_wmi_pdev_dfs_radar_detected_event()
8380 ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, in ath11k_wmi_pdev_dfs_radar_detected_event()
8381 ev->freq_offset, ev->sidx); in ath11k_wmi_pdev_dfs_radar_detected_event()
8385 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8389 ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8393 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "DFS Radar Detected in pdev %d\n", in ath11k_wmi_pdev_dfs_radar_detected_event()
8394 ev->pdev_id); in ath11k_wmi_pdev_dfs_radar_detected_event()
8396 if (ar->dfs_block_radar_events) in ath11k_wmi_pdev_dfs_radar_detected_event()
8399 ieee80211_radar_detected(ar->hw, NULL); in ath11k_wmi_pdev_dfs_radar_detected_event()
8431 ev->temp, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8435 ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8437 ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); in ath11k_wmi_pdev_temperature_event()
8441 ath11k_thermal_event_temperature(ar, ev->temp); in ath11k_wmi_pdev_temperature_event()
8476 ev->vdev_id, ev->fils_tt, ev->tbtt); in ath11k_fils_discovery_event()
8497 ath11k_dbg(ab, ATH11K_DBG_WMI, "event probe resp tx status"); in ath11k_probe_resp_tx_status_event()
8507 if (ev->tx_status) in ath11k_probe_resp_tx_status_event()
8510 ev->vdev_id, ev->tx_status); in ath11k_probe_resp_tx_status_event()
8527 ev->wake_reason, wow_reason(ev->wake_reason)); in ath11k_wmi_tlv_wow_wakeup_host_parse()
8531 if (ev && ev->wake_reason == WOW_REASON_PAGE_FAULT) { in ath11k_wmi_tlv_wow_wakeup_host_parse()
8557 ret = ath11k_wmi_tlv_iter(ab, skb->data, skb->len, in ath11k_wmi_event_wow_wakeup_host()
8567 complete(&ab->wow.wakeup_completed); in ath11k_wmi_event_wow_wakeup_host()
8576 trace_ath11k_wmi_diag(ab, skb->data, skb->len); in ath11k_wmi_diag_event()
8631 if (ev->status) in ath11k_wmi_twt_add_dialog_event()
8634 ev->vdev_id, ev->dialog_id, in ath11k_wmi_twt_add_dialog_event()
8635 ath11k_wmi_twt_add_dialog_event_status(ev->status)); in ath11k_wmi_twt_add_dialog_event()
8667 arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id); in ath11k_wmi_gtk_offload_status_event()
8670 ev->vdev_id); in ath11k_wmi_gtk_offload_status_event()
8675 ev->refresh_cnt); in ath11k_wmi_gtk_offload_status_event()
8677 NULL, ev->replay_ctr.counter, GTK_REPLAY_COUNTER_BYTES); in ath11k_wmi_gtk_offload_status_event()
8679 replay_ctr = ev->replay_ctr.word1; in ath11k_wmi_gtk_offload_status_event()
8680 replay_ctr = (replay_ctr << 32) | ev->replay_ctr.word0; in ath11k_wmi_gtk_offload_status_event()
8681 arvif->rekey_data.replay_ctr = replay_ctr; in ath11k_wmi_gtk_offload_status_event()
8683 /* supplicant expects big-endian replay counter */ in ath11k_wmi_gtk_offload_status_event()
8686 ieee80211_gtk_rekey_notify(arvif->vif, arvif->bssid, in ath11k_wmi_gtk_offload_status_event()
8716 vdev_id = ev->vdev_id; in ath11k_wmi_p2p_noa_event()
8717 noa_descriptors = u32_get_bits(noa->noa_attr, in ath11k_wmi_p2p_noa_event()
8751 cmd_hdr = (struct wmi_cmd_hdr *)skb->data; in ath11k_wmi_tlv_op_rx()
8752 id = FIELD_GET(WMI_CMD_HDR_CMD_ID, (cmd_hdr->cmd_id)); in ath11k_wmi_tlv_op_rx()
8754 trace_ath11k_wmi_event(ab, id, skb->data, skb->len); in ath11k_wmi_tlv_op_rx()
8907 status = ath11k_htc_connect_service(&ab->htc, &conn_req, &conn_resp); in ath11k_connect_pdev_htc_service()
8914 ab->wmi_ab.wmi_endpoint_id[pdev_idx] = conn_resp.eid; in ath11k_connect_pdev_htc_service()
8915 ab->wmi_ab.wmi[pdev_idx].eid = conn_resp.eid; in ath11k_connect_pdev_htc_service()
8916 ab->wmi_ab.max_msg_len[pdev_idx] = conn_resp.max_msg_len; in ath11k_connect_pdev_htc_service()
8917 init_waitqueue_head(&ab->wmi_ab.wmi[pdev_idx].tx_ce_desc_wq); in ath11k_connect_pdev_htc_service()
8927 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_send_unit_test_cmd()
8940 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, buf_len); in ath11k_wmi_send_unit_test_cmd()
8942 return -ENOMEM; in ath11k_wmi_send_unit_test_cmd()
8944 cmd = (struct wmi_unit_test_cmd *)skb->data; in ath11k_wmi_send_unit_test_cmd()
8945 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_UNIT_TEST_CMD) | in ath11k_wmi_send_unit_test_cmd()
8946 FIELD_PREP(WMI_TLV_LEN, sizeof(ut_cmd) - TLV_HDR_SIZE); in ath11k_wmi_send_unit_test_cmd()
8948 cmd->vdev_id = ut_cmd.vdev_id; in ath11k_wmi_send_unit_test_cmd()
8949 cmd->module_id = ut_cmd.module_id; in ath11k_wmi_send_unit_test_cmd()
8950 cmd->num_args = ut_cmd.num_args; in ath11k_wmi_send_unit_test_cmd()
8951 cmd->diag_token = ut_cmd.diag_token; in ath11k_wmi_send_unit_test_cmd()
8953 ptr = skb->data + sizeof(ut_cmd); in ath11k_wmi_send_unit_test_cmd()
8956 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_send_unit_test_cmd()
8968 ath11k_warn(ar->ab, "failed to send WMI_UNIT_TEST CMD :%d\n", in ath11k_wmi_send_unit_test_cmd()
8973 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_send_unit_test_cmd()
8975 cmd->module_id, cmd->vdev_id, cmd->num_args, in ath11k_wmi_send_unit_test_cmd()
8976 cmd->diag_token); in ath11k_wmi_send_unit_test_cmd()
8988 list_for_each_entry(arvif, &ar->arvifs, list) { in ath11k_wmi_simulate_radar()
8989 if (arvif->is_started && arvif->vdev_type == WMI_VDEV_TYPE_AP) { in ath11k_wmi_simulate_radar()
8996 return -EINVAL; in ath11k_wmi_simulate_radar()
8999 dfs_args[DFS_TEST_PDEV_ID] = ar->pdev->pdev_id; in ath11k_wmi_simulate_radar()
9000 /* Currently we could pass segment_id(b0 - b1), chirp(b2) in ath11k_wmi_simulate_radar()
9001 * freq offset (b3 - b10) to unit test. For simulation in ath11k_wmi_simulate_radar()
9006 wmi_ut.vdev_id = arvif->vdev_id; in ath11k_wmi_simulate_radar()
9011 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "Triggering Radar Simulation\n"); in ath11k_wmi_simulate_radar()
9019 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_fw_dbglog_cfg()
9026 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_fw_dbglog_cfg()
9028 return -ENOMEM; in ath11k_wmi_fw_dbglog_cfg()
9030 cmd = (struct wmi_debug_log_config_cmd_fixed_param *)skb->data; in ath11k_wmi_fw_dbglog_cfg()
9031 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_DEBUG_LOG_CONFIG_CMD) | in ath11k_wmi_fw_dbglog_cfg()
9032 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_fw_dbglog_cfg()
9033 cmd->dbg_log_param = dbglog->param; in ath11k_wmi_fw_dbglog_cfg()
9036 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_fw_dbglog_cfg()
9039 switch (dbglog->param) { in ath11k_wmi_fw_dbglog_cfg()
9044 cmd->value = dbglog->value; in ath11k_wmi_fw_dbglog_cfg()
9048 cmd->value = dbglog->value; in ath11k_wmi_fw_dbglog_cfg()
9049 memcpy(tlv->value, module_id_bitmap, in ath11k_wmi_fw_dbglog_cfg()
9057 return -EINVAL; in ath11k_wmi_fw_dbglog_cfg()
9062 ath11k_warn(ar->ab, in ath11k_wmi_fw_dbglog_cfg()
9067 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "cmd dbglog cfg"); in ath11k_wmi_fw_dbglog_cfg()
9077 wmi_ep_count = ab->htc.wmi_ep_count; in ath11k_wmi_connect()
9078 if (wmi_ep_count > ab->hw_params.max_radios) in ath11k_wmi_connect()
9079 return -1; in ath11k_wmi_connect()
9100 if (pdev_id >= ab->hw_params.max_radios) in ath11k_wmi_pdev_attach()
9101 return -EINVAL; in ath11k_wmi_pdev_attach()
9103 wmi_handle = &ab->wmi_ab.wmi[pdev_id]; in ath11k_wmi_pdev_attach()
9105 wmi_handle->wmi_ab = &ab->wmi_ab; in ath11k_wmi_pdev_attach()
9107 ab->wmi_ab.ab = ab; in ath11k_wmi_pdev_attach()
9121 ab->wmi_ab.ab = ab; in ath11k_wmi_attach()
9122 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_MAX; in ath11k_wmi_attach()
9125 if (ab->hw_params.single_pdev_only && ab->hw_params.num_rxdma_per_pdev > 1) in ath11k_wmi_attach()
9126 ab->wmi_ab.preferred_hw_mode = WMI_HOST_HW_MODE_SINGLE; in ath11k_wmi_attach()
9129 init_completion(&ab->wmi_ab.service_ready); in ath11k_wmi_attach()
9130 init_completion(&ab->wmi_ab.unified_ready); in ath11k_wmi_attach()
9141 for (i = 0; i < ab->htc.wmi_ep_count; i++) in ath11k_wmi_detach()
9155 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_hw_data_filter_cmd()
9158 return -ENOMEM; in ath11k_wmi_hw_data_filter_cmd()
9160 cmd = (struct wmi_hw_data_filter_cmd *)skb->data; in ath11k_wmi_hw_data_filter_cmd()
9161 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_HW_DATA_FILTER_CMD) | in ath11k_wmi_hw_data_filter_cmd()
9162 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_hw_data_filter_cmd()
9164 cmd->vdev_id = vdev_id; in ath11k_wmi_hw_data_filter_cmd()
9165 cmd->enable = enable; in ath11k_wmi_hw_data_filter_cmd()
9168 if (cmd->enable) in ath11k_wmi_hw_data_filter_cmd()
9169 cmd->hw_filter_bitmap = filter_bitmap; in ath11k_wmi_hw_data_filter_cmd()
9171 cmd->hw_filter_bitmap = ((u32)~0U); in ath11k_wmi_hw_data_filter_cmd()
9173 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_hw_data_filter_cmd()
9177 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_HW_DATA_FILTER_CMDID); in ath11k_wmi_hw_data_filter_cmd()
9187 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_host_wakeup_ind()
9189 return -ENOMEM; in ath11k_wmi_wow_host_wakeup_ind()
9191 cmd = (struct wmi_wow_host_wakeup_ind *)skb->data; in ath11k_wmi_wow_host_wakeup_ind()
9192 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_host_wakeup_ind()
9194 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_host_wakeup_ind()
9196 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow host wakeup ind\n"); in ath11k_wmi_wow_host_wakeup_ind()
9198 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID); in ath11k_wmi_wow_host_wakeup_ind()
9208 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_enable()
9210 return -ENOMEM; in ath11k_wmi_wow_enable()
9212 cmd = (struct wmi_wow_enable_cmd *)skb->data; in ath11k_wmi_wow_enable()
9213 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ENABLE_CMD) | in ath11k_wmi_wow_enable()
9214 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_enable()
9216 cmd->enable = 1; in ath11k_wmi_wow_enable()
9217 cmd->pause_iface_config = WOW_IFACE_PAUSE_ENABLED; in ath11k_wmi_wow_enable()
9218 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow enable\n"); in ath11k_wmi_wow_enable()
9220 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_CMDID); in ath11k_wmi_wow_enable()
9235 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_scan_prob_req_oui()
9237 return -ENOMEM; in ath11k_wmi_scan_prob_req_oui()
9239 cmd = (struct wmi_scan_prob_req_oui_cmd *)skb->data; in ath11k_wmi_scan_prob_req_oui()
9240 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_scan_prob_req_oui()
9242 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_scan_prob_req_oui()
9243 cmd->prob_req_oui = prob_req_oui; in ath11k_wmi_scan_prob_req_oui()
9245 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "scan prob req oui %d\n", in ath11k_wmi_scan_prob_req_oui()
9248 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_SCAN_PROB_REQ_OUI_CMDID); in ath11k_wmi_scan_prob_req_oui()
9260 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_add_wakeup_event()
9262 return -ENOMEM; in ath11k_wmi_wow_add_wakeup_event()
9264 cmd = (struct wmi_wow_add_del_event_cmd *)skb->data; in ath11k_wmi_wow_add_wakeup_event()
9265 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_WOW_ADD_DEL_EVT_CMD) | in ath11k_wmi_wow_add_wakeup_event()
9266 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_wakeup_event()
9268 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_add_wakeup_event()
9269 cmd->is_add = enable; in ath11k_wmi_wow_add_wakeup_event()
9270 cmd->event_bitmap = (1 << event); in ath11k_wmi_wow_add_wakeup_event()
9272 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()
9275 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID); in ath11k_wmi_wow_add_wakeup_event()
9298 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_add_pattern()
9300 return -ENOMEM; in ath11k_wmi_wow_add_pattern()
9303 ptr = (u8 *)skb->data; in ath11k_wmi_wow_add_pattern()
9305 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9307 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_pattern()
9309 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_add_pattern()
9310 cmd->pattern_id = pattern_id; in ath11k_wmi_wow_add_pattern()
9311 cmd->pattern_type = WOW_BITMAP_PATTERN; in ath11k_wmi_wow_add_pattern()
9317 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9324 bitmap->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9326 FIELD_PREP(WMI_TLV_LEN, sizeof(*bitmap) - TLV_HDR_SIZE); in ath11k_wmi_wow_add_pattern()
9328 memcpy(bitmap->patternbuf, pattern, pattern_len); in ath11k_wmi_wow_add_pattern()
9329 ath11k_ce_byte_swap(bitmap->patternbuf, roundup(pattern_len, 4)); in ath11k_wmi_wow_add_pattern()
9330 memcpy(bitmap->bitmaskbuf, mask, pattern_len); in ath11k_wmi_wow_add_pattern()
9331 ath11k_ce_byte_swap(bitmap->bitmaskbuf, roundup(pattern_len, 4)); in ath11k_wmi_wow_add_pattern()
9332 bitmap->pattern_offset = pattern_offset; in ath11k_wmi_wow_add_pattern()
9333 bitmap->pattern_len = pattern_len; in ath11k_wmi_wow_add_pattern()
9334 bitmap->bitmask_len = pattern_len; in ath11k_wmi_wow_add_pattern()
9335 bitmap->pattern_id = pattern_id; in ath11k_wmi_wow_add_pattern()
9341 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9349 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9357 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9365 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9373 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_add_pattern()
9377 …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()
9380 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_ADD_WAKE_PATTERN_CMDID); in ath11k_wmi_wow_add_pattern()
9390 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_wow_del_pattern()
9392 return -ENOMEM; in ath11k_wmi_wow_del_pattern()
9394 cmd = (struct wmi_wow_del_pattern_cmd *)skb->data; in ath11k_wmi_wow_del_pattern()
9395 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_wow_del_pattern()
9397 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_wow_del_pattern()
9399 cmd->vdev_id = vdev_id; in ath11k_wmi_wow_del_pattern()
9400 cmd->pattern_id = pattern_id; in ath11k_wmi_wow_del_pattern()
9401 cmd->pattern_type = WOW_BITMAP_PATTERN; in ath11k_wmi_wow_del_pattern()
9403 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv wow del pattern vdev_id %d pattern_id %d\n", in ath11k_wmi_wow_del_pattern()
9406 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_WOW_DEL_WAKE_PATTERN_CMDID); in ath11k_wmi_wow_del_pattern()
9431 channel_list_len = sizeof(u32) * pno->a_networks[0].channel_count; in ath11k_wmi_op_gen_config_pno_start()
9434 nlo_list_len = sizeof(*nlo_list) * pno->uc_networks_count; in ath11k_wmi_op_gen_config_pno_start()
9437 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_op_gen_config_pno_start()
9439 return ERR_PTR(-ENOMEM); in ath11k_wmi_op_gen_config_pno_start()
9441 ptr = (u8 *)skb->data; in ath11k_wmi_op_gen_config_pno_start()
9443 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NLO_CONFIG_CMD) | in ath11k_wmi_op_gen_config_pno_start()
9444 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_op_gen_config_pno_start()
9446 cmd->vdev_id = pno->vdev_id; in ath11k_wmi_op_gen_config_pno_start()
9447 cmd->flags = WMI_NLO_CONFIG_START | WMI_NLO_CONFIG_SSID_HIDE_EN; in ath11k_wmi_op_gen_config_pno_start()
9449 /* current FW does not support min-max range for dwell time */ in ath11k_wmi_op_gen_config_pno_start()
9450 cmd->active_dwell_time = pno->active_max_time; in ath11k_wmi_op_gen_config_pno_start()
9451 cmd->passive_dwell_time = pno->passive_max_time; in ath11k_wmi_op_gen_config_pno_start()
9453 if (pno->do_passive_scan) in ath11k_wmi_op_gen_config_pno_start()
9454 cmd->flags |= WMI_NLO_CONFIG_SCAN_PASSIVE; in ath11k_wmi_op_gen_config_pno_start()
9456 cmd->fast_scan_period = pno->fast_scan_period; in ath11k_wmi_op_gen_config_pno_start()
9457 cmd->slow_scan_period = pno->slow_scan_period; in ath11k_wmi_op_gen_config_pno_start()
9458 cmd->fast_scan_max_cycles = pno->fast_scan_max_cycles; in ath11k_wmi_op_gen_config_pno_start()
9459 cmd->delay_start_time = pno->delay_start_time; in ath11k_wmi_op_gen_config_pno_start()
9461 if (pno->enable_pno_scan_randomization) { in ath11k_wmi_op_gen_config_pno_start()
9462 cmd->flags |= WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ | in ath11k_wmi_op_gen_config_pno_start()
9464 ether_addr_copy(cmd->mac_addr.addr, pno->mac_addr); in ath11k_wmi_op_gen_config_pno_start()
9465 ether_addr_copy(cmd->mac_mask.addr, pno->mac_addr_mask); in ath11k_wmi_op_gen_config_pno_start()
9466 ath11k_ce_byte_swap(cmd->mac_addr.addr, 8); in ath11k_wmi_op_gen_config_pno_start()
9467 ath11k_ce_byte_swap(cmd->mac_mask.addr, 8); in ath11k_wmi_op_gen_config_pno_start()
9473 cmd->no_of_ssids = pno->uc_networks_count; in ath11k_wmi_op_gen_config_pno_start()
9475 tlv->header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_op_gen_config_pno_start()
9481 for (i = 0; i < cmd->no_of_ssids; i++) { in ath11k_wmi_op_gen_config_pno_start()
9483 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_op_gen_config_pno_start()
9484 FIELD_PREP(WMI_TLV_LEN, sizeof(*nlo_list) - sizeof(*tlv)); in ath11k_wmi_op_gen_config_pno_start()
9487 nlo_list[i].ssid.ssid.ssid_len = pno->a_networks[i].ssid.ssid_len; in ath11k_wmi_op_gen_config_pno_start()
9489 pno->a_networks[i].ssid.ssid, in ath11k_wmi_op_gen_config_pno_start()
9494 if (pno->a_networks[i].rssi_threshold && in ath11k_wmi_op_gen_config_pno_start()
9495 pno->a_networks[i].rssi_threshold > -300) { in ath11k_wmi_op_gen_config_pno_start()
9498 pno->a_networks[i].rssi_threshold; in ath11k_wmi_op_gen_config_pno_start()
9503 pno->a_networks[i].bcast_nw_type; in ath11k_wmi_op_gen_config_pno_start()
9507 cmd->num_of_channels = pno->a_networks[0].channel_count; in ath11k_wmi_op_gen_config_pno_start()
9509 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | in ath11k_wmi_op_gen_config_pno_start()
9513 for (i = 0; i < cmd->num_of_channels; i++) in ath11k_wmi_op_gen_config_pno_start()
9514 channel_list[i] = pno->a_networks[0].channels[i]; in ath11k_wmi_op_gen_config_pno_start()
9516 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "tlv start pno config vdev_id %d\n", in ath11k_wmi_op_gen_config_pno_start()
9530 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_op_gen_config_pno_stop()
9532 return ERR_PTR(-ENOMEM); in ath11k_wmi_op_gen_config_pno_stop()
9534 cmd = (struct wmi_wow_nlo_config_cmd *)skb->data; in ath11k_wmi_op_gen_config_pno_stop()
9535 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NLO_CONFIG_CMD) | in ath11k_wmi_op_gen_config_pno_stop()
9536 FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); in ath11k_wmi_op_gen_config_pno_stop()
9538 cmd->vdev_id = vdev_id; in ath11k_wmi_op_gen_config_pno_stop()
9539 cmd->flags = WMI_NLO_CONFIG_STOP; in ath11k_wmi_op_gen_config_pno_stop()
9541 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_op_gen_config_pno_stop()
9551 if (pno_scan->enable) in ath11k_wmi_wow_config_pno()
9557 return -ENOMEM; in ath11k_wmi_wow_config_pno()
9559 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); in ath11k_wmi_wow_config_pno()
9574 ns_cnt = offload->ipv6_count; in ath11k_wmi_fill_ns_offload()
9579 ns_ext_tuples = offload->ipv6_count - WMI_MAX_NS_OFFLOADS; in ath11k_wmi_fill_ns_offload()
9580 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_ns_offload()
9583 max_offloads = offload->ipv6_count; in ath11k_wmi_fill_ns_offload()
9585 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_ns_offload()
9595 ns->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_NS_OFFLOAD_TUPLE) | in ath11k_wmi_fill_ns_offload()
9596 FIELD_PREP(WMI_TLV_LEN, sizeof(*ns) - TLV_HDR_SIZE); in ath11k_wmi_fill_ns_offload()
9600 ns->flags |= WMI_NSOL_FLAGS_VALID; in ath11k_wmi_fill_ns_offload()
9602 memcpy(ns->target_ipaddr[0], offload->ipv6_addr[i], 16); in ath11k_wmi_fill_ns_offload()
9603 memcpy(ns->solicitation_ipaddr, offload->self_ipv6_addr[i], 16); in ath11k_wmi_fill_ns_offload()
9604 ath11k_ce_byte_swap(ns->target_ipaddr[0], 16); in ath11k_wmi_fill_ns_offload()
9605 ath11k_ce_byte_swap(ns->solicitation_ipaddr, 16); in ath11k_wmi_fill_ns_offload()
9607 if (offload->ipv6_type[i]) in ath11k_wmi_fill_ns_offload()
9608 ns->flags |= WMI_NSOL_FLAGS_IS_IPV6_ANYCAST; in ath11k_wmi_fill_ns_offload()
9610 memcpy(ns->target_mac.addr, offload->mac_addr, ETH_ALEN); in ath11k_wmi_fill_ns_offload()
9611 ath11k_ce_byte_swap(ns->target_mac.addr, 8); in ath11k_wmi_fill_ns_offload()
9613 if (ns->target_mac.word0 != 0 || in ath11k_wmi_fill_ns_offload()
9614 ns->target_mac.word1 != 0) { in ath11k_wmi_fill_ns_offload()
9615 ns->flags |= WMI_NSOL_FLAGS_MAC_VALID; in ath11k_wmi_fill_ns_offload()
9618 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_fill_ns_offload()
9620 i, ns->solicitation_ipaddr, in ath11k_wmi_fill_ns_offload()
9621 ns->target_ipaddr[0]); in ath11k_wmi_fill_ns_offload()
9642 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_STRUCT) | in ath11k_wmi_fill_arp_offload()
9648 arp->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARP_OFFLOAD_TUPLE) | in ath11k_wmi_fill_arp_offload()
9649 FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE); in ath11k_wmi_fill_arp_offload()
9651 if (enable && i < offload->ipv4_count) { in ath11k_wmi_fill_arp_offload()
9653 arp->flags = WMI_ARPOL_FLAGS_VALID; in ath11k_wmi_fill_arp_offload()
9654 memcpy(arp->target_ipaddr, offload->ipv4_addr[i], 4); in ath11k_wmi_fill_arp_offload()
9655 ath11k_ce_byte_swap(arp->target_ipaddr, 4); in ath11k_wmi_fill_arp_offload()
9657 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "arp offload address %pI4", in ath11k_wmi_fill_arp_offload()
9658 arp->target_ipaddr); in ath11k_wmi_fill_arp_offload()
9678 offload = &arvif->arp_ns_offload; in ath11k_wmi_arp_ns_offload()
9679 ns_cnt = offload->ipv6_count; in ath11k_wmi_arp_ns_offload()
9688 ns_ext_tuples = ns_cnt - WMI_MAX_NS_OFFLOADS; in ath11k_wmi_arp_ns_offload()
9693 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_arp_ns_offload()
9695 return -ENOMEM; in ath11k_wmi_arp_ns_offload()
9697 buf_ptr = skb->data; in ath11k_wmi_arp_ns_offload()
9699 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_arp_ns_offload()
9701 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_arp_ns_offload()
9703 cmd->flags = 0; in ath11k_wmi_arp_ns_offload()
9704 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_arp_ns_offload()
9705 cmd->num_ns_ext_tuples = ns_ext_tuples; in ath11k_wmi_arp_ns_offload()
9715 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_SET_ARP_NS_OFFLOAD_CMDID); in ath11k_wmi_arp_ns_offload()
9722 struct ath11k_rekey_data *rekey_data = &arvif->rekey_data; in ath11k_wmi_gtk_rekey_offload()
9728 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_gtk_rekey_offload()
9730 return -ENOMEM; in ath11k_wmi_gtk_rekey_offload()
9732 cmd = (struct wmi_gtk_rekey_offload_cmd *)skb->data; in ath11k_wmi_gtk_rekey_offload()
9733 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_GTK_OFFLOAD_CMD) | in ath11k_wmi_gtk_rekey_offload()
9734 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_gtk_rekey_offload()
9736 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_gtk_rekey_offload()
9739 cmd->flags = GTK_OFFLOAD_ENABLE_OPCODE; in ath11k_wmi_gtk_rekey_offload()
9742 memcpy(cmd->kck, rekey_data->kck, sizeof(cmd->kck)); in ath11k_wmi_gtk_rekey_offload()
9743 ath11k_ce_byte_swap(cmd->kck, GTK_OFFLOAD_KEK_BYTES); in ath11k_wmi_gtk_rekey_offload()
9744 memcpy(cmd->kek, rekey_data->kek, sizeof(cmd->kek)); in ath11k_wmi_gtk_rekey_offload()
9745 ath11k_ce_byte_swap(cmd->kek, GTK_OFFLOAD_KEK_BYTES); in ath11k_wmi_gtk_rekey_offload()
9747 replay_ctr = cpu_to_le64(rekey_data->replay_ctr); in ath11k_wmi_gtk_rekey_offload()
9748 memcpy(cmd->replay_ctr, &replay_ctr, in ath11k_wmi_gtk_rekey_offload()
9750 ath11k_ce_byte_swap(cmd->replay_ctr, GTK_REPLAY_COUNTER_BYTES); in ath11k_wmi_gtk_rekey_offload()
9752 cmd->flags = GTK_OFFLOAD_DISABLE_OPCODE; in ath11k_wmi_gtk_rekey_offload()
9755 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "offload gtk rekey vdev: %d %d\n", in ath11k_wmi_gtk_rekey_offload()
9756 arvif->vdev_id, enable); in ath11k_wmi_gtk_rekey_offload()
9757 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_GTK_OFFLOAD_CMDID); in ath11k_wmi_gtk_rekey_offload()
9768 skb = ath11k_wmi_alloc_skb(ar->wmi->wmi_ab, len); in ath11k_wmi_gtk_rekey_getinfo()
9770 return -ENOMEM; in ath11k_wmi_gtk_rekey_getinfo()
9772 cmd = (struct wmi_gtk_rekey_offload_cmd *)skb->data; in ath11k_wmi_gtk_rekey_getinfo()
9773 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_GTK_OFFLOAD_CMD) | in ath11k_wmi_gtk_rekey_getinfo()
9774 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_gtk_rekey_getinfo()
9776 cmd->vdev_id = arvif->vdev_id; in ath11k_wmi_gtk_rekey_getinfo()
9777 cmd->flags = GTK_OFFLOAD_REQUEST_STATUS_OPCODE; in ath11k_wmi_gtk_rekey_getinfo()
9779 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, "get gtk rekey vdev_id: %d\n", in ath11k_wmi_gtk_rekey_getinfo()
9780 arvif->vdev_id); in ath11k_wmi_gtk_rekey_getinfo()
9781 return ath11k_wmi_cmd_send(ar->wmi, skb, WMI_GTK_OFFLOAD_CMDID); in ath11k_wmi_gtk_rekey_getinfo()
9785 { struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_bios_sar_table_param()
9798 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_bios_sar_table_param()
9800 return -ENOMEM; in ath11k_wmi_pdev_set_bios_sar_table_param()
9802 cmd = (struct wmi_pdev_set_sar_table_cmd *)skb->data; in ath11k_wmi_pdev_set_bios_sar_table_param()
9803 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()
9804 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_bios_sar_table_param()
9805 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_bios_sar_table_param()
9806 cmd->sar_len = BIOS_SAR_TABLE_LEN; in ath11k_wmi_pdev_set_bios_sar_table_param()
9807 cmd->rsvd_len = BIOS_SAR_RSVD1_LEN; in ath11k_wmi_pdev_set_bios_sar_table_param()
9809 buf_ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_set_bios_sar_table_param()
9811 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_sar_table_param()
9818 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_sar_table_param()
9826 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_pdev_set_bios_geo_table_param()
9836 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_pdev_set_bios_geo_table_param()
9838 return -ENOMEM; in ath11k_wmi_pdev_set_bios_geo_table_param()
9840 cmd = (struct wmi_pdev_set_geo_table_cmd *)skb->data; in ath11k_wmi_pdev_set_bios_geo_table_param()
9841 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()
9842 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_pdev_set_bios_geo_table_param()
9843 cmd->pdev_id = ar->pdev->pdev_id; in ath11k_wmi_pdev_set_bios_geo_table_param()
9844 cmd->rsvd_len = BIOS_SAR_RSVD2_LEN; in ath11k_wmi_pdev_set_bios_geo_table_param()
9846 buf_ptr = skb->data + sizeof(*cmd); in ath11k_wmi_pdev_set_bios_geo_table_param()
9848 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | in ath11k_wmi_pdev_set_bios_geo_table_param()
9857 struct ath11k_pdev_wmi *wmi = ar->wmi; in ath11k_wmi_sta_keepalive()
9864 skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); in ath11k_wmi_sta_keepalive()
9866 return -ENOMEM; in ath11k_wmi_sta_keepalive()
9868 cmd = (struct wmi_sta_keepalive_cmd *)skb->data; in ath11k_wmi_sta_keepalive()
9869 cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_sta_keepalive()
9871 FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); in ath11k_wmi_sta_keepalive()
9872 cmd->vdev_id = arg->vdev_id; in ath11k_wmi_sta_keepalive()
9873 cmd->enabled = arg->enabled; in ath11k_wmi_sta_keepalive()
9874 cmd->interval = arg->interval; in ath11k_wmi_sta_keepalive()
9875 cmd->method = arg->method; in ath11k_wmi_sta_keepalive()
9878 arp->tlv_header = FIELD_PREP(WMI_TLV_TAG, in ath11k_wmi_sta_keepalive()
9880 FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE); in ath11k_wmi_sta_keepalive()
9882 if (arg->method == WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE || in ath11k_wmi_sta_keepalive()
9883 arg->method == WMI_STA_KEEPALIVE_METHOD_GRATUITOUS_ARP_REQUEST) { in ath11k_wmi_sta_keepalive()
9884 arp->src_ip4_addr = arg->src_ip4_addr; in ath11k_wmi_sta_keepalive()
9885 arp->dest_ip4_addr = arg->dest_ip4_addr; in ath11k_wmi_sta_keepalive()
9886 ether_addr_copy(arp->dest_mac_addr.addr, arg->dest_mac_addr); in ath11k_wmi_sta_keepalive()
9889 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_wmi_sta_keepalive()
9891 arg->vdev_id, arg->enabled, arg->method, arg->interval); in ath11k_wmi_sta_keepalive()
9899 ar->ab->wmi_ab.svc_map) && ar->supports_6ghz; in ath11k_wmi_supports_6ghz_cc_ext()