[PATCH] pcnet32.c, kernel 2.4.20

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds support for running AMD's PCnet/Home 79C978 chip in HomePNA 
mode.  It is patched against kernel version 2.4.20.  Currently, the driver is 
in Ethernet mode by default and the media bit changes for HomePNA mode are 
protected by #if 0.  I added an option, "mode", that can be set to "homepna" 
so the driver mode can be selected when the module is loaded.  For example, 

modprobe pcnet32 mode=homepna

I tested this patch on my Diamond HomeFree cards, and it worked for both 
ethernet and HomePNA modes.

Is there some documentation for this driver to which I can add this new 
option?  Please CC me on any messages to the list, as I am not subscribed.  
Cheers,

Jim Blomo


--- linux-2.4.20/drivers/net/pcnet32.c	2003-04-12 21:05:17.000000000 -0700
+++ /home/jim/src/pcnet32.c	2003-05-11 15:09:25.000000000 -0700
@@ -84,6 +84,7 @@

 static int max_interrupt_work = 80;
 static int rx_copybreak = 200;
+static char mode[10];

 #define PCNET32_PORT_AUI      0x00
 #define PCNET32_PORT_10BT     0x01
@@ -582,19 +583,20 @@
 	fdx = 1;
 	/*
 	 * This is based on specs published at www.amd.com.  This section
-	 * assumes that a card with a 79C978 wants to go into 1Mb HomePNA
-	 * mode.  The 79C978 can also go into standard ethernet, and there
-	 * probably should be some sort of module option to select the
-	 * mode by which the card should operate
+	 * assumes that a card with a 79C978 wants to go into standard ethernet
+	 * mode.  The 79C978 can also go into HomePNA mode, and the
+	 * module option to select the mode in which the card should operate is
+	 * "mode".
 	 */
-	/* switch to home wiring mode */
 	media = a->read_bcr(ioaddr, 49);
-#if 0
-	if (pcnet32_debug > 2)
-	    printk(KERN_DEBUG PFX "media value %#x.\n",  media);
-	media &= ~3;
-	media |= 1;
-#endif
+	if( !strcmp(mode, "homepna") ) {
+		/* switch to home wiring mode */
+	    if (pcnet32_debug > 2)
+			printk(KERN_DEBUG PFX "media value %#x.\n",  media);
+	    media &= ~3;
+	    media |= 1;
+	}
+
 	if (pcnet32_debug > 2)
 	    printk(KERN_DEBUG PFX "media reset to %#x.\n",  media);
 	a->write_bcr(ioaddr, 49, media);
@@ -1704,6 +1706,9 @@
 MODULE_PARM_DESC(options, DRV_NAME " initial option setting(s) (0-15)");
 MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
 MODULE_PARM_DESC(full_duplex, DRV_NAME " full duplex setting(s) (1)");
+MODULE_PARM(mode, "c10"); 
+MODULE_PARM_DESC(mode, DRV_NAME " switch to HomePNA mode (homepna)");
+

 MODULE_AUTHOR("Thomas Bogendoerfer");
 MODULE_DESCRIPTION("Driver for PCnet32 and PCnetPCI based ethercards");

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux