Commit b2cf8d48 authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman

Staging: rtl8192e: Clean up rtl8192_interrupt formatting

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bf3c45f0
...@@ -6179,144 +6179,134 @@ static void __exit rtl8192_pci_module_exit(void) ...@@ -6179,144 +6179,134 @@ static void __exit rtl8192_pci_module_exit(void)
ieee80211_rtl_exit(); ieee80211_rtl_exit();
} }
//warning message WB
static irqreturn_t rtl8192_interrupt(int irq, void *netdev) static irqreturn_t rtl8192_interrupt(int irq, void *netdev)
{ {
struct net_device *dev = (struct net_device *) netdev; struct net_device *dev = (struct net_device *) netdev;
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
unsigned long flags; unsigned long flags;
u32 inta; u32 inta;
/* We should return IRQ_NONE, but for now let me keep this */
if(priv->irq_enabled == 0){
return IRQ_HANDLED;
}
spin_lock_irqsave(&priv->irq_th_lock,flags); /* We should return IRQ_NONE, but for now let me keep this */
if (priv->irq_enabled == 0)
return IRQ_HANDLED;
//ISR: 4bytes spin_lock_irqsave(&priv->irq_th_lock,flags);
inta = read_nic_dword(dev, ISR);// & priv->IntrMask; /* ISR: 4bytes */
write_nic_dword(dev,ISR,inta); // reset int situation
priv->stats.shints++; inta = read_nic_dword(dev, ISR); /* & priv->IntrMask; */
//DMESG("Enter interrupt, ISR value = 0x%08x", inta); write_nic_dword(dev, ISR, inta); /* reset int situation */
if(!inta){
spin_unlock_irqrestore(&priv->irq_th_lock,flags);
return IRQ_HANDLED;
/*
most probably we can safely return IRQ_NONE,
but for now is better to avoid problems
*/
}
if(inta == 0xffff){ priv->stats.shints++;
/* HW disappared */ if (!inta) {
spin_unlock_irqrestore(&priv->irq_th_lock,flags); spin_unlock_irqrestore(&priv->irq_th_lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} /*
* most probably we can safely return IRQ_NONE,
* but for now is better to avoid problems
*/
}
priv->stats.ints++; if (inta == 0xffff) {
/* HW disappared */
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
return IRQ_HANDLED;
}
priv->stats.ints++;
#ifdef DEBUG_IRQ #ifdef DEBUG_IRQ
DMESG("NIC irq %x",inta); DMESG("NIC irq %x",inta);
#endif #endif
//priv->irqpending = inta;
if(!netif_running(dev)) {
spin_unlock_irqrestore(&priv->irq_th_lock,flags);
return IRQ_HANDLED;
}
if(inta & IMR_TIMEOUT0){
// write_nic_dword(dev, TimerInt, 0);
//DMESG("=================>waking up");
// rtl8180_hw_wakeup(dev);
}
if(inta & IMR_TBDOK){ if (!netif_running(dev)) {
RT_TRACE(COMP_INTR, "beacon ok interrupt!\n"); spin_unlock_irqrestore(&priv->irq_th_lock, flags);
rtl8192_tx_isr(dev, BEACON_QUEUE); return IRQ_HANDLED;
priv->stats.txbeaconokint++; }
}
if(inta & IMR_TBDER){ if (inta & IMR_TBDOK) {
RT_TRACE(COMP_INTR, "beacon ok interrupt!\n"); RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
rtl8192_tx_isr(dev, BEACON_QUEUE); rtl8192_tx_isr(dev, BEACON_QUEUE);
priv->stats.txbeaconerr++; priv->stats.txbeaconokint++;
} }
if(inta & IMR_MGNTDOK ) { if (inta & IMR_TBDER) {
RT_TRACE(COMP_INTR, "Manage ok interrupt!\n"); RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
priv->stats.txmanageokint++; rtl8192_tx_isr(dev, BEACON_QUEUE);
rtl8192_tx_isr(dev,MGNT_QUEUE); priv->stats.txbeaconerr++;
}
} if (inta & IMR_MGNTDOK ) {
RT_TRACE(COMP_INTR, "Manage ok interrupt!\n");
priv->stats.txmanageokint++;
rtl8192_tx_isr(dev,MGNT_QUEUE);
}
if(inta & IMR_COMDOK) if (inta & IMR_COMDOK)
{ {
priv->stats.txcmdpktokint++; priv->stats.txcmdpktokint++;
rtl8192_tx_isr(dev,TXCMD_QUEUE); rtl8192_tx_isr(dev, TXCMD_QUEUE);
} }
if(inta & IMR_ROK){ if (inta & IMR_ROK) {
#ifdef DEBUG_RX #ifdef DEBUG_RX
DMESG("Frame arrived !"); DMESG("Frame arrived !");
#endif #endif
priv->stats.rxint++; priv->stats.rxint++;
tasklet_schedule(&priv->irq_rx_tasklet); tasklet_schedule(&priv->irq_rx_tasklet);
} }
if(inta & IMR_BcnInt) { if (inta & IMR_BcnInt) {
RT_TRACE(COMP_INTR, "prepare beacon for interrupt!\n"); RT_TRACE(COMP_INTR, "prepare beacon for interrupt!\n");
tasklet_schedule(&priv->irq_prepare_beacon_tasklet); tasklet_schedule(&priv->irq_prepare_beacon_tasklet);
} }
if(inta & IMR_RDU){ if (inta & IMR_RDU) {
RT_TRACE(COMP_INTR, "rx descriptor unavailable!\n"); RT_TRACE(COMP_INTR, "rx descriptor unavailable!\n");
priv->stats.rxrdu++; priv->stats.rxrdu++;
/* reset int situation */ /* reset int situation */
write_nic_dword(dev,INTA_MASK,read_nic_dword(dev, INTA_MASK) & ~IMR_RDU); write_nic_dword(dev, INTA_MASK, read_nic_dword(dev, INTA_MASK) & ~IMR_RDU);
tasklet_schedule(&priv->irq_rx_tasklet); tasklet_schedule(&priv->irq_rx_tasklet);
} }
if(inta & IMR_RXFOVW){ if (inta & IMR_RXFOVW) {
RT_TRACE(COMP_INTR, "rx overflow !\n"); RT_TRACE(COMP_INTR, "rx overflow !\n");
priv->stats.rxoverflow++; priv->stats.rxoverflow++;
tasklet_schedule(&priv->irq_rx_tasklet); tasklet_schedule(&priv->irq_rx_tasklet);
} }
if(inta & IMR_TXFOVW) priv->stats.txoverflow++; if (inta & IMR_TXFOVW)
priv->stats.txoverflow++;
if(inta & IMR_BKDOK){ if (inta & IMR_BKDOK) {
RT_TRACE(COMP_INTR, "BK Tx OK interrupt!\n"); RT_TRACE(COMP_INTR, "BK Tx OK interrupt!\n");
priv->stats.txbkokint++; priv->stats.txbkokint++;
priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++;
rtl8192_tx_isr(dev,BK_QUEUE); rtl8192_tx_isr(dev, BK_QUEUE);
} }
if(inta & IMR_BEDOK){ if (inta & IMR_BEDOK) {
RT_TRACE(COMP_INTR, "BE TX OK interrupt!\n"); RT_TRACE(COMP_INTR, "BE TX OK interrupt!\n");
priv->stats.txbeokint++; priv->stats.txbeokint++;
priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++;
rtl8192_tx_isr(dev,BE_QUEUE); rtl8192_tx_isr(dev, BE_QUEUE);
} }
if(inta & IMR_VIDOK){ if (inta & IMR_VIDOK) {
RT_TRACE(COMP_INTR, "VI TX OK interrupt!\n"); RT_TRACE(COMP_INTR, "VI TX OK interrupt!\n");
priv->stats.txviokint++; priv->stats.txviokint++;
priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++;
rtl8192_tx_isr(dev,VI_QUEUE); rtl8192_tx_isr(dev, VI_QUEUE);
} }
if(inta & IMR_VODOK){ if (inta & IMR_VODOK) {
priv->stats.txvookint++; priv->stats.txvookint++;
priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++; priv->ieee80211->LinkDetectInfo.NumTxOkInPeriod++;
rtl8192_tx_isr(dev,VO_QUEUE); rtl8192_tx_isr(dev, VO_QUEUE);
} }
spin_unlock_irqrestore(&priv->irq_th_lock,flags); spin_unlock_irqrestore(&priv->irq_th_lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
void EnableHWSecurityConfig8192(struct net_device *dev) void EnableHWSecurityConfig8192(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment