Message ID | 20231211062216.382164-5-quic_bqiang@quicinc.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Kalle Valo |
Headers | show |
Series | wifi: ath11k: add support for 6 GHz station for various modes : LPI, SP and VLP | expand |
On 12/11/23 11:52, Baochen Qiang wrote: > diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c > index 7f7b39817773..1e314fcab41b 100644 > --- a/drivers/net/wireless/ath/ath11k/mac.c > +++ b/drivers/net/wireless/ath/ath11k/mac.c > @@ -6943,6 +6943,14 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, > ret); > } > > + if (ath11k_wmi_supports_6ghz_cc_ext(ar)) { > + struct cur_regulatory_info *reg_info; > + > + reg_info = &ab->reg_info_store[ar->pdev_idx]; > + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac interface added to change reg rules\n"); > + ath11k_reg_handle_chan_list(ab, reg_info, IEEE80211_REG_LPI_AP); > + } > + So we update the rules by default for AP. Then in next patch 5/12, once STA connects to AP, we put the proper power mode and refresh the rules. So if user wants to bring up 1 STA interface alone, in total 3 regulatory updates will happen from driver to upper layer - 1. During initial boot time 2. During interface create time (above hunk) 3. During channel context assignment (5/12 patch) Does this seem good? 3 times we would be changing regulatory rules and first 2 times we are doing the same thing.
On 12/12/2023 1:20 AM, Aditya Kumar Singh wrote: > On 12/11/23 11:52, Baochen Qiang wrote: >> diff --git a/drivers/net/wireless/ath/ath11k/mac.c >> b/drivers/net/wireless/ath/ath11k/mac.c >> index 7f7b39817773..1e314fcab41b 100644 >> --- a/drivers/net/wireless/ath/ath11k/mac.c >> +++ b/drivers/net/wireless/ath/ath11k/mac.c >> @@ -6943,6 +6943,14 @@ static int ath11k_mac_op_add_interface(struct >> ieee80211_hw *hw, >> ret); >> } >> + if (ath11k_wmi_supports_6ghz_cc_ext(ar)) { >> + struct cur_regulatory_info *reg_info; >> + >> + reg_info = &ab->reg_info_store[ar->pdev_idx]; >> + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac interface added to change >> reg rules\n"); >> + ath11k_reg_handle_chan_list(ab, reg_info, IEEE80211_REG_LPI_AP); >> + } >> + > So we update the rules by default for AP. Then in next patch 5/12, once > STA connects to AP, we put the proper power mode and refresh the rules. > > So if user wants to bring up 1 STA interface alone, in total 3 > regulatory updates will happen from driver to upper layer - > 1. During initial boot time > 2. During interface create time (above hunk) > 3. During channel context assignment (5/12 patch) > > Does this seem good? 3 times we would be changing regulatory rules and > first 2 times we are doing the same thing. No, the first two times are not the same: as mentioned in the commit log, at the first time when boot up, interface mode is not determined, so the argument vdev_type is 0 when calling ath11k_reg_build_regd(), as a result AP reg info is chosen. And for the second time, here when adding interface, we know exactly the interface type, say a STA, vdev_type is 2 when calling ath11k_reg_build_regd(), resulting in that client reg info is chosen. see the changes to ath11k_reg_build_regd() in patch 1/12.
On 12/14/23 12:39, Baochen Qiang wrote: > > > On 12/12/2023 1:20 AM, Aditya Kumar Singh wrote: >> On 12/11/23 11:52, Baochen Qiang wrote: >>> diff --git a/drivers/net/wireless/ath/ath11k/mac.c >>> b/drivers/net/wireless/ath/ath11k/mac.c >>> index 7f7b39817773..1e314fcab41b 100644 >>> --- a/drivers/net/wireless/ath/ath11k/mac.c >>> +++ b/drivers/net/wireless/ath/ath11k/mac.c >>> @@ -6943,6 +6943,14 @@ static int ath11k_mac_op_add_interface(struct >>> ieee80211_hw *hw, >>> ret); >>> } >>> + if (ath11k_wmi_supports_6ghz_cc_ext(ar)) { >>> + struct cur_regulatory_info *reg_info; >>> + >>> + reg_info = &ab->reg_info_store[ar->pdev_idx]; >>> + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac interface added to >>> change reg rules\n"); >>> + ath11k_reg_handle_chan_list(ab, reg_info, >>> IEEE80211_REG_LPI_AP); >>> + } >>> + >> So we update the rules by default for AP. Then in next patch 5/12, >> once STA connects to AP, we put the proper power mode and refresh the >> rules. >> >> So if user wants to bring up 1 STA interface alone, in total 3 >> regulatory updates will happen from driver to upper layer - >> 1. During initial boot time >> 2. During interface create time (above hunk) >> 3. During channel context assignment (5/12 patch) >> >> Does this seem good? 3 times we would be changing regulatory rules and >> first 2 times we are doing the same thing. > No, the first two times are not the same: as mentioned in the commit > log, at the first time when boot up, interface mode is not determined, > so the argument vdev_type is 0 when calling ath11k_reg_build_regd(), as > a result AP reg info is chosen. And for the second time, here when > adding interface, we know exactly the interface type, say a STA, > vdev_type is 2 when calling ath11k_reg_build_regd(), resulting in that > client reg info is chosen. see the changes to ath11k_reg_build_regd() in > patch 1/12. Ah I see, sorry got confused a bit. Correct, it is different, but still updating 3 times, is it good? Just ponder once, otherwise fine.
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 7f7b39817773..1e314fcab41b 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -6943,6 +6943,14 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, ret); } + if (ath11k_wmi_supports_6ghz_cc_ext(ar)) { + struct cur_regulatory_info *reg_info; + + reg_info = &ab->reg_info_store[ar->pdev_idx]; + ath11k_dbg(ab, ATH11K_DBG_MAC, "mac interface added to change reg rules\n"); + ath11k_reg_handle_chan_list(ab, reg_info, IEEE80211_REG_LPI_AP); + } + mutex_unlock(&ar->conf_mutex); return 0; diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 1d033507a24c..cd879eae6c92 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -9861,3 +9861,9 @@ int ath11k_wmi_sta_keepalive(struct ath11k *ar, return ath11k_wmi_cmd_send(wmi, skb, WMI_STA_KEEPALIVE_CMDID); } + +bool ath11k_wmi_supports_6ghz_cc_ext(struct ath11k *ar) +{ + return test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT, + ar->ab->wmi_ab.svc_map) && ar->supports_6ghz; +} diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index d46c70704774..fa85e6eb4ab4 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -6485,4 +6485,5 @@ void ath11k_reg_reset_info(struct cur_regulatory_info *reg_info); int ath11k_reg_handle_chan_list(struct ath11k_base *ab, struct cur_regulatory_info *reg_info, enum ieee80211_ap_reg_power power_type); +bool ath11k_wmi_supports_6ghz_cc_ext(struct ath11k *ar); #endif