Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/e1000/if_em.c
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | static pci_vendor_info_t em_vendor_info_array[] = | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM6, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V6, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM7, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V7, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM8, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), | |||||
/* required last entry */ | /* required last entry */ | ||||
PVID_END | PVID_END | ||||
}; | }; | ||||
static pci_vendor_info_t igb_vendor_info_array[] = | static pci_vendor_info_t igb_vendor_info_array[] = | ||||
{ | { | ||||
/* Intel(R) PRO/1000 Network Connection - igb */ | /* Intel(R) PRO/1000 Network Connection - igb */ | ||||
PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), | PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), | ||||
▲ Show 20 Lines • Show All 680 Lines • ▼ Show 20 Lines | adapter->osdep.flash_bus_space_handle = | ||||
rman_get_bushandle(adapter->flash); | rman_get_bushandle(adapter->flash); | ||||
} | } | ||||
/* | /* | ||||
** In the new SPT device flash is not a | ** In the new SPT device flash is not a | ||||
** separate BAR, rather it is also in BAR0, | ** separate BAR, rather it is also in BAR0, | ||||
** so use the same tag and an offset handle for the | ** so use the same tag and an offset handle for the | ||||
** FLASH read/write macros in the shared code. | ** FLASH read/write macros in the shared code. | ||||
*/ | */ | ||||
else if (hw->mac.type == e1000_pch_spt) { | else if (hw->mac.type >= e1000_pch_spt) { | ||||
adapter->osdep.flash_bus_space_tag = | adapter->osdep.flash_bus_space_tag = | ||||
adapter->osdep.mem_bus_space_tag; | adapter->osdep.mem_bus_space_tag; | ||||
adapter->osdep.flash_bus_space_handle = | adapter->osdep.flash_bus_space_handle = | ||||
adapter->osdep.mem_bus_space_handle | adapter->osdep.mem_bus_space_handle | ||||
+ E1000_FLASH_BASE_ADDR; | + E1000_FLASH_BASE_ADDR; | ||||
} | } | ||||
/* Do Shared Code initialization */ | /* Do Shared Code initialization */ | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) | ||||
switch (adapter->hw.mac.type) { | switch (adapter->hw.mac.type) { | ||||
case e1000_82571: | case e1000_82571: | ||||
case e1000_82572: | case e1000_82572: | ||||
case e1000_ich9lan: | case e1000_ich9lan: | ||||
case e1000_ich10lan: | case e1000_ich10lan: | ||||
case e1000_pch2lan: | case e1000_pch2lan: | ||||
case e1000_pch_lpt: | case e1000_pch_lpt: | ||||
case e1000_pch_spt: | case e1000_pch_spt: | ||||
case e1000_pch_cnp: | |||||
case e1000_82574: | case e1000_82574: | ||||
case e1000_82583: | case e1000_82583: | ||||
case e1000_80003es2lan: | case e1000_80003es2lan: | ||||
/* 9K Jumbo Frame size */ | /* 9K Jumbo Frame size */ | ||||
max_frame_size = 9234; | max_frame_size = 9234; | ||||
break; | break; | ||||
case e1000_pchlan: | case e1000_pchlan: | ||||
max_frame_size = 4096; | max_frame_size = 4096; | ||||
▲ Show 20 Lines • Show All 1,268 Lines • ▼ Show 20 Lines | if (adapter->hw.mac.max_frame_size > 4096) | ||||
pba = E1000_PBA_14K; | pba = E1000_PBA_14K; | ||||
else | else | ||||
pba = E1000_PBA_10K; | pba = E1000_PBA_10K; | ||||
break; | break; | ||||
case e1000_pchlan: | case e1000_pchlan: | ||||
case e1000_pch2lan: | case e1000_pch2lan: | ||||
case e1000_pch_lpt: | case e1000_pch_lpt: | ||||
case e1000_pch_spt: | case e1000_pch_spt: | ||||
case e1000_pch_cnp: | |||||
pba = E1000_PBA_26K; | pba = E1000_PBA_26K; | ||||
break; | break; | ||||
case e1000_82575: | case e1000_82575: | ||||
pba = E1000_PBA_32K; | pba = E1000_PBA_32K; | ||||
break; | break; | ||||
case e1000_82576: | case e1000_82576: | ||||
case e1000_vfadapt: | case e1000_vfadapt: | ||||
pba = E1000_READ_REG(hw, E1000_RXPBS); | pba = E1000_READ_REG(hw, E1000_RXPBS); | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (if_getmtu(ifp) > ETHERMTU) { | ||||
hw->fc.high_water = 0x5000; | hw->fc.high_water = 0x5000; | ||||
hw->fc.low_water = 0x3000; | hw->fc.low_water = 0x3000; | ||||
} | } | ||||
hw->fc.refresh_time = 0x1000; | hw->fc.refresh_time = 0x1000; | ||||
break; | break; | ||||
case e1000_pch2lan: | case e1000_pch2lan: | ||||
case e1000_pch_lpt: | case e1000_pch_lpt: | ||||
case e1000_pch_spt: | case e1000_pch_spt: | ||||
case e1000_pch_cnp: | |||||
hw->fc.high_water = 0x5C20; | hw->fc.high_water = 0x5C20; | ||||
hw->fc.low_water = 0x5048; | hw->fc.low_water = 0x5048; | ||||
hw->fc.pause_time = 0x0650; | hw->fc.pause_time = 0x0650; | ||||
hw->fc.refresh_time = 0x0400; | hw->fc.refresh_time = 0x0400; | ||||
/* Jumbos need adjusted PBA */ | /* Jumbos need adjusted PBA */ | ||||
if (if_getmtu(ifp) > ETHERMTU) | if (if_getmtu(ifp) > ETHERMTU) | ||||
E1000_WRITE_REG(hw, E1000_PBA, 12); | E1000_WRITE_REG(hw, E1000_PBA, 12); | ||||
else | else | ||||
▲ Show 20 Lines • Show All 514 Lines • ▼ Show 20 Lines | tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | | ||||
(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); | ||||
if (adapter->hw.mac.type >= e1000_82571) | if (adapter->hw.mac.type >= e1000_82571) | ||||
tctl |= E1000_TCTL_MULR; | tctl |= E1000_TCTL_MULR; | ||||
/* This write will effectively turn on the transmit unit. */ | /* This write will effectively turn on the transmit unit. */ | ||||
E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); | E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); | ||||
/* SPT and KBL errata workarounds */ | |||||
if (hw->mac.type == e1000_pch_spt) { | if (hw->mac.type == e1000_pch_spt) { | ||||
u32 reg; | u32 reg; | ||||
reg = E1000_READ_REG(hw, E1000_IOSFPC); | reg = E1000_READ_REG(hw, E1000_IOSFPC); | ||||
reg |= E1000_RCTL_RDMTS_HEX; | reg |= E1000_RCTL_RDMTS_HEX; | ||||
E1000_WRITE_REG(hw, E1000_IOSFPC, reg); | E1000_WRITE_REG(hw, E1000_IOSFPC, reg); | ||||
/* i218-i219 Specification Update 1.5.4.4 */ | |||||
reg = E1000_READ_REG(hw, E1000_TARC(0)); | reg = E1000_READ_REG(hw, E1000_TARC(0)); | ||||
reg |= E1000_TARC0_CB_MULTIQ_3_REQ; | reg &= E1000_TARC0_CB_MULTIQ_3_REQ; | ||||
reg |= E1000_TARC0_CB_MULTIQ_2_REQ; | |||||
E1000_WRITE_REG(hw, E1000_TARC(0), reg); | E1000_WRITE_REG(hw, E1000_TARC(0), reg); | ||||
} | } | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* Enable receive unit. | * Enable receive unit. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,474 Lines • Show Last 20 Lines |