Re: starfire update for 2.4.4-pre5

2001-04-20 Thread Ion Badulescu

On Fri, 20 Apr 2001, Jeff Garzik wrote:

> alas:
> http://gtf.org/garzik/kernel/files/patches/2.4/2.4.4/net-version-2.4.4.5.patch.gz

Oh well. Another hour, another patch to be sent out. :-)

I'll deal with CVS tomorrow, when I figure out on which disk I have enough
space for yet another tree. So I can only hope the attached diff,
generated against 2.4.4-pre5 plus the above patch, will apply cleanly.

Once these changes are accepted, the next step will be to add zerocopy 
support. I have it all ready (since January), I was just waiting for the 
zerocopy framework to be included.

Thanks,
Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.
-
--- /mnt/3/linux-2.4/drivers/net/starfire.c Fri Apr 20 04:06:54 2001
+++ linux-2.4/drivers/net/starfire.cFri Apr 20 04:08:23 2001
@@ -20,7 +20,7 @@
---
 
Linux kernel-specific changes:
-   
+
LK1.1.1 (jgarzik):
- Use PCI driver interface
- Fix MOD_xxx races
@@ -31,27 +31,102 @@
 
LK1.1.3 (Andrew Morton)
- Timer cleanups
-   
+
LK1.1.4 (jgarzik):
- Merge Becker version 1.03
+
+   LK1.2.1 (Ion Badulescu <[EMAIL PROTECTED]>)
+   - Support hardware Rx/Tx checksumming
+   - Use the GFP firmware taken from Adaptec's Netware driver
+
+   LK1.2.2 (Ion Badulescu)
+   - Backported to 2.2.x
+
+   LK1.2.3 (Ion Badulescu)
+   - Fix the flaky mdio interface
+   - More compat clean-ups
+
+   LK1.2.4 (Ion Badulescu)
+   - More 2.2.x initialization fixes
+
+   LK1.2.5 (Ion Badulescu)
+   - Several fixes from Manfred Spraul
+
+   LK1.2.6 (Ion Badulescu)
+   - Fixed ifup/ifdown/ifup problem in 2.4.x
+
+   LK1.2.7 (Ion Badulescu)
+   - Removed unused code
+   - Made more functions static and __init
+
+   LK1.2.8 (Ion Badulescu)
+   - Quell bogus error messages, inform about the Tx threshold
+   - Removed #ifdef CONFIG_PCI, this driver is PCI only
+
+   LK1.2.9 (Ion Badulescu)
+   - Merged Jeff Garzik's changes from 2.4.4-pre5
+   - Added 2.2.x compatibility stuff required by the above changes
+
+   LK1.2.9a (Ion Badulescu)
+   - More updates from Jeff Garzik
+
+TODO:
+   - implement tx_timeout() properly
+   - support ethtool
 */
 
+/*
+ * Adaptec's license for their Novell drivers (which is where I got the
+ * firmware files) does not allow one to redistribute them. Thus, we can't
+ * include the firmware with this driver.
+ *
+ * However, an end-user is allowed to download and use it, after
+ * converting it to C header files using starfire_firmware.pl.
+ * Once that's done, the #undef must be changed into a #define
+ * for this driver to really use the firmware. Note that Rx/Tx
+ * hardware TCP checksumming is not possible without the firmware.
+ *
+ * I'm currently [Feb 2001] talking to Adaptec about this redistribution
+ * issue. Stay tuned...
+ */
+#undef HAS_FIRMWARE
+/*
+ * The current frame processor firmware fails to checksum a fragment
+ * of length 1. If and when this is fixed, the #define below can be removed.
+ */
+#define HAS_BROKEN_FIRMWARE
+
 /* The user-configurable values.
These may be modified when a driver module is loaded.*/
 
 /* Used for tuning interrupt latency vs. overhead. */
-static int interrupt_mitigation = 0x0;
+static int interrupt_mitigation;
 
 static int debug = 1;  /* 1 normal messages, 0 quiet .. 7 verbose. */
 static int max_interrupt_work = 20;
 static int mtu;
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
-   The Starfire has a 512 element hash table based on the Ethernet CRC.  */
-static int multicast_filter_limit = 32;
+   The Starfire has a 512 element hash table based on the Ethernet CRC. */
+static int multicast_filter_limit = 512;
 
-/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
-   Setting to > 1518 effectively disables this feature. */
+#define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer.*/
+/*
+ * Set the copy breakpoint for the copy-only-tiny-frames scheme.
+ * Setting to > 1518 effectively disables this feature.
+ *
+ * NOTE:
+ * The ia64 doesn't allow for unaligned loads even of integers being
+ * misaligned on a 2 byte boundary. Thus always force copying of
+ * packets as the starfire doesn't allow for misaligned DMAs ;-(
+ * 23/10/2000 - Jes
+ *
+ * The Alpha and the Sparc don't allow unaligned loads, either. -Ion
+ */
+#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__)
+static int rx_copybreak = PKT_BUF_SZ;
+#else
 static int rx_copybreak = 0;
+#endif
 
 /* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' exist for driver interoperability.
@@ -75,21 +150,9 @@
 
 /* Operational parameters that usually are not changed. */
 /* Time in jiffies before concluding the 

Re: starfire update for 2.4.4-pre5

2001-04-20 Thread Jeff Garzik

alas:
http://gtf.org/garzik/kernel/files/patches/2.4/2.4.4/net-version-2.4.4.5.patch.gz

To avoid all sync problems with me, you can always get the latest out of
my CVS.  CVS instructions on http://sourceforge.net/projects/gkernel/

Check out module 'linux_2_4'.  Branch name is based on the latest Linus
release: hack_2_4_4_pre5, hack_2_4_3, hack_2_4_2, etc.  Using the branch
name is critical: you cannot simply "cvs co linux_2_4" and have things
work.

-- 
Jeff Garzik  | The difference between America and England is that
Building 1024| the English think 100 miles is a long distance and
MandrakeSoft | the Americans think 100 years is a long time.
 |  (random fortune)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



starfire update for 2.4.4-pre5

2001-04-20 Thread Ion Badulescu

Hi Jeff,

Here is the same starfire.c version I sent earlier, this time diff'ed 
against 2.4.4-pre5. It's essentially the version from 2.2.19 plus your 
2.4.4-pre5 changes minus the 2.2 compatibility stuff.

Thanks,
Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.
--
--- /mnt/3/linux-2.4/drivers/net/starfire.c Thu Apr 19 15:54:59 2001
+++ linux-2.4/drivers/net/starfire.cThu Apr 19 21:39:24 2001
@@ -20,7 +20,7 @@
---
 
Linux kernel-specific changes:
-   
+
LK1.1.1 (jgarzik):
- Use PCI driver interface
- Fix MOD_xxx races
@@ -31,9 +31,45 @@
 
LK1.1.3 (Andrew Morton)
- Timer cleanups
-   
+
LK1.1.4 (jgarzik):
- Merge Becker version 1.03
+
+   LK1.2.1 (Ion Badulescu <[EMAIL PROTECTED]>)
+   - Support hardware Rx/Tx checksumming
+   - Use the GFP firmware taken from Adaptec's Netware driver
+
+   LK1.2.2 (Ion Badulescu)
+   - Backported to 2.2.x
+
+   LK1.2.3 (Ion Badulescu)
+   - Fix the flaky mdio interface
+   - More compat clean-ups
+
+   LK1.2.4 (Ion Badulescu)
+   - More 2.2.x initialization fixes
+
+   LK1.2.5 (Ion Badulescu)
+   - Several fixes from Manfred Spraul
+
+   LK1.2.6 (Ion Badulescu)
+   - Fixed ifup/ifdown/ifup problem in 2.4.x
+
+   LK1.2.7 (Ion Badulescu)
+   - Removed unused code
+   - Made more functions static and __init
+
+   LK1.2.8 (Ion Badulescu)
+   - Quell bogus error messages, inform about the Tx threshold
+   - Removed #ifdef CONFIG_PCI, this driver is PCI only
+
+   LK1.2.9 (Ion Badulescu)
+   - Merged Jeff Garzik's changes from 2.4.4-pre5
+   - Added 2.2.x compatibility stuff required by the above changes
+
+TODO:
+   - implement tx_timeout() properly
+   - support ethtool
 */
 
 /* These identify the driver base version and may not be removed. */
@@ -43,24 +79,60 @@
 " Updates and info at http://www.scyld.com/network/starfire.html\n";
 
 static const char version3[] =
-" (unofficial 2.4.x kernel port, version 1.1.4, August 10, 2000)\n";
+" (unofficial 2.4.x kernel port, version 1.2.9, April 19, 2001)\n";
+
+/*
+ * Adaptec's license for their Novell drivers (which is where I got the
+ * firmware files) does not allow one to redistribute them. Thus, we can't
+ * include the firmware with this driver.
+ *
+ * However, an end-user is allowed to download and use it, after
+ * converting it to C header files using starfire_firmware.pl.
+ * Once that's done, the #undef must be changed into a #define
+ * for this driver to really use the firmware. Note that Rx/Tx
+ * hardware TCP checksumming is not possible without the firmware.
+ *
+ * I'm currently [Feb 2001] talking to Adaptec about this redistribution
+ * issue. Stay tuned...
+ */
+#undef HAS_FIRMWARE
+/*
+ * The current frame processor firmware fails to checksum a fragment
+ * of length 1. If and when this is fixed, the #define below can be removed.
+ */
+#define HAS_BROKEN_FIRMWARE
 
 /* The user-configurable values.
These may be modified when a driver module is loaded.*/
 
 /* Used for tuning interrupt latency vs. overhead. */
-static int interrupt_mitigation = 0x0;
+static int interrupt_mitigation;
 
 static int debug = 1;  /* 1 normal messages, 0 quiet .. 7 verbose. */
 static int max_interrupt_work = 20;
 static int mtu;
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
-   The Starfire has a 512 element hash table based on the Ethernet CRC.  */
-static int multicast_filter_limit = 32;
+   The Starfire has a 512 element hash table based on the Ethernet CRC. */
+static int multicast_filter_limit = 512;
 
-/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
-   Setting to > 1518 effectively disables this feature. */
+#define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer.*/
+/*
+ * Set the copy breakpoint for the copy-only-tiny-frames scheme.
+ * Setting to > 1518 effectively disables this feature.
+ *
+ * NOTE:
+ * The ia64 doesn't allow for unaligned loads even of integers being
+ * misaligned on a 2 byte boundary. Thus always force copying of
+ * packets as the starfire doesn't allow for misaligned DMAs ;-(
+ * 23/10/2000 - Jes
+ *
+ * The Alpha and the Sparc don't allow unaligned loads, either. -Ion
+ */
+#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__)
+static int rx_copybreak = PKT_BUF_SZ;
+#else
 static int rx_copybreak = 0;
+#endif
 
 /* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' exist for driver interoperability.
@@ -84,21 +156,9 @@
 
 /* Operational parameters that usually are not changed. */
 /* Time in jiffies before concluding the transmitter is hung. */
-#define TX_TIMEOUT  (2*HZ)
+#define TX_TIMEOUT (2*HZ)
 
-#define PKT_BUF_SZ 1536   

starfire update for 2.4.4-pre5

2001-04-20 Thread Ion Badulescu

Hi Jeff,

Here is the same starfire.c version I sent earlier, this time diff'ed 
against 2.4.4-pre5. It's essentially the version from 2.2.19 plus your 
2.4.4-pre5 changes minus the 2.2 compatibility stuff.

Thanks,
Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.
--
--- /mnt/3/linux-2.4/drivers/net/starfire.c Thu Apr 19 15:54:59 2001
+++ linux-2.4/drivers/net/starfire.cThu Apr 19 21:39:24 2001
@@ -20,7 +20,7 @@
---
 
Linux kernel-specific changes:
-   
+
LK1.1.1 (jgarzik):
- Use PCI driver interface
- Fix MOD_xxx races
@@ -31,9 +31,45 @@
 
LK1.1.3 (Andrew Morton)
- Timer cleanups
-   
+
LK1.1.4 (jgarzik):
- Merge Becker version 1.03
+
+   LK1.2.1 (Ion Badulescu [EMAIL PROTECTED])
+   - Support hardware Rx/Tx checksumming
+   - Use the GFP firmware taken from Adaptec's Netware driver
+
+   LK1.2.2 (Ion Badulescu)
+   - Backported to 2.2.x
+
+   LK1.2.3 (Ion Badulescu)
+   - Fix the flaky mdio interface
+   - More compat clean-ups
+
+   LK1.2.4 (Ion Badulescu)
+   - More 2.2.x initialization fixes
+
+   LK1.2.5 (Ion Badulescu)
+   - Several fixes from Manfred Spraul
+
+   LK1.2.6 (Ion Badulescu)
+   - Fixed ifup/ifdown/ifup problem in 2.4.x
+
+   LK1.2.7 (Ion Badulescu)
+   - Removed unused code
+   - Made more functions static and __init
+
+   LK1.2.8 (Ion Badulescu)
+   - Quell bogus error messages, inform about the Tx threshold
+   - Removed #ifdef CONFIG_PCI, this driver is PCI only
+
+   LK1.2.9 (Ion Badulescu)
+   - Merged Jeff Garzik's changes from 2.4.4-pre5
+   - Added 2.2.x compatibility stuff required by the above changes
+
+TODO:
+   - implement tx_timeout() properly
+   - support ethtool
 */
 
 /* These identify the driver base version and may not be removed. */
@@ -43,24 +79,60 @@
 " Updates and info at http://www.scyld.com/network/starfire.html\n";
 
 static const char version3[] =
-" (unofficial 2.4.x kernel port, version 1.1.4, August 10, 2000)\n";
+" (unofficial 2.4.x kernel port, version 1.2.9, April 19, 2001)\n";
+
+/*
+ * Adaptec's license for their Novell drivers (which is where I got the
+ * firmware files) does not allow one to redistribute them. Thus, we can't
+ * include the firmware with this driver.
+ *
+ * However, an end-user is allowed to download and use it, after
+ * converting it to C header files using starfire_firmware.pl.
+ * Once that's done, the #undef must be changed into a #define
+ * for this driver to really use the firmware. Note that Rx/Tx
+ * hardware TCP checksumming is not possible without the firmware.
+ *
+ * I'm currently [Feb 2001] talking to Adaptec about this redistribution
+ * issue. Stay tuned...
+ */
+#undef HAS_FIRMWARE
+/*
+ * The current frame processor firmware fails to checksum a fragment
+ * of length 1. If and when this is fixed, the #define below can be removed.
+ */
+#define HAS_BROKEN_FIRMWARE
 
 /* The user-configurable values.
These may be modified when a driver module is loaded.*/
 
 /* Used for tuning interrupt latency vs. overhead. */
-static int interrupt_mitigation = 0x0;
+static int interrupt_mitigation;
 
 static int debug = 1;  /* 1 normal messages, 0 quiet .. 7 verbose. */
 static int max_interrupt_work = 20;
 static int mtu;
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
-   The Starfire has a 512 element hash table based on the Ethernet CRC.  */
-static int multicast_filter_limit = 32;
+   The Starfire has a 512 element hash table based on the Ethernet CRC. */
+static int multicast_filter_limit = 512;
 
-/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
-   Setting to  1518 effectively disables this feature. */
+#define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer.*/
+/*
+ * Set the copy breakpoint for the copy-only-tiny-frames scheme.
+ * Setting to  1518 effectively disables this feature.
+ *
+ * NOTE:
+ * The ia64 doesn't allow for unaligned loads even of integers being
+ * misaligned on a 2 byte boundary. Thus always force copying of
+ * packets as the starfire doesn't allow for misaligned DMAs ;-(
+ * 23/10/2000 - Jes
+ *
+ * The Alpha and the Sparc don't allow unaligned loads, either. -Ion
+ */
+#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__)
+static int rx_copybreak = PKT_BUF_SZ;
+#else
 static int rx_copybreak = 0;
+#endif
 
 /* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' exist for driver interoperability.
@@ -84,21 +156,9 @@
 
 /* Operational parameters that usually are not changed. */
 /* Time in jiffies before concluding the transmitter is hung. */
-#define TX_TIMEOUT  (2*HZ)
+#define TX_TIMEOUT (2*HZ)
 
-#define PKT_BUF_SZ 1536   

Re: starfire update for 2.4.4-pre5

2001-04-20 Thread Ion Badulescu

On Fri, 20 Apr 2001, Jeff Garzik wrote:

 alas:
 http://gtf.org/garzik/kernel/files/patches/2.4/2.4.4/net-version-2.4.4.5.patch.gz

Oh well. Another hour, another patch to be sent out. :-)

I'll deal with CVS tomorrow, when I figure out on which disk I have enough
space for yet another tree. So I can only hope the attached diff,
generated against 2.4.4-pre5 plus the above patch, will apply cleanly.

Once these changes are accepted, the next step will be to add zerocopy 
support. I have it all ready (since January), I was just waiting for the 
zerocopy framework to be included.

Thanks,
Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.
-
--- /mnt/3/linux-2.4/drivers/net/starfire.c Fri Apr 20 04:06:54 2001
+++ linux-2.4/drivers/net/starfire.cFri Apr 20 04:08:23 2001
@@ -20,7 +20,7 @@
---
 
Linux kernel-specific changes:
-   
+
LK1.1.1 (jgarzik):
- Use PCI driver interface
- Fix MOD_xxx races
@@ -31,27 +31,102 @@
 
LK1.1.3 (Andrew Morton)
- Timer cleanups
-   
+
LK1.1.4 (jgarzik):
- Merge Becker version 1.03
+
+   LK1.2.1 (Ion Badulescu [EMAIL PROTECTED])
+   - Support hardware Rx/Tx checksumming
+   - Use the GFP firmware taken from Adaptec's Netware driver
+
+   LK1.2.2 (Ion Badulescu)
+   - Backported to 2.2.x
+
+   LK1.2.3 (Ion Badulescu)
+   - Fix the flaky mdio interface
+   - More compat clean-ups
+
+   LK1.2.4 (Ion Badulescu)
+   - More 2.2.x initialization fixes
+
+   LK1.2.5 (Ion Badulescu)
+   - Several fixes from Manfred Spraul
+
+   LK1.2.6 (Ion Badulescu)
+   - Fixed ifup/ifdown/ifup problem in 2.4.x
+
+   LK1.2.7 (Ion Badulescu)
+   - Removed unused code
+   - Made more functions static and __init
+
+   LK1.2.8 (Ion Badulescu)
+   - Quell bogus error messages, inform about the Tx threshold
+   - Removed #ifdef CONFIG_PCI, this driver is PCI only
+
+   LK1.2.9 (Ion Badulescu)
+   - Merged Jeff Garzik's changes from 2.4.4-pre5
+   - Added 2.2.x compatibility stuff required by the above changes
+
+   LK1.2.9a (Ion Badulescu)
+   - More updates from Jeff Garzik
+
+TODO:
+   - implement tx_timeout() properly
+   - support ethtool
 */
 
+/*
+ * Adaptec's license for their Novell drivers (which is where I got the
+ * firmware files) does not allow one to redistribute them. Thus, we can't
+ * include the firmware with this driver.
+ *
+ * However, an end-user is allowed to download and use it, after
+ * converting it to C header files using starfire_firmware.pl.
+ * Once that's done, the #undef must be changed into a #define
+ * for this driver to really use the firmware. Note that Rx/Tx
+ * hardware TCP checksumming is not possible without the firmware.
+ *
+ * I'm currently [Feb 2001] talking to Adaptec about this redistribution
+ * issue. Stay tuned...
+ */
+#undef HAS_FIRMWARE
+/*
+ * The current frame processor firmware fails to checksum a fragment
+ * of length 1. If and when this is fixed, the #define below can be removed.
+ */
+#define HAS_BROKEN_FIRMWARE
+
 /* The user-configurable values.
These may be modified when a driver module is loaded.*/
 
 /* Used for tuning interrupt latency vs. overhead. */
-static int interrupt_mitigation = 0x0;
+static int interrupt_mitigation;
 
 static int debug = 1;  /* 1 normal messages, 0 quiet .. 7 verbose. */
 static int max_interrupt_work = 20;
 static int mtu;
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
-   The Starfire has a 512 element hash table based on the Ethernet CRC.  */
-static int multicast_filter_limit = 32;
+   The Starfire has a 512 element hash table based on the Ethernet CRC. */
+static int multicast_filter_limit = 512;
 
-/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
-   Setting to  1518 effectively disables this feature. */
+#define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer.*/
+/*
+ * Set the copy breakpoint for the copy-only-tiny-frames scheme.
+ * Setting to  1518 effectively disables this feature.
+ *
+ * NOTE:
+ * The ia64 doesn't allow for unaligned loads even of integers being
+ * misaligned on a 2 byte boundary. Thus always force copying of
+ * packets as the starfire doesn't allow for misaligned DMAs ;-(
+ * 23/10/2000 - Jes
+ *
+ * The Alpha and the Sparc don't allow unaligned loads, either. -Ion
+ */
+#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__)
+static int rx_copybreak = PKT_BUF_SZ;
+#else
 static int rx_copybreak = 0;
+#endif
 
 /* Used to pass the media type, etc.
Both 'options[]' and 'full_duplex[]' exist for driver interoperability.
@@ -75,21 +150,9 @@
 
 /* Operational parameters that usually are not changed. */
 /* Time in jiffies before concluding the transmitter