hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
 ******************************************************************************
 *
 * @file rwnx_irqs.c
 *
 * Copyright (C) RivieraWaves 2012-2019
 *
 ******************************************************************************
 */
#include <linux/interrupt.h>
 
#include "rwnx_defs.h"
#include "ipc_host.h"
#include "rwnx_prof.h"
 
/**
 * rwnx_irq_hdlr - IRQ handler
 *
 * Handler registerd by the platform driver
 */
irqreturn_t rwnx_irq_hdlr(int irq, void *dev_id)
{
   struct rwnx_hw *rwnx_hw = (struct rwnx_hw *)dev_id;
   disable_irq_nosync(irq);
   tasklet_schedule(&rwnx_hw->task);
   return IRQ_HANDLED;
}
 
/**
 * rwnx_task - Bottom half for IRQ handler
 *
 * Read irq status and process accordingly
 */
void rwnx_task(unsigned long data)
{
   struct rwnx_hw *rwnx_hw = (struct rwnx_hw *)data;
 
#if 0
   struct rwnx_plat *rwnx_plat = rwnx_hw->plat;
   u32 status, statuses = 0;
 
   /* Ack unconditionnally in case ipc_host_get_status does not see the irq */
   rwnx_plat->ack_irq(rwnx_plat);
 
   while ((status = ipc_host_get_status(rwnx_hw->ipc_env))) {
       statuses |= status;
       /* All kinds of IRQs will be handled in one shot (RX, MSG, DBG, ...)
        * this will ack IPC irqs not the cfpga irqs */
       ipc_host_irq(rwnx_hw->ipc_env, status);
 
       rwnx_plat->ack_irq(rwnx_plat);
   }
#endif
   //if (statuses & IPC_IRQ_E2A_RXDESC)
   //    rwnx_hw->stats.last_rx = now;
   //if (statuses & IPC_IRQ_E2A_TXCFM)
   //    rwnx_hw->stats.last_tx = now;
 
   spin_lock_bh(&rwnx_hw->tx_lock);
   rwnx_hwq_process_all(rwnx_hw);
   spin_unlock_bh(&rwnx_hw->tx_lock);
#if 0
   enable_irq(rwnx_platform_get_irq(rwnx_plat));
#endif
}