--- ethtool-5.orig/ethtool-util.h
+++ ethtool-5/ethtool-util.h
@@ -9,6 +9,9 @@
 typedef __uint16_t u16;         /* ditto */
 typedef __uint8_t u8;           /* ditto */
 #include "ethtool-copy.h"
+#if defined(PRE24_COMPAT) && defined(__sparc__)
+# include "ethtool-sparc22.h"
+#endif
 
 /* National Semiconductor DP83815, DP83816 */
 int natsemi_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
--- ethtool-5.orig/ethtool.c
+++ ethtool-5/ethtool.c
@@ -33,10 +33,12 @@
 #include <string.h>
 #include <errno.h>
 #include <net/if.h>
+#include <sys/utsname.h>
 
 #include <linux/sockios.h>
 #include "ethtool-util.h"
 
+
 #ifndef SIOCETHTOOL
 #define SIOCETHTOOL     0x8946
 #endif
@@ -65,6 +67,8 @@
 static int do_goffload(int fd, struct ifreq *ifr);
 static int do_soffload(int fd, struct ifreq *ifr);
 static int do_gstats(int fd, struct ifreq *ifr);
+static int send_ioctl(int fd, struct ifreq *ifr);
+static int check_for_pre24_kernel();
 
 static enum {
 	MODE_HELP = -1,
@@ -171,15 +175,24 @@
 static void show_usage(int badarg)
 {
 	int i;
-	fprintf(stderr, PACKAGE " version " VERSION "\n");
-	fprintf(stderr,
+	if (badarg != 0) {
+		fprintf(stderr,
+			"ethtool: bad command line argument(s)\n"
+			"For more information run ethtool -h\n"
+		);
+	}
+	else {
+		/* ethtool -h */
+		fprintf(stdout, PACKAGE " version " VERSION "\n");
+		fprintf(stdout,
 		"Usage:\n"
 		"ethtool DEVNAME\tDisplay standard information about device\n");
-	for (i = 0; args[i].srt; i++) {
-		fprintf(stderr, "        ethtool %s|%s DEVNAME\t%s\n%s",
-			args[i].srt, args[i].lng,
-			args[i].help,
-			args[i].opthelp ? args[i].opthelp : "");
+		for (i = 0; args[i].srt; i++) {
+			fprintf(stderr, "        ethtool %s|%s DEVNAME\t%s\n%s",
+				args[i].srt, args[i].lng,
+				args[i].help,
+				args[i].opthelp ? args[i].opthelp : "");
+		}
 	}
 	exit(badarg);
 }
@@ -247,6 +260,7 @@
 static int gwol_changed = 0; /* did anything in GWOL change? */
 static int msglvl_wanted = -1;
 static int phys_id_time = 0;
+static int is_pre24_kernel = 0;
 static int gregs_changed = 0;
 static int gregs_dump_raw = 0;
 static int geeprom_changed = 0;
@@ -1204,7 +1218,7 @@
 
 	drvinfo.cmd = ETHTOOL_GDRVINFO;
 	ifr->ifr_data = (caddr_t)&drvinfo;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get driver information");
 		return 71;
@@ -1220,7 +1234,7 @@
 
 	epause.cmd = ETHTOOL_GPAUSEPARAM;
 	ifr->ifr_data = (caddr_t)&epause;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		err = dump_pause();
 		if (err)
@@ -1268,7 +1282,7 @@
 
 	epause.cmd = ETHTOOL_GPAUSEPARAM;
 	ifr->ifr_data = (caddr_t)&epause;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err) {
 		perror("Cannot get device pause settings");
 		return 77;
@@ -1283,7 +1297,7 @@
 
 	epause.cmd = ETHTOOL_SPAUSEPARAM;
 	ifr->ifr_data = (caddr_t)&epause;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err) {
 		perror("Cannot set device pause parameters");
 		return 79;
@@ -1298,7 +1312,7 @@
 
 	ering.cmd = ETHTOOL_GRINGPARAM;
 	ifr->ifr_data = (caddr_t)&ering;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err) {
 		perror("Cannot get device ring settings");
 		return 76;
@@ -1313,7 +1327,7 @@
 
 	ering.cmd = ETHTOOL_SRINGPARAM;
 	ifr->ifr_data = (caddr_t)&ering;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err) {
 		perror("Cannot set device ring parameters");
 		return 81;
@@ -1330,7 +1344,7 @@
 
 	ering.cmd = ETHTOOL_GRINGPARAM;
 	ifr->ifr_data = (caddr_t)&ering;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		err = dump_ring();
 		if (err)
@@ -1351,7 +1365,7 @@
 
 	ecoal.cmd = ETHTOOL_GCOALESCE;
 	ifr->ifr_data = (caddr_t)&ecoal;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		err = dump_coalesce();
 		if (err)
@@ -1370,7 +1384,7 @@
 
 	ecoal.cmd = ETHTOOL_GCOALESCE;
 	ifr->ifr_data = (caddr_t)&ecoal;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err) {
 		perror("Cannot get device coalesce settings");
 		return 76;
@@ -1386,7 +1400,7 @@
 
 	ecoal.cmd = ETHTOOL_SCOALESCE;
 	ifr->ifr_data = (caddr_t)&ecoal;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err) {
 		perror("Cannot set device ring parameters");
 		return 81;
@@ -1404,7 +1418,7 @@
 
 	eval.cmd = ETHTOOL_GRXCSUM;
 	ifr->ifr_data = (caddr_t)&eval;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err)
 		perror("Cannot get device rx csum settings");
 	else {
@@ -1414,7 +1428,7 @@
 
 	eval.cmd = ETHTOOL_GTXCSUM;
 	ifr->ifr_data = (caddr_t)&eval;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err)
 		perror("Cannot get device tx csum settings");
 	else {
@@ -1424,7 +1438,7 @@
 
 	eval.cmd = ETHTOOL_GSG;
 	ifr->ifr_data = (caddr_t)&eval;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err)
 		perror("Cannot get device scatter-gather settings");
 	else {
@@ -1434,7 +1448,7 @@
 
 	eval.cmd = ETHTOOL_GTSO;
 	ifr->ifr_data = (caddr_t)&eval;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err)
 		perror("Cannot get device tcp segmentation offload settings");
 	else {
@@ -1480,7 +1494,7 @@
 		eval.cmd = ETHTOOL_SRXCSUM;
 		eval.data = (off_csum_rx_wanted == 1);
 		ifr->ifr_data = (caddr_t)&eval;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err) {
 			perror("Cannot set device rx csum settings");
 			return 84;
@@ -1492,7 +1506,7 @@
 		eval.cmd = ETHTOOL_STXCSUM;
 		eval.data = (off_csum_tx_wanted == 1);
 		ifr->ifr_data = (caddr_t)&eval;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err) {
 			perror("Cannot set device tx csum settings");
 			return 85;
@@ -1504,7 +1518,7 @@
 		eval.cmd = ETHTOOL_SSG;
 		eval.data = (off_sg_wanted == 1);
 		ifr->ifr_data = (caddr_t)&eval;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err) {
 			perror("Cannot set device scatter-gather settings");
 			return 86;
@@ -1516,7 +1530,7 @@
 		eval.cmd = ETHTOOL_STSO;
 		eval.data = (off_tso_wanted == 1);
 		ifr->ifr_data = (caddr_t)&eval;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err) {
 			perror("Cannot set device tcp segmentation offload settings");
 			return 88;
@@ -1563,7 +1577,7 @@
 
 	ecmd.cmd = ETHTOOL_GSET;
 	ifr->ifr_data = (caddr_t)&ecmd;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		err = dump_ecmd(&ecmd);
 		if (err)
@@ -1575,7 +1589,7 @@
 
 	wolinfo.cmd = ETHTOOL_GWOL;
 	ifr->ifr_data = (caddr_t)&wolinfo;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		err = dump_wol(&wolinfo);
 		if (err)
@@ -1587,7 +1601,7 @@
 
 	edata.cmd = ETHTOOL_GMSGLVL;
 	ifr->ifr_data = (caddr_t)&edata;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		fprintf(stdout, "	Current message level: 0x%08x (%d)\n",
 			edata.data, edata.data);
@@ -1598,7 +1612,7 @@
 
 	edata.cmd = ETHTOOL_GLINK;
 	ifr->ifr_data = (caddr_t)&edata;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err == 0) {
 		fprintf(stdout, "	Link detected: %s\n",
 			edata.data ? "yes":"no");
@@ -1623,7 +1637,7 @@
 
 		ecmd.cmd = ETHTOOL_GSET;
 		ifr->ifr_data = (caddr_t)&ecmd;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err < 0) {
 			perror("Cannot get current device settings");
 		} else {
@@ -1656,7 +1670,7 @@
 			/* Try to perform the update. */
 			ecmd.cmd = ETHTOOL_SSET;
 			ifr->ifr_data = (caddr_t)&ecmd;
-			err = ioctl(fd, SIOCETHTOOL, ifr);
+			err = send_ioctl(fd, ifr);
 			if (err < 0)
 				perror("Cannot set new settings");
 		}
@@ -1681,7 +1695,7 @@
 
 		wol.cmd = ETHTOOL_GWOL;
 		ifr->ifr_data = (caddr_t)&wol;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err < 0) {
 			perror("Cannot get current wake-on-lan settings");
 		} else {
@@ -1699,7 +1713,7 @@
 			/* Try to perform the update. */
 			wol.cmd = ETHTOOL_SWOL;
 			ifr->ifr_data = (caddr_t)&wol;
-			err = ioctl(fd, SIOCETHTOOL, ifr);
+			err = send_ioctl(fd, ifr);
 			if (err < 0)
 				perror("Cannot set new wake-on-lan settings");
 		}
@@ -1717,7 +1731,7 @@
 		edata.cmd = ETHTOOL_SMSGLVL;
 		edata.data = msglvl_wanted;
 		ifr->ifr_data = (caddr_t)&edata;;
-		err = ioctl(fd, SIOCETHTOOL, ifr);
+		err = send_ioctl(fd, ifr);
 		if (err < 0)
 			perror("Cannot set new msglvl");
 	}
