[PATCH][2.2] eepro 0.12d

2001-01-08 Thread aris

ok,
as i don't have documentation this is the right thing to be
done: restore the default path for old cards and keep the new one to these
blue cards. i hope this finally fixes all problems that my changes (by
guesses and lot of dosemu) introduced on a stable driver.
if it doesn't work for you please email me. i won't rest until i restore
the stability of the old boards and make the blue one supported.

P.S.: (again) if you have any documentation about these boards please send
to me. it will make my work easy and more decent than guesses by sniffing
io.
---
aristeu sergio rozanski filho | www.cathedrallabs.org/~aris
[EMAIL PROTECTED]| [EMAIL PROTECTED] 
---


--- linux/drivers/net/eepro.c.old   Wed Dec 27 21:44:29 2000
+++ linux/drivers/net/eepro.c   Wed Dec 27 22:17:54 2000
@@ -23,6 +23,8 @@
This is a compatibility hardware problem.
 
Versions:
+   0.12d   tottaly isolated old code to new code (blue cards).
+   (aris, 12/27/2000)
0.12c   fixed other multiple cards bug and other cleanups
(aris, 08/21/2000)
0.12b   added reset when the tx interrupt is called and TX isn't done
@@ -103,7 +105,7 @@
 */
 
 static const char *version =
-   "eepro.c: v0.12b 06/20/2000 [EMAIL PROTECTED]\n";
+   "eepro.c: v0.12d 12/27/2000 [EMAIL PROTECTED]\n";
 
 #include 
 
@@ -149,47 +151,28 @@
 #include 
 #include 
 
-
 #include 
 
-/* For linux 2.1.xx */
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x20155
-
 #include 
 #include 
 #include 
 
-#define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) )
 /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */
 #define SLOW_DOWN inb(0x80)
-/* udelay(2) */
-#define compat_init_func(X)  __initfunc(X)
-#define compat_init_data __initdata
-
-#else 
-/* for 2.x */
-
-#define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb), (mode) )
-#define test_and_set_bit(a,b) set_bit((a),(b))
-#define SLOW_DOWN SLOW_DOWN_IO
-#define compat_init_func(X) X
-#define compat_init_data
-
-#endif
 
-
-/* First, a few definitions that the brave might change. */
-/* A zero-terminated list of I/O addresses to be probed. */
-static unsigned int eepro_portlist[] compat_init_data =
+/* First, a few definitions that the brave might change.
+ * A zero-terminated list of I/O addresses to be probed.
+ * note: 0x300 is default, the 595FX supports ALL IO Ports 
+ * from 0x000 to 0x3F0, some of which are reserved in PCs
+ */
+static unsigned eepro_portlist[] __initdata =
{ 0x300, 0x210, 0x240, 0x280, 0x2C0, 0x200, 0x320, 0x340, 0x360, 0};
-/* note: 0x300 is default, the 595FX supports ALL IO Ports 
-  from 0x000 to 0x3F0, some of which are reserved in PCs */
 
 /* use 0 for production, 1 for verification, >2 for debug */
 #ifndef NET_DEBUG
 #define NET_DEBUG 0
 #endif
-static unsigned int net_debug = NET_DEBUG;
+static unsigned net_debug = NET_DEBUG;
 
 /* The number of low I/O ports used by the ethercard. */
 #define EEPRO_IO_EXTENT16
