From: Baochen Qiang <quic_bqiang@quicinc.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: Aditya Kumar Singh <quic_adisi@quicinc.com>,
<ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v8 02/12] wifi: ath11k: store cur_regulatory_info for each radio
Date: Thu, 14 Dec 2023 14:56:55 +0800 [thread overview]
Message-ID: <884610f6-ccc2-4fa3-bdc1-dac3023f9020@quicinc.com> (raw)
In-Reply-To: <871qbs6a4k.fsf@kernel.org>
On 12/11/2023 11:18 PM, Kalle Valo wrote:
> Baochen Qiang <quic_bqiang@quicinc.com> writes:
>
>> On 12/7/2023 11:15 AM, Aditya Kumar Singh wrote:
>>> On 12/4/23 13:43, Baochen Qiang wrote:
>>>> --- a/drivers/net/wireless/ath/ath11k/mac.h
>>>> +++ b/drivers/net/wireless/ath/ath11k/mac.h
>>>> @@ -159,7 +159,6 @@ struct ath11k_vif *ath11k_mac_get_vif_up(struct
>>>> ath11k_base *ab);
>>>> struct ath11k *ath11k_mac_get_ar_by_vdev_id(struct ath11k_base
>>>> *ab, u32 vdev_id);
>>>> struct ath11k *ath11k_mac_get_ar_by_pdev_id(struct ath11k_base
>>>> *ab, u32 pdev_id);
>>>> -
>>> Irrelevant change w.r.t commit message?
>>>
>>>> void ath11k_mac_drain_tx(struct ath11k *ar);
>>>> void ath11k_mac_peer_cleanup_all(struct ath11k *ar);
>>>> int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
>>> ...
>>>> @@ -4749,6 +4749,11 @@ static int
>>>> ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse(struct ath11k_base *soc,
>>>> soc->pdevs[0].pdev_id = 0;
>>>> }
>>>> + if (!soc->reg_info_store)
>>>> + soc->reg_info_store = kcalloc(soc->num_radios,
>>>> + sizeof(*soc->reg_info_store),
>>>> + GFP_ATOMIC);
>>> What if this memory allocation request fails? Any negative case
>>> check should be present?
>>>
>>>> +
>>>> return 0;
>>>> }
>>>> @@ -7071,33 +7076,54 @@ static bool ath11k_reg_is_world_alpha(char
>>>> *alpha)
>>>> return false;
>>>> }
>>>> -static int ath11k_reg_chan_list_event(struct ath11k_base *ab,
>>>> - struct sk_buff *skb,
>>>> - enum wmi_reg_chan_list_cmd_type id)
>>>> +void ath11k_reg_reset_info(struct cur_regulatory_info *reg_info)
>>>> {
>>>> - struct cur_regulatory_info *reg_info = NULL;
>>>> - struct ieee80211_regdomain *regd = NULL;
>>>> - bool intersect = false;
>>>> - int ret = 0, pdev_idx, i, j;
>>>> - struct ath11k *ar;
>>>> + int i, j;
>>>> - reg_info = kzalloc(sizeof(*reg_info), GFP_ATOMIC);
>>>> - if (!reg_info) {
>>>> - ret = -ENOMEM;
>>>> - goto fallback;
>>>> - }
>>>> + if (reg_info) {
>>>> + kfree(reg_info->reg_rules_2ghz_ptr);
>>>> - if (id == WMI_REG_CHAN_LIST_CC_ID)
>>>> - ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info);
>>>> - else
>>>> - ret = ath11k_pull_reg_chan_list_ext_update_ev(ab, skb,
>>>> reg_info);
>>>> + kfree(reg_info->reg_rules_5ghz_ptr);
>>>> - if (ret) {
>>>> - ath11k_warn(ab, "failed to extract regulatory info from
>>>> received event\n");
>>>> - goto fallback;
>>>> + for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) {
>>>> + kfree(reg_info->reg_rules_6ghz_ap_ptr[i]);
>>>> + for (j = 0; j < WMI_REG_MAX_CLIENT_TYPE; j++)
>>>> + kfree(reg_info->reg_rules_6ghz_client_ptr[i][j]);
>>>> + }
>>>> +
>>>> + memset(reg_info, 0, sizeof(*reg_info));
>>>> }
>>>> +}
>>>> +
>>>> +static
>>>> +enum wmi_vdev_type ath11k_reg_get_ar_vdev_type(struct ath11k *ar)
>>>> +{
>>>> + struct ath11k_vif *arvif;
>>>> +
>>>> + /* Currently each struct ath11k maps to one struct
>>>> ieee80211_hw/wiphy
>>>> + * and one struct ieee80211_regdomain, so it could only store
>>>> one group
>>>> + * reg rules. It means muti-interface concurrency in the same
>>>> ath11k is
>>>> + * not support for the regdomain. So get the vdev type of the
>>>> first entry
>>>> + * now. After concurrency support for the regdomain, this
>>>> should change.
>>>> + */
>>>> + arvif = list_first_entry_or_null(&ar->arvifs, struct
>>>> ath11k_vif, list);
>>>> + if (arvif)
>>>> + return arvif->vdev_type;
>>>> +
>>>> + return WMI_VDEV_TYPE_UNSPEC;
>>>> +}
>>>> +
>>>> +int ath11k_reg_handle_chan_list(struct ath11k_base *ab,
>>>> + struct cur_regulatory_info *reg_info,
>>>> + enum ieee80211_ap_reg_power power_type)
>>>> +{
>>>> + struct ieee80211_regdomain *regd;
>>>> + bool intersect = false;
>>>> + int pdev_idx;
>>>> + struct ath11k *ar;
>>>> + enum wmi_vdev_type vdev_type;
>>>> - ath11k_dbg(ab, ATH11K_DBG_WMI, "event reg chan list id %d", id);
>>>> + ath11k_dbg(ab, ATH11K_DBG_WMI, "event reg handle chan list");
>>> I believe this debug was helpful in the sense it showed which type
>>> of event came. Can't we still print this somehow? Or may be
>>> somewhere else?You can check the event type from logs of
>> ath11k_pull_reg_chan_list_update_ev() and
>> ath11k_pull_reg_chan_list_ext_update_ev().
>
> Baochen, I didn't see any comments from you. Did you send an empty mail
> by accident?
I did have comments, but some how, I don't know why, it gets merged in
Aditya's comments. Will repost it here:
You can check the event type from logs of
ath11k_pull_reg_chan_list_update_ev() and
ath11k_pull_reg_chan_list_ext_update_ev().
>
next prev parent reply other threads:[~2023-12-14 6:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 8:13 [PATCH v8 00/12] wifi: ath11k: add support for 6 GHz station for various modes : LPI, SP and VLP Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 01/12] wifi: ath11k: add support to select 6 GHz regulatory type Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 02/12] wifi: ath11k: store cur_regulatory_info for each radio Baochen Qiang
2023-12-07 3:15 ` Aditya Kumar Singh
2023-12-11 3:56 ` Baochen Qiang
2023-12-11 15:18 ` Kalle Valo
2023-12-14 6:56 ` Baochen Qiang [this message]
2023-12-04 8:13 ` [PATCH v8 03/12] wifi: ath11k: fix a possible dead lock caused by ab->base_lock Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 04/12] wifi: ath11k: update regulatory rules when interface added Baochen Qiang
2023-12-07 3:15 ` Aditya Kumar Singh
2023-12-11 3:55 ` Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 05/12] wifi: ath11k: update regulatory rules when connect to AP on 6 GHz band for station Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 06/12] wifi: ath11k: save power spectral density(PSD) of regulatory rule Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 07/12] wifi: ath11k: add parse of transmit power envelope element Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 08/12] wifi: ath11k: save max tx power in vdev start response event from firmware Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 09/12] wifi: ath11k: fill parameters for vdev set tpc power WMI command Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 10/12] wifi: ath11k: add WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT service bit Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 11/12] wifi: ath11k: add handler for WMI_VDEV_SET_TPC_POWER_CMDID Baochen Qiang
2023-12-04 8:13 ` [PATCH v8 12/12] wifi: ath11k: discard BSS_CHANGED_TXPOWER when EXT_TPC_REG_SUPPORT for 6 GHz Baochen Qiang
2023-12-04 15:53 ` Aditya Kumar Singh
2023-12-06 5:34 ` Baochen Qiang
2023-12-07 3:31 ` Aditya Kumar Singh
2023-12-11 2:26 ` Baochen Qiang
2023-12-04 8:42 ` [PATCH v8 00/12] wifi: ath11k: add support for 6 GHz station for various modes : LPI, SP and VLP Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=884610f6-ccc2-4fa3-bdc1-dac3023f9020@quicinc.com \
--to=quic_bqiang@quicinc.com \
--cc=ath11k@lists.infradead.org \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_adisi@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).