# $Id: openbsd-em_match_thinkpad_x200.diff,v 1.4 2008/12/16 22:34:31 jcs Exp $ # XXX: committed # # hack to make the em(4) driver attach to the Intel ICH9 IGP M AMT on # the lenovo thinkpad x200 # # sent to me by Chris Kuethe # Index: if_em.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_em.c,v retrieving revision 1.194 diff -u -p -r1.194 if_em.c --- if_em.c 28 Oct 2008 05:43:11 -0000 1.194 +++ if_em.c 2 Nov 2008 14:15:21 -0000 @@ -127,6 +127,7 @@ const struct pci_matchid em_devices[] = { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_ICH9_IFE_G }, { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_ICH9_IFE_GT }, { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_ICH9_IGP_AMT }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_ICH9_IGP_M_AMT }, { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_ICH9_IGP_C } }; Index: if_em_hw.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_em_hw.c,v retrieving revision 1.30 diff -u -p -r1.30 if_em_hw.c --- if_em_hw.c 24 Sep 2008 19:12:59 -0000 1.30 +++ if_em_hw.c 2 Nov 2008 14:15:37 -0000 @@ -460,6 +460,7 @@ em_set_mac_type(struct em_hw *hw) case E1000_DEV_ID_ICH9_IFE_GT: case E1000_DEV_ID_ICH9_IGP_AMT: case E1000_DEV_ID_ICH9_IGP_C: + case E1000_DEV_ID_ICH9_IGP_M_AMT: hw->mac_type = em_ich9lan; break; default: @@ -4046,6 +4047,14 @@ em_detect_gig_phy(struct em_hw *hw) hw->phy_id = IGP01E1000_I_PHY_ID; hw->phy_type = em_phy_igp_2; return E1000_SUCCESS; + } + + /* hack for the thinkpad x200 Intel ICH9 IGP M AMT, on which we can't grok + * the eeprom correctly */ + if (hw->mac_type == em_ich9lan) { + hw->phy_id = IGP03E1000_E_PHY_ID; + hw->phy_type = em_phy_igp_3; + return E1000_SUCCESS; } /* ESB-2 PHY reads require em_phy_gg82563 to be set because of a work-