Currently, the calculation of ack signal strength is incorrect. This is because before calculating the ack signal strength, ath11k need to determine whether the hardware and firmware support db2dbm. If the hardware and firmware support db2dbm, do not need to add noise floor, otherwise, need to add noise floor. Besides, the value of ack_rssi passed by firmware to ath11k should be a signed number, so change its type to s8. After that, "iw wlan0 station dump" show the correct ack signal strength. Such as: root@CDCCSTEX0799733-LIN:~# iw wlp88s0 station dump Station 00:03:7f:12:df:df (on wlp88s0) inactive time: 75 ms rx bytes: 11599 rx packets: 99 tx bytes: 9029 tx packets: 81 tx retries: 4 tx failed: 0 rx drop misc: 2 signal: -16 dBm signal avg: -24 dBm tx bitrate: 1560.0 MBit/s VHT-MCS 9 80MHz VHT-NSS 4 tx duration: 9230 us rx bitrate: 1560.0 MBit/s VHT-MCS 9 80MHz VHT-NSS 4 rx duration: 7201 us last ack signal:-23 dBm avg ack signal: -22 dBm Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://patch.msgid.link/20240611022550.59078-1-quic_lingbok@quicinc.com
74 lines
2.1 KiB
C
74 lines
2.1 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
|
/*
|
|
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
|
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef ATH11K_HAL_TX_H
|
|
#define ATH11K_HAL_TX_H
|
|
|
|
#include "hal_desc.h"
|
|
#include "core.h"
|
|
|
|
#define HAL_TX_ADDRX_EN 1
|
|
#define HAL_TX_ADDRY_EN 2
|
|
|
|
#define HAL_TX_ADDR_SEARCH_DEFAULT 0
|
|
#define HAL_TX_ADDR_SEARCH_INDEX 1
|
|
|
|
struct hal_tx_info {
|
|
u16 meta_data_flags; /* %HAL_TCL_DATA_CMD_INFO0_META_ */
|
|
u8 ring_id;
|
|
u32 desc_id;
|
|
enum hal_tcl_desc_type type;
|
|
enum hal_tcl_encap_type encap_type;
|
|
dma_addr_t paddr;
|
|
u32 data_len;
|
|
u32 pkt_offset;
|
|
enum hal_encrypt_type encrypt_type;
|
|
u32 flags0; /* %HAL_TCL_DATA_CMD_INFO1_ */
|
|
u32 flags1; /* %HAL_TCL_DATA_CMD_INFO2_ */
|
|
u16 addr_search_flags; /* %HAL_TCL_DATA_CMD_INFO0_ADDR(X/Y)_ */
|
|
u16 bss_ast_hash;
|
|
u16 bss_ast_idx;
|
|
u8 tid;
|
|
u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */
|
|
u8 lmac_id;
|
|
u8 dscp_tid_tbl_idx;
|
|
bool enable_mesh;
|
|
u8 rbm_id;
|
|
};
|
|
|
|
/* TODO: Check if the actual desc macros can be used instead */
|
|
#define HAL_TX_STATUS_FLAGS_FIRST_MSDU BIT(0)
|
|
#define HAL_TX_STATUS_FLAGS_LAST_MSDU BIT(1)
|
|
#define HAL_TX_STATUS_FLAGS_MSDU_IN_AMSDU BIT(2)
|
|
#define HAL_TX_STATUS_FLAGS_RATE_STATS_VALID BIT(3)
|
|
#define HAL_TX_STATUS_FLAGS_RATE_LDPC BIT(4)
|
|
#define HAL_TX_STATUS_FLAGS_RATE_STBC BIT(5)
|
|
#define HAL_TX_STATUS_FLAGS_OFDMA BIT(6)
|
|
|
|
#define HAL_TX_STATUS_DESC_LEN sizeof(struct hal_wbm_release_ring)
|
|
|
|
/* Tx status parsed from srng desc */
|
|
struct hal_tx_status {
|
|
enum hal_wbm_rel_src_module buf_rel_source;
|
|
enum hal_wbm_tqm_rel_reason status;
|
|
s8 ack_rssi;
|
|
u32 flags; /* %HAL_TX_STATUS_FLAGS_ */
|
|
u32 ppdu_id;
|
|
u8 try_cnt;
|
|
u8 tid;
|
|
u16 peer_id;
|
|
u32 rate_stats;
|
|
};
|
|
|
|
void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,
|
|
struct hal_tx_info *ti);
|
|
void ath11k_hal_tx_set_dscp_tid_map(struct ath11k_base *ab, int id);
|
|
int ath11k_hal_reo_cmd_send(struct ath11k_base *ab, struct hal_srng *srng,
|
|
enum hal_reo_cmd_type type,
|
|
struct ath11k_hal_reo_cmd *cmd);
|
|
void ath11k_hal_tx_init_data_ring(struct ath11k_base *ab,
|
|
struct hal_srng *srng);
|
|
#endif
|