Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 4/5] cirrus: cs89x0: Neaten debugging and logging
From: Joe Perches @ 2012-05-18 22:56 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: Jaccon Bastiaansen
In-Reply-To: <cover.1337381533.git.joe@perches.com>

Introduce and use a debug macro to test and print.
Convert printks to pr_<level>.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/cirrus/cs89x0.c |  187 +++++++++++++++-------------------
 1 files changed, 82 insertions(+), 105 deletions(-)

diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 6e5b2c7..859f8be 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -77,8 +77,14 @@
 
 #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 =
-	"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"
 
@@ -315,8 +321,7 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
 {
 	int i;
 
-	if (net_debug > 3)
-		printk("EEPROM data from %x for %x:\n", off, len);
+	cs89_dbg(3, info, "EEPROM data from %x for %x:\n", off, len);
 	for (i = 0; i < len; i++) {
 		if (wait_eeprom_ready(dev) < 0)
 			return -1;
@@ -325,11 +330,9 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
 		if (wait_eeprom_ready(dev) < 0)
 			return -1;
 		buffer[i] = readreg(dev, PP_EEData);
-		if (net_debug > 3)
-			printk("%04x ", buffer[i]);
+		cs89_dbg(3, cont, "%04x ", buffer[i]);
 	}
-	if (net_debug > 3)
-		printk("\n");
+	cs89_dbg(3, cont, "\n");
 	return 0;
 }
 
@@ -435,8 +438,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	if (lp->chip_type != CS8900 && lp->chip_revision >= 'C')
 		lp->send_cmd = TX_NOW;
 
-	if (net_debug)
-		printk_once(version);
+	pr_info_once("%s\n", version);
 
 	pr_info("%s: cs89%c0%s rev %c found at %p ",
 		dev->name,
@@ -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 |
 				A_CNF_MEDIA_AUI | A_CNF_MEDIA_10B_T | A_CNF_MEDIA_AUTO;
 
-		if (net_debug > 1)
-			pr_info("%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n",
-				dev->name, i, lp->adapter_cnf);
+		cs89_dbg(1, info, "%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n",
+			 dev->name, i, lp->adapter_cnf);
 
 		/* IRQ. Other chips already probe, see below. */
 		if (lp->chip_type == CS8900)
 			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. */
 
@@ -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 + 1] = eeprom_buff[i] >> 8;
 		}
-		if (net_debug > 1)
-			pr_debug("%s: new adapter_cnf: 0x%x\n",
-				 dev->name, lp->adapter_cnf);
+		cs89_dbg(1, debug, "%s: new adapter_cnf: 0x%x\n",
+			 dev->name, lp->adapter_cnf);
 	}
 
 	/* 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)
 			lp->adapter_cnf |= A_CNF_MEDIA_10B_2;
 	}
 
-	if (net_debug > 1)
-		pr_debug("%s: after force 0x%x, adapter_cnf=0x%x\n",
-			 dev->name, lp->force, lp->adapter_cnf);
+	cs89_dbg(1, debug, "%s: after force 0x%x, adapter_cnf=0x%x\n",
+		 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 */
 
@@ -629,24 +628,23 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 			dev->irq = i;
 	}
 
-	printk(" IRQ %d", dev->irq);
+	pr_cont(" IRQ %d", dev->irq);
 
 #if ALLOW_DMA
 	if (lp->use_dma) {
 		get_dma_channel(dev);
-		printk(", DMA %d", dev->dma);
+		pr_cont(", DMA %d", dev->dma);
 	} else
 #endif
-		printk(", programmed I/O");
+		pr_cont(", programmed I/O");
 
 	/* 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->watchdog_timeo = HZ;
 
-	if (net_debug)
-		printk("cs89x0_probe1() successful\n");
+	cs89_dbg(0, info, "cs89x0_probe1() successful\n");
 
 	retval = register_netdev(dev);
 	if (retval)
@@ -693,8 +691,7 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
 	 * will skip the test for the ADD_PORT.
 	 */
 	if (ioport & 1) {
-		if (net_debug > 1)
-			pr_info("%s: odd ioaddr 0x%lx\n", dev->name, ioport);
+		cs89_dbg(1, info, "%s: odd ioaddr 0x%lx\n", dev->name, ioport);
 		if ((ioport & 2) != 2) {
 			if ((ioread16(io_mem + ADD_PORT) & ADD_MASK) !=
 			    ADD_SIG) {
@@ -742,8 +739,7 @@ struct net_device * __init cs89x0_probe(int unit)
 	io = dev->base_addr;
 	irq = dev->irq;
 
-	if (net_debug)
-		pr_info("cs89x0_probe(0x%x)\n", io);
+	cs89_dbg(0, info, "cs89x0_probe(0x%x)\n", io);
 
 	if (io > 0x1ff)	{	/* Check a single specified location. */
 		err = cs89x0_ioport_probe(dev, io, 0);
@@ -817,18 +813,15 @@ set_dma_cfg(struct net_device *dev)
 
 	if (lp->use_dma) {
 		if ((lp->isa_config & ANY_ISA_DMA) == 0) {
-			if (net_debug > 3)
-				printk("set_dma_cfg(): no DMA\n");
+			cs89_dbg(3, err, "set_dma_cfg(): no DMA\n");
 			return;
 		}
 		if (lp->isa_config & ISA_RxDMA) {
 			lp->curr_rx_cfg |= RX_DMA_ONLY;
-			if (net_debug > 3)
-				printk("set_dma_cfg(): RX_DMA_ONLY\n");
+			cs89_dbg(3, info, "set_dma_cfg(): RX_DMA_ONLY\n");
 		} else {
 			lp->curr_rx_cfg |= AUTO_RX_DMA;	/* not that we support it... */
-			if (net_debug > 3)
-				printk("set_dma_cfg(): AUTO_RX_DMA\n");
+			cs89_dbg(3, info, "set_dma_cfg(): AUTO_RX_DMA\n");
 		}
 	}
 }
@@ -871,10 +864,10 @@ dma_rx(struct net_device *dev)
 	status = bp[0] + (bp[1] << 8);
 	length = bp[2] + (bp[3] << 8);
 	bp += 4;
-	if (net_debug > 5) {
-		printk("%s: receiving DMA packet at %lx, status %x, length %x\n",
-		       dev->name, (unsigned long)bp, status, length);
-	}
+
+	cs89_dbg(5, debug, "%s: receiving DMA packet at %lx, status %x, length %x\n",
+		 dev->name, (unsigned long)bp, status, length);
+
 	if ((status & RX_OK) == 0) {
 		count_rx_errors(status, dev);
 		goto skip_this_frame;
@@ -883,9 +876,9 @@ dma_rx(struct net_device *dev)
 	/* Malloc up new buffer. */
 	skb = netdev_alloc_skb(dev, length + 2);
 	if (skb == NULL) {
-		if (net_debug)	/* I don't think we want to do this to a stressed system */
-			printk("%s: Memory squeeze, dropping packet\n",
-			       dev->name);
+		/* I don't think we want to do this to a stressed system */
+		cs89_dbg(0, err, "%s: Memory squeeze, dropping packet\n",
+			 dev->name);
 		dev->stats.rx_dropped++;
 
 		/* AKPM: advance bp to the next frame */
@@ -911,12 +904,11 @@ skip_this_frame:
 		bp -= lp->dmasize*1024;
 	lp->rx_dma_ptr = bp;
 
-	if (net_debug > 3) {
-		printk("%s: received %d byte DMA packet of type %x\n",
-		       dev->name, length,
-		       ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
-			skb->data[ETH_ALEN + ETH_ALEN + 1]));
-	}
+	cs89_dbg(3, info, "%s: received %d byte DMA packet of type %x\n",
+		 dev->name, length,
+		 ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
+		  skb->data[ETH_ALEN + ETH_ALEN + 1]));
+
 	skb->protocol = eth_type_trans(skb, dev);
 	netif_rx(skb);
 	dev->stats.rx_packets++;
@@ -998,8 +990,7 @@ detect_tp(struct net_device *dev)
 	int timenow = jiffies;
 	int fdx;
 
-	if (net_debug > 1)
-		printk("%s: Attempting TP\n", dev->name);
+	cs89_dbg(1, debug, "%s: Attempting TP\n", dev->name);
 
 	/* If connected to another full duplex capable 10-Base-T card
 	 * the link pulses seem to be lost when the auto detect bit in
@@ -1023,7 +1014,8 @@ detect_tp(struct net_device *dev)
 		switch (lp->force & 0xf0) {
 #if 0
 		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;
 #endif
 			/* CS8900 doesn't support AUTO, change to HALF*/
@@ -1102,18 +1094,15 @@ send_test_pkt(struct net_device *dev)
 	/* Write the contents of the packet */
 	writewords(lp, TX_FRAME_PORT, test_packet, (ETH_ZLEN + 1) >> 1);
 
-	if (net_debug > 1)
-		printk("Sending test packet ");
+	cs89_dbg(1, debug, "Sending test packet ");
 	/* wait a couple of jiffies for packet to be received */
 	for (timenow = jiffies; jiffies - timenow < 3;)
 		;
 	if ((readreg(dev, PP_TxEvent) & TX_SEND_OK_BITS) == TX_OK) {
-		if (net_debug > 1)
-			printk("succeeded\n");
+		cs89_dbg(1, cont, "succeeded\n");
 		return 1;
 	}
-	if (net_debug > 1)
-		printk("failed\n");
+	cs89_dbg(1, cont, "failed\n");
 	return 0;
 }
 
@@ -1123,8 +1112,7 @@ detect_aui(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 
-	if (net_debug > 1)
-		printk("%s: Attempting AUI\n", dev->name);
+	cs89_dbg(1, debug, "%s: Attempting AUI\n", dev->name);
 	control_dc_dc(dev, 0);
 
 	writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY);
@@ -1140,8 +1128,7 @@ detect_bnc(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 
-	if (net_debug > 1)
-		printk("%s: Attempting BNC\n", dev->name);
+	cs89_dbg(1, debug, "%s: Attempting BNC\n", dev->name);
 	control_dc_dc(dev, 1);
 
 	writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY);
@@ -1255,12 +1242,10 @@ net_open(struct net_device *dev)
 			       dev->name, lp->dmasize);
 			goto release_irq;
 		}
-		if (net_debug > 1) {
-			printk("%s: dma %lx %lx\n",
-			       dev->name,
-			       (unsigned long)lp->dma_buff,
-			       (unsigned long)isa_virt_to_bus(lp->dma_buff));
-		}
+		cs89_dbg(1, debug, "%s: dma %lx %lx\n",
+			 dev->name,
+			 (unsigned long)lp->dma_buff,
+			 (unsigned long)isa_virt_to_bus(lp->dma_buff));
 		if ((unsigned long)lp->dma_buff >= MAX_DMA_ADDRESS ||
 		    !dma_page_eq(lp->dma_buff,
 				 lp->dma_buff + lp->dmasize * 1024 - 1)) {
@@ -1442,8 +1427,7 @@ release_irq:
 #endif
 			 ));
 	netif_start_queue(dev);
-	if (net_debug > 1)
-		printk("cs89x0: net_open() succeeded\n");
+	cs89_dbg(1, debug, "net_open() succeeded\n");
 	return 0;
 bad_out:
 	return ret;
@@ -1453,10 +1437,9 @@ static void net_timeout(struct net_device *dev)
 {
 	/* If we get here, some higher level has decided we are broken.
 	   There should really be a "kick me" function call instead. */
-	if (net_debug > 0)
-		printk("%s: transmit timed out, %s?\n",
-		       dev->name,
-		       tx_done(dev) ? "IRQ conflict" : "network cable problem");
+	cs89_dbg(0, err, "%s: transmit timed out, %s?\n",
+		 dev->name,
+		 tx_done(dev) ? "IRQ conflict" : "network cable problem");
 	/* Try to restart the adaptor. */
 	netif_wake_queue(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);
 	unsigned long flags;
 
-	if (net_debug > 3) {
-		printk("%s: sent %d byte packet of type %x\n",
-		       dev->name, skb->len,
-		       ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
-			skb->data[ETH_ALEN + ETH_ALEN + 1]));
-	}
+	cs89_dbg(3, debug, "%s: sent %d byte packet of type %x\n",
+		 dev->name, skb->len,
+		 ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
+		  skb->data[ETH_ALEN + ETH_ALEN + 1]));
 
 	/* keep the upload from being interrupted, since we
 	 * 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)
 		 */
 
 		spin_unlock_irqrestore(&lp->lock, flags);
-		if (net_debug)
-			printk("cs89x0: Tx buffer not free!\n");
+		cs89_dbg(0, err, "Tx buffer not free!\n");
 		return NETDEV_TX_BUSY;
 	}
 	/* Write the contents of the packet */
@@ -1537,8 +1517,7 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 	 * vista, baby!
 	 */
 	while ((status = ioread16(lp->virt_addr + ISQ_PORT))) {
-		if (net_debug > 4)
-			printk("%s: event=%04x\n", dev->name, status);
+		cs89_dbg(4, debug, "%s: event=%04x\n", dev->name, status);
 		handled = 1;
 		switch (status & ISQ_EVENT_MASK) {
 		case ISQ_RECEIVER_EVENT:
@@ -1576,9 +1555,8 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 				netif_wake_queue(dev);	/* Inform upper layers. */
 			}
 			if (status & TX_UNDERRUN) {
-				if (net_debug > 0)
-					printk("%s: transmit underrun\n",
-					       dev->name);
+				cs89_dbg(0, err, "%s: transmit underrun\n",
+					 dev->name);
 				lp->send_underrun++;
 				if (lp->send_underrun == 3)
 					lp->send_cmd = TX_AFTER_381;
@@ -1596,18 +1574,20 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 			if (lp->use_dma && (status & RX_DMA)) {
 				int count = readreg(dev, PP_DmaFrameCnt);
 				while (count) {
-					if (net_debug > 5)
-						printk("%s: receiving %d DMA frames\n",
-						       dev->name, count);
-					if (net_debug > 2 && count > 1)
-						printk("%s: receiving %d DMA frames\n",
-						       dev->name, count);
+					cs89_dbg(5, debug,
+						 "%s: receiving %d DMA frames\n",
+						 dev->name, count);
+					if (count > 1)
+						cs89_dbg(2, debug,
+							 "%s: receiving %d DMA frames\n",
+							 dev->name, count);
 					dma_rx(dev);
 					if (--count == 0)
 						count = readreg(dev, PP_DmaFrameCnt);
-					if (net_debug > 2 && count > 0)
-						printk("%s: continuing with %d DMA frames\n",
-						       dev->name, count);
+					if (count > 0)
+						cs89_dbg(2, debug,
+							 "%s: continuing with %d DMA frames\n",
+							 dev->name, count);
 				}
 			}
 #endif
@@ -1669,12 +1649,10 @@ net_rx(struct net_device *dev)
 	if (length & 1)
 		skb->data[length-1] = ioread16(lp->virt_addr + RX_FRAME_PORT);
 
-	if (net_debug > 3) {
-		printk("%s: received %d byte packet of type %x\n",
-		       dev->name, length,
-		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) |
-		       skb->data[ETH_ALEN + ETH_ALEN + 1]);
-	}
+	cs89_dbg(3, debug, "%s: received %d byte packet of type %x\n",
+		 dev->name, length,
+		 (skb->data[ETH_ALEN + ETH_ALEN] << 8) |
+		 skb->data[ETH_ALEN + ETH_ALEN + 1]);
 
 	skb->protocol = eth_type_trans(skb, dev);
 	netif_rx(skb);
@@ -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);
 
-	if (net_debug)
-		printk("%s: Setting MAC address to %pM\n",
-		       dev->name, dev->dev_addr);
+	cs89_dbg(0, debug, "%s: Setting MAC address to %pM\n",
+		 dev->name, dev->dev_addr);
 
 	/* set the Ethernet address */
 	for (i = 0; i < ETH_ALEN / 2; i++)
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH net-next 3/5] cirrus: cs89x0: Code neatening
From: Joe Perches @ 2012-05-18 22:56 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: Jaccon Bastiaansen
In-Reply-To: <cover.1337381533.git.joe@perches.com>

Just some stylings.

Use #include <linux... not #include <asm...
Convert a test and print to a printk_once.
Combine an "if (foo) { if (bar) {" to single "if (foo && bar) {"
to save an indent level.
Convert single line "if (foo) bar;" to multiple lines.
Move some braces.
Align some long lines a bit better.

Long lines and printks with KERN_ checkpatch complaints
still exist.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/cirrus/cs89x0.c |  452 ++++++++++++++++++++--------------
 1 files changed, 272 insertions(+), 180 deletions(-)

diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index b612040..6e5b2c7 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -67,8 +67,8 @@
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
+#include <linux/io.h>
 
-#include <asm/io.h>
 #include <asm/irq.h>
 #include <linux/atomic.h>
 #if ALLOW_DMA
@@ -78,7 +78,7 @@
 #include "cs89x0.h"
 
 static char version[] __initdata =
-	"cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton\n";
+	"v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton\n";
 
 #define DRV_NAME "cs89x0"
 
@@ -97,17 +97,29 @@ static char version[] __initdata =
  */
 #if defined(CONFIG_MACH_IXDP2351)
 #define CS89x0_NONISA_IRQ
-static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0};
-static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0};
+static unsigned int netcard_portlist[] __used __initdata = {
+	IXDP2351_VIRT_CS8900_BASE, 0
+};
+static unsigned int cs8900_irq_map[] = {
+	IRQ_IXDP2351_CS8900, 0, 0, 0
+};
 #elif defined(CONFIG_ARCH_IXDP2X01)
 #define CS89x0_NONISA_IRQ
-static unsigned int netcard_portlist[] __used __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0};
-static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
+static unsigned int netcard_portlist[] __used __initdata = {
+	IXDP2X01_CS8900_VIRT_BASE, 0
+};
+static unsigned int cs8900_irq_map[] = {
+	IRQ_IXDP2X01_CS8900, 0, 0, 0
+};
 #else
 #ifndef CONFIG_CS89x0_PLATFORM
-static unsigned int netcard_portlist[] __used __initdata =
-{ 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
-static unsigned int cs8900_irq_map[] = {10, 11, 12, 5};
+static unsigned int netcard_portlist[] __used __initdata = {
+	0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240,
+	0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0
+};
+static unsigned int cs8900_irq_map[] = {
+	10, 11, 12, 5
+};
 #endif
 #endif
 
@@ -201,9 +213,13 @@ static int g_cs89x0_media__force;
 
 static int __init media_fn(char *str)
 {
-	if (!strcmp(str, "rj45")) g_cs89x0_media__force = FORCE_RJ45;
-	else if (!strcmp(str, "aui")) g_cs89x0_media__force = FORCE_AUI;
-	else if (!strcmp(str, "bnc")) g_cs89x0_media__force = FORCE_BNC;
+	if (!strcmp(str, "rj45"))
+		g_cs89x0_media__force = FORCE_RJ45;
+	else if (!strcmp(str, "aui"))
+		g_cs89x0_media__force = FORCE_AUI;
+	else if (!strcmp(str, "bnc"))
+		g_cs89x0_media__force = FORCE_BNC;
+
 	return 1;
 }
 
@@ -299,16 +315,21 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
 {
 	int i;
 
-	if (net_debug > 3) printk("EEPROM data from %x for %x:\n", off, len);
+	if (net_debug > 3)
+		printk("EEPROM data from %x for %x:\n", off, len);
 	for (i = 0; i < len; i++) {
-		if (wait_eeprom_ready(dev) < 0) return -1;
+		if (wait_eeprom_ready(dev) < 0)
+			return -1;
 		/* Now send the EEPROM read command and EEPROM location to read */
 		writereg(dev, PP_EECMD, (off + i) | EEPROM_READ_CMD);
-		if (wait_eeprom_ready(dev) < 0) return -1;
+		if (wait_eeprom_ready(dev) < 0)
+			return -1;
 		buffer[i] = readreg(dev, PP_EEData);
-		if (net_debug > 3) printk("%04x ", buffer[i]);
+		if (net_debug > 3)
+			printk("%04x ", buffer[i]);
 	}
-	if (net_debug > 3) printk("\n");
+	if (net_debug > 3)
+		printk("\n");
 	return 0;
 }
 
@@ -364,7 +385,6 @@ static int __init
 cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 {
 	struct net_local *lp = netdev_priv(dev);
-	static unsigned version_printed;
 	int i;
 	int tmp;
 	unsigned rev_type = 0;
@@ -415,8 +435,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	if (lp->chip_type != CS8900 && lp->chip_revision >= 'C')
 		lp->send_cmd = TX_NOW;
 
-	if (net_debug  &&  version_printed++ == 0)
-		printk(version);
+	if (net_debug)
+		printk_once(version);
 
 	pr_info("%s: cs89%c0%s rev %c found at %p ",
 		dev->name,
@@ -436,7 +456,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	 */
 
 	if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) ==
-	    (EEPROM_OK|EEPROM_PRESENT)) {
+	    (EEPROM_OK | EEPROM_PRESENT)) {
 		/* Load the MAC. */
 		for (i = 0; i < ETH_ALEN / 2; i++) {
 			unsigned int Addr;
@@ -507,12 +527,14 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 		 */
 
 		/* get transmission control word  but keep the autonegotiation bits */
-		if (!lp->auto_neg_cnf) lp->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
+		if (!lp->auto_neg_cnf)
+			lp->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET / 2];
 		/* Store adapter configuration */
-		if (!lp->adapter_cnf) lp->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET/2];
+		if (!lp->adapter_cnf)
+			lp->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET / 2];
 		/* Store ISA configuration */
-		lp->isa_config = eeprom_buff[ISA_CNF_OFFSET/2];
-		dev->mem_start = eeprom_buff[PACKET_PAGE_OFFSET/2] << 8;
+		lp->isa_config = eeprom_buff[ISA_CNF_OFFSET / 2];
+		dev->mem_start = eeprom_buff[PACKET_PAGE_OFFSET / 2] << 8;
 
 		/* eeprom_buff has 32-bit ints, so we can't just memcpy it */
 		/* store the initial memory base address */
@@ -528,13 +550,26 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	/* allow them to force multiple transceivers.  If they force multiple, autosense */
 	{
 		int count = 0;
-		if (lp->force & FORCE_RJ45)	{lp->adapter_cnf |= A_CNF_10B_T; count++; }
-		if (lp->force & FORCE_AUI)	{lp->adapter_cnf |= A_CNF_AUI; count++; }
-		if (lp->force & FORCE_BNC)	{lp->adapter_cnf |= A_CNF_10B_2; count++; }
-		if (count > 1)			{lp->adapter_cnf |= A_CNF_MEDIA_AUTO; }
-		else if (lp->force & FORCE_RJ45){lp->adapter_cnf |= A_CNF_MEDIA_10B_T; }
-		else if (lp->force & FORCE_AUI)	{lp->adapter_cnf |= A_CNF_MEDIA_AUI; }
-		else if (lp->force & FORCE_BNC)	{lp->adapter_cnf |= A_CNF_MEDIA_10B_2; }
+		if (lp->force & FORCE_RJ45) {
+			lp->adapter_cnf |= A_CNF_10B_T;
+			count++;
+		}
+		if (lp->force & FORCE_AUI) {
+			lp->adapter_cnf |= A_CNF_AUI;
+			count++;
+		}
+		if (lp->force & FORCE_BNC) {
+			lp->adapter_cnf |= A_CNF_10B_2;
+			count++;
+		}
+		if (count > 1)
+			lp->adapter_cnf |= A_CNF_MEDIA_AUTO;
+		else if (lp->force & FORCE_RJ45)
+			lp->adapter_cnf |= A_CNF_MEDIA_10B_T;
+		else if (lp->force & FORCE_AUI)
+			lp->adapter_cnf |= A_CNF_MEDIA_AUI;
+		else if (lp->force & FORCE_BNC)
+			lp->adapter_cnf |= A_CNF_MEDIA_10B_2;
 	}
 
 	if (net_debug > 1)
@@ -584,7 +619,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 					    IRQ_MAP_LEN / 2,
 					    irq_map_buff) >= 0) {
 				if ((irq_map_buff[0] & 0xff) == PNP_IRQ_FRMT)
-					lp->irq_map = (irq_map_buff[0] >> 8) | (irq_map_buff[1] << 8);
+					lp->irq_map = ((irq_map_buff[0] >> 8) |
+						       (irq_map_buff[1] << 8));
 			}
 #endif
 		}
@@ -599,20 +635,16 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	if (lp->use_dma) {
 		get_dma_channel(dev);
 		printk(", DMA %d", dev->dma);
-	}
-	else
+	} else
 #endif
-	{
 		printk(", programmed I/O");
-	}
 
 	/* print the ethernet address. */
-	printk(", MAC %pM", dev->dev_addr);
+	printk(", MAC %pM\n", dev->dev_addr);
 
 	dev->netdev_ops	= &net_ops;
 	dev->watchdog_timeo = HZ;
 
-	printk("\n");
 	if (net_debug)
 		printk("cs89x0_probe1() successful\n");
 
@@ -663,7 +695,7 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
 	if (ioport & 1) {
 		if (net_debug > 1)
 			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) !=
 			    ADD_SIG) {
 				pr_err("%s: bad signature 0x%x\n",
@@ -671,6 +703,7 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
 				ret = -ENODEV;
 				goto unmap;
 			}
+		}
 	}
 
 	ret = cs89x0_probe1(dev, io_mem, modular);
@@ -742,7 +775,7 @@ out:
 
 #if ALLOW_DMA
 
-#define dma_page_eq(ptr1, ptr2) ((long)(ptr1)>>17 == (long)(ptr2)>>17)
+#define dma_page_eq(ptr1, ptr2) ((long)(ptr1) >> 17 == (long)(ptr2) >> 17)
 
 static void
 get_dma_channel(struct net_device *dev)
@@ -771,11 +804,10 @@ write_dma(struct net_device *dev, int chip_type, int dma)
 	struct net_local *lp = netdev_priv(dev);
 	if ((lp->isa_config & ANY_ISA_DMA) == 0)
 		return;
-	if (chip_type == CS8900) {
-		writereg(dev, PP_CS8900_ISADMA, dma-5);
-	} else {
+	if (chip_type == CS8900)
+		writereg(dev, PP_CS8900_ISADMA, dma - 5);
+	else
 		writereg(dev, PP_CS8920_ISADMA, dma);
-	}
 }
 
 static void
@@ -836,8 +868,8 @@ dma_rx(struct net_device *dev)
 	int status, length;
 	unsigned char *bp = lp->rx_dma_ptr;
 
-	status = bp[0] + (bp[1]<<8);
-	length = bp[2] + (bp[3]<<8);
+	status = bp[0] + (bp[1] << 8);
+	length = bp[2] + (bp[3] << 8);
 	bp += 4;
 	if (net_debug > 5) {
 		printk("%s: receiving DMA packet at %lx, status %x, length %x\n",
@@ -852,13 +884,15 @@ dma_rx(struct net_device *dev)
 	skb = netdev_alloc_skb(dev, length + 2);
 	if (skb == NULL) {
 		if (net_debug)	/* I don't think we want to do this to a stressed system */
-			printk("%s: Memory squeeze, dropping packet.\n", dev->name);
+			printk("%s: Memory squeeze, dropping packet\n",
+			       dev->name);
 		dev->stats.rx_dropped++;
 
 		/* AKPM: advance bp to the next frame */
 skip_this_frame:
 		bp += (length + 3) & ~3;
-		if (bp >= lp->end_dma_buff) bp -= lp->dmasize*1024;
+		if (bp >= lp->end_dma_buff)
+			bp -= lp->dmasize * 1024;
 		lp->rx_dma_ptr = bp;
 		return;
 	}
@@ -873,13 +907,15 @@ skip_this_frame:
 		memcpy(skb_put(skb, length), bp, length);
 	}
 	bp += (length + 3) & ~3;
-	if (bp >= lp->end_dma_buff) bp -= lp->dmasize*1024;
+	if (bp >= lp->end_dma_buff)
+		bp -= lp->dmasize*1024;
 	lp->rx_dma_ptr = bp;
 
 	if (net_debug > 3) {
 		printk("%s: received %d byte DMA packet of type %x\n",
 		       dev->name, length,
-		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
+		       ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
+			skb->data[ETH_ALEN + ETH_ALEN + 1]));
 	}
 	skb->protocol = eth_type_trans(skb, dev);
 	netif_rx(skb);
@@ -919,7 +955,8 @@ static void __init reset_chip(struct net_device *dev)
 
 	/* Wait until the chip is reset */
 	reset_start_time = jiffies;
-	while ((readreg(dev, PP_SelfST) & INIT_DONE) == 0 && jiffies - reset_start_time < 2)
+	while ((readreg(dev, PP_SelfST) & INIT_DONE) == 0 &&
+	       jiffies - reset_start_time < 2)
 		;
 #endif /* !CONFIG_MACH_MX31ADS */
 }
@@ -932,8 +969,9 @@ control_dc_dc(struct net_device *dev, int on_not_off)
 	unsigned int selfcontrol;
 	int timenow = jiffies;
 	/* control the DC to DC convertor in the SelfControl register.
-	   Note: This is hooked up to a general purpose pin, might not
-	   always be a DC to DC convertor. */
+	 * Note: This is hooked up to a general purpose pin, might not
+	 * always be a DC to DC convertor.
+	 */
 
 	selfcontrol = HCB1_ENBL; /* Enable the HCB1 bit as an output */
 	if (((lp->adapter_cnf & A_CNF_DC_DC_POLARITY) != 0) ^ on_not_off)
@@ -960,18 +998,23 @@ detect_tp(struct net_device *dev)
 	int timenow = jiffies;
 	int fdx;
 
-	if (net_debug > 1) printk("%s: Attempting TP\n", dev->name);
-
-	/* 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 LineCTL is set.
-	   To overcome this the auto detect bit will be cleared whilst testing the
-	   10-Base-T interface.  This would not be necessary for the sparrow chip but
-	   is simpler to do it anyway. */
+	if (net_debug > 1)
+		printk("%s: Attempting TP\n", dev->name);
+
+	/* 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 LineCTL is set.  To overcome this the auto detect bit will
+	 * be cleared whilst testing the 10-Base-T interface.  This would
+	 * not be necessary for the sparrow chip but is simpler to do it
+	 * anyway.
+	 */
 	writereg(dev, PP_LineCTL, lp->linectl & ~AUI_ONLY);
 	control_dc_dc(dev, 0);
 
-	/* Delay for the hardware to work out if the TP cable is present - 150ms */
-	for (timenow = jiffies; jiffies - timenow < 15; )
+	/* Delay for the hardware to work out if the TP cable is present
+	 * - 150ms
+	 */
+	for (timenow = jiffies; jiffies - timenow < 15;)
 		;
 	if ((readreg(dev, PP_LineST) & LINK_OK) == 0)
 		return DETECTED_NONE;
@@ -991,7 +1034,8 @@ detect_tp(struct net_device *dev)
 		case FORCE_HALF:
 			break;
 		case FORCE_FULL:
-			writereg(dev, PP_TestCTL, readreg(dev, PP_TestCTL) | FDX_8900);
+			writereg(dev, PP_TestCTL,
+				 readreg(dev, PP_TestCTL) | FDX_8900);
 			break;
 		}
 		fdx = readreg(dev, PP_TestCTL) & FDX_8900;
@@ -1032,10 +1076,12 @@ static int
 send_test_pkt(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
-	char test_packet[] = { 0,0,0,0,0,0, 0,0,0,0,0,0,
-			       0, 46, /* A 46 in network order */
-			       0, 0, /* DSAP=0 & SSAP=0 fields */
-			       0xf3, 0 /* Control (Test Req + P bit set) */ };
+	char test_packet[] = {
+		0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0,
+		0, 46,		/* A 46 in network order */
+		0, 0,		/* DSAP=0 & SSAP=0 fields */
+		0xf3, 0		/* Control (Test Req + P bit set) */
+	};
 	long timenow = jiffies;
 
 	writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) | SERIAL_TX_ON);
@@ -1054,17 +1100,20 @@ send_test_pkt(struct net_device *dev)
 		return 0;	/* this shouldn't happen */
 
 	/* 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) printk("Sending test packet ");
+	if (net_debug > 1)
+		printk("Sending test packet ");
 	/* 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 (net_debug > 1) printk("succeeded\n");
+		if (net_debug > 1)
+			printk("succeeded\n");
 		return 1;
 	}
-	if (net_debug > 1) printk("failed\n");
+	if (net_debug > 1)
+		printk("failed\n");
 	return 0;
 }
 
@@ -1074,7 +1123,8 @@ detect_aui(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 
-	if (net_debug > 1) printk("%s: Attempting AUI\n", dev->name);
+	if (net_debug > 1)
+		printk("%s: Attempting AUI\n", dev->name);
 	control_dc_dc(dev, 0);
 
 	writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY);
@@ -1090,7 +1140,8 @@ detect_bnc(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 
-	if (net_debug > 1) printk("%s: Attempting BNC\n", dev->name);
+	if (net_debug > 1)
+		printk("%s: Attempting BNC\n", dev->name);
 	control_dc_dc(dev, 1);
 
 	writereg(dev, PP_LineCTL, (lp->linectl & ~AUTO_AUI_10BASET) | AUI_ONLY);
@@ -1155,7 +1206,8 @@ net_open(struct net_device *dev)
 
 		for (i = 2; i < CS8920_NO_INTS; i++) {
 			if ((1 << i) & lp->irq_map) {
-				if (request_irq(i, net_interrupt, 0, dev->name, dev) == 0) {
+				if (request_irq(i, net_interrupt, 0, dev->name,
+						dev) == 0) {
 					dev->irq = i;
 					write_irq(dev, lp->chip_type, i);
 					/* writereg(dev, PP_BufCFG, GENERATE_SW_INTERRUPT); */
@@ -1170,9 +1222,7 @@ net_open(struct net_device *dev)
 			ret = -EAGAIN;
 			goto bad_out;
 		}
-	}
-	else
-	{
+	} else {
 #if !defined(CS89x0_NONISA_IRQ) && !defined(CONFIG_CS89x0_PLATFORM)
 		if (((1 << dev->irq) & lp->irq_map) == 0) {
 			pr_err("%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
@@ -1196,69 +1246,78 @@ net_open(struct net_device *dev)
 	}
 
 #if ALLOW_DMA
-	if (lp->use_dma) {
-		if (lp->isa_config & ANY_ISA_DMA) {
-			unsigned long flags;
-			lp->dma_buff = (unsigned char *)__get_dma_pages(GFP_KERNEL,
-									get_order(lp->dmasize * 1024));
-
-			if (!lp->dma_buff) {
-				pr_err("%s: cannot get %dK memory for DMA\n",
-				       dev->name, lp->dmasize);
-				goto release_irq;
-			}
-			if (net_debug > 1) {
-				printk("%s: dma %lx %lx\n",
-				       dev->name,
-				       (unsigned long)lp->dma_buff,
-				       (unsigned long)isa_virt_to_bus(lp->dma_buff));
-			}
-			if ((unsigned long) lp->dma_buff >= MAX_DMA_ADDRESS ||
-			    !dma_page_eq(lp->dma_buff, lp->dma_buff+lp->dmasize*1024-1)) {
-				pr_err("%s: not usable as DMA buffer\n",
-				       dev->name);
-				goto release_irq;
-			}
-			memset(lp->dma_buff, 0, lp->dmasize * 1024);	/* Why? */
-			if (request_dma(dev->dma, dev->name)) {
-				pr_err("%s: cannot get dma channel %d\n",
-				       dev->name, dev->dma);
-				goto release_irq;
-			}
-			write_dma(dev, lp->chip_type, dev->dma);
-			lp->rx_dma_ptr = lp->dma_buff;
-			lp->end_dma_buff = lp->dma_buff + lp->dmasize*1024;
-			spin_lock_irqsave(&lp->lock, flags);
-			disable_dma(dev->dma);
-			clear_dma_ff(dev->dma);
-			set_dma_mode(dev->dma, DMA_RX_MODE); /* auto_init as well */
-			set_dma_addr(dev->dma, isa_virt_to_bus(lp->dma_buff));
-			set_dma_count(dev->dma, lp->dmasize*1024);
-			enable_dma(dev->dma);
-			spin_unlock_irqrestore(&lp->lock, flags);
+	if (lp->use_dma && (lp->isa_config & ANY_ISA_DMA)) {
+		unsigned long flags;
+		lp->dma_buff = (unsigned char *)__get_dma_pages(GFP_KERNEL,
+								get_order(lp->dmasize * 1024));
+		if (!lp->dma_buff) {
+			pr_err("%s: cannot get %dK memory for DMA\n",
+			       dev->name, lp->dmasize);
+			goto release_irq;
+		}
+		if (net_debug > 1) {
+			printk("%s: dma %lx %lx\n",
+			       dev->name,
+			       (unsigned long)lp->dma_buff,
+			       (unsigned long)isa_virt_to_bus(lp->dma_buff));
+		}
+		if ((unsigned long)lp->dma_buff >= MAX_DMA_ADDRESS ||
+		    !dma_page_eq(lp->dma_buff,
+				 lp->dma_buff + lp->dmasize * 1024 - 1)) {
+			pr_err("%s: not usable as DMA buffer\n", dev->name);
+			goto release_irq;
 		}
+		memset(lp->dma_buff, 0, lp->dmasize * 1024);	/* Why? */
+		if (request_dma(dev->dma, dev->name)) {
+			pr_err("%s: cannot get dma channel %d\n",
+			       dev->name, dev->dma);
+			goto release_irq;
+		}
+		write_dma(dev, lp->chip_type, dev->dma);
+		lp->rx_dma_ptr = lp->dma_buff;
+		lp->end_dma_buff = lp->dma_buff + lp->dmasize * 1024;
+		spin_lock_irqsave(&lp->lock, flags);
+		disable_dma(dev->dma);
+		clear_dma_ff(dev->dma);
+		set_dma_mode(dev->dma, DMA_RX_MODE); /* auto_init as well */
+		set_dma_addr(dev->dma, isa_virt_to_bus(lp->dma_buff));
+		set_dma_count(dev->dma, lp->dmasize * 1024);
+		enable_dma(dev->dma);
+		spin_unlock_irqrestore(&lp->lock, flags);
 	}
 #endif	/* ALLOW_DMA */
 
 	/* set the Ethernet address */
 	for (i = 0; i < ETH_ALEN / 2; i++)
-		writereg(dev, PP_IA + i * 2, dev->dev_addr[i * 2] | (dev->dev_addr[i * 2 + 1] << 8));
+		writereg(dev, PP_IA + i * 2,
+			 (dev->dev_addr[i * 2] |
+			  (dev->dev_addr[i * 2 + 1] << 8)));
 
 	/* while we're testing the interface, leave interrupts disabled */
 	writereg(dev, PP_BusCTL, MEMORY_ON);
 
 	/* Set the LineCTL quintuplet based on adapter configuration read from EEPROM */
-	if ((lp->adapter_cnf & A_CNF_EXTND_10B_2) && (lp->adapter_cnf & A_CNF_LOW_RX_SQUELCH))
+	if ((lp->adapter_cnf & A_CNF_EXTND_10B_2) &&
+	    (lp->adapter_cnf & A_CNF_LOW_RX_SQUELCH))
 		lp->linectl = LOW_RX_SQUELCH;
 	else
 		lp->linectl = 0;
 
 	/* check to make sure that they have the "right" hardware available */
 	switch (lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
-	case A_CNF_MEDIA_10B_T: result = lp->adapter_cnf & A_CNF_10B_T; break;
-	case A_CNF_MEDIA_AUI:   result = lp->adapter_cnf & A_CNF_AUI; break;
-	case A_CNF_MEDIA_10B_2: result = lp->adapter_cnf & A_CNF_10B_2; break;
-	default: result = lp->adapter_cnf & (A_CNF_10B_T | A_CNF_AUI | A_CNF_10B_2);
+	case A_CNF_MEDIA_10B_T:
+		result = lp->adapter_cnf & A_CNF_10B_T;
+		break;
+	case A_CNF_MEDIA_AUI:
+		result = lp->adapter_cnf & A_CNF_AUI;
+		break;
+	case A_CNF_MEDIA_10B_2:
+		result = lp->adapter_cnf & A_CNF_10B_2;
+		break;
+	default:
+		result = lp->adapter_cnf & (A_CNF_10B_T |
+					    A_CNF_AUI |
+					    A_CNF_10B_2);
 	}
 	if (!result) {
 		pr_err("%s: EEPROM is configured for unavailable media\n",
@@ -1269,7 +1328,8 @@ release_dma:
 release_irq:
 		release_dma_buff(lp);
 #endif
-		writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON));
+		writereg(dev, PP_LineCTL,
+			 readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON));
 		free_irq(dev->irq, dev);
 		ret = -EAGAIN;
 		goto bad_out;
@@ -1304,15 +1364,21 @@ release_irq:
 		break;
 	case A_CNF_MEDIA_AUTO:
 		writereg(dev, PP_LineCTL, lp->linectl | AUTO_AUI_10BASET);
-		if (lp->adapter_cnf & A_CNF_10B_T)
-			if ((result = detect_tp(dev)) != DETECTED_NONE)
+		if (lp->adapter_cnf & A_CNF_10B_T) {
+			result = detect_tp(dev);
+			if (result != DETECTED_NONE)
 				break;
-		if (lp->adapter_cnf & A_CNF_AUI)
-			if ((result = detect_aui(dev)) != DETECTED_NONE)
+		}
+		if (lp->adapter_cnf & A_CNF_AUI) {
+			result = detect_aui(dev);
+			if (result != DETECTED_NONE)
 				break;
-		if (lp->adapter_cnf & A_CNF_10B_2)
-			if ((result = detect_bnc(dev)) != DETECTED_NONE)
+		}
+		if (lp->adapter_cnf & A_CNF_10B_2) {
+			result = detect_bnc(dev);
+			if (result != DETECTED_NONE)
 				break;
+		}
 		pr_err("%s: no media detected\n", dev->name);
 		goto release_dma;
 	}
@@ -1336,7 +1402,8 @@ release_irq:
 	}
 
 	/* Turn on both receive and transmit operations */
-	writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) | SERIAL_RX_ON | SERIAL_TX_ON);
+	writereg(dev, PP_LineCTL,
+		 readreg(dev, PP_LineCTL) | SERIAL_RX_ON | SERIAL_TX_ON);
 
 	/* Receive only error free packets addressed to this card */
 	lp->rx_mode = 0;
@@ -1351,22 +1418,29 @@ release_irq:
 #endif
 	writereg(dev, PP_RxCFG, lp->curr_rx_cfg);
 
-	writereg(dev, PP_TxCFG, TX_LOST_CRS_ENBL | TX_SQE_ERROR_ENBL | TX_OK_ENBL |
-		 TX_LATE_COL_ENBL | TX_JBR_ENBL | TX_ANY_COL_ENBL | TX_16_COL_ENBL);
+	writereg(dev, PP_TxCFG, (TX_LOST_CRS_ENBL |
+				 TX_SQE_ERROR_ENBL |
+				 TX_OK_ENBL |
+				 TX_LATE_COL_ENBL |
+				 TX_JBR_ENBL |
+				 TX_ANY_COL_ENBL |
+				 TX_16_COL_ENBL));
 
-	writereg(dev, PP_BufCFG, READY_FOR_TX_ENBL | RX_MISS_COUNT_OVRFLOW_ENBL |
+	writereg(dev, PP_BufCFG, (READY_FOR_TX_ENBL |
+				  RX_MISS_COUNT_OVRFLOW_ENBL |
 #if ALLOW_DMA
-		 dma_bufcfg(dev) |
+				  dma_bufcfg(dev) |
 #endif
-		 TX_COL_COUNT_OVRFLOW_ENBL | TX_UNDERRUN_ENBL);
+				  TX_COL_COUNT_OVRFLOW_ENBL |
+				  TX_UNDERRUN_ENBL));
 
 	/* now that we've got our act together, enable everything */
-	writereg(dev, PP_BusCTL, ENABLE_IRQ
-		 | (dev->mem_start ? MEMORY_ON : 0) /* turn memory on */
+	writereg(dev, PP_BusCTL, (ENABLE_IRQ
+				  | (dev->mem_start ? MEMORY_ON : 0) /* turn memory on */
 #if ALLOW_DMA
-		 | dma_busctl(dev)
+				  | dma_busctl(dev)
 #endif
-		);
+			 ));
 	netif_start_queue(dev);
 	if (net_debug > 1)
 		printk("cs89x0: net_open() succeeded\n");
@@ -1379,8 +1453,10 @@ static void net_timeout(struct net_device *dev)
 {
 	/* If we get here, some higher level has decided we are broken.
 	   There should really be a "kick me" function call instead. */
-	if (net_debug > 0) printk("%s: transmit timed out, %s?\n", dev->name,
-				  tx_done(dev) ? "IRQ conflict ?" : "network cable problem");
+	if (net_debug > 0)
+		printk("%s: transmit timed out, %s?\n",
+		       dev->name,
+		       tx_done(dev) ? "IRQ conflict" : "network cable problem");
 	/* Try to restart the adaptor. */
 	netif_wake_queue(dev);
 }
@@ -1393,12 +1469,14 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev)
 	if (net_debug > 3) {
 		printk("%s: sent %d byte packet of type %x\n",
 		       dev->name, skb->len,
-		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
+		       ((skb->data[ETH_ALEN + ETH_ALEN] << 8) |
+			skb->data[ETH_ALEN + ETH_ALEN + 1]));
 	}
 
 	/* keep the upload from being interrupted, since we
-	   ask the chip to start transmitting before the
-	   whole packet has been completely uploaded. */
+	 * ask the chip to start transmitting before the
+	 * whole packet has been completely uploaded.
+	 */
 
 	spin_lock_irqsave(&lp->lock, flags);
 	netif_stop_queue(dev);
@@ -1414,11 +1492,12 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev)
 		 */
 
 		spin_unlock_irqrestore(&lp->lock, flags);
-		if (net_debug) printk("cs89x0: Tx buffer not free!\n");
+		if (net_debug)
+			printk("cs89x0: Tx buffer not free!\n");
 		return NETDEV_TX_BUSY;
 	}
 	/* Write the contents of the packet */
-	writewords(lp, TX_FRAME_PORT, skb->data, (skb->len+1) >> 1);
+	writewords(lp, TX_FRAME_PORT, skb->data, (skb->len + 1) >> 1);
 	spin_unlock_irqrestore(&lp->lock, flags);
 	dev->stats.tx_bytes += skb->len;
 	dev_kfree_skb(skb);
@@ -1427,10 +1506,10 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev)
 	 * We also DO NOT call netif_start_queue().
 	 *
 	 * Either of these would cause another bottom half run through
-	 * net_send_packet() before this packet has fully gone out.  That causes
-	 * us to hit the "Gasp!" above and the send is rescheduled.  it runs like
-	 * a dog.  We just return and wait for the Tx completion interrupt handler
-	 * to restart the netdevice layer
+	 * net_send_packet() before this packet has fully gone out.
+	 * That causes us to hit the "Gasp!" above and the send is rescheduled.
+	 * it runs like a dog.  We just return and wait for the Tx completion
+	 * interrupt handler to restart the netdevice layer
 	 */
 
 	return NETDEV_TX_OK;
@@ -1458,7 +1537,8 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 	 * vista, baby!
 	 */
 	while ((status = ioread16(lp->virt_addr + ISQ_PORT))) {
-		if (net_debug > 4)printk("%s: event=%04x\n", dev->name, status);
+		if (net_debug > 4)
+			printk("%s: event=%04x\n", dev->name, status);
 		handled = 1;
 		switch (status & ISQ_EVENT_MASK) {
 		case ISQ_RECEIVER_EVENT:
@@ -1496,10 +1576,14 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 				netif_wake_queue(dev);	/* Inform upper layers. */
 			}
 			if (status & TX_UNDERRUN) {
-				if (net_debug > 0) printk("%s: transmit underrun\n", dev->name);
+				if (net_debug > 0)
+					printk("%s: transmit underrun\n",
+					       dev->name);
 				lp->send_underrun++;
-				if (lp->send_underrun == 3) lp->send_cmd = TX_AFTER_381;
-				else if (lp->send_underrun == 6) lp->send_cmd = TX_AFTER_ALL;
+				if (lp->send_underrun == 3)
+					lp->send_cmd = TX_AFTER_381;
+				else if (lp->send_underrun == 6)
+					lp->send_cmd = TX_AFTER_ALL;
 				/* transmit cycle is done, although
 				 * frame wasn't transmitted - this
 				 * avoids having to wait for the upper
@@ -1513,14 +1597,17 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 				int count = readreg(dev, PP_DmaFrameCnt);
 				while (count) {
 					if (net_debug > 5)
-						printk("%s: receiving %d DMA frames\n", dev->name, count);
+						printk("%s: receiving %d DMA frames\n",
+						       dev->name, count);
 					if (net_debug > 2 && count > 1)
-						printk("%s: receiving %d DMA frames\n", dev->name, count);
+						printk("%s: receiving %d DMA frames\n",
+						       dev->name, count);
 					dma_rx(dev);
 					if (--count == 0)
 						count = readreg(dev, PP_DmaFrameCnt);
 					if (net_debug > 2 && count > 0)
-						printk("%s: continuing with %d DMA frames\n", dev->name, count);
+						printk("%s: continuing with %d DMA frames\n",
+						       dev->name, count);
 				}
 			}
 #endif
@@ -1544,7 +1631,7 @@ count_rx_errors(int status, struct net_device *dev)
 		dev->stats.rx_length_errors++;
 	if (status & RX_EXTRA_DATA)
 		dev->stats.rx_length_errors++;
-	if ((status & RX_CRC_ERROR) && !(status & (RX_EXTRA_DATA|RX_RUNT)))
+	if ((status & RX_CRC_ERROR) && !(status & (RX_EXTRA_DATA | RX_RUNT)))
 		/* per str 172 */
 		dev->stats.rx_crc_errors++;
 	if (status & RX_DRIBBLE)
@@ -1585,7 +1672,8 @@ net_rx(struct net_device *dev)
 	if (net_debug > 3) {
 		printk("%s: received %d byte packet of type %x\n",
 		       dev->name, length,
-		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
+		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) |
+		       skb->data[ETH_ALEN + ETH_ALEN + 1]);
 	}
 
 	skb->protocol = eth_type_trans(skb, dev);
@@ -1598,7 +1686,8 @@ net_rx(struct net_device *dev)
 static void release_dma_buff(struct net_local *lp)
 {
 	if (lp->dma_buff) {
-		free_pages((unsigned long)(lp->dma_buff), get_order(lp->dmasize * 1024));
+		free_pages((unsigned long)(lp->dma_buff),
+			   get_order(lp->dmasize * 1024));
 		lp->dma_buff = NULL;
 	}
 }
@@ -1656,28 +1745,29 @@ static void set_multicast_list(struct net_device *dev)
 	unsigned long flags;
 
 	spin_lock_irqsave(&lp->lock, flags);
-	if (dev->flags&IFF_PROMISC)
-	{
+	if (dev->flags & IFF_PROMISC)
 		lp->rx_mode = RX_ALL_ACCEPT;
-	}
 	else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev))
-	{
-		/* The multicast-accept list is initialized to accept-all, and we
-		   rely on higher-level filtering for now. */
+		/* The multicast-accept list is initialized to accept-all,
+		 * and we rely on higher-level filtering for now.
+		 */
 		lp->rx_mode = RX_MULTCAST_ACCEPT;
-	}
 	else
 		lp->rx_mode = 0;
 
 	writereg(dev, PP_RxCTL, DEF_RX_ACCEPT | lp->rx_mode);
 
-	/* in promiscuous mode, we accept errored packets, so we have to enable interrupts on them also */
-	writereg(dev, PP_RxCFG, lp->curr_rx_cfg |
-		 (lp->rx_mode == RX_ALL_ACCEPT ? (RX_CRC_ERROR_ENBL|RX_RUNT_ENBL|RX_EXTRA_DATA_ENBL) : 0));
+	/* in promiscuous mode, we accept errored packets,
+	 * so we have to enable interrupts on them also
+	 */
+	writereg(dev, PP_RxCFG,
+		 (lp->curr_rx_cfg |
+		  (lp->rx_mode == RX_ALL_ACCEPT)
+		  ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL)
+		  : 0));
 	spin_unlock_irqrestore(&lp->lock, flags);
 }
 
-
 static int set_mac_address(struct net_device *dev, void *p)
 {
 	int i;
@@ -1689,12 +1779,14 @@ static int set_mac_address(struct net_device *dev, void *p)
 	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
 	if (net_debug)
-		printk("%s: Setting MAC address to %pM.\n",
+		printk("%s: Setting MAC address to %pM\n",
 		       dev->name, dev->dev_addr);
 
 	/* set the Ethernet address */
 	for (i = 0; i < ETH_ALEN / 2; i++)
-		writereg(dev, PP_IA + i * 2, dev->dev_addr[i * 2] | (dev->dev_addr[i * 2 + 1] << 8));
+		writereg(dev, PP_IA + i * 2,
+			 (dev->dev_addr[i * 2] |
+			  (dev->dev_addr[i * 2 + 1] << 8)));
 
 	return 0;
 }
@@ -1871,28 +1963,28 @@ static int __init cs89x0_platform_probe(struct platform_device *pdev)
 	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dev->irq = platform_get_irq(pdev, 0);
 	if (mem_res == NULL || dev->irq <= 0) {
-		dev_warn(&dev->dev, "memory/interrupt resource missing.\n");
+		dev_warn(&dev->dev, "memory/interrupt resource missing\n");
 		err = -ENXIO;
 		goto free;
 	}
 
 	lp->size = resource_size(mem_res);
 	if (!request_mem_region(mem_res->start, lp->size, DRV_NAME)) {
-		dev_warn(&dev->dev, "request_mem_region() failed.\n");
+		dev_warn(&dev->dev, "request_mem_region() failed\n");
 		err = -EBUSY;
 		goto free;
 	}
 
 	virt_addr = ioremap(mem_res->start, lp->size);
 	if (!virt_addr) {
-		dev_warn(&dev->dev, "ioremap() failed.\n");
+		dev_warn(&dev->dev, "ioremap() failed\n");
 		err = -ENOMEM;
 		goto release;
 	}
 
 	err = cs89x0_probe1(dev, virt_addr, 0);
 	if (err) {
-		dev_warn(&dev->dev, "no cs8900 or cs8920 detected.\n");
+		dev_warn(&dev->dev, "no cs8900 or cs8920 detected\n");
 		goto unmap;
 	}
 
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH net-next 2/5] cirrus: cs89x0: Convert printks to pr_<level>
From: Joe Perches @ 2012-05-18 22:56 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: Jaccon Bastiaansen
In-Reply-To: <cover.1337381533.git.joe@perches.com>

Use more current logging styles.

Add pr_fmt.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/cirrus/cs89x0.c |  116 ++++++++++++++++++----------------
 1 files changed, 61 insertions(+), 55 deletions(-)

diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 41c8ac9..b612040 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -46,6 +46,8 @@
  *	Crystal Semiconductor data sheets.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/printk.h>
 #include <linux/errno.h>
@@ -385,15 +387,15 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 #endif
 	}
 
-	printk(KERN_DEBUG "PP_addr at %p[%x]: 0x%x\n",
-	       ioaddr, ADD_PORT, ioread16(ioaddr + ADD_PORT));
+	pr_debug("PP_addr at %p[%x]: 0x%x\n",
+		 ioaddr, ADD_PORT, ioread16(ioaddr + ADD_PORT));
 	iowrite16(PP_ChipID, ioaddr + ADD_PORT);
 
 	tmp = ioread16(ioaddr + DATA_PORT);
 	if (tmp != CHIP_EISA_ID_SIG) {
-		printk(KERN_DEBUG "%s: incorrect signature at %p[%x]: 0x%x!="
-		       CHIP_EISA_ID_SIG_STR "\n",
-		       dev->name, ioaddr, DATA_PORT, tmp);
+		pr_debug("%s: incorrect signature at %p[%x]: 0x%x!="
+			 CHIP_EISA_ID_SIG_STR "\n",
+			 dev->name, ioaddr, DATA_PORT, tmp);
 		retval = -ENODEV;
 		goto out1;
 	}
@@ -416,12 +418,12 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	if (net_debug  &&  version_printed++ == 0)
 		printk(version);
 
-	printk(KERN_INFO "%s: cs89%c0%s rev %c found at %p ",
-	       dev->name,
-	       lp->chip_type == CS8900  ? '0' : '2',
-	       lp->chip_type == CS8920M ? "M" : "",
-	       lp->chip_revision,
-	       lp->virt_addr);
+	pr_info("%s: cs89%c0%s rev %c found at %p ",
+		dev->name,
+		lp->chip_type == CS8900  ? '0' : '2',
+		lp->chip_type == CS8920M ? "M" : "",
+		lp->chip_revision,
+		lp->virt_addr);
 
 	reset_chip(dev);
 
@@ -474,8 +476,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 				A_CNF_MEDIA_AUI | A_CNF_MEDIA_10B_T | A_CNF_MEDIA_AUTO;
 
 		if (net_debug > 1)
-			printk(KERN_INFO "%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n",
-			       dev->name, i, lp->adapter_cnf);
+			pr_info("%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n",
+				dev->name, i, lp->adapter_cnf);
 
 		/* IRQ. Other chips already probe, see below. */
 		if (lp->chip_type == CS8900)
@@ -489,15 +491,15 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	/* First check to see if an EEPROM is attached. */
 
 	if ((readreg(dev, PP_SelfST) & EEPROM_PRESENT) == 0)
-		printk(KERN_WARNING "cs89x0: No EEPROM, relying on command line....\n");
+		pr_warn("No EEPROM, relying on command line....\n");
 	else if (get_eeprom_data(dev, START_EEPROM_DATA, CHKSUM_LEN, eeprom_buff) < 0) {
-		printk(KERN_WARNING "\ncs89x0: EEPROM read failed, relying on command line.\n");
+		pr_warn("EEPROM read failed, relying on command line\n");
 	} else if (get_eeprom_cksum(START_EEPROM_DATA, CHKSUM_LEN, eeprom_buff) < 0) {
 		/* Check if the chip was able to read its own configuration starting
 		   at 0 in the EEPROM*/
 		if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) !=
 		    (EEPROM_OK | EEPROM_PRESENT))
-			printk(KERN_WARNING "cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command line\n");
+			pr_warn("Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command line\n");
 
 	} else {
 		/* This reads an extended EEPROM that is not documented
@@ -519,8 +521,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 			dev->dev_addr[i * 2 + 1] = eeprom_buff[i] >> 8;
 		}
 		if (net_debug > 1)
-			printk(KERN_DEBUG "%s: new adapter_cnf: 0x%x\n",
-			       dev->name, lp->adapter_cnf);
+			pr_debug("%s: new adapter_cnf: 0x%x\n",
+				 dev->name, lp->adapter_cnf);
 	}
 
 	/* allow them to force multiple transceivers.  If they force multiple, autosense */
@@ -536,8 +538,8 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	}
 
 	if (net_debug > 1)
