In if_em.c rev. 1.239 the hw.revision_id assignment was moved
to after call to em_set_mac_type(). However, em_set_mac_type()
depends on hw.revision_id being set (is used in a switch statement).
Possible fix below.

Holger
;-se

Index: if_em.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em.c,v
retrieving revision 1.243
diff -u -r1.243 if_em.c
--- if_em.c     4 Aug 2010 17:10:34 -0000       1.243
+++ if_em.c     7 Aug 2010 21:59:29 -0000
@@ -1539,16 +1539,15 @@
        sc->hw.subsystem_vendor_id = PCI_VENDOR(reg);
        sc->hw.subsystem_id = PCI_PRODUCT(reg);

+       reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_CLASS_REG);
+       sc->hw.revision_id = PCI_REVISION(reg);
+
        /* Identify the MAC */
        if (em_set_mac_type(&sc->hw))
                printf("%s: Unknown MAC Type\n", sc->sc_dv.dv_xname);

        if (sc->hw.mac_type == em_pchlan)
                sc->hw.revision_id = PCI_PRODUCT(pa->pa_id) & 0x0f;
-       else {
-               reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_CLASS_REG);
-               sc->hw.revision_id = PCI_REVISION(reg);
-       }

        if (sc->hw.mac_type == em_82541 ||
            sc->hw.mac_type == em_82541_rev_2 ||

Reply via email to