brcmsmac: cleanup in isr code
brcms_c_isr returns true if interrupt was for us and if dpc should be scheduled which is the same thing. Simplify it. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Piotr Haber <phaber@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
c4dea35e34
commit
94d9902dc0
@@ -896,27 +896,22 @@ static void brcms_remove(struct bcma_device *pdev)
|
|||||||
static irqreturn_t brcms_isr(int irq, void *dev_id)
|
static irqreturn_t brcms_isr(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
struct brcms_info *wl;
|
struct brcms_info *wl;
|
||||||
bool ours, wantdpc;
|
irqreturn_t ret = IRQ_NONE;
|
||||||
|
|
||||||
wl = (struct brcms_info *) dev_id;
|
wl = (struct brcms_info *) dev_id;
|
||||||
|
|
||||||
spin_lock(&wl->isr_lock);
|
spin_lock(&wl->isr_lock);
|
||||||
|
|
||||||
/* call common first level interrupt handler */
|
/* call common first level interrupt handler */
|
||||||
ours = brcms_c_isr(wl->wlc, &wantdpc);
|
if (brcms_c_isr(wl->wlc)) {
|
||||||
if (ours) {
|
/* schedule second level handler */
|
||||||
/* if more to do... */
|
tasklet_schedule(&wl->tasklet);
|
||||||
if (wantdpc) {
|
ret = IRQ_HANDLED;
|
||||||
|
|
||||||
/* ...and call the second level interrupt handler */
|
|
||||||
/* schedule dpc */
|
|
||||||
tasklet_schedule(&wl->tasklet);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock(&wl->isr_lock);
|
spin_unlock(&wl->isr_lock);
|
||||||
|
|
||||||
return IRQ_RETVAL(ours);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -2546,10 +2546,6 @@ static inline u32 wlc_intstatus(struct brcms_c_info *wlc, bool in_isr)
|
|||||||
if (macintstatus == 0)
|
if (macintstatus == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* interrupts are already turned off for CFE build
|
|
||||||
* Caution: For CFE Turning off the interrupts again has some undesired
|
|
||||||
* consequences
|
|
||||||
*/
|
|
||||||
/* turn off the interrupts */
|
/* turn off the interrupts */
|
||||||
bcma_write32(core, D11REGOFFS(macintmask), 0);
|
bcma_write32(core, D11REGOFFS(macintmask), 0);
|
||||||
(void)bcma_read32(core, D11REGOFFS(macintmask));
|
(void)bcma_read32(core, D11REGOFFS(macintmask));
|
||||||
@@ -2592,33 +2588,31 @@ bool brcms_c_intrsupd(struct brcms_c_info *wlc)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* First-level interrupt processing.
|
* First-level interrupt processing.
|
||||||
* Return true if this was our interrupt, false otherwise.
|
* Return true if this was our interrupt
|
||||||
* *wantdpc will be set to true if further brcms_c_dpc() processing is required,
|
* and if further brcms_c_dpc() processing is required,
|
||||||
* false otherwise.
|
* false otherwise.
|
||||||
*/
|
*/
|
||||||
bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc)
|
bool brcms_c_isr(struct brcms_c_info *wlc)
|
||||||
{
|
{
|
||||||
struct brcms_hardware *wlc_hw = wlc->hw;
|
struct brcms_hardware *wlc_hw = wlc->hw;
|
||||||
u32 macintstatus;
|
u32 macintstatus;
|
||||||
|
|
||||||
*wantdpc = false;
|
|
||||||
|
|
||||||
if (!wlc_hw->up || !wlc->macintmask)
|
if (!wlc_hw->up || !wlc->macintmask)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* read and clear macintstatus and intstatus registers */
|
/* read and clear macintstatus and intstatus registers */
|
||||||
macintstatus = wlc_intstatus(wlc, true);
|
macintstatus = wlc_intstatus(wlc, true);
|
||||||
|
|
||||||
if (macintstatus == 0xffffffff)
|
if (macintstatus == 0xffffffff) {
|
||||||
brcms_err(wlc_hw->d11core,
|
brcms_err(wlc_hw->d11core,
|
||||||
"DEVICEREMOVED detected in the ISR code path\n");
|
"DEVICEREMOVED detected in the ISR code path\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* it is not for us */
|
/* it is not for us */
|
||||||
if (macintstatus == 0)
|
if (macintstatus == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*wantdpc = true;
|
|
||||||
|
|
||||||
/* save interrupt status bits */
|
/* save interrupt status bits */
|
||||||
wlc->macintstatus = macintstatus;
|
wlc->macintstatus = macintstatus;
|
||||||
|
|
||||||
|
@@ -282,7 +282,7 @@ extern void brcms_c_intrson(struct brcms_c_info *wlc);
|
|||||||
extern u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
|
extern u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
|
||||||
extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
|
extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
|
||||||
extern bool brcms_c_intrsupd(struct brcms_c_info *wlc);
|
extern bool brcms_c_intrsupd(struct brcms_c_info *wlc);
|
||||||
extern bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc);
|
extern bool brcms_c_isr(struct brcms_c_info *wlc);
|
||||||
extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
|
extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
|
||||||
extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
|
extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
|
||||||
struct sk_buff *sdu,
|
struct sk_buff *sdu,
|
||||||
|
Reference in New Issue
Block a user