-		printk(KERN_DEBUG "%s: after force 0x%x, adapter_cnf=0x%x\n",
-		       dev->name, lp->force, lp->adapter_cnf);
+		pr_debug("%s: after force 0x%x, adapter_cnf=0x%x\n",
+			 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 */
 
@@ -547,10 +549,10 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	 * ifconfig IFACE hw ether AABBCCDDEEFF
 	 */
 
-	printk(KERN_INFO "cs89x0 media %s%s%s",
-	       (lp->adapter_cnf & A_CNF_10B_T) ? "RJ-45," : "",
-	       (lp->adapter_cnf & A_CNF_AUI) ? "AUI," : "",
-	       (lp->adapter_cnf & A_CNF_10B_2) ? "BNC," : "");
+	pr_info("media %s%s%s",
+		(lp->adapter_cnf & A_CNF_10B_T) ? "RJ-45," : "",
+		(lp->adapter_cnf & A_CNF_AUI) ? "AUI," : "",
+		(lp->adapter_cnf & A_CNF_10B_2) ? "BNC," : "");
 
 	lp->irq_map = 0xffff;
 
@@ -570,7 +572,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 #else
 			/* Translate the IRQ using the IRQ mapping table. */
 			if (i >= ARRAY_SIZE(cs8900_irq_map))
-				printk("\ncs89x0: invalid ISA interrupt number %d\n", i);
+				pr_err("invalid ISA interrupt number %d\n", i);
 			else
 				i = cs8900_irq_map[i];
 
@@ -660,15 +662,12 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
 	 */
 	if (ioport & 1) {
 		if (net_debug > 1)
-			printk(KERN_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 ((ioread16(io_mem + ADD_PORT) & ADD_MASK) !=
 			    ADD_SIG) {
-				printk(KERN_ERR "%s: bad signature 0x%x\n",
-				       dev->name,
-				       ioread16(io_mem + ADD_PORT));
+				pr_err("%s: bad signature 0x%x\n",
+				       dev->name, ioread16(io_mem + ADD_PORT));
 				ret = -ENODEV;
 				goto unmap;
 			}
@@ -711,7 +710,7 @@ struct net_device * __init cs89x0_probe(int unit)
 	irq = dev->irq;
 
 	if (net_debug)
-		printk(KERN_INFO "cs89x0:cs89x0_probe(0x%x)\n", io);
+		pr_info("cs89x0_probe(0x%x)\n", io);
 
 	if (io > 0x1ff)	{	/* Check a single specified location. */
 		err = cs89x0_ioport_probe(dev, io, 0);
@@ -731,7 +730,7 @@ struct net_device * __init cs89x0_probe(int unit)
 	return dev;
 out:
 	free_netdev(dev);
-	printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP\n");
+	pr_warn("no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP\n");
 	return ERR_PTR(err);
 }
 #endif
@@ -1012,10 +1011,10 @@ detect_tp(struct net_device *dev)
 		writereg(dev, PP_AutoNegCTL, lp->auto_neg_cnf & AUTO_NEG_MASK);
 
 		if ((lp->auto_neg_cnf & AUTO_NEG_BITS) == AUTO_NEG_ENABLE) {
-			printk(KERN_INFO "%s: negotiating duplex...\n", dev->name);
+			pr_info("%s: negotiating duplex...\n", dev->name);
 			while (readreg(dev, PP_AutoNegST) & AUTO_NEG_BUSY) {
 				if (jiffies - timenow > 4000) {
-					printk(KERN_ERR "**** Full / half duplex auto-negotiation timed out ****\n");
+					pr_err("**** Full / half duplex auto-negotiation timed out ****\n");
 					break;
 				}
 			}
@@ -1167,7 +1166,7 @@ net_open(struct net_device *dev)
 
 		if (i >= CS8920_NO_INTS) {
 			writereg(dev, PP_BusCTL, 0);	/* disable interrupts. */
-			printk(KERN_ERR "cs89x0: can't get an interrupt\n");
+			pr_err("can't get an interrupt\n");
 			ret = -EAGAIN;
 			goto bad_out;
 		}
@@ -1176,7 +1175,7 @@ net_open(struct net_device *dev)
 	{
 #if !defined(CS89x0_NONISA_IRQ) && !defined(CONFIG_CS89x0_PLATFORM)
 		if (((1 << dev->irq) & lp->irq_map) == 0) {
-			printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
+			pr_err("%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
 			       dev->name, dev->irq, lp->irq_map);
 			ret = -EAGAIN;
 			goto bad_out;
@@ -1191,7 +1190,7 @@ net_open(struct net_device *dev)
 		write_irq(dev, lp->chip_type, dev->irq);
 		ret = request_irq(dev->irq, net_interrupt, 0, dev->name, dev);
 		if (ret) {
-			printk(KERN_ERR "cs89x0: request_irq(%d) failed\n", dev->irq);
+			pr_err("request_irq(%d) failed\n", dev->irq);
 			goto bad_out;
 		}
 	}
@@ -1204,7 +1203,8 @@ net_open(struct net_device *dev)
 									get_order(lp->dmasize * 1024));
 
 			if (!lp->dma_buff) {
-				printk(KERN_ERR "%s: cannot get %dK memory for DMA\n", dev->name, lp->dmasize);
+				pr_err("%s: cannot get %dK memory for DMA\n",
+				       dev->name, lp->dmasize);
 				goto release_irq;
 			}
 			if (net_debug > 1) {
@@ -1215,12 +1215,14 @@ net_open(struct net_device *dev)
 			}
 			if ((unsigned long) lp->dma_buff >= MAX_DMA_ADDRESS ||
 			    !dma_page_eq(lp->dma_buff, lp->dma_buff+lp->dmasize*1024-1)) {
-				printk(KERN_ERR "%s: not usable as DMA buffer\n", dev->name);
+				pr_err("%s: not usable as DMA buffer\n",
+				       dev->name);
 				goto release_irq;
 			}
 			memset(lp->dma_buff, 0, lp->dmasize * 1024);	/* Why? */
 			if (request_dma(dev->dma, dev->name)) {
-				printk(KERN_ERR "%s: cannot get dma channel %d\n", dev->name, dev->dma);
+				pr_err("%s: cannot get dma channel %d\n",
+				       dev->name, dev->dma);
 				goto release_irq;
 			}
 			write_dma(dev, lp->chip_type, dev->dma);
@@ -1259,7 +1261,8 @@ net_open(struct net_device *dev)
 	default: result = lp->adapter_cnf & (A_CNF_10B_T | A_CNF_AUI | A_CNF_10B_2);
 	}
 	if (!result) {
-		printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name);
+		pr_err("%s: EEPROM is configured for unavailable media\n",
+		       dev->name);
 release_dma:
 #if ALLOW_DMA
 		free_dma(dev->dma);
@@ -1277,7 +1280,8 @@ release_irq:
 	case A_CNF_MEDIA_10B_T:
 		result = detect_tp(dev);
 		if (result == DETECTED_NONE) {
-			printk(KERN_WARNING "%s: 10Base-T (RJ-45) has no cable\n", dev->name);
+			pr_warn("%s: 10Base-T (RJ-45) has no cable\n",
+				dev->name);
 			if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
 				result = DETECTED_RJ45H; /* Yes! I don't care if I see a link pulse */
 		}
@@ -1285,7 +1289,7 @@ release_irq:
 	case A_CNF_MEDIA_AUI:
 		result = detect_aui(dev);
 		if (result == DETECTED_NONE) {
-			printk(KERN_WARNING "%s: 10Base-5 (AUI) has no cable\n", dev->name);
+			pr_warn("%s: 10Base-5 (AUI) has no cable\n", dev->name);
 			if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
 				result = DETECTED_AUI; /* Yes! I don't care if I see a carrrier */
 		}
@@ -1293,7 +1297,7 @@ release_irq:
 	case A_CNF_MEDIA_10B_2:
 		result = detect_bnc(dev);
 		if (result == DETECTED_NONE) {
-			printk(KERN_WARNING "%s: 10Base-2 (BNC) has no cable\n", dev->name);
+			pr_warn("%s: 10Base-2 (BNC) has no cable\n", dev->name);
 			if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
 				result = DETECTED_BNC; /* Yes! I don't care if I can xmit a packet */
 		}
@@ -1309,24 +1313,25 @@ release_irq:
 		if (lp->adapter_cnf & A_CNF_10B_2)
 			if ((result = detect_bnc(dev)) != DETECTED_NONE)
 				break;
-		printk(KERN_ERR "%s: no media detected\n", dev->name);
+		pr_err("%s: no media detected\n", dev->name);
 		goto release_dma;
 	}
 	switch (result) {
 	case DETECTED_NONE:
-		printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name);
+		pr_err("%s: no network cable attached to configured media\n",
+		       dev->name);
 		goto release_dma;
 	case DETECTED_RJ45H:
-		printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
+		pr_info("%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
 		break;
 	case DETECTED_RJ45F:
-		printk(KERN_INFO "%s: using full-duplex 10Base-T (RJ-45)\n", dev->name);
+		pr_info("%s: using full-duplex 10Base-T (RJ-45)\n", dev->name);
 		break;
 	case DETECTED_AUI:
-		printk(KERN_INFO "%s: using 10Base-5 (AUI)\n", dev->name);
+		pr_info("%s: using 10Base-5 (AUI)\n", dev->name);
 		break;
 	case DETECTED_BNC:
-		printk(KERN_INFO "%s: using 10Base-2 (BNC)\n", dev->name);
+		pr_info("%s: using 10Base-2 (BNC)\n", dev->name);
 		break;
 	}
 
@@ -1566,7 +1571,7 @@ net_rx(struct net_device *dev)
 	skb = netdev_alloc_skb(dev, length + 2);
 	if (skb == NULL) {
 #if 0		/* Again, this seems a cruel thing to do */
-		printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
+		pr_warn("%s: Memory squeeze, dropping packet\n", dev->name);
 #endif
 		dev->stats.rx_dropped++;
 		return;
@@ -1808,8 +1813,8 @@ int __init init_module(void)
 		lp->auto_neg_cnf = AUTO_NEG_ENABLE;
 
 	if (io == 0) {
-		printk(KERN_ERR "cs89x0.c: Module autoprobing not allowed.\n");
-		printk(KERN_ERR "cs89x0.c: Append io=0xNNN\n");
+		pr_err("Module autoprobing not allowed\n");
+		pr_err("Append io=0xNNN\n");
 		ret = -EPERM;
 		goto out;
 	} else if (io <= 0x1ff) {
@@ -1819,7 +1824,8 @@ int __init init_module(void)
 
 #if ALLOW_DMA
 	if (use_dma && dmasize != 16 && dmasize != 64) {
-		printk(KERN_ERR "cs89x0.c: dma size must be either 16K or 64K, not %dK\n", dmasize);
+		pr_err("dma size must be either 16K or 64K, not %dK\n",
+		       dmasize);
 		ret = -EPERM;
 		goto out;
 	}
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH net-next 1/5] cirrus: cs89x0: Code style neatening
From: Joe Perches @ 2012-05-18 22:56 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: Jaccon Bastiaansen
In-Reply-To: <cover.1337381533.git.joe@perches.com>

Neaten the comments and reflow the code without
changing anything other than whitespace.

git diff -w shows just comment neatening and a few
line removals.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ethernet/cirrus/cs89x0.c |  734 +++++++++++++++-------------------
 1 files changed, 323 insertions(+), 411 deletions(-)

diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 1d59030..41c8ac9 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -1,105 +1,27 @@
 /* cs89x0.c: A Crystal Semiconductor (Now Cirrus Logic) CS89[02]0
- *  driver for linux.
+ *           driver for linux.
+ * Written 1996 by Russell Nelson, with reference to skeleton.c
+ * written 1993-1994 by Donald Becker.
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ * The author may be reached at nelson@crynwr.com, Crynwr
+ * Software, 521 Pleasant Valley Rd., Potsdam, NY 13676
+ *
+ * Other contributors:
+ * Mike Cruse        : mcruse@cti-ltd.com
+ * Russ Nelson
+ * Melody Lee        : ethernet@crystal.cirrus.com
+ * Alan Cox
+ * Andrew Morton
+ * Oskar Schirmer    : oskar@scara.com
+ * Deepak Saxena     : dsaxena@plexity.net
+ * Dmitry Pervushin  : dpervushin@ru.mvista.com
+ * Deepak Saxena     : dsaxena@plexity.net
+ * Domenico Andreoli : cavokz@gmail.com
  */
 
-/*
-	Written 1996 by Russell Nelson, with reference to skeleton.c
-	written 1993-1994 by Donald Becker.
-
-	This software may be used and distributed according to the terms
-	of the GNU General Public License, incorporated herein by reference.
-
-        The author may be reached at nelson@crynwr.com, Crynwr
-        Software, 521 Pleasant Valley Rd., Potsdam, NY 13676
-
-  Changelog:
-
-  Mike Cruse        : mcruse@cti-ltd.com
-                    : Changes for Linux 2.0 compatibility.
-                    : Added dev_id parameter in net_interrupt(),
-                    : request_irq() and free_irq(). Just NULL for now.
-
-  Mike Cruse        : Added MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros
-                    : in net_open() and net_close() so kerneld would know
-                    : that the module is in use and wouldn't eject the
-                    : driver prematurely.
-
-  Mike Cruse        : Rewrote init_module() and cleanup_module using 8390.c
-                    : as an example. Disabled autoprobing in init_module(),
-                    : not a good thing to do to other devices while Linux
-                    : is running from all accounts.
-
-  Russ Nelson       : Jul 13 1998.  Added RxOnly DMA support.
-
-  Melody Lee        : Aug 10 1999.  Changes for Linux 2.2.5 compatibility.
-                    : email: ethernet@crystal.cirrus.com
-
-  Alan Cox          : Removed 1.2 support, added 2.1 extra counters.
-
-  Andrew Morton     : Kernel 2.3.48
-                    : Handle kmalloc() failures
-                    : Other resource allocation fixes
-                    : Add SMP locks
-                    : Integrate Russ Nelson's ALLOW_DMA functionality back in.
-                    : If ALLOW_DMA is true, make DMA runtime selectable
-                    : Folded in changes from Cirrus (Melody Lee
-                    : <klee@crystal.cirrus.com>)
-                    : Don't call netif_wake_queue() in net_send_packet()
-                    : Fixed an out-of-mem bug in dma_rx()
-                    : Updated Documentation/networking/cs89x0.txt
-
-  Andrew Morton     : Kernel 2.3.99-pre1
-                    : Use skb_reserve to longword align IP header (two places)
-                    : Remove a delay loop from dma_rx()
-                    : Replace '100' with HZ
-                    : Clean up a couple of skb API abuses
-                    : Added 'cs89x0_dma=N' kernel boot option
-                    : Correctly initialise lp->lock in non-module compile
-
-  Andrew Morton     : Kernel 2.3.99-pre4-1
-                    : MOD_INC/DEC race fix (see
-                    : http://www.uwsg.indiana.edu/hypermail/linux/kernel/0003.3/1532.html)
-
-  Andrew Morton     : Kernel 2.4.0-test7-pre2
-                    : Enhanced EEPROM support to cover more devices,
-                    :   abstracted IRQ mapping to support CONFIG_ARCH_CLPS7500 arch
-                    :   (Jason Gunthorpe <jgg@ualberta.ca>)
-
-  Andrew Morton     : Kernel 2.4.0-test11-pre4
-                    : Use dev->name in request_*() (Andrey Panin)
-                    : Fix an error-path memleak in init_module()
-                    : Preserve return value from request_irq()
-                    : Fix type of `media' module parm (Keith Owens)
-                    : Use SET_MODULE_OWNER()
-                    : Tidied up strange request_irq() abuse in net_open().
-
-  Andrew Morton     : Kernel 2.4.3-pre1
-                    : Request correct number of pages for DMA (Hugh Dickens)
-                    : Select PP_ChipID _after_ unregister_netdev in cleanup_module()
-                    :  because unregister_netdev() calls get_stats.
-                    : Make `version[]' __initdata
-                    : Uninlined the read/write reg/word functions.
-
-  Oskar Schirmer    : oskar@scara.com
-                    : HiCO.SH4 (superh) support added (irq#1, cs89x0_media=)
-
-  Deepak Saxena     : dsaxena@plexity.net
-                    : Intel IXDP2x01 (XScale ixp2x00 NPU) platform support
-
-  Dmitry Pervushin  : dpervushin@ru.mvista.com
-                    : PNX010X platform support
-
-  Deepak Saxena     : dsaxena@plexity.net
-                    : Intel IXDP2351 platform support
-
-  Dmitry Pervushin  : dpervushin@ru.mvista.com
-                    : PNX010X platform support
-
-  Domenico Andreoli : cavokz@gmail.com
-                    : QQ2440 platform support
-
-*/
-
 
 /*
  * Set this to zero to disable DMA code
@@ -119,14 +41,10 @@
  */
 #define DEBUGGING	1
 
-/*
-  Sources:
-
-	Crynwr packet driver epktisa.
-
-	Crystal Semiconductor data sheets.
-
-*/
+/* Sources:
+ *	Crynwr packet driver epktisa.
+ *	Crystal Semiconductor data sheets.
+ */
 
 #include <linux/module.h>
 #include <linux/printk.h>
@@ -158,21 +76,23 @@
 #include "cs89x0.h"
 
 static char version[] __initdata =
-"cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton\n";
+	"cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton\n";
 
 #define DRV_NAME "cs89x0"
 
 /* First, a few definitions that the brave might change.
-   A zero-terminated list of I/O addresses to be probed. Some special flags..
-      Addr & 1 = Read back the address port, look for signature and reset
-                 the page window before probing
-      Addr & 3 = Reset the page window and probe
-   The CLPS eval board has the Cirrus chip at 0x80090300, in ARM IO space,
-   but it is possible that a Cirrus board could be plugged into the ISA
-   slots. */
+ * A zero-terminated list of I/O addresses to be probed. Some special flags..
+ * Addr & 1 = Read back the address port, look for signature and reset
+ * the page window before probing
+ * Addr & 3 = Reset the page window and probe
+ * The CLPS eval board has the Cirrus chip at 0x80090300, in ARM IO space,
+ * but it is possible that a Cirrus board could be plugged into the ISA
+ * slots.
+ */
 /* The cs8900 has 4 IRQ pins, software selectable. cs8900_irq_map maps
-   them to system IRQ numbers. This mapping is card specific and is set to
-   the configuration of the Cirrus Eval board for this chip. */
+ * them to system IRQ numbers. This mapping is card specific and is set to
+ * the configuration of the Cirrus Eval board for this chip.
+ */
 #if defined(CONFIG_MACH_IXDP2351)
 #define CS89x0_NONISA_IRQ
 static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0};
@@ -184,8 +104,8 @@ static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
 #else
 #ifndef CONFIG_CS89x0_PLATFORM
 static unsigned int netcard_portlist[] __used __initdata =
-   { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
-static unsigned int cs8900_irq_map[] = {10,11,12,5};
+{ 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
+static unsigned int cs8900_irq_map[] = {10, 11, 12, 5};
 #endif
 #endif
 
@@ -268,7 +188,7 @@ static int g_cs89x0_dma;
 
 static int __init dma_fn(char *str)
 {
-	g_cs89x0_dma = simple_strtol(str,NULL,0);
+	g_cs89x0_dma = simple_strtol(str, NULL, 0);
 	return 1;
 }
 
@@ -362,10 +282,11 @@ static int __init
 wait_eeprom_ready(struct net_device *dev)
 {
 	int timeout = jiffies;
-	/* check to see if the EEPROM is ready, a timeout is used -
-	   just in case EEPROM is ready when SI_BUSY in the
-	   PP_SelfST is clear */
-	while(readreg(dev, PP_SelfST) & SI_BUSY)
+	/* check to see if the EEPROM is ready,
+	 * a timeout is used just in case EEPROM is ready when
+	 * SI_BUSY in the PP_SelfST is clear
+	 */
+	while (readreg(dev, PP_SelfST) & SI_BUSY)
 		if (jiffies - timeout >= 40)
 			return -1;
 	return 0;
@@ -376,7 +297,7 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
 {
 	int i;
 
-	if (net_debug > 3) printk("EEPROM data from %x for %x:\n",off,len);
+	if (net_debug > 3) printk("EEPROM data from %x for %x:\n", off, len);
 	for (i = 0; i < len; i++) {
 		if (wait_eeprom_ready(dev) < 0) return -1;
 		/* Now send the EEPROM read command and EEPROM location to read */
@@ -386,7 +307,7 @@ get_eeprom_data(struct net_device *dev, int off, int len, int *buffer)
 		if (net_debug > 3) printk("%04x ", buffer[i]);
 	}
 	if (net_debug > 3) printk("\n");
-        return 0;
+	return 0;
 }
 
 static int  __init
@@ -420,10 +341,10 @@ static const struct net_device_ops net_ops = {
 	.ndo_open		= net_open,
 	.ndo_stop		= net_close,
 	.ndo_tx_timeout		= net_timeout,
-	.ndo_start_xmit 	= net_send_packet,
+	.ndo_start_xmit		= net_send_packet,
 	.ndo_get_stats		= net_get_stats,
 	.ndo_set_rx_mode	= set_multicast_list,
-	.ndo_set_mac_address 	= set_mac_address,
+	.ndo_set_mac_address	= set_mac_address,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= net_poll_controller,
 #endif
@@ -431,12 +352,12 @@ static const struct net_device_ops net_ops = {
 	.ndo_validate_addr	= eth_validate_addr,
 };
 
-/* This is the real probe routine.  Linux has a history of friendly device
-   probes on the ISA bus.  A good device probes avoids doing writes, and
-   verifies that the correct device exists and functions.
-   Return 0 on success.
+/* This is the real probe routine.
+ * Linux has a history of friendly device probes on the ISA bus.
+ * A good device probes avoids doing writes, and
+ * verifies that the correct device exists and functions.
+ * Return 0 on success.
  */
-
 static int __init
 cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 {
@@ -462,7 +383,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 #endif
 		lp->force = g_cs89x0_media__force;
 #endif
-        }
+	}
 
 	printk(KERN_DEBUG "PP_addr at %p[%x]: 0x%x\n",
 	       ioaddr, ADD_PORT, ioread16(ioaddr + ADD_PORT));
@@ -471,9 +392,9 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 	tmp = ioread16(ioaddr + DATA_PORT);
 	if (tmp != CHIP_EISA_ID_SIG) {
 		printk(KERN_DEBUG "%s: incorrect signature at %p[%x]: 0x%x!="
-			CHIP_EISA_ID_SIG_STR "\n",
-			dev->name, ioaddr, DATA_PORT, tmp);
-  		retval = -ENODEV;
+		       CHIP_EISA_ID_SIG_STR "\n",
+		       dev->name, ioaddr, DATA_PORT, tmp);
+		retval = -ENODEV;
 		goto out1;
 	}
 
@@ -481,11 +402,11 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 
 	/* get the chip type */
 	rev_type = readreg(dev, PRODUCT_ID_ADD);
-	lp->chip_type = rev_type &~ REVISON_BITS;
+	lp->chip_type = rev_type & ~REVISON_BITS;
 	lp->chip_revision = ((rev_type & REVISON_BITS) >> 8) + 'A';
 
 	/* Check the chip type and revision in order to set the correct send command
-	CS8920 revision C and CS8900 revision F can use the faster send. */
+	   CS8920 revision C and CS8900 revision F can use the faster send. */
 	lp->send_cmd = TX_AFTER_381;
 	if (lp->chip_type == CS8900 && lp->chip_revision >= 'F')
 		lp->send_cmd = TX_NOW;
@@ -497,45 +418,46 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 
 	printk(KERN_INFO "%s: cs89%c0%s rev %c found at %p ",
 	       dev->name,
-	       lp->chip_type==CS8900?'0':'2',
-	       lp->chip_type==CS8920M?"M":"",
+	       lp->chip_type == CS8900  ? '0' : '2',
+	       lp->chip_type == CS8920M ? "M" : "",
 	       lp->chip_revision,
 	       lp->virt_addr);
 
 	reset_chip(dev);
 
-        /* Here we read the current configuration of the chip. If there
-	   is no Extended EEPROM then the idea is to not disturb the chip
-	   configuration, it should have been correctly setup by automatic
-	   EEPROM read on reset. So, if the chip says it read the EEPROM
-	   the driver will always do *something* instead of complain that
-	   adapter_cnf is 0. */
-
-
-        if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) ==
-	      (EEPROM_OK|EEPROM_PRESENT)) {
-	        /* Load the MAC. */
-		for (i=0; i < ETH_ALEN/2; i++) {
-	                unsigned int Addr;
-			Addr = readreg(dev, PP_IA+i*2);
-		        dev->dev_addr[i*2] = Addr & 0xFF;
-		        dev->dev_addr[i*2+1] = Addr >> 8;
+	/* Here we read the current configuration of the chip.
+	 * If there is no Extended EEPROM then the idea is to not disturb
+	 * the chip configuration, it should have been correctly setup by
+	 * automatic EEPROM read on reset. So, if the chip says it read
+	 * the EEPROM the driver will always do *something* instead of
+	 * complain that adapter_cnf is 0.
+	 */
+
+	if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) ==
+	    (EEPROM_OK|EEPROM_PRESENT)) {
+		/* Load the MAC. */
+		for (i = 0; i < ETH_ALEN / 2; i++) {
+			unsigned int Addr;
+			Addr = readreg(dev, PP_IA + i * 2);
+			dev->dev_addr[i * 2] = Addr & 0xFF;
+			dev->dev_addr[i * 2 + 1] = Addr >> 8;
 		}
 
-	   	/* Load the Adapter Configuration.
-		   Note:  Barring any more specific information from some
-		   other source (ie EEPROM+Schematics), we would not know
-		   how to operate a 10Base2 interface on the AUI port.
-		   However, since we  do read the status of HCB1 and use
-		   settings that always result in calls to control_dc_dc(dev,0)
-		   a BNC interface should work if the enable pin
-		   (dc/dc converter) is on HCB1. It will be called AUI
-		   however. */
+		/* Load the Adapter Configuration.
+		 * Note:  Barring any more specific information from some
+		 * other source (ie EEPROM+Schematics), we would not know
+		 * how to operate a 10Base2 interface on the AUI port.
+		 * However, since we  do read the status of HCB1 and use
+		 * settings that always result in calls to control_dc_dc(dev,0)
+		 * a BNC interface should work if the enable pin
+		 * (dc/dc converter) is on HCB1.
+		 * It will be called AUI however.
+		 */
 
 		lp->adapter_cnf = 0;
 		i = readreg(dev, PP_LineCTL);
 		/* Preserve the setting of the HCB1 pin. */
-		if ((i & (HCB1 | HCB1_ENBL)) ==  (HCB1 | HCB1_ENBL))
+		if ((i & (HCB1 | HCB1_ENBL)) == (HCB1 | HCB1_ENBL))
 			lp->adapter_cnf |= A_CNF_DC_DC_POLARITY;
 		/* Save the sqelch bit */
 		if ((i & LOW_RX_SQUELCH) == LOW_RX_SQUELCH)
@@ -549,92 +471,94 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 		/* Check if the card is in Auto mode. */
 		if ((i & (AUI_ONLY | AUTO_AUI_10BASET)) == AUTO_AUI_10BASET)
 			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)
 			printk(KERN_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. */
 		if (lp->chip_type == CS8900)
 			lp->isa_config = readreg(dev, PP_CS8900_ISAINT) & INT_NO_MASK;
 
-		printk( "[Cirrus EEPROM] ");
+		printk("[Cirrus EEPROM] ");
 	}
 
-        printk("\n");
+	printk("\n");
 
 	/* First check to see if an EEPROM is attached. */
 
 	if ((readreg(dev, PP_SelfST) & EEPROM_PRESENT) == 0)
 		printk(KERN_WARNING "cs89x0: No EEPROM, relying on command line....\n");
-	else if (get_eeprom_data(dev, START_EEPROM_DATA,CHKSUM_LEN,eeprom_buff) < 0) {
+	else if (get_eeprom_data(dev, START_EEPROM_DATA, CHKSUM_LEN, eeprom_buff) < 0) {
 		printk(KERN_WARNING "\ncs89x0: EEPROM read failed, relying on command line.\n");
-        } else if (get_eeprom_cksum(START_EEPROM_DATA,CHKSUM_LEN,eeprom_buff) < 0) {
+	} else if (get_eeprom_cksum(START_EEPROM_DATA, CHKSUM_LEN, eeprom_buff) < 0) {
 		/* Check if the chip was able to read its own configuration starting
 		   at 0 in the EEPROM*/
 		if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) !=
-		    (EEPROM_OK|EEPROM_PRESENT))
-                	printk(KERN_WARNING "cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command line\n");
+		    (EEPROM_OK | EEPROM_PRESENT))
+			printk(KERN_WARNING "cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command line\n");
 
-        } else {
+	} else {
 		/* This reads an extended EEPROM that is not documented
-		   in the CS8900 datasheet. */
-
-                /* get transmission control word  but keep the autonegotiation bits */
-                if (!lp->auto_neg_cnf) lp->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
-                /* Store adapter configuration */
-                if (!lp->adapter_cnf) lp->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET/2];
-                /* Store ISA configuration */
-                lp->isa_config = eeprom_buff[ISA_CNF_OFFSET/2];
-                dev->mem_start = eeprom_buff[PACKET_PAGE_OFFSET/2] << 8;
-
-                /* eeprom_buff has 32-bit ints, so we can't just memcpy it */
-                /* store the initial memory base address */
-                for (i = 0; i < ETH_ALEN/2; i++) {
-                        dev->dev_addr[i*2] = eeprom_buff[i];
-                        dev->dev_addr[i*2+1] = eeprom_buff[i] >> 8;
-                }
+		 * in the CS8900 datasheet.
+		 */
+
+		/* get transmission control word  but keep the autonegotiation bits */
+		if (!lp->auto_neg_cnf) lp->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
+		/* Store adapter configuration */
+		if (!lp->adapter_cnf) lp->adapter_cnf = eeprom_buff[ADAPTER_CNF_OFFSET/2];
+		/* Store ISA configuration */
+		lp->isa_config = eeprom_buff[ISA_CNF_OFFSET/2];
+		dev->mem_start = eeprom_buff[PACKET_PAGE_OFFSET/2] << 8;
+
+		/* eeprom_buff has 32-bit ints, so we can't just memcpy it */
+		/* store the initial memory base address */
+		for (i = 0; i < ETH_ALEN / 2; i++) {
+			dev->dev_addr[i * 2] = eeprom_buff[i];
+			dev->dev_addr[i * 2 + 1] = eeprom_buff[i] >> 8;
+		}
 		if (net_debug > 1)
 			printk(KERN_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 */
+	{
 		int count = 0;
 		if (lp->force & FORCE_RJ45)	{lp->adapter_cnf |= A_CNF_10B_T; count++; }
-		if (lp->force & FORCE_AUI) 	{lp->adapter_cnf |= A_CNF_AUI; count++; }
+		if (lp->force & FORCE_AUI)	{lp->adapter_cnf |= A_CNF_AUI; count++; }
 		if (lp->force & FORCE_BNC)	{lp->adapter_cnf |= A_CNF_10B_2; count++; }
 		if (count > 1)			{lp->adapter_cnf |= A_CNF_MEDIA_AUTO; }
 		else if (lp->force & FORCE_RJ45){lp->adapter_cnf |= A_CNF_MEDIA_10B_T; }
 		else if (lp->force & FORCE_AUI)	{lp->adapter_cnf |= A_CNF_MEDIA_AUI; }
 		else if (lp->force & FORCE_BNC)	{lp->adapter_cnf |= A_CNF_MEDIA_10B_2; }
-        }
+	}
 
 	if (net_debug > 1)
 		printk(KERN_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 */
 
-        /* FIXME: We don't let you set the IMM bit from the command line: add it to lp->auto_neg_cnf here */
+	/* FIXME: We don't let you set the IMM bit from the command line: add it to lp->auto_neg_cnf here */
 
-        /* FIXME: we don't set the Ethernet address on the command line.  Use
-           ifconfig IFACE hw ether AABBCCDDEEFF */
+	/* FIXME: we don't set the Ethernet address on the command line.  Use
+	 * ifconfig IFACE hw ether AABBCCDDEEFF
+	 */
 
 	printk(KERN_INFO "cs89x0 media %s%s%s",
-	       (lp->adapter_cnf & A_CNF_10B_T)?"RJ-45,":"",
-	       (lp->adapter_cnf & A_CNF_AUI)?"AUI,":"",
-	       (lp->adapter_cnf & A_CNF_10B_2)?"BNC,":"");
+	       (lp->adapter_cnf & A_CNF_10B_T) ? "RJ-45," : "",
+	       (lp->adapter_cnf & A_CNF_AUI) ? "AUI," : "",
+	       (lp->adapter_cnf & A_CNF_10B_2) ? "BNC," : "");
 
 	lp->irq_map = 0xffff;
 
 	/* If this is a CS8900 then no pnp soft */
 	if (lp->chip_type != CS8900 &&
 	    /* Check if the ISA IRQ has been set  */
-		(i = readreg(dev, PP_CS8920_ISAINT) & 0xff,
-		 (i != 0 && i < CS8920_NO_INTS))) {
+	    (i = readreg(dev, PP_CS8920_ISAINT) & 0xff,
+	     (i != 0 && i < CS8920_NO_INTS))) {
 		if (!dev->irq)
 			dev->irq = i;
 	} else {
@@ -642,7 +566,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 #ifndef CONFIG_CS89x0_PLATFORM
 		if (lp->chip_type == CS8900) {
 #ifdef CS89x0_NONISA_IRQ
-		        i = cs8900_irq_map[0];
+			i = cs8900_irq_map[0];
 #else
 			/* Translate the IRQ using the IRQ mapping table. */
 			if (i >= ARRAY_SIZE(cs8900_irq_map))
@@ -655,10 +579,10 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular)
 			int irq_map_buff[IRQ_MAP_LEN/2];
 
 			if (get_eeprom_data(dev, IRQ_MAP_EEPROM_DATA,
-					    IRQ_MAP_LEN/2,
+					    IRQ_MAP_LEN / 2,
 					    irq_map_buff) >= 0) {
 				if ((irq_map_buff[0] & 0xff) == PNP_IRQ_FRMT)
-					lp->irq_map = (irq_map_buff[0]>>8) | (irq_map_buff[1] << 8);
+					lp->irq_map = (irq_map_buff[0] >> 8) | (irq_map_buff[1] << 8);
 			}
 #endif
 		}
@@ -730,9 +654,10 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
 	}
 
 	/* if they give us an odd I/O address, then do ONE write to
-	   the address port, to get it back to address zero, where we
-	   expect to find the EISA signature word. An IO with a base of 0x3
-	   will skip the test for the ADD_PORT. */
+	 * the address port, to get it back to address zero, where we
+	 * expect to find the EISA signature word. An IO with a base of 0x3
+	 * will skip the test for the ADD_PORT.
+	 */
 	if (ioport & 1) {
 		if (net_debug > 1)
 			printk(KERN_INFO "%s: odd ioaddr 0x%lx\n",
@@ -742,8 +667,8 @@ cs89x0_ioport_probe(struct net_device *dev, unsigned long ioport, int modular)
 			if ((ioread16(io_mem + ADD_PORT) & ADD_MASK) !=
 			    ADD_SIG) {
 				printk(KERN_ERR "%s: bad signature 0x%x\n",
-					dev->name,
-					ioread16(io_mem + ADD_PORT));
+				       dev->name,
+				       ioread16(io_mem + ADD_PORT));
 				ret = -ENODEV;
 				goto unmap;
 			}
@@ -762,12 +687,12 @@ out:
 
 #ifndef MODULE
 /* Check for a network adaptor of this type, and return '0' iff one exists.
-   If dev->base_addr == 0, probe all likely locations.
-   If dev->base_addr == 1, always return failure.
-   If dev->base_addr == 2, allocate space for the device and return success
-   (detachable devices only).
-   Return 0 on success.
-   */
+ * If dev->base_addr == 0, probe all likely locations.
+ * If dev->base_addr == 1, always return failure.
+ * If dev->base_addr == 2, allocate space for the device and return success
+ * (detachable devices only).
+ * Return 0 on success.
+ */
 
 struct net_device * __init cs89x0_probe(int unit)
 {
@@ -814,7 +739,7 @@ out:
 
 /*********************************
  * This page contains DMA routines
-**********************************/
+ *********************************/
 
 #if ALLOW_DMA
 
@@ -882,7 +807,7 @@ dma_bufcfg(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 	if (lp->use_dma)
-		return (lp->isa_config & ANY_ISA_DMA)? RX_DMA_ENBL : 0;
+		return (lp->isa_config & ANY_ISA_DMA) ? RX_DMA_ENBL : 0;
 	else
 		return 0;
 }
@@ -916,8 +841,8 @@ dma_rx(struct net_device *dev)
 	length = bp[2] + (bp[3]<<8);
 	bp += 4;
 	if (net_debug > 5) {
-		printk(	"%s: receiving DMA packet at %lx, status %x, length %x\n",
-			dev->name, (unsigned long)bp, status, length);
+		printk("%s: receiving DMA packet at %lx, status %x, length %x\n",
+		       dev->name, (unsigned long)bp, status, length);
 	}
 	if ((status & RX_OK) == 0) {
 		count_rx_errors(status, dev);
@@ -942,22 +867,22 @@ skip_this_frame:
 
 	if (bp + length > lp->end_dma_buff) {
 		int semi_cnt = lp->end_dma_buff - bp;
-		memcpy(skb_put(skb,semi_cnt), bp, semi_cnt);
-		memcpy(skb_put(skb,length - semi_cnt), lp->dma_buff,
+		memcpy(skb_put(skb, semi_cnt), bp, semi_cnt);
+		memcpy(skb_put(skb, length - semi_cnt), lp->dma_buff,
 		       length - semi_cnt);
 	} else {
-		memcpy(skb_put(skb,length), bp, length);
+		memcpy(skb_put(skb, length), bp, length);
 	}
 	bp += (length + 3) & ~3;
 	if (bp >= lp->end_dma_buff) bp -= lp->dmasize*1024;
 	lp->rx_dma_ptr = bp;
 
 	if (net_debug > 3) {
-		printk(	"%s: received %d byte DMA packet of type %x\n",
-			dev->name, length,
-			(skb->data[ETH_ALEN+ETH_ALEN] << 8) | skb->data[ETH_ALEN+ETH_ALEN+1]);
+		printk("%s: received %d byte DMA packet of type %x\n",
+		       dev->name, length,
+		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
 	}
-        skb->protocol=eth_type_trans(skb,dev);
+	skb->protocol = eth_type_trans(skb, dev);
 	netif_rx(skb);
 	dev->stats.rx_packets++;
 	dev->stats.rx_bytes += length;
@@ -995,7 +920,7 @@ static void __init reset_chip(struct net_device *dev)
 
 	/* Wait until the chip is reset */
 	reset_start_time = jiffies;
-	while( (readreg(dev, PP_SelfST) & INIT_DONE) == 0 && jiffies - reset_start_time < 2)
+	while ((readreg(dev, PP_SelfST) & INIT_DONE) == 0 && jiffies - reset_start_time < 2)
 		;
 #endif /* !CONFIG_MACH_MX31ADS */
 }
@@ -1038,38 +963,38 @@ detect_tp(struct net_device *dev)
 
 	if (net_debug > 1) printk("%s: Attempting TP\n", dev->name);
 
-        /* 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 LineCTL is set.
-           To overcome this the auto detect bit will be cleared whilst testing the
-           10-Base-T interface.  This would not be necessary for the sparrow chip but
-           is simpler to do it anyway. */
-	writereg(dev, PP_LineCTL, lp->linectl &~ AUI_ONLY);
+	/* 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 LineCTL is set.
+	   To overcome this the auto detect bit will be cleared whilst testing the
+	   10-Base-T interface.  This would not be necessary for the sparrow chip but
+	   is simpler to do it anyway. */
+	writereg(dev, PP_LineCTL, lp->linectl & ~AUI_ONLY);
 	control_dc_dc(dev, 0);
 
-        /* Delay for the hardware to work out if the TP cable is present - 150ms */
+	/* Delay for the hardware to work out if the TP cable is present - 150ms */
 	for (timenow = jiffies; jiffies - timenow < 15; )
-                ;
+		;
 	if ((readreg(dev, PP_LineST) & LINK_OK) == 0)
 		return DETECTED_NONE;
 
 	if (lp->chip_type == CS8900) {
-                switch (lp->force & 0xf0) {
+		switch (lp->force & 0xf0) {
 #if 0
-                case FORCE_AUTO:
-			printk("%s: cs8900 doesn't autonegotiate\n",dev->name);
-                        return DETECTED_NONE;
+		case FORCE_AUTO:
+			printk("%s: cs8900 doesn't autonegotiate\n", dev->name);
+			return DETECTED_NONE;
 #endif
-		/* CS8900 doesn't support AUTO, change to HALF*/
-                case FORCE_AUTO:
+			/* CS8900 doesn't support AUTO, change to HALF*/
+		case FORCE_AUTO:
 			lp->force &= ~FORCE_AUTO;
-                        lp->force |= FORCE_HALF;
+			lp->force |= FORCE_HALF;
 			break;
 		case FORCE_HALF:
 			break;
-                case FORCE_FULL:
+		case FORCE_FULL:
 			writereg(dev, PP_TestCTL, readreg(dev, PP_TestCTL) | FDX_8900);
 			break;
-                }
+		}
 		fdx = readreg(dev, PP_TestCTL) & FDX_8900;
 	} else {
 		switch (lp->force & 0xf0) {
@@ -1082,12 +1007,12 @@ detect_tp(struct net_device *dev)
 		case FORCE_FULL:
 			lp->auto_neg_cnf = RE_NEG_NOW | ALLOW_FDX;
 			break;
-                }
+		}
 
 		writereg(dev, PP_AutoNegCTL, lp->auto_neg_cnf & AUTO_NEG_MASK);
 
 		if ((lp->auto_neg_cnf & AUTO_NEG_BITS) == AUTO_NEG_ENABLE) {
-			printk(KERN_INFO "%s: negotiating duplex...\n",dev->name);
+			printk(KERN_INFO "%s: negotiating duplex...\n", dev->name);
 			while (readreg(dev, PP_AutoNegST) & AUTO_NEG_BUSY) {
 				if (jiffies - timenow > 4000) {
 					printk(KERN_ERR "**** Full / half duplex auto-negotiation timed out ****\n");
@@ -1109,15 +1034,15 @@ send_test_pkt(struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 	char test_packet[] = { 0,0,0,0,0,0, 0,0,0,0,0,0,
-				 0, 46, /* A 46 in network order */
-				 0, 0, /* DSAP=0 & SSAP=0 fields */
-				 0xf3, 0 /* Control (Test Req + P bit set) */ };
+			       0, 46, /* A 46 in network order */
+			       0, 0, /* DSAP=0 & SSAP=0 fields */
+			       0xf3, 0 /* Control (Test Req + P bit set) */ };
 	long timenow = jiffies;
 
 	writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) | SERIAL_TX_ON);
 
-	memcpy(test_packet,          dev->dev_addr, ETH_ALEN);
-	memcpy(test_packet+ETH_ALEN, dev->dev_addr, ETH_ALEN);
+	memcpy(test_packet,            dev->dev_addr, ETH_ALEN);
+	memcpy(test_packet + ETH_ALEN, dev->dev_addr, ETH_ALEN);
 
 	iowrite16(TX_AFTER_ALL, lp->virt_addr + TX_CMD_PORT);
 	iowrite16(ETH_ZLEN, lp->virt_addr + TX_LEN_PORT);
@@ -1135,11 +1060,11 @@ send_test_pkt(struct net_device *dev)
 	if (net_debug > 1) printk("Sending test packet ");
 	/* wait a couple of jiffies for packet to be received */
 	for (timenow = jiffies; jiffies - timenow < 3; )
-                ;
-        if ((readreg(dev, PP_TxEvent) & TX_SEND_OK_BITS) == TX_OK) {
-                if (net_debug > 1) printk("succeeded\n");
-                return 1;
-        }
+		;
+	if ((readreg(dev, PP_TxEvent) & TX_SEND_OK_BITS) == TX_OK) {
+		if (net_debug > 1) printk("succeeded\n");
+		return 1;
+	}
 	if (net_debug > 1) printk("failed\n");
 	return 0;
 }
@@ -1153,7 +1078,7 @@ detect_aui(struct net_device *dev)
 	if (net_debug > 1) printk("%s: Attempting AUI\n", dev->name);
 	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);
 
 	if (send_test_pkt(dev))
 		return DETECTED_AUI;
@@ -1169,7 +1094,7 @@ detect_bnc(struct net_device *dev)
 	if (net_debug > 1) printk("%s: Attempting BNC\n", dev->name);
 	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);
 
 	if (send_test_pkt(dev))
 		return DETECTED_BNC;
@@ -1208,7 +1133,7 @@ write_irq(struct net_device *dev, int chip_type, int irq)
    This routine should set everything up anew at each open, even
    registers that "should" only need to be set once at boot, so that
    there is non-reboot way to recover if something goes wrong.
-   */
+*/
 
 /* AKPM: do we need to do any locking here? */
 
@@ -1224,7 +1149,7 @@ net_open(struct net_device *dev)
 		/* Allow interrupts to be generated by the chip */
 /* Cirrus' release had this: */
 #if 0
-		writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL)|ENABLE_IRQ );
+		writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL) | ENABLE_IRQ);
 #endif
 /* And 2.3.47 had this: */
 		writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
@@ -1252,13 +1177,13 @@ net_open(struct net_device *dev)
 #if !defined(CS89x0_NONISA_IRQ) && !defined(CONFIG_CS89x0_PLATFORM)
 		if (((1 << dev->irq) & lp->irq_map) == 0) {
 			printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
-                               dev->name, dev->irq, lp->irq_map);
+			       dev->name, dev->irq, lp->irq_map);
 			ret = -EAGAIN;
 			goto bad_out;
 		}
 #endif
 /* FIXME: Cirrus' release had this: */
-		writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL)|ENABLE_IRQ );
+		writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL)|ENABLE_IRQ);
 /* And 2.3.47 had this: */
 #if 0
 		writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
@@ -1276,17 +1201,17 @@ net_open(struct net_device *dev)
 		if (lp->isa_config & ANY_ISA_DMA) {
 			unsigned long flags;
 			lp->dma_buff = (unsigned char *)__get_dma_pages(GFP_KERNEL,
-							get_order(lp->dmasize * 1024));
+									get_order(lp->dmasize * 1024));
 
 			if (!lp->dma_buff) {
 				printk(KERN_ERR "%s: cannot get %dK memory for DMA\n", dev->name, lp->dmasize);
 				goto release_irq;
 			}
 			if (net_debug > 1) {
-				printk(	"%s: dma %lx %lx\n",
-					dev->name,
-					(unsigned long)lp->dma_buff,
-					(unsigned long)isa_virt_to_bus(lp->dma_buff));
+				printk("%s: dma %lx %lx\n",
+				       dev->name,
+				       (unsigned long)lp->dma_buff,
+				       (unsigned long)isa_virt_to_bus(lp->dma_buff));
 			}
 			if ((unsigned long) lp->dma_buff >= MAX_DMA_ADDRESS ||
 			    !dma_page_eq(lp->dma_buff, lp->dma_buff+lp->dmasize*1024-1)) {
@@ -1314,64 +1239,64 @@ net_open(struct net_device *dev)
 #endif	/* ALLOW_DMA */
 
 	/* set the Ethernet address */
-	for (i=0; i < ETH_ALEN/2; i++)
-		writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8));
+	for (i = 0; i < ETH_ALEN / 2; i++)
+		writereg(dev, PP_IA + i * 2, dev->dev_addr[i * 2] | (dev->dev_addr[i * 2 + 1] << 8));
 
 	/* while we're testing the interface, leave interrupts disabled */
 	writereg(dev, PP_BusCTL, MEMORY_ON);
 
 	/* Set the LineCTL quintuplet based on adapter configuration read from EEPROM */
 	if ((lp->adapter_cnf & A_CNF_EXTND_10B_2) && (lp->adapter_cnf & A_CNF_LOW_RX_SQUELCH))
-                lp->linectl = LOW_RX_SQUELCH;
+		lp->linectl = LOW_RX_SQUELCH;
 	else
-                lp->linectl = 0;
+		lp->linectl = 0;
 
-        /* check to make sure that they have the "right" hardware available */
-	switch(lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
+	/* check to make sure that they have the "right" hardware available */
+	switch (lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
 	case A_CNF_MEDIA_10B_T: result = lp->adapter_cnf & A_CNF_10B_T; break;
 	case A_CNF_MEDIA_AUI:   result = lp->adapter_cnf & A_CNF_AUI; break;
 	case A_CNF_MEDIA_10B_2: result = lp->adapter_cnf & A_CNF_10B_2; break;
-        default: result = lp->adapter_cnf & (A_CNF_10B_T | A_CNF_AUI | A_CNF_10B_2);
-        }
-        if (!result) {
-                printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name);
+	default: result = lp->adapter_cnf & (A_CNF_10B_T | A_CNF_AUI | A_CNF_10B_2);
+	}
+	if (!result) {
+		printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name);
 release_dma:
 #if ALLOW_DMA
 		free_dma(dev->dma);
 release_irq:
 		release_dma_buff(lp);
 #endif
-                writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON));
-                free_irq(dev->irq, dev);
+		writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON));
+		free_irq(dev->irq, dev);
 		ret = -EAGAIN;
 		goto bad_out;
 	}
 