@@ -204,16 +187,17 @@
 struct eepro_local {
struct enet_statistics stats;
unsigned rx_start;
-   unsigned tx_start; /* start of the transmit chain */
-   int tx_last;  /* pointer to last packet in the transmit chain */
-   unsigned tx_end;   /* end of the transmit chain (plus 1) */
-   int eepro;  /* 1 for the EtherExpress Pro/10,
-  2 for the EtherExpress Pro/10+,
-  0 for other 82595-based lan cards. */
-   int version;/* a flag to indicate if this is a TX or FX
-  version of the 82595 chip. */
+   unsigned tx_start;  /* start of the transmit chain */
+   int tx_last;/* pointer to last packet in the transmit chain */
+   unsigned tx_end;/* end of the transmit chain (plus 1) */
+   int eepro;  /* 1 for the EtherExpress Pro/10,
+* 2 for the EtherExpress Pro/10+,
+* 3 for the blue cards,
+* 0 for other 82595-based lan cards. */
+   int version;/* a flag to indicate if this is a TX or FX
+* version of the 82595 chip. */
int stepping;
-   spinlock_t lock; /* Serializing lock  */ 
+   spinlock_t lock;/* Serializing lock  */ 
unsigned rcv_ram;
unsigned rcv_start;
unsigned xmt_bar;
@@ -322,7 +306,7 @@
 static void set_multicast_list(struct device *dev);
 
 static int read_eeprom(int ioaddr, int location, struct device *dev);
-static void hardware_send_packet(struct device *dev, void *buf, short length);
+static int hardware_send_packet(struct 

[PATCH][2.2] eepro 0.12d

2001-01-08 Thread aris

ok,
as i don't have documentation this is the right thing to be
done: restore the default path for old cards and keep the new one to these
blue cards. i hope this finally fixes all problems that my changes (by
guesses and lot of dosemu) introduced on a stable driver.
if it doesn't work for you please email me. i won't rest until i restore
the stability of the old boards and make the blue one supported.

P.S.: (again) if you have any documentation about these boards please send
to me. it will make my work easy and more decent than guesses by sniffing
io.
---
aristeu sergio rozanski filho | www.cathedrallabs.org/~aris
[EMAIL PROTECTED]| [EMAIL PROTECTED] 
---


--- linux/drivers/net/eepro.c.old   Wed Dec 27 21:44:29 2000
+++ linux/drivers/net/eepro.c   Wed Dec 27 22:17:54 2000
@@ -23,6 +23,8 @@
This is a compatibility hardware problem.
 
Versions:
+   0.12d   tottaly isolated old code to new code (blue cards).
+   (aris, 12/27/2000)
0.12c   fixed other multiple cards bug and other cleanups
(aris, 08/21/2000)
0.12b   added reset when the tx interrupt is called and TX isn't done
@@ -103,7 +105,7 @@
 */
 
 static const char *version =
-   "eepro.c: v0.12b 06/20/2000 [EMAIL PROTECTED]\n";
+   "eepro.c: v0.12d 12/27/2000 [EMAIL PROTECTED]\n";
 
 #include linux/module.h
 
@@ -149,47 +151,28 @@
 #include linux/etherdevice.h
 #include linux/skbuff.h
 
-
 #include linux/version.h
 
-/* For linux 2.1.xx */
-#if defined (LINUX_VERSION_CODE)  LINUX_VERSION_CODE  0x20155
-
 #include asm/spinlock.h
 #include linux/init.h
 #include linux/delay.h
 
-#define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) )
 /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */
 #define SLOW_DOWN inb(0x80)
-/* udelay(2) */
-#define compat_init_func(X)  __initfunc(X)
-#define compat_init_data __initdata
-
-#else 
-/* for 2.x */
-
-#define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb), (mode) )
-#define test_and_set_bit(a,b) set_bit((a),(b))
-#define SLOW_DOWN SLOW_DOWN_IO
-#define compat_init_func(X) X
-#define compat_init_data
-
-#endif
 
-
-/* First, a few definitions that the brave might change. */
-/* A zero-terminated list of I/O addresses to be probed. */
-static unsigned int eepro_portlist[] compat_init_data =
+/* First, a few definitions that the brave might change.
+ * A zero-terminated list of I/O addresses to be probed.
+ * note: 0x300 is default, the 595FX supports ALL IO Ports 
+ * from 0x000 to 0x3F0, some of which are reserved in PCs
+ */
+static unsigned eepro_portlist[] __initdata =
{ 0x300, 0x210, 0x240, 0x280, 0x2C0, 0x200, 0x320, 0x340, 0x360, 0};
-/* note: 0x300 is default, the 595FX supports ALL IO Ports 
-  from 0x000 to 0x3F0, some of which are reserved in PCs */
 
 /* use 0 for production, 1 for verification, 2 for debug */
 #ifndef NET_DEBUG
 #define NET_DEBUG 0
 #endif
-static unsigned int net_debug = NET_DEBUG;
+static unsigned net_debug = NET_DEBUG;
 
 /* The number of low I/O ports used by the ethercard. */
 #define EEPRO_IO_EXTENT16
@@ -204,16 +187,17 @@
 struct eepro_local {
struct enet_statistics stats;
unsigned rx_start;
-   unsigned tx_start; /* start of the transmit chain */
-   int tx_last;  /* pointer to last packet in the transmit chain */
-   unsigned tx_end;   /* end of the transmit chain (plus 1) */
-   int eepro;  /* 1 for the EtherExpress Pro/10,
-  2 for the EtherExpress Pro/10+,
-  0 for other 82595-based lan cards. */
-   int version;/* a flag to indicate if this is a TX or FX
-  version of the 82595 chip. */
+   unsigned tx_start;  /* start of the transmit chain */
+   int tx_last;/* pointer to last packet in the transmit chain */
+   unsigned tx_end;/* end of the transmit chain (plus 1) */
+   int eepro;  /* 1 for the EtherExpress Pro/10,
+* 2 for the EtherExpress Pro/10+,
+* 3 for the blue cards,
+* 0 for other 82595-based lan cards. */
+   int version;/* a flag to indicate if this is a TX or FX
+* version of the 82595 chip. */
int stepping;
-   spinlock_t lock; /* Serializing lock  */ 
+   spinlock_t lock;/* Serializing lock  */ 
unsigned rcv_ram;
unsigned rcv_start;
unsigned xmt_bar;
@@ -322,7 +306,7 @@
 static void set_multicast_list(struct device *dev);
 
 static int read_eeprom(int ioaddr, int location, struct device *dev);
-static void