[BK PATCHES] 2.6.x experimental net driver queue

7 messages, 3 authors, 2003-11-19 · open the first message on its own page

[BK PATCHES] 2.6.x experimental net driver queue

From: Jeff Garzik <hidden>
Date: 2003-11-17 00:37:38

Yet more updates.  Syncing with Andrew Morton, and more syncing with Al Viro.

No users of init_etherdev remain in the tree.  (yay!)

Re: [BK PATCHES] 2.6.x experimental net driver queue

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2003-11-17 18:02:48

On Sun, 16 Nov 2003, Jeff Garzik wrote:
Yet more updates.  Syncing with Andrew Morton, and more syncing with Al 
Viro.

No users of init_etherdev remain in the tree.  (yay!)
Here are some (untested, except for cross-gcc) fixes for the m68k-related
drivers:
  - Space.c: fix incorrect prototypes for atarilance_probe() and mace_probe()
  - a2065.c: kill superfluous argument of alloc_etherdev()
  - apne.c:
      o fix incorrect prototype for apne_probe()
      o kill unused variable err
  - mac8390.c:
      o kill unused variable probed
      o fix typos ENDOEV -> ENODEV and ERR_PTE -> ERR_PTR
      o add missing variable slots 
  - macmace.c: use ERR_PTR() where needed
  - macsonic.c: kill unused variable lp
  - mvme147.c:
      o kill conversion warning and kill a cast by making ram unsigned long
      o add missing variable err

