mbox series

[0/3] wifi: ath12k: prepare vif and sta datastructure

Message ID 20240422125630.1469456-1-quic_ramess@quicinc.com
Headers show
Series wifi: ath12k: prepare vif and sta datastructure | expand

Message

Rameshkumar Sundaram April 22, 2024, 12:56 p.m. UTC
From: Sriram R <quic_srirrama@quicinc.com>

To prepare the driver for MLO support, split the driver vif and sta
data structure to scale for multiple links .This requires changing
the use of arvif and arsta to per link and not per hw which can now
comprise of multiple links.
Also since most configurations from mac80211 are done per link,
do refactoring of the driver functions to apply these configurations
at link level.
Add the required locking changes to synchronize the usage of these
per link objects.

Sriram R (3):
  wifi: ath12k: prepare vif data structure for MLO handling
  wifi: ath12k: pass ath12k_link_vif instead of vif/ahvif
  wifi: ath12k: prepare sta data structure for MLO handling

 drivers/net/wireless/ath/ath12k/core.h   |  82 ++-
 drivers/net/wireless/ath/ath12k/dp.c     |  21 +-
 drivers/net/wireless/ath/ath12k/dp.h     |   3 +-
 drivers/net/wireless/ath/ath12k/dp_mon.c |  14 +-
 drivers/net/wireless/ath/ath12k/dp_rx.c  |  16 +-
 drivers/net/wireless/ath/ath12k/dp_rx.h  |   4 +-
 drivers/net/wireless/ath/ath12k/dp_tx.c  |   9 +-
 drivers/net/wireless/ath/ath12k/dp_tx.h  |   4 +-
 drivers/net/wireless/ath/ath12k/mac.c    | 848 +++++++++++++++--------
 drivers/net/wireless/ath/ath12k/mac.h    |   9 +-
 drivers/net/wireless/ath/ath12k/p2p.c    |  17 +-
 drivers/net/wireless/ath/ath12k/p2p.h    |   2 +-
 drivers/net/wireless/ath/ath12k/peer.c   |   7 +-
 drivers/net/wireless/ath/ath12k/peer.h   |   4 +-
 drivers/net/wireless/ath/ath12k/wmi.c    |  12 +-
 15 files changed, 676 insertions(+), 376 deletions(-)


base-commit: 264e95feb91f4c02f75e7dba7a67267b0022db2c

Comments

Jeff Johnson April 23, 2024, 8:30 p.m. UTC | #1
On 4/22/2024 5:56 AM, Rameshkumar Sundaram wrote:
> From: Sriram R <quic_srirrama@quicinc.com>
> 
> To prepare the driver for MLO support, split the driver sta
> data structure to scale for multiple links. This requires changing
> the use of arsta to per link and not per hw which can now
> comprise of multiple links.
> Also since most configurations from mac80211 are done per link,
> do refactoring of the driver functions to apply these configurations
> at link level.
> 
> Split ath12k_sta which is the driver private of ieee80211_sta to store
> link specific information as ath12k_link_sta. For default use cases
> the ath12k_sta will have a preallocated link sta called deflink which will
> be used by non ML STAs and the first link sta of ML STA.
> 
> With MLO Support to be added, remaining link stas will allocated during
> state change where new STA is added. These link stas will be freed when
> STA is deleted.
> 
> 		Current ath12k_sta(arsta) structure
> 
> 	 +-----------------+       +----------------+
> 	 |                 |       |                |
> 	 |   ieee80211_sta |       |  ieee80211_sta |
> 	 |   private data  |       |  private data  |
> 	 |                 |       |                |
> 	 |   ath12k_sta    |       |  ath12k_sta    |
> 	 |   (arsta)       |       |   (arsta)      |
> 	 |+---------------+|       | +-------------+|
> 	 || *arvif (link  ||       | |*arvif (link ||
> 	 || vif of an ar  ||       | | vif of an ar||
> 	 || say 5GHz)     ||       | | say 6GHz)   ||
> 	 |+---------------+|       | +-------------+|
> 	 +-----------------+       +----------------+
> 
> 	Proposed ath12k_sta(ahsta) containing ath12k_link_sta(s) (arsta)
> 	(deflink is preallocated member which is always the first link if
> 	 ieee80211_sta is ML STA and is the only link sta otherwise)
> 
> 		+---------------------------------------+
> 		|         ieee80211_sta                 |
> 		|         private data                  |
> 		|                                       |
> 		|         ath12k_sta (ahsta)            |
> 		| +-------------------------------------+
> 		| | ath12k_link_sta deflink (arsta)     |
> 		| |                                     |
> 		| |  *arvif (link vif of ar (5GHz))     |
> 		| +-------------------------------------+
> 		| +-------------------------------------+
> 		| | ath12k_link_sta *link (arsta)       |
> 		| |                                     |
> 		| |   *arvif (link vif of ar (6GHz))    |
> 		| |                                     |
> 		| +-------------------------------------+
> 		|                                       |
> 		+---------------------------------------+
> 
> To refactor existing ath12k_sta to make use of link stas, following
>  changes are made,
> 
>  1. Limit ieee80211_sta argument mac80211 ops unless otherwise really required.
> 
>  2. ath12k_sta now called by variable name arsta stores multiple
>     arstas(ah12k_link_sta) and also has a back pointer to ath12k_sta
> 
>  3. Pass ath12k_link_sta to mac functions that passed ieee80211_sta arg
>     and fetch ath12k_sta(ahsta) and sta(ieee80211_sta) internally.
>     This is done to avoid passing link id in all the functions and performing
>     validation across these functions.
>     Rather the validation and sta to arsta conversion can be done only at the
>     mac80211 ops.
> 
>  4. In this patchset, only ahsta->deflink is used to be on par with the
>     existing code. When MLO support is added the link id will be used to fetch
>     the arsta.
> 
>  5. Change ath12k_sta_to_arsta() to ath12k_vif_to_ahsta() to fetch the
>     ML level sta. The link sta can be fetched from ahsta->link[], or the
>     deflink can be accessed via ahsta->deflink. API to access link
>     sta (arsta) by passing link_id can be introduced with MLO Support.
> 
>  6. The ieee80211_sta can be accessed from ahsta using ath12k_sta_to_sta()
> 
> 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.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> 
> Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
> Co-developed-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
> Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>