/* Prevent the PCI-E bus from sticking if there is no TLP connection *onthelastTLPread/writetransactionwhenMACisreset.
*/
ret_val = igc_disable_pcie_master(hw); if (ret_val)
hw_dbg("PCI-E Master disable polling has failed\n");
hw_dbg("Masking off all interrupts\n");
wr32(IGC_IMC, 0xffffffff);
hw_dbg("Issuing a global reset to MAC\n");
wr32(IGC_CTRL, ctrl | IGC_CTRL_RST);
ret_val = igc_get_auto_rd_done(hw); if (ret_val) { /* When auto config read does not complete, do not *returnwithanerror.Thiscanhappeninsituations *wherethereisnoeepromandpreventsgettinglink.
*/
hw_dbg("Auto Read Done did not complete\n");
}
/* Clear any pending interrupt events. */
wr32(IGC_IMC, 0xffffffff);
rd32(IGC_ICR);
/* set lan id */
hw->bus.func = FIELD_GET(IGC_STATUS_FUNC_MASK, rd32(IGC_STATUS));
/* Make sure the PHY is in a good state. Several people have reported *firmwareleavingthePHY'spageselectregistersettosomething *otherthanthedefaultofzero,whichcausesthePHYIDreadto *accesssomethingotherthantheintendedregister.
*/
ret_val = hw->phy.ops.reset(hw); if (ret_val) {
hw_dbg("Error resetting the PHY\n"); goto out;
}
ret_val = igc_get_phy_id(hw); if (ret_val) return ret_val;
switch (hw->device_id) { case IGC_DEV_ID_I225_LM: case IGC_DEV_ID_I225_V: case IGC_DEV_ID_I225_I: case IGC_DEV_ID_I220_V: case IGC_DEV_ID_I225_K: case IGC_DEV_ID_I225_K2: case IGC_DEV_ID_I226_K: case IGC_DEV_ID_I225_LMVP: case IGC_DEV_ID_I226_LMVP: case IGC_DEV_ID_I225_IT: case IGC_DEV_ID_I226_LM: case IGC_DEV_ID_I226_V: case IGC_DEV_ID_I226_IT: case IGC_DEV_ID_I221_V: case IGC_DEV_ID_I226_BLANK_NVM: case IGC_DEV_ID_I225_BLANK_NVM:
mac->type = igc_i225; break; default: return -IGC_ERR_MAC_INIT;
}
hw->phy.media_type = igc_media_type_copper;
/* mac initialization and operations */
ret_val = igc_init_mac_params_base(hw); if (ret_val) goto out;
/* Setup the receive address */
igc_init_rx_addrs(hw, rar_count);
/* Zero out the Multicast HASH table */
hw_dbg("Zeroing the MTA\n"); for (i = 0; i < mac->mta_reg_count; i++)
array_wr32(IGC_MTA, i, 0);
/* Zero out the Unicast HASH table */
hw_dbg("Zeroing the UTA\n"); for (i = 0; i < mac->uta_reg_count; i++)
array_wr32(IGC_UTA, i, 0);
/* Setup link and flow control */
ret_val = igc_setup_link(hw);
/* Clear all of the statistics registers (clear on read). It is *importantthatwedothisafterwehavetriedtoestablishlink *becausethesymbolerrorcountwillincrementwildlyifthere *isnolink.
*/
igc_clear_hw_cntrs_base(hw);
return ret_val;
}
/** *igc_power_down_phy_copper_base-RemovelinkduringPHYpowerdown *@hw:pointertotheHWstructure * *InthecaseofaPHYpowerdowntosavepower,ortoturnofflinkduringa *driverunload,orwakeonlanisnotenabled,removethelink.
*/ void igc_power_down_phy_copper_base(struct igc_hw *hw)
{ /* If the management interface is not enabled, then power down */ if (!(igc_enable_mng_pass_thru(hw) || igc_check_reset_block(hw)))
igc_power_down_phy_copper(hw);
}
/* disable IPv6 options as per hardware errata */
rfctl = rd32(IGC_RFCTL);
rfctl |= IGC_RFCTL_IPV6_EX_DIS;
wr32(IGC_RFCTL, rfctl);
if (!(rd32(IGC_MANC) & IGC_MANC_RCV_TCO_EN)) return;
/* Disable all Rx queues */ for (i = 0; i < 4; i++) {
rxdctl[i] = rd32(IGC_RXDCTL(i));
wr32(IGC_RXDCTL(i),
rxdctl[i] & ~IGC_RXDCTL_QUEUE_ENABLE);
} /* Poll all queues to verify they have shut down */ for (ms_wait = 0; ms_wait < 10; ms_wait++) {
usleep_range(1000, 2000);
rx_enabled = 0; for (i = 0; i < 4; i++)
rx_enabled |= rd32(IGC_RXDCTL(i)); if (!(rx_enabled & IGC_RXDCTL_QUEUE_ENABLE)) break;
}
if (ms_wait == 10)
hw_dbg("Queue disable timed out after 10ms\n");
/* Clear RLPML, RCTL.SBP, RFCTL.LEF, and set RCTL.LPE so that all *incomingpacketsarerejected.Setenableandwait2mssothat *anypacketthatwascominginasRCTL.ENwassetisflushed
*/
wr32(IGC_RFCTL, rfctl & ~IGC_RFCTL_LEF);
/* Enable Rx queues that were previously enabled and restore our *previousstate
*/ for (i = 0; i < 4; i++)
wr32(IGC_RXDCTL(i), rxdctl[i]);
wr32(IGC_RCTL, rctl);
wrfl();
bool igc_is_device_id_i225(struct igc_hw *hw)
{ switch (hw->device_id) { case IGC_DEV_ID_I225_LM: case IGC_DEV_ID_I225_V: case IGC_DEV_ID_I225_I: case IGC_DEV_ID_I225_K: case IGC_DEV_ID_I225_K2: case IGC_DEV_ID_I225_LMVP: case IGC_DEV_ID_I225_IT: returntrue; default: returnfalse;
}
}
bool igc_is_device_id_i226(struct igc_hw *hw)
{ switch (hw->device_id) { case IGC_DEV_ID_I226_LM: case IGC_DEV_ID_I226_V: case IGC_DEV_ID_I226_K: case IGC_DEV_ID_I226_IT: returntrue; default: returnfalse;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.