Commit 808e9a77 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

cirrus: cs89x0: Neaten debugging and logging

Introduce and use a debug macro to test and print.
Convert printks to pr_<level>.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ca034bcd
...@@ -77,8 +77,14 @@ ...@@ -77,8 +77,14 @@
#include "cs89x0.h" #include "cs89x0.h"
#define cs89_dbg(val, level, fmt, ...) \
do { \
if (val <= net_debug) \
pr_##level(fmt, ##__VA_ARGS__); \
} while (0)
static char version[] __initdata = static char version[] __initdata =
"v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton\n"; "v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton";
#define DRV_NAME "cs89x0" #define DRV_NAME "cs89x0"
...@@ -315,8 +321,7 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer) ...@@ -315,8 +321,7 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
{ {
int i; int i;
if (net_debug > 3) cs89_dbg(3, info, "EEPROM data from %x for %x:\n", off, len);
printk("EEPROM data from %x for %x:\n", off, len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (wait_eeprom_ready(dev) < 0) if (wait_eeprom_ready(dev) < 0)
return -1; return -1;
...@@ -325,11 +330,9 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer) ...@@ -325,11 +330,9 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
if (wait_eeprom_ready(dev) < 0) if (wait_eeprom_ready(dev) < 0)
return -1; return -1;
buffer[i] = readreg(dev, PP_EEData); buffer[i] = readreg(dev, PP_EEData);
if (net_debug > 3) cs89_dbg(3, cont, "%04x ", buffer[i]);
printk("%04x ", buffer[i]);
} }
if (net_debug > 3) cs89_dbg(3, cont, "\n");
printk("\n");
return 0; return 0;
} }
...@@ -435,8 +438,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) ...@@ -435,8 +438,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
if (lp->chip_type != CS8900 && lp->chip_revision >= 'C') if (lp->chip_type != CS8900 && lp->chip_revision >= 'C')
lp->send_cmd = TX_NOW; lp->send_cmd = TX_NOW;
if (net_debug) pr_info_once("%s\n", version);
printk_once(version);
pr_info("%s: cs89%c0%s rev %c found at %p ", pr_info("%s: cs89%c0%s rev %c found at %p ",
dev->name, dev->name,
...@@ -495,18 +497,17 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) ...@@ -495,18 +497,17 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
lp->adapter_cnf |= A_CNF_AUI | A_CNF_10B_T | lp->adapter_cnf |= A_CNF_AUI | A_CNF_10B_T |
A_CNF_MEDIA_AUI | A_CNF_MEDIA_10B_T | A_CNF_MEDIA_AUTO; A_CNF_MEDIA_AUI | A_CNF_MEDIA_10B_T | A_CNF_MEDIA_AUTO;
if (net_debug > 1) cs89_dbg(1, info, "%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n",
pr_info("%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n", dev->name, i, lp->adapter_cnf);
dev->name, i, lp->adapter_cnf);
/* IRQ. Other chips already probe, see below. */ /* IRQ. Other chips already probe, see below. */
if (lp->chip_type == CS8900) if (lp->chip_type == CS8900)
lp->isa_config = readreg(dev, PP_CS8900_ISAINT) & INT_NO_MASK; lp->isa_config = readreg(dev, PP_CS8900_ISAINT) & INT_NO_MASK;
printk("[Cirrus EEPROM] "); pr_cont("[Cirrus EEPROM] ");
} }
printk("\n"); pr_cont("\n");
/* First check to see if an EEPROM is attached. */ /* First check to see if an EEPROM is attached. */
...@@ -542,9 +543,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) ...@@ -542,9 +543,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
dev->dev_addr[i * 2] = eeprom_buff[i]; dev->dev_addr[i * 2] = eeprom_buff[i];
dev->dev_addr[i * 2 + 1] = eeprom_buff[i] >> 8; dev->dev_addr[i * 2 + 1] = eeprom_buff[i] >> 8;
} }
if (net_debug > 1) cs89_dbg(1, debug, "%s: new adapter_cnf: 0x%x\n",
pr_debug("%s: new adapter_cnf: 0x%x\n", dev->name, lp->adapter_cnf);
dev->name, lp->adapter_cnf);
} }
/* allow them to force multiple transceivers. If they force multiple, autosense */ /* allow them to force multiple transceivers. If they force multiple, autosense */
...@@ -572,9 +572,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) ...@@ -572,9 +572,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
lp->adapter_cnf |= A_CNF_MEDIA_10B_2; lp->adapter_cnf |= A_CNF_MEDIA_10B_2;
} }
if (net_debug > 1) cs89_dbg(1, debug, "%s: after force 0x%x, adapter_cnf=0x%x\n",
pr_debug("%s: after force 0x%x, adapter_cnf=0x%x\n", dev->name, lp->force, lp->adapter_cnf);
dev->name, lp->force, lp->adapter_cnf);
/* FIXME: We don't let you set dc-dc polarity or low RX squelch from the command line: add it here */ /* FIXME: We don't let you set dc-dc polarity or low RX squelch from the command line: add it here */
...@@ -629,24 +628,23 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) ...@@ -629,24 +628,23 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
dev->irq = i; dev->irq = i;
} }
printk(" IRQ %d", dev->irq); pr_cont(" IRQ %d", dev->irq);
#if ALLOW_DMA #if ALLOW_DMA
if (lp->use_dma) { if (lp->use_dma) {
get_dma_channel(dev); get_dma_channel(dev);
printk(", DMA %d", dev->dma); pr_cont(", DMA %d", dev->dma);
} else } else
#endif #endif
printk(", programmed I/O"); pr_cont(", programmed I/O");
/* print the ethernet address. */ /* print the ethernet address. */
printk(", MAC %pM\n", dev->dev_addr); pr_cont(", MAC %pM\n", dev->dev_addr);
dev->netdev_ops = &net_ops; dev->netdev_ops = &net_ops;
dev->watchdog_timeo = HZ; dev->watchdog_timeo = HZ;
if (net_debug) cs89_dbg(0, info, "cs89x0_probe1() successful\n");
printk("cs89x0_probe1() successful\n");
retval = register_netdev(dev); retval = register_netdev(dev);
if (retval) if (retval)
...@@ -693,8 +691,7 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular) ...@@ -693,8 +691,7 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
* will skip the test for the ADD_PORT. * will skip the test for the ADD_PORT.
*/ */
if (ioport & 1) { if (ioport & 1) {
if (net_debug > 1) cs89_dbg(1, info, "%s: odd ioaddr 0x%lx\n", dev->name, ioport);
pr_info("%s: odd ioaddr 0x%lx\n", dev->name, ioport);
if ((ioport & 2) != 2) { if ((ioport & 2) != 2) {
if ((ioread16(io_mem + ADD_PORT) & ADD_MASK) != if ((ioread16(io_mem + ADD_PORT) & ADD_MASK) !=
ADD_SIG) { ADD_SIG) {
...@@ -742,8 +739,7 @@ struct net_device * __init cs89x0_probe(int unit) ...@@ -742,8 +739,7 @@ struct net_device * __init cs89x0_probe(int unit)
io = dev->base_addr; io = dev->base_addr;
irq = dev->irq; irq = dev->irq;
if (net_debug) cs89_dbg(0, info, "cs89x0_probe(0x%x)\n", io);
pr_info("cs89x0_probe(0x%x)\n", io);
if (io > 0x1ff) { /* Check a single specified location. */ if (io > 0x1ff) { /* Check a single specified location. */
err = cs89x0_ioport_probe(dev, io, 0); err = cs89x0_ioport_probe(dev, io, 0);
...@@ -817,18 +813,15 @@ set_dma_cfg(struct net_device *dev) ...@@ -817,18 +813,15 @@ set_dma_cfg(struct net_device *dev)
if (lp->use_dma) { if (lp->use_dma) {
if ((lp->isa_config & ANY_ISA_DMA) == 0) { if ((lp->isa_config & ANY_ISA_DMA) == 0) {
if (net_debug > 3) cs89_dbg(3, err, "set_dma_cfg(): no DMA\n");
printk("set_dma_cfg(): no DMA\n");
return; return;
} }
if (lp->isa_config & ISA_RxDMA) { if (lp->isa_config & ISA_RxDMA) {
lp->curr_rx_cfg |= RX_DMA_ONLY; lp->curr_rx_cfg |= RX_DMA_ONLY;
if (net_debug > 3) cs89_dbg(3, info, "set_dma_cfg(): RX_DMA_ONLY\n");
printk("set_dma_cfg(): RX_DMA_ONLY\n");
} else { } else {
lp->curr_rx_cfg |= AUTO_RX_DMA; /* not that we support it... */ lp->curr_rx_cfg |= AUTO_RX_DMA; /* not that we support it... */
if (net_debug > 3) cs89_dbg(3, info, "set_dma_cfg(): AUTO_RX_DMA\n");
printk("set_dma_cfg(): AUTO_RX_DMA\n");
} }
} }
} }
...@@ -871,10 +864,10 @@ dma_rx(struct net_device *dev) ...@@ -871,10 +864,10 @@ dma_rx(struct net_device *dev)
status = bp[0] + (bp[1] << 8); status = bp[0] + (bp[1] << 8);
length = bp[2] + (bp[3] << 8); length = bp[2] + (bp[3] << 8);
bp += 4; bp += 4;
if (net_debug > 5) {
printk("%s: receiving DMA packet at %lx, status %x, length %x\n", cs89_dbg(5, debug, "%s: receiving DMA packet at %lx, status %x, length %x\n",
dev->name, (unsigned long)bp, status, length); dev->name, (unsigned long)bp, status, length);
}
if ((status & RX_OK) == 0) { if ((status & RX_OK) == 0) {
count_rx_errors(status, dev); count_rx_errors(status, dev);
goto skip_this_frame; goto skip_this_frame;
...@@ -883,9 +876,9 @@ dma_rx(struct net_device *dev) ...@@ -883,9 +876,9 @@ dma_rx(struct net_device *dev)
/* Malloc up new buffer. */ /* Malloc up new buffer. */
skb = netdev_alloc_skb(dev, length + 2); skb = netdev_alloc_skb(dev, length + 2);
if (skb == NULL) { if (skb == NULL) {
if (net_debug) /* I don't think we want to do this to a stressed system */ /* I don't think we want to do this to a stressed system */
printk("%s: Memory squeeze, dropping packet\n", cs89_dbg(0, err, "%s: Memory squeeze, dropping packet\n",
dev->name); dev->name);
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
/* AKPM: advance bp to the next frame */ /* AKPM: advance bp to the next frame */
...@@ -911,12 +904,11 @@ dma_rx(struct net_device *dev) ...@@ -911,12 +904,11 @@ dma_rx(struct net_device *dev)
bp -= lp->dmasize*1024; bp -= lp->dmasize*1024;
lp->rx_dma_ptr = bp; lp->rx_dma_ptr = bp;
if (net_debug > 3) { cs89_dbg(3, info, "%s: received %d byte DMA packet of type %x\n",
printk("%s: received %d byte DMA packet of type %x\n", dev->name, length,
dev->name, length, ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
((skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]));
skb->data[ETH_ALEN + ETH_ALEN + 1]));
}
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
dev->stats.rx_packets++; dev->stats.rx_packets++;
...@@ -998,8 +990,7 @@ detect_tp(struct net_device *dev) ...@@ -998,8 +990,7 @@ detect_tp(struct net_device *dev)
int timenow = jiffies; int timenow = jiffies;
int fdx; int fdx;
if (net_debug > 1) cs89_dbg(1, debug, "%s: Attempting TP\n", dev->name);
printk("%s: Attempting TP\n", dev->name);
/* If connected to another full duplex capable 10-Base-T card /* If connected to another full duplex capable 10-Base-T card
* the link pulses seem to be lost when the auto detect bit in * the link pulses seem to be lost when the auto detect bit in
...@@ -1023,7 +1014,8 @@ detect_tp(struct net_device *dev) ...@@ -1023,7 +1014,8 @@ detect_tp(struct net_device *dev)
switch (lp->force & 0xf0) { switch (lp->force & 0xf0) {
#if 0 #if 0
case FORCE_AUTO: case FORCE_AUTO:
printk("%s: cs8900 doesn't autonegotiate\n", dev->name); pr_info("%s: cs8900 doesn't autonegotiate\n",
dev->name);
return DETECTED_NONE; return DETECTED_NONE;
#endif #endif
/* CS8900 doesn't support AUTO, change to HALF*/ /* CS8900 doesn't support AUTO, change to HALF*/
...@@ -1102,18 +1094,15 @@ send_test_pkt(struct net_device *dev) ...@@ -1102,18 +1094,15 @@ send_test_pkt(struct net_device *dev)
/* Write the contents of the packet */ /* Write the contents of the packet */
writewords(lp, TX_FRAME_PORT, test_packet, (ETH_ZLEN + 1) >> 1); writewords(lp, TX_FRAME_PORT, test_packet, (ETH_ZLEN + 1) >> 1);
if (net_debug > 1) cs89_dbg(1, debug, "Sending test packet ");
printk("Sending test packet ");
/* wait a couple of jiffies for packet to be received */ /* wait a couple of jiffies for packet to be received */
for (timenow = jiffies; jiffies - timenow < 3;) for (timenow = jiffies; jiffies - timenow < 3;)
; ;
if ((readreg(dev, PP_TxEvent) & TX_SEND_OK_BITS) == TX_OK) { if ((readreg(dev, PP_TxEvent) & TX_SEND_OK_BITS) == TX_OK) {
if (net_debug > 1) cs89_dbg(1, cont, "succeeded\n");
printk("succeeded\n");
return 1; return 1;
} }
if (net_debug > 1) cs89_dbg(1, cont, "failed\n");
printk("failed\n");
return 0; return 0;
} }
...@@ -1123,8 +1112,7 @@ detect_aui(struct net_device *dev) ...@@ -1123,8 +1112,7 @@ detect_aui(struct net_device *dev)
{ {
struct net_local *lp = netdev_priv(dev); struct net_local *lp = netdev_priv(dev);
if (net_debug > 1) cs89_dbg(1, debug, "%s: Attempting AUI\n", dev->name);
printk("%s: Attempting AUI\n", dev->name);
control_dc_dc(dev, 0); control_dc_dc(dev, 0);
writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY); writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY);
...@@ -1140,8 +1128,7 @@ detect_bnc(struct net_device *dev) ...@@ -1140,8 +1128,7 @@ detect_bnc(struct net_device *dev)
{ {
struct net_local *lp = netdev_priv(dev); struct net_local *lp = netdev_priv(dev);
if (net_debug > 1) cs89_dbg(1, debug, "%s: Attempting BNC\n", dev->name);
printk("%s: Attempting BNC\n", dev->name);
control_dc_dc(dev, 1); control_dc_dc(dev, 1);
writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY); writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY);
...@@ -1255,12 +1242,10 @@ net_open(struct net_device *dev) ...@@ -1255,12 +1242,10 @@ net_open(struct net_device *dev)
dev->name, lp->dmasize); dev->name, lp->dmasize);
goto release_irq; goto release_irq;
} }
if (net_debug > 1) { cs89_dbg(1, debug, "%s: dma %lx %lx\n",
printk("%s: dma %lx %lx\n", dev->name,
dev->name, (unsigned long)lp->dma_buff,
(unsigned long)lp->dma_buff, (unsigned long)isa_virt_to_bus(lp->dma_buff));
(unsigned long)isa_virt_to_bus(lp->dma_buff));
}
if ((unsigned long)lp->dma_buff >= MAX_DMA_ADDRESS || if ((unsigned long)lp->dma_buff >= MAX_DMA_ADDRESS ||
!dma_page_eq(lp->dma_buff, !dma_page_eq(lp->dma_buff,
lp->dma_buff + lp->dmasize * 1024 - 1)) { lp->dma_buff + lp->dmasize * 1024 - 1)) {
...@@ -1442,8 +1427,7 @@ net_open(struct net_device *dev) ...@@ -1442,8 +1427,7 @@ net_open(struct net_device *dev)
#endif #endif
)); ));
netif_start_queue(dev); netif_start_queue(dev);
if (net_debug > 1) cs89_dbg(1, debug, "net_open() succeeded\n");
printk("cs89x0: net_open() succeeded\n");
return 0; return 0;
bad_out: bad_out:
return ret; return ret;
...@@ -1453,10 +1437,9 @@ static void net_timeout(struct net_device *dev) ...@@ -1453,10 +1437,9 @@ static void net_timeout(struct net_device *dev)
{ {
/* If we get here, some higher level has decided we are broken. /* If we get here, some higher level has decided we are broken.
There should really be a "kick me" function call instead. */ There should really be a "kick me" function call instead. */
if (net_debug > 0) cs89_dbg(0, err, "%s: transmit timed out, %s?\n",
printk("%s: transmit timed out, %s?\n", dev->name,
dev->name, tx_done(dev) ? "IRQ conflict" : "network cable problem");
tx_done(dev) ? "IRQ conflict" : "network cable problem");
/* Try to restart the adaptor. */ /* Try to restart the adaptor. */
netif_wake_queue(dev); netif_wake_queue(dev);
} }
...@@ -1466,12 +1449,10 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -1466,12 +1449,10 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev)
struct net_local *lp = netdev_priv(dev); struct net_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
if (net_debug > 3) { cs89_dbg(3, debug, "%s: sent %d byte packet of type %x\n",
printk("%s: sent %d byte packet of type %x\n", dev->name, skb->len,
dev->name, skb->len, ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
((skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]));
skb->data[ETH_ALEN + ETH_ALEN + 1]));
}
/* keep the upload from being interrupted, since we /* keep the upload from being interrupted, since we
* ask the chip to start transmitting before the * ask the chip to start transmitting before the
...@@ -1492,8 +1473,7 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -1492,8 +1473,7 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev)
*/ */
spin_unlock_irqrestore(&lp->lock, flags); spin_unlock_irqrestore(&lp->lock, flags);
if (net_debug) cs89_dbg(0, err, "Tx buffer not free!\n");
printk("cs89x0: Tx buffer not free!\n");
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
/* Write the contents of the packet */ /* Write the contents of the packet */
...@@ -1537,8 +1517,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id) ...@@ -1537,8 +1517,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
* vista, baby! * vista, baby!
*/ */
while ((status = ioread16(lp->virt_addr + ISQ_PORT))) { while ((status = ioread16(lp->virt_addr + ISQ_PORT))) {
if (net_debug > 4) cs89_dbg(4, debug, "%s: event=%04x\n", dev->name, status);
printk("%s: event=%04x\n", dev->name, status);
handled = 1; handled = 1;
switch (status & ISQ_EVENT_MASK) { switch (status & ISQ_EVENT_MASK) {
case ISQ_RECEIVER_EVENT: case ISQ_RECEIVER_EVENT:
...@@ -1576,9 +1555,8 @@ static irqreturn_t net_interrupt(int irq, void *dev_id) ...@@ -1576,9 +1555,8 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
netif_wake_queue(dev); /* Inform upper layers. */ netif_wake_queue(dev); /* Inform upper layers. */
} }
if (status & TX_UNDERRUN) { if (status & TX_UNDERRUN) {
if (net_debug > 0) cs89_dbg(0, err, "%s: transmit underrun\n",
printk("%s: transmit underrun\n", dev->name);
dev->name);
lp->send_underrun++; lp->send_underrun++;
if (lp->send_underrun == 3) if (lp->send_underrun == 3)
lp->send_cmd = TX_AFTER_381; lp->send_cmd = TX_AFTER_381;
...@@ -1596,18 +1574,20 @@ static irqreturn_t net_interrupt(int irq, void *dev_id) ...@@ -1596,18 +1574,20 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
if (lp->use_dma && (status & RX_DMA)) { if (lp->use_dma && (status & RX_DMA)) {
int count = readreg(dev, PP_DmaFrameCnt); int count = readreg(dev, PP_DmaFrameCnt);
while (count) { while (count) {
if (net_debug > 5) cs89_dbg(5, debug,
printk("%s: receiving %d DMA frames\n", "%s: receiving %d DMA frames\n",
dev->name, count); dev->name, count);
if (net_debug > 2 && count > 1) if (count > 1)
printk("%s: receiving %d DMA frames\n", cs89_dbg(2, debug,
dev->name, count); "%s: receiving %d DMA frames\n",
dev->name, count);
dma_rx(dev); dma_rx(dev);
if (--count == 0) if (--count == 0)
count = readreg(dev, PP_DmaFrameCnt); count = readreg(dev, PP_DmaFrameCnt);
if (net_debug > 2 && count > 0) if (count > 0)
printk("%s: continuing with %d DMA frames\n", cs89_dbg(2, debug,
dev->name, count); "%s: continuing with %d DMA frames\n",
dev->name, count);
} }
} }
#endif #endif
...@@ -1669,12 +1649,10 @@ net_rx(struct net_device *dev) ...@@ -1669,12 +1649,10 @@ net_rx(struct net_device *dev)
if (length & 1) if (length & 1)
skb->data[length-1] = ioread16(lp->virt_addr + RX_FRAME_PORT); skb->data[length-1] = ioread16(lp->virt_addr + RX_FRAME_PORT);
if (net_debug > 3) { cs89_dbg(3, debug, "%s: received %d byte packet of type %x\n",
printk("%s: received %d byte packet of type %x\n", dev->name, length,
dev->name, length, (skb->data[ETH_ALEN + ETH_ALEN] << 8) |
(skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
skb->data[ETH_ALEN + ETH_ALEN + 1]);
}
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
...@@ -1778,9 +1756,8 @@ static int set_mac_address(struct net_device *dev, void *p) ...@@ -1778,9 +1756,8 @@ static int set_mac_address(struct net_device *dev, void *p)
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
if (net_debug) cs89_dbg(0, debug, "%s: Setting MAC address to %pM\n",
printk("%s: Setting MAC address to %pM\n", dev->name, dev->dev_addr);
dev->name, dev->dev_addr);
/* set the Ethernet address */ /* set the Ethernet address */
for (i = 0; i < ETH_ALEN / 2; i++) for (i = 0; i < ETH_ALEN / 2; i++)
......
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