2023-09-26 13:51:39

by Aditya Kumar Singh

[permalink] [raw]
Subject: [PATCH v3 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/mac80211/cfg.c | 11 ++++++++---
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 3 ++-
net/mac80211/mesh.c | 2 +-
net/wireless/nl80211.c | 2 +-
net/wireless/rdev-ops.h | 7 ++++---
net/wireless/trace.h | 12 ++++++++----
8 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 34c50f7273d1..df0b511b6401 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4762,7 +4762,8 @@ struct cfg80211_ops {

int (*channel_switch)(struct wiphy *wiphy,
struct net_device *dev,
- struct cfg80211_csa_settings *params);
+ struct cfg80211_csa_settings *params,
+ unsigned int link_id);

int (*set_qos_map)(struct wiphy *wiphy,
struct net_device *dev,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5bc6b1329465..ac977aaad58e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3844,7 +3844,8 @@ static void ieee80211_color_change_abort(struct ieee80211_sub_if_data *sdata)

static int
__ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
- struct cfg80211_csa_settings *params)
+ struct cfg80211_csa_settings *params,
+ unsigned int link_id)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
@@ -3856,6 +3857,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,

lockdep_assert_wiphy(local->hw.wiphy);

+ if (WARN_ON(link_id > IEEE80211_MLD_MAX_NUM_LINKS))
+ return -EINVAL;
+
if (!list_empty(&local->roc_list) || local->scanning)
return -EBUSY;

@@ -3949,14 +3953,15 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
}

int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
- struct cfg80211_csa_settings *params)
+ struct cfg80211_csa_settings *params,
+ unsigned int link_id)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;

lockdep_assert_wiphy(local->hw.wiphy);

- return __ieee80211_channel_switch(wiphy, dev, params);
+ return __ieee80211_channel_switch(wiphy, dev, params, link_id);
}

u64 ieee80211_mgmt_tx_cookie(struct ieee80211_local *local)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index a7736acadf3c..c72449d0fe1a 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -871,7 +871,7 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
params.block_tx = !!csa_ie.mode;

if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev,
- &params))
+ &params, 0))
goto disconnect;

ieee80211_ibss_csa_mark_radar(sdata);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 19429f84afc3..da97812119ea 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1947,7 +1947,8 @@ int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
/* channel switch handling */
void ieee80211_csa_finalize_work(struct wiphy *wiphy, struct wiphy_work *work);
int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
- struct cfg80211_csa_settings *params);
+ struct cfg80211_csa_settings *params,
+ unsigned int link_id);

/* color change handling */
void ieee80211_color_change_finalize_work(struct wiphy *wiphy,
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 0d0fbae51b61..7e63ccea6c22 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1391,7 +1391,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_REPEATER;

if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev,
- &params) < 0)
+ &params, 0) < 0)
return false;

return true;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 87b21c0c0f25..d9212a1431d3 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10240,7 +10240,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
goto free;
}

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

free:
kfree(params.beacon_after.mbssid_ies);
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 2214a90cf101..7487164abe29 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -1099,12 +1099,13 @@ static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,

