2024-01-03 06:38:03

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 00/10] wifi: ath12k: Refactor mac80211 callback operation functions

Currently, the existing mac80211 callback functions are defined assuming
each link/radio is represented by a single mac80211 hw. In order to
support multi link operation (MLO), need to move from the multi wiphy
model to a single wiphy model. However, the single wiphy model allows
multiple link/radio to be exposed by the same mac80211 hw. Therefore, we
need to separate the link/radio specific handling within the mac80211
callback operations. This way, the callback can be extended to support
multiple link/radio in the future.

Current Multi wiphy Model

+---------------+ +---------------+ +-------------+
| Mac80211 hw | | Mac80211 hw | |Mac80211 hw |
| private data | | private data | |private data |
| | | | | |
| | | | | |
| | | | | |
| ar (2GHz) | | ar (5GHz) | | ar (6GHz) |
| | | | | |
| | | | | |
| | | | | |
+---------------+ +---------------+ +-------------+




Single wiphy Model

+--------------+
| Mac80211 hw |
| private data |
| |
|ath12k hw (ah)|
| +----------+ |
| |ar (2GHz) | |
| +----------+ |
| | | |
| |ar (5GHz) | |
| +----------+ |
| | | |
| |ar (6GHz) | |
| | | |
| +----------+ |
+--------------+


Karthikeyan Periyasamy (10):
wifi: ath12k: Refactor mac callback of config
wifi: ath12k: Refactor mac callback of bss info changed
wifi: ath12k: Refactor mac callback of conf tx
wifi: ath12k: Refactor mac callback of start
wifi: ath12k: Refactor mac callback of stop
wifi: ath12k: Refactor mac callback of update vif offload
wifi: ath12k: Refactor mac callback of configure filter
wifi: ath12k: Refactor mac callback of ampdu action
wifi: ath12k: Refactor mac callback of flush
wifi: ath12k: Refactor start vdev delay function

drivers/net/wireless/ath/ath12k/mac.c | 250 ++++++++++++++++++--------
1 file changed, 173 insertions(+), 77 deletions(-)


base-commit: 2cd4e3f91f264926a6b11df948417b74d52ca9b9
--
2.34.1



2024-01-03 06:38:11

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 02/10] wifi: ath12k: Refactor mac callback of bss info changed

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback bss_info_change(). This way, the
callback can be extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 43 ++++++++++++++++-----------
1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 7b02a107ab38..bbd57b73fa63 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -2279,12 +2279,11 @@ static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_vif *arvif,
ath12k_smps_map[smps]);
}

-static void ath12k_bss_assoc(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
+static void ath12k_bss_assoc(struct ath12k *ar,
+ struct ath12k_vif *arvif,
struct ieee80211_bss_conf *bss_conf)
{
- struct ath12k *ar = hw->priv;
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+ struct ieee80211_vif *vif = arvif->vif;
struct ath12k_wmi_peer_assoc_arg peer_arg;
struct ieee80211_sta *ap_sta;
struct ath12k_peer *peer;
@@ -2374,11 +2373,9 @@ static void ath12k_bss_assoc(struct ieee80211_hw *hw,
arvif->vdev_id, ret);
}

-static void ath12k_bss_disassoc(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
+static void ath12k_bss_disassoc(struct ath12k *ar,
+ struct ath12k_vif *arvif)
{
- struct ath12k *ar = hw->priv;
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
int ret;

lockdep_assert_held(&ar->conf_mutex);
@@ -2504,13 +2501,12 @@ static int ath12k_mac_fils_discovery(struct ath12k_vif *arvif,
return ret;
}

-static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- struct ieee80211_bss_conf *info,
- u64 changed)
+static void ath12k_mac_bss_info_changed(struct ath12k *ar,
+ struct ath12k_vif *arvif,
+ struct ieee80211_bss_conf *info,
+ u64 changed)
{
- struct ath12k *ar = hw->priv;
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+ struct ieee80211_vif *vif = arvif->vif;
struct cfg80211_chan_def def;
u32 param_id, param_value;
enum nl80211_band band;
@@ -2523,7 +2519,7 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
u8 rateidx;
u32 rate;

- mutex_lock(&ar->conf_mutex);
+ lockdep_assert_held(&ar->conf_mutex);

if (changed & BSS_CHANGED_BEACON_INT) {
arvif->beacon_interval = info->beacon_int;
@@ -2679,9 +2675,9 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,

if (changed & BSS_CHANGED_ASSOC) {
if (vif->cfg.assoc)
- ath12k_bss_assoc(hw, vif, info);
+ ath12k_bss_assoc(ar, arvif, info);
else
- ath12k_bss_disassoc(hw, vif);
+ ath12k_bss_disassoc(ar, arvif);
}

if (changed & BSS_CHANGED_TXPOWER) {
@@ -2783,6 +2779,19 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,

if (changed & BSS_CHANGED_EHT_PUNCTURING)
arvif->punct_bitmap = info->eht_puncturing;
+}
+
+static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *info,
+ u64 changed)
+{
+ struct ath12k *ar = hw->priv;
+ struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+
+ mutex_lock(&ar->conf_mutex);
+
+ ath12k_mac_bss_info_changed(ar, arvif, info, changed);

mutex_unlock(&ar->conf_mutex);
}
--
2.34.1


2024-01-03 06:38:17

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 04/10] wifi: ath12k: Refactor mac callback of start

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback start(). This way, the callback can be
extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 31 ++++++++++++++++++++-------
1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 66c758bddf48..31ed3d342741 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5081,14 +5081,12 @@ static void ath12k_mac_wait_reconfigure(struct ath12k_base *ab)
ATH12K_RECONFIGURE_TIMEOUT_HZ);
}

-static int ath12k_mac_op_start(struct ieee80211_hw *hw)
+static int ath12k_mac_start(struct ath12k *ar)
{
- struct ath12k *ar = hw->priv;
struct ath12k_base *ab = ar->ab;
struct ath12k_pdev *pdev = ar->pdev;
int ret;

- ath12k_mac_drain_tx(ar);
mutex_lock(&ar->conf_mutex);

switch (ar->state) {
@@ -5111,14 +5109,14 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
1, pdev->pdev_id);

if (ret) {
- ath12k_err(ar->ab, "failed to enable PMF QOS: (%d\n", ret);
+ ath12k_err(ab, "failed to enable PMF QOS: (%d\n", ret);
goto err;
}

ret = ath12k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_DYNAMIC_BW, 1,
pdev->pdev_id);
if (ret) {
- ath12k_err(ar->ab, "failed to enable dynamic bw: %d\n", ret);
+ ath12k_err(ab, "failed to enable dynamic bw: %d\n", ret);
goto err;
}

@@ -5148,7 +5146,7 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
1, pdev->pdev_id);

if (ret) {
- ath12k_err(ar->ab, "failed to enable MESH MCAST ENABLE: (%d\n", ret);
+ ath12k_err(ab, "failed to enable MESH MCAST ENABLE: (%d\n", ret);
goto err;
}

@@ -5174,7 +5172,7 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
}

if (ret == -ENOTSUPP)
- ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
+ ath12k_dbg(ab, ATH12K_DBG_MAC,
"monitor status config is not yet supported");

/* Configure the hash seed for hash based reo dest ring selection */
@@ -5196,7 +5194,6 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
&ab->pdevs[ar->pdev_idx]);

return 0;
-
err:
ar->state = ATH12K_STATE_OFF;
mutex_unlock(&ar->conf_mutex);
@@ -5204,6 +5201,24 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
return ret;
}

+static int ath12k_mac_op_start(struct ieee80211_hw *hw)
+{
+ struct ath12k *ar = hw->priv;
+ struct ath12k_base *ab = ar->ab;
+ int ret;
+
+ ath12k_mac_drain_tx(ar);
+
+ ret = ath12k_mac_start(ar);
+ if (ret) {
+ ath12k_err(ab, "fail to start mac operations in pdev idx %d ret %d\n",
+ ar->pdev_idx, ret);
+ return ret;
+ }
+
+ return 0;
+}
+
int ath12k_mac_rfkill_config(struct ath12k *ar)
{
struct ath12k_base *ab = ar->ab;
--
2.34.1


2024-01-03 06:38:26

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 03/10] wifi: ath12k: Refactor mac callback of conf tx

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback conf_tx(). This way, the callback can
be extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 41 ++++++++++++++++++---------
1 file changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index bbd57b73fa63..66c758bddf48 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -3986,10 +3986,10 @@ static void ath12k_mac_op_sta_rc_update(struct ieee80211_hw *hw,
ieee80211_queue_work(hw, &arsta->update_wk);
}

-static int ath12k_conf_tx_uapsd(struct ath12k *ar, struct ieee80211_vif *vif,
+static int ath12k_conf_tx_uapsd(struct ath12k_vif *arvif,
u16 ac, bool enable)
{
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+ struct ath12k *ar = arvif->ar;
u32 value;
int ret;

@@ -4043,17 +4043,16 @@ static int ath12k_conf_tx_uapsd(struct ath12k *ar, struct ieee80211_vif *vif,
return ret;
}

-static int ath12k_mac_op_conf_tx(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- unsigned int link_id, u16 ac,
- const struct ieee80211_tx_queue_params *params)
+static int ath12k_mac_conf_tx(struct ath12k_vif *arvif,
+ unsigned int link_id, u16 ac,
+ const struct ieee80211_tx_queue_params *params)
{
- struct ath12k *ar = hw->priv;
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
struct wmi_wmm_params_arg *p = NULL;
+ struct ath12k *ar = arvif->ar;
+ struct ath12k_base *ab = ar->ab;
int ret;

- mutex_lock(&ar->conf_mutex);
+ lockdep_assert_held(&ar->conf_mutex);

switch (ac) {
case IEEE80211_AC_VO:
@@ -4083,17 +4082,33 @@ static int ath12k_mac_op_conf_tx(struct ieee80211_hw *hw,
ret = ath12k_wmi_send_wmm_update_cmd(ar, arvif->vdev_id,
&arvif->wmm_params);
if (ret) {
- ath12k_warn(ar->ab, "failed to set wmm params: %d\n", ret);
+ ath12k_warn(ab, "pdev idx %d failed to set wmm params: %d\n",
+ ar->pdev_idx, ret);
goto exit;
}

- ret = ath12k_conf_tx_uapsd(ar, vif, ac, params->uapsd);
-
+ ret = ath12k_conf_tx_uapsd(arvif, ac, params->uapsd);
if (ret)
- ath12k_warn(ar->ab, "failed to set sta uapsd: %d\n", ret);
+ ath12k_warn(ab, "pdev idx %d failed to set sta uapsd: %d\n",
+ ar->pdev_idx, ret);

exit:
+ return ret;
+}
+
+static int ath12k_mac_op_conf_tx(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ unsigned int link_id, u16 ac,
+ const struct ieee80211_tx_queue_params *params)
+{
+ struct ath12k *ar = hw->priv;
+ struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+ int ret;
+
+ mutex_lock(&ar->conf_mutex);
+ ret = ath12k_mac_conf_tx(arvif, link_id, ac, params);
mutex_unlock(&ar->conf_mutex);
+
return ret;
}

--
2.34.1


2024-01-03 06:38:26

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 05/10] wifi: ath12k: Refactor mac callback of stop

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback stop(). This way, the callback can be
extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 31ed3d342741..0b72b32e25d4 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5276,14 +5276,11 @@ int ath12k_mac_rfkill_enable_radio(struct ath12k *ar, bool enable)
return 0;
}

-static void ath12k_mac_op_stop(struct ieee80211_hw *hw)
+static void ath12k_mac_stop(struct ath12k *ar)
{
- struct ath12k *ar = hw->priv;
struct htt_ppdu_stats_info *ppdu_stats, *tmp;
int ret;

- ath12k_mac_drain_tx(ar);
-
mutex_lock(&ar->conf_mutex);
ret = ath12k_mac_config_mon_status_default(ar, false);
if (ret && (ret != -ENOTSUPP))
@@ -5312,6 +5309,15 @@ static void ath12k_mac_op_stop(struct ieee80211_hw *hw)
atomic_set(&ar->num_pending_mgmt_tx, 0);
}

+static void ath12k_mac_op_stop(struct ieee80211_hw *hw)
+{
+ struct ath12k *ar = hw->priv;
+
+ ath12k_mac_drain_tx(ar);
+
+ ath12k_mac_stop(ar);
+}
+
static u8
ath12k_mac_get_vdev_stats_id(struct ath12k_vif *arvif)
{
--
2.34.1


2024-01-03 06:38:30

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 06/10] wifi: ath12k: Refactor mac callback of update vif offload

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback update_vif_offload(). This way, the
callback can be extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 0b72b32e25d4..5c7b747addda 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5434,12 +5434,11 @@ static int ath12k_set_he_mu_sounding_mode(struct ath12k *ar,
return ret;
}

-static void ath12k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
+static void ath12k_mac_update_vif_offload(struct ath12k_vif *arvif)
{
- struct ath12k *ar = hw->priv;
+ struct ieee80211_vif *vif = arvif->vif;
+ struct ath12k *ar = arvif->ar;
struct ath12k_base *ab = ar->ab;
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
u32 param_id, param_value;
int ret;

@@ -5481,6 +5480,14 @@ static void ath12k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
}
}

+static void ath12k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+{
+ struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+
+ ath12k_mac_update_vif_offload(arvif);
+}
+
static int ath12k_mac_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
@@ -5584,7 +5591,7 @@ static int ath12k_mac_op_add_interface(struct ieee80211_hw *hw,
list_add(&arvif->list, &ar->arvifs);
spin_unlock_bh(&ar->data_lock);

- ath12k_mac_op_update_vif_offload(hw, vif);
+ ath12k_mac_update_vif_offload(arvif);

nss = hweight32(ar->cfg_tx_chainmask) ? : 1;
ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
--
2.34.1


2024-01-03 06:38:38

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 08/10] wifi: ath12k: Refactor mac callback of ampdu action

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback ampdu_action(). This way, the callback
can be extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 1566b43029cd..c505bac365f6 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5901,14 +5901,13 @@ static int ath12k_mac_op_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx
return ret;
}

