include/linux/soc/airoha/airoha_offload.h
Source file repositories/reference/linux-study-clean/include/linux/soc/airoha/airoha_offload.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/soc/airoha/airoha_offload.h- Extension
.h- Size
- 8667 bytes
- Lines
- 318
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/skbuff.hlinux/spinlock.hlinux/workqueue.h
Detected Declarations
struct airoha_ppe_devstruct airoha_npu_rx_dma_descstruct airoha_npu_tx_dma_descstruct airoha_npustruct airoha_npu_coreenum airoha_npu_wlan_set_cmdenum airoha_npu_wlan_get_cmdfunction airoha_ppe_dev_setup_tc_block_cbfunction airoha_ppe_dev_check_skbfunction airoha_ppe_put_devfunction airoha_ppe_dev_check_skbfunction airoha_npu_wlan_init_reserved_memoryfunction airoha_npu_wlan_send_msgfunction airoha_npu_wlan_get_msgfunction airoha_npu_wlan_get_queue_addrfunction airoha_npu_wlan_set_irq_statusfunction airoha_npu_wlan_get_irq_statusfunction airoha_npu_wlan_enable_irqfunction airoha_npu_wlan_disable_irqfunction airoha_npu_putfunction airoha_npu_wlan_send_msgfunction airoha_npu_wlan_get_msgfunction airoha_npu_wlan_get_queue_addrfunction airoha_npu_wlan_set_irq_statusfunction airoha_npu_wlan_enable_irq
Annotated Snippet
struct airoha_ppe_dev {
struct {
int (*setup_tc_block_cb)(struct airoha_ppe_dev *dev,
void *type_data);
void (*check_skb)(struct airoha_ppe_dev *dev,
struct sk_buff *skb, u16 hash,
bool rx_wlan);
} ops;
void *priv;
};
#if (IS_BUILTIN(CONFIG_NET_AIROHA) || IS_MODULE(CONFIG_NET_AIROHA))
struct airoha_ppe_dev *airoha_ppe_get_dev(struct device *dev);
void airoha_ppe_put_dev(struct airoha_ppe_dev *dev);
static inline int airoha_ppe_dev_setup_tc_block_cb(struct airoha_ppe_dev *dev,
void *type_data)
{
return dev->ops.setup_tc_block_cb(dev, type_data);
}
static inline void airoha_ppe_dev_check_skb(struct airoha_ppe_dev *dev,
struct sk_buff *skb,
u16 hash, bool rx_wlan)
{
dev->ops.check_skb(dev, skb, hash, rx_wlan);
}
#else
static inline struct airoha_ppe_dev *airoha_ppe_get_dev(struct device *dev)
{
return NULL;
}
static inline void airoha_ppe_put_dev(struct airoha_ppe_dev *dev)
{
}
static inline int airoha_ppe_dev_setup_tc_block_cb(struct airoha_ppe_dev *dev,
void *type_data)
{
return -EOPNOTSUPP;
}
static inline void airoha_ppe_dev_check_skb(struct airoha_ppe_dev *dev,
struct sk_buff *skb, u16 hash,
bool rx_wlan)
{
}
#endif
#define NPU_NUM_CORES 8
#define NPU_NUM_IRQ 6
#define NPU_RX0_DESC_NUM 512
#define NPU_RX1_DESC_NUM 512
/* CTRL */
#define NPU_RX_DMA_DESC_LAST_MASK BIT(29)
#define NPU_RX_DMA_DESC_LEN_MASK GENMASK(28, 15)
#define NPU_RX_DMA_DESC_CUR_LEN_MASK GENMASK(14, 1)
#define NPU_RX_DMA_DESC_DONE_MASK BIT(0)
/* INFO */
#define NPU_RX_DMA_PKT_COUNT_MASK GENMASK(31, 29)
#define NPU_RX_DMA_PKT_ID_MASK GENMASK(28, 26)
#define NPU_RX_DMA_SRC_PORT_MASK GENMASK(25, 21)
#define NPU_RX_DMA_CRSN_MASK GENMASK(20, 16)
#define NPU_RX_DMA_FOE_ID_MASK GENMASK(15, 0)
/* DATA */
#define NPU_RX_DMA_SID_MASK GENMASK(31, 16)
#define NPU_RX_DMA_FRAG_TYPE_MASK GENMASK(15, 14)
#define NPU_RX_DMA_PRIORITY_MASK GENMASK(13, 10)
#define NPU_RX_DMA_RADIO_ID_MASK GENMASK(9, 6)
#define NPU_RX_DMA_VAP_ID_MASK GENMASK(5, 2)
#define NPU_RX_DMA_FRAME_TYPE_MASK GENMASK(1, 0)
struct airoha_npu_rx_dma_desc {
u32 ctrl;
u32 info;
u32 data;
u32 addr;
u64 rsv;
} __packed;
/* CTRL */
#define NPU_TX_DMA_DESC_SCHED_MASK BIT(31)
#define NPU_TX_DMA_DESC_LEN_MASK GENMASK(30, 18)
#define NPU_TX_DMA_DESC_VEND_LEN_MASK GENMASK(17, 1)
#define NPU_TX_DMA_DESC_DONE_MASK BIT(0)
#define NPU_TXWI_LEN 192
Annotation
- Immediate include surface: `linux/skbuff.h`, `linux/spinlock.h`, `linux/workqueue.h`.
- Detected declarations: `struct airoha_ppe_dev`, `struct airoha_npu_rx_dma_desc`, `struct airoha_npu_tx_dma_desc`, `struct airoha_npu`, `struct airoha_npu_core`, `enum airoha_npu_wlan_set_cmd`, `enum airoha_npu_wlan_get_cmd`, `function airoha_ppe_dev_setup_tc_block_cb`, `function airoha_ppe_dev_check_skb`, `function airoha_ppe_put_dev`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.