@@ -1733,7 +1747,7 @@
 
 	drvinfo.cmd = ETHTOOL_GDRVINFO;
 	ifr->ifr_data = (caddr_t)&drvinfo;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get driver information");
 		return 72;
@@ -1747,7 +1761,7 @@
 	regs->cmd = ETHTOOL_GREGS;
 	regs->len = drvinfo.regdump_len;
 	ifr->ifr_data = (caddr_t)regs;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get register dump");
 		free(regs);
@@ -1770,7 +1784,7 @@
 
 	edata.cmd = ETHTOOL_NWAY_RST;
 	ifr->ifr_data = (caddr_t)&edata;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0)
 		perror("Cannot restart autonegotiation");
 
@@ -1785,7 +1799,7 @@
 
 	drvinfo.cmd = ETHTOOL_GDRVINFO;
 	ifr->ifr_data = (caddr_t)&drvinfo;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get driver information");
 		return 74;
@@ -1806,7 +1820,7 @@
 	eeprom->len = geeprom_length;
 	eeprom->offset = geeprom_offset;
 	ifr->ifr_data = (caddr_t)eeprom;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get EEPROM data");
 		free(eeprom);
@@ -1832,7 +1846,7 @@
 	edata.eeprom.magic = seeprom_magic;
 	edata.data = seeprom_value;
 	ifr->ifr_data = (caddr_t)&edata.eeprom;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot set EEPROM data");
 		return 87;