static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
struct net_device *dev,
- struct cfg80211_csa_settings *params)
+ struct cfg80211_csa_settings *params,
+ unsigned int link_id)
{
int ret;

- trace_rdev_channel_switch(&rdev->wiphy, dev, params);
- ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
+ trace_rdev_channel_switch(&rdev->wiphy, dev, params, link_id);
+ ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params, link_id);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index da2b73951c32..014664f4d255 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2311,8 +2311,9 @@ TRACE_EVENT(rdev_crit_proto_stop,

TRACE_EVENT(rdev_channel_switch,
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
- struct cfg80211_csa_settings *params),
- TP_ARGS(wiphy, netdev, params),
+ struct cfg80211_csa_settings *params,
+ unsigned int link_id),
+ TP_ARGS(wiphy, netdev, params, link_id),
TP_STRUCT__entry(
WIPHY_ENTRY
NETDEV_ENTRY
@@ -2322,6 +2323,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(unsigned int, link_id)
),
TP_fast_assign(
WIPHY_ASSIGN;
@@ -2339,11 +2341,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 = 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.17.1


2023-09-30 09:30:19

by kernel test robot

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

Hi Aditya,

kernel test robot noticed the following build errors:

[auto build test ERROR on 5482c0a28b2634e7a7d8ddaca7feac183e74b528]

url: https://github.com/intel-lab-lkp/linux/commits/Aditya-Kumar-Singh/wifi-cfg80211-send-link-id-in-channel_switch-ops/20230926-171918
base: 5482c0a28b2634e7a7d8ddaca7feac183e74b528
patch link: https://lore.kernel.org/r/20230926091648.17184-2-quic_adisi%40quicinc.com
patch subject: [PATCH v3 1/3] wifi: cfg80211: send link id in channel_switch ops
config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20230930/[email protected]/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230930/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/net/wireless/quantenna/qtnfmac/cfg80211.c:1026:35: error: initialization of 'int (*)(struct wiphy *, struct net_device *, struct cfg80211_csa_settings *, unsigned int)' from incompatible pointer type 'int (*)(struct wiphy *, struct net_device *, struct cfg80211_csa_settings *)' [-Werror=incompatible-pointer-types]
1026 | .channel_switch = qtnf_channel_switch,
| ^~~~~~~~~~~~~~~~~~~
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c:1026:35: note: (near initialization for 'qtn_cfg80211_ops.channel_switch')
cc1: some warnings being treated as errors


vim +1026 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

28b9188483908b2 Sergey Matyukevich 2018-08-02 1000
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1001 static struct cfg80211_ops qtn_cfg80211_ops = {
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1002 .add_virtual_intf = qtnf_add_virtual_intf,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1003 .change_virtual_intf = qtnf_change_virtual_intf,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1004 .del_virtual_intf = qtnf_del_virtual_intf,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1005 .start_ap = qtnf_start_ap,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1006 .change_beacon = qtnf_change_beacon,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1007 .stop_ap = qtnf_stop_ap,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1008 .set_wiphy_params = qtnf_set_wiphy_params,
6cd536fe62ef58d Johannes Berg 2020-04-17 1009 .update_mgmt_frame_registrations =
6cd536fe62ef58d Johannes Berg 2020-04-17 1010 qtnf_update_mgmt_frame_registrations,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1011 .mgmt_tx = qtnf_mgmt_tx,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1012 .change_station = qtnf_change_station,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1013 .del_station = qtnf_del_station,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1014 .get_station = qtnf_get_station,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1015 .dump_station = qtnf_dump_station,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1016 .add_key = qtnf_add_key,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1017 .del_key = qtnf_del_key,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1018 .set_default_key = qtnf_set_default_key,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1019 .set_default_mgmt_key = qtnf_set_default_mgmt_key,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1020 .scan = qtnf_scan,
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1021 .connect = qtnf_connect,
47b08e75a669887 Sergey Matyukevich 2019-02-05 1022 .external_auth = qtnf_external_auth,
7c04b43984a57bd Sergey Matyukevich 2017-07-28 1023 .disconnect = qtnf_disconnect,
278944482b2970b Sergey Matyukevich 2017-07-28 1024 .dump_survey = qtnf_dump_survey,
97883695d596e29 Sergey Matyukevich 2017-07-28 1025 .get_channel = qtnf_get_channel,
b05ee456fd21d7b Igor Mitsyanko 2017-12-19 @1026 .channel_switch = qtnf_channel_switch,
b05ee456fd21d7b Igor Mitsyanko 2017-12-19 1027 .start_radar_detection = qtnf_start_radar_detection,
f1398fd2dd8c77b Vasily Ulyanov 2017-12-19 1028 .set_mac_acl = qtnf_set_mac_acl,
4775ad06b56a151 Sergei Maksimenko 2018-05-31 1029 .set_power_mgmt = qtnf_set_power_mgmt,
0756e913fc020ab Mikhail Karpenko 2019-11-13 1030 .get_tx_power = qtnf_get_tx_power,
0756e913fc020ab Mikhail Karpenko 2019-11-13 1031 .set_tx_power = qtnf_set_tx_power,
44d09764856f69d Sergey Matyukevich 2020-02-13 1032 .update_owe_info = qtnf_update_owe_info,
28b9188483908b2 Sergey Matyukevich 2018-08-02 1033 #ifdef CONFIG_PM
28b9188483908b2 Sergey Matyukevich 2018-08-02 1034 .suspend = qtnf_suspend,
28b9188483908b2 Sergey Matyukevich 2018-08-02 1035 .resume = qtnf_resume,
28b9188483908b2 Sergey Matyukevich 2018-08-02 1036 .set_wakeup = qtnf_set_wakeup,
28b9188483908b2 Sergey Matyukevich 2018-08-02 1037 #endif
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1038 };
98f44cb0655cbef Igor Mitsyanko 2017-05-11 1039

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki