git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
net
/
tulip
/
interrupt.c
diff --git
a/drivers/net/tulip/interrupt.c
b/drivers/net/tulip/interrupt.c
index
cb0e304
..
bb35581
100644
(file)
--- a/
drivers/net/tulip/interrupt.c
+++ b/
drivers/net/tulip/interrupt.c
@@
-14,10
+14,10
@@
*/
*/
+#include <linux/pci.h>
#include "tulip.h"
#include <linux/config.h>
#include <linux/etherdevice.h>
#include "tulip.h"
#include <linux/config.h>
#include <linux/etherdevice.h>
-#include <linux/pci.h>
int tulip_rx_copybreak;
unsigned int tulip_max_interrupt_work;
int tulip_rx_copybreak;
unsigned int tulip_max_interrupt_work;
@@
-26,7
+26,7
@@
unsigned int tulip_max_interrupt_work;
#define MIT_SIZE 15
#define MIT_TABLE 15 /* We use 0 or max */
#define MIT_SIZE 15
#define MIT_TABLE 15 /* We use 0 or max */
-unsigned int mit_table[MIT_SIZE+1] =
+
static
unsigned int mit_table[MIT_SIZE+1] =
{
/* CRS11 21143 hardware Mitigation Control Interrupt
We use only RX mitigation we other techniques for
{
/* CRS11 21143 hardware Mitigation Control Interrupt
We use only RX mitigation we other techniques for
@@
-78,7
+78,7
@@
int tulip_refill_rx(struct net_device *dev)
if (skb == NULL)
break;
if (skb == NULL)
break;
- mapping = pci_map_single(tp->pdev, skb->
tail
, PKT_BUF_SZ,
+ mapping = pci_map_single(tp->pdev, skb->
data
, PKT_BUF_SZ,
PCI_DMA_FROMDEVICE);
tp->rx_buffers[entry].mapping = mapping;
PCI_DMA_FROMDEVICE);
tp->rx_buffers[entry].mapping = mapping;
@@
-89,11
+89,11
@@
int tulip_refill_rx(struct net_device *dev)
tp->rx_ring[entry].status = cpu_to_le32(DescOwned);
}
if(tp->chip_id == LC82C168) {
tp->rx_ring[entry].status = cpu_to_le32(DescOwned);
}
if(tp->chip_id == LC82C168) {
- if(((i
nl(dev
->base_addr + CSR5)>>17)&0x07) == 4) {
+ if(((i
oread32(tp
->base_addr + CSR5)>>17)&0x07) == 4) {
/* Rx stopped due to out of buffers,
* restart it
*/
/* Rx stopped due to out of buffers,
* restart it
*/
-
outl(0x01, dev
->base_addr + CSR2);
+
iowrite32(0x01, tp
->base_addr + CSR2);
}
}
return refilled;
}
}
return refilled;
@@
-133,8
+133,12
@@
int tulip_poll(struct net_device *dev, int *budget)
tp->rx_ring[entry].status);
do {
tp->rx_ring[entry].status);
do {
+ if (ioread32(tp->base_addr + CSR5) == 0xffffffff) {
+ printk(KERN_DEBUG " In tulip_poll(), hardware disappeared.\n");
+ break;
+ }
/* Acknowledge current RX interrupt sources. */
/* Acknowledge current RX interrupt sources. */
-
outl((RxIntr | RxNoBuf), dev
->base_addr + CSR5);
+
iowrite32((RxIntr | RxNoBuf), tp
->base_addr + CSR5);
/* If we own the next entry, it is a new packet. Send it up. */
/* If we own the next entry, it is a new packet. Send it up. */
@@
-195,12
+199,12
@@
int tulip_poll(struct net_device *dev, int *budget)
tp->rx_buffers[entry].mapping,
pkt_len, PCI_DMA_FROMDEVICE);
#if ! defined(__alpha__)
tp->rx_buffers[entry].mapping,
pkt_len, PCI_DMA_FROMDEVICE);
#if ! defined(__alpha__)
- eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->
tail
,
+ eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->
data
,
pkt_len, 0);
skb_put(skb, pkt_len);
#else
memcpy(skb_put(skb, pkt_len),
pkt_len, 0);
skb_put(skb, pkt_len);
#else
memcpy(skb_put(skb, pkt_len),
- tp->rx_buffers[entry].skb->
tail
,
+ tp->rx_buffers[entry].skb->
data
,
pkt_len);
#endif
pci_dma_sync_single_for_device(tp->pdev,
pkt_len);
#endif
pci_dma_sync_single_for_device(tp->pdev,
@@
-254,7
+258,7
@@
int tulip_poll(struct net_device *dev, int *budget)
* No idea how to fix this if "playing with fire" will fail
* tomorrow (night 011029). If it will not fail, we won
* finally: amount of IO did not increase at all. */
* No idea how to fix this if "playing with fire" will fail
* tomorrow (night 011029). If it will not fail, we won
* finally: amount of IO did not increase at all. */
- } while ((i
nl(dev
->base_addr + CSR5) & RxIntr));
+ } while ((i
oread32(tp
->base_addr + CSR5) & RxIntr));
done:
done:
@@
-281,13
+285,13
@@
done:
if( received > 1 ) {
if( ! tp->mit_on ) {
tp->mit_on = 1;
if( received > 1 ) {
if( ! tp->mit_on ) {
tp->mit_on = 1;
-
outl(mit_table[MIT_TABLE], dev
->base_addr + CSR11);
+
iowrite32(mit_table[MIT_TABLE], tp
->base_addr + CSR11);
}
}
else {
if( tp->mit_on ) {
tp->mit_on = 0;
}
}
else {
if( tp->mit_on ) {
tp->mit_on = 0;
-
outl(0, dev
->base_addr + CSR11);
+
iowrite32(0, tp
->base_addr + CSR11);
}
}
}
}
}
}
@@
-305,7
+309,7
@@
done:
/* Remove us from polling list and enable RX intr. */
netif_rx_complete(dev);
/* Remove us from polling list and enable RX intr. */
netif_rx_complete(dev);
-
outl(tulip_tbl[tp->chip_id].valid_intrs, dev
->base_addr+CSR7);
+
iowrite32(tulip_tbl[tp->chip_id].valid_intrs, tp
->base_addr+CSR7);
/* The last op happens after poll completion. Which means the following:
* 1. it can race with disabling irqs in irq handler
/* The last op happens after poll completion. Which means the following:
* 1. it can race with disabling irqs in irq handler
@@
-419,12
+423,12
@@
static int tulip_rx(struct net_device *dev)
tp->rx_buffers[entry].mapping,
pkt_len, PCI_DMA_FROMDEVICE);
#if ! defined(__alpha__)
tp->rx_buffers[entry].mapping,
pkt_len, PCI_DMA_FROMDEVICE);
#if ! defined(__alpha__)
- eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->
tail
,
+ eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->
data
,
pkt_len, 0);
skb_put(skb, pkt_len);
#else
memcpy(skb_put(skb, pkt_len),
pkt_len, 0);
skb_put(skb, pkt_len);
#else
memcpy(skb_put(skb, pkt_len),
- tp->rx_buffers[entry].skb->
tail
,
+ tp->rx_buffers[entry].skb->
data
,
pkt_len);
#endif
pci_dma_sync_single_for_device(tp->pdev,
pkt_len);
#endif
pci_dma_sync_single_for_device(tp->pdev,
@@
-470,19
+474,19
@@
static int tulip_rx(struct net_device *dev)
static inline unsigned int phy_interrupt (struct net_device *dev)
{
#ifdef __hppa__
static inline unsigned int phy_interrupt (struct net_device *dev)
{
#ifdef __hppa__
- int csr12 = inl(dev->base_addr + CSR12) & 0xff;
struct tulip_private *tp = netdev_priv(dev);
struct tulip_private *tp = netdev_priv(dev);
+ int csr12 = ioread32(tp->base_addr + CSR12) & 0xff;
if (csr12 != tp->csr12_shadow) {
/* ack interrupt */
if (csr12 != tp->csr12_shadow) {
/* ack interrupt */
-
outl(csr12 | 0x02, dev
->base_addr + CSR12);
+
iowrite32(csr12 | 0x02, tp
->base_addr + CSR12);
tp->csr12_shadow = csr12;
/* do link change stuff */
spin_lock(&tp->lock);
tulip_check_duplex(dev);
spin_unlock(&tp->lock);
/* clear irq ack bit */
tp->csr12_shadow = csr12;
/* do link change stuff */
spin_lock(&tp->lock);
tulip_check_duplex(dev);
spin_unlock(&tp->lock);
/* clear irq ack bit */
-
outl(csr12 & ~0x02, dev
->base_addr + CSR12);
+
iowrite32(csr12 & ~0x02, tp
->base_addr + CSR12);
return 1;
}
return 1;
}
@@
-497,7
+501,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *)dev_instance;
struct tulip_private *tp = netdev_priv(dev);
{
struct net_device *dev = (struct net_device *)dev_instance;
struct tulip_private *tp = netdev_priv(dev);
-
long ioaddr = dev
->base_addr;
+
void __iomem *ioaddr = tp
->base_addr;
int csr5;
int missed;
int rx = 0;
int csr5;
int missed;
int rx = 0;
@@
-515,7
+519,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
unsigned int handled = 0;
/* Let's see whether the interrupt really is for us */
unsigned int handled = 0;
/* Let's see whether the interrupt really is for us */
- csr5 = i
nl
(ioaddr + CSR5);
+ csr5 = i
oread32
(ioaddr + CSR5);
if (tp->flags & HAS_PHY_IRQ)
handled = phy_interrupt (dev);
if (tp->flags & HAS_PHY_IRQ)
handled = phy_interrupt (dev);
@@
-532,7
+536,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (!rxd && (csr5 & (RxIntr | RxNoBuf))) {
rxd++;
/* Mask RX intrs and add the device to poll list. */
if (!rxd && (csr5 & (RxIntr | RxNoBuf))) {
rxd++;
/* Mask RX intrs and add the device to poll list. */
-
outl
(tulip_tbl[tp->chip_id].valid_intrs&~RxPollInt, ioaddr + CSR7);
+
iowrite32
(tulip_tbl[tp->chip_id].valid_intrs&~RxPollInt, ioaddr + CSR7);
netif_rx_schedule(dev);
if (!(csr5&~(AbnormalIntr|NormalIntr|RxPollInt|TPLnkPass)))
netif_rx_schedule(dev);
if (!(csr5&~(AbnormalIntr|NormalIntr|RxPollInt|TPLnkPass)))
@@
-542,11
+546,11
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
/* Acknowledge the interrupt sources we handle here ASAP
the poll function does Rx and RxNoBuf acking */
/* Acknowledge the interrupt sources we handle here ASAP
the poll function does Rx and RxNoBuf acking */
-
outl
(csr5 & 0x0001ff3f, ioaddr + CSR5);
+
iowrite32
(csr5 & 0x0001ff3f, ioaddr + CSR5);
#else
/* Acknowledge all of the current interrupt sources ASAP. */
#else
/* Acknowledge all of the current interrupt sources ASAP. */
-
outl
(csr5 & 0x0001ffff, ioaddr + CSR5);
+
iowrite32
(csr5 & 0x0001ffff, ioaddr + CSR5);
if (csr5 & (RxIntr | RxNoBuf)) {
if (csr5 & (RxIntr | RxNoBuf)) {
@@
-558,7
+562,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (tulip_debug > 4)
printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x.\n",
if (tulip_debug > 4)
printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x.\n",
- dev->name, csr5, i
nl(dev->base_
addr + CSR5));
+ dev->name, csr5, i
oread32(io
addr + CSR5));
if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) {
if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) {
@@
-633,7
+637,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (tulip_debug > 2)
printk(KERN_WARNING "%s: The transmitter stopped."
" CSR5 is %x, CSR6 %x, new CSR6 %x.\n",
if (tulip_debug > 2)
printk(KERN_WARNING "%s: The transmitter stopped."
" CSR5 is %x, CSR6 %x, new CSR6 %x.\n",
- dev->name, csr5, i
nl
(ioaddr + CSR6), tp->csr6);
+ dev->name, csr5, i
oread32
(ioaddr + CSR6), tp->csr6);
tulip_restart_rxtx(tp);
}
spin_unlock(&tp->lock);
tulip_restart_rxtx(tp);
}
spin_unlock(&tp->lock);
@@
-651,16
+655,16
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
tp->csr6 |= 0x00200000; /* Store-n-forward. */
/* Restart the transmit process. */
tulip_restart_rxtx(tp);
tp->csr6 |= 0x00200000; /* Store-n-forward. */
/* Restart the transmit process. */
tulip_restart_rxtx(tp);
-
outl
(0, ioaddr + CSR1);
+
iowrite32
(0, ioaddr + CSR1);
}
if (csr5 & (RxDied | RxNoBuf)) {
if (tp->flags & COMET_MAC_ADDR) {
}
if (csr5 & (RxDied | RxNoBuf)) {
if (tp->flags & COMET_MAC_ADDR) {
-
outl
(tp->mc_filter[0], ioaddr + 0xAC);
-
outl
(tp->mc_filter[1], ioaddr + 0xB0);
+
iowrite32
(tp->mc_filter[0], ioaddr + 0xAC);
+
iowrite32
(tp->mc_filter[1], ioaddr + 0xB0);
}
}
if (csr5 & RxDied) { /* Missed a Rx frame. */
}
}
if (csr5 & RxDied) { /* Missed a Rx frame. */
- tp->stats.rx_missed_errors += i
nl
(ioaddr + CSR8) & 0xffff;
+ tp->stats.rx_missed_errors += i
oread32
(ioaddr + CSR8) & 0xffff;
tp->stats.rx_errors++;
tulip_start_rxtx(tp);
}
tp->stats.rx_errors++;
tulip_start_rxtx(tp);
}
@@
-688,7
+692,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
dev->name, tp->nir, error);
}
/* Clear all error sources, included undocumented ones! */
dev->name, tp->nir, error);
}
/* Clear all error sources, included undocumented ones! */
-
outl
(0x0800f7ba, ioaddr + CSR5);
+
iowrite32
(0x0800f7ba, ioaddr + CSR5);
oi++;
}
if (csr5 & TimerInt) {
oi++;
}
if (csr5 & TimerInt) {
@@
-696,7
+700,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (tulip_debug > 2)
printk(KERN_ERR "%s: Re-enabling interrupts, %8.8x.\n",
dev->name, csr5);
if (tulip_debug > 2)
printk(KERN_ERR "%s: Re-enabling interrupts, %8.8x.\n",
dev->name, csr5);
-
outl
(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
+
iowrite32
(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
tp->ttimer = 0;
oi++;
}
tp->ttimer = 0;
oi++;
}
@@
-706,20
+710,20
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
"csr5=0x%8.8x. (%lu) (%d,%d,%d)\n", dev->name, csr5, tp->nir, tx, rx, oi);
/* Acknowledge all interrupt sources. */
"csr5=0x%8.8x. (%lu) (%d,%d,%d)\n", dev->name, csr5, tp->nir, tx, rx, oi);
/* Acknowledge all interrupt sources. */
-
outl
(0x8001ffff, ioaddr + CSR5);
+
iowrite32
(0x8001ffff, ioaddr + CSR5);
if (tp->flags & HAS_INTR_MITIGATION) {
/* Josip Loncaric at ICASE did extensive experimentation
to develop a good interrupt mitigation setting.*/
if (tp->flags & HAS_INTR_MITIGATION) {
/* Josip Loncaric at ICASE did extensive experimentation
to develop a good interrupt mitigation setting.*/
-
outl
(0x8b240000, ioaddr + CSR11);
+
iowrite32
(0x8b240000, ioaddr + CSR11);
} else if (tp->chip_id == LC82C168) {
/* the LC82C168 doesn't have a hw timer.*/
} else if (tp->chip_id == LC82C168) {
/* the LC82C168 doesn't have a hw timer.*/
-
outl
(0x00, ioaddr + CSR7);
+
iowrite32
(0x00, ioaddr + CSR7);
mod_timer(&tp->timer, RUN_AT(HZ/50));
} else {
/* Mask all interrupting sources, set timer to
re-enable. */
mod_timer(&tp->timer, RUN_AT(HZ/50));
} else {
/* Mask all interrupting sources, set timer to
re-enable. */
-
outl
(((~csr5) & 0x0001ebef) | AbnormalIntr | TimerInt, ioaddr + CSR7);
-
outl
(0x0012, ioaddr + CSR11);
+
iowrite32
(((~csr5) & 0x0001ebef) | AbnormalIntr | TimerInt, ioaddr + CSR7);
+
iowrite32
(0x0012, ioaddr + CSR11);
}
break;
}
}
break;
}
@@
-728,7
+732,7
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (work_count == 0)
break;
if (work_count == 0)
break;
- csr5 = i
nl
(ioaddr + CSR5);
+ csr5 = i
oread32
(ioaddr + CSR5);
#ifdef CONFIG_TULIP_NAPI
if (rxd)
#ifdef CONFIG_TULIP_NAPI
if (rxd)
@@
-754,29
+758,29
@@
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (tulip_debug > 1)
printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx);
if (tp->chip_id == LC82C168) {
if (tulip_debug > 1)
printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx);
if (tp->chip_id == LC82C168) {
-
outl
(0x00, ioaddr + CSR7);
+
iowrite32
(0x00, ioaddr + CSR7);
mod_timer(&tp->timer, RUN_AT(HZ/50));
} else {
mod_timer(&tp->timer, RUN_AT(HZ/50));
} else {
- if (tp->ttimer == 0 || (i
nl
(ioaddr + CSR11) & 0xffff) == 0) {
+ if (tp->ttimer == 0 || (i
oread32
(ioaddr + CSR11) & 0xffff) == 0) {
if (tulip_debug > 1)
printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir);
if (tulip_debug > 1)
printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir);
-
outl
(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
+
iowrite32
(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
ioaddr + CSR7);
ioaddr + CSR7);
-
outl
(TimerInt, ioaddr + CSR5);
-
outl
(12, ioaddr + CSR11);
+
iowrite32
(TimerInt, ioaddr + CSR5);
+
iowrite32
(12, ioaddr + CSR11);
tp->ttimer = 1;
}
}
}
#endif /* CONFIG_TULIP_NAPI */
tp->ttimer = 1;
}
}
}
#endif /* CONFIG_TULIP_NAPI */
- if ((missed = i
nl
(ioaddr + CSR8) & 0x1ffff)) {
+ if ((missed = i
oread32
(ioaddr + CSR8) & 0x1ffff)) {
tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed;
}
if (tulip_debug > 4)
printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n",
tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed;
}
if (tulip_debug > 4)
printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n",
- dev->name, i
nl
(ioaddr + CSR5));
+ dev->name, i
oread32
(ioaddr + CSR5));
return IRQ_HANDLED;
}
return IRQ_HANDLED;
}