aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2006-08-31 17:27:46 -0400
committerAuke Kok <juke-jan.h.kok@intel.com>2006-08-31 17:27:46 -0400
commit120cd57644f85b280b538ee403423641167913a9 (patch)
tree32c35ef6464c0894c6c279d378493c9d6a289402 /drivers/net/e1000/e1000_main.c
parent1db2740d78c74eb11c4d0906047d9c13229a89a4 (diff)
e1000: unify WoL capability detection code
WoL is constantly giving problems and needed a rewrite. Consolidates all WoL capabilities into a single function, and disables WoL for all other ports on the device except for port A. 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.c47
1 files changed, 34 insertions, 13 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index c128f62fa45..9071b78c77f 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -681,9 +681,9 @@ e1000_probe(struct pci_dev *pdev,
681 unsigned long flash_start, flash_len; 681 unsigned long flash_start, flash_len;
682 682
683 static int cards_found = 0; 683 static int cards_found = 0;
684 static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */ 684 static int global_quad_port_a = 0; /* global ksp3 port a indication */
685 int i, err, pci_using_dac; 685 int i, err, pci_using_dac;
686 uint16_t eeprom_data; 686 uint16_t eeprom_data = 0;
687 uint16_t eeprom_apme_mask = E1000_EEPROM_APME; 687 uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
688 if ((err = pci_enable_device(pdev))) 688 if ((err = pci_enable_device(pdev)))
689 return err; 689 return err;
@@ -786,15 +786,6 @@ e1000_probe(struct pci_dev *pdev,
786 if (e1000_check_phy_reset_block(&adapter->hw)) 786 if (e1000_check_phy_reset_block(&adapter->hw))
787 DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n"); 787 DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n");
788 788
789 /* if ksp3, indicate if it's port a being setup */
790 if (pdev->device == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 &&
791 e1000_ksp3_port_a == 0)
792 adapter->ksp3_port_a = 1;
793 e1000_ksp3_port_a++;
794 /* Reset for multiple KP3 adapters */
795 if (e1000_ksp3_port_a == 4)
796 e1000_ksp3_port_a = 0;
797
798 if (adapter->hw.mac_type >= e1000_82543) { 789 if (adapter->hw.mac_type >= e1000_82543) {
799 netdev->features = NETIF_F_SG | 790 netdev->features = NETIF_F_SG |
800 NETIF_F_HW_CSUM | 791 NETIF_F_HW_CSUM |
@@ -913,7 +904,37 @@ e1000_probe(struct pci_dev *pdev,
913 break; 904 break;
914 } 905 }
915 if (eeprom_data & eeprom_apme_mask) 906 if (eeprom_data & eeprom_apme_mask)
916 adapter->wol |= E1000_WUFC_MAG; 907 adapter->eeprom_wol |= E1000_WUFC_MAG;
908
909 /* now that we have the eeprom settings, apply the special cases
910 * where the eeprom may be wrong or the board simply won't support
911 * wake on lan on a particular port */
912 switch (pdev->device) {
913 case E1000_DEV_ID_82546GB_PCIE:
914 adapter->eeprom_wol = 0;
915 break;
916 case E1000_DEV_ID_82546EB_FIBER:
917 case E1000_DEV_ID_82546GB_FIBER:
918 case E1000_DEV_ID_82571EB_FIBER:
919 /* Wake events only supported on port A for dual fiber
920 * regardless of eeprom setting */
921 if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1)
922 adapter->eeprom_wol = 0;
923 break;
924 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
925 /* if quad port adapter, disable WoL on all but port A */
926 if (global_quad_port_a != 0)
927 adapter->eeprom_wol = 0;
928 else
929 adapter->quad_port_a = 1;
930 /* Reset for multiple quad port adapters */
931 if (++global_quad_port_a == 4)
932 global_quad_port_a = 0;
933 break;
934 }
935
936 /* initialize the wol settings based on the eeprom settings */
937 adapter->wol = adapter->eeprom_wol;
917 938
918 /* print bus type/speed/width info */ 939 /* print bus type/speed/width info */
919 { 940 {
@@ -4635,7 +4656,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4635 e1000_set_multi(netdev); 4656 e1000_set_multi(netdev);
4636 4657
4637 /* turn on all-multi mode if wake on multicast is enabled */ 4658 /* turn on all-multi mode if wake on multicast is enabled */
4638 if (adapter->wol & E1000_WUFC_MC) { 4659 if (wufc & E1000_WUFC_MC) {
4639 rctl = E1000_READ_REG(&adapter->hw, RCTL); 4660 rctl = E1000_READ_REG(&adapter->hw, RCTL);
4640 rctl |= E1000_RCTL_MPE; 4661 rctl |= E1000_RCTL_MPE;
4641 E1000_WRITE_REG(&adapter->hw, RCTL, rctl); 4662 E1000_WRITE_REG(&adapter->hw, RCTL, rctl);