[PATCH] PCNet32/Home 79C978

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

 



This is an update of my previous patch for this card.  It's still patched 
against Linux 2.6.6, not against its prior self :)
--- linux-2.6.6/drivers/net/pcnet32.c.bak	2004-05-10 18:33:18.000000000 -0500
+++ linux-2.6.6/drivers/net/pcnet32.c	2004-06-03 15:21:20.000000000 -0500
@@ -135,6 +135,7 @@ static const char pcnet32_gstrings_test[
 #define MAX_UNITS 8	/* More are supported, limit only on options */
 static int options[MAX_UNITS];
 static int full_duplex[MAX_UNITS];
+static int pcnet32_homepna[MAX_UNITS] = {0,0,0,0,0,0,0,0};
 
 /*
  *				Theory of Operation
@@ -234,7 +235,9 @@ static int full_duplex[MAX_UNITS];
  *	   Jim Lewis <jklewis@us.ibm.com> added ethernet loopback test.
  *	   Thomas Munck Steenholdt <tmus@tmus.dk> non-mii ioctl corrections.
  * v1.29   6 Apr 2004 Jim Lewis <jklewis@us.ibm.com> added physical
- *	   identification code (blink led's).
+ *	   identification code (blink led's)i.
+ * v1.30   4 Jun 2004 Patrick Simmons <psimmons@flash.net> added option
+ *         pcnet32_homepna for selecting HomePNA mode for the PCNet/Home 79C978.
  */
 
 
@@ -958,7 +961,7 @@ pcnet32_probe1(unsigned long ioaddr, uns
     /* initialize variables */
     fdx = mii = fset = dxsuflo = ltint = 0;
     chip_version = (chip_version >> 12) & 0xffff;
-
+    static int homepna_counter = -1;
     switch (chip_version) {
     case 0x2420:
 	chipname = "PCnet/PCI 79C970"; /* PCI */
@@ -991,13 +994,21 @@ pcnet32_probe1(unsigned long ioaddr, uns
 	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 1MB HomePNA mode, and the module
+	 * option pcnet32_homepna=1 can select this instead.
 	 */
 	/* switch to home wiring mode */
 	media = a->read_bcr(ioaddr, 49);
+	homepna_counter++;
+	if(homepna_counter==MAX_UNITS)
+		homepna_counter--;
+	if(pcnet32_homepna[homepna_counter]) {
+	   if (pcnet32_debug > 2)
+	      printk(KERN_DEBUG PFX "media value %#x.\n",  media);
+	   media &= ~3;
+	   media |= 1;
+	}
 	if (pcnet32_debug & NETIF_MSG_PROBE)
 	    printk(KERN_DEBUG PFX "media reset to %#x.\n",  media);
 	a->write_bcr(ioaddr, 49, media);
@@ -2156,6 +2167,10 @@ MODULE_PARM(options, "1-" __MODULE_STRIN
 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 Parameter for HomePNA cards
+  added by Patrick Simmons, 2004*/
+MODULE_PARM(pcnet32_homepna,"1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_PARM_DESC(pcnet32_homepna, DRV_NAME " mode for 79C978 cards (1 for HomePNA, 0 for Ethernet, default Ethernet");
 
 MODULE_AUTHOR("Thomas Bogendoerfer");
 MODULE_DESCRIPTION("Driver for PCnet32 and PCnetPCI based ethercards");

[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