Commit 2818fba1 authored by Alexander Beregalov's avatar Alexander Beregalov Committed by David S. Miller

de620: convert PRINTK() to pr_debug() and cleanup

Also remove DE620_DEBUG and de620_debug.
Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64303258
...@@ -48,7 +48,6 @@ static const char version[] = ...@@ -48,7 +48,6 @@ static const char version[] =
* Compile-time options: (see below for descriptions) * Compile-time options: (see below for descriptions)
* -DDE620_IO=0x378 (lpt1) * -DDE620_IO=0x378 (lpt1)
* -DDE620_IRQ=7 (lpt1) * -DDE620_IRQ=7 (lpt1)
* -DDE602_DEBUG=...
* -DSHUTDOWN_WHEN_LOST * -DSHUTDOWN_WHEN_LOST
* -DCOUNT_LOOPS * -DCOUNT_LOOPS
* -DLOWSPEED * -DLOWSPEED
...@@ -98,15 +97,6 @@ static const char version[] = ...@@ -98,15 +97,6 @@ static const char version[] =
#define SHUTDOWN_WHEN_LOST #define SHUTDOWN_WHEN_LOST
*/ */
/*
* Enable debugging by "-DDE620_DEBUG=3" when compiling,
* OR by enabling the following #define
*
* use 0 for production, 1 for verification, >2 for debug
*
#define DE620_DEBUG 3
*/
#ifdef LOWSPEED #ifdef LOWSPEED
/* /*
* Enable this #define if you want to see debugging output that show how long * Enable this #define if you want to see debugging output that show how long
...@@ -160,14 +150,6 @@ typedef unsigned char byte; ...@@ -160,14 +150,6 @@ typedef unsigned char byte;
#define RUNT 60 /* Too small Ethernet packet */ #define RUNT 60 /* Too small Ethernet packet */
#define GIANT 1514 /* largest legal size packet, no fcs */ #define GIANT 1514 /* largest legal size packet, no fcs */
#ifdef DE620_DEBUG /* Compile-time configurable */
#define PRINTK(x) if (de620_debug >= 2) printk x
#else
#define DE620_DEBUG 0
#define PRINTK(x) /**/
#endif
/* /*
* Force media with insmod: * Force media with insmod:
* insmod de620.o bnc=1 * insmod de620.o bnc=1
...@@ -186,8 +168,6 @@ static int io = DE620_IO; ...@@ -186,8 +168,6 @@ static int io = DE620_IO;
static int irq = DE620_IRQ; static int irq = DE620_IRQ;
static int clone = DE620_CLONE; static int clone = DE620_CLONE;
static unsigned int de620_debug = DE620_DEBUG;
static spinlock_t de620_lock; static spinlock_t de620_lock;
module_param(bnc, int, 0); module_param(bnc, int, 0);
...@@ -195,13 +175,11 @@ module_param(utp, int, 0); ...@@ -195,13 +175,11 @@ module_param(utp, int, 0);
module_param(io, int, 0); module_param(io, int, 0);
module_param(irq, int, 0); module_param(irq, int, 0);
module_param(clone, int, 0); module_param(clone, int, 0);
module_param(de620_debug, int, 0);
MODULE_PARM_DESC(bnc, "DE-620 set BNC medium (0-1)"); MODULE_PARM_DESC(bnc, "DE-620 set BNC medium (0-1)");
MODULE_PARM_DESC(utp, "DE-620 set UTP medium (0-1)"); MODULE_PARM_DESC(utp, "DE-620 set UTP medium (0-1)");
MODULE_PARM_DESC(io, "DE-620 I/O base address,required"); MODULE_PARM_DESC(io, "DE-620 I/O base address,required");
MODULE_PARM_DESC(irq, "DE-620 IRQ number,required"); MODULE_PARM_DESC(irq, "DE-620 IRQ number,required");
MODULE_PARM_DESC(clone, "Check also for non-D-Link DE-620 clones (0-1)"); MODULE_PARM_DESC(clone, "Check also for non-D-Link DE-620 clones (0-1)");
MODULE_PARM_DESC(de620_debug, "DE-620 debug level (0-2)");
/*********************************************** /***********************************************
* * * *
...@@ -534,8 +512,8 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -534,8 +512,8 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Start real output */ /* Start real output */
spin_lock_irqsave(&de620_lock, flags); spin_lock_irqsave(&de620_lock, flags);
PRINTK(("de620_start_xmit: len=%d, bufs 0x%02x\n", pr_debug("de620_start_xmit: len=%d, bufs 0x%02x\n",
(int)skb->len, using_txbuf)); (int)skb->len, using_txbuf);
/* select a free tx buffer. if there is one... */ /* select a free tx buffer. if there is one... */
switch (using_txbuf) { switch (using_txbuf) {
...@@ -585,12 +563,12 @@ de620_interrupt(int irq_in, void *dev_id) ...@@ -585,12 +563,12 @@ de620_interrupt(int irq_in, void *dev_id)
/* Read the status register (_not_ the status port) */ /* Read the status register (_not_ the status port) */
irq_status = de620_get_register(dev, R_STS); irq_status = de620_get_register(dev, R_STS);
PRINTK(("de620_interrupt (%2.2X)\n", irq_status)); pr_debug("de620_interrupt (%2.2X)\n", irq_status);
if (irq_status & RXGOOD) { if (irq_status & RXGOOD) {
do { do {
again = de620_rx_intr(dev); again = de620_rx_intr(dev);
PRINTK(("again=%d\n", again)); pr_debug("again=%d\n", again);
} }
while (again && (++bogus_count < 100)); while (again && (++bogus_count < 100));
} }
...@@ -622,7 +600,7 @@ static int de620_rx_intr(struct net_device *dev) ...@@ -622,7 +600,7 @@ static int de620_rx_intr(struct net_device *dev)
byte pagelink; byte pagelink;
byte curr_page; byte curr_page;
PRINTK(("de620_rx_intr: next_rx_page = %d\n", next_rx_page)); pr_debug("de620_rx_intr: next_rx_page = %d\n", next_rx_page);
/* Tell the adapter that we are going to read data, and from where */ /* Tell the adapter that we are going to read data, and from where */
de620_send_command(dev, W_CR | RRN); de620_send_command(dev, W_CR | RRN);
...@@ -631,8 +609,9 @@ static int de620_rx_intr(struct net_device *dev) ...@@ -631,8 +609,9 @@ static int de620_rx_intr(struct net_device *dev)
/* Deep breath, and away we goooooo */ /* Deep breath, and away we goooooo */
de620_read_block(dev, (byte *)&header_buf, sizeof(struct header_buf)); de620_read_block(dev, (byte *)&header_buf, sizeof(struct header_buf));
PRINTK(("page status=0x%02x, nextpage=%d, packetsize=%d\n", pr_debug("page status=0x%02x, nextpage=%d, packetsize=%d\n",
header_buf.status, header_buf.Rx_NextPage, header_buf.Rx_ByteCount)); header_buf.status, header_buf.Rx_NextPage,
header_buf.Rx_ByteCount);
/* Plausible page header? */ /* Plausible page header? */
pagelink = header_buf.Rx_NextPage; pagelink = header_buf.Rx_NextPage;
...@@ -683,7 +662,7 @@ static int de620_rx_intr(struct net_device *dev) ...@@ -683,7 +662,7 @@ static int de620_rx_intr(struct net_device *dev)
buffer = skb_put(skb,size); buffer = skb_put(skb,size);
/* copy the packet into the buffer */ /* copy the packet into the buffer */
de620_read_block(dev, buffer, size); de620_read_block(dev, buffer, size);
PRINTK(("Read %d bytes\n", size)); pr_debug("Read %d bytes\n", size);
skb->protocol=eth_type_trans(skb,dev); skb->protocol=eth_type_trans(skb,dev);
netif_rx(skb); /* deliver it "upstairs" */ netif_rx(skb); /* deliver it "upstairs" */
/* count all receives */ /* count all receives */
...@@ -696,7 +675,7 @@ static int de620_rx_intr(struct net_device *dev) ...@@ -696,7 +675,7 @@ static int de620_rx_intr(struct net_device *dev)
/* NOTE! We're _not_ checking the 'EMPTY'-flag! This seems better... */ /* NOTE! We're _not_ checking the 'EMPTY'-flag! This seems better... */
curr_page = de620_get_register(dev, R_CPR); curr_page = de620_get_register(dev, R_CPR);
de620_set_register(dev, W_NPRF, next_rx_page); de620_set_register(dev, W_NPRF, next_rx_page);
PRINTK(("next_rx_page=%d CPR=%d\n", next_rx_page, curr_page)); pr_debug("next_rx_page=%d CPR=%d\n", next_rx_page, curr_page);
return (next_rx_page != curr_page); /* That was slightly tricky... */ return (next_rx_page != curr_page); /* That was slightly tricky... */
} }
...@@ -830,8 +809,7 @@ struct net_device * __init de620_probe(int unit) ...@@ -830,8 +809,7 @@ struct net_device * __init de620_probe(int unit)
netdev_boot_setup_check(dev); netdev_boot_setup_check(dev);
} }
if (de620_debug) pr_debug("%s", version);
printk(version);
printk(KERN_INFO "D-Link DE-620 pocket adapter"); printk(KERN_INFO "D-Link DE-620 pocket adapter");
...@@ -878,14 +856,13 @@ struct net_device * __init de620_probe(int unit) ...@@ -878,14 +856,13 @@ struct net_device * __init de620_probe(int unit)
/* base_addr and irq are already set, see above! */ /* base_addr and irq are already set, see above! */
/* dump eeprom */ /* dump eeprom */
if (de620_debug) { pr_debug("\nEEPROM contents:\n"
printk("\nEEPROM contents:\n"); "RAM_Size = 0x%02X\n"
printk("RAM_Size = 0x%02X\n", nic_data.RAM_Size); "NodeID = %pM\n"
printk("NodeID = %pM\n", nic_data.NodeID); "Model = %d\n"
printk("Model = %d\n", nic_data.Model); "Media = %d\n"
printk("Media = %d\n", nic_data.Media); "SCR = 0x%02x\n", nic_data.RAM_Size, nic_data.NodeID,
printk("SCR = 0x%02x\n", nic_data.SCR); nic_data.Model, nic_data.Media, nic_data.SCR);
}
err = register_netdev(dev); err = register_netdev(dev);
if (err) if (err)
......
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