@@ -1850,7 +1864,7 @@
 
 	drvinfo.cmd = ETHTOOL_GDRVINFO;
 	ifr->ifr_data = (caddr_t)&drvinfo;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get driver information");
 		return 72;
@@ -1869,7 +1883,7 @@
 	else
 		test->flags = 0;
 	ifr->ifr_data = (caddr_t)test;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot test");
 		free (test);
@@ -1888,7 +1902,7 @@
 	strings->string_set = ETH_SS_TEST;
 	strings->len = drvinfo.testinfo_len;
 	ifr->ifr_data = (caddr_t)strings;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get strings");
 		free (test);
@@ -1910,7 +1924,7 @@
 	edata.cmd = ETHTOOL_PHYS_ID;
 	edata.data = phys_id_time;
 	ifr->ifr_data = (caddr_t)&edata;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0)
 		perror("Cannot identify NIC");
 
@@ -1927,7 +1941,7 @@
 
 	drvinfo.cmd = ETHTOOL_GDRVINFO;
 	ifr->ifr_data = (caddr_t)&drvinfo;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get driver information");
 		return 71;
@@ -1953,7 +1967,7 @@
 	strings->string_set = ETH_SS_STATS;
 	strings->len = n_stats;
 	ifr->ifr_data = (caddr_t) strings;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get stats strings information");
 		free(strings);
