Lines 269-274
Link Here
|
269 |
static void em_release_hw_control(struct adapter *); |
269 |
static void em_release_hw_control(struct adapter *); |
270 |
static void em_get_wakeup(if_ctx_t ctx); |
270 |
static void em_get_wakeup(if_ctx_t ctx); |
271 |
static void em_enable_wakeup(if_ctx_t ctx); |
271 |
static void em_enable_wakeup(if_ctx_t ctx); |
|
|
272 |
static void igb_enable_wakeup(if_ctx_t ctx); |
272 |
static int em_enable_phy_wakeup(struct adapter *); |
273 |
static int em_enable_phy_wakeup(struct adapter *); |
273 |
static void em_disable_aspm(struct adapter *); |
274 |
static void em_disable_aspm(struct adapter *); |
274 |
|
275 |
|
Lines 1089-1095
Link Here
|
1089 |
|
1090 |
|
1090 |
em_release_manageability(adapter); |
1091 |
em_release_manageability(adapter); |
1091 |
em_release_hw_control(adapter); |
1092 |
em_release_hw_control(adapter); |
1092 |
em_enable_wakeup(ctx); |
1093 |
if (adapter->hw.mac.type >= igb_mac_min) |
|
|
1094 |
igb_enable_wakeup(ctx); |
1095 |
else |
1096 |
em_enable_wakeup(ctx); |
1093 |
return (0); |
1097 |
return (0); |
1094 |
} |
1098 |
} |
1095 |
|
1099 |
|
Lines 1733-1739
Link Here
|
1733 |
INIT_DEBUGOUT("em_stop: begin"); |
1737 |
INIT_DEBUGOUT("em_stop: begin"); |
1734 |
|
1738 |
|
1735 |
e1000_reset_hw(&adapter->hw); |
1739 |
e1000_reset_hw(&adapter->hw); |
1736 |
if (adapter->hw.mac.type >= e1000_82544) |
1740 |
if (adapter->hw.mac.type >= igb_mac_min) |
|
|
1741 |
E1000_WRITE_REG(&adapter->hw, E1000_WUFC, 0); |
1742 |
else if (adapter->hw.mac.type >= e1000_82544) |
1737 |
E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0); |
1743 |
E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0); |
1738 |
|
1744 |
|
1739 |
e1000_led_off(&adapter->hw); |
1745 |
e1000_led_off(&adapter->hw); |
Lines 2309-2315
Link Here
|
2309 |
|
2315 |
|
2310 |
/* Issue a global reset */ |
2316 |
/* Issue a global reset */ |
2311 |
e1000_reset_hw(hw); |
2317 |
e1000_reset_hw(hw); |
2312 |
E1000_WRITE_REG(hw, E1000_WUC, 0); |
2318 |
if (adapter->hw.mac.type >= igb_mac_min) |
|
|
2319 |
E1000_WRITE_REG(&adapter->hw, E1000_WUFC, 0); |
2320 |
else |
2321 |
E1000_WRITE_REG(hw, E1000_WUC, 0); |
2322 |
|
2313 |
em_disable_aspm(adapter); |
2323 |
em_disable_aspm(adapter); |
2314 |
/* and a re-init */ |
2324 |
/* and a re-init */ |
2315 |
if (e1000_init_hw(hw) < 0) { |
2325 |
if (e1000_init_hw(hw) < 0) { |
Lines 3314-3319
Link Here
|
3314 |
adapter->has_amt = TRUE; |
3324 |
adapter->has_amt = TRUE; |
3315 |
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); |
3325 |
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); |
3316 |
break; |
3326 |
break; |
|
|
3327 |
/* igb devices */ |
3328 |
case e1000_82575: |
3329 |
case e1000_82576: |
3330 |
case e1000_82580: |
3331 |
case e1000_i350: |
3332 |
case e1000_i354: |
3333 |
case e1000_i210: |
3334 |
case e1000_i211: |
3335 |
apme_mask = E1000_WUC_APME; |
3336 |
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); |
3337 |
break; |
3317 |
default: |
3338 |
default: |
3318 |
e1000_read_nvm(&adapter->hw, |
3339 |
e1000_read_nvm(&adapter->hw, |
3319 |
NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data); |
3340 |
NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data); |
Lines 3421-3427
Link Here
|
3421 |
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl); |
3442 |
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl); |
3422 |
} |
3443 |
} |
3423 |
|
3444 |
|
3424 |
if ((adapter->hw.mac.type == e1000_pchlan) || |
3445 |
if ((adapter->hw.mac.type == e1000_pchlan) || |
3425 |
(adapter->hw.mac.type == e1000_pch2lan) || |
3446 |
(adapter->hw.mac.type == e1000_pch2lan) || |
3426 |
(adapter->hw.mac.type == e1000_pch_lpt) || |
3447 |
(adapter->hw.mac.type == e1000_pch_lpt) || |
3427 |
(adapter->hw.mac.type == e1000_pch_spt)) { |
3448 |
(adapter->hw.mac.type == e1000_pch_spt)) { |
Lines 3446-3451
Link Here
|
3446 |
} |
3467 |
} |
3447 |
|
3468 |
|
3448 |
/* |
3469 |
/* |
|
|
3470 |
* Enable PCI Wake On Lan capability |
3471 |
*/ |
3472 |
static void |
3473 |
igb_enable_wakeup(if_ctx_t ctx) |
3474 |
{ |
3475 |
struct adapter *adapter = iflib_get_softc(ctx); |
3476 |
device_t dev = iflib_get_dev(ctx); |
3477 |
struct ifnet *ifp = adapter->ifp; |
3478 |
u32 wuc; |
3479 |
u16 cap, status; |
3480 |
u8 id; |
3481 |
|
3482 |
adapter->wol = E1000_READ_REG(&adapter->hw, E1000_WUFC); |
3483 |
if (ifp->if_capenable & IFCAP_WOL_MAGIC) { |
3484 |
adapter->wol |= E1000_WUFC_MAG; |
3485 |
} else { |
3486 |
adapter->wol &= ~E1000_WUFC_MAG; |
3487 |
} |
3488 |
if (ifp->if_capenable & IFCAP_WOL_MCAST) { |
3489 |
adapter->wol |= E1000_WUFC_MC; |
3490 |
} else { |
3491 |
adapter->wol &= ~E1000_WUFC_MC; |
3492 |
} |
3493 |
if (ifp->if_capenable & IFCAP_WOL_UCAST) { |
3494 |
adapter->wol |= E1000_WUFC_EX; |
3495 |
} else { |
3496 |
adapter->wol &= ~E1000_WUFC_EX; |
3497 |
} |
3498 |
if(adapter->wol & ( E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_MAG) ) { |
3499 |
wuc = E1000_READ_REG(&adapter->hw, E1000_WUC); |
3500 |
wuc |= (E1000_WUC_PME_EN | E1000_WUC_APME) ; |
3501 |
E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc); |
3502 |
E1000_WRITE_REG(&adapter->hw, E1000_WUFC, adapter->wol); |
3503 |
/* First find the capabilities pointer*/ |
3504 |
cap = pci_read_config(dev, PCIR_CAP_PTR, 2); |
3505 |
/* Read the PM Capabilities */ |
3506 |
id = pci_read_config(dev, cap, 1); |
3507 |
if (id != PCIY_PMG) /* Something wrong */ |
3508 |
return; |
3509 |
/* |
3510 |
* We have the power capabilities, |
3511 |
* get the status register |
3512 |
*/ |
3513 |
cap += PCIR_POWER_STATUS; |
3514 |
status = pci_read_config(dev, cap, 2); |
3515 |
status |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; |
3516 |
pci_write_config(dev, cap, status, 2); |
3517 |
} |
3518 |
return; |
3519 |
} |
3520 |
|
3521 |
/* |
3449 |
** WOL in the newer chipset interfaces (pchlan) |
3522 |
** WOL in the newer chipset interfaces (pchlan) |
3450 |
** require thing to be copied into the phy |
3523 |
** require thing to be copied into the phy |
3451 |
*/ |
3524 |
*/ |