Skip to contentSkip to conversation

Driver for IXP4xx built-in Ethernet ports

PATCH In review Krzysztof Halasa 4 participants 6 messages Apr 20, 2008 – May 2, 2008

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Driver for IXP4xx built-in Ethernet ports

Adds a driver for built-in IXP4xx Ethernet ports.

drivers/net/arm/Kconfig +8 -0
index f9cc2b6..8eda6ee 100644
@@ -47,3 +47,11 @@ config EP93XX_ETH
 	help
 	  This is a driver for the ethernet hardware included in EP93xx CPUs.
 	  Say Y if you are building a kernel for EP93xx based devices.
+
+config IXP4XX_ETH
+	tristate "Intel IXP4xx Ethernet support"
+	depends on ARM && ARCH_IXP4XX && IXP4XX_NPE && IXP4XX_QMGR
+	select MII
+	help
+	  Say Y here if you want to use built-in Ethernet ports
+	  on IXP4xx processor.
drivers/net/arm/Makefile +1 -0
index a4c8682..7c812ac 100644
@@ -9,3 +9,4 @@ obj-$(CONFIG_ARM_ETHER3)	+= ether3.o
 obj-$(CONFIG_ARM_ETHER1)	+= ether1.o
 obj-$(CONFIG_ARM_AT91_ETHER)	+= at91_ether.o
 obj-$(CONFIG_EP93XX_ETH)	+= ep93xx_eth.o
+obj-$(CONFIG_IXP4XX_ETH)	+= ixp4xx_eth.o
drivers/net/arm/ixp4xx_eth.c new file +1265 -0

1,265 lines not on this page · raw message

arch/arm/mach-ixp4xx/ixp4xx_npe.c +4 -0
index 83c137e..63a23fa 100644
@@ -448,7 +448,9 @@ int npe_send_message(struct npe *npe, const void *msg, const char *what)
 		return -ETIMEDOUT;
 	}
 
+#if DEBUG_MSG > 1
 	debug_msg(npe, "Sending a message took %i cycles\n", cycles);
+#endif
 	return 0;
 }
 
@@ -484,7 +486,9 @@ int npe_recv_message(struct npe *npe, void *msg, const char *what)
 		return -ETIMEDOUT;
 	}
 
+#if DEBUG_MSG > 1
 	debug_msg(npe, "Receiving a message took %i cycles\n", cycles);
+#endif
 	return 0;
 }
 
arch/arm/mach-ixp4xx/ixp4xx_qmgr.c +2 -0
index e833013..fab94ea 100644
@@ -184,6 +184,8 @@ void qmgr_release_queue(unsigned int queue)
 	case 3: mask[0] = 0xFF; break;
 	}
 
+	mask[1] = mask[2] = mask[3] = 0;
+
 	while (addr--)
 		shift_mask(mask);
 
#1 lore raw
Quoted 1 line · Krzysztof Halasa

Adds a driver for built-in IXP4xx Ethernet ports.

Are there any comments on this driver? We've been using it for a while now in Debian and it would be great see it in the mainline kernel.

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#2 lore raw
Quoted 6 lines · Martin Michlmayr
Quoted 1 line · Krzysztof Halasa

Adds a driver for built-in IXP4xx Ethernet ports.

Are there any comments on this driver? We've been using it for a while now in Debian and it would be great see it in the mainline kernel.

Same here. I've been using it on my IXP42x-based ARM box for three months now, and it (a) hasn't caused a single problem of any kind, and (b) is a massive improvement over having to deal with Intel's IXP400 software and driver kit.

#3 lore raw
In reply to Krzysztof Halasa
Quoted 1 line

Adds a driver for built-in IXP4xx Ethernet ports.

Thanks for applying those other two patches, Jeff.

And if you worry about this one and specifically about these two included fixes to arch/arm/mach-ixp4xx/ixp4xx_npe.c and ixp4xx_qmgr.c, I believe they don't need to go through Russell's patch system, and I maintain the files, there is no potential conflict. I guess you can take this patch safely.

Alternatively I can omit the changes and submit them separately, your call.

You have already acked a previous version of this driver, I have changed NAPI interface (as needed by 2.6.24) since then.

TIA.

Signature · 1 line
Krzysztof Halasa
#5 lore raw
Quoted 2 lines · Jeff Garzik

the ifdefs are really ugly and want cleaning, but the rest seems sane. applied

Thanks.

They (#ifdef __ARMEB__) are indeed very ugly but I don't know how to clean them, except by splitting the driver into two (which is worse).

The most used things are #defined and then used without those __ARMEB__ checks.

Duplicating those functions is effectively splitting into two :-(

Well, perhaps Intel could give us firmware which could convert LE-BE on the fly while TX/RX, that would make the LE code go away. Binary-only :-(

OTOH I could convert #if* DEBUG_*, I will look at it.

Signature · 1 line
Krzysztof Halasa