From nobody@FreeBSD.org  Wed Nov  7 18:03:39 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 0D5AA37B418
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Nov 2001 18:03:39 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id fA823cU42135;
	Wed, 7 Nov 2001 18:03:38 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200111080203.fA823cU42135@freefall.freebsd.org>
Date: Wed, 7 Nov 2001 18:03:38 -0800 (PST)
From: Jed Clear <clear@netaxs.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ex0 panic if NIC not cabled
X-Send-Pr-Version: www-1.0

>Number:         31839
>Category:       kern
>Synopsis:       ex0 panic if NIC not cabled
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    mdodd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 07 18:10:03 PST 2001
>Closed-Date:    Mon Apr 14 11:08:06 PDT 2003
>Last-Modified:  Mon Apr 14 11:08:06 PDT 2003
>Originator:     Jed Clear
>Release:        4.4
>Organization:
dis
>Environment:
FreeBSD fb486 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Sat Nov  3 19:53:17 EST 2001     root@fb486:/usr/src/sys/compile/JEDWALL  i386

JEDWALL is GENERIC with unneeded devices removed and IPFIREWALL options added.

>Description:
486 based firewall (ipfw/natd) with an Intel EtherExpress PRO/10+ card for the outside
NIC.  I was booting it with the cat5 cable disconnected and the kernel would
panic after ex0 detection.  

ifmedia_set: no match for 0x25/0xffffffff
panic: ifmedia_set

Inside card is an NE2000 clone (ed0) and was connected.
>How-To-Repeat:
See how to stop it below, otherwise it repeats itself.
>Fix:
Workaround:  plug the cable back in :}
>Release-Note:
>Audit-Trail:

From: "Matthew Emmerton" <matt@gsicomp.on.ca>
To: <freebsd-gnats-submit@FreeBSD.org>, <clear@netaxs.com>
Cc:  
Subject: Re: kern/31839: ex0 panic if NIC not cabled
Date: Thu, 15 Nov 2001 23:39:28 -0500

 Looks like the code that detects the media type doesn't allow for IFM_NONE.
 The below patch should fix the problem.
 
 --- sys/dev/ex/if_ex.c.orig     Thu Nov 15 23:13:41 2001
 +++ sys/dev/ex/if_ex.c  Thu Nov 15 23:26:28 2001
 @@ -252,6 +252,8 @@
                 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_2, 0, NULL);
         if (temp & EE_W5_PORT_AUI)
                 ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_5, 0, NULL);
 +       if (!(temp & (EE_W5_PORT_TPE | EE_W5_PORT_BNC | EE_W5_PORT_AUI)))
 +               ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_NONE, 0, NULL);
 
         ifmedia_set(&sc->ifmedia, ex_get_media(sc->iobase));
 
 
Responsible-Changed-From-To: freebsd-bugs->mdodd 
Responsible-Changed-By: ashp 
Responsible-Changed-When: Tue Jan 15 10:04:29 PST 2002 
Responsible-Changed-Why:  
mdodd appears to be responsible for the if_ex.c driver.  Apologies if this is unwanted! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31839 
State-Changed-From-To: open->closed 
State-Changed-By: mdodd 
State-Changed-When: Mon Apr 14 11:07:52 PDT 2003 
State-Changed-Why:  
Fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31839 
>Unformatted:
