mbox series

[v4,00/11] wifi: ath12k: some fixes and clean up for monitor mode

Message ID 20241017031056.1714-1-quic_kangyang@quicinc.com
Headers show
Series wifi: ath12k: some fixes and clean up for monitor mode | expand

Message

Kang Yang Oct. 17, 2024, 3:10 a.m. UTC
This patch set does some fixes and clean up for monitor mode.

v4: rebase on tag: ath/main(ath-202410161539).
v3: rebase on tag: ath/main(ath-202410111606).
v2: rebase on tag: ath-202410072115.

Kang Yang (11):
  wifi: ath12k: remove unused variable monitor_present
  wifi: ath12k: optimize storage size for struct ath12k
  wifi: ath12k: fix struct hal_rx_ppdu_end_user_stats
  wifi: ath12k: fix struct hal_rx_ppdu_start
  wifi: ath12k: fix struct hal_rx_phyrx_rssi_legacy_info
  wifi: ath12k: fix struct hal_rx_mpdu_start
  wifi: ath12k: properly handling the state variables of monitor mode
  wifi: ath12k: delete NSS and TX power setting for monitor vdev
  wifi: ath12k: use tail MSDU to get MSDU information
  wifi: ath12k: fix A-MSDU indication in monitor mode
  wifi: ath12k: delete mon reap timer

 drivers/net/wireless/ath/ath12k/core.c   |   5 ++
 drivers/net/wireless/ath/ath12k/core.h   |  23 +++--
 drivers/net/wireless/ath/ath12k/dp.c     |  25 ------
 drivers/net/wireless/ath/ath12k/dp_mon.c | 107 +++++++++++++----------
 drivers/net/wireless/ath/ath12k/hal_rx.h |  53 ++++++-----
 drivers/net/wireless/ath/ath12k/mac.c    |  24 +++--
 6 files changed, 115 insertions(+), 122 deletions(-)


base-commit: fa934bf3e0a825ee09f035c6580af513187d59a2

Comments

Jeff Johnson Oct. 17, 2024, 8:40 p.m. UTC | #1
On 10/16/2024 8:10 PM, Kang Yang wrote:
> Current struct hal_rx_ppdu_start in hal_rx.h is not matched with
> hardware descriptor definition.
> 
> So update this structure and related code.
> 
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> 
> Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
> ---
>  drivers/net/wireless/ath/ath12k/dp_mon.c | 16 ++++++++++++----
>  drivers/net/wireless/ath/ath12k/hal_rx.h | 11 ++++++++---
>  2 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
> index 8aef25c0d98b..86796efe5acd 100644
> --- a/drivers/net/wireless/ath/ath12k/dp_mon.c
> +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
> @@ -593,12 +593,20 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
>  		struct hal_rx_ppdu_start *ppdu_start =
>  			(struct hal_rx_ppdu_start *)tlv_data;
>  
> +		u64 ppdu_ts = __le32_to_cpu(ppdu_start->ppdu_start_ts_31_0) |
> +			(u64)(__le32_to_cpu(ppdu_start->ppdu_start_ts_63_32)) << 32;

a recent debugfs change introduced ath12k_le32hilo_to_u64()
https://lore.kernel.org/all/20241014065259.3968727-1-quic_rdevanat@quicinc.com/

but this is currently static within debugfs_htt_stats.c

perhaps we should move this into a header files and make it inline so that it
can be shared with this code

> +
>  		info[0] = __le32_to_cpu(ppdu_start->info0);
>  
> -		ppdu_info->ppdu_id =
> -			u32_get_bits(info[0], HAL_RX_PPDU_START_INFO0_PPDU_ID);
> -		ppdu_info->chan_num = __le32_to_cpu(ppdu_start->chan_num);
> -		ppdu_info->ppdu_ts = __le32_to_cpu(ppdu_start->ppdu_start_ts);
> +		ppdu_info->ppdu_id = u32_get_bits(info[0],
> +						  HAL_RX_PPDU_START_INFO0_PPDU_ID);
> +
> +		info[1] = __le32_to_cpu(ppdu_start->info1);
> +		ppdu_info->chan_num = u32_get_bits(info[1],
> +						   HAL_RX_PPDU_START_INFO1_CHAN_NUM);
> +		ppdu_info->freq = u32_get_bits(info[1],
> +					       HAL_RX_PPDU_START_INFO1_CHAN_FREQ);
> +		ppdu_info->ppdu_ts = ppdu_ts;
>  
>  		if (ppdu_info->ppdu_id != ppdu_info->last_ppdu_id) {
>  			ppdu_info->last_ppdu_id = ppdu_info->ppdu_id;
> diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.h b/drivers/net/wireless/ath/ath12k/hal_rx.h
> index 837ba4adba88..6ab33d5f1b2a 100644
> --- a/drivers/net/wireless/ath/ath12k/hal_rx.h
> +++ b/drivers/net/wireless/ath/ath12k/hal_rx.h
> @@ -156,6 +156,7 @@ struct hal_rx_mon_ppdu_info {
>  	u32 preamble_type;
>  	u32 mpdu_len;
>  	u16 chan_num;
> +	u16 freq;
>  	u16 tcp_msdu_count;
>  	u16 tcp_ack_msdu_count;
>  	u16 udp_msdu_count;
> @@ -232,12 +233,16 @@ struct hal_rx_mon_ppdu_info {
>  	u8 medium_prot_type;
>  };
>  
> -#define HAL_RX_PPDU_START_INFO0_PPDU_ID		GENMASK(15, 0)
> +#define HAL_RX_PPDU_START_INFO0_PPDU_ID			GENMASK(15, 0)
> +#define HAL_RX_PPDU_START_INFO1_CHAN_NUM		GENMASK(15, 0)
> +#define HAL_RX_PPDU_START_INFO1_CHAN_FREQ		GENMASK(31, 16)
>  
>  struct hal_rx_ppdu_start {
>  	__le32 info0;
> -	__le32 chan_num;
> -	__le32 ppdu_start_ts;
> +	__le32 info1;
> +	__le32 ppdu_start_ts_31_0;
> +	__le32 ppdu_start_ts_63_32;
> +	__le32 rsvd[2];
>  } __packed;
>  
>  #define HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR	GENMASK(26, 16)