-        /* set the hardware to the configured choice */
-	switch(lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
+	/* set the hardware to the configured choice */
+	switch (lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
 	case A_CNF_MEDIA_10B_T:
-                result = detect_tp(dev);
-                if (result==DETECTED_NONE) {
-                        printk(KERN_WARNING "%s: 10Base-T (RJ-45) has no cable\n", dev->name);
-                        if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
-                                result = DETECTED_RJ45H; /* Yes! I don't care if I see a link pulse */
-                }
+		result = detect_tp(dev);
+		if (result == DETECTED_NONE) {
+			printk(KERN_WARNING "%s: 10Base-T (RJ-45) has no cable\n", dev->name);
+			if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
+				result = DETECTED_RJ45H; /* Yes! I don't care if I see a link pulse */
+		}
 		break;
 	case A_CNF_MEDIA_AUI:
-                result = detect_aui(dev);
-                if (result==DETECTED_NONE) {
-                        printk(KERN_WARNING "%s: 10Base-5 (AUI) has no cable\n", dev->name);
-                        if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
-                                result = DETECTED_AUI; /* Yes! I don't care if I see a carrrier */
-                }
+		result = detect_aui(dev);
+		if (result == DETECTED_NONE) {
+			printk(KERN_WARNING "%s: 10Base-5 (AUI) has no cable\n", dev->name);
+			if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
+				result = DETECTED_AUI; /* Yes! I don't care if I see a carrrier */
+		}
 		break;
 	case A_CNF_MEDIA_10B_2:
-                result = detect_bnc(dev);
-                if (result==DETECTED_NONE) {
-                        printk(KERN_WARNING "%s: 10Base-2 (BNC) has no cable\n", dev->name);
-                        if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
-                                result = DETECTED_BNC; /* Yes! I don't care if I can xmit a packet */
-                }
+		result = detect_bnc(dev);
+		if (result == DETECTED_NONE) {
+			printk(KERN_WARNING "%s: 10Base-2 (BNC) has no cable\n", dev->name);
+			if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
+				result = DETECTED_BNC; /* Yes! I don't care if I can xmit a packet */
+		}
 		break;
 	case A_CNF_MEDIA_AUTO:
 		writereg(dev, PP_LineCTL, lp->linectl | AUTO_AUI_10BASET);
@@ -1387,7 +1312,7 @@ release_irq:
 		printk(KERN_ERR "%s: no media detected\n", dev->name);
 		goto release_dma;
 	}
-	switch(result) {
+	switch (result) {
 	case DETECTED_NONE:
 		printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name);
 		goto release_dma;
@@ -1422,22 +1347,22 @@ release_irq:
 	writereg(dev, PP_RxCFG, lp->curr_rx_cfg);
 
 	writereg(dev, PP_TxCFG, TX_LOST_CRS_ENBL | TX_SQE_ERROR_ENBL | TX_OK_ENBL |
-		TX_LATE_COL_ENBL | TX_JBR_ENBL | TX_ANY_COL_ENBL | TX_16_COL_ENBL);
+		 TX_LATE_COL_ENBL | TX_JBR_ENBL | TX_ANY_COL_ENBL | TX_16_COL_ENBL);
 
 	writereg(dev, PP_BufCFG, READY_FOR_TX_ENBL | RX_MISS_COUNT_OVRFLOW_ENBL |
 #if ALLOW_DMA
-		dma_bufcfg(dev) |
+		 dma_bufcfg(dev) |
 #endif
-		TX_COL_COUNT_OVRFLOW_ENBL | TX_UNDERRUN_ENBL);
+		 TX_COL_COUNT_OVRFLOW_ENBL | TX_UNDERRUN_ENBL);
 
 	/* now that we've got our act together, enable everything */
 	writereg(dev, PP_BusCTL, ENABLE_IRQ
-		 | (dev->mem_start?MEMORY_ON : 0) /* turn memory on */
+		 | (dev->mem_start ? MEMORY_ON : 0) /* turn memory on */
 #if ALLOW_DMA
 		 | dma_busctl(dev)
 #endif
-                 );
-        netif_start_queue(dev);
+		);
+	netif_start_queue(dev);
 	if (net_debug > 1)
 		printk("cs89x0: net_open() succeeded\n");
 	return 0;
@@ -1450,25 +1375,25 @@ static void net_timeout(struct net_device *dev)
 	/* If we get here, some higher level has decided we are broken.
 	   There should really be a "kick me" function call instead. */
 	if (net_debug > 0) printk("%s: transmit timed out, %s?\n", dev->name,
-		   tx_done(dev) ? "IRQ conflict ?" : "network cable problem");
+				  tx_done(dev) ? "IRQ conflict ?" : "network cable problem");
 	/* Try to restart the adaptor. */
 	netif_wake_queue(dev);
 }
 
-static netdev_tx_t net_send_packet(struct sk_buff *skb,struct net_device *dev)
+static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
 	struct net_local *lp = netdev_priv(dev);
 	unsigned long flags;
 
 	if (net_debug > 3) {
 		printk("%s: sent %d byte packet of type %x\n",
-			dev->name, skb->len,
-			(skb->data[ETH_ALEN+ETH_ALEN] << 8) | skb->data[ETH_ALEN+ETH_ALEN+1]);
+		       dev->name, skb->len,
+		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
 	}
 
 	/* keep the upload from being interrupted, since we
-                  ask the chip to start transmitting before the
-                  whole packet has been completely uploaded. */
+	   ask the chip to start transmitting before the
+	   whole packet has been completely uploaded. */
 
 	spin_lock_irqsave(&lp->lock, flags);
 	netif_stop_queue(dev);
@@ -1479,8 +1404,7 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb,struct net_device *dev)
 
 	/* Test to see if the chip has allocated memory for the packet */
 	if ((readreg(dev, PP_BusST) & READY_FOR_TX_NOW) == 0) {
-		/*
-		 * Gasp!  It hasn't.  But that shouldn't happen since
+		/* Gasp!  It hasn't.  But that shouldn't happen since
 		 * we're waiting for TxOk, so return 1 and requeue this packet.
 		 */
 
@@ -1492,10 +1416,9 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb,struct net_device *dev)
 	writewords(lp, TX_FRAME_PORT, skb->data, (skb->len+1) >> 1);
 	spin_unlock_irqrestore(&lp->lock, flags);
 	dev->stats.tx_bytes += skb->len;
-	dev_kfree_skb (skb);
+	dev_kfree_skb(skb);
 
-	/*
-	 * We DO NOT call netif_wake_queue() here.
+	/* We DO NOT call netif_wake_queue() here.
 	 * We also DO NOT call netif_start_queue().
 	 *
 	 * Either of these would cause another bottom half run through
@@ -1509,28 +1432,30 @@ static netdev_tx_t net_send_packet(struct sk_buff *skb,struct net_device *dev)
 }
 
 /* The typical workload of the driver:
-   Handle the network interface interrupts. */
+ * Handle the network interface interrupts.
+ */
 
 static irqreturn_t net_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev = dev_id;
 	struct net_local *lp;
 	int status;
- 	int handled = 0;
+	int handled = 0;
 
 	lp = netdev_priv(dev);
 
 	/* we MUST read all the events out of the ISQ, otherwise we'll never
-           get interrupted again.  As a consequence, we can't have any limit
-           on the number of times we loop in the interrupt handler.  The
-           hardware guarantees that eventually we'll run out of events.  Of
-           course, if you're on a slow machine, and packets are arriving
-           faster than you can read them off, you're screwed.  Hasta la
-           vista, baby!  */
+	 * get interrupted again.  As a consequence, we can't have any limit
+	 * on the number of times we loop in the interrupt handler.  The
+	 * hardware guarantees that eventually we'll run out of events.  Of
+	 * course, if you're on a slow machine, and packets are arriving
+	 * faster than you can read them off, you're screwed.  Hasta la
+	 * vista, baby!
+	 */
 	while ((status = ioread16(lp->virt_addr + ISQ_PORT))) {
 		if (net_debug > 4)printk("%s: event=%04x\n", dev->name, status);
 		handled = 1;
-		switch(status & ISQ_EVENT_MASK) {
+		switch (status & ISQ_EVENT_MASK) {
 		case ISQ_RECEIVER_EVENT:
 			/* Got a packet(s). */
 			net_rx(dev);
@@ -1538,11 +1463,11 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 		case ISQ_TRANSMITTER_EVENT:
 			dev->stats.tx_packets++;
 			netif_wake_queue(dev);	/* Inform upper layers. */
-			if ((status & (	TX_OK |
-					TX_LOST_CRS |
-					TX_SQE_ERROR |
-					TX_LATE_COL |
-					TX_16_COL)) != TX_OK) {
+			if ((status & (TX_OK |
+				       TX_LOST_CRS |
+				       TX_SQE_ERROR |
+				       TX_LATE_COL |
+				       TX_16_COL)) != TX_OK) {
 				if ((status & TX_OK) == 0)
 					dev->stats.tx_errors++;
 				if (status & TX_LOST_CRS)
@@ -1558,31 +1483,33 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)
 		case ISQ_BUFFER_EVENT:
 			if (status & READY_FOR_TX) {
 				/* we tried to transmit a packet earlier,
-                                   but inexplicably ran out of buffers.
-                                   That shouldn't happen since we only ever
-                                   load one packet.  Shrug.  Do the right
-                                   thing anyway. */
+				 * but inexplicably ran out of buffers.
+				 * That shouldn't happen since we only ever
+				 * load one packet.  Shrug.  Do the right
+				 * thing anyway.
+				 */
 				netif_wake_queue(dev);	/* Inform upper layers. */
 			}
 			if (status & TX_UNDERRUN) {
 				if (net_debug > 0) printk("%s: transmit underrun\n", dev->name);
-                                lp->send_underrun++;
-                                if (lp->send_underrun == 3) lp->send_cmd = TX_AFTER_381;
-                                else if (lp->send_underrun == 6) lp->send_cmd = TX_AFTER_ALL;
+				lp->send_underrun++;
+				if (lp->send_underrun == 3) lp->send_cmd = TX_AFTER_381;
+				else if (lp->send_underrun == 6) lp->send_cmd = TX_AFTER_ALL;
 				/* transmit cycle is done, although
-				   frame wasn't transmitted - this
-				   avoids having to wait for the upper
-				   layers to timeout on us, in the
-				   event of a tx underrun */
+				 * frame wasn't transmitted - this
+				 * avoids having to wait for the upper
+				 * layers to timeout on us, in the
+				 * event of a tx underrun
+				 */
 				netif_wake_queue(dev);	/* Inform upper layers. */
-                        }
+			}
 #if ALLOW_DMA
 			if (lp->use_dma && (status & RX_DMA)) {
 				int count = readreg(dev, PP_DmaFrameCnt);
-				while(count) {
+				while (count) {
 					if (net_debug > 5)
 						printk("%s: receiving %d DMA frames\n", dev->name, count);
-					if (net_debug > 2 && count >1)
+					if (net_debug > 2 && count > 1)
 						printk("%s: receiving %d DMA frames\n", dev->name, count);
 					dma_rx(dev);
 					if (--count == 0)
@@ -1651,12 +1578,12 @@ net_rx(struct net_device *dev)
 		skb->data[length-1] = ioread16(lp->virt_addr + RX_FRAME_PORT);
 
 	if (net_debug > 3) {
-		printk(	"%s: received %d byte packet of type %x\n",
-			dev->name, length,
-			(skb->data[ETH_ALEN+ETH_ALEN] << 8) | skb->data[ETH_ALEN+ETH_ALEN+1]);
+		printk("%s: received %d byte packet of type %x\n",
+		       dev->name, length,
+		       (skb->data[ETH_ALEN + ETH_ALEN] << 8) | skb->data[ETH_ALEN + ETH_ALEN + 1]);
 	}
 
-        skb->protocol=eth_type_trans(skb,dev);
+	skb->protocol = eth_type_trans(skb, dev);
 	netif_rx(skb);
 	dev->stats.rx_packets++;
 	dev->stats.rx_bytes += length;
@@ -1700,8 +1627,9 @@ net_close(struct net_device *dev)
 	return 0;
 }
 
-/* Get the current statistics.	This may be called with the card open or
-   closed. */
+/* Get the current statistics.
+ * This may be called with the card open or closed.
+ */
 static struct net_device_stats *
 net_get_stats(struct net_device *dev)
 {
@@ -1723,7 +1651,7 @@ static void set_multicast_list(struct net_device *dev)
 	unsigned long flags;
 
 	spin_lock_irqsave(&lp->lock, flags);
-	if(dev->flags&IFF_PROMISC)
+	if (dev->flags&IFF_PROMISC)
 	{
 		lp->rx_mode = RX_ALL_ACCEPT;
 	}
@@ -1740,7 +1668,7 @@ static void set_multicast_list(struct net_device *dev)
 
 	/* in promiscuous mode, we accept errored packets, so we have to enable interrupts on them also */
 	writereg(dev, PP_RxCFG, lp->curr_rx_cfg |
-	     (lp->rx_mode == RX_ALL_ACCEPT? (RX_CRC_ERROR_ENBL|RX_RUNT_ENBL|RX_EXTRA_DATA_ENBL) : 0));
+		 (lp->rx_mode == RX_ALL_ACCEPT ? (RX_CRC_ERROR_ENBL|RX_RUNT_ENBL|RX_EXTRA_DATA_ENBL) : 0));
 	spin_unlock_irqrestore(&lp->lock, flags);
 }
 
@@ -1760,8 +1688,8 @@ static int set_mac_address(struct net_device *dev, void *p)
 		       dev->name, dev->dev_addr);
 
 	/* set the Ethernet address */
-	for (i=0; i < ETH_ALEN/2; i++)
-		writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8));
+	for (i = 0; i < ETH_ALEN / 2; i++)
+		writereg(dev, PP_IA + i * 2, dev->dev_addr[i * 2] | (dev->dev_addr[i * 2 + 1] << 8));
 
 	return 0;
 }
@@ -1770,8 +1698,7 @@ static int set_mac_address(struct net_device *dev, void *p)
 
 static struct net_device *dev_cs89x0;
 
-/*
- * Support the 'debug' module parm even if we're compiled for non-debug to
+/* Support the 'debug' module parm even if we're compiled for non-debug to
  * avoid breaking someone's startup scripts
  */
 
@@ -1779,11 +1706,11 @@ static int io;
 static int irq;
 static int debug;
 static char media[8];
-static int duplex=-1;
+static int duplex = -1;
 
 static int use_dma;			/* These generate unused var warnings if ALLOW_DMA = 0 */
 static int dma;
-static int dmasize=16;			/* or 64 */
+static int dmasize = 16;		/* or 64 */
 
 module_param(io, int, 0);
 module_param(irq, int, 0);
@@ -1816,32 +1743,28 @@ MODULE_PARM_DESC(use_dma , "(ignored)");
 MODULE_AUTHOR("Mike Cruse, Russwll Nelson <nelson@crynwr.com>, Andrew Morton");
 MODULE_LICENSE("GPL");
 
-
 /*
-* media=t             - specify media type
-   or media=2
-   or media=aui
-   or medai=auto
-* duplex=0            - specify forced half/full/autonegotiate duplex
-* debug=#             - debug level
-
-
-* Default Chip Configuration:
-  * DMA Burst = enabled
-  * IOCHRDY Enabled = enabled
-    * UseSA = enabled
-    * CS8900 defaults to half-duplex if not specified on command-line
-    * CS8920 defaults to autoneg if not specified on command-line
-    * Use reset defaults for other config parameters
-
-* Assumptions:
-  * media type specified is supported (circuitry is present)
-  * if memory address is > 1MB, then required mem decode hw is present
-  * if 10B-2, then agent other than driver will enable DC/DC converter
-    (hw or software util)
-
-
-*/
+ * media=t             - specify media type
+ * or media=2
+ * or media=aui
+ * or medai=auto
+ * duplex=0            - specify forced half/full/autonegotiate duplex
+ * debug=#             - debug level
+ *
+ * Default Chip Configuration:
+ * DMA Burst = enabled
+ * IOCHRDY Enabled = enabled
+ * UseSA = enabled
+ * CS8900 defaults to half-duplex if not specified on command-line
+ * CS8920 defaults to autoneg if not specified on command-line
+ * Use reset defaults for other config parameters
+ *
+ * Assumptions:
+ * media type specified is supported (circuitry is present)
+ * if memory address is > 1MB, then required mem decode hw is present
+ * if 10B-2, then agent other than driver will enable DC/DC converter
+ * (hw or software util)
+ */
 
 int __init init_module(void)
 {
@@ -1871,8 +1794,8 @@ int __init init_module(void)
 
 	spin_lock_init(&lp->lock);
 
-        /* boy, they'd better get these right */
-        if (!strcmp(media, "rj45"))
+	/* boy, they'd better get these right */
+	if (!strcmp(media, "rj45"))
 		lp->adapter_cnf = A_CNF_MEDIA_10B_T | A_CNF_10B_T;
 	else if (!strcmp(media, "aui"))
 		lp->adapter_cnf = A_CNF_MEDIA_AUI   | A_CNF_AUI;
@@ -1881,15 +1804,15 @@ int __init init_module(void)
 	else
 		lp->adapter_cnf = A_CNF_MEDIA_10B_T | A_CNF_10B_T;
 
-        if (duplex==-1)
+	if (duplex == -1)
 		lp->auto_neg_cnf = AUTO_NEG_ENABLE;
 
-        if (io == 0) {
-                printk(KERN_ERR "cs89x0.c: Module autoprobing not allowed.\n");
-                printk(KERN_ERR "cs89x0.c: Append io=0xNNN\n");
-                ret = -EPERM;
+	if (io == 0) {
+		printk(KERN_ERR "cs89x0.c: Module autoprobing not allowed.\n");
+		printk(KERN_ERR "cs89x0.c: Append io=0xNNN\n");
+		ret = -EPERM;
 		goto out;
-        } else if (io <= 0x1ff) {
+	} else if (io <= 0x1ff) {
 		ret = -ENXIO;
 		goto out;
 	}
@@ -1985,8 +1908,7 @@ static int cs89x0_platform_remove(struct platform_device *pdev)
 	struct net_local *lp = netdev_priv(dev);
 	struct resource *mem_res;
 
-	/*
-	 * This platform_get_resource() call will not return NULL, because
+	/* This platform_get_resource() call will not return NULL, because
 	 * the same call in cs89x0_platform_probe() has returned a non NULL
 	 * value.
 	 */
@@ -2021,13 +1943,3 @@ static void __exit cs89x0_cleanup(void)
 module_exit(cs89x0_cleanup);
 
 #endif /* CONFIG_CS89x0_PLATFORM */
-
-/*
- * Local variables:
- *  version-control: t
- *  kept-new-versions: 5
- *  c-indent-level: 8
- *  tab-width: 8
- * End:
- *
- */
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH net-next 0/5] cirrus: cs89x0: Neatening
From: Joe Perches @ 2012-05-18 22:56 UTC (permalink / raw)
  To: netdev; +Cc: Jaccon Bastiaansen, linux-kernel

Yeah, some might consider it gratuitous.
I think it's cleaner now though.

Joe Perches (5):
  cirrus: cs89x0: Code style neatening
  cirrus: cs89x0: Convert printks to pr_<level>
  cirrus: cs89x0: Code neatening
  cirrus: cs89x0: Neaten debugging and logging
  cirrus: cs89x0: Remove function prototypes and reorder declarations

 drivers/net/ethernet/cirrus/cs89x0.c | 2408 +++++++++++++++++-----------------
 1 files changed, 1185 insertions(+), 1223 deletions(-)

-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply

* Re: Kernel splat with debugging on 3.3.6+ kernel.
From: Ben Greear @ 2012-05-18 22:46 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, netdev
In-Reply-To: <4FB697AB.10809@candelatech.com>

On 05/18/2012 11:40 AM, Ben Greear wrote:
> This is a patched kernel, but nothing proprietary loaded.
>
> We're chasing a hard-to-reproduce bug that appears to be stale
> memory access related to wifi stations.
>
> So, I enabled a bunch of debugging (memory debugging, lockdep, etc)
> and this lockup occurs every time we try to load our
> '400 station' test case.
>
> I'm going to poke at this some more, try some smaller test
> cases and such, but if anyone has any other suggestions I'm interested!

I think with the amount of mem debugging I have enabled,
I just cannot use this many virtual stations.

The problem goes away when we have "only" 100 or so virtual
stations enabled...

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: [RFC 13/13] USB: Disable hub-initiated LPM for comms devices.
From: Tilman Schmidt @ 2012-05-18 22:38 UTC (permalink / raw)
  To: Sarah Sharp
  Cc: Greg Kroah-Hartman, linux-usb, Alan Stern, Hansjoerg Lipp,
	linux-bluetooth, gigaset307x-common, netdev, linux-wireless,
	ath9k-devel, libertas-dev, users
In-Reply-To: <20120517173150.GE4967@xanatos>

[-- Attachment #1: Type: text/plain, Size: 2194 bytes --]

Am 17.05.2012 19:31, schrieb Sarah Sharp:
> On Thu, May 17, 2012 at 07:07:32PM +0200, Tilman Schmidt wrote:
>>
>> I follow the argument for class drivers. But this patch also
>> modifies drivers for specific existing USB 2.0 only devices
>> which are unlikely to ever grow USB 3.0 support, such as the
>> Gigaset ISDN driver:
>>
>>>  drivers/isdn/gigaset/bas-gigaset.c            |    1 +
>>>  drivers/isdn/gigaset/usb-gigaset.c            |    1 +
> 
> Is there a particular reason why you think that driver is unlikely to
> ever get USB 3.0 support?

Actually, there is. :-)
- The USB devices driven by this driver aren't built anymore.
- Their USB interface design is quite, um, idiosyncratic, and it's
  pretty unlikely that anyone will reuse it. (At least I truly hope
  no one will.)
- Their successor models have completely different and incompatible
  USB interfaces which this driver is unable to handle.

>> What is the interest of setting the disable_hub_initiated_lpm
>> flag for these?
> 
> It's partially to lay the foundation for anyone who wants to make a USB
> 3.0 communications driver in the future.  They're likely to start from
> some USB 2.0 class driver, and copy a lot of code.  If they notice that
> flag is set in all the USB communications class drivers, they're likely
> to set it as well.

You've got a point there.

> I'm not quite sure where the best place to provide documentation on the
> flag is.  I've added the kernel doc comments to the structure, but maybe
> it needs to be documented somewhere in Documentation/usb/?

Documentation/usb/power-management.txt would seem like a natural
place. Although it appears to limit itself to "suspending" in its
first paragraph, it does have a section "xHCI hardware link PM"
at the end already, added by Andiry Xu on 2011-09-23.

Hmmm, that section seems to suggest that LPM exists for USB2, too.
Perhaps I should reconsider my attitude towards your patch.

Thanks,
Tilman

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply

* Re: [PATCH v6 0/3] netdev/of/phy: MDIO bus multiplexer support.
From: David Daney @ 2012-05-18 22:23 UTC (permalink / raw)
  To: Timur Tabi
  Cc: devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <4FB6C886.3050105@freescale.com>

On 05/18/2012 03:09 PM, Timur Tabi wrote:
> David Daney wrote:
>>>> I'm not sure what the "parent" MDIO bus node is supposed to represent.
>>>>    Is that that device that actually controls the muxing hardware
>
>> No.  It is the device that implements the master 802.3 clause {22,45}
>> MDIO Station Management (STA) protocol.
>
> Ah, I think I get it.  It is *the* MDIO node that would normally exist if
> muxing we're necessary on the board.  From the looks of it, that node
> would look exactly the same if you didn't need muxing?
>

Yes.  You may note in the DTS file I attached in the parent (sorry for 
the fubar mime types), that there are two, almost identical, MDIO 
masters.  smi0 has two directly attached PHYs.  smi1 goes to the mux, 
and each child of the mux has four attached PHYs.

This is a fairly complex configuration as the GPIOs controlling the MDIO 
mux are on I2C GPIO expanders which are themselves behind an I2C mux...

The nice thing about this is that the Linux I2C and MDIO infrastructure 
is all configured dynamically from the device tree and everything works 
well together with no locking issues.  The addition of the deferred 
driver probe mechanism was the last part of the puzzle (I think... 
actually I don't know if all my I2C things are merged yet...).

David Daney

^ permalink raw reply

* Re: [PATCH v6 0/3] netdev/of/phy: MDIO bus multiplexer support.
From: Timur Tabi @ 2012-05-18 22:09 UTC (permalink / raw)
  To: David Daney
  Cc: devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <4FB6C728.3090507@gmail.com>

David Daney wrote:
>> > I'm not sure what the "parent" MDIO bus node is supposed to represent.
>> >   Is that that device that actually controls the muxing hardware

> No.  It is the device that implements the master 802.3 clause {22,45} 
> MDIO Station Management (STA) protocol.

Ah, I think I get it.  It is *the* MDIO node that would normally exist if
muxing we're necessary on the board.  From the looks of it, that node
would look exactly the same if you didn't need muxing?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.
From: Paul Gortmaker @ 2012-05-18 22:03 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: davem, netdev, Alan Cox
In-Reply-To: <201205182016.51489.linux@rainbow-software.org>

[Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.] On 18/05/2012 (Fri 20:16) Ondrej Zary wrote:

> On Friday 18 May 2012 19:39:29 Paul Gortmaker wrote:
> > It was amusing that linux was able to make use of this 1980's
> > technology on machines long past its intended lifespan, but
> > it probably should go now -- it is causing issues in some
> > distros[1], and while that might be fixable, it is just not
> > worth it.
> >
> > [1]
> > http://www.linuxquestions.org/questions/linux-networking-3/3com-3c501-card-
> >not-detecting-934344/
> 
> That looks like a bug elsewhere and removing this driver will not fix it.

You miss the point.  We've got someone with a modern i7 machine who is
getting confused by seeing messages from some ancient 3c501 driver, but
he doesn't have the context to know it is ancient and the message is a
red herring.  Will it fix a distro's broken init that tries to modprobe
everything?  No.  Will it help by not muddying the waters with
meaningless printk from 3c501 that confuse users?  Yes.

Thanks,
Paul.

> 
> -- 
> Ondrej Zary

^ permalink raw reply

* Re: [PATCH v6 0/3] netdev/of/phy: MDIO bus multiplexer support.
From: David Daney @ 2012-05-18 22:03 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <CAOZdJXWVCu+aNxcQRkcSSDsWWxnn8B9X5Y6=8oVgFwJ9SZTTGQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

On 05/18/2012 02:42 PM, Tabi Timur-B04825 wrote:
> On Wed, May 2, 2012 at 8:16 PM, David Daney<ddaney.cavm@gmail.com>  wrote:
>> From: David Daney<david.daney@cavium.com>
>>
>> This code has been working well for about six months on a couple of
>> different configurations (boards), so I thought it would be a good
>> time to send it out again, and I hope get it on the path towards
>> merging.
>
> David,
>
> I'm trying to implement this feature on our boards, which don't use
> GPIOs but rather a memory-mapped FPGA.  I control the mux by setting
> some bits in one of the FPGA registers.

You can either:

1) write a standard GPIO driver for the thing that controls the mux, and 
then use mdio-mux-gpio.c, or...

2) Write a new driver modeled on mdio-mux-gpio.c for your switch control.

