Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/e1000/if_em.c
Show First 20 Lines • Show All 1,055 Lines • ▼ Show 20 Lines | em_if_attach_pre(if_ctx_t ctx) | ||||
if (e1000_read_mac_addr(hw) < 0) { | if (e1000_read_mac_addr(hw) < 0) { | ||||
device_printf(dev, "EEPROM read error while reading MAC" | device_printf(dev, "EEPROM read error while reading MAC" | ||||
" address\n"); | " address\n"); | ||||
error = EIO; | error = EIO; | ||||
goto err_late; | goto err_late; | ||||
} | } | ||||
if (!em_is_valid_ether_addr(hw->mac.addr)) { | if (!em_is_valid_ether_addr(hw->mac.addr)) { | ||||
if (adapter->vf_ifp) { | |||||
u8 addr[ETHER_ADDR_LEN]; | |||||
arc4rand(&addr, sizeof(addr), 0); | |||||
addr[0] &= 0xFE; | |||||
addr[0] |= 0x02; | |||||
bcopy(addr, hw->mac.addr, sizeof(addr)); | |||||
} else { | |||||
device_printf(dev, "Invalid MAC address\n"); | device_printf(dev, "Invalid MAC address\n"); | ||||
error = EIO; | error = EIO; | ||||
goto err_late; | goto err_late; | ||||
} | } | ||||
markj: How does vf_ifp get set? | |||||
} | |||||
/* Disable ULP support */ | /* Disable ULP support */ | ||||
e1000_disable_ulp_lpt_lp(hw, TRUE); | e1000_disable_ulp_lpt_lp(hw, TRUE); | ||||
/* | /* | ||||
* Get Wake-on-Lan and Management info for later use | * Get Wake-on-Lan and Management info for later use | ||||
*/ | */ | ||||
em_get_wakeup(ctx); | em_get_wakeup(ctx); | ||||
▲ Show 20 Lines • Show All 842 Lines • ▼ Show 20 Lines | em_identify_hardware(if_ctx_t ctx) | ||||
adapter->hw.subsystem_device_id = | adapter->hw.subsystem_device_id = | ||||
pci_read_config(dev, PCIR_SUBDEV_0, 2); | pci_read_config(dev, PCIR_SUBDEV_0, 2); | ||||
/* Do Shared Code Init and Setup */ | /* Do Shared Code Init and Setup */ | ||||
if (e1000_set_mac_type(&adapter->hw)) { | if (e1000_set_mac_type(&adapter->hw)) { | ||||
device_printf(dev, "Setup init failure\n"); | device_printf(dev, "Setup init failure\n"); | ||||
return; | return; | ||||
} | } | ||||
/* Are we a VF device? */ | |||||
if ((adapter->hw.mac.type == e1000_vfadapt) || | |||||
(adapter->hw.mac.type == e1000_vfadapt_i350)) | |||||
adapter->vf_ifp = 1; | |||||
else | |||||
adapter->vf_ifp = 0; | |||||
} | } | ||||
static int | static int | ||||
em_allocate_pci_resources(if_ctx_t ctx) | em_allocate_pci_resources(if_ctx_t ctx) | ||||
{ | { | ||||
struct adapter *adapter = iflib_get_softc(ctx); | struct adapter *adapter = iflib_get_softc(ctx); | ||||
device_t dev = iflib_get_dev(ctx); | device_t dev = iflib_get_dev(ctx); | ||||
int rid, val; | int rid, val; | ||||
▲ Show 20 Lines • Show All 2,700 Lines • Show Last 20 Lines |
How does vf_ifp get set?