@@ -1964,7 +1978,7 @@
 	stats->cmd = ETHTOOL_GSTATS;
 	stats->n_stats = n_stats;
 	ifr->ifr_data = (caddr_t) stats;
-	err = ioctl(fd, SIOCETHTOOL, ifr);
+	err = send_ioctl(fd, ifr);
 	if (err < 0) {
 		perror("Cannot get stats information");
 		free(strings);
@@ -1988,8 +2002,75 @@
 	return 0;
 }
 
+static int send_ioctl(int fd, struct ifreq *ifr)
+{
+	int err;
+	if (! is_pre24_kernel) {
+		err = ioctl(fd, SIOCETHTOOL, ifr);
+	}
+	else {
+#if defined(__sparc__) && defined(PRE24_COMPAT)
+		/* this part is working only on sparc HME ethernet driver */
+		struct ethtool_cmd_22 old_ecmd;
+		struct ethtool_cmd *ecmd = (struct ethtool_cmd *)ifr->ifr_data;
+		/* fill in old pre-2.4 ethtool struct */
+		old_ecmd.cmd = ecmd->cmd;
+		old_ecmd.supported = ecmd->supported;
+		old_ecmd.speed = ecmd->speed;
+		old_ecmd.duplex = ecmd->duplex;
+		old_ecmd.port = ecmd->port;
+		old_ecmd.phy_address = ecmd->phy_address;
+		old_ecmd.transceiver = ecmd->transceiver;
+		old_ecmd.autoneg = ecmd->autoneg;
+		/* issue the ioctl */
+		ifr->ifr_data = (caddr_t) &old_ecmd;
+		err = ioctl( fd, SIOCETHTOOL_22, ifr );
+		ifr->ifr_data = (caddr_t) ecmd;
+		/* copy back results from ioctl (on get cmd) */
+		if (ecmd->cmd == ETHTOOL_GSET) {
+			ecmd->supported = old_ecmd.supported;
+			ecmd->speed = old_ecmd.speed;
+			ecmd->duplex = old_ecmd.duplex;
+			ecmd->port = old_ecmd.port;
+			ecmd->phy_address = old_ecmd.phy_address;
+			ecmd->transceiver = old_ecmd.transceiver;
+			ecmd->autoneg = old_ecmd.autoneg;
+		}
+#else
+		err = -1;
+		errno = EOPNOTSUPP;
+#endif
+	}
+	return err;
+}
+
+#ifdef PRE24_COMPAT
+static int check_for_pre24_kernel()
+{
+	struct utsname sysinfo;
+	int rmaj, rmin, rpl;
+	if (uname( &sysinfo ) < 0) {
+		perror( "Cannot get system informations:" );
+		return 68;
+	}
+	if (sscanf( sysinfo.release, "%d.%d.%d", &rmaj, &rmin, &rpl ) != 3) {
+		fprintf( stderr, "Cannot parse kernel revision: %s\n", sysinfo.release );
+		return 68;
+	}
+	if (rmaj < 2 || (rmaj == 2 && rmin < 4))
+		is_pre24_kernel = 1;
+	return 0;
+}
+#endif
+
 int main(int argc, char **argp, char **envp)
 {
+	int err;
+#ifdef PRE24_COMPAT
+	err = check_for_pre24_kernel();
+	if (err != 0)
+		return err;
+#endif
 	parse_cmdline(argc, argp);
 	return doit();
 }
--- ethtool-5.orig/debian/changelog
+++ ethtool-5/debian/changelog
@@ -0,0 +1,95 @@
+ethtool (5-2) unstable; urgency=low
+
+  * Removed outdated information in package description.
+    Closes: #389689.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org>  Fri, 11 May 2007 22:12:08 +1000
+
+ethtool (5-1) unstable; urgency=low
+
+  * New maintainer.
+  * New upstream release. Closes: #380681.
+  * Set Standards-Version to 3.7.2.
+  * Set debhelper compatibility to 5.
+  * Added debian/watch.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org>  Fri, 27 Oct 2006 13:05:16 +1000
+
+ethtool (3-1) unstable; urgency=low
+
+  * New upstream release.  Closes: #308954.
+  * Lintian cleanup (debhelper V4 compatibility, updated standard-version).
+
+ -- Eric Delaunay <delaunay@debian.org>  Tue, 25 Oct 2005 22:50:55 +0000
+
+ethtool (2-1) unstable; urgency=low
+
+  * New upstream release (new upstream version scheme using only 1 number).
+    Closes: #275982.
+  * Removed autoconf build-dependency (don't patch configure.in not to trigger
+    an autoconf run when building this package; PRE24_COMPAT option is
+    directly passed to Makefile through CFLAGS). Closes: #213921.
+  * Strip binary. Closes: #273715.
+  * Updated README.Debian. Closes: #213699.
+  * Don't be so verbose when called with bad arg. Display long help message
+    (ethtool -h) to stdout. Closes: #256249.
+
+ -- Eric Delaunay <delaunay@debian.org>  Tue,  9 Nov 2004 23:40:54 +0100
+
+ethtool (1.8-2) unstable; urgency=low
+
+  * Fixed autoconf troubles. Closes: #211982.
+  * Fixed package and manpage description about which kernel revision ethtool
+    is compatible with. Closes: #207798.
+
+ -- Eric Delaunay <delaunay@debian.org>  Wed, 24 Sep 2003 19:23:36 +0200
+
+ethtool (1.8-1) unstable; urgency=low
+
+  * New upstream release. Closes: #203577.
+  * Fixed typo in man page. Closes: #199711.
+
+ -- Eric Delaunay <delaunay@debian.org>  Sun, 17 Aug 2003 19:41:14 +0200
+
+ethtool (1.7-1) unstable; urgency=low
+
+  * New upstream release. Closes: #179413.
+  * Build-Depends on debhelper. Closes: #189636.
+
+ -- Eric Delaunay <delaunay@debian.org>  Thu, 24 Apr 2003 23:08:27 +0200
+
+ethtool (1.6-1) unstable; urgency=low
+
+  * New upstream release.
+  * Moved to utils section. Closes: #145095.
+
+ -- Eric Delaunay <delaunay@debian.org>  Sat, 13 Jul 2002 17:41:06 +0200
+
+ethtool (1.5-2) unstable; urgency=low
+
+  * Moved ethtool-sparc22.h into ethtool-util.h to get u8 & u32 defined before
+    use. Closes: #143431.
+
+ -- Eric Delaunay <delaunay@debian.org>  Sat, 20 Apr 2002 21:50:19 +0200
+
+ethtool (1.5-1) unstable; urgency=low
+
+  * New upstream release.
+  * New maintainer address.
+  * Updated list of drivers that support ethtool protocol in README.debian
+    based on infos found in 2.4.18 kernel tree.
+
+ -- Eric Delaunay <delaunay@debian.org>  Sun, 14 Apr 2002 19:24:18 +0200
+
+ethtool (1.3-1) unstable; urgency=low
+
+  * Initial release forked from sparc-utils 1.8-2 to enable multi-arch support.
+  * Updated from ethtool 1.0 to 1.3 to enable 2.4 kernel support.
+  * Hacked backward compatibility with pre-2.4 kernels for use with sparc Happy
+    Meal (hme) Ethernet cards.
+
+ -- Eric Delaunay <delaunay@lix.polytechnique.fr>  Tue,  2 Oct 2001 20:25:05 +0200
+
+Local variables:
+mode: debian-changelog
+End:
--- ethtool-5.orig/debian/control
+++ ethtool-5/debian/control
@@ -0,0 +1,15 @@
+Source: ethtool
+Section: utils
+Priority: extra
+Maintainer: Anibal Monsalve Salazar <anibal@debian.org>
+Standards-Version: 3.7.2
+Build-Depends: debhelper (>= 5)
+
+Package: ethtool
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: sparc-utils (<< 1.9-1)
+Description: display or change ethernet card settings
+ ethtool is used for querying settings of an ethernet device and changing them.
+ .
+  Homepage: http://sourceforge.net/projects/gkernel/
--- ethtool-5.orig/debian/copyright
+++ ethtool-5/debian/copyright
@@ -0,0 +1,10 @@
+This is the Debian GNU/Linux prepackaged version of "ethtool".
+
+This package is currently maintained by Eric Delaunay <delaunay@debian.org>
+and built from sources obtained from Sourceforce:
+
+http://sourceforge.net/projects/gkernel/
+
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
--- ethtool-5.orig/debian/rules
+++ ethtool-5/debian/rules
@@ -0,0 +1,53 @@
+#! /usr/bin/make -f
+# (C) 2001, Eric Delaunay
+
+CC=gcc
+# PRE24_COMPAT is adding support for old Sparc HME ethernet driver on 2.2 kernel
+CFLAGS=-O2 -DPRE24_COMPAT
+
+a=$(shell dpkg --print-architecture)
+p=ethtool
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	./configure --prefix=/usr --mandir=/usr/share/man --enable-compat
+	$(MAKE) all CC=$(CC) CFLAGS="$(CFLAGS)"
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+	-$(MAKE) distclean
+	dh_clean
+
+binary: binary-arch binary-indep
+
+binary-indep:
+# nothing to do for arch independent binary packages
+
+binary-arch: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	# install binaries
+	$(MAKE) install-strip DESTDIR=`pwd`/debian/ethtool
+	# force removing .comment section from binary (lintian check)
+	strip -R .comment debian/ethtool/usr/sbin/ethtool
+	# install documentation
+	dh_installmanpages
+	dh_installdocs AUTHORS NEWS README
+	dh_installchangelogs ChangeLog
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+source diff:                                                                  
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+.PHONY: binary-arch binary-indep binary build clean
--- ethtool-5.orig/debian/README.Debian
+++ ethtool-5/debian/README.Debian
@@ -0,0 +1,78 @@
+ethtool for Debian
+------------------
+
+ethtool is a small utility for examining and tuning your ethernet-based network
+interface.  See the man page for more details.
+
+ethtool is only supported on 2.2 kernel for use with Sparc Happy Meal (hme)
+ethernet cards.
+On 2.4 or newer kernel, more architectures and cards are supported (see below).
+
+Note: as of nov. 2004, this file is quite out of date (need to be synchronized
+on kernel sources).
+
+
+2.4 kernel support for ETHTOOL protocol
+---------------------------------------
+
+Informations shown below were extracted from 2.4.18 kernel sources.
+Please, report back to me misinterpretation of it contents.
+
+Last column show current capabilities of these drivers:
+  D = get driver infos
+  C = get/set card settings
+  W = get/set wake-on-lan settings
+  M = get/set message-level
+  L = get link status
+  R = restart autonegotiation
+  G = get registers
+  P = get EEPROM
+
+An 'x' indicates that the feature is available, a '.' indicates not.
+
+Ethernet card family                        linux driver    DCWMLRGP
+--------------------------------------------------------------------
+3Com 3c501 cards                            3c501           x..x....
+3Com 3c503 and 3c503/16 cards               3c503           x.......
+3Com Etherlink Plus (3C505) cards           3c505           x..x....
+3Com EtherLink16 (3c507) cards              3c507           x..x....
+3Com EtherLink3 (3c509) cards               3c509           x..x....
+3Com ISA EtherLink XL (3c515) cards         3c515           x..x....
+3Com Etherlink/MC (3c523) cards (i82586)    3c523           x.......
+3Com Etherlink/MC32 (3c527) cards           3c527           x..x....
+3Com "Vortex" and "Boomerang" series        3c59x           x.......
+RealTek RTL-8139C+ Ethernet cards           8139cp          xx.xxx..
+RealTek RTL-8139 Fast Ethernet              8139too         xxxxxx..
+Alteon AceNIC Gigabit Ethernet              acenic          .x......
+Davicom DM9102* NIC Fast Ethernet           dfme            x.......
+Intel i82544EI Gigabit Ethernet	            e1000           x.......
+Intel i82557-559 Ethernet cards             eepro100        x.......
+SMC 83c170 EPIC/100 Fast Ethernet           epic100         xx.xxx..
+Myson MTD-8xx 100/10M Ethernet PCI          fealnx          xx.xxx..
+Packet Engines GNIC-II Gigabit Ethernet     hamachi         x.......
+SGI's IOC3 based Ethernet cards             ioc3-eth        .x......
+NatSemi DP8381x series                      natsemi         xxxxxxxx
+NE2000 clone on PCI bus                     ne2k-pci        x.......
+National Semiconductor DP83820 10/100/1000  ns83820         x...x...
+AMD PCnet32 ethernet cards                  pcnet32         xx.xxx..
+SiS 900/7016 PCI Fast Ethernet              sis900          x.......
+Adaptec Starfire                            starfire        xx.xxx..
+Sundance ST201 "Alta"                       sundance        x.......
+Sun GEM Gbit ethernet                       sungem          xx.xx...
+SUN Happy Meal (BigMac) Ethernet            sunhme          .x......
+Digital 21*4* Tulip ethernet cards          tulip           x.......
+VIA Rhine PCI Fast Ethernet                 via-rhine       xx.xxx..
+Winbond W89c840 PCI Ethernet                winbond-840     xx.xxx..
+Packet Engines G-NIC PCI Gigabit Ethernet   yellowfin       x.......
+
+PCMCIA Ethernet card family                 linux driver    DCWMLRGP
+--------------------------------------------------------------------
+3com 3c589 PCMCIA ethernet cards            3c589_cs        x..x....
+Aironet 4500 Pcmcia ethernet cards          aironet4500_cs  x..x....
+fmvj18x (and compatibles) PCMCIA cards      fmvj18x_cs      x..x....
+Netwave AirSurfer Wireless LAN PC Card      netwave_cs      x..x....
+New Media PCMCIA ethernet cards             nmclan_cs       x..x....
+Xircom CBE-100 ethernet cards               xircom_tulip_cb xx......
+
+--
+ Eric Delaunay <delaunay@debian.org>
--- ethtool-5.orig/debian/compat
+++ ethtool-5/debian/compat
@@ -0,0 +1 @@
+5
--- ethtool-5.orig/debian/watch
+++ ethtool-5/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://prdownloads.sourceforge.net/gkernel/ethtool-([\d\.]+).tar.gz
--- ethtool-5.orig/ethtool-sparc22.h
+++ ethtool-5/ethtool-sparc22.h
@@ -0,0 +1,29 @@
+/*
+ * This is an excerpt from kernel-source-2.2.19 include/asm-sparc/ethtool.h.
+ */
+
+/* $Id: ethtool.h,v 1.1.2.1 2000/01/31 05:02:42 davem Exp $
+ * ethtool.h: Defines for SparcLinux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (davem@redhat.com)
+ */
+
+#ifndef _SPARC_ETHTOOL_H
+#define _SPARC_ETHTOOL_H
+
+/* pre-2.4 value of SIOCETHTOOL */
+#define SIOCETHTOOL_22 (SIOCDEVPRIVATE + 0x0f)
+
+/* This should work for both 32 and 64 bit userland. */
+struct ethtool_cmd_22 {
+	u32	cmd;
+	u32	supported;
+	u16	speed;
+	u8	duplex;
+	u8	port;
+	u8	phy_address;
+	u8	transceiver;
+	u8	autoneg;
+};
+
+#endif /* _SPARC_ETHTOOL_H */
