e1000_osdep.c revision 4914a7d0d1ee59f8cc21b19bfd7979cb65681eac
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater * This file is provided under a CDDLv1 license. When using or
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * redistributing this file, you may do so under this license.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * In redistributing this file this license must be included
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * and no other modification of this header file is permitted.
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley * CDDL LICENSE SUMMARY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Copyright(c) 1999 - 2007 Intel Corporation. All rights reserved.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * The contents of this file are subject to the terms of Version
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * 1.0 of the Common Development and Distribution License (the "License").
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * You should have received a copy of the License with this software.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * You can obtain a copy of the License at
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley * See the License for the specific language governing permissions
b239c8294a5653d21876d084e0c5b029f6b9fc5dMichael Graff * and limitations under the License.
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Use is subject to license terms of the CDDLv1.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein#pragma ident "%Z%%M% %I% %E% SMI"
92ef1a9b9dbd48ecb507b42ac62c15afefdaf838David Lawrencee1000_alloc_zeroed_dev_spec_struct(struct e1000_hw *hw, u32 size)
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley uint16_t val = hw->bus.pci_cmd_word | CMD_MEM_WRT_INVALIDATE;
4c9406964425ecc33fac38bb093e236b43b449e6Andreas Gustafsson e1000_write_pci_cfg(hw, PCI_COMMAND_REGISTER, &val);
34b26adb24ea63e325e3e75437988264ba060117Andreas Gustafsson uint16_t val = hw->bus.pci_cmd_word & ~CMD_MEM_WRT_INVALIDATE;
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein e1000_write_pci_cfg(hw, PCI_COMMAND_REGISTER, &val);
00c6365ade24779db7844792cea313e628012be4Bob Halleye1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
00c6365ade24779db7844792cea313e628012be4Bob Halley pci_config_put16(OS_DEP(hw)->cfg_handle, reg, *value);
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halleye1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
3740b569ae76295b941d57a724a43beb75b533baBob Halley * phy_spd_state - set smart-power-down (SPD) state
298523461941e171ce97ea8b76892ac01bb7a49fBob Halley * This only acts on the 82541/47 family and the 82571/72 family.
f47bb8d1f3a2e3edae11942d0d7e62e96caa5720Bob Halley * For any others, return without doing anything.
298523461941e171ce97ea8b76892ac01bb7a49fBob Halleyphy_spd_state(struct e1000_hw *hw, boolean_t enable)
3740b569ae76295b941d57a724a43beb75b533baBob Halley return; /* no action */
de9282a1eaa50764fdc2e88046f8ff3522e3092eBob Halley reg &= ~spd_bit; /* disable: clear the spd bit */
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley * The real intent of this routine is to return the value from pci-e
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley * config space at offset reg into the capability space.
f47bb8d1f3a2e3edae11942d0d7e62e96caa5720Bob Halley * ICH devices are "PCI Express"-ish. They have a configuration space,
3740b569ae76295b941d57a724a43beb75b533baBob Halley * but do not contain PCI Express Capability registers, so this returns
00c6365ade24779db7844792cea313e628012be4Bob Halley * the equivalent of "not supported"
298523461941e171ce97ea8b76892ac01bb7a49fBob Halleye1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
298523461941e171ce97ea8b76892ac01bb7a49fBob Halley *value = pci_config_get16(OS_DEP(hw)->cfg_handle,
91cd0f93ad34d23e8b09dca337120f64fbe8f0a1Andreas Gustafsson * Enables PCI-Express master access.
298523461941e171ce97ea8b76892ac01bb7a49fBob Halley * hw: Struct containing variables accessed by shared code
7bae6a079bb304bf69ffb83a5ac4cfaec9967ffcBob Halley * returns: - none.
298523461941e171ce97ea8b76892ac01bb7a49fBob Halley * e1000g_get_driver_control - tell manageability firmware that the driver
298523461941e171ce97ea8b76892ac01bb7a49fBob Halley * has control.
298523461941e171ce97ea8b76892ac01bb7a49fBob Halley /* tell manageability firmware the driver has taken over */