Date: Mon, 11 Dec 2000 23:33:37 +1100 (EST) From: chris@aims.com.au To: FreeBSD-gnats-submit@freebsd.org Cc: chris@aims.com.au Subject: kern/23468: xe Driver causes kernel panic when Xircom PS-CE2-10 inserted Message-ID: <200012111233.eBBCXbK00439@ait0fd01.aims.private> Resent-Message-ID: <200012111240.eBBCe2C13743@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 23468
>Category: kern
>Synopsis: xe Driver causes kernel panic when Xircom PS-CE2-10 inserted
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Dec 11 04:40:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Chris Knight
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
AIMS Independent Computer Professionals
>Environment:
System: FreeBSD ait0fd01.aims.private 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Mon Dec 11 10:06:34 EST 2000 root@ait0fd01.aims.private:/usr/obj/usr/src/sys/THINKPAD i386
>Description:
The xe driver causes a kernel panic in pccardd when a Xircom CreditCard Ethernet
Adapter IIps (PS-CE2-10) is inserted due to scp->cardtype being used in an
strcmp call before being assigned a value.
>How-To-Repeat:
Ensure that pccardd is running, using the default pccard.conf file
(pccardd -f /etc/defaults/pccardd.conf). Insert Xircom PS-CE2-10. A kernel
panic will occur in pccardd. A ddb session will show the trap at strcmp+0x1b.
>Fix:
The following unified diff fixed the kernel panic, and correctly retrieved the
MAC address of the card. Additional debug statments were added to assist in
tracking down the problem. Also included is the result of a pccardc dumpcis
on the Xircom PS-CE2-10 for reference if anyone is interested in providing
a better fix.
% pccardc dumpcis
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
% cat if_xe.c.diff
--- if_xe.c.orig Mon Oct 16 01:18:36 2000
+++ if_xe.c Mon Dec 11 07:24:23 2000
@@ -354,6 +354,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
@@ -392,6 +395,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:
@@ -402,9 +406,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++;
@@ -419,6 +433,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;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012111233.eBBCXbK00439>
