aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2006-06-27 12:08:22 -0400
committerAuke Kok <juke-jan.h.kok@intel.com>2006-06-27 12:08:22 -0400
commitcd94dd0b648ceb64ca5e41d9ccfa99c1e30e92ef (patch)
tree48144ae7c119c5cc7e61d42c670609540c3c7e9d /drivers/net/e1000/e1000_main.c
parentd37ea5d56293b7a883d2a993df5d8b9fb660ed3b (diff)
e1000: integrate ich8 support into driver
This hooks up the ich8 structure into the driver itself. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c120
1 files changed, 104 insertions, 16 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index cc0c77c4c170..f5c6f08966c7 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -366,6 +366,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
366{ 366{
367 uint32_t ctrl_ext; 367 uint32_t ctrl_ext;
368 uint32_t swsm; 368 uint32_t swsm;
369 uint32_t extcnf;
369 370
370 /* Let firmware taken over control of h/w */ 371 /* Let firmware taken over control of h/w */
371 switch (adapter->hw.mac_type) { 372 switch (adapter->hw.mac_type) {
@@ -380,6 +381,11 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
380 swsm = E1000_READ_REG(&adapter->hw, SWSM); 381 swsm = E1000_READ_REG(&adapter->hw, SWSM);
381 E1000_WRITE_REG(&adapter->hw, SWSM, 382 E1000_WRITE_REG(&adapter->hw, SWSM,
382 swsm & ~E1000_SWSM_DRV_LOAD); 383 swsm & ~E1000_SWSM_DRV_LOAD);
384 case e1000_ich8lan:
385 extcnf = E1000_READ_REG(&adapter->hw, CTRL_EXT);
386 E1000_WRITE_REG(&adapter->hw, CTRL_EXT,
387 extcnf & ~E1000_CTRL_EXT_DRV_LOAD);
388 break;
383 default: 389 default:
384 break; 390 break;
385 } 391 }
@@ -401,6 +407,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
401{ 407{
402 uint32_t ctrl_ext; 408 uint32_t ctrl_ext;
403 uint32_t swsm; 409 uint32_t swsm;
410 uint32_t extcnf;
404 /* Let firmware know the driver has taken over */ 411 /* Let firmware know the driver has taken over */
405 switch (adapter->hw.mac_type) { 412 switch (adapter->hw.mac_type) {
406 case e1000_82571: 413 case e1000_82571:
@@ -415,6 +422,11 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
415 E1000_WRITE_REG(&adapter->hw, SWSM, 422 E1000_WRITE_REG(&adapter->hw, SWSM,
416 swsm | E1000_SWSM_DRV_LOAD); 423 swsm | E1000_SWSM_DRV_LOAD);
417 break; 424 break;
425 case e1000_ich8lan:
426 extcnf = E1000_READ_REG(&adapter->hw, EXTCNF_CTRL);
427 E1000_WRITE_REG(&adapter->hw, EXTCNF_CTRL,
428 extcnf | E1000_EXTCNF_CTRL_SWFLAG);
429 break;
418 default: 430 default:
419 break; 431 break;
420 } 432 }
@@ -490,6 +502,7 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)
490 * (b) AMT is active 502 * (b) AMT is active
491 * (c) SoL/IDER session is active */ 503 * (c) SoL/IDER session is active */
492 if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 && 504 if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 &&
505 adapter->hw.mac_type != e1000_ich8lan &&
493 adapter->hw.media_type == e1000_media_type_copper && 506 adapter->hw.media_type == e1000_media_type_copper &&
494 !(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) && 507 !(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) &&
495 !mng_mode_enabled && 508 !mng_mode_enabled &&
@@ -561,6 +574,9 @@ e1000_reset(struct e1000_adapter *adapter)
561 case e1000_82573: 574 case e1000_82573:
562 pba = E1000_PBA_12K; 575 pba = E1000_PBA_12K;
563 break; 576 break;
577 case e1000_ich8lan:
578 pba = E1000_PBA_8K;
579 break;
564 default: 580 default:
565 pba = E1000_PBA_48K; 581 pba = E1000_PBA_48K;
566 break; 582 break;
@@ -585,6 +601,12 @@ e1000_reset(struct e1000_adapter *adapter)
585 /* Set the FC high water mark to 90% of the FIFO size. 601 /* Set the FC high water mark to 90% of the FIFO size.
586 * Required to clear last 3 LSB */ 602 * Required to clear last 3 LSB */
587 fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8; 603 fc_high_water_mark = ((pba * 9216)/10) & 0xFFF8;
604 /* We can't use 90% on small FIFOs because the remainder
605 * would be less than 1 full frame. In this case, we size
606 * it to allow at least a full frame above the high water
607 * mark. */
608 if (pba < E1000_PBA_16K)
609 fc_high_water_mark = (pba * 1024) - 1600;
588 610
589 adapter->hw.fc_high_water = fc_high_water_mark; 611 adapter->hw.fc_high_water = fc_high_water_mark;
590 adapter->hw.fc_low_water = fc_high_water_mark - 8; 612 adapter->hw.fc_low_water = fc_high_water_mark - 8;
@@ -622,6 +644,8 @@ e1000_reset(struct e1000_adapter *adapter)
622 phy_data); 644 phy_data);
623 } 645 }
624 646
647 if (adapter->hw.mac_type < e1000_ich8lan)
648 /* FIXME: this code is duplicate and wrong for PCI Express */
625 if (adapter->en_mng_pt) { 649 if (adapter->en_mng_pt) {
626 manc = E1000_READ_REG(&adapter->hw, MANC); 650 manc = E1000_READ_REG(&adapter->hw, MANC);
627 manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST); 651 manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
@@ -648,6 +672,7 @@ e1000_probe(struct pci_dev *pdev,
648 struct net_device *netdev; 672 struct net_device *netdev;
649 struct e1000_adapter *adapter; 673 struct e1000_adapter *adapter;
650 unsigned long mmio_start, mmio_len; 674 unsigned long mmio_start, mmio_len;
675 unsigned long flash_start, flash_len;
651 676
652 static int cards_found = 0; 677 static int cards_found = 0;
653 static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */ 678 static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */
@@ -657,10 +682,12 @@ e1000_probe(struct pci_dev *pdev,
657 if ((err = pci_enable_device(pdev))) 682 if ((err = pci_enable_device(pdev)))
658 return err; 683 return err;
659 684
660 if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { 685 if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
686 !(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
661 pci_using_dac = 1; 687 pci_using_dac = 1;
662 } else { 688 } else {
663 if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { 689 if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) &&
690 (err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) {
664 E1000_ERR("No usable DMA configuration, aborting\n"); 691 E1000_ERR("No usable DMA configuration, aborting\n");
665 return err; 692 return err;
666 } 693 }
@@ -740,6 +767,19 @@ e1000_probe(struct pci_dev *pdev,
740 if ((err = e1000_sw_init(adapter))) 767 if ((err = e1000_sw_init(adapter)))
741 goto err_sw_init; 768 goto err_sw_init;
742 769
770 /* Flash BAR mapping must happen after e1000_sw_init
771 * because it depends on mac_type */
772 if ((adapter->hw.mac_type == e1000_ich8lan) &&
773 (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
774 flash_start = pci_resource_start(pdev, 1);
775 flash_len = pci_resource_len(pdev, 1);
776 adapter->hw.flash_address = ioremap(flash_start, flash_len);
777 if (!adapter->hw.flash_address) {
778 err = -EIO;
779 goto err_flashmap;
780 }
781 }
782
743 if ((err = e1000_check_phy_reset_block(&adapter->hw))) 783 if ((err = e1000_check_phy_reset_block(&adapter->hw)))
744 DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n"); 784 DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n");
745 785
@@ -758,6 +798,8 @@ e1000_probe(struct pci_dev *pdev,
758 NETIF_F_HW_VLAN_TX | 798 NETIF_F_HW_VLAN_TX |
759 NETIF_F_HW_VLAN_RX | 799 NETIF_F_HW_VLAN_RX |
760 NETIF_F_HW_VLAN_FILTER; 800 NETIF_F_HW_VLAN_FILTER;
801 if (adapter->hw.mac_type == e1000_ich8lan)
802 netdev->features &= ~NETIF_F_HW_VLAN_FILTER;
761 } 803 }
762 804
763#ifdef NETIF_F_TSO 805#ifdef NETIF_F_TSO
@@ -773,11 +815,17 @@ e1000_probe(struct pci_dev *pdev,
773 if (pci_using_dac) 815 if (pci_using_dac)
774 netdev->features |= NETIF_F_HIGHDMA; 816 netdev->features |= NETIF_F_HIGHDMA;
775 817
776 /* hard_start_xmit is safe against parallel locking */
777 netdev->features |= NETIF_F_LLTX; 818 netdev->features |= NETIF_F_LLTX;
778 819
779 adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw); 820 adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
780 821
822 /* initialize eeprom parameters */
823
824 if (e1000_init_eeprom_params(&adapter->hw)) {
825 E1000_ERR("EEPROM initialization failed\n");
826 return -EIO;
827 }
828
781 /* before reading the EEPROM, reset the controller to 829 /* before reading the EEPROM, reset the controller to
782 * put the device in a known good starting state */ 830 * put the device in a known good starting state */
783 831
@@ -845,6 +893,11 @@ e1000_probe(struct pci_dev *pdev,
845 EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data); 893 EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data);
846 eeprom_apme_mask = E1000_EEPROM_82544_APM; 894 eeprom_apme_mask = E1000_EEPROM_82544_APM;
847 break; 895 break;
896 case e1000_ich8lan:
897 e1000_read_eeprom(&adapter->hw,
898 EEPROM_INIT_CONTROL1_REG, 1, &eeprom_data);
899 eeprom_apme_mask = E1000_EEPROM_ICH8_APME;
900 break;
848 case e1000_82546: 901 case e1000_82546:
849 case e1000_82546_rev_3: 902 case e1000_82546_rev_3:
850 case e1000_82571: 903 case e1000_82571:
@@ -904,6 +957,9 @@ e1000_probe(struct pci_dev *pdev,
904 return 0; 957 return 0;
905 958
906err_register: 959err_register:
960 if (adapter->hw.flash_address)
961 iounmap(adapter->hw.flash_address);
962err_flashmap:
907err_sw_init: 963err_sw_init:
908err_eeprom: 964err_eeprom:
909 iounmap(adapter->hw.hw_addr); 965 iounmap(adapter->hw.hw_addr);
@@ -937,6 +993,7 @@ e1000_remove(struct pci_dev *pdev)
937 flush_scheduled_work(); 993 flush_scheduled_work();
938 994
939 if (adapter->hw.mac_type >= e1000_82540 && 995 if (adapter->hw.mac_type >= e1000_82540 &&
996 adapter->hw.mac_type != e1000_ich8lan &&
940 adapter->hw.media_type == e1000_media_type_copper) { 997 adapter->hw.media_type == e1000_media_type_copper) {
941 manc = E1000_READ_REG(&adapter->hw, MANC); 998 manc = E1000_READ_REG(&adapter->hw, MANC);
942 if (manc & E1000_MANC_SMBUS_EN) { 999 if (manc & E1000_MANC_SMBUS_EN) {
@@ -965,6 +1022,8 @@ e1000_remove(struct pci_dev *pdev)
965#endif 1022#endif
966 1023
967 iounmap(adapter->hw.hw_addr); 1024 iounmap(adapter->hw.hw_addr);
1025 if (adapter->hw.flash_address)
1026 iounmap(adapter->hw.flash_address);
968 pci_release_regions(pdev); 1027 pci_release_regions(pdev);
969 1028
970 free_netdev(netdev); 1029 free_netdev(netdev);
@@ -1015,13 +1074,6 @@ e1000_sw_init(struct e1000_adapter *adapter)
1015 return -EIO; 1074 return -EIO;
1016 } 1075 }
1017 1076
1018 /* initialize eeprom parameters */
1019
1020 if (e1000_init_eeprom_params(hw)) {
1021 E1000_ERR("EEPROM initialization failed\n");
1022 return -EIO;
1023 }
1024
1025 switch (hw->mac_type) { 1077 switch (hw->mac_type) {
1026 default: 1078 default:
1027 break; 1079 break;
@@ -1257,8 +1309,7 @@ e1000_setup_tx_resources(struct e1000_adapter *adapter,
1257 int size; 1309 int size;
1258 1310
1259 size = sizeof(struct e1000_buffer) * txdr->count; 1311 size = sizeof(struct e1000_buffer) * txdr->count;
1260 1312 txdr->buffer_info = vmalloc(size);
1261 txdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus));
1262 if (!txdr->buffer_info) { 1313 if (!txdr->buffer_info) {
1263 DPRINTK(PROBE, ERR, 1314 DPRINTK(PROBE, ERR,
1264 "Unable to allocate memory for the transmit descriptor ring\n"); 1315 "Unable to allocate memory for the transmit descriptor ring\n");
@@ -1486,7 +1537,7 @@ e1000_setup_rx_resources(struct e1000_adapter *adapter,
1486 int size, desc_len; 1537 int size, desc_len;
1487 1538
1488 size = sizeof(struct e1000_buffer) * rxdr->count; 1539 size = sizeof(struct e1000_buffer) * rxdr->count;
1489 rxdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus)); 1540 rxdr->buffer_info = vmalloc(size);
1490 if (!rxdr->buffer_info) { 1541 if (!rxdr->buffer_info) {
1491 DPRINTK(PROBE, ERR, 1542 DPRINTK(PROBE, ERR,
1492 "Unable to allocate memory for the receive descriptor ring\n"); 1543 "Unable to allocate memory for the receive descriptor ring\n");
@@ -2145,6 +2196,12 @@ e1000_set_multi(struct net_device *netdev)
2145 uint32_t rctl; 2196 uint32_t rctl;
2146 uint32_t hash_value; 2197 uint32_t hash_value;
2147 int i, rar_entries = E1000_RAR_ENTRIES; 2198 int i, rar_entries = E1000_RAR_ENTRIES;
2199 int mta_reg_count = (hw->mac_type == e1000_ich8lan) ?
2200 E1000_NUM_MTA_REGISTERS_ICH8LAN :
2201 E1000_NUM_MTA_REGISTERS;
2202
2203 if (adapter->hw.mac_type == e1000_ich8lan)
2204 rar_entries = E1000_RAR_ENTRIES_ICH8LAN;
2148 2205
2149 /* reserve RAR[14] for LAA over-write work-around */ 2206 /* reserve RAR[14] for LAA over-write work-around */
2150 if (adapter->hw.mac_type == e1000_82571) 2207 if (adapter->hw.mac_type == e1000_82571)
@@ -2191,7 +2248,7 @@ e1000_set_multi(struct net_device *netdev)
2191 2248
2192 /* clear the old settings from the multicast hash table */ 2249 /* clear the old settings from the multicast hash table */
2193 2250
2194 for (i = 0; i < E1000_NUM_MTA_REGISTERS; i++) { 2251 for (i = 0; i < mta_reg_count; i++) {
2195 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0); 2252 E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
2196 E1000_WRITE_FLUSH(hw); 2253 E1000_WRITE_FLUSH(hw);
2197 } 2254 }
@@ -2270,8 +2327,16 @@ e1000_watchdog(unsigned long data)
2270 struct net_device *netdev = adapter->netdev; 2327 struct net_device *netdev = adapter->netdev;
2271 struct e1000_tx_ring *txdr = adapter->tx_ring; 2328 struct e1000_tx_ring *txdr = adapter->tx_ring;
2272 uint32_t link, tctl; 2329 uint32_t link, tctl;
2273 2330 int32_t ret_val;
2274 e1000_check_for_link(&adapter->hw); 2331
2332 ret_val = e1000_check_for_link(&adapter->hw);
2333 if ((ret_val == E1000_ERR_PHY) &&
2334 (adapter->hw.phy_type == e1000_phy_igp_3) &&
2335 (E1000_READ_REG(&adapter->hw, CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) {
2336 /* See e1000_kumeran_lock_loss_workaround() */
2337 DPRINTK(LINK, INFO,
2338 "Gigabit has been disabled, downgrading speed\n");
2339 }
2275 if (adapter->hw.mac_type == e1000_82573) { 2340 if (adapter->hw.mac_type == e1000_82573) {
2276 e1000_enable_tx_pkt_filtering(&adapter->hw); 2341 e1000_enable_tx_pkt_filtering(&adapter->hw);
2277 if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id) 2342 if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id)
@@ -2837,6 +2902,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2837 case e1000_82571: 2902 case e1000_82571:
2838 case e1000_82572: 2903 case e1000_82572:
2839 case e1000_82573: 2904 case e1000_82573:
2905 case e1000_ich8lan:
2840 pull_size = min((unsigned int)4, skb->data_len); 2906 pull_size = min((unsigned int)4, skb->data_len);
2841 if (!__pskb_pull_tail(skb, pull_size)) { 2907 if (!__pskb_pull_tail(skb, pull_size)) {
2842 DPRINTK(DRV, ERR, 2908 DPRINTK(DRV, ERR,
@@ -3021,6 +3087,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
3021 /* Adapter-specific max frame size limits. */ 3087 /* Adapter-specific max frame size limits. */
3022 switch (adapter->hw.mac_type) { 3088 switch (adapter->hw.mac_type) {
3023 case e1000_undefined ... e1000_82542_rev2_1: 3089 case e1000_undefined ... e1000_82542_rev2_1:
3090 case e1000_ich8lan:
3024 if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) { 3091 if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
3025 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n"); 3092 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n");
3026 return -EINVAL; 3093 return -EINVAL;
@@ -3129,12 +3196,15 @@ e1000_update_stats(struct e1000_adapter *adapter)
3129 adapter->stats.bprc += E1000_READ_REG(hw, BPRC); 3196 adapter->stats.bprc += E1000_READ_REG(hw, BPRC);
3130 adapter->stats.mprc += E1000_READ_REG(hw, MPRC); 3197 adapter->stats.mprc += E1000_READ_REG(hw, MPRC);
3131 adapter->stats.roc += E1000_READ_REG(hw, ROC); 3198 adapter->stats.roc += E1000_READ_REG(hw, ROC);
3199
3200 if (adapter->hw.mac_type != e1000_ich8lan) {
3132 adapter->stats.prc64 += E1000_READ_REG(hw, PRC64); 3201 adapter->stats.prc64 += E1000_READ_REG(hw, PRC64);
3133 adapter->stats.prc127 += E1000_READ_REG(hw, PRC127); 3202 adapter->stats.prc127 += E1000_READ_REG(hw, PRC127);
3134 adapter->stats.prc255 += E1000_READ_REG(hw, PRC255); 3203 adapter->stats.prc255 += E1000_READ_REG(hw, PRC255);
3135 adapter->stats.prc511 += E1000_READ_REG(hw, PRC511); 3204 adapter->stats.prc511 += E1000_READ_REG(hw, PRC511);
3136 adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023); 3205 adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023);
3137 adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522); 3206 adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522);
3207 }
3138 3208
3139 adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS); 3209 adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS);
3140 adapter->stats.mpc += E1000_READ_REG(hw, MPC); 3210 adapter->stats.mpc += E1000_READ_REG(hw, MPC);
@@ -3162,12 +3232,16 @@ e1000_update_stats(struct e1000_adapter *adapter)
3162 adapter->stats.totl += E1000_READ_REG(hw, TOTL); 3232 adapter->stats.totl += E1000_READ_REG(hw, TOTL);
3163 adapter->stats.toth += E1000_READ_REG(hw, TOTH); 3233 adapter->stats.toth += E1000_READ_REG(hw, TOTH);
3164 adapter->stats.tpr += E1000_READ_REG(hw, TPR); 3234 adapter->stats.tpr += E1000_READ_REG(hw, TPR);
3235
3236 if (adapter->hw.mac_type != e1000_ich8lan) {
3165 adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64); 3237 adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64);
3166 adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127); 3238 adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127);
3167 adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255); 3239 adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255);
3168 adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511); 3240 adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511);
3169 adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023); 3241 adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023);
3170 adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522); 3242 adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522);
3243 }
3244
3171 adapter->stats.mptc += E1000_READ_REG(hw, MPTC); 3245 adapter->stats.mptc += E1000_READ_REG(hw, MPTC);
3172 adapter->stats.bptc += E1000_READ_REG(hw, BPTC); 3246 adapter->stats.bptc += E1000_READ_REG(hw, BPTC);
3173 3247
@@ -3189,6 +3263,8 @@ e1000_update_stats(struct e1000_adapter *adapter)
3189 if (hw->mac_type > e1000_82547_rev_2) { 3263 if (hw->mac_type > e1000_82547_rev_2) {
3190 adapter->stats.iac += E1000_READ_REG(hw, IAC); 3264 adapter->stats.iac += E1000_READ_REG(hw, IAC);
3191 adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC); 3265 adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC);
3266
3267 if (adapter->hw.mac_type != e1000_ich8lan) {
3192 adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC); 3268 adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC);
3193 adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC); 3269 adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC);
3194 adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC); 3270 adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC);
@@ -3196,6 +3272,7 @@ e1000_update_stats(struct e1000_adapter *adapter)
3196 adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC); 3272 adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC);
3197 adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC); 3273 adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC);
3198 adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC); 3274 adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC);
3275 }
3199 } 3276 }
3200 3277
3201 /* Fill out the OS statistics structure */ 3278 /* Fill out the OS statistics structure */
@@ -4330,18 +4407,21 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
4330 ctrl |= E1000_CTRL_VME; 4407 ctrl |= E1000_CTRL_VME;
4331 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); 4408 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
4332 4409
4410 if (adapter->hw.mac_type != e1000_ich8lan) {
4333 /* enable VLAN receive filtering */ 4411 /* enable VLAN receive filtering */
4334 rctl = E1000_READ_REG(&adapter->hw, RCTL); 4412 rctl = E1000_READ_REG(&adapter->hw, RCTL);
4335 rctl |= E1000_RCTL_VFE; 4413 rctl |= E1000_RCTL_VFE;
4336 rctl &= ~E1000_RCTL_CFIEN; 4414 rctl &= ~E1000_RCTL_CFIEN;
4337 E1000_WRITE_REG(&adapter->hw, RCTL, rctl); 4415 E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
4338 e1000_update_mng_vlan(adapter); 4416 e1000_update_mng_vlan(adapter);
4417 }
4339 } else { 4418 } else {
4340 /* disable VLAN tag insert/strip */ 4419 /* disable VLAN tag insert/strip */
4341 ctrl = E1000_READ_REG(&adapter->hw, CTRL); 4420 ctrl = E1000_READ_REG(&adapter->hw, CTRL);
4342 ctrl &= ~E1000_CTRL_VME; 4421 ctrl &= ~E1000_CTRL_VME;
4343 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); 4422 E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
4344 4423
4424 if (adapter->hw.mac_type != e1000_ich8lan) {
4345 /* disable VLAN filtering */ 4425 /* disable VLAN filtering */
4346 rctl = E1000_READ_REG(&adapter->hw, RCTL); 4426 rctl = E1000_READ_REG(&adapter->hw, RCTL);
4347 rctl &= ~E1000_RCTL_VFE; 4427 rctl &= ~E1000_RCTL_VFE;
@@ -4350,6 +4430,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
4350 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); 4430 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
4351 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; 4431 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
4352 } 4432 }
4433 }
4353 } 4434 }
4354 4435
4355 e1000_irq_enable(adapter); 4436 e1000_irq_enable(adapter);
@@ -4578,7 +4659,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4578 pci_enable_wake(pdev, PCI_D3cold, 0); 4659 pci_enable_wake(pdev, PCI_D3cold, 0);
4579 } 4660 }
4580 4661
4662 /* FIXME: this code is incorrect for PCI Express */
4581 if (adapter->hw.mac_type >= e1000_82540 && 4663 if (adapter->hw.mac_type >= e1000_82540 &&
4664 adapter->hw.mac_type != e1000_ich8lan &&
4582 adapter->hw.media_type == e1000_media_type_copper) { 4665 adapter->hw.media_type == e1000_media_type_copper) {
4583 manc = E1000_READ_REG(&adapter->hw, MANC); 4666 manc = E1000_READ_REG(&adapter->hw, MANC);
4584 if (manc & E1000_MANC_SMBUS_EN) { 4667 if (manc & E1000_MANC_SMBUS_EN) {
@@ -4589,6 +4672,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4589 } 4672 }
4590 } 4673 }
4591 4674
4675 if (adapter->hw.phy_type == e1000_phy_igp_3)
4676 e1000_phy_powerdown_workaround(&adapter->hw);
4677
4592 /* Release control of h/w to f/w. If f/w is AMT enabled, this 4678 /* Release control of h/w to f/w. If f/w is AMT enabled, this
4593 * would have already happened in close and is redundant. */ 4679 * would have already happened in close and is redundant. */
4594 e1000_release_hw_control(adapter); 4680 e1000_release_hw_control(adapter);
@@ -4624,7 +4710,9 @@ e1000_resume(struct pci_dev *pdev)
4624 4710
4625 netif_device_attach(netdev); 4711 netif_device_attach(netdev);
4626 4712
4713 /* FIXME: this code is incorrect for PCI Express */
4627 if (adapter->hw.mac_type >= e1000_82540 && 4714 if (adapter->hw.mac_type >= e1000_82540 &&
4715 adapter->hw.mac_type != e1000_ich8lan &&
4628 adapter->hw.media_type == e1000_media_type_copper) { 4716 adapter->hw.media_type == e1000_media_type_copper) {
4629 manc = E1000_READ_REG(&adapter->hw, MANC); 4717 manc = E1000_READ_REG(&adapter->hw, MANC);
4630 manc &= ~(E1000_MANC_ARP_EN); 4718 manc &= ~(E1000_MANC_ARP_EN);