Note: The use of `slots' in mac8390.c is not in my tree. Do you know where that
change comes from?
--- linux-net2-2.6.0-test9.orig/drivers/net/Space.c	2003-11-17 11:41:17.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/Space.c	2003-11-17 18:38:56.000000000 +0100
@@ -74,7 +74,7 @@
 extern struct net_device *SK_init(int unit);
 extern struct net_device *seeq8005_probe(int unit);
 extern struct net_device *smc_init(int unit);
-extern struct net_device *atarilance_probe(struct net_device *);
+extern struct net_device *atarilance_probe(int unit);
 extern struct net_device *sun3lance_probe(int unit);
 extern struct net_device *sun3_82586_probe(int unit);
 extern struct net_device *apne_probe(int unit);
@@ -86,7 +86,7 @@
 extern struct net_device *mvme147lance_probe(int unit);
 extern struct net_device *tc515_probe(int unit);
 extern struct net_device *lance_probe(int unit);
-extern struct net_device *mace_probe(struct net_device *dev);
+extern struct net_device *mace_probe(int unit);
 extern struct net_device *macsonic_probe(int unit);
 extern struct net_device *mac8390_probe(int unit);
 extern struct net_device *mac89x0_probe(int unit);
--- linux-net2-2.6.0-test9.orig/drivers/net/a2065.c	2003-11-17 11:41:17.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/a2065.c	2003-11-17 18:39:24.000000000 +0100
@@ -737,7 +737,7 @@
 			continue;
 		}
 
-		dev = alloc_etherdev(0, sizeof(struct lance_private));
+		dev = alloc_etherdev(sizeof(struct lance_private));
 
 		if (dev == NULL) {
 			release_resource(r1);
--- linux-net2-2.6.0-test9.orig/drivers/net/apne.c	2003-11-17 11:41:17.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/apne.c	2003-11-17 18:38:56.000000000 +0100
@@ -72,7 +72,7 @@
 #define NESM_STOP_PG	0x80	/* Last page +1 of RX ring */
 
 
-int apne_probe(struct net_device *dev);
+struct net_device * __init apne_probe(int unit);
 static int apne_probe1(struct net_device *dev, int ioaddr);
 
 static int apne_open(struct net_device *dev);
@@ -572,8 +572,6 @@
 
 int init_module(void)
 {
-	int err;
-
 	apne_dev = apne_probe(-1);
 	if (IS_ERR(apne_dev))
 		return PTR_ERR(apne_dev);
--- linux-net2-2.6.0-test9.orig/drivers/net/mac8390.c	2003-11-17 11:41:20.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/mac8390.c	2003-11-17 18:38:56.000000000 +0100
@@ -228,12 +228,12 @@
 	volatile unsigned short *i;
 	int version_disp = 0;
 	struct nubus_dev * ndev = NULL;
-	static int probed;
-	int err = -ENDOEV;
+	int err = -ENODEV;
 	
 	struct nubus_dir dir;
 	struct nubus_dirent ent;
 	int offset;
+	static unsigned int slots;
 
 	enum mac8390_type cardtype;
 
@@ -379,7 +379,7 @@
 	dev->priv = NULL;
 out:
 	free_netdev(dev);
-	return ERR_PTE(err);
+	return ERR_PTR(err);
 }
 
 #ifdef MODULE
--- linux-net2-2.6.0-test9.orig/drivers/net/macmace.c	2003-11-17 11:41:20.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/macmace.c	2003-11-17 18:38:56.000000000 +0100
@@ -229,7 +229,7 @@
 	
 	if (checksum != 0xFF) {
 		free_netdev(dev);
-		return -ENODEV;
+		return ERR_PTR(-ENODEV);
 	}
 
 	memset(&mp->stats, 0, sizeof(mp->stats));
--- linux-net2-2.6.0-test9.orig/drivers/net/macsonic.c	2003-11-17 11:41:20.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/macsonic.c	2003-11-17 18:38:56.000000000 +0100
@@ -495,7 +495,6 @@
 {
 	static int slots;
 	struct nubus_dev* ndev = NULL;
-	struct sonic_local* lp;
 	unsigned long base_addr, prom_addr;
 	u16 sonic_dcr;
 	int id;
--- linux-net2-2.6.0-test9.orig/drivers/net/mvme147.c	2003-11-17 11:41:20.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/mvme147.c	2003-11-17 18:38:56.000000000 +0100
@@ -41,7 +41,7 @@
 struct m147lance_private {
 	struct lance_private lance;
 	void *base;
-	void *ram;
+	unsigned long ram;
 };
 
 /* function prototypes... This is easy because all the grot is in the
@@ -68,6 +68,7 @@
 	struct m147lance_private *lp;
 	u_long *addr;
 	u_long address;
+	int err;
 
 	if (!MACH_IS_MVME147 || called)
 		return ERR_PTR(-ENODEV);
@@ -112,7 +113,7 @@
 		dev->dev_addr[5]);
 
 	lp = (struct m147lance_private *)dev->priv;
-	lp->ram = (void *)__get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
+	lp->ram = __get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
 	if (!lp->ram)
 	{
 		printk("%s: No memory for LANCE buffers\n", dev->name);
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

Re: [BK PATCHES] 2.6.x experimental net driver queue

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2003-11-18 12:28:14

On Mon, 17 Nov 2003, Geert Uytterhoeven wrote:
On Sun, 16 Nov 2003, Jeff Garzik wrote:
quoted
Yet more updates.  Syncing with Andrew Morton, and more syncing with Al 
Viro.

No users of init_etherdev remain in the tree.  (yay!)
Here are some (untested, except for cross-gcc) fixes for the m68k-related
drivers:
I forget to test the Sun-3 drivers:
  - sun3_82586.c:
      o add missing casts to iounmap() calls
      o fix parameter of free_netdev()
  - sun3lance.c: add missing casts to iounmap() calls
      
Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not
defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed
to ioremap()?
--- linux-net2-2.6.0-test9/drivers/net/sun3_82586.c	2003-11-17 11:06:18.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/sun3_82586.c	2003-11-18 13:03:01.000000000 +0100
@@ -327,7 +327,7 @@
 out1:
 	free_netdev(dev);
 out:
-	iounmap(ioaddr);
+	iounmap((void *)ioaddr);
 	return ERR_PTR(err);
 }
 
@@ -1163,8 +1163,8 @@
 	unsigned long ioaddr = dev_sun3_82586->base_addr;
 	unregister_netdev(dev_sun3_82586);
 	release_region(ioaddr, SUN3_82586_TOTAL_SIZE);
-	iounmap(ioaddr);
-	free_netdev(dev);
+	iounmap((void *)ioaddr);
+	free_netdev(dev_sun3_82586);
 }
 #endif /* MODULE */
 
--- linux-net2-2.6.0-test9/drivers/net/sun3lance.c	2003-11-17 11:06:18.000000000 +0100
+++ linux-net2-2.6.0-test9/drivers/net/sun3lance.c	2003-11-18 13:02:32.000000000 +0100
@@ -287,7 +287,7 @@
 
 out1:
 #ifdef CONFIG_SUN3
-	iounmap(dev->base_addr);
+	iounmap((void *)dev->base_addr);
 #endif
 out:
 	free_netdev(dev);
@@ -327,7 +327,7 @@
 		ioaddr_probe[1] = tmp2;
 
 #ifdef CONFIG_SUN3
-		iounmap(ioaddr);
+		iounmap((void *)ioaddr);
 #endif
 		return 0;
 	}
@@ -957,7 +957,7 @@
 {
 	unregister_netdev(sun3lance_dev);
 #ifdef CONFIG_SUN3
-	iounmap(sun3lance_dev->base_addr);
+	iounmap((void *)sun3lance_dev->base_addr);
 #endif
 	free_netdev(sun3lance_dev);
 }
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

Re: [BK PATCHES] 2.6.x experimental net driver queue

From: Sam Creasey <sammy@sammy.net>
Date: 2003-11-18 21:07:24


On Tue, 18 Nov 2003, Geert Uytterhoeven wrote:
On Mon, 17 Nov 2003, Geert Uytterhoeven wrote:
quoted
On Sun, 16 Nov 2003, Jeff Garzik wrote:
quoted
Yet more updates.  Syncing with Andrew Morton, and more syncing with Al
Viro.

No users of init_etherdev remain in the tree.  (yay!)
Here are some (untested, except for cross-gcc) fixes for the m68k-related
drivers:
I forget to test the Sun-3 drivers:
  - sun3_82586.c:
      o add missing casts to iounmap() calls
      o fix parameter of free_netdev()
  - sun3lance.c: add missing casts to iounmap() calls

Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not
defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed
to ioremap()?
Should be...  I looked back through a few versions of the code, and I'm
not even sure what SUN3_82586_TOTAL_SIZE even was (appears I commented
that line out long ago anyway).  (I'm also amazed just how much of that
driver I've forgotten in the last year or two :)

-- Sam

Re: [BK PATCHES] 2.6.x experimental net driver queue

From: Sam Creasey <sammy@sammy.net>
Date: 2003-11-18 21:19:20


On Tue, 18 Nov 2003, Geert Uytterhoeven wrote:
On Mon, 17 Nov 2003, Geert Uytterhoeven wrote:
quoted
On Sun, 16 Nov 2003, Jeff Garzik wrote:
quoted
Yet more updates.  Syncing with Andrew Morton, and more syncing with Al
Viro.

No users of init_etherdev remain in the tree.  (yay!)
Here are some (untested, except for cross-gcc) fixes for the m68k-related
drivers:
I forget to test the Sun-3 drivers:
  - sun3_82586.c:
      o add missing casts to iounmap() calls
      o fix parameter of free_netdev()
  - sun3lance.c: add missing casts to iounmap() calls

Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not
defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed
to ioremap()?
Should be...  I looked back through a few versions of the code, and I'm
not even sure what SUN3_82586_TOTAL_SIZE even was (appears I commented
that line out long ago anyway).  (I'm also amazed just how much of that
driver I've forgotten in the last year or two :)

-- Sam

Re: [BK PATCHES] 2.6.x experimental net driver queue

From: Jeff Garzik <hidden>
Date: 2003-11-18 21:42:51

thanks, applied both patches

Re: [BK PATCHES] 2.6.x experimental net driver queue

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2003-11-19 09:37:57

On Wed, 19 Nov 2003, Sam Creasey wrote:
On Tue, 18 Nov 2003, Geert Uytterhoeven wrote:
quoted
On Mon, 17 Nov 2003, Geert Uytterhoeven wrote:
quoted
On Sun, 16 Nov 2003, Jeff Garzik wrote:
quoted
Yet more updates.  Syncing with Andrew Morton, and more syncing with Al
Viro.

No users of init_etherdev remain in the tree.  (yay!)
Here are some (untested, except for cross-gcc) fixes for the m68k-related
drivers:
I forget to test the Sun-3 drivers:
  - sun3_82586.c:
      o add missing casts to iounmap() calls
      o fix parameter of free_netdev()
  - sun3lance.c: add missing casts to iounmap() calls

Note that sun3_82586.c no longer compiles since SUN3_82586_TOTAL_SIZE is not
defined. Sammy, is it OK to use PAGE_SIZE for that, since that's what's passed
to ioremap()?
Should be...  I looked back through a few versions of the code, and I'm
not even sure what SUN3_82586_TOTAL_SIZE even was (appears I commented
that line out long ago anyway).  (I'm also amazed just how much of that
driver I've forgotten in the last year or two :)
OK, so here's a additional patch that fixes that:
--- linux/drivers/net/sun3_82586.c.orig	2003-11-19 10:32:09.000000000 +0100
+++ linux/drivers/net/sun3_82586.c	2003-11-19 10:33:44.000000000 +0100
@@ -55,6 +55,7 @@
 
 #define DEBUG       /* debug on */
 #define SYSBUSVAL 0 /* 16 Bit */
+#define SUN3_82586_TOTAL_SIZE	PAGE_SIZE
 
 #define sun3_attn586()  {*(volatile unsigned char *)(dev->base_addr) |= IEOB_ATTEN; *(volatile unsigned char *)(dev->base_addr) &= ~IEOB_ATTEN;}
 #define sun3_reset586() {*(volatile unsigned char *)(dev->base_addr) = 0; udelay(100); *(volatile unsigned char *)(dev->base_addr) = IEOB_NORSET;}
@@ -298,7 +299,7 @@
 	if (found)
 		return ERR_PTR(-ENODEV);
 	
-	ioaddr = (unsigned long)ioremap(IE_OBIO, PAGE_SIZE);
+	ioaddr = (unsigned long)ioremap(IE_OBIO, SUN3_82586_TOTAL_SIZE);
 	if (!ioaddr)
 		return ERR_PTR(-ENOMEM);
 	found = 1;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help