From: kettenis Date: Tue, 15 Jul 2008 17:50:20 +0000 (+0000) Subject: Backout rev 1.162. This change made us muck with with pci config space at X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=00e40214bd16deef7d2237767afb63fd221a749b;p=openbsd Backout rev 1.162. This change made us muck with with pci config space at address 0x1a and 0x1e, and that's not where the PCIe capability stuff lives. Potentially it was mucking with an IO BAR (super dangerous). But probably it was achieving nothing at all. ok dlg@, marco@, brad@ --- diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 1568a17b56a..459b507614a 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.185 2008/06/15 16:37:00 millert Exp $ */ +/* $OpenBSD: if_em.c,v 1.186 2008/07/15 17:50:20 kettenis Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include @@ -2869,26 +2869,14 @@ em_pci_clear_mwi(struct em_hw *hw) (hw->pci_cmd_word & ~CMD_MEM_WRT_INVALIDATE)); } +/* + * We may eventually really do this, but its unnecessary + * for now so we just return unsupported. + */ int32_t em_read_pcie_cap_reg(struct em_hw *hw, uint32_t reg, uint16_t *value) { - struct pci_attach_args *pa = &((struct em_osdep *)hw->back)->em_pa; - int32_t rc; - u_int16_t pectl; - - /* find the PCIe link width and set max read request to 4KB */ - if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_PCIEXPRESS, - NULL, NULL) != 0) { - em_read_pci_cfg(hw, reg + 0x12, value); - - em_read_pci_cfg(hw, reg + 0x8, &pectl); - pectl = (pectl & ~0x7000) | (5 << 12); - em_write_pci_cfg(hw, reg + 0x8, &pectl); - rc = 0; - } else - rc = -1; - - return (rc); + return -E1000_NOT_IMPLEMENTED; } /********************************************************************* diff --git a/sys/dev/pci/if_em_hw.h b/sys/dev/pci/if_em_hw.h index db7ffd037fb..aa5667f77b4 100644 --- a/sys/dev/pci/if_em_hw.h +++ b/sys/dev/pci/if_em_hw.h @@ -31,7 +31,7 @@ *******************************************************************************/ -/* $OpenBSD: if_em_hw.h,v 1.25 2008/03/21 00:20:55 brad Exp $ */ +/* $OpenBSD: if_em_hw.h,v 1.26 2008/07/15 17:50:20 kettenis Exp $ */ /* $FreeBSD: if_em_hw.h,v 1.15 2005/05/26 23:32:02 tackerman Exp $ */ /* if_em_hw.h @@ -299,6 +299,7 @@ typedef enum { #define E1000_ERR_HOST_INTERFACE_COMMAND 11 #define E1000_BLK_PHY_RESET 12 #define E1000_ERR_SWFW_SYNC 13 +#define E1000_NOT_IMPLEMENTED 14 #define E1000_BYTE_SWAP_WORD(_value) ((((_value) & 0x00ff) << 8) | \ (((_value) & 0xff00) >> 8))