Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150241
b: refs/heads/master
c: 2818fba
h: refs/heads/master
i:
  150239: 93d8037
v: v3
  • Loading branch information
Alexander Beregalov authored and David S. Miller committed May 18, 2009
1 parent 2cfc9cc commit 72661cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64303258961c74f0168e056da14b612ce839dbc1
refs/heads/master: 2818fba1322c469181603a1fbffadf3d3c5cb1e0
59 changes: 18 additions & 41 deletions trunk/drivers/net/de620.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static const char version[] =
* Compile-time options: (see below for descriptions)
* -DDE620_IO=0x378 (lpt1)
* -DDE620_IRQ=7 (lpt1)
* -DDE602_DEBUG=...
* -DSHUTDOWN_WHEN_LOST
* -DCOUNT_LOOPS
* -DLOWSPEED
Expand Down Expand Up @@ -98,15 +97,6 @@ static const char version[] =
#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
/*
* Enable this #define if you want to see debugging output that show how long
Expand Down Expand Up @@ -160,14 +150,6 @@ typedef unsigned char byte;
#define RUNT 60 /* Too small Ethernet packet */
#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:
* insmod de620.o bnc=1
Expand All @@ -186,22 +168,18 @@ static int io = DE620_IO;
static int irq = DE620_IRQ;
static int clone = DE620_CLONE;

static unsigned int de620_debug = DE620_DEBUG;

static spinlock_t de620_lock;

module_param(bnc, int, 0);
module_param(utp, int, 0);
module_param(io, int, 0);
module_param(irq, 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(utp, "DE-620 set UTP medium (0-1)");
MODULE_PARM_DESC(io, "DE-620 I/O base address,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(de620_debug, "DE-620 debug level (0-2)");

/***********************************************
* *
Expand Down Expand Up @@ -534,8 +512,8 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Start real output */

spin_lock_irqsave(&de620_lock, flags);
PRINTK(("de620_start_xmit: len=%d, bufs 0x%02x\n",
(int)skb->len, using_txbuf));
pr_debug("de620_start_xmit: len=%d, bufs 0x%02x\n",
(int)skb->len, using_txbuf);

/* select a free tx buffer. if there is one... */
switch (using_txbuf) {
Expand Down Expand Up @@ -585,12 +563,12 @@ de620_interrupt(int irq_in, void *dev_id)
/* Read the status register (_not_ the status port) */
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) {
do {
again = de620_rx_intr(dev);
PRINTK(("again=%d\n", again));
pr_debug("again=%d\n", again);
}
while (again && (++bogus_count < 100));
}
Expand Down Expand Up @@ -622,7 +600,7 @@ static int de620_rx_intr(struct net_device *dev)
byte pagelink;
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 */
de620_send_command(dev, W_CR | RRN);
Expand All @@ -631,8 +609,9 @@ static int de620_rx_intr(struct net_device *dev)

/* Deep breath, and away we goooooo */
de620_read_block(dev, (byte *)&header_buf, sizeof(struct header_buf));
PRINTK(("page status=0x%02x, nextpage=%d, packetsize=%d\n",
header_buf.status, header_buf.Rx_NextPage, header_buf.Rx_ByteCount));
pr_debug("page status=0x%02x, nextpage=%d, packetsize=%d\n",
header_buf.status, header_buf.Rx_NextPage,
header_buf.Rx_ByteCount);

/* Plausible page header? */
pagelink = header_buf.Rx_NextPage;
Expand Down Expand Up @@ -683,7 +662,7 @@ static int de620_rx_intr(struct net_device *dev)
buffer = skb_put(skb,size);
/* copy the packet into the buffer */
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);
netif_rx(skb); /* deliver it "upstairs" */
/* count all receives */
Expand All @@ -696,7 +675,7 @@ static int de620_rx_intr(struct net_device *dev)
/* NOTE! We're _not_ checking the 'EMPTY'-flag! This seems better... */
curr_page = de620_get_register(dev, R_CPR);
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... */
}
Expand Down Expand Up @@ -830,8 +809,7 @@ struct net_device * __init de620_probe(int unit)
netdev_boot_setup_check(dev);
}

if (de620_debug)
printk(version);
pr_debug("%s", version);

printk(KERN_INFO "D-Link DE-620 pocket adapter");

Expand Down Expand Up @@ -878,14 +856,13 @@ struct net_device * __init de620_probe(int unit)
/* base_addr and irq are already set, see above! */

/* dump eeprom */
if (de620_debug) {
printk("\nEEPROM contents:\n");
printk("RAM_Size = 0x%02X\n", nic_data.RAM_Size);
printk("NodeID = %pM\n", nic_data.NodeID);
printk("Model = %d\n", nic_data.Model);
printk("Media = %d\n", nic_data.Media);
printk("SCR = 0x%02x\n", nic_data.SCR);
}
pr_debug("\nEEPROM contents:\n"
"RAM_Size = 0x%02X\n"
"NodeID = %pM\n"
"Model = %d\n"
"Media = %d\n"
"SCR = 0x%02x\n", nic_data.RAM_Size, nic_data.NodeID,
nic_data.Model, nic_data.Media, nic_data.SCR);

err = register_netdev(dev);
if (err)
Expand Down

0 comments on commit 72661cf

Please sign in to comment.