>
> Do you have a real device tree I can use as an example?
>

Attached.

> I'm not sure what the "parent" MDIO bus node is supposed to represent.
>   Is that that device that actually controls the muxing hardware

No.  It is the device that implements the master 802.3 clause {22,45} 
MDIO Station Management (STA) protocol.

>, which in our case would be the FPGA?

I have no idea what your FPGA implements, so it is hard to say.

A sane person would implement a separate MDIO STA controller for each 
bus, in which case you wouldn't use the multiplexer driver.

Only people dealing with insane hardware need the multiplexer.  The 
patch in net-next has a nice ASCII art picture of such an insane design.

David Daney

[-- Attachment #2: ebb6600.dts --]
[-- Type: audio/vnd.dts, Size: 16812 bytes --]

^ permalink raw reply

* Re: [PATCH 1/1]net:ethernet:fixed a coding style issue relating space.
From: Stephen Hemminger @ 2012-05-18 21:56 UTC (permalink / raw)
  To: Jeffrin Jose; +Cc: davem, netdev, linux-kernel
In-Reply-To: <1337377537-4636-1-git-send-email-ahiliation@yahoo.co.in>

On Sat, 19 May 2012 03:15:37 +0530
Jeffrin Jose <ahiliation@yahoo.co.in> wrote:

> Fixed a coding style issue relating to  space found
> by checkpatch.pl tool in net/ethernet/eth.c
> 
> Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
> ---
>  net/ethernet/eth.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
> index 36e5880..c847aa6 100644
> --- a/net/ethernet/eth.c
> +++ b/net/ethernet/eth.c
> @@ -178,7 +178,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
>  	 *      seems to set IFF_PROMISC.
>  	 */
>  
> -	else if (1 /*dev->flags&IFF_PROMISC */ ) {
> +	else if (1 /*dev->flags&IFF_PROMISC */) {
>  		if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
>  						      dev->dev_addr)))
>  			skb->pkt_type = PACKET_OTHERHOST;

Rather than put lips on a pig, why not remove the bogus if?

^ permalink raw reply

* [PATCH 1/1]net:ethernet:fixed a coding style issue relating space.
From: Jeffrin Jose @ 2012-05-18 21:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, ahiliation

Fixed a coding style issue relating to  space found
by checkpatch.pl tool in net/ethernet/eth.c

Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
 net/ethernet/eth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 36e5880..c847aa6 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -178,7 +178,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	 *      seems to set IFF_PROMISC.
 	 */
 
-	else if (1 /*dev->flags&IFF_PROMISC */ ) {
+	else if (1 /*dev->flags&IFF_PROMISC */) {
 		if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
 						      dev->dev_addr)))
 			skb->pkt_type = PACKET_OTHERHOST;
-- 
1.7.10

^ permalink raw reply related

* Re: [PATCH v6 0/3] netdev/of/phy: MDIO bus multiplexer support.
From: Tabi Timur-B04825 @ 2012-05-18 21:42 UTC (permalink / raw)
  To: David Daney
  Cc: devicetree-discuss@lists.ozlabs.org, netdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1336007799-31016-1-git-send-email-ddaney.cavm@gmail.com>

On Wed, May 2, 2012 at 8:16 PM, David Daney <ddaney.cavm@gmail.com> wrote:
> From: David Daney <david.daney@cavium.com>
>
> This code has been working well for about six months on a couple of
> different configurations (boards), so I thought it would be a good
> time to send it out again, and I hope get it on the path towards
> merging.

David,

I'm trying to implement this feature on our boards, which don't use
GPIOs but rather a memory-mapped FPGA.  I control the mux by setting
some bits in one of the FPGA registers.

Do you have a real device tree I can use as an example?

I'm not sure what the "parent" MDIO bus node is supposed to represent.
 Is that that device that actually controls the muxing hardware, which
in our case would be the FPGA?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* [PATCH net-next] ipv6: ip6_fragment() should check CHECKSUM_PARTIAL
From: Eric Dumazet @ 2012-05-18 21:02 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Tore Anderson

From: Eric Dumazet <edumazet@google.com>

Quoting Tore Anderson from :

If the allfrag feature has been set on a host route (due to an ICMPv6
Packet Too Big received indicating a MTU of less than 1280),
TCP SYN/ACK packets to that destination appears to get an incorrect
TCP checksum. This in turn means they are thrown away as invalid.

In the case of an IPv4 client behind a link with a MTU of less than
1260, accessing an IPv6 server through a stateless translator,
this means that the client can only download a single large file
from the server, because once it is in the server's routing cache
with the allfrag feature set, new TCP connections can no longer
be established.

</endquote>

It appears ip6_fragment() doesn't handle CHECKSUM_PARTIAL properly.

As network drivers are not prepared to fetch correct transport header, a
safe fix is to call skb_checksum_help() before fragmenting packet.

Reported-by: Tore Anderson <tore@fud.no>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Tore Anderson <tore@fud.no>
---
 net/ipv6/ip6_output.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index a254e4b..3dc633f 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -788,6 +788,10 @@ slow_path_clean:
 	}
 
 slow_path:
+	if ((skb->ip_summed == CHECKSUM_PARTIAL) &&
+	    skb_checksum_help(skb))
+		goto fail;
+
 	left = skb->len - hlen;		/* Space per frame */
 	ptr = hlen;			/* Where to start from */
 

^ permalink raw reply related

* Re: [RFC PATCH net-next] hp100: delete VG/AnyLAN hp100
From: Francois Romieu @ 2012-05-18 19:28 UTC (permalink / raw)
  To: Joe Perches
  Cc: Joel Soete, Paul Gortmaker, linux-kernel, JBottomley,
	David S. Miller, netdev
In-Reply-To: <1337295024.8872.33.camel@joe2Laptop>

Joe Perches <joe@perches.com> :
[...]
> I saw people using TR adapters with Linux as of 2008/9.
> 
> That doesn't mean it's common or make it desirable to
> keep TR in the current kernel tree though.

I'll leave token ring PCI drivers where they are for now.

> Is VG/AnyLAN different?

Your own word: "unused". I see nothing wrong asking users if they
still care. If no one cares about the hp100, fine.

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH 00/10] Doorbell drop recovery for Chelsio T4 iWARP
From: David Miller @ 2012-05-18 18:53 UTC (permalink / raw)
  To: roland-BHEL68pLQRGGvPXPguhicg
  Cc: vipul-ut6Up61K2wZBDgjK7y7TUQ, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ,
	dm-ut6Up61K2wZBDgjK7y7TUQ, kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW
In-Reply-To: <CAL1RGDXjekRWkGvZrPF4-B2+kutWRAm-c694vw_D-CqUJXZNMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

From: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
Date: Fri, 18 May 2012 10:58:55 -0700

> On Fri, May 18, 2012 at 10:32 AM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
>> From: Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
>> Date: Fri, 18 May 2012 15:29:23 +0530
>>
>>> Below is a link where Roland advised to re-post the series.
>>> http://www.spinics.net/lists/netdev/msg187997.html
>>
>> Roland, who takes this, you or me?
> 
> I already have a few cxgb4 patches in my tree, I'm happy to grab this today.

Great, please do.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: TCPBacklogDrops during aggressive bursts of traffic
From: Eric Dumazet @ 2012-05-18 18:40 UTC (permalink / raw)
  To: Kieran Mansley; +Cc: Ben Hutchings, netdev
In-Reply-To: <1337355955.15044.24.camel@kjm-desktop.uk.level5networks.com>

Le vendredi 18 mai 2012 à 16:45 +0100, Kieran Mansley a écrit :

> > With net-next and tcp coalescing, I no longer have TCPBacklogDrops /
> > collapses, but I dont have sfc card/driver. 
> 
> I'll try that.

By the way, we should get rid of napi_get_frags() & napi_gro_frags() API
and use plain build_skb() instead.

This would save 1024 bytes per skb, and remove lot of GRO code (frag0,
frag0_len, skb_gro_header_fast(), skb_gro_header_hard()...), since by
definition skb->head would point to the frame.

^ permalink raw reply

* Kernel splat with debugging on 3.3.6+ kernel.
From: Ben Greear @ 2012-05-18 18:40 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org, netdev

This is a patched kernel, but nothing proprietary loaded.

We're chasing a hard-to-reproduce bug that appears to be stale
memory access related to wifi stations.

So, I enabled a bunch of debugging (memory debugging, lockdep, etc)
and this lockup occurs every time we try to load our
'400 station' test case.

I'm going to poke at this some more, try some smaller test
cases and such, but if anyone has any other suggestions I'm interested!


BUG: soft lockup - CPU#0 stuck for 22s! [iw:21673]
Modules linked in: 8021q garp stp llc macvlan pktgen fuse coretemp hwmon sunrpc ipv6 uinput arc4 ppdev snd_hda_codec_realtek ath9k snd_hda_intel mac80211 
snd_hda_codec snd_hwdep snd_seq ath9k_common microcode snd_seq_device ath9k_hw snd_pcm ath iTCO_wdt i2c_i801 serio_raw pcspkr iTCO_vendor_support cfg80211 
snd_timer snd e1000e mei(C) soundcore snd_page_alloc parport_pc parport i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
irq event stamp: 2249893
hardirqs last  enabled at (2249892): [<ffffffff810efeaa>] __slab_alloc+0x402/0x436
hardirqs last disabled at (2249893): [<ffffffff8147d8ae>] apic_timer_interrupt+0x6e/0x80
softirqs last  enabled at (8972): [<ffffffff8103e0f2>] __do_softirq+0x13c/0x15b
softirqs last disabled at (8979): [<ffffffff8147e2ac>] call_softirq+0x1c/0x30
CPU 0
Modules linked in: 8021q garp stp llc macvlan pktgen fuse coretemp hwmon sunrpc ipv6 uinput arc4 ppdev snd_hda_codec_realtek ath9k snd_hda_intel mac80211 
snd_hda_codec snd_hwdep snd_seq ath9k_common microcode snd_seq_device ath9k_hw snd_pcm ath iTCO_wdt i2c_i801 serio_raw pcspkr iTCO_vendor_support cfg80211 
snd_timer snd e1000e mei(C) soundcore snd_page_alloc parport_pc parport i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]

Pid: 21673, comm: iw Tainted: G         C O 3.3.6+ #1 To be filled by O.E.M. To be filled by O.E.M./To be filled by O.E.M.
RIP: 0010:[<ffffffff810efeb3>]  [<ffffffff810efeb3>] __slab_alloc+0x40b/0x436
RSP: 0018:ffff88022bc03a10  EFLAGS: 00000282
RAX: ffff88021e0ec400 RBX: ffff88022bc039d0 RCX: 0000000000000003
RDX: 0000000000000003 RSI: ffffffff813aff74 RDI: 0000000000000282
RBP: ffff88022bc03ae0 R08: ffff8801fbca33d8 R09: ffff88022bc038f0
R10: 0000000000000046 R11: ffffea0007ef2820 R12: ffff88022bc03988
R13: ffffffff8147d8b3 R14: ffff88022bc03ae0 R15: ffff880223006f40
FS:  00007f498a0b1720(0000) GS:ffff88022bc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007fff41409330 CR3: 000000020a006000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process iw (pid: 21673, threadinfo ffff880200e62000, task ffff88021e0ec400)
Stack:
  0000000000000003 ffff88022bc03b70 ffff88022bc03a60 0000000000000246
  ffffffff813aff74 ffff88021e0ed240 ffff88021bb10cd8 ffff88021e0ed240
  0000000200000020 0000000000000282 ffff88021bb10cd8 ffff880204232ae0
Call Trace:
  <IRQ>
  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff8147796c>] ? _raw_spin_unlock+0x4e/0x52
  [<ffffffffa02b30e7>] ? ieee80211_rx_handlers+0x17d2/0x1855 [mac80211]
  [<ffffffff810f1b07>] __kmalloc_node_track_caller+0x95/0xf7
  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff813af2f5>] __alloc_skb+0x71/0x138
  [<ffffffff813aff74>] skb_copy+0x3b/0x9f
  [<ffffffffa02b34e3>] ieee80211_prepare_and_rx_handle+0x379/0x921 [mac80211]
  [<ffffffffa02b43a8>] ieee80211_rx+0x864/0x95c [mac80211]
  [<ffffffff810785ef>] ? mark_held_locks+0x73/0x97
  [<ffffffffa0208c40>] ath_rx_tasklet+0x1765/0x18a3 [ath9k]
  [<ffffffff814779b2>] ? _raw_spin_unlock_irqrestore+0x42/0x79
  [<ffffffffa0204d82>] ath9k_tasklet+0x10d/0x182 [ath9k]
  [<ffffffff8103da1f>] tasklet_action+0x91/0xf1
  [<ffffffff8103e054>] __do_softirq+0x9e/0x15b
  [<ffffffff8147e2ac>] call_softirq+0x1c/0x30
  [<ffffffff8100bd6e>] do_softirq+0x46/0x9e
  [<ffffffff8103ddc2>] irq_exit+0x4e/0xcc
  [<ffffffff8100b662>] do_IRQ+0x97/0xae
  [<ffffffff81477ef3>] common_interrupt+0x73/0x73
  <EOI>
  [<ffffffff8106e19e>] ? sysctl_check_table+0x201/0x303
  [<ffffffff8106e178>] ? sysctl_check_table+0x1db/0x303
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff810785ef>] ? mark_held_locks+0x73/0x97
  [<ffffffff810efeaa>] ? __slab_alloc+0x402/0x436
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff81078905>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff8103f38c>] ? sysctl_set_parent+0x24/0x33
  [<ffffffff810405e9>] __register_sysctl_paths+0xce/0x25c
  [<ffffffffa02fae2a>] ? ndisc_net_init+0x7d/0x7d [ipv6]
  [<ffffffff81458524>] register_net_sysctl_table+0x43/0x47
  [<ffffffff813c08e6>] neigh_sysctl_register+0x1fc/0x235
  [<ffffffffa02edc82>] addrconf_sysctl_register+0x29/0x46 [ipv6]
  [<ffffffffa02eea1d>] ipv6_add_dev+0x308/0x368 [ipv6]
  [<ffffffffa02f027f>] addrconf_notify+0x58/0x8a5 [ipv6]
  [<ffffffff814759b4>] ? mutex_unlock+0x9/0xb
  [<ffffffffa012120d>] ? cfg80211_netdev_notifier_call+0x1c2/0x561 [cfg80211]
  [<ffffffff8105c5e0>] ? get_parent_ip+0x11/0x42
  [<ffffffff8147ad48>] notifier_call_chain+0x54/0x81
  [<ffffffff81057372>] raw_notifier_call_chain+0xf/0x11
  [<ffffffff813b9877>] call_netdevice_notifiers+0x45/0x4a
  [<ffffffff813bb0e9>] register_netdevice+0x258/0x307
  [<ffffffffa02a9e16>] ieee80211_if_add+0x55a/0x5e6 [mac80211]
  [<ffffffff81475975>] ? __mutex_unlock_slowpath+0x11f/0x155
  [<ffffffff810788c1>] ? trace_hardirqs_on_caller+0x123/0x15a
  [<ffffffff81078905>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffffa02afd93>] ieee80211_add_iface+0x2d/0x57 [mac80211]
  [<ffffffffa01228cd>] ? cfg80211_get_dev_from_info+0x44/0x4b [cfg80211]
  [<ffffffffa012b0c9>] nl80211_new_interface+0xf2/0x186 [cfg80211]
  [<ffffffff813da541>] genl_rcv_msg+0x1f4/0x239
  [<ffffffff813da34d>] ? genl_rcv+0x28/0x28
  [<ffffffff813d921d>] netlink_rcv_skb+0x3e/0x8f
  [<ffffffff813da346>] genl_rcv+0x21/0x28
  [<ffffffff813d8ff8>] netlink_unicast+0xe9/0x152
  [<ffffffff813d9777>] netlink_sendmsg+0x1f8/0x216
  [<ffffffff813a979f>] ? rcu_read_unlock+0x4b/0x4d
  [<ffffffff813a5d3d>] __sock_sendmsg_nosec+0x5f/0x6a
  [<ffffffff813a5d85>] __sock_sendmsg+0x3d/0x48
  [<ffffffff813a662f>] sock_sendmsg+0xa3/0xbc
  [<ffffffff810cdab1>] ? might_fault+0x4e/0x9e
  [<ffffffff810cdafa>] ? might_fault+0x97/0x9e
  [<ffffffff813b02fa>] ? copy_from_user+0x2a/0x2c
  [<ffffffff813b06cc>] ? verify_iovec+0x4f/0xa3
  [<ffffffff813a6e38>] __sys_sendmsg+0x20f/0x29c
  [<ffffffff8105c5e0>] ? get_parent_ip+0x11/0x42
  [<ffffffff8110360a>] ? fcheck_files+0xac/0xea
  [<ffffffff8110375e>] ? fget_light+0x35/0xac
  [<ffffffff813a702e>] sys_sendmsg+0x3d/0x5b
  [<ffffffff8147cd79>] system_call_fastpath+0x16/0x1b
