aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/de620.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/de620.c')
-rw-r--r--drivers/net/de620.c59
1 files changed, 18 insertions, 41 deletions
diff --git a/drivers/net/de620.c b/drivers/net/de620.c
index c5cd6e3d00df..039bc1acadd3 100644
--- a/drivers/net/de620.c
+++ b/drivers/net/de620.c
@@ -48,7 +48,6 @@ static const char version[] =
48 * Compile-time options: (see below for descriptions) 48 * Compile-time options: (see below for descriptions)
49 * -DDE620_IO=0x378 (lpt1) 49 * -DDE620_IO=0x378 (lpt1)
50 * -DDE620_IRQ=7 (lpt1) 50 * -DDE620_IRQ=7 (lpt1)
51 * -DDE602_DEBUG=...
52 * -DSHUTDOWN_WHEN_LOST 51 * -DSHUTDOWN_WHEN_LOST
53 * -DCOUNT_LOOPS 52 * -DCOUNT_LOOPS
54 * -DLOWSPEED 53 * -DLOWSPEED
@@ -98,15 +97,6 @@ static const char version[] =
98#define SHUTDOWN_WHEN_LOST 97#define SHUTDOWN_WHEN_LOST
99 */ 98 */
100 99
101/*
102 * Enable debugging by "-DDE620_DEBUG=3" when compiling,
103 * OR by enabling the following #define
104 *
105 * use 0 for production, 1 for verification, >2 for debug
106 *
107#define DE620_DEBUG 3
108 */
109
110#ifdef LOWSPEED 100#ifdef LOWSPEED
111/* 101/*
112 * Enable this #define if you want to see debugging output that show how long 102 * Enable this #define if you want to see debugging output that show how long
@@ -160,14 +150,6 @@ typedef unsigned char byte;
160#define RUNT 60 /* Too small Ethernet packet */ 150#define RUNT 60 /* Too small Ethernet packet */
161#define GIANT 1514 /* largest legal size packet, no fcs */ 151#define GIANT 1514 /* largest legal size packet, no fcs */
162 152
163#ifdef DE620_DEBUG /* Compile-time configurable */
164#define PRINTK(x) if (de620_debug >= 2) printk x
165#else
166#define DE620_DEBUG 0
167#define PRINTK(x) /**/
168#endif
169
170
171/* 153/*
172 * Force media with insmod: 154 * Force media with insmod:
173 * insmod de620.o bnc=1 155 * insmod de620.o bnc=1
@@ -186,8 +168,6 @@ static int io = DE620_IO;
186static int irq = DE620_IRQ; 168static int irq = DE620_IRQ;
187static int clone = DE620_CLONE; 169static int clone = DE620_CLONE;
188 170
189static unsigned int de620_debug = DE620_DEBUG;
190
191static spinlock_t de620_lock; 171static spinlock_t de620_lock;
192 172
193module_param(bnc, int, 0); 173module_param(bnc, int, 0);
@@ -195,13 +175,11 @@ module_param(utp, int, 0);
195module_param(io, int, 0); 175module_param(io, int, 0);
196module_param(irq, int, 0); 176module_param(irq, int, 0);
197module_param(clone, int, 0); 177module_param(clone, int, 0);
198module_param(de620_debug, int, 0);
199MODULE_PARM_DESC(bnc, "DE-620 set BNC medium (0-1)"); 178MODULE_PARM_DESC(bnc, "DE-620 set BNC medium (0-1)");
200MODULE_PARM_DESC(utp, "DE-620 set UTP medium (0-1)"); 179MODULE_PARM_DESC(utp, "DE-620 set UTP medium (0-1)");
201MODULE_PARM_DESC(io, "DE-620 I/O base address,required"); 180MODULE_PARM_DESC(io, "DE-620 I/O base address,required");
202MODULE_PARM_DESC(irq, "DE-620 IRQ number,required"); 181MODULE_PARM_DESC(irq, "DE-620 IRQ number,required");
203MODULE_PARM_DESC(clone, "Check also for non-D-Link DE-620 clones (0-1)"); 182MODULE_PARM_DESC(clone, "Check also for non-D-Link DE-620 clones (0-1)");
204MODULE_PARM_DESC(de620_debug, "DE-620 debug level (0-2)");
205 183
206/*********************************************** 184/***********************************************
207 * * 185 * *
@@ -534,8 +512,8 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev)
534 /* Start real output */ 512 /* Start real output */
535 513
536 spin_lock_irqsave(&de620_lock, flags); 514 spin_lock_irqsave(&de620_lock, flags);
537 PRINTK(("de620_start_xmit: len=%d, bufs 0x%02x\n", 515 pr_debug("de620_start_xmit: len=%d, bufs 0x%02x\n",
538 (int)skb->len, using_txbuf)); 516 (int)skb->len, using_txbuf);
539 517
540 /* select a free tx buffer. if there is one... */ 518 /* select a free tx buffer. if there is one... */
541 switch (using_txbuf) { 519 switch (using_txbuf) {
@@ -585,12 +563,12 @@ de620_interrupt(int irq_in, void *dev_id)
585 /* Read the status register (_not_ the status port) */ 563 /* Read the status register (_not_ the status port) */
586 irq_status = de620_get_register(dev, R_STS); 564 irq_status = de620_get_register(dev, R_STS);
587 565
588 PRINTK(("de620_interrupt (%2.2X)\n", irq_status)); 566 pr_debug("de620_interrupt (%2.2X)\n", irq_status);
589 567
590 if (irq_status & RXGOOD) { 568 if (irq_status & RXGOOD) {
591 do { 569 do {
592 again = de620_rx_intr(dev); 570 again = de620_rx_intr(dev);
593 PRINTK(("again=%d\n", again)); 571 pr_debug("again=%d\n", again);
594 } 572 }
595 while (again && (++bogus_count < 100)); 573 while (again && (++bogus_count < 100));
596 } 574 }
@@ -622,7 +600,7 @@ static int de620_rx_intr(struct net_device *dev)
622 byte pagelink; 600 byte pagelink;
623 byte curr_page; 601 byte curr_page;
624 602
625 PRINTK(("de620_rx_intr: next_rx_page = %d\n", next_rx_page)); 603 pr_debug("de620_rx_intr: next_rx_page = %d\n", next_rx_page);
626 604
627 /* Tell the adapter that we are going to read data, and from where */ 605 /* Tell the adapter that we are going to read data, and from where */
628 de620_send_command(dev, W_CR | RRN); 606 de620_send_command(dev, W_CR | RRN);
@@ -631,8 +609,9 @@ static int de620_rx_intr(struct net_device *dev)
631 609
632 /* Deep breath, and away we goooooo */ 610 /* Deep breath, and away we goooooo */
633 de620_read_block(dev, (byte *)&header_buf, sizeof(struct header_buf)); 611 de620_read_block(dev, (byte *)&header_buf, sizeof(struct header_buf));
634 PRINTK(("page status=0x%02x, nextpage=%d, packetsize=%d\n", 612 pr_debug("page status=0x%02x, nextpage=%d, packetsize=%d\n",
635 header_buf.status, header_buf.Rx_NextPage, header_buf.Rx_ByteCount)); 613 header_buf.status, header_buf.Rx_NextPage,
614 header_buf.Rx_ByteCount);
636 615
637 /* Plausible page header? */ 616 /* Plausible page header? */
638 pagelink = header_buf.Rx_NextPage; 617 pagelink = header_buf.Rx_NextPage;
@@ -683,7 +662,7 @@ static int de620_rx_intr(struct net_device *dev)
683 buffer = skb_put(skb,size); 662 buffer = skb_put(skb,size);
684 /* copy the packet into the buffer */ 663 /* copy the packet into the buffer */
685 de620_read_block(dev, buffer, size); 664 de620_read_block(dev, buffer, size);
686 PRINTK(("Read %d bytes\n", size)); 665 pr_debug("Read %d bytes\n", size);
687 skb->protocol=eth_type_trans(skb,dev); 666 skb->protocol=eth_type_trans(skb,dev);
688 netif_rx(skb); /* deliver it "upstairs" */ 667 netif_rx(skb); /* deliver it "upstairs" */
689 /* count all receives */ 668 /* count all receives */
@@ -696,7 +675,7 @@ static int de620_rx_intr(struct net_device *dev)
696 /* NOTE! We're _not_ checking the 'EMPTY'-flag! This seems better... */ 675 /* NOTE! We're _not_ checking the 'EMPTY'-flag! This seems better... */
697 curr_page = de620_get_register(dev, R_CPR); 676 curr_page = de620_get_register(dev, R_CPR);
698 de620_set_register(dev, W_NPRF, next_rx_page); 677 de620_set_register(dev, W_NPRF, next_rx_page);
699 PRINTK(("next_rx_page=%d CPR=%d\n", next_rx_page, curr_page)); 678 pr_debug("next_rx_page=%d CPR=%d\n", next_rx_page, curr_page);
700 679
701 return (next_rx_page != curr_page); /* That was slightly tricky... */ 680 return (next_rx_page != curr_page); /* That was slightly tricky... */
702} 681}
@@ -830,8 +809,7 @@ struct net_device * __init de620_probe(int unit)
830 netdev_boot_setup_check(dev); 809 netdev_boot_setup_check(dev);
831 } 810 }
832 811
833 if (de620_debug) 812 pr_debug("%s", version);
834 printk(version);
835 813
836 printk(KERN_INFO "D-Link DE-620 pocket adapter"); 814 printk(KERN_INFO "D-Link DE-620 pocket adapter");
837 815
@@ -878,14 +856,13 @@ struct net_device * __init de620_probe(int unit)
878 /* base_addr and irq are already set, see above! */ 856 /* base_addr and irq are already set, see above! */
879 857
880 /* dump eeprom */ 858 /* dump eeprom */
881 if (de620_debug) { 859 pr_debug("\nEEPROM contents:\n"
882 printk("\nEEPROM contents:\n"); 860 "RAM_Size = 0x%02X\n"
883 printk("RAM_Size = 0x%02X\n", nic_data.RAM_Size); 861 "NodeID = %pM\n"
884 printk("NodeID = %pM\n", nic_data.NodeID); 862 "Model = %d\n"
885 printk("Model = %d\n", nic_data.Model); 863 "Media = %d\n"
886 printk("Media = %d\n", nic_data.Media); 864 "SCR = 0x%02x\n", nic_data.RAM_Size, nic_data.NodeID,
887 printk("SCR = 0x%02x\n", nic_data.SCR); 865 nic_data.Model, nic_data.Media, nic_data.SCR);
888 }
889 866
890 err = register_netdev(dev); 867 err = register_netdev(dev);
891 if (err) 868 if (err)