Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Dec 2000 01:54:04 +1100
From:      "Chris Knight" <chris@aims.com.au>
To:        <freebsd-stable@freebsd.org>
Cc:        <scott@uk.freebsd.org>, <imp@village.org>
Subject:   FreeBSD 4.2-stable, if_xe.c and Xircom CreditCard Ethernet Adapter IIps
Message-ID:  <000201c05ba6$8dbb6060$020aa8c0@aims.private>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0003_01C05C02.C12BD860
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Howdy,

I finally got sick of not being able to use the above-mentioned card that
was given to me, so I've come up with the following hack. It's not pretty,
but it works for me. I've included the CIS dump from the card if anyone is
interested in doing a better job. I'm not able to test this with other
Xircoms unfortunately.
I found that pccardd would generate a kernel panic due to scp->card_type not
being set by the time the weird CE2 detection was run. Also, if my memory
serves me correctly, this kernel panic also occurs under -current. I noticed
the use of strcmp (yuck), but I left them alone, as I'm sure that would
break the detection code for other Xircoms.
I also added some extra debug statements, which helped me to get it going.
If this is the wrong place for this, please let me know where I should send
it.

Regards,
Chris Knight
Systems Administrator
AIMS Independent Computer Professionals
Tel: +61 3 6334 6664  Fax: +61 3 6331 7032  Mob: +61 419 528 795
Web: http://www.aims.com.au


------=_NextPart_000_0003_01C05C02.C12BD860
Content-Type: text/plain;
	name="ps-ce2-10.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="ps-ce2-10.txt"

Configuration data for card in slot 0
Tuple #1, code = 0x1 (Common memory descriptor), length = 2
    000:  d9 40
	Common memory device information:
		Device number 1, type Function specific, WPS = ON
		Speed = 250nS, Memory block size = 512b, 9 units
Tuple #2, code = 0x15 (Version 1 info), length = 60
    000:  04 01 58 69 72 63 6f 6d 00 43 72 65 64 69 74 43
    010:  61 72 64 20 31 30 42 61 73 65 2d 54 00 50 53 2d
    020:  43 45 32 2d 31 30 00 32 2e 31 2f 30 38 30 32 36
    030:  34 33 32 2d 30 39 31 34 39 34 00 ff
	Version = 4.1, Manuf = [Xircom], card vers = [CreditCard 10Base-T]
	Addit. info = [PS-CE2-10],[2.1/08026432-091494]
Tuple #3, code = 0x1a (Configuration map), length = 5
    000:  01 01 00 08 03
	Reg len = 2, config register addr = 0x800, last config = 0x1
	Registers: XX------ 
Tuple #4, code = 0x1b (Configuration entry), length = 21
    000:  c1 41 be 71 55 2e 46 06 21 8e 7d 35 fc 2a 64 10
    010:  f8 ff 10 00 20
	Config index = 0x1(default)
	Interface byte = 0x41 (I/O)  +RDY/-BSY active
	Vcc pwr:
		Nominal operating supply voltage: 5 x 1V
		Max current average over 1 second: 2.5 x 100mA
		Max current average over 10 ms: 4 x 100mA
		Power down supply current: 1 x 100mA
	Vpp pwr:
		Nominal operating supply voltage: 1.2 x 10V, ext = 0x7d
		Max current average over 10 ms: 3 x 10mA
	Wait scale Speed = 2.0 x 100 ns
	Card decodes 4 address lines, full 8/16 Bit I/O
		IRQ modes:
		IRQs:  3 4 5 6 7 8 9 10 11 12 13 14 15
	Memory space length = 0x10
	Max twin cards = 0
	Misc attr: (Power down supported)
Tuple #5, code = 0x22 (Functional EXT), length = 13
    000:  02 01 06 00 80 c7 40 79 7a 00 00 00 ff
Tuple #6, code = 0x20 (Manufacturer ID), length = 5
    000:  05 01 0a 01 ff
	PCMCIA ID = 0x105, OEM ID = 0x10a
Tuple #7, code = 0xff (Terminator), length = 0
2 slots found

------=_NextPart_000_0003_01C05C02.C12BD860
Content-Type: application/octet-stream;
	name="if_xe.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="if_xe.c.diff"

--- if_xe.c.orig	Fri Dec  1 15:14:23 2000
+++ if_xe.c	Sat Dec  2 00:49:37 2000
@@ -205,7 +205,7 @@
  * Debug functions -- uncomment for VERY verbose dignostic information.
  * Set to 1 for less verbose information
  */
-/* #define XE_DEBUG 2 */
+#define XE_DEBUG 2
 #ifdef XE_DEBUG
 #define XE_REG_DUMP(scp)		xe_reg_dump((scp))
 #define XE_MII_DUMP(scp)		xe_mii_dump((scp))
@@ -355,6 +355,9 @@
       default:
 	scp->vendor = "Unknown";
       }
+#if XE_DEBUG > 1
+      device_printf(dev, "Vendor %s\n", scp->vendor);
+#endif
 
       if (!((prod & 0x40) && (media & 0x01))) {
 #if XE_DEBUG > 1
@@ -393,6 +396,7 @@
 	} else {		/* Ethernet-only cards */
 #if XE_DEBUG > 1
 	  device_printf(dev, "Card is Ethernet only\n");
+          device_printf(dev, "Card prod val is %d\n", prod & 0x0f);
 #endif
 	  switch (prod & 0x0f) {
 	  case 1:
@@ -403,9 +407,19 @@
 	  case 3:
 	    scp->mohawk = 1;
 	    scp->card_type = "CE3"; break;
+          /* my PS-CE2-10 has a prod of 0xff ?? */
+          case 15:
+            scp->card_type = "CE2"; break;
 	  default:
 	    rc = ENODEV;
 	  }
+#if XE_DEBUG > 1
+          if (rc != ENODEV) {
+            device_printf(dev, "Ethernet Type: %s\n", scp->card_type);
+          } else {
+            device_printf(dev, "Card Type not set!\n");
+          }
+#endif
 	}
       }
       success++;
@@ -420,6 +434,17 @@
 #endif
 	for (i = 0; i < ETHER_ADDR_LEN; i++)
           scp->arpcom.ac_enaddr[i] = CISTPL_DATA(buf, i+2);
+      }
+      /* my PS-CE2-10 has this: */
+      if ((CISTPL_LEN(buf) == 13) &&
+	  (CISTPL_DATA(buf, 0) == 0x02) &&
+	  (CISTPL_DATA(buf, 1) == 0x01) &&
+	  (CISTPL_DATA(buf, 2) == ETHER_ADDR_LEN)) {
+#if XE_DEBUG > 1
+	device_printf(dev, "Got MAC address (0x22)\n");
+#endif
+	for (i = 0; i < ETHER_ADDR_LEN; i++)
+          scp->arpcom.ac_enaddr[i] = CISTPL_DATA(buf, i+3);
       }
       success++;
       break;

------=_NextPart_000_0003_01C05C02.C12BD860--




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000201c05ba6$8dbb6060$020aa8c0>