2024-01-25 13:07:35

by Aditya Kumar Singh

[permalink] [raw]
Subject: [PATCH v5 0/3] wifi: cfg80211/mac80211: add link_id handling in AP channel switch during Multi-Link Operation

Currently, during channel switch, deflink (or link_id 0) is always
considered. However, with Multi-Link Operation (MLO), there is a
need to handle link specific data structures based on the actual
operational link_id during channel switch operation.

Hence, add support for the same. Non-MLO based operations will use
link_id as 0 or deflink member as applicable.

While at it, beacon count down now needs to be updated on proper
link_id's beacon, do that as well.

Aditya Kumar Singh (3):
wifi: cfg80211: send link id in channel_switch ops
wifi: mac80211: add support for AP channel switch with MLO
wifi: mac80211: update beacon counters per link basis
---
v5: * fixed compilation issue reported by kernel test robot.

v4: * fixed compilation issue reported by kernel test robot.
* rebased on latest ToT.
* moved link_id arguement into csa_params struct in [1/3]

v3: * splitted [v2 1/2] into [v3 1/3] and [v3 2/3] having simple cfg80211
changes in 1/3 for easy review. Rest in 2/3 [Johannes]
* used wiphy_dereference() instead of sdata_dereference() [Johannes]

v2: * reabsed on ToT
* removed unwanted locking sequence during cancelling CSA work handler
since now locking is moved to wiphy level, that part is uncessary now.
---
drivers/net/wireless/ath/ath10k/mac.c | 4 +-
drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
drivers/net/wireless/ath/ath11k/mac.c | 2 +-
drivers/net/wireless/ath/ath11k/wmi.c | 2 +-
drivers/net/wireless/ath/ath12k/wmi.c | 2 +-
drivers/net/wireless/ath/ath9k/beacon.c | 2 +-
.../net/wireless/ath/ath9k/htc_drv_beacon.c | 2 +-
.../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 6 +-
.../wireless/intel/iwlwifi/mvm/time-event.c | 2 +-
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
.../net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +-
.../net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +-
.../net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +-
.../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
drivers/net/wireless/ti/wlcore/event.c | 2 +-
drivers/net/wireless/virtual/mac80211_hwsim.c | 2 +-
include/net/cfg80211.h | 3 +
include/net/mac80211.h | 7 +-
net/mac80211/cfg.c | 110 +++++++++++-------
net/mac80211/tx.c | 14 ++-
net/wireless/nl80211.c | 1 +
net/wireless/trace.h | 7 +-
22 files changed, 112 insertions(+), 68 deletions(-)


base-commit: acf868ff60b1cd1f2e597f0b15aee2ff43f9fcd3
--
2.25.1



2024-01-25 13:11:09

by Aditya Kumar Singh

[permalink] [raw]
Subject: [PATCH v5 1/3] wifi: cfg80211: send link id in channel_switch ops

Currently, during channel switch, no link id information is passed
due to which channel switch is carried on deflink always. In order
to support channel switch during Multi Link Operation, it is
required to pass link id as well.

Add changes to pass link id in the channel_switch cfg80211_ops.

Signed-off-by: Aditya Kumar Singh <[email protected]>
---
include/net/cfg80211.h | 3 +++
net/wireless/nl80211.c | 1 +
net/wireless/trace.h | 7 +++++--
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index cf79656ce09c..098a4f10fdfd 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1531,6 +1531,8 @@ struct cfg80211_ap_update {
* @punct_bitmap: Preamble puncturing bitmap. Each bit represents
* a 20 MHz channel, lowest bit corresponding to the lowest channel.
* Bit set to 1 indicates that the channel is punctured.
+ * @link_id: defines the link on which channel switch is expected during
+ * MLO. 0 is case of non-MLO.
*/
struct cfg80211_csa_settings {
struct cfg80211_chan_def chandef;
@@ -1544,6 +1546,7 @@ struct cfg80211_csa_settings {
bool block_tx;
u8 count;
u16 punct_bitmap;
+ u8 link_id;
};

/**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 60877b532993..7022e34d0a93 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10277,6 +10277,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
goto free;
}

+ params.link_id = link_id;
err = rdev_channel_switch(rdev, dev, &params);

free:
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 1f374c8a17a5..2af58f5fbf51 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2324,6 +2324,7 @@ TRACE_EVENT(rdev_channel_switch,
__field(u8, count)
__dynamic_array(u16, bcn_ofs, params->n_counter_offsets_beacon)
__dynamic_array(u16, pres_ofs, params->n_counter_offsets_presp)
+ __field(u8, link_id)
),
TP_fast_assign(
WIPHY_ASSIGN;
@@ -2341,11 +2342,13 @@ TRACE_EVENT(rdev_channel_switch,
memcpy(__get_dynamic_array(pres_ofs),
params->counter_offsets_presp,
params->n_counter_offsets_presp * sizeof(u16));
+ __entry->link_id = params->link_id;
),
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
- ", block_tx: %d, count: %u, radar_required: %d",
+ ", block_tx: %d, count: %u, radar_required: %d link_id: %d",
WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
- __entry->block_tx, __entry->count, __entry->radar_required)
+ __entry->block_tx, __entry->count, __entry->radar_required,
+ __entry->link_id)
);

TRACE_EVENT(rdev_set_qos_map,
--
2.25.1


2024-01-26 10:13:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v5 1/3] wifi: cfg80211: send link id in channel_switch ops

On Thu, 2024-01-25 at 18:34 +0530, Aditya Kumar Singh wrote:
> Currently, during channel switch, no link id information is passed
> due to which channel switch is carried on deflink always.

I guess I already know what you mean, but ... that's really hard to
parse, can you rewrite it?

> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -1531,6 +1531,8 @@ struct cfg80211_ap_update {
> * @punct_bitmap: Preamble puncturing bitmap. Each bit represents
> * a 20 MHz channel, lowest bit corresponding to the lowest channel.
> * Bit set to 1 indicates that the channel is punctured.
> + * @link_id: defines the link on which channel switch is expected during
> + * MLO. 0 is case of non-MLO.

please use a tab

johannes

2024-01-27 04:52:55

by Aditya Kumar Singh

[permalink] [raw]
Subject: Re: [PATCH v5 1/3] wifi: cfg80211: send link id in channel_switch ops

On 1/26/24 14:48, Johannes Berg wrote:
> On Thu, 2024-01-25 at 18:34 +0530, Aditya Kumar Singh wrote:
>> Currently, during channel switch, no link id information is passed
>> due to which channel switch is carried on deflink always.
>
> I guess I already know what you mean, but ... that's really hard to
> parse, can you rewrite it?
>

Sure, let me rephrase it.

>> --- a/include/net/cfg80211.h
>> +++ b/include/net/cfg80211.h
>> @@ -1531,6 +1531,8 @@ struct cfg80211_ap_update {
>> * @punct_bitmap: Preamble puncturing bitmap. Each bit represents
>> * a 20 MHz channel, lowest bit corresponding to the lowest channel.
>> * Bit set to 1 indicates that the channel is punctured.
>> + * @link_id: defines the link on which channel switch is expected during
>> + * MLO. 0 is case of non-MLO.
>
> please use a tab
>
Oh, checkpatch did not warn me. Let me take a look still. Thanks for
pointing it out.