diff mbox series

[v3,4/7] wifi: ath11k: MBSSID parameter configuration in AP mode

Message ID 20230405221648.17950-5-quic_alokad@quicinc.com (mailing list archive)
State Accepted
Commit c82dc33f252fd8883be66f2d0230af0fd734c683
Delegated to: Kalle Valo
Headers show
Series v3: ath11k: MBSSID and EMA support in AP mode. | expand

Commit Message

Aloka Dixit April 5, 2023, 10:16 p.m. UTC
Include MBSSID parameters in WMI vdev up operation.

Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Co-developed-by: John Crispin <john@phrozen.org>
Signed-off-by: John Crispin <john@phrozen.org>
---
v3: No logical changes from v2. But '[v2,05/10] ath11k: create a
    structure for WMI vdev up parameters' is deleted in this
    version hence the function prototype is diffferent.

v2: Additions in struct vdev_up_params moved from patch 5/9 in
    v1 to this patch.

 drivers/net/wireless/ath/ath11k/mac.c | 26 ++++++++++++++++++++------
 drivers/net/wireless/ath/ath11k/wmi.c |  8 +++++++-
 drivers/net/wireless/ath/ath11k/wmi.h |  3 ++-
 3 files changed, 29 insertions(+), 8 deletions(-)

Comments

Kalle Valo April 29, 2023, 5:37 a.m. UTC | #1
Aloka Dixit <quic_alokad@quicinc.com> writes:

> Include MBSSID parameters in WMI vdev up operation.
>
> Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
> Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
> Co-developed-by: John Crispin <john@phrozen.org>
> Signed-off-by: John Crispin <john@phrozen.org>
> ---

[...]

> @@ -7153,8 +7161,13 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>  			ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
>  				    ret);
>  
> +		if (arvif->vif->mbssid_tx_vif)
> +			tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;

This had a warning:

drivers/net/wireless/ath/ath11k/mac.c:7200: line length of 92 exceeds 90 columns

In the pending branch I fixed it like this:

--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7143,6 +7143,7 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
 {
        struct ath11k_base *ab = ar->ab;
        struct ath11k_vif *arvif, *tx_arvif = NULL;
+       struct ieee80211_vif *mbssid_tx_vif;
        int ret;
        int i;
        bool monitor_vif = false;
@@ -7196,8 +7197,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
                        ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
                                    ret);
 
-               if (arvif->vif->mbssid_tx_vif)
-                       tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
+               mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
+               if (mbssid_tx_vif)
+                       tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
+
                ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
                                         arvif->bssid,
                                         tx_arvif ? tx_arvif->bssid : NULL,

Link to the commit:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=c884238009e778a0c8202a5eb0a7f68b13200bde
Aloka Dixit May 1, 2023, 5:41 p.m. UTC | #2
On 4/28/2023 10:37 PM, Kalle Valo wrote:
> Aloka Dixit <quic_alokad@quicinc.com> writes:
> 
>> Include MBSSID parameters in WMI vdev up operation.
>>
>> Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
>> Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
>> Co-developed-by: John Crispin <john@phrozen.org>
>> Signed-off-by: John Crispin <john@phrozen.org>
>> ---
> 
> [...]
> 
>> @@ -7153,8 +7161,13 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>>   			ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
>>   				    ret);
>>   
>> +		if (arvif->vif->mbssid_tx_vif)
>> +			tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
> 
> This had a warning:
> 
> drivers/net/wireless/ath/ath11k/mac.c:7200: line length of 92 exceeds 90 columns
> 
> In the pending branch I fixed it like this:
> 
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -7143,6 +7143,7 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>   {
>          struct ath11k_base *ab = ar->ab;
>          struct ath11k_vif *arvif, *tx_arvif = NULL;
> +       struct ieee80211_vif *mbssid_tx_vif;
>          int ret;
>          int i;
>          bool monitor_vif = false;
> @@ -7196,8 +7197,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>                          ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
>                                      ret);
>   
> -               if (arvif->vif->mbssid_tx_vif)
> -                       tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
> +               mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
> +               if (mbssid_tx_vif)
> +                       tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
> +
>                  ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
>                                           arvif->bssid,
>                                           tx_arvif ? tx_arvif->bssid : NULL,
> 
> Link to the commit:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=c884238009e778a0c8202a5eb0a7f68b13200bde
> 

Thank you.

I saw the warning but couldn't decide between adding a new pointer 
variable and letting 2 extra characters for just one assignment.

What are your thoughts on changing the scripts to allow up to 100?
Although nl80211 and mac80211 scripts also don't allow that long currently.
Kalle Valo May 5, 2023, 1:28 p.m. UTC | #3
Aloka Dixit <quic_alokad@quicinc.com> writes:

> On 4/28/2023 10:37 PM, Kalle Valo wrote:
>
>> Aloka Dixit <quic_alokad@quicinc.com> writes:
>>
>>> Include MBSSID parameters in WMI vdev up operation.
>>>
>>> Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
>>> Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
>>> Co-developed-by: John Crispin <john@phrozen.org>
>>> Signed-off-by: John Crispin <john@phrozen.org>
>>> ---
>>
>> [...]
>>
>>> @@ -7153,8 +7161,13 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>>>   			ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
>>>   				    ret);
>>>   +		if (arvif->vif->mbssid_tx_vif)
>>> +			tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
>>
>> This had a warning:
>>
>> drivers/net/wireless/ath/ath11k/mac.c:7200: line length of 92 exceeds 90 columns
>>
>> In the pending branch I fixed it like this:
>>
>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>> @@ -7143,6 +7143,7 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>>   {
>>          struct ath11k_base *ab = ar->ab;
>>          struct ath11k_vif *arvif, *tx_arvif = NULL;
>> +       struct ieee80211_vif *mbssid_tx_vif;
>>          int ret;
>>          int i;
>>          bool monitor_vif = false;
>> @@ -7196,8 +7197,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
>>                          ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
>>                                      ret);
>>   -               if (arvif->vif->mbssid_tx_vif)
>> -                       tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
>> +               mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
>> +               if (mbssid_tx_vif)
>> +                       tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
>> +
>>                  ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
>>                                           arvif->bssid,
>>                                           tx_arvif ? tx_arvif->bssid : NULL,
>>
>> Link to the commit:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=c884238009e778a0c8202a5eb0a7f68b13200bde
>>
>
> Thank you.
>
> I saw the warning but couldn't decide between adding a new pointer
> variable and letting 2 extra characters for just one assignment.

My scripts will fail loudly if any of the ath*0k-check scripts have
warnings, so just like with compiler warnings I have a zero warnings
policy :) It would become a mess otherwise to know which warnings are
new and which are old.

> What are your thoughts on changing the scripts to allow up to 100?
> Although nl80211 and mac80211 scripts also don't allow that long currently.

Yeah, the checkpatch default is 100 right now and I have understood that
what Linus prefers. I'm just worried that increasing the max to 100
makes our code even more convoluted, it's a challenge as is.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 8c852bf6294f..87f21a3f0ac6 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -964,7 +964,7 @@  static int ath11k_mac_monitor_vdev_start(struct ath11k *ar, int vdev_id,
 		return ret;
 	}
 
-	ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr);
+	ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr, NULL, 0, 0);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n",
 			    vdev_id, ret);
@@ -1423,6 +1423,7 @@  static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 				     struct ieee80211_bss_conf *info)
 {
 	struct ath11k *ar = arvif->ar;
+	struct ath11k_vif *tx_arvif = NULL;
 	int ret = 0;
 
 	lockdep_assert_held(&arvif->ar->conf_mutex);
@@ -1451,8 +1452,14 @@  static void ath11k_control_beaconing(struct ath11k_vif *arvif,
 
 	ether_addr_copy(arvif->bssid, info->bssid);
 
+	if (arvif->vif->mbssid_tx_vif)
+		tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
+
 	ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
-				 arvif->bssid);
+				 arvif->bssid,
+				 tx_arvif ? tx_arvif->bssid : NULL,
+				 info->bssid_index,
+				 1 << info->bssid_indicator);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n",
 			    arvif->vdev_id, ret);
@@ -2879,7 +2886,8 @@  static void ath11k_bss_assoc(struct ieee80211_hw *hw,
 	arvif->aid = vif->cfg.aid;
 	ether_addr_copy(arvif->bssid, bss_conf->bssid);
 
-	ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid);
+	ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid,
+				 NULL, 0, 0);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n",
 			    arvif->vdev_id, ret);
@@ -7099,7 +7107,7 @@  ath11k_mac_update_vif_chan(struct ath11k *ar,
 			   int n_vifs)
 {
 	struct ath11k_base *ab = ar->ab;
-	struct ath11k_vif *arvif;
+	struct ath11k_vif *arvif, *tx_arvif = NULL;
 	int ret;
 	int i;
 	bool monitor_vif = false;
@@ -7153,8 +7161,13 @@  ath11k_mac_update_vif_chan(struct ath11k *ar,
 			ath11k_warn(ab, "failed to update bcn tmpl during csa: %d\n",
 				    ret);
 
+		if (arvif->vif->mbssid_tx_vif)
+			tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
 		ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
-					 arvif->bssid);
+					 arvif->bssid,
+					 tx_arvif ? tx_arvif->bssid : NULL,
+					 arvif->vif->bss_conf.bssid_index,
+					 1 << arvif->vif->bss_conf.bssid_indicator);
 		if (ret) {
 			ath11k_warn(ab, "failed to bring vdev up %d: %d\n",
 				    arvif->vdev_id, ret);
@@ -7272,7 +7285,8 @@  static int ath11k_start_vdev_delay(struct ieee80211_hw *hw,
 	}
 
 	if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
-		ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr);
+		ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, 0, ar->mac_addr,
+					 NULL, 0, 0);
 		if (ret) {
 			ath11k_warn(ab, "failed put monitor up: %d\n", ret);
 			return ret;
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 1265f4c98860..039df4847108 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -994,7 +994,8 @@  int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,
 	return ret;
 }
 
-int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
+int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid,
+		       u8 *tx_bssid, u32 nontx_profile_idx, u32 nontx_profile_cnt)
 {
 	struct ath11k_pdev_wmi *wmi = ar->wmi;
 	struct wmi_vdev_up_cmd *cmd;
@@ -1018,6 +1019,11 @@  int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
 
 	ether_addr_copy(cmd->vdev_bssid.addr, bssid);
 
+	cmd->nontx_profile_idx = nontx_profile_idx;
+	cmd->nontx_profile_cnt = nontx_profile_cnt;
+	if (tx_bssid)
+		ether_addr_copy(cmd->tx_vdev_bssid.addr, tx_bssid);
+
 	if (arvif && arvif->vif->type == NL80211_IFTYPE_STATION) {
 		bss_conf = &arvif->vif->bss_conf;
 
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index cc695318ab7c..b83807087174 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -6296,7 +6296,8 @@  int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id,
 			struct sk_buff *bcn);
 int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id);
 int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid,
-		       const u8 *bssid);
+		       const u8 *bssid, u8 *tx_bssid, u32 nontx_profile_idx,
+		       u32 nontx_profile_cnt);
 int ath11k_wmi_vdev_stop(struct ath11k *ar, u8 vdev_id);
 int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,
 			  bool restart);