net: airoha: Add airoha_ppe_dev struct definition

Introduce airoha_ppe_dev struct as container for PPE offload callbacks
consumed by the MT76 driver during flowtable offload for traffic
received by the wlan NIC and forwarded to the wired one.
Add airoha_ppe_setup_tc_block_cb routine to PPE offload ops for MT76
driver.
Rely on airoha_ppe_dev pointer in airoha_ppe_setup_tc_block_cb
signature.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250823-airoha-en7581-wlan-rx-offload-v3-2-f78600ec3ed8@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Lorenzo Bianconi
2025-08-23 09:56:03 +02:00
committed by Jakub Kicinski
parent 524a43c3a0
commit f45fc18b6d
5 changed files with 104 additions and 7 deletions

View File

@@ -9,6 +9,41 @@
#include <linux/spinlock.h>
#include <linux/workqueue.h>
struct airoha_ppe_dev {
struct {
int (*setup_tc_block_cb)(struct airoha_ppe_dev *dev,
void *type_data);
} 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);
}
#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_setup_tc_block_cb(struct airoha_ppe_dev *dev,
void *type_data)
{
return -EOPNOTSUPP;
}
#endif
#define NPU_NUM_CORES 8
#define NPU_NUM_IRQ 6
#define NPU_RX0_DESC_NUM 512