You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
ath11k: driver for Qualcomm IEEE 802.11ax devices
ath11k is a new driver for Qualcomm IEEE 802.11ax devices, first supporting only IPQ8074 SoC using the shared memory AHB bus. ath11k uses mac80211 and supports AP, Station and Mesh modes. Even though ath11k has some similar code as with ath10k (especially the WMI layer) it was concluded to be simpler to have a "clean start" for ath11k code base and not try to share the code with ath10k. This makes maintenance easier and avoids major changes in ath10k, which would have significantly increased the risk of regressions in existing setups. Even though the driver is very similar with ath10k but there are major differences as well. The datapath is completely different. ath11k supports multiple MACs, called "soc" in the firmware interface. And there's only one WMI interface to support. Currently ath11k supports only IEEE 802.11ac mode, but patches for 802.11ax are available and they will be submitted after ath11k is accepted to upstream. The firmware images are available from ath11k-firmware repository but they will be also submitted to linux-firmware: https://github.com/kvalo/ath11k-firmware This was tested with firmware version WLAN.HK.2.1.0.1-00629-QCAHKSWPL_SILICONZ-1. The driver has had multiple authors who are listed in alphabetical order below. Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org> Signed-off-by: Ganesh Sesetti <gseset@codeaurora.org> Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org> Signed-off-by: kbuild test robot <lkp@intel.com> Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org> Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org> Signed-off-by: Miles Hu <milehu@codeaurora.org> Signed-off-by: Muna Sinada <msinada@codeaurora.org> Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org> Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org> Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: Sriram R <srirrama@codeaurora.org> Signed-off-by: Sven Eckelmann <seckelmann@datto.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
This commit is contained in:
@@ -62,5 +62,6 @@ source "drivers/net/wireless/ath/ar5523/Kconfig"
|
||||
source "drivers/net/wireless/ath/wil6210/Kconfig"
|
||||
source "drivers/net/wireless/ath/ath10k/Kconfig"
|
||||
source "drivers/net/wireless/ath/wcn36xx/Kconfig"
|
||||
source "drivers/net/wireless/ath/ath11k/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
@@ -7,6 +7,7 @@ obj-$(CONFIG_AR5523) += ar5523/
|
||||
obj-$(CONFIG_WIL6210) += wil6210/
|
||||
obj-$(CONFIG_ATH10K) += ath10k/
|
||||
obj-$(CONFIG_WCN36XX) += wcn36xx/
|
||||
obj-$(CONFIG_ATH11K) += ath11k/
|
||||
|
||||
obj-$(CONFIG_ATH_COMMON) += ath.o
|
||||
|
||||
|
||||
35
drivers/net/wireless/ath/ath11k/Kconfig
Normal file
35
drivers/net/wireless/ath/ath11k/Kconfig
Normal file
@@ -0,0 +1,35 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
config ATH11K
|
||||
tristate "Qualcomm Technologies 802.11ax chipset support"
|
||||
depends on MAC80211 && HAS_DMA
|
||||
depends on REMOTEPROC
|
||||
depends on ARCH_QCOM || COMPILE_TEST
|
||||
select ATH_COMMON
|
||||
select QCOM_QMI_HELPERS
|
||||
---help---
|
||||
This module adds support for Qualcomm Technologies 802.11ax family of
|
||||
chipsets.
|
||||
|
||||
If you choose to build a module, it'll be called ath11k.
|
||||
|
||||
config ATH11K_DEBUG
|
||||
bool "QCA ath11k debugging"
|
||||
depends on ATH11K
|
||||
---help---
|
||||
Enables debug support
|
||||
|
||||
If unsure, say Y to make it easier to debug problems.
|
||||
|
||||
config ATH11K_DEBUGFS
|
||||
bool "QCA ath11k debugfs support"
|
||||
depends on ATH11K && DEBUG_FS
|
||||
---help---
|
||||
Enable ath11k debugfs support
|
||||
|
||||
If unsure, say Y to make it easier to debug problems.
|
||||
|
||||
config ATH11K_TRACING
|
||||
bool "ath11k tracing support"
|
||||
depends on ATH11K && EVENT_TRACING
|
||||
---help---
|
||||
Select this to use ath11k tracing infrastructure.
|
||||
26
drivers/net/wireless/ath/ath11k/Makefile
Normal file
26
drivers/net/wireless/ath/ath11k/Makefile
Normal file
@@ -0,0 +1,26 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
obj-$(CONFIG_ATH11K) += ath11k.o
|
||||
ath11k-y += core.o \
|
||||
hal.o \
|
||||
hal_tx.o \
|
||||
hal_rx.o \
|
||||
ahb.o \
|
||||
wmi.o \
|
||||
mac.o \
|
||||
reg.o \
|
||||
htc.o \
|
||||
qmi.o \
|
||||
dp.o \
|
||||
dp_tx.o \
|
||||
dp_rx.o \
|
||||
debug.o \
|
||||
ce.o \
|
||||
peer.o
|
||||
|
||||
ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o
|
||||
ath11k-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
|
||||
ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
|
||||
ath11k-$(CONFIG_ATH11K_TRACING) += trace.o
|
||||
|
||||
# for tracing framework to find trace.h
|
||||
CFLAGS_trace.o := -I$(src)
|
||||
1004
drivers/net/wireless/ath/ath11k/ahb.c
Normal file
1004
drivers/net/wireless/ath/ath11k/ahb.c
Normal file
File diff suppressed because it is too large
Load Diff
35
drivers/net/wireless/ath/ath11k/ahb.h
Normal file
35
drivers/net/wireless/ath/ath11k/ahb.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#ifndef ATH11K_AHB_H
|
||||
#define ATH11K_AHB_H
|
||||
|
||||
#include "core.h"
|
||||
|
||||
#define ATH11K_AHB_RECOVERY_TIMEOUT (3 * HZ)
|
||||
struct ath11k_base;
|
||||
|
||||
static inline u32 ath11k_ahb_read32(struct ath11k_base *ab, u32 offset)
|
||||
{
|
||||
return ioread32(ab->mem + offset);
|
||||
}
|
||||
|
||||
static inline void ath11k_ahb_write32(struct ath11k_base *ab, u32 offset, u32 value)
|
||||
{
|
||||
iowrite32(value, ab->mem + offset);
|
||||
}
|
||||
|
||||
void ath11k_ahb_ext_irq_enable(struct ath11k_base *ab);
|
||||
void ath11k_ahb_ext_irq_disable(struct ath11k_base *ab);
|
||||
int ath11k_ahb_start(struct ath11k_base *ab);
|
||||
void ath11k_ahb_stop(struct ath11k_base *ab);
|
||||
int ath11k_ahb_power_up(struct ath11k_base *ab);
|
||||
void ath11k_ahb_power_down(struct ath11k_base *ab);
|
||||
int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
|
||||
u8 *ul_pipe, u8 *dl_pipe);
|
||||
|
||||
int ath11k_ahb_init(void);
|
||||
void ath11k_ahb_exit(void);
|
||||
|
||||
#endif
|
||||
805
drivers/net/wireless/ath/ath11k/ce.c
Normal file
805
drivers/net/wireless/ath/ath11k/ce.c
Normal file
File diff suppressed because it is too large
Load Diff
178
drivers/net/wireless/ath/ath11k/ce.h
Normal file
178
drivers/net/wireless/ath/ath11k/ce.h
Normal file
@@ -0,0 +1,178 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef ATH11K_CE_H
|
||||
#define ATH11K_CE_H
|
||||
|
||||
#define CE_COUNT 12
|
||||
|
||||
/* Byte swap data words */
|
||||
#define CE_ATTR_BYTE_SWAP_DATA 2
|
||||
|
||||
/* no interrupt on copy completion */
|
||||
#define CE_ATTR_DIS_INTR 8
|
||||
|
||||
/* Host software's Copy Engine configuration. */
|
||||
#ifdef __BIG_ENDIAN
|
||||
#define CE_ATTR_FLAGS CE_ATTR_BYTE_SWAP_DATA
|
||||
#else
|
||||
#define CE_ATTR_FLAGS 0
|
||||
#endif
|
||||
|
||||
/* Threshold to poll for tx completion in case of Interrupt disabled CE's */
|
||||
#define ATH11K_CE_USAGE_THRESHOLD 32
|
||||
|
||||
void ath11k_ce_byte_swap(void *mem, u32 len);
|
||||
|
||||
/*
|
||||
* Directions for interconnect pipe configuration.
|
||||
* These definitions may be used during configuration and are shared
|
||||
* between Host and Target.
|
||||
*
|
||||
* Pipe Directions are relative to the Host, so PIPEDIR_IN means
|
||||
* "coming IN over air through Target to Host" as with a WiFi Rx operation.
|
||||
* Conversely, PIPEDIR_OUT means "going OUT from Host through Target over air"
|
||||
* as with a WiFi Tx operation. This is somewhat awkward for the "middle-man"
|
||||
* Target since things that are "PIPEDIR_OUT" are coming IN to the Target
|
||||
* over the interconnect.
|
||||
*/
|
||||
#define PIPEDIR_NONE 0
|
||||
#define PIPEDIR_IN 1 /* Target-->Host, WiFi Rx direction */
|
||||
#define PIPEDIR_OUT 2 /* Host->Target, WiFi Tx direction */
|
||||
#define PIPEDIR_INOUT 3 /* bidirectional */
|
||||
#define PIPEDIR_INOUT_H2H 4 /* bidirectional, host to host */
|
||||
|
||||
/* CE address/mask */
|
||||
#define CE_HOST_IE_ADDRESS 0x00A1803C
|
||||
#define CE_HOST_IE_2_ADDRESS 0x00A18040
|
||||
#define CE_HOST_IE_3_ADDRESS CE_HOST_IE_ADDRESS
|
||||
|
||||
#define CE_HOST_IE_3_SHIFT 0xC
|
||||
|
||||
#define CE_RING_IDX_INCR(nentries_mask, idx) (((idx) + 1) & (nentries_mask))
|
||||
|
||||
#define ATH11K_CE_RX_POST_RETRY_JIFFIES 50
|
||||
|
||||
struct ath11k_base;
|
||||
|
||||
/* Establish a mapping between a service/direction and a pipe. */
|
||||
struct service_to_pipe {
|
||||
__le32 service_id;
|
||||
__le32 pipedir;
|
||||
__le32 pipenum;
|
||||
};
|
||||
|
||||
/*
|
||||
* Configuration information for a Copy Engine pipe.
|
||||
* Passed from Host to Target during startup (one per CE).
|
||||
*
|
||||
* NOTE: Structure is shared between Host software and Target firmware!
|
||||
*/
|
||||
struct ce_pipe_config {
|
||||
__le32 pipenum;
|
||||
__le32 pipedir;
|
||||
__le32 nentries;
|
||||
__le32 nbytes_max;
|
||||
__le32 flags;
|
||||
__le32 reserved;
|
||||
};
|
||||
|
||||
struct ce_attr {
|
||||
/* CE_ATTR_* values */
|
||||
unsigned int flags;
|
||||
|
||||
/* #entries in source ring - Must be a power of 2 */
|
||||
unsigned int src_nentries;
|
||||
|
||||
/*
|
||||
* Max source send size for this CE.
|
||||
* This is also the minimum size of a destination buffer.
|
||||
*/
|
||||
unsigned int src_sz_max;
|
||||
|
||||
/* #entries in destination ring - Must be a power of 2 */
|
||||
unsigned int dest_nentries;
|
||||
|
||||
void (*recv_cb)(struct ath11k_base *, struct sk_buff *);
|
||||
};
|
||||
|
||||
#define CE_DESC_RING_ALIGN 8
|
||||
|
||||
struct ath11k_ce_ring {
|
||||
/* Number of entries in this ring; must be power of 2 */
|
||||
unsigned int nentries;
|
||||
unsigned int nentries_mask;
|
||||
|
||||
/* For dest ring, this is the next index to be processed
|
||||
* by software after it was/is received into.
|
||||
*
|
||||
* For src ring, this is the last descriptor that was sent
|
||||
* and completion processed by software.
|
||||
*
|
||||
* Regardless of src or dest ring, this is an invariant
|
||||
* (modulo ring size):
|
||||
* write index >= read index >= sw_index
|
||||
*/
|
||||
unsigned int sw_index;
|
||||
/* cached copy */
|
||||
unsigned int write_index;
|
||||
|
||||
/* Start of DMA-coherent area reserved for descriptors */
|
||||
/* Host address space */
|
||||
void *base_addr_owner_space_unaligned;
|
||||
/* CE address space */
|
||||
u32 base_addr_ce_space_unaligned;
|
||||
|
||||
/* Actual start of descriptors.
|
||||
* Aligned to descriptor-size boundary.
|
||||
* Points into reserved DMA-coherent area, above.
|
||||
*/
|
||||
/* Host address space */
|
||||
void *base_addr_owner_space;
|
||||
|
||||
/* CE address space */
|
||||
u32 base_addr_ce_space;
|
||||
|
||||
/* HAL ring id */
|
||||
u32 hal_ring_id;
|
||||
|
||||
/* keep last */
|
||||
struct sk_buff *skb[0];
|
||||
};
|
||||
|
||||
struct ath11k_ce_pipe {
|
||||
struct ath11k_base *ab;
|
||||
u16 pipe_num;
|
||||
unsigned int attr_flags;
|
||||
unsigned int buf_sz;
|
||||
unsigned int rx_buf_needed;
|
||||
|
||||
void (*send_cb)(struct ath11k_ce_pipe *);
|
||||
void (*recv_cb)(struct ath11k_base *, struct sk_buff *);
|
||||
|
||||
struct tasklet_struct intr_tq;
|
||||
struct ath11k_ce_ring *src_ring;
|
||||
struct ath11k_ce_ring *dest_ring;
|
||||
struct ath11k_ce_ring *status_ring;
|
||||
};
|
||||
|
||||
struct ath11k_ce {
|
||||
struct ath11k_ce_pipe ce_pipe[CE_COUNT];
|
||||
/* Protects rings of all ce pipes */
|
||||
spinlock_t ce_lock;
|
||||
};
|
||||
|
||||
void ath11k_ce_cleanup_pipes(struct ath11k_base *ab);
|
||||
void ath11k_ce_rx_replenish_retry(struct timer_list *t);
|
||||
void ath11k_ce_per_engine_service(struct ath11k_base *ab, u16 ce_id);
|
||||
int ath11k_ce_send(struct ath11k_base *ab, struct sk_buff *skb, u8 pipe_id,
|
||||
u16 transfer_id);
|
||||
void ath11k_ce_rx_post_buf(struct ath11k_base *ab);
|
||||
int ath11k_ce_init_pipes(struct ath11k_base *ab);
|
||||
int ath11k_ce_alloc_pipes(struct ath11k_base *ab);
|
||||
void ath11k_ce_free_pipes(struct ath11k_base *ab);
|
||||
int ath11k_ce_get_attr_flags(int ce_id);
|
||||
void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
|
||||
#endif
|
||||
772
drivers/net/wireless/ath/ath11k/core.c
Normal file
772
drivers/net/wireless/ath/ath11k/core.c
Normal file
File diff suppressed because it is too large
Load Diff
823
drivers/net/wireless/ath/ath11k/core.h
Normal file
823
drivers/net/wireless/ath/ath11k/core.h
Normal file
File diff suppressed because it is too large
Load Diff
1060
drivers/net/wireless/ath/ath11k/debug.c
Normal file
1060
drivers/net/wireless/ath/ath11k/debug.c
Normal file
File diff suppressed because it is too large
Load Diff
278
drivers/net/wireless/ath/ath11k/debug.h
Normal file
278
drivers/net/wireless/ath/ath11k/debug.h
Normal file
@@ -0,0 +1,278 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _ATH11K_DEBUG_H_
|
||||
#define _ATH11K_DEBUG_H_
|
||||
|
||||
#include "hal_tx.h"
|
||||
#include "trace.h"
|
||||
|
||||
enum ath11k_debug_mask {
|
||||
ATH11K_DBG_AHB = 0x00000001,
|
||||
ATH11K_DBG_WMI = 0x00000002,
|
||||
ATH11K_DBG_HTC = 0x00000004,
|
||||
ATH11K_DBG_DP_HTT = 0x00000008,
|
||||
ATH11K_DBG_MAC = 0x00000010,
|
||||
ATH11K_DBG_BOOT = 0x00000020,
|
||||
ATH11K_DBG_QMI = 0x00000040,
|
||||
ATH11K_DBG_DATA = 0x00000080,
|
||||
ATH11K_DBG_MGMT = 0x00000100,
|
||||
ATH11K_DBG_REG = 0x00000200,
|
||||
ATH11K_DBG_TESTMODE = 0x00000400,
|
||||
ATH11k_DBG_HAL = 0x00000800,
|
||||
ATH11K_DBG_ANY = 0xffffffff,
|
||||
};
|
||||
|
||||
/* htt_dbg_ext_stats_type */
|
||||
enum ath11k_dbg_htt_ext_stats_type {
|
||||
ATH11K_DBG_HTT_EXT_STATS_RESET = 0,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_TX = 1,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_RX = 2,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_HWQ = 3,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED = 4,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_ERROR = 5,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_TQM = 6,
|
||||
ATH11K_DBG_HTT_EXT_STATS_TQM_CMDQ = 7,
|
||||
ATH11K_DBG_HTT_EXT_STATS_TX_DE_INFO = 8,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_RATE = 9,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_RX_RATE = 10,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PEER_INFO = 11,
|
||||
ATH11K_DBG_HTT_EXT_STATS_TX_SELFGEN_INFO = 12,
|
||||
ATH11K_DBG_HTT_EXT_STATS_TX_MU_HWQ = 13,
|
||||
ATH11K_DBG_HTT_EXT_STATS_RING_IF_INFO = 14,
|
||||
ATH11K_DBG_HTT_EXT_STATS_SRNG_INFO = 15,
|
||||
ATH11K_DBG_HTT_EXT_STATS_SFM_INFO = 16,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_MU = 17,
|
||||
ATH11K_DBG_HTT_EXT_STATS_ACTIVE_PEERS_LIST = 18,
|
||||
ATH11K_DBG_HTT_EXT_STATS_PDEV_CCA_STATS = 19,
|
||||
ATH11K_DBG_HTT_EXT_STATS_TWT_SESSIONS = 20,
|
||||
ATH11K_DBG_HTT_EXT_STATS_REO_RESOURCE_STATS = 21,
|
||||
ATH11K_DBG_HTT_EXT_STATS_TX_SOUNDING_INFO = 22,
|
||||
|
||||
/* keep this last */
|
||||
ATH11K_DBG_HTT_NUM_EXT_STATS,
|
||||
};
|
||||
|
||||
struct debug_htt_stats_req {
|
||||
bool done;
|
||||
u8 pdev_id;
|
||||
u8 type;
|
||||
u8 peer_addr[ETH_ALEN];
|
||||
struct completion cmpln;
|
||||
u32 buf_len;
|
||||
u8 buf[0];
|
||||
};
|
||||
|
||||
#define ATH11K_HTT_STATS_BUF_SIZE (1024 * 512)
|
||||
|
||||
#define ATH11K_FW_STATS_BUF_SIZE (1024 * 1024)
|
||||
|
||||
#define ATH11K_HTT_PKTLOG_MAX_SIZE 2048
|
||||
|
||||
enum ath11k_pktlog_filter {
|
||||
ATH11K_PKTLOG_RX = 0x000000001,
|
||||
ATH11K_PKTLOG_TX = 0x000000002,
|
||||
ATH11K_PKTLOG_RCFIND = 0x000000004,
|
||||
ATH11K_PKTLOG_RCUPDATE = 0x000000008,
|
||||
ATH11K_PKTLOG_EVENT_SMART_ANT = 0x000000020,
|
||||
ATH11K_PKTLOG_EVENT_SW = 0x000000040,
|
||||
ATH11K_PKTLOG_ANY = 0x00000006f,
|
||||
};
|
||||
|
||||
enum ath11k_pktlog_mode {
|
||||
ATH11K_PKTLOG_MODE_LITE = 1,
|
||||
ATH11K_PKTLOG_MODE_FULL = 2,
|
||||
};
|
||||
|
||||
enum ath11k_pktlog_enum {
|
||||
ATH11K_PKTLOG_TYPE_TX_CTRL = 1,
|
||||
ATH11K_PKTLOG_TYPE_TX_STAT = 2,
|
||||
ATH11K_PKTLOG_TYPE_TX_MSDU_ID = 3,
|
||||
ATH11K_PKTLOG_TYPE_RX_STAT = 5,
|
||||
ATH11K_PKTLOG_TYPE_RC_FIND = 6,
|
||||
ATH11K_PKTLOG_TYPE_RC_UPDATE = 7,
|
||||
ATH11K_PKTLOG_TYPE_TX_VIRT_ADDR = 8,
|
||||
ATH11K_PKTLOG_TYPE_RX_CBF = 10,
|
||||
ATH11K_PKTLOG_TYPE_RX_STATBUF = 22,
|
||||
ATH11K_PKTLOG_TYPE_PPDU_STATS = 23,
|
||||
ATH11K_PKTLOG_TYPE_LITE_RX = 24,
|
||||
};
|
||||
|
||||
__printf(2, 3) void ath11k_info(struct ath11k_base *ab, const char *fmt, ...);
|
||||
__printf(2, 3) void ath11k_err(struct ath11k_base *ab, const char *fmt, ...);
|
||||
__printf(2, 3) void ath11k_warn(struct ath11k_base *ab, const char *fmt, ...);
|
||||
|
||||
extern unsigned int ath11k_debug_mask;
|
||||
|
||||
#ifdef CONFIG_ATH11K_DEBUG
|
||||
__printf(3, 4) void __ath11k_dbg(struct ath11k_base *ab,
|
||||
enum ath11k_debug_mask mask,
|
||||
const char *fmt, ...);
|
||||
void ath11k_dbg_dump(struct ath11k_base *ab,
|
||||
enum ath11k_debug_mask mask,
|
||||
const char *msg, const char *prefix,
|
||||
const void *buf, size_t len);
|
||||
#else /* CONFIG_ATH11K_DEBUG */
|
||||
static inline int __ath11k_dbg(struct ath11k_base *ab,
|
||||
enum ath11k_debug_mask dbg_mask,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ath11k_dbg_dump(struct ath11k_base *ab,
|
||||
enum ath11k_debug_mask mask,
|
||||
const char *msg, const char *prefix,
|
||||
const void *buf, size_t len)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_ATH11K_DEBUG */
|
||||
|
||||
#ifdef CONFIG_ATH11K_DEBUGFS
|
||||
int ath11k_debug_soc_create(struct ath11k_base *ab);
|
||||
void ath11k_debug_soc_destroy(struct ath11k_base *ab);
|
||||
int ath11k_debug_pdev_create(struct ath11k_base *ab);
|
||||
void ath11k_debug_pdev_destroy(struct ath11k_base *ab);
|
||||
int ath11k_debug_register(struct ath11k *ar);
|
||||
void ath11k_debug_unregister(struct ath11k *ar);
|
||||
void ath11k_dbg_htt_ext_stats_handler(struct ath11k_base *ab,
|
||||
struct sk_buff *skb);
|
||||
void ath11k_debug_fw_stats_process(struct ath11k_base *ab, struct sk_buff *skb);
|
||||
|
||||
void ath11k_debug_fw_stats_init(struct ath11k *ar);
|
||||
int ath11k_dbg_htt_stats_req(struct ath11k *ar);
|
||||
|
||||
static inline bool ath11k_debug_is_pktlog_lite_mode_enabled(struct ath11k *ar)
|
||||
{
|
||||
return (ar->debug.pktlog_mode == ATH11K_PKTLOG_MODE_LITE);
|
||||
}
|
||||
|
||||
static inline bool ath11k_debug_is_pktlog_rx_stats_enabled(struct ath11k *ar)
|
||||
{
|
||||
return (!ar->debug.pktlog_peer_valid && ar->debug.pktlog_mode);
|
||||
}
|
||||
|
||||
static inline bool ath11k_debug_is_pktlog_peer_valid(struct ath11k *ar, u8 *addr)
|
||||
{
|
||||
return (ar->debug.pktlog_peer_valid && ar->debug.pktlog_mode &&
|
||||
ether_addr_equal(addr, ar->debug.pktlog_peer_addr));
|
||||
}
|
||||
|
||||
static inline int ath11k_debug_is_extd_tx_stats_enabled(struct ath11k *ar)
|
||||
{
|
||||
return ar->debug.extd_tx_stats;
|
||||
}
|
||||
|
||||
static inline int ath11k_debug_is_extd_rx_stats_enabled(struct ath11k *ar)
|
||||
{
|
||||
return ar->debug.extd_rx_stats;
|
||||
}
|
||||
#else
|
||||
static inline int ath11k_debug_soc_create(struct ath11k_base *ab)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ath11k_debug_soc_destroy(struct ath11k_base *ab)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int ath11k_debug_pdev_create(struct ath11k_base *ab)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ath11k_debug_pdev_destroy(struct ath11k_base *ab)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int ath11k_debug_register(struct ath11k *ar)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ath11k_debug_unregister(struct ath11k *ar)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void ath11k_dbg_htt_ext_stats_handler(struct ath11k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void ath11k_debug_fw_stats_process(struct ath11k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void ath11k_debug_fw_stats_init(struct ath11k *ar)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int ath11k_debug_is_extd_tx_stats_enabled(struct ath11k *ar)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ath11k_debug_is_extd_rx_stats_enabled(struct ath11k *ar)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ath11k_dbg_htt_stats_req(struct ath11k *ar)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool ath11k_debug_is_pktlog_lite_mode_enabled(struct ath11k *ar)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool ath11k_debug_is_pktlog_rx_stats_enabled(struct ath11k *ar)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool ath11k_debug_is_pktlog_peer_valid(struct ath11k *ar, u8 *addr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_ATH11K_DEBUGFS */
|
||||
|
||||
#ifdef CONFIG_MAC80211_DEBUGFS
|
||||
void ath11k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, struct dentry *dir);
|
||||
void
|
||||
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
|
||||
struct ath11k_per_peer_tx_stats *peer_stats,
|
||||
u8 legacy_rate_idx);
|
||||
void ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
|
||||
struct sk_buff *msdu,
|
||||
struct hal_tx_status *ts);
|
||||
#else /* !CONFIG_MAC80211_DEBUGFS */
|
||||
static inline void
|
||||
ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
|
||||
struct ath11k_per_peer_tx_stats *peer_stats,
|
||||
u8 legacy_rate_idx)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
ath11k_update_per_peer_stats_from_txcompl(struct ath11k *ar,
|
||||
struct sk_buff *msdu,
|
||||
struct hal_tx_status *ts)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MAC80211_DEBUGFS*/
|
||||
|
||||
#define ath11k_dbg(ar, dbg_mask, fmt, ...) \
|
||||
do { \
|
||||
if (ath11k_debug_mask & dbg_mask) \
|
||||
__ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif /* _ATH11K_DEBUG_H_ */
|
||||
4432
drivers/net/wireless/ath/ath11k/debug_htt_stats.c
Normal file
4432
drivers/net/wireless/ath/ath11k/debug_htt_stats.c
Normal file
File diff suppressed because it is too large
Load Diff
1620
drivers/net/wireless/ath/ath11k/debug_htt_stats.h
Normal file
1620
drivers/net/wireless/ath/ath11k/debug_htt_stats.h
Normal file
File diff suppressed because it is too large
Load Diff
538
drivers/net/wireless/ath/ath11k/debugfs_sta.c
Normal file
538
drivers/net/wireless/ath/ath11k/debugfs_sta.c
Normal file
File diff suppressed because it is too large
Load Diff
898
drivers/net/wireless/ath/ath11k/dp.c
Normal file
898
drivers/net/wireless/ath/ath11k/dp.c
Normal file
File diff suppressed because it is too large
Load Diff
1526
drivers/net/wireless/ath/ath11k/dp.h
Normal file
1526
drivers/net/wireless/ath/ath11k/dp.h
Normal file
File diff suppressed because it is too large
Load Diff
4143
drivers/net/wireless/ath/ath11k/dp_rx.c
Normal file
4143
drivers/net/wireless/ath/ath11k/dp_rx.c
Normal file
File diff suppressed because it is too large
Load Diff
84
drivers/net/wireless/ath/ath11k/dp_rx.h
Normal file
84
drivers/net/wireless/ath/ath11k/dp_rx.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#ifndef ATH11K_DP_RX_H
|
||||
#define ATH11K_DP_RX_H
|
||||
|
||||
#include "core.h"
|
||||
#include "rx_desc.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define DP_RX_MPDU_ERR_FCS BIT(0)
|
||||
#define DP_RX_MPDU_ERR_DECRYPT BIT(1)
|
||||
#define DP_RX_MPDU_ERR_TKIP_MIC BIT(2)
|
||||
#define DP_RX_MPDU_ERR_AMSDU_ERR BIT(3)
|
||||
#define DP_RX_MPDU_ERR_OVERFLOW BIT(4)
|
||||
#define DP_RX_MPDU_ERR_MSDU_LEN BIT(5)
|
||||
#define DP_RX_MPDU_ERR_MPDU_LEN BIT(6)
|
||||
#define DP_RX_MPDU_ERR_UNENCRYPTED_FRAME BIT(7)
|
||||
|
||||
enum dp_rx_decap_type {
|
||||
DP_RX_DECAP_TYPE_RAW,
|
||||
DP_RX_DECAP_TYPE_NATIVE_WIFI,
|
||||
DP_RX_DECAP_TYPE_ETHERNET2_DIX,
|
||||
DP_RX_DECAP_TYPE_8023,
|
||||
};
|
||||
|
||||
struct ath11k_dp_amsdu_subframe_hdr {
|
||||
u8 dst[ETH_ALEN];
|
||||
u8 src[ETH_ALEN];
|
||||
__be16 len;
|
||||
} __packed;
|
||||
|
||||
struct ath11k_dp_rfc1042_hdr {
|
||||
u8 llc_dsap;
|
||||
u8 llc_ssap;
|
||||
u8 llc_ctrl;
|
||||
u8 snap_oui[3];
|
||||
__be16 snap_type;
|
||||
} __packed;
|
||||
|
||||
int ath11k_dp_rx_ampdu_start(struct ath11k *ar,
|
||||
struct ieee80211_ampdu_params *params);
|
||||
int ath11k_dp_rx_ampdu_stop(struct ath11k *ar,
|
||||
struct ieee80211_ampdu_params *params);
|
||||
void ath11k_peer_rx_tid_cleanup(struct ath11k *ar, struct ath11k_peer *peer);
|
||||
int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id,
|
||||
u8 tid, u32 ba_win_sz, u16 ssn);
|
||||
void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,
|
||||
struct sk_buff *skb);
|
||||
int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int pdev_idx);
|
||||
void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int pdev_idx);
|
||||
void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab);
|
||||
void ath11k_dp_process_reo_status(struct ath11k_base *ab);
|
||||
int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget);
|
||||
int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab,
|
||||
struct napi_struct *napi, int budget);
|
||||
int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,
|
||||
int budget);
|
||||
int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,
|
||||
struct napi_struct *napi, struct sk_buff_head *pending_q,
|
||||
int budget);
|
||||
int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id,
|
||||
struct dp_rxdma_ring *rx_ring,
|
||||
int req_entries,
|
||||
enum hal_rx_buf_return_buf_manager mgr,
|
||||
gfp_t gfp);
|
||||
int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len,
|
||||
int (*iter)(struct ath11k_base *ar, u16 tag, u16 len,
|
||||
const void *ptr, void *data),
|
||||
void *data);
|
||||
int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id,
|
||||
struct napi_struct *napi, int budget);
|
||||
int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
|
||||
struct napi_struct *napi, int budget);
|
||||
int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id,
|
||||
struct dp_rxdma_ring *rx_ring,
|
||||
int req_entries,
|
||||
enum hal_rx_buf_return_buf_manager mgr,
|
||||
gfp_t gfp);
|
||||
int ath11k_dp_rx_pdev_mon_detach(struct ath11k *ar);
|
||||
int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar);
|
||||
|
||||
#endif /* ATH11K_DP_RX_H */
|
||||
943
drivers/net/wireless/ath/ath11k/dp_tx.c
Normal file
943
drivers/net/wireless/ath/ath11k/dp_tx.c
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user