git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mwl8k: disable softirqs when accessing sta_notify_list
[safe/jmp/linux-2.6]
/
drivers
/
net
/
3c507.c
diff --git
a/drivers/net/3c507.c
b/drivers/net/3c507.c
index
fbbaf82
..
fbc2311
100644
(file)
--- a/
drivers/net/3c507.c
+++ b/
drivers/net/3c507.c
@@
-284,7
+284,8
@@
static unsigned short init_words[] = {
static int el16_probe1(struct net_device *dev, int ioaddr);
static int el16_open(struct net_device *dev);
static int el16_probe1(struct net_device *dev, int ioaddr);
static int el16_open(struct net_device *dev);
-static int el16_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t el16_send_packet(struct sk_buff *skb,
+ struct net_device *dev);
static irqreturn_t el16_interrupt(int irq, void *dev_id);
static void el16_rx(struct net_device *dev);
static int el16_close(struct net_device *dev);
static irqreturn_t el16_interrupt(int irq, void *dev_id);
static void el16_rx(struct net_device *dev);
static int el16_close(struct net_device *dev);
@@
-364,7
+365,7
@@
static const struct net_device_ops netdev_ops = {
static int __init el16_probe1(struct net_device *dev, int ioaddr)
{
static int __init el16_probe1(struct net_device *dev, int ioaddr)
{
- static unsigned char init_ID_done
, version_printed
;
+ static unsigned char init_ID_done;
int i, irq, irqval, retval;
struct net_local *lp;
int i, irq, irqval, retval;
struct net_local *lp;
@@
-391,19
+392,17
@@
static int __init el16_probe1(struct net_device *dev, int ioaddr)
goto out;
}
goto out;
}
- if (net_debug && version_printed++ == 0)
- printk(version);
-
- printk("%s: 3c507 at %#x,", dev->name, ioaddr);
+ pr_info("%s: 3c507 at %#x,", dev->name, ioaddr);
/* We should make a few more checks here, like the first three octets of
the S.A. for the manufacturer's code. */
irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
/* We should make a few more checks here, like the first three octets of
the S.A. for the manufacturer's code. */
irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
- irqval = request_irq(irq,
&
el16_interrupt, 0, DRV_NAME, dev);
+ irqval = request_irq(irq, el16_interrupt, 0, DRV_NAME, dev);
if (irqval) {
if (irqval) {
- printk(KERN_ERR "3c507: unable to get IRQ %d (irqval=%d).\n", irq, irqval);
+ pr_cont("\n");
+ pr_err("3c507: unable to get IRQ %d (irqval=%d).\n", irq, irqval);
retval = -EAGAIN;
goto out;
}
retval = -EAGAIN;
goto out;
}
@@
-414,7
+413,7
@@
static int __init el16_probe1(struct net_device *dev, int ioaddr)
outb(0x01, ioaddr + MISC_CTRL);
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + i);
outb(0x01, ioaddr + MISC_CTRL);
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + i);
- pr
intk
(" %pM", dev->dev_addr);
+ pr
_cont
(" %pM", dev->dev_addr);
if (mem_start)
net_debug = mem_start & 7;
if (mem_start)
net_debug = mem_start & 7;
@@
-443,18
+442,18
@@
static int __init el16_probe1(struct net_device *dev, int ioaddr)
dev->if_port = (inb(ioaddr + ROM_CONFIG) & 0x80) ? 1 : 0;
dev->irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
dev->if_port = (inb(ioaddr + ROM_CONFIG) & 0x80) ? 1 : 0;
dev->irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
- pr
intk
(", IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->irq,
+ pr
_cont
(", IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->irq,
dev->if_port ? "ex" : "in", dev->mem_start, dev->mem_end-1);
if (net_debug)
dev->if_port ? "ex" : "in", dev->mem_start, dev->mem_end-1);
if (net_debug)
- pr
intk(
version);
+ pr
_debug("%s",
version);
lp = netdev_priv(dev);
memset(lp, 0, sizeof(*lp));
spin_lock_init(&lp->lock);
lp->base = ioremap(dev->mem_start, RX_BUF_END);
if (!lp->base) {
lp = netdev_priv(dev);
memset(lp, 0, sizeof(*lp));
spin_lock_init(&lp->lock);
lp->base = ioremap(dev->mem_start, RX_BUF_END);
if (!lp->base) {
- pr
intk(KERN_ERR
"3c507: unable to remap memory\n");
+ pr
_err(
"3c507: unable to remap memory\n");
retval = -EAGAIN;
goto out1;
}
retval = -EAGAIN;
goto out1;
}
@@
-488,20
+487,20
@@
static void el16_tx_timeout (struct net_device *dev)
void __iomem *shmem = lp->base;
if (net_debug > 1)
void __iomem *shmem = lp->base;
if (net_debug > 1)
- pr
intk
("%s: transmit timed out, %s? ", dev->name,
+ pr
_debug
("%s: transmit timed out, %s? ", dev->name,
readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" :
"network cable problem");
/* Try to restart the adaptor. */
if (lp->last_restart == dev->stats.tx_packets) {
if (net_debug > 1)
readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" :
"network cable problem");
/* Try to restart the adaptor. */
if (lp->last_restart == dev->stats.tx_packets) {
if (net_debug > 1)
- pr
intk
("Resetting board.\n");
+ pr
_cont
("Resetting board.\n");
/* Completely reset the adaptor. */
init_82586_mem (dev);
lp->tx_pkts_in_ring = 0;
} else {
/* Issue the channel attention signal and hope it "gets better". */
if (net_debug > 1)
/* Completely reset the adaptor. */
init_82586_mem (dev);
lp->tx_pkts_in_ring = 0;
} else {
/* Issue the channel attention signal and hope it "gets better". */
if (net_debug > 1)
- pr
intk
("Kicking board.\n");
+ pr
_cont
("Kicking board.\n");
writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD);
outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */
lp->last_restart = dev->stats.tx_packets;
writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD);
outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */
lp->last_restart = dev->stats.tx_packets;
@@
-511,7
+510,8
@@
static void el16_tx_timeout (struct net_device *dev)
}
}
-static int el16_send_packet (struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t el16_send_packet (struct sk_buff *skb,
+ struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
{
struct net_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
@@
-539,7
+539,7
@@
static int el16_send_packet (struct sk_buff *skb, struct net_device *dev)
/* You might need to clean up and record Tx statistics here. */
/* You might need to clean up and record Tx statistics here. */
- return
0
;
+ return
NETDEV_TX_OK
;
}
/* The typical workload of the driver:
}
/* The typical workload of the driver:
@@
-553,7
+553,8
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
void __iomem *shmem;
if (dev == NULL) {
void __iomem *shmem;
if (dev == NULL) {
- printk ("net_interrupt(): irq %d for unknown device.\n", irq);
+ pr_err("%s: net_interrupt(): irq %d for unknown device.\n",
+ dev->name, irq);
return IRQ_NONE;
}
return IRQ_NONE;
}
@@
-566,7
+567,7
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
status = readw(shmem+iSCB_STATUS);
if (net_debug > 4) {
status = readw(shmem+iSCB_STATUS);
if (net_debug > 4) {
- pr
intk
("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status);
+ pr
_debug
("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status);
}
/* Disable the 82586's input to the interrupt line. */
}
/* Disable the 82586's input to the interrupt line. */
@@
-577,7
+578,7
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
unsigned short tx_status = readw(shmem+lp->tx_reap);
if (!(tx_status & 0x8000)) {
if (net_debug > 5)
unsigned short tx_status = readw(shmem+lp->tx_reap);
if (!(tx_status & 0x8000)) {
if (net_debug > 5)
- pr
intk
("Tx command incomplete (%#x).\n", lp->tx_reap);
+ pr
_debug
("Tx command incomplete (%#x).\n", lp->tx_reap);
break;
}
/* Tx unsuccessful or some interesting status bit set. */
break;
}
/* Tx unsuccessful or some interesting status bit set. */
@@
-591,7
+592,7
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
}
dev->stats.tx_packets++;
if (net_debug > 5)
}
dev->stats.tx_packets++;
if (net_debug > 5)
- pr
intk
("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status);
+ pr
_debug
("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status);
lp->tx_reap += TX_BUF_SIZE;
if (lp->tx_reap > RX_BUF_START - TX_BUF_SIZE)
lp->tx_reap = TX_BUF_START;
lp->tx_reap += TX_BUF_SIZE;
if (lp->tx_reap > RX_BUF_START - TX_BUF_SIZE)
lp->tx_reap = TX_BUF_START;
@@
-606,7
+607,7
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
if (status & 0x4000) { /* Packet received. */
if (net_debug > 5)
if (status & 0x4000) { /* Packet received. */
if (net_debug > 5)
- pr
intk
("Received packet, rx_head %04x.\n", lp->rx_head);
+ pr
_debug
("Received packet, rx_head %04x.\n", lp->rx_head);
el16_rx(dev);
}
el16_rx(dev);
}
@@
-615,7
+616,7
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
if ((status & 0x0700) != 0x0200 && netif_running(dev)) {
if (net_debug)
if ((status & 0x0700) != 0x0200 && netif_running(dev)) {
if (net_debug)
- pr
intk
("%s: Command unit stopped, status %04x, restarting.\n",
+ pr
_debug
("%s: Command unit stopped, status %04x, restarting.\n",
dev->name, status);
/* If this ever occurs we should really re-write the idle loop, reset
the Tx list, and do a complete restart of the command unit.
dev->name, status);
/* If this ever occurs we should really re-write the idle loop, reset
the Tx list, and do a complete restart of the command unit.
@@
-627,7
+628,7
@@
static irqreturn_t el16_interrupt(int irq, void *dev_id)
/* The Rx unit is not ready, it must be hung. Restart the receiver by
initializing the rx buffers, and issuing an Rx start command. */
if (net_debug)
/* The Rx unit is not ready, it must be hung. Restart the receiver by
initializing the rx buffers, and issuing an Rx start command. */
if (net_debug)
- pr
intk
("%s: Rx unit stopped, status %04x, restarting.\n",
+ pr
_debug
("%s: Rx unit stopped, status %04x, restarting.\n",
dev->name, status);
init_rx_bufs(dev);
writew(RX_BUF_START,shmem+iSCB_RFA);
dev->name, status);
init_rx_bufs(dev);
writew(RX_BUF_START,shmem+iSCB_RFA);
@@
-753,9
+754,8
@@
static void init_82586_mem(struct net_device *dev)
int boguscnt = 50;
while (readw(shmem+iSCB_STATUS) == 0)
if (--boguscnt == 0) {
int boguscnt = 50;
while (readw(shmem+iSCB_STATUS) == 0)
if (--boguscnt == 0) {
- printk("%s: i82586 initialization timed out with status %04x, "
- "cmd %04x.\n", dev->name,
- readw(shmem+iSCB_STATUS), readw(shmem+iSCB_CMD));
+ pr_warning("%s: i82586 initialization timed out with status %04x, cmd %04x.\n",
+ dev->name, readw(shmem+iSCB_STATUS), readw(shmem+iSCB_CMD));
break;
}
/* Issue channel-attn -- the 82586 won't start. */
break;
}
/* Issue channel-attn -- the 82586 won't start. */
@@
-765,7
+765,7
@@
static void init_82586_mem(struct net_device *dev)
/* Disable loopback and enable interrupts. */
outb(0x84, ioaddr + MISC_CTRL);
if (net_debug > 4)
/* Disable loopback and enable interrupts. */
outb(0x84, ioaddr + MISC_CTRL);
if (net_debug > 4)
- pr
intk
("%s: Initialized 82586, status %04x.\n", dev->name,
+ pr
_debug
("%s: Initialized 82586, status %04x.\n", dev->name,
readw(shmem+iSCB_STATUS));
return;
}
readw(shmem+iSCB_STATUS));
return;
}
@@
-810,7
+810,7
@@
static void hardware_send_packet(struct net_device *dev, void *buf, short length
lp->tx_head = TX_BUF_START;
if (net_debug > 4) {
lp->tx_head = TX_BUF_START;
if (net_debug > 4) {
- pr
intk
("%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n",
+ pr
_debug
("%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n",
dev->name, ioaddr, length, tx_block, lp->tx_head);
}
dev->name, ioaddr, length, tx_block, lp->tx_head);
}
@@
-836,9
+836,9
@@
static void el16_rx(struct net_device *dev)
void __iomem *data_frame = lp->base + data_buffer_addr;
ushort pkt_len = readw(data_frame);
void __iomem *data_frame = lp->base + data_buffer_addr;
ushort pkt_len = readw(data_frame);
- if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22
-
||
(pkt_len & 0xC000) != 0xC000) {
- pr
intk(KERN_ERR
"%s: Rx frame at %#x corrupted, "
+ if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22
||
+ (pkt_len & 0xC000) != 0xC000) {
+ pr
_err(
"%s: Rx frame at %#x corrupted, "
"status %04x cmd %04x next %04x "
"data-buf @%04x %04x.\n",
dev->name, rx_head, frame_status, rfd_cmd,
"status %04x cmd %04x next %04x "
"data-buf @%04x %04x.\n",
dev->name, rx_head, frame_status, rfd_cmd,
@@
-858,8
+858,7
@@
static void el16_rx(struct net_device *dev)
pkt_len &= 0x3fff;
skb = dev_alloc_skb(pkt_len+2);
if (skb == NULL) {
pkt_len &= 0x3fff;
skb = dev_alloc_skb(pkt_len+2);
if (skb == NULL) {
- printk(KERN_ERR "%s: Memory squeeze, "
- "dropping packet.\n",
+ pr_err("%s: Memory squeeze, dropping packet.\n",
dev->name);
dev->stats.rx_dropped++;
break;
dev->name);
dev->stats.rx_dropped++;
break;
@@
-926,7
+925,7
@@
MODULE_PARM_DESC(irq, "(ignored)");
int __init init_module(void)
{
if (io == 0)
int __init init_module(void)
{
if (io == 0)
- pr
intk
("3c507: You should not use auto-probing with insmod!\n");
+ pr
_notice
("3c507: You should not use auto-probing with insmod!\n");
dev_3c507 = el16_probe(-1);
return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0;
}
dev_3c507 = el16_probe(-1);
return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0;
}