Bug 31839

Summary: ex0 panic if NIC not cabled
Product: Base System Reporter: Jed Clear <clear>
Component: kernAssignee: Matthew N. Dodd <mdodd>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Jed Clear 2001-11-08 02:10:03 UTC
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.

Fix: 

Workaround:  plug the cable back in :}
How-To-Repeat: See how to stop it below, otherwise it repeats itself.
Comment 1 matt 2001-11-16 04:39:28 UTC
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));
Comment 2 ashp freebsd_committer freebsd_triage 2002-01-15 18:04:29 UTC
Responsible Changed
From-To: freebsd-bugs->mdodd

mdodd appears to be responsible for the if_ex.c driver.  Apologies if this is unwanted!
Comment 3 Matthew N. Dodd freebsd_committer freebsd_triage 2003-04-14 19:07:52 UTC
State Changed
From-To: open->closed

Fixed.