-static int ath12k_mac_op_ampdu_action(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- struct ieee80211_ampdu_params *params)
+static int ath12k_mac_ampdu_action(struct ath12k_vif *arvif,
+ struct ieee80211_ampdu_params *params)
{
- struct ath12k *ar = hw->priv;
+ struct ath12k *ar = arvif->ar;
int ret = -EINVAL;

- mutex_lock(&ar->conf_mutex);
+ lockdep_assert_held(&ar->conf_mutex);

switch (params->action) {
case IEEE80211_AMPDU_RX_START:
@@ -5929,8 +5928,25 @@ static int ath12k_mac_op_ampdu_action(struct ieee80211_hw *hw,
break;
}

+ return ret;
+}
+
+static int ath12k_mac_op_ampdu_action(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_ampdu_params *params)
+{
+ struct ath12k *ar = hw->priv;
+ struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+ int ret = -EINVAL;
+
+ mutex_lock(&ar->conf_mutex);
+ ret = ath12k_mac_ampdu_action(arvif, params);
mutex_unlock(&ar->conf_mutex);

+ if (ret)
+ ath12k_warn(ar->ab, "pdev idx %d unable to perform ampdu action %d ret %d\n",
+ ar->pdev_idx, params->action, ret);
+
return ret;
}

--
2.34.1


2024-01-03 06:38:45

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 09/10] wifi: ath12k: Refactor mac callback of flush

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback flush(). This way, the callback can be
extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index c505bac365f6..84587c5782e6 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -6644,15 +6644,10 @@ static int ath12k_mac_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value)
return -EOPNOTSUPP;
}

-static void ath12k_mac_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- u32 queues, bool drop)
+static void ath12k_mac_flush(struct ath12k *ar)
{
- struct ath12k *ar = hw->priv;
long time_left;

- if (drop)
- return;
-
time_left = wait_event_timeout(ar->dp.tx_empty_waitq,
(atomic_read(&ar->dp.num_tx_pending) == 0),
ATH12K_FLUSH_TIMEOUT);
@@ -6667,6 +6662,17 @@ static void ath12k_mac_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *v
time_left);
}

+static void ath12k_mac_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ u32 queues, bool drop)
+{
+ struct ath12k *ar = hw->priv;
+
+ if (drop)
+ return;
+
+ ath12k_mac_flush(ar);
+}
+
static int
ath12k_mac_bitrate_mask_num_ht_rates(struct ath12k *ar,
enum nl80211_band band,
--
2.34.1


2024-01-03 06:38:51

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 07/10] wifi: ath12k: Refactor mac callback of configure filter

To support single wiphy abstraction, introduce link/radio specific helper
function in the mac80211 callback configure_filter(). This way, the
callback can be extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 28 ++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 5c7b747addda..1566b43029cd 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5831,19 +5831,15 @@ static void ath12k_mac_op_remove_interface(struct ieee80211_hw *hw,
FIF_PROBE_REQ | \
FIF_FCSFAIL)

-static void ath12k_mac_op_configure_filter(struct ieee80211_hw *hw,
- unsigned int changed_flags,
- unsigned int *total_flags,
- u64 multicast)
+static void ath12k_mac_configure_filter(struct ath12k *ar,
+ unsigned int total_flags)
{
- struct ath12k *ar = hw->priv;
bool reset_flag;
int ret;

- mutex_lock(&ar->conf_mutex);
+ lockdep_assert_held(&ar->conf_mutex);

- *total_flags &= SUPPORTED_FILTERS;
- ar->filter_flags = *total_flags;
+ ar->filter_flags = total_flags;

/* For monitor mode */
reset_flag = !(ar->filter_flags & FIF_BCN_PRBRESP_PROMISC);
@@ -5858,9 +5854,23 @@ static void ath12k_mac_op_configure_filter(struct ieee80211_hw *hw,
ath12k_warn(ar->ab,
"fail to set monitor filter: %d\n", ret);
}
+
ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
"total_flags:0x%x, reset_flag:%d\n",
- *total_flags, reset_flag);
+ total_flags, reset_flag);
+}
+
+static void ath12k_mac_op_configure_filter(struct ieee80211_hw *hw,
+ unsigned int changed_flags,
+ unsigned int *total_flags,
+ u64 multicast)
+{
+ struct ath12k *ar = hw->priv;
+
+ mutex_lock(&ar->conf_mutex);
+
+ *total_flags &= SUPPORTED_FILTERS;
+ ath12k_mac_configure_filter(ar, *total_flags);

mutex_unlock(&ar->conf_mutex);
}
--
2.34.1


2024-01-03 06:39:11

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: [PATCH 10/10] wifi: ath12k: Refactor start vdev delay function

To support single wiphy abstraction, remove the mac80211 hw data
dependency from the start vdev delay function. This way, this
function can be extended to handle multiple link/radio in the future.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Karthikeyan Periyasamy <[email protected]>
---
drivers/net/wireless/ath/ath12k/mac.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 84587c5782e6..d328f37dac92 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -241,8 +241,8 @@ static const u32 ath12k_smps_map[] = {
[WLAN_HT_CAP_SM_PS_DISABLED] = WMI_PEER_SMPS_PS_NONE,
};

-static int ath12k_start_vdev_delay(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif);
+static int ath12k_start_vdev_delay(struct ath12k *ar,
+ struct ath12k_vif *arvif);

static const char *ath12k_mac_phymode_str(enum wmi_phy_mode mode)
{
@@ -3718,7 +3718,7 @@ static int ath12k_mac_station_add(struct ath12k *ar,
if (ab->hw_params->vdev_start_delay &&
!arvif->is_started &&
arvif->vdev_type != WMI_VDEV_TYPE_AP) {
- ret = ath12k_start_vdev_delay(ar->hw, vif);
+ ret = ath12k_start_vdev_delay(ar, arvif);
if (ret) {
ath12k_warn(ab, "failed to delay vdev start: %d\n", ret);
goto free_peer;
@@ -6411,12 +6411,11 @@ static void ath12k_mac_op_change_chanctx(struct ieee80211_hw *hw,
mutex_unlock(&ar->conf_mutex);
}

-static int ath12k_start_vdev_delay(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
+static int ath12k_start_vdev_delay(struct ath12k *ar,
+ struct ath12k_vif *arvif)
{
- struct ath12k *ar = hw->priv;
struct ath12k_base *ab = ar->ab;
- struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+ struct ieee80211_vif *vif = arvif->vif;
int ret;

if (WARN_ON(arvif->is_started))
--
2.34.1


2024-01-03 17:25:25

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 02/10] wifi: ath12k: Refactor mac callback of bss info changed

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback bss_info_change(). This way, the
> callback can be extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-03 17:26:02

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 03/10] wifi: ath12k: Refactor mac callback of conf tx

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback conf_tx(). This way, the callback can
> be extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>


2024-01-03 17:31:21

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 04/10] wifi: ath12k: Refactor mac callback of start

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback start(). This way, the callback can be
> extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-03 17:32:36

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 05/10] wifi: ath12k: Refactor mac callback of stop

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback stop(). This way, the callback can be
> extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>


2024-01-03 17:36:49

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 06/10] wifi: ath12k: Refactor mac callback of update vif offload

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback update_vif_offload(). This way, the
> callback can be extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-03 17:37:04

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 07/10] wifi: ath12k: Refactor mac callback of configure filter

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback configure_filter(). This way, the
> callback can be extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-03 17:37:33

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 08/10] wifi: ath12k: Refactor mac callback of ampdu action

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback ampdu_action(). This way, the callback
> can be extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-03 17:40:49

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 09/10] wifi: ath12k: Refactor mac callback of flush

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, introduce link/radio specific helper
> function in the mac80211 callback flush(). This way, the callback can be
> extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-03 17:40:56

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH 10/10] wifi: ath12k: Refactor start vdev delay function

On 1/2/2024 10:37 PM, Karthikeyan Periyasamy wrote:
> To support single wiphy abstraction, remove the mac80211 hw data
> dependency from the start vdev delay function. This way, this
> function can be extended to handle multiple link/radio in the future.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Karthikeyan Periyasamy <[email protected]>
Acked-by: Jeff Johnson <[email protected]>



2024-01-15 15:35:52

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 00/10] wifi: ath12k: Refactor mac80211 callback operation functions

Karthikeyan Periyasamy <[email protected]> writes:

> Currently, the existing mac80211 callback functions are defined assuming
> each link/radio is represented by a single mac80211 hw. In order to
> support multi link operation (MLO), need to move from the multi wiphy
> model to a single wiphy model. However, the single wiphy model allows
> multiple link/radio to be exposed by the same mac80211 hw. Therefore, we
> need to separate the link/radio specific handling within the mac80211
> callback operations. This way, the callback can be extended to support
> multiple link/radio in the future.
>
> Current Multi wiphy Model
>
> +---------------+ +---------------+ +-------------+
> | Mac80211 hw | | Mac80211 hw | |Mac80211 hw |
> | private data | | private data | |private data |
> | | | | | |
> | | | | | |
> | | | | | |
> | ar (2GHz) | | ar (5GHz) | | ar (6GHz) |
> | | | | | |
> | | | | | |
> | | | | | |
> +---------------+ +---------------+ +-------------+
>
>
>
>
> Single wiphy Model
>
> +--------------+
> | Mac80211 hw |
> | private data |
> | |
> |ath12k hw (ah)|
> | +----------+ |
> | |ar (2GHz) | |
> | +----------+ |
> | | | |
> | |ar (5GHz) | |
> | +----------+ |
> | | | |
> | |ar (6GHz) | |
> | | | |
> | +----------+ |
> +--------------+
>
>
> Karthikeyan Periyasamy (10):
> wifi: ath12k: Refactor mac callback of config
> wifi: ath12k: Refactor mac callback of bss info changed
> wifi: ath12k: Refactor mac callback of conf tx
> wifi: ath12k: Refactor mac callback of start
> wifi: ath12k: Refactor mac callback of stop
> wifi: ath12k: Refactor mac callback of update vif offload
> wifi: ath12k: Refactor mac callback of configure filter
> wifi: ath12k: Refactor mac callback of ampdu action
> wifi: ath12k: Refactor mac callback of flush
> wifi: ath12k: Refactor start vdev delay function

In the pending branch I renamed the patch titles like this, an example:

wifi: ath12k: refactor ath12k_mac_op_conf_tx()

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=bdb399b467daacabdc0e2127e03874d399f17a38

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2024-01-16 04:51:37

by Karthikeyan Periyasamy

[permalink] [raw]
Subject: Re: [PATCH 00/10] wifi: ath12k: Refactor mac80211 callback operation functions


On 1/15/2024 9:05 PM, Kalle Valo wrote:
> Karthikeyan Periyasamy <[email protected]> writes:
>
>> Currently, the existing mac80211 callback functions are defined assuming
>> each link/radio is represented by a single mac80211 hw. In order to
>> support multi link operation (MLO), need to move from the multi wiphy
>> model to a single wiphy model. However, the single wiphy model allows
>> multiple link/radio to be exposed by the same mac80211 hw. Therefore, we
>> need to separate the link/radio specific handling within the mac80211
>> callback operations. This way, the callback can be extended to support
>> multiple link/radio in the future.
>>
>> Current Multi wiphy Model
>>
>> +---------------+ +---------------+ +-------------+
>> | Mac80211 hw | | Mac80211 hw | |Mac80211 hw |
>> | private data | | private data | |private data |
>> | | | | | |
>> | | | | | |
>> | | | | | |
>> | ar (2GHz) | | ar (5GHz) | | ar (6GHz) |
>> | | | | | |
>> | | | | | |
>> | | | | | |
>> +---------------+ +---------------+ +-------------+
>>
>>
>>
>>
>> Single wiphy Model
>>
>> +--------------+
>> | Mac80211 hw |
>> | private data |
>> | |
>> |ath12k hw (ah)|
>> | +----------+ |
>> | |ar (2GHz) | |
>> | +----------+ |
>> | | | |
>> | |ar (5GHz) | |
>> | +----------+ |
>> | | | |
>> | |ar (6GHz) | |
>> | | | |
>> | +----------+ |
>> +--------------+
>>
>>
>> Karthikeyan Periyasamy (10):
>> wifi: ath12k: Refactor mac callback of config
>> wifi: ath12k: Refactor mac callback of bss info changed
>> wifi: ath12k: Refactor mac callback of conf tx
>> wifi: ath12k: Refactor mac callback of start
>> wifi: ath12k: Refactor mac callback of stop
>> wifi: ath12k: Refactor mac callback of update vif offload
>> wifi: ath12k: Refactor mac callback of configure filter
>> wifi: ath12k: Refactor mac callback of ampdu action
>> wifi: ath12k: Refactor mac callback of flush
>> wifi: ath12k: Refactor start vdev delay function
> In the pending branch I renamed the patch titles like this, an example:
>
> wifi: ath12k: refactor ath12k_mac_op_conf_tx()
>
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=bdb399b467daacabdc0e2127e03874d399f17a38

Looks fine to me.


Thanks,

Karthikeyan