Date: Wed, 2 Sep 1998 15:30:43 -0400 (EDT) From: Bill Paul <wpaul@skynet.ctr.columbia.edu> To: vance@usq.edu.au (Christopher JS Vance) Cc: stable@FreeBSD.ORG Subject: Re: Looking for feedback on xl (3c905/3c905B) driver Message-ID: <199809021930.PAA08981@skynet.ctr.columbia.edu> In-Reply-To: <19980902042906.506.qmail@usq.edu.au> from "Christopher JS Vance" at Sep 2, 98 02:29:06 pm
next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the towns in all the world, Christopher JS
Vance had to walk into mine and say:
> Bill Paul wrote:
> | Okay people, it's been some time since I put the xl0 driver in
> | -current
> | and -stable. I need to know if people are having problems with the
> | driver
> | or not. So far I've gotten startlingly little feedback. This either
> | means
> | that it's working so well that nobody has had any trouble with it, or
> | you guys are all just slackers and are too lazy to speak up.
>
> I get a kernel panic. I didn't actually try the new kernel till
> several days after the discussion started...
*sigh*
> | - What kind of adapter you have. Note that a 3c905-TX is NOT THE SAME
> | as a 3c905B-TX. (See the 'B'? It makes a difference.) Double and
> | triple
> | check the model. Don't tell me you have a 3c905B when you actually
> | only
> | have a 3c905. If you want to be really nice, do 'dmesg | grep xl'
> | and
> | show me the output.
>
> My handwritten copy of what the 2.2.7-STABLE kernel (with -dv) gives
> on reboot just before the panic is:
>
> xl0 <3Com 3c900 Etherlink XL 10BaseT Combo> rev 0 int a irq 11 on
> pci0:9:0
> mapreg[10] type=1 addr=0000e000 size=0040.
> xl0: Ethernet address: 00:60:97:a4:18:de
> xl0: media options word: e138
> xl0: found 10BaseT
> xl0: found AUI
> xl0: found BNC
> xl0: unknown XCVR type: 14
> ifmedia_set: no match for 0x100026/0xffffffff
> panic: ifmedia_set
This is not normal: 14 is not a proper transceiver selection value
as far as I can tell. Why your EEPROM has this value programmed into
it I can't say, but it's not right. Grr. Looks like another oddball
condition I have to test for. Does it always report the same value
(14) or does it change from one reboot to the next?
I'd like you try a small patch for me. This will modify the xl_mediacheck()
routine to also test the XCVR value for sanity and choose a proper default
based on the card type.
This should at least get the system booted without a panic. I think
in your case it will default to 10baseT as the media; you'll need to
use ifconfig xl0 media <foo> to change it, where <foo> is one of
10baseT/UTP, 10base5/AUI or 10base2/BNC (assuming you have a COMBO
card, otherwise 10baseT will be right). Please let me know if this
works.
To apply this patch:
- Save this e-mail message to /tmp/xl.diff
- cd /sys/pci
- patch < /tmp/xl.diff
- make a new kernel and boot it
-Bill
--
=============================================================================
-Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu
Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
"It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness"
=============================================================================
*** if_xl.c 1998/08/31 15:13:27 1.37
--- if_xl.c 1998/09/02 19:13:53
***************
*** 1152,1164 ****
*/
if (sc->xl_media & (XL_MEDIAOPT_MASK & ~XL_MEDIAOPT_VCO))
return;
! printf("xl%d: WARNING: no media options bits set in "
! "the media options register!!\n", sc->xl_unit);
! printf("xl%d: this could be a manufacturing defect in "
! "your adapter or system\n", sc->xl_unit);
! printf("xl%d: attempting to guess media type; you "
! "should probably consult your vendor\n", sc->xl_unit);
/*
* Read the device ID from the EEPROM.
--- 1152,1178 ----
*/
if (sc->xl_media & (XL_MEDIAOPT_MASK & ~XL_MEDIAOPT_VCO))
return;
+ else {
+ printf("xl%d: WARNING: no media options bits set in "
+ "the media options register!!\n", sc->xl_unit);
+ printf("xl%d: this could be a manufacturing defect in "
+ "your adapter or system\n", sc->xl_unit);
+ printf("xl%d: attempting to guess media type; you "
+ "should probably consult your vendor\n", sc->xl_unit);
+ }
! /*
! * Check the XCVR value. If it's not in the normal range
! * of values, we need to fake it up here.
! */
! if (sc->xl_xcvr <= XL_XCVR_AUTO)
! return;
! else {
! printf("xl%d: warning: bogus xcvr value in EEPROM (%x)\n",
! sc->xl_unit, sc->xl_xcvr);
! printf("xl%d: choosing new default based on card type\n",
! sc->xl_unit);
! }
/*
* Read the device ID from the EEPROM.
***************
*** 1171,1194 ****
--- 1185,1213 ----
case TC_DEVICEID_BOOMERANG_10BT: /* 3c900-TP */
case TC_DEVICEID_CYCLONE_10BT: /* 3c905B-TP */
sc->xl_media = XL_MEDIAOPT_BT;
+ sc->xl_xcvr = XL_XCVR_10BT;
printf("xl%d: guessing 10BaseT transceiver\n", sc->xl_unit);
break;
case TC_DEVICEID_BOOMERANG_10BT_COMBO: /* 3c900-COMBO */
case TC_DEVICEID_CYCLONE_10BT_COMBO: /* 3c905B-COMBO */
sc->xl_media = XL_MEDIAOPT_BT|XL_MEDIAOPT_BNC|XL_MEDIAOPT_AUI;
+ sc->xl_xcvr = XL_XCVR_10BT;
printf("xl%d: guessing COMBO (AUI/BNC/TP)\n", sc->xl_unit);
break;
case TC_DEVICEID_BOOMERANG_10_100BT: /* 3c905-TX */
sc->xl_media = XL_MEDIAOPT_MII;
+ sc->xl_xcvr = XL_XCVR_MII;
printf("xl%d: guessing MII\n", sc->xl_unit);
break;
case TC_DEVICEID_BOOMERANG_100BT4: /* 3c905-T4 */
case TC_DEVICEID_CYCLONE_10_100BT4: /* 3c905B-T4 */
sc->xl_media = XL_MEDIAOPT_BT4;
+ sc->xl_xcvr = XL_XCVR_MII;
printf("xl%d: guessing 100BaseT4/MII\n", sc->xl_unit);
break;
case TC_DEVICEID_CYCLONE_10_100BT: /* 3c905B-TX */
sc->xl_media = XL_MEDIAOPT_BTX;
+ sc->xl_xcvr = XL_XCVR_AUTO;
printf("xl%d: guessing 10/100 internal\n", sc->xl_unit);
break;
default:
***************
*** 1388,1398 ****
printf("xl%d: media options word: %x\n", sc->xl_unit,
sc->xl_media);
- xl_mediacheck(sc);
-
xl_read_eeprom(sc, (char *)&sc->xl_xcvr, XL_EE_ICFG_0, 2, 0);
sc->xl_xcvr &= XL_ICFG_CONNECTOR_MASK;
sc->xl_xcvr >>= XL_ICFG_CONNECTOR_BITS;
if (sc->xl_media & XL_MEDIAOPT_MII || sc->xl_media & XL_MEDIAOPT_BTX
|| sc->xl_media & XL_MEDIAOPT_BT4) {
/*
--- 1407,1418 ----
printf("xl%d: media options word: %x\n", sc->xl_unit,
sc->xl_media);
xl_read_eeprom(sc, (char *)&sc->xl_xcvr, XL_EE_ICFG_0, 2, 0);
sc->xl_xcvr &= XL_ICFG_CONNECTOR_MASK;
sc->xl_xcvr >>= XL_ICFG_CONNECTOR_BITS;
+
+ xl_mediacheck(sc);
+
if (sc->xl_media & XL_MEDIAOPT_MII || sc->xl_media & XL_MEDIAOPT_BTX
|| sc->xl_media & XL_MEDIAOPT_BT4) {
/*
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?199809021930.PAA08981>
