mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
net: airoha: npu: Add wlan irq management callbacks
Introduce callbacks used by the MT76 driver to configure NPU SoC interrupts. This is a preliminary patch to enable wlan flowtable offload for EN7581 SoC with MT76 driver. Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20250811-airoha-en7581-wlan-offlaod-v7-4-58823603bb4e@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
f97fc66185
commit
03b7ca3ee5
|
|
@ -520,6 +520,29 @@ static u32 airoha_npu_wlan_queue_addr_get(struct airoha_npu *npu, int qid,
|
|||
return REG_RX_BASE(qid);
|
||||
}
|
||||
|
||||
static void airoha_npu_wlan_irq_status_set(struct airoha_npu *npu, u32 val)
|
||||
{
|
||||
regmap_write(npu->regmap, REG_IRQ_STATUS, val);
|
||||
}
|
||||
|
||||
static u32 airoha_npu_wlan_irq_status_get(struct airoha_npu *npu, int q)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
regmap_read(npu->regmap, REG_IRQ_STATUS, &val);
|
||||
return val;
|
||||
}
|
||||
|
||||
static void airoha_npu_wlan_irq_enable(struct airoha_npu *npu, int q)
|
||||
{
|
||||
regmap_set_bits(npu->regmap, REG_IRQ_RXDONE(q), NPU_IRQ_RX_MASK(q));
|
||||
}
|
||||
|
||||
static void airoha_npu_wlan_irq_disable(struct airoha_npu *npu, int q)
|
||||
{
|
||||
regmap_clear_bits(npu->regmap, REG_IRQ_RXDONE(q), NPU_IRQ_RX_MASK(q));
|
||||
}
|
||||
|
||||
struct airoha_npu *airoha_npu_get(struct device *dev, dma_addr_t *stats_addr)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
|
|
@ -627,6 +650,10 @@ static int airoha_npu_probe(struct platform_device *pdev)
|
|||
npu->ops.wlan_send_msg = airoha_npu_wlan_msg_send;
|
||||
npu->ops.wlan_get_msg = airoha_npu_wlan_msg_get;
|
||||
npu->ops.wlan_get_queue_addr = airoha_npu_wlan_queue_addr_get;
|
||||
npu->ops.wlan_set_irq_status = airoha_npu_wlan_irq_status_set;
|
||||
npu->ops.wlan_get_irq_status = airoha_npu_wlan_irq_status_get;
|
||||
npu->ops.wlan_enable_irq = airoha_npu_wlan_irq_enable;
|
||||
npu->ops.wlan_disable_irq = airoha_npu_wlan_irq_disable;
|
||||
|
||||
npu->regmap = devm_regmap_init_mmio(dev, base, ®map_config);
|
||||
if (IS_ERR(npu->regmap))
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ struct airoha_npu {
|
|||
void *data, int data_len, gfp_t gfp);
|
||||
u32 (*wlan_get_queue_addr)(struct airoha_npu *npu, int qid,
|
||||
bool xmit);
|
||||
void (*wlan_set_irq_status)(struct airoha_npu *npu, u32 val);
|
||||
u32 (*wlan_get_irq_status)(struct airoha_npu *npu, int q);
|
||||
void (*wlan_enable_irq)(struct airoha_npu *npu, int q);
|
||||
void (*wlan_disable_irq)(struct airoha_npu *npu, int q);
|
||||
} ops;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user