Code: ff ff 00 02 00 00 75 15 48 8b bd 78 ff ff ff 57 9d 66 66 90 66 90 e8 c9 65 f8 ff eb 13 e8 4e 8a f8 ff 48 8b bd 78 ff ff ff 57 9d <66> 66 90 66 90 48 81 c4 
a8 00 00 00 4c 89 f0 5b 41 5c 41 5d 41
Call Trace:
  <IRQ>  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff8147796c>] ? _raw_spin_unlock+0x4e/0x52
  [<ffffffffa02b30e7>] ? ieee80211_rx_handlers+0x17d2/0x1855 [mac80211]
  [<ffffffff810f1b07>] __kmalloc_node_track_caller+0x95/0xf7
  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff813af2f5>] __alloc_skb+0x71/0x138
  [<ffffffff813aff74>] skb_copy+0x3b/0x9f
  [<ffffffffa02b34e3>] ieee80211_prepare_and_rx_handle+0x379/0x921 [mac80211]
  [<ffffffffa02b43a8>] ieee80211_rx+0x864/0x95c [mac80211]
  [<ffffffff810785ef>] ? mark_held_locks+0x73/0x97
  [<ffffffffa0208c40>] ath_rx_tasklet+0x1765/0x18a3 [ath9k]
  [<ffffffff814779b2>] ? _raw_spin_unlock_irqrestore+0x42/0x79
  [<ffffffffa0204d82>] ath9k_tasklet+0x10d/0x182 [ath9k]
  [<ffffffff8103da1f>] tasklet_action+0x91/0xf1
  [<ffffffff8103e054>] __do_softirq+0x9e/0x15b
  [<ffffffff8147e2ac>] call_softirq+0x1c/0x30
  [<ffffffff8100bd6e>] do_softirq+0x46/0x9e
  [<ffffffff8103ddc2>] irq_exit+0x4e/0xcc
  [<ffffffff8100b662>] do_IRQ+0x97/0xae
  [<ffffffff81477ef3>] common_interrupt+0x73/0x73
  <EOI>  [<ffffffff8106e19e>] ? sysctl_check_table+0x201/0x303
  [<ffffffff8106e178>] ? sysctl_check_table+0x1db/0x303
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff810785ef>] ? mark_held_locks+0x73/0x97
  [<ffffffff810efeaa>] ? __slab_alloc+0x402/0x436
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff81078905>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff8103f38c>] ? sysctl_set_parent+0x24/0x33
  [<ffffffff810405e9>] __register_sysctl_paths+0xce/0x25c
  [<ffffffffa02fae2a>] ? ndisc_net_init+0x7d/0x7d [ipv6]
  [<ffffffff81458524>] register_net_sysctl_table+0x43/0x47
  [<ffffffff813c08e6>] neigh_sysctl_register+0x1fc/0x235
  [<ffffffffa02edc82>] addrconf_sysctl_register+0x29/0x46 [ipv6]
  [<ffffffffa02eea1d>] ipv6_add_dev+0x308/0x368 [ipv6]
  [<ffffffffa02f027f>] addrconf_notify+0x58/0x8a5 [ipv6]
  [<ffffffff814759b4>] ? mutex_unlock+0x9/0xb
  [<ffffffffa012120d>] ? cfg80211_netdev_notifier_call+0x1c2/0x561 [cfg80211]
  [<ffffffff8105c5e0>] ? get_parent_ip+0x11/0x42
  [<ffffffff8147ad48>] notifier_call_chain+0x54/0x81
  [<ffffffff81057372>] raw_notifier_call_chain+0xf/0x11
  [<ffffffff813b9877>] call_netdevice_notifiers+0x45/0x4a
  [<ffffffff813bb0e9>] register_netdevice+0x258/0x307
  [<ffffffffa02a9e16>] ieee80211_if_add+0x55a/0x5e6 [mac80211]
  [<ffffffff81475975>] ? __mutex_unlock_slowpath+0x11f/0x155
  [<ffffffff810788c1>] ? trace_hardirqs_on_caller+0x123/0x15a
  [<ffffffff81078905>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffffa02afd93>] ieee80211_add_iface+0x2d/0x57 [mac80211]
  [<ffffffffa01228cd>] ? cfg80211_get_dev_from_info+0x44/0x4b [cfg80211]
  [<ffffffffa012b0c9>] nl80211_new_interface+0xf2/0x186 [cfg80211]
  [<ffffffff813da541>] genl_rcv_msg+0x1f4/0x239
  [<ffffffff813da34d>] ? genl_rcv+0x28/0x28
  [<ffffffff813d921d>] netlink_rcv_skb+0x3e/0x8f
  [<ffffffff813da346>] genl_rcv+0x21/0x28
  [<ffffffff813d8ff8>] netlink_unicast+0xe9/0x152
  [<ffffffff813d9777>] netlink_sendmsg+0x1f8/0x216
  [<ffffffff813a979f>] ? rcu_read_unlock+0x4b/0x4d
  [<ffffffff813a5d3d>] __sock_sendmsg_nosec+0x5f/0x6a
  [<ffffffff813a5d85>] __sock_sendmsg+0x3d/0x48
  [<ffffffff813a662f>] sock_sendmsg+0xa3/0xbc
  [<ffffffff810cdab1>] ? might_fault+0x4e/0x9e
  [<ffffffff810cdafa>] ? might_fault+0x97/0x9e
  [<ffffffff813b02fa>] ? copy_from_user+0x2a/0x2c
  [<ffffffff813b06cc>] ? verify_iovec+0x4f/0xa3
  [<ffffffff813a6e38>] __sys_sendmsg+0x20f/0x29c
  [<ffffffff8105c5e0>] ? get_parent_ip+0x11/0x42
  [<ffffffff8110360a>] ? fcheck_files+0xac/0xea
  [<ffffffff8110375e>] ? fget_light+0x35/0xac
  [<ffffffff813a702e>] sys_sendmsg+0x3d/0x5b
  [<ffffffff8147cd79>] system_call_fastpath+0x16/0x1b
Kernel panic - not syncing: softlockup: hung tasks
Pid: 21673, comm: iw Tainted: G         C O 3.3.6+ #1
Call Trace:
  <IRQ>  [<ffffffff81474e27>] panic+0xb8/0x1d6
  [<ffffffff8109b3ad>] watchdog_timer_fn+0x147/0x16b
  [<ffffffff8109b266>] ? __touch_watchdog+0x1f/0x1f
  [<ffffffff81055938>] __run_hrtimer+0x66/0xc1
  [<ffffffff81055cb7>] hrtimer_interrupt+0xe5/0x1c0
  [<ffffffff8102324e>] smp_apic_timer_interrupt+0x80/0x93
  [<ffffffff8147d8b3>] apic_timer_interrupt+0x73/0x80
  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff810efeb3>] ? __slab_alloc+0x40b/0x436
  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff8147796c>] ? _raw_spin_unlock+0x4e/0x52
  [<ffffffffa02b30e7>] ? ieee80211_rx_handlers+0x17d2/0x1855 [mac80211]
  [<ffffffff810f1b07>] __kmalloc_node_track_caller+0x95/0xf7
  [<ffffffff813aff74>] ? skb_copy+0x3b/0x9f
  [<ffffffff813af2f5>] __alloc_skb+0x71/0x138
  [<ffffffff813aff74>] skb_copy+0x3b/0x9f
  [<ffffffffa02b34e3>] ieee80211_prepare_and_rx_handle+0x379/0x921 [mac80211]
  [<ffffffffa02b43a8>] ieee80211_rx+0x864/0x95c [mac80211]
  [<ffffffff810785ef>] ? mark_held_locks+0x73/0x97
  [<ffffffffa0208c40>] ath_rx_tasklet+0x1765/0x18a3 [ath9k]
  [<ffffffff814779b2>] ? _raw_spin_unlock_irqrestore+0x42/0x79
  [<ffffffffa0204d82>] ath9k_tasklet+0x10d/0x182 [ath9k]
  [<ffffffff8103da1f>] tasklet_action+0x91/0xf1
  [<ffffffff8103e054>] __do_softirq+0x9e/0x15b
  [<ffffffff8147e2ac>] call_softirq+0x1c/0x30
  [<ffffffff8100bd6e>] do_softirq+0x46/0x9e
  [<ffffffff8103ddc2>] irq_exit+0x4e/0xcc
  [<ffffffff8100b662>] do_IRQ+0x97/0xae
  [<ffffffff81477ef3>] common_interrupt+0x73/0x73
  <EOI>  [<ffffffff8106e19e>] ? sysctl_check_table+0x201/0x303
  [<ffffffff8106e178>] ? sysctl_check_table+0x1db/0x303
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff810785ef>] ? mark_held_locks+0x73/0x97
  [<ffffffff810efeaa>] ? __slab_alloc+0x402/0x436
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff81078905>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff8106e21c>] sysctl_check_table+0x27f/0x303
  [<ffffffff8103f38c>] ? sysctl_set_parent+0x24/0x33
  [<ffffffff810405e9>] __register_sysctl_paths+0xce/0x25c
  [<ffffffffa02fae2a>] ? ndisc_net_init+0x7d/0x7d [ipv6]
  [<ffffffff81458524>] register_net_sysctl_table+0x43/0x47
  [<ffffffff813c08e6>] neigh_sysctl_register+0x1fc/0x235
  [<ffffffffa02edc82>] addrconf_sysctl_register+0x29/0x46 [ipv6]
  [<ffffffffa02eea1d>] ipv6_add_dev+0x308/0x368 [ipv6]
  [<ffffffffa02f027f>] addrconf_notify+0x58/0x8a5 [ipv6]
  [<ffffffff814759b4>] ? mutex_unlock+0x9/0xb
  [<ffffffffa012120d>] ? cfg80211_netdev_notifier_call+0x1c2/0x561 [cfg80211]
  [<ffffffff8105c5e0>] ? get_parent_ip+0x11/0x42
  [<ffffffff8147ad48>] notifier_call_chain+0x54/0x81
  [<ffffffff81057372>] raw_notifier_call_chain+0xf/0x11
  [<ffffffff813b9877>] call_netdevice_notifiers+0x45/0x4a
  [<ffffffff813bb0e9>] register_netdevice+0x258/0x307
  [<ffffffffa02a9e16>] ieee80211_if_add+0x55a/0x5e6 [mac80211]
  [<ffffffff81475975>] ? __mutex_unlock_slowpath+0x11f/0x155
  [<ffffffff810788c1>] ? trace_hardirqs_on_caller+0x123/0x15a
  [<ffffffff81078905>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffffa02afd93>] ieee80211_add_iface+0x2d/0x57 [mac80211]
  [<ffffffffa01228cd>] ? cfg80211_get_dev_from_info+0x44/0x4b [cfg80211]
  [<ffffffffa012b0c9>] nl80211_new_interface+0xf2/0x186 [cfg80211]
  [<ffffffff813da541>] genl_rcv_msg+0x1f4/0x239
  [<ffffffff813da34d>] ? genl_rcv+0x28/0x28
  [<ffffffff813d921d>] netlink_rcv_skb+0x3e/0x8f
  [<ffffffff813da346>] genl_rcv+0x21/0x28
  [<ffffffff813d8ff8>] netlink_unicast+0xe9/0x152
  [<ffffffff813d9777>] netlink_sendmsg+0x1f8/0x216
  [<ffffffff813a979f>] ? rcu_read_unlock+0x4b/0x4d
  [<ffffffff813a5d3d>] __sock_sendmsg_nosec+0x5f/0x6a
  [<ffffffff813a5d85>] __sock_sendmsg+0x3d/0x48
  [<ffffffff813a662f>] sock_sendmsg+0xa3/0xbc
  [<ffffffff810cdab1>] ? might_fault+0x4e/0x9e
  [<ffffffff810cdafa>] ? might_fault+0x97/0x9e
  [<ffffffff813b02fa>] ? copy_from_user+0x2a/0x2c
  [<ffffffff813b06cc>] ? verify_iovec+0x4f/0xa3
  [<ffffffff813a6e38>] __sys_sendmsg+0x20f/0x29c
  [<ffffffff8105c5e0>] ? get_parent_ip+0x11/0x42
  [<ffffffff8110360a>] ? fcheck_files+0xac/0xea
  [<ffffffff8110375e>] ? fget_light+0x35/0xac
  [<ffffffff813a702e>] sys_sendmsg+0x3d/0x5b
  [<ffffffff8147cd79>] system_call_fastpath+0x16/0x1b
panic occurred, switching back to text console
Rebooting in 10 seconds..[greearb@fs3 linux-3.3.dev.y]$

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply

* Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.
From: Ondrej Zary @ 2012-05-18 18:16 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: davem, netdev, Alan Cox
In-Reply-To: <1337362769-4676-1-git-send-email-paul.gortmaker@windriver.com>

On Friday 18 May 2012 19:39:29 Paul Gortmaker wrote:
> It was amusing that linux was able to make use of this 1980's
> technology on machines long past its intended lifespan, but
> it probably should go now -- it is causing issues in some
> distros[1], and while that might be fixable, it is just not
> worth it.
>
> [1]
> http://www.linuxquestions.org/questions/linux-networking-3/3com-3c501-card-
>not-detecting-934344/

That looks like a bug elsewhere and removing this driver will not fix it.

-- 
Ondrej Zary

^ permalink raw reply

* Docs bug or argument handling error in iproute2 xt action
From: Robin H. Johnson @ 2012-05-18 18:16 UTC (permalink / raw)
  To: netdev, shemminger

(Please CC, not subscribed to netdev)

>From doc/actions/ifb-README in the iproute2 repo:
===================
# redirect all IP packets arriving in eth0 to ifb0
# use mark 1 --> puts them onto class 1:1
$TC filter add dev eth0 parent ffff: protocol ip prio 10 u32 \
match u32 0 0 flowid 1:1 \
action ipt -j MARK --set-mark 1 \
action mirred egress redirect dev ifb0
===================

Other documentation says 'ipt' has been replaced by 'xt',
but the passing of arguments other than the jump target doesn't seem to work at all with xt.

Running the above with s/ipt/xt/ gets me:
====
xt: unrecognized option '--set-mark'
Killed
====

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85

^ permalink raw reply

* Re: [PATCH 00/10] Doorbell drop recovery for Chelsio T4 iWARP
From: Roland Dreier @ 2012-05-18 17:58 UTC (permalink / raw)
  To: David Miller
  Cc: vipul-ut6Up61K2wZBDgjK7y7TUQ, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, divy-ut6Up61K2wZBDgjK7y7TUQ,
	dm-ut6Up61K2wZBDgjK7y7TUQ, kumaras-ut6Up61K2wZBDgjK7y7TUQ,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW
In-Reply-To: <20120518.133246.2299040648312366919.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Fri, May 18, 2012 at 10:32 AM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> From: Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
> Date: Fri, 18 May 2012 15:29:23 +0530
>
>> Below is a link where Roland advised to re-post the series.
>> http://www.spinics.net/lists/netdev/msg187997.html
>
> Roland, who takes this, you or me?

I already have a few cxgb4 patches in my tree, I'm happy to grab this today.

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] pktgen: fix module unload for good
From: David Miller @ 2012-05-18 17:55 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1337334746.3403.114.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 18 May 2012 11:52:26 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> commit c57b5468406 (pktgen: fix crash at module unload) did a very poor
> job with list primitives.
> 
> 1) list_splice() arguments were in the wrong order 
> 
> 2) list_splice(list, head) has undefined behavior if head is not
> initialized.
> 
> 3) We should use the list_splice_init() variant to clear pktgen_threads
> list.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.
From: Paul Gortmaker @ 2012-05-18 17:39 UTC (permalink / raw)
  To: davem; +Cc: netdev, Paul Gortmaker, Alan Cox

It was amusing that linux was able to make use of this 1980's
technology on machines long past its intended lifespan, but
it probably should go now -- it is causing issues in some
distros[1], and while that might be fixable, it is just not
worth it.

To set the context, the 3c501 was designed in the 1980's to be
used on 8088 PC-XT 8bit ISA machines.  It was built using
discrete TTL components and truly looks like a relic of the past.

But from a functional point of view, the real issue, as stated
in the (also obsolete) Ethernet-HowTo, is that "...the 3c501 can
only do one thing at a time -- while you are removing one packet
from the single-packet buffer it cannot receive another packet,
nor can it receive a packet while loading a transmit packet."

You know things are not good when the Kconfig help text suggests
you make a cron job doing a ping every minute.

Hardware that old and crippled is simply not going to be used by
anyone in a time where 10 year old 100Mbit PCI cards (that are
still functional) are largely give-away items.

[1] http://www.linuxquestions.org/questions/linux-networking-3/3com-3c501-card-not-detecting-934344/

Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

Below is "format-patch -D" to omit full line-by-line deletions,
for review only; full patch based on net-next of today is at:

The following changes since commit 92113bfde2f0982daa5a372d67b62f3d55bbc88a:

  ipv6: bool conversions phase1 (2012-05-18 02:24:13 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git delete-3c501

for you to fetch changes up to 4a3da8d00afdf701a8ff6880180d234d8da8ab6f:

  drivers/net: delete old 8bit ISA 3c501 driver. (2012-05-18 13:10:01 -0400)

----------------------------------------------------------------
Paul Gortmaker (1):
      drivers/net: delete old 8bit ISA 3c501 driver.

 Documentation/networking/multicast.txt |    1 -
 drivers/net/Space.c                    |    3 -
 drivers/net/ethernet/3com/3c501.c      |  896 --------------------------------
 drivers/net/ethernet/3com/3c501.h      |   91 ----
 drivers/net/ethernet/3com/Kconfig      |   14 -
 drivers/net/ethernet/3com/Makefile     |    1 -
 6 files changed, 0 insertions(+), 1006 deletions(-)
 delete mode 100644 drivers/net/ethernet/3com/3c501.c
 delete mode 100644 drivers/net/ethernet/3com/3c501.h

diff --git a/Documentation/networking/multicast.txt b/Documentation/networking/multicast.txt
index b06c8c6..df1a5cf 100644
--- a/Documentation/networking/multicast.txt
+++ b/Documentation/networking/multicast.txt
@@ -15,7 +15,6 @@ IP-MRoute	AllMulti	hardware filters are of no help
 
 Board		Multicast	AllMulti	Promisc		Filter
 ------------------------------------------------------------------------
-3c501		YES		YES		YES		Software
 3c503		YES		YES		YES		Hardware
 3c505		YES		NO		YES		Hardware
 3c507		NO		NO		NO		N/A
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index e3f0fac..d108fac 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -198,9 +198,6 @@ static struct devprobe2 isa_probes[] __initdata = {
 #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET)	/* Intel I82596 */
 	{i82596_probe, 0},
 #endif
-#ifdef CONFIG_EL1		/* 3c501 */
-	{el1_probe, 0},
-#endif
 #ifdef CONFIG_EL16		/* 3c507 */
 	{el16_probe, 0},
 #endif
diff --git a/drivers/net/ethernet/3com/3c501.c b/drivers/net/ethernet/3com/3c501.c
deleted file mode 100644
index bf73e1a..0000000
diff --git a/drivers/net/ethernet/3com/3c501.h b/drivers/net/ethernet/3com/3c501.h
deleted file mode 100644
index 183fd55..0000000
diff --git a/drivers/net/ethernet/3com/Kconfig b/drivers/net/ethernet/3com/Kconfig
index bad4fa6..854b8fe 100644
--- a/drivers/net/ethernet/3com/Kconfig
+++ b/drivers/net/ethernet/3com/Kconfig
@@ -18,20 +18,6 @@ config NET_VENDOR_3COM
 
 if NET_VENDOR_3COM
 
-config EL1
-	tristate "3c501 \"EtherLink\" support"
-	depends on ISA
-	---help---
-	  If you have a network (Ethernet) card of this type, say Y and read
-	  the Ethernet-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.  Also, consider buying a
-	  new card, since the 3c501 is slow, broken, and obsolete: you will
-	  have problems.  Some people suggest to ping ("man ping") a nearby
-	  machine every minute ("man cron") when using this card.
-
-	  To compile this driver as a module, choose M here. The module
-	  will be called 3c501.
-
 config EL3
 	tristate "3c509/3c529 (MCA)/3c579 \"EtherLink III\" support"
 	depends on (ISA || EISA || MCA)
diff --git a/drivers/net/ethernet/3com/Makefile b/drivers/net/ethernet/3com/Makefile
index 1e5382a..74046af 100644
--- a/drivers/net/ethernet/3com/Makefile
+++ b/drivers/net/ethernet/3com/Makefile
@@ -2,7 +2,6 @@
 # Makefile for the 3Com Ethernet device drivers
 #
 
-obj-$(CONFIG_EL1) += 3c501.o
 obj-$(CONFIG_EL3) += 3c509.o
 obj-$(CONFIG_3C515) += 3c515.o
 obj-$(CONFIG_PCMCIA_3C589) += 3c589_cs.o
-- 
1.7.9.1

^ permalink raw reply related

* Re: [PATCH 2/2] cfg80211: deprecate CFG80211_WEXT
From: C. McPherson @ 2012-05-18 17:39 UTC (permalink / raw)
  To: netdev, Christopher Worsley, Adam
In-Reply-To: <20120516214048.739945597@sipsolutions.net>

Please reconsider this! We still have applications that still use some 
CFG80211_WEXT functions. Can't you just disable it as default?

-Clyde

On 05/16/2012 05:40 PM, Johannes Berg wrote:

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox