diff options
Diffstat (limited to 'drivers/net/atl1c')
-rw-r--r-- | drivers/net/atl1c/atl1c.h | 13 | ||||
-rw-r--r-- | drivers/net/atl1c/atl1c_ethtool.c | 17 | ||||
-rw-r--r-- | drivers/net/atl1c/atl1c_hw.c | 19 | ||||
-rw-r--r-- | drivers/net/atl1c/atl1c_hw.h | 43 | ||||
-rw-r--r-- | drivers/net/atl1c/atl1c_main.c | 104 |
5 files changed, 70 insertions, 126 deletions
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h index 52abbbdf8a08..925929d764ca 100644 --- a/drivers/net/atl1c/atl1c.h +++ b/drivers/net/atl1c/atl1c.h | |||
@@ -265,7 +265,7 @@ struct atl1c_recv_ret_status { | |||
265 | __le32 word3; | 265 | __le32 word3; |
266 | }; | 266 | }; |
267 | 267 | ||
268 | /* RFD desciptor */ | 268 | /* RFD descriptor */ |
269 | struct atl1c_rx_free_desc { | 269 | struct atl1c_rx_free_desc { |
270 | __le64 buffer_addr; | 270 | __le64 buffer_addr; |
271 | }; | 271 | }; |
@@ -531,7 +531,7 @@ struct atl1c_rfd_ring { | |||
531 | struct atl1c_buffer *buffer_info; | 531 | struct atl1c_buffer *buffer_info; |
532 | }; | 532 | }; |
533 | 533 | ||
534 | /* receive return desciptor (rrd) ring */ | 534 | /* receive return descriptor (rrd) ring */ |
535 | struct atl1c_rrd_ring { | 535 | struct atl1c_rrd_ring { |
536 | void *desc; /* descriptor ring virtual address */ | 536 | void *desc; /* descriptor ring virtual address */ |
537 | dma_addr_t dma; /* descriptor ring physical address */ | 537 | dma_addr_t dma; /* descriptor ring physical address */ |
@@ -559,7 +559,6 @@ struct atl1c_adapter { | |||
559 | struct napi_struct napi; | 559 | struct napi_struct napi; |
560 | struct atl1c_hw hw; | 560 | struct atl1c_hw hw; |
561 | struct atl1c_hw_stats hw_stats; | 561 | struct atl1c_hw_stats hw_stats; |
562 | struct net_device_stats net_stats; | ||
563 | struct mii_if_info mii; /* MII interface info */ | 562 | struct mii_if_info mii; /* MII interface info */ |
564 | u16 rx_buffer_len; | 563 | u16 rx_buffer_len; |
565 | 564 | ||
@@ -567,9 +566,9 @@ struct atl1c_adapter { | |||
567 | #define __AT_TESTING 0x0001 | 566 | #define __AT_TESTING 0x0001 |
568 | #define __AT_RESETTING 0x0002 | 567 | #define __AT_RESETTING 0x0002 |
569 | #define __AT_DOWN 0x0003 | 568 | #define __AT_DOWN 0x0003 |
570 | u8 work_event; | 569 | unsigned long work_event; |
571 | #define ATL1C_WORK_EVENT_RESET 0x01 | 570 | #define ATL1C_WORK_EVENT_RESET 0 |
572 | #define ATL1C_WORK_EVENT_LINK_CHANGE 0x02 | 571 | #define ATL1C_WORK_EVENT_LINK_CHANGE 1 |
573 | u32 msg_enable; | 572 | u32 msg_enable; |
574 | 573 | ||
575 | bool have_msi; | 574 | bool have_msi; |
@@ -632,8 +631,6 @@ struct atl1c_adapter { | |||
632 | extern char atl1c_driver_name[]; | 631 | extern char atl1c_driver_name[]; |
633 | extern char atl1c_driver_version[]; | 632 | extern char atl1c_driver_version[]; |
634 | 633 | ||
635 | extern int atl1c_up(struct atl1c_adapter *adapter); | ||
636 | extern void atl1c_down(struct atl1c_adapter *adapter); | ||
637 | extern void atl1c_reinit_locked(struct atl1c_adapter *adapter); | 634 | extern void atl1c_reinit_locked(struct atl1c_adapter *adapter); |
638 | extern s32 atl1c_reset_hw(struct atl1c_hw *hw); | 635 | extern s32 atl1c_reset_hw(struct atl1c_hw *hw); |
639 | extern void atl1c_set_ethtool_ops(struct net_device *netdev); | 636 | extern void atl1c_set_ethtool_ops(struct net_device *netdev); |
diff --git a/drivers/net/atl1c/atl1c_ethtool.c b/drivers/net/atl1c/atl1c_ethtool.c index 7c521508313c..7be884d0aaf6 100644 --- a/drivers/net/atl1c/atl1c_ethtool.c +++ b/drivers/net/atl1c/atl1c_ethtool.c | |||
@@ -50,13 +50,13 @@ static int atl1c_get_settings(struct net_device *netdev, | |||
50 | ecmd->transceiver = XCVR_INTERNAL; | 50 | ecmd->transceiver = XCVR_INTERNAL; |
51 | 51 | ||
52 | if (adapter->link_speed != SPEED_0) { | 52 | if (adapter->link_speed != SPEED_0) { |
53 | ecmd->speed = adapter->link_speed; | 53 | ethtool_cmd_speed_set(ecmd, adapter->link_speed); |
54 | if (adapter->link_duplex == FULL_DUPLEX) | 54 | if (adapter->link_duplex == FULL_DUPLEX) |
55 | ecmd->duplex = DUPLEX_FULL; | 55 | ecmd->duplex = DUPLEX_FULL; |
56 | else | 56 | else |
57 | ecmd->duplex = DUPLEX_HALF; | 57 | ecmd->duplex = DUPLEX_HALF; |
58 | } else { | 58 | } else { |
59 | ecmd->speed = -1; | 59 | ethtool_cmd_speed_set(ecmd, -1); |
60 | ecmd->duplex = -1; | 60 | ecmd->duplex = -1; |
61 | } | 61 | } |
62 | 62 | ||
@@ -77,7 +77,8 @@ static int atl1c_set_settings(struct net_device *netdev, | |||
77 | if (ecmd->autoneg == AUTONEG_ENABLE) { | 77 | if (ecmd->autoneg == AUTONEG_ENABLE) { |
78 | autoneg_advertised = ADVERTISED_Autoneg; | 78 | autoneg_advertised = ADVERTISED_Autoneg; |
79 | } else { | 79 | } else { |
80 | if (ecmd->speed == SPEED_1000) { | 80 | u32 speed = ethtool_cmd_speed(ecmd); |
81 | if (speed == SPEED_1000) { | ||
81 | if (ecmd->duplex != DUPLEX_FULL) { | 82 | if (ecmd->duplex != DUPLEX_FULL) { |
82 | if (netif_msg_link(adapter)) | 83 | if (netif_msg_link(adapter)) |
83 | dev_warn(&adapter->pdev->dev, | 84 | dev_warn(&adapter->pdev->dev, |
@@ -86,7 +87,7 @@ static int atl1c_set_settings(struct net_device *netdev, | |||
86 | return -EINVAL; | 87 | return -EINVAL; |
87 | } | 88 | } |
88 | autoneg_advertised = ADVERTISED_1000baseT_Full; | 89 | autoneg_advertised = ADVERTISED_1000baseT_Full; |
89 | } else if (ecmd->speed == SPEED_100) { | 90 | } else if (speed == SPEED_100) { |
90 | if (ecmd->duplex == DUPLEX_FULL) | 91 | if (ecmd->duplex == DUPLEX_FULL) |
91 | autoneg_advertised = ADVERTISED_100baseT_Full; | 92 | autoneg_advertised = ADVERTISED_100baseT_Full; |
92 | else | 93 | else |
@@ -113,11 +114,6 @@ static int atl1c_set_settings(struct net_device *netdev, | |||
113 | return 0; | 114 | return 0; |
114 | } | 115 | } |
115 | 116 | ||
116 | static u32 atl1c_get_tx_csum(struct net_device *netdev) | ||
117 | { | ||
118 | return (netdev->features & NETIF_F_HW_CSUM) != 0; | ||
119 | } | ||
120 | |||
121 | static u32 atl1c_get_msglevel(struct net_device *netdev) | 117 | static u32 atl1c_get_msglevel(struct net_device *netdev) |
122 | { | 118 | { |
123 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 119 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
@@ -307,9 +303,6 @@ static const struct ethtool_ops atl1c_ethtool_ops = { | |||
307 | .get_link = ethtool_op_get_link, | 303 | .get_link = ethtool_op_get_link, |
308 | .get_eeprom_len = atl1c_get_eeprom_len, | 304 | .get_eeprom_len = atl1c_get_eeprom_len, |
309 | .get_eeprom = atl1c_get_eeprom, | 305 | .get_eeprom = atl1c_get_eeprom, |
310 | .get_tx_csum = atl1c_get_tx_csum, | ||
311 | .get_sg = ethtool_op_get_sg, | ||
312 | .set_sg = ethtool_op_set_sg, | ||
313 | }; | 306 | }; |
314 | 307 | ||
315 | void atl1c_set_ethtool_ops(struct net_device *netdev) | 308 | void atl1c_set_ethtool_ops(struct net_device *netdev) |
diff --git a/drivers/net/atl1c/atl1c_hw.c b/drivers/net/atl1c/atl1c_hw.c index d8501f060957..23f2ab0f2fa8 100644 --- a/drivers/net/atl1c/atl1c_hw.c +++ b/drivers/net/atl1c/atl1c_hw.c | |||
@@ -82,7 +82,7 @@ static int atl1c_get_permanent_address(struct atl1c_hw *hw) | |||
82 | addr[0] = addr[1] = 0; | 82 | addr[0] = addr[1] = 0; |
83 | AT_READ_REG(hw, REG_OTP_CTRL, &otp_ctrl_data); | 83 | AT_READ_REG(hw, REG_OTP_CTRL, &otp_ctrl_data); |
84 | if (atl1c_check_eeprom_exist(hw)) { | 84 | if (atl1c_check_eeprom_exist(hw)) { |
85 | if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c_b) { | 85 | if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c) { |
86 | /* Enable OTP CLK */ | 86 | /* Enable OTP CLK */ |
87 | if (!(otp_ctrl_data & OTP_CTRL_CLK_EN)) { | 87 | if (!(otp_ctrl_data & OTP_CTRL_CLK_EN)) { |
88 | otp_ctrl_data |= OTP_CTRL_CLK_EN; | 88 | otp_ctrl_data |= OTP_CTRL_CLK_EN; |
@@ -345,7 +345,7 @@ int atl1c_write_phy_reg(struct atl1c_hw *hw, u32 reg_addr, u16 phy_data) | |||
345 | */ | 345 | */ |
346 | static int atl1c_phy_setup_adv(struct atl1c_hw *hw) | 346 | static int atl1c_phy_setup_adv(struct atl1c_hw *hw) |
347 | { | 347 | { |
348 | u16 mii_adv_data = ADVERTISE_DEFAULT_CAP & ~ADVERTISE_SPEED_MASK; | 348 | u16 mii_adv_data = ADVERTISE_DEFAULT_CAP & ~ADVERTISE_ALL; |
349 | u16 mii_giga_ctrl_data = GIGA_CR_1000T_DEFAULT_CAP & | 349 | u16 mii_giga_ctrl_data = GIGA_CR_1000T_DEFAULT_CAP & |
350 | ~GIGA_CR_1000T_SPEED_MASK; | 350 | ~GIGA_CR_1000T_SPEED_MASK; |
351 | 351 | ||
@@ -373,7 +373,7 @@ static int atl1c_phy_setup_adv(struct atl1c_hw *hw) | |||
373 | } | 373 | } |
374 | 374 | ||
375 | if (atl1c_write_phy_reg(hw, MII_ADVERTISE, mii_adv_data) != 0 || | 375 | if (atl1c_write_phy_reg(hw, MII_ADVERTISE, mii_adv_data) != 0 || |
376 | atl1c_write_phy_reg(hw, MII_GIGA_CR, mii_giga_ctrl_data) != 0) | 376 | atl1c_write_phy_reg(hw, MII_CTRL1000, mii_giga_ctrl_data) != 0) |
377 | return -1; | 377 | return -1; |
378 | return 0; | 378 | return 0; |
379 | } | 379 | } |
@@ -480,7 +480,7 @@ int atl1c_phy_reset(struct atl1c_hw *hw) | |||
480 | atl1c_write_phy_reg(hw, MII_DBG_DATA, 0x929D); | 480 | atl1c_write_phy_reg(hw, MII_DBG_DATA, 0x929D); |
481 | } | 481 | } |
482 | if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c_b2 | 482 | if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c_b2 |
483 | || hw->nic_type == athr_l2c || hw->nic_type == athr_l2c) { | 483 | || hw->nic_type == athr_l2c) { |
484 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x29); | 484 | atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x29); |
485 | atl1c_write_phy_reg(hw, MII_DBG_DATA, 0xB6DD); | 485 | atl1c_write_phy_reg(hw, MII_DBG_DATA, 0xB6DD); |
486 | } | 486 | } |
@@ -517,19 +517,18 @@ int atl1c_phy_init(struct atl1c_hw *hw) | |||
517 | "Error Setting up Auto-Negotiation\n"); | 517 | "Error Setting up Auto-Negotiation\n"); |
518 | return ret_val; | 518 | return ret_val; |
519 | } | 519 | } |
520 | mii_bmcr_data |= BMCR_AUTO_NEG_EN | BMCR_RESTART_AUTO_NEG; | 520 | mii_bmcr_data |= BMCR_ANENABLE | BMCR_ANRESTART; |
521 | break; | 521 | break; |
522 | case MEDIA_TYPE_100M_FULL: | 522 | case MEDIA_TYPE_100M_FULL: |
523 | mii_bmcr_data |= BMCR_SPEED_100 | BMCR_FULL_DUPLEX; | 523 | mii_bmcr_data |= BMCR_SPEED100 | BMCR_FULLDPLX; |
524 | break; | 524 | break; |
525 | case MEDIA_TYPE_100M_HALF: | 525 | case MEDIA_TYPE_100M_HALF: |
526 | mii_bmcr_data |= BMCR_SPEED_100; | 526 | mii_bmcr_data |= BMCR_SPEED100; |
527 | break; | 527 | break; |
528 | case MEDIA_TYPE_10M_FULL: | 528 | case MEDIA_TYPE_10M_FULL: |
529 | mii_bmcr_data |= BMCR_SPEED_10 | BMCR_FULL_DUPLEX; | 529 | mii_bmcr_data |= BMCR_FULLDPLX; |
530 | break; | 530 | break; |
531 | case MEDIA_TYPE_10M_HALF: | 531 | case MEDIA_TYPE_10M_HALF: |
532 | mii_bmcr_data |= BMCR_SPEED_10; | ||
533 | break; | 532 | break; |
534 | default: | 533 | default: |
535 | if (netif_msg_link(adapter)) | 534 | if (netif_msg_link(adapter)) |
@@ -657,7 +656,7 @@ int atl1c_restart_autoneg(struct atl1c_hw *hw) | |||
657 | err = atl1c_phy_setup_adv(hw); | 656 | err = atl1c_phy_setup_adv(hw); |
658 | if (err) | 657 | if (err) |
659 | return err; | 658 | return err; |
660 | mii_bmcr_data |= BMCR_AUTO_NEG_EN | BMCR_RESTART_AUTO_NEG; | 659 | mii_bmcr_data |= BMCR_ANENABLE | BMCR_ANRESTART; |
661 | 660 | ||
662 | return atl1c_write_phy_reg(hw, MII_BMCR, mii_bmcr_data); | 661 | return atl1c_write_phy_reg(hw, MII_BMCR, mii_bmcr_data); |
663 | } | 662 | } |
diff --git a/drivers/net/atl1c/atl1c_hw.h b/drivers/net/atl1c/atl1c_hw.h index 3dd675979aa1..655fc6c4a8a4 100644 --- a/drivers/net/atl1c/atl1c_hw.h +++ b/drivers/net/atl1c/atl1c_hw.h | |||
@@ -736,55 +736,16 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw); | |||
736 | #define REG_DEBUG_DATA0 0x1900 | 736 | #define REG_DEBUG_DATA0 0x1900 |
737 | #define REG_DEBUG_DATA1 0x1904 | 737 | #define REG_DEBUG_DATA1 0x1904 |
738 | 738 | ||
739 | /* PHY Control Register */ | ||
740 | #define MII_BMCR 0x00 | ||
741 | #define BMCR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */ | ||
742 | #define BMCR_COLL_TEST_ENABLE 0x0080 /* Collision test enable */ | ||
743 | #define BMCR_FULL_DUPLEX 0x0100 /* FDX =1, half duplex =0 */ | ||
744 | #define BMCR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */ | ||
745 | #define BMCR_ISOLATE 0x0400 /* Isolate PHY from MII */ | ||
746 | #define BMCR_POWER_DOWN 0x0800 /* Power down */ | ||
747 | #define BMCR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */ | ||
748 | #define BMCR_SPEED_SELECT_LSB 0x2000 /* bits 6,13: 10=1000, 01=100, 00=10 */ | ||
749 | #define BMCR_LOOPBACK 0x4000 /* 0 = normal, 1 = loopback */ | ||
750 | #define BMCR_RESET 0x8000 /* 0 = normal, 1 = PHY reset */ | ||
751 | #define BMCR_SPEED_MASK 0x2040 | ||
752 | #define BMCR_SPEED_1000 0x0040 | ||
753 | #define BMCR_SPEED_100 0x2000 | ||
754 | #define BMCR_SPEED_10 0x0000 | ||
755 | |||
756 | /* PHY Status Register */ | ||
757 | #define MII_BMSR 0x01 | ||
758 | #define BMMSR_EXTENDED_CAPS 0x0001 /* Extended register capabilities */ | ||
759 | #define BMSR_JABBER_DETECT 0x0002 /* Jabber Detected */ | ||
760 | #define BMSR_LINK_STATUS 0x0004 /* Link Status 1 = link */ | ||
761 | #define BMSR_AUTONEG_CAPS 0x0008 /* Auto Neg Capable */ | ||
762 | #define BMSR_REMOTE_FAULT 0x0010 /* Remote Fault Detect */ | ||
763 | #define BMSR_AUTONEG_COMPLETE 0x0020 /* Auto Neg Complete */ | ||
764 | #define BMSR_PREAMBLE_SUPPRESS 0x0040 /* Preamble may be suppressed */ | ||
765 | #define BMSR_EXTENDED_STATUS 0x0100 /* Ext. status info in Reg 0x0F */ | ||
766 | #define BMSR_100T2_HD_CAPS 0x0200 /* 100T2 Half Duplex Capable */ | ||
767 | #define BMSR_100T2_FD_CAPS 0x0400 /* 100T2 Full Duplex Capable */ | ||
768 | #define BMSR_10T_HD_CAPS 0x0800 /* 10T Half Duplex Capable */ | ||
769 | #define BMSR_10T_FD_CAPS 0x1000 /* 10T Full Duplex Capable */ | ||
770 | #define BMSR_100X_HD_CAPS 0x2000 /* 100X Half Duplex Capable */ | ||
771 | #define BMMII_SR_100X_FD_CAPS 0x4000 /* 100X Full Duplex Capable */ | ||
772 | #define BMMII_SR_100T4_CAPS 0x8000 /* 100T4 Capable */ | ||
773 | |||
774 | #define MII_PHYSID1 0x02 | ||
775 | #define MII_PHYSID2 0x03 | ||
776 | #define L1D_MPW_PHYID1 0xD01C /* V7 */ | 739 | #define L1D_MPW_PHYID1 0xD01C /* V7 */ |
777 | #define L1D_MPW_PHYID2 0xD01D /* V1-V6 */ | 740 | #define L1D_MPW_PHYID2 0xD01D /* V1-V6 */ |
778 | #define L1D_MPW_PHYID3 0xD01E /* V8 */ | 741 | #define L1D_MPW_PHYID3 0xD01E /* V8 */ |
779 | 742 | ||
780 | 743 | ||
781 | /* Autoneg Advertisement Register */ | 744 | /* Autoneg Advertisement Register */ |
782 | #define MII_ADVERTISE 0x04 | 745 | #define ADVERTISE_DEFAULT_CAP \ |
783 | #define ADVERTISE_SPEED_MASK 0x01E0 | 746 | (ADVERTISE_ALL | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM) |
784 | #define ADVERTISE_DEFAULT_CAP 0x0DE0 | ||
785 | 747 | ||
786 | /* 1000BASE-T Control Register */ | 748 | /* 1000BASE-T Control Register */ |
787 | #define MII_GIGA_CR 0x09 | ||
788 | #define GIGA_CR_1000T_REPEATER_DTE 0x0400 /* 1=Repeater/switch device port 0=DTE device */ | 749 | #define GIGA_CR_1000T_REPEATER_DTE 0x0400 /* 1=Repeater/switch device port 0=DTE device */ |
789 | 750 | ||
790 | #define GIGA_CR_1000T_MS_VALUE 0x0800 /* 1=Configure PHY as Master 0=Configure PHY as Slave */ | 751 | #define GIGA_CR_1000T_MS_VALUE 0x0800 /* 1=Configure PHY as Master 0=Configure PHY as Slave */ |
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index c7b8ef507ebd..1269ba5d6e56 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -48,6 +48,7 @@ static DEFINE_PCI_DEVICE_TABLE(atl1c_pci_tbl) = { | |||
48 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B)}, | 48 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B)}, |
49 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B2)}, | 49 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B2)}, |
50 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D)}, | 50 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D)}, |
51 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D_2_0)}, | ||
51 | /* required last entry */ | 52 | /* required last entry */ |
52 | { 0 } | 53 | { 0 } |
53 | }; | 54 | }; |
@@ -66,6 +67,8 @@ static void atl1c_set_aspm(struct atl1c_hw *hw, bool linkup); | |||
66 | static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter); | 67 | static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter); |
67 | static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que, | 68 | static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que, |
68 | int *work_done, int work_to_do); | 69 | int *work_done, int work_to_do); |
70 | static int atl1c_up(struct atl1c_adapter *adapter); | ||
71 | static void atl1c_down(struct atl1c_adapter *adapter); | ||
69 | 72 | ||
70 | static const u16 atl1c_pay_load_size[] = { | 73 | static const u16 atl1c_pay_load_size[] = { |
71 | 128, 256, 512, 1024, 2048, 4096, | 74 | 128, 256, 512, 1024, 2048, 4096, |
@@ -322,7 +325,7 @@ static void atl1c_link_chg_event(struct atl1c_adapter *adapter) | |||
322 | } | 325 | } |
323 | } | 326 | } |
324 | 327 | ||
325 | adapter->work_event |= ATL1C_WORK_EVENT_LINK_CHANGE; | 328 | set_bit(ATL1C_WORK_EVENT_LINK_CHANGE, &adapter->work_event); |
326 | schedule_work(&adapter->common_task); | 329 | schedule_work(&adapter->common_task); |
327 | } | 330 | } |
328 | 331 | ||
@@ -334,20 +337,16 @@ static void atl1c_common_task(struct work_struct *work) | |||
334 | adapter = container_of(work, struct atl1c_adapter, common_task); | 337 | adapter = container_of(work, struct atl1c_adapter, common_task); |
335 | netdev = adapter->netdev; | 338 | netdev = adapter->netdev; |
336 | 339 | ||
337 | if (adapter->work_event & ATL1C_WORK_EVENT_RESET) { | 340 | if (test_and_clear_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event)) { |
338 | adapter->work_event &= ~ATL1C_WORK_EVENT_RESET; | ||
339 | netif_device_detach(netdev); | 341 | netif_device_detach(netdev); |
340 | atl1c_down(adapter); | 342 | atl1c_down(adapter); |
341 | atl1c_up(adapter); | 343 | atl1c_up(adapter); |
342 | netif_device_attach(netdev); | 344 | netif_device_attach(netdev); |
343 | return; | ||
344 | } | 345 | } |
345 | 346 | ||
346 | if (adapter->work_event & ATL1C_WORK_EVENT_LINK_CHANGE) { | 347 | if (test_and_clear_bit(ATL1C_WORK_EVENT_LINK_CHANGE, |
347 | adapter->work_event &= ~ATL1C_WORK_EVENT_LINK_CHANGE; | 348 | &adapter->work_event)) |
348 | atl1c_check_link_status(adapter); | 349 | atl1c_check_link_status(adapter); |
349 | } | ||
350 | return; | ||
351 | } | 350 | } |
352 | 351 | ||
353 | 352 | ||
@@ -366,7 +365,7 @@ static void atl1c_tx_timeout(struct net_device *netdev) | |||
366 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 365 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
367 | 366 | ||
368 | /* Do the reset outside of interrupt context */ | 367 | /* Do the reset outside of interrupt context */ |
369 | adapter->work_event |= ATL1C_WORK_EVENT_RESET; | 368 | set_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event); |
370 | schedule_work(&adapter->common_task); | 369 | schedule_work(&adapter->common_task); |
371 | } | 370 | } |
372 | 371 | ||
@@ -481,6 +480,15 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, | |||
481 | adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? | 480 | adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? |
482 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; | 481 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; |
483 | } | 482 | } |
483 | |||
484 | static u32 atl1c_fix_features(struct net_device *netdev, u32 features) | ||
485 | { | ||
486 | if (netdev->mtu > MAX_TSO_FRAME_SIZE) | ||
487 | features &= ~(NETIF_F_TSO | NETIF_F_TSO6); | ||
488 | |||
489 | return features; | ||
490 | } | ||
491 | |||
484 | /* | 492 | /* |
485 | * atl1c_change_mtu - Change the Maximum Transfer Unit | 493 | * atl1c_change_mtu - Change the Maximum Transfer Unit |
486 | * @netdev: network interface device structure | 494 | * @netdev: network interface device structure |
@@ -507,14 +515,8 @@ static int atl1c_change_mtu(struct net_device *netdev, int new_mtu) | |||
507 | netdev->mtu = new_mtu; | 515 | netdev->mtu = new_mtu; |
508 | adapter->hw.max_frame_size = new_mtu; | 516 | adapter->hw.max_frame_size = new_mtu; |
509 | atl1c_set_rxbufsize(adapter, netdev); | 517 | atl1c_set_rxbufsize(adapter, netdev); |
510 | if (new_mtu > MAX_TSO_FRAME_SIZE) { | ||
511 | adapter->netdev->features &= ~NETIF_F_TSO; | ||
512 | adapter->netdev->features &= ~NETIF_F_TSO6; | ||
513 | } else { | ||
514 | adapter->netdev->features |= NETIF_F_TSO; | ||
515 | adapter->netdev->features |= NETIF_F_TSO6; | ||
516 | } | ||
517 | atl1c_down(adapter); | 518 | atl1c_down(adapter); |
519 | netdev_update_features(netdev); | ||
518 | atl1c_up(adapter); | 520 | atl1c_up(adapter); |
519 | clear_bit(__AT_RESETTING, &adapter->flags); | 521 | clear_bit(__AT_RESETTING, &adapter->flags); |
520 | if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) { | 522 | if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) { |
@@ -700,6 +702,7 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter) | |||
700 | 702 | ||
701 | 703 | ||
702 | adapter->wol = 0; | 704 | adapter->wol = 0; |
705 | device_set_wakeup_enable(&pdev->dev, false); | ||
703 | adapter->link_speed = SPEED_0; | 706 | adapter->link_speed = SPEED_0; |
704 | adapter->link_duplex = FULL_DUPLEX; | 707 | adapter->link_duplex = FULL_DUPLEX; |
705 | adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE; | 708 | adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE; |
@@ -1088,20 +1091,18 @@ static void atl1c_configure_tx(struct atl1c_adapter *adapter) | |||
1088 | u32 max_pay_load; | 1091 | u32 max_pay_load; |
1089 | u16 tx_offload_thresh; | 1092 | u16 tx_offload_thresh; |
1090 | u32 txq_ctrl_data; | 1093 | u32 txq_ctrl_data; |
1091 | u32 extra_size = 0; /* Jumbo frame threshold in QWORD unit */ | ||
1092 | u32 max_pay_load_data; | 1094 | u32 max_pay_load_data; |
1093 | 1095 | ||
1094 | extra_size = ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN; | ||
1095 | tx_offload_thresh = MAX_TX_OFFLOAD_THRESH; | 1096 | tx_offload_thresh = MAX_TX_OFFLOAD_THRESH; |
1096 | AT_WRITE_REG(hw, REG_TX_TSO_OFFLOAD_THRESH, | 1097 | AT_WRITE_REG(hw, REG_TX_TSO_OFFLOAD_THRESH, |
1097 | (tx_offload_thresh >> 3) & TX_TSO_OFFLOAD_THRESH_MASK); | 1098 | (tx_offload_thresh >> 3) & TX_TSO_OFFLOAD_THRESH_MASK); |
1098 | AT_READ_REG(hw, REG_DEVICE_CTRL, &dev_ctrl_data); | 1099 | AT_READ_REG(hw, REG_DEVICE_CTRL, &dev_ctrl_data); |
1099 | max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT) & | 1100 | max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT) & |
1100 | DEVICE_CTRL_MAX_PAYLOAD_MASK; | 1101 | DEVICE_CTRL_MAX_PAYLOAD_MASK; |
1101 | hw->dmaw_block = min(max_pay_load, hw->dmaw_block); | 1102 | hw->dmaw_block = min_t(u32, max_pay_load, hw->dmaw_block); |
1102 | max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT) & | 1103 | max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT) & |
1103 | DEVICE_CTRL_MAX_RREQ_SZ_MASK; | 1104 | DEVICE_CTRL_MAX_RREQ_SZ_MASK; |
1104 | hw->dmar_block = min(max_pay_load, hw->dmar_block); | 1105 | hw->dmar_block = min_t(u32, max_pay_load, hw->dmar_block); |
1105 | 1106 | ||
1106 | txq_ctrl_data = (hw->tpd_burst & TXQ_NUM_TPD_BURST_MASK) << | 1107 | txq_ctrl_data = (hw->tpd_burst & TXQ_NUM_TPD_BURST_MASK) << |
1107 | TXQ_NUM_TPD_BURST_SHIFT; | 1108 | TXQ_NUM_TPD_BURST_SHIFT; |
@@ -1562,7 +1563,7 @@ static struct net_device_stats *atl1c_get_stats(struct net_device *netdev) | |||
1562 | { | 1563 | { |
1563 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 1564 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
1564 | struct atl1c_hw_stats *hw_stats = &adapter->hw_stats; | 1565 | struct atl1c_hw_stats *hw_stats = &adapter->hw_stats; |
1565 | struct net_device_stats *net_stats = &adapter->net_stats; | 1566 | struct net_device_stats *net_stats = &netdev->stats; |
1566 | 1567 | ||
1567 | atl1c_update_hw_stats(adapter); | 1568 | atl1c_update_hw_stats(adapter); |
1568 | net_stats->rx_packets = hw_stats->rx_ok; | 1569 | net_stats->rx_packets = hw_stats->rx_ok; |
@@ -1590,7 +1591,7 @@ static struct net_device_stats *atl1c_get_stats(struct net_device *netdev) | |||
1590 | net_stats->tx_aborted_errors = hw_stats->tx_abort_col; | 1591 | net_stats->tx_aborted_errors = hw_stats->tx_abort_col; |
1591 | net_stats->tx_window_errors = hw_stats->tx_late_col; | 1592 | net_stats->tx_window_errors = hw_stats->tx_late_col; |
1592 | 1593 | ||
1593 | return &adapter->net_stats; | 1594 | return net_stats; |
1594 | } | 1595 | } |
1595 | 1596 | ||
1596 | static inline void atl1c_clear_phy_int(struct atl1c_adapter *adapter) | 1597 | static inline void atl1c_clear_phy_int(struct atl1c_adapter *adapter) |
@@ -1700,7 +1701,7 @@ static irqreturn_t atl1c_intr(int irq, void *data) | |||
1700 | 1701 | ||
1701 | /* link event */ | 1702 | /* link event */ |
1702 | if (status & (ISR_GPHY | ISR_MANUAL)) { | 1703 | if (status & (ISR_GPHY | ISR_MANUAL)) { |
1703 | adapter->net_stats.tx_carrier_errors++; | 1704 | netdev->stats.tx_carrier_errors++; |
1704 | atl1c_link_chg_event(adapter); | 1705 | atl1c_link_chg_event(adapter); |
1705 | break; | 1706 | break; |
1706 | } | 1707 | } |
@@ -1719,7 +1720,7 @@ static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter, | |||
1719 | * cannot figure out if the packet is fragmented or not, | 1720 | * cannot figure out if the packet is fragmented or not, |
1720 | * so we tell the KERNEL CHECKSUM_NONE | 1721 | * so we tell the KERNEL CHECKSUM_NONE |
1721 | */ | 1722 | */ |
1722 | skb->ip_summed = CHECKSUM_NONE; | 1723 | skb_checksum_none_assert(skb); |
1723 | } | 1724 | } |
1724 | 1725 | ||
1725 | static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid) | 1726 | static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid) |
@@ -2076,7 +2077,7 @@ static int atl1c_tso_csum(struct atl1c_adapter *adapter, | |||
2076 | check_sum: | 2077 | check_sum: |
2077 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 2078 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
2078 | u8 css, cso; | 2079 | u8 css, cso; |
2079 | cso = skb_transport_offset(skb); | 2080 | cso = skb_checksum_start_offset(skb); |
2080 | 2081 | ||
2081 | if (unlikely(cso & 0x1)) { | 2082 | if (unlikely(cso & 0x1)) { |
2082 | if (netif_msg_tx_err(adapter)) | 2083 | if (netif_msg_tx_err(adapter)) |
@@ -2243,7 +2244,7 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb, | |||
2243 | return NETDEV_TX_OK; | 2244 | return NETDEV_TX_OK; |
2244 | } | 2245 | } |
2245 | 2246 | ||
2246 | if (unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) { | 2247 | if (unlikely(vlan_tx_tag_present(skb))) { |
2247 | u16 vlan = vlan_tx_tag_get(skb); | 2248 | u16 vlan = vlan_tx_tag_get(skb); |
2248 | __le16 tag; | 2249 | __le16 tag; |
2249 | 2250 | ||
@@ -2309,7 +2310,7 @@ static int atl1c_request_irq(struct atl1c_adapter *adapter) | |||
2309 | return err; | 2310 | return err; |
2310 | } | 2311 | } |
2311 | 2312 | ||
2312 | int atl1c_up(struct atl1c_adapter *adapter) | 2313 | static int atl1c_up(struct atl1c_adapter *adapter) |
2313 | { | 2314 | { |
2314 | struct net_device *netdev = adapter->netdev; | 2315 | struct net_device *netdev = adapter->netdev; |
2315 | int num; | 2316 | int num; |
@@ -2351,7 +2352,7 @@ err_alloc_rx: | |||
2351 | return err; | 2352 | return err; |
2352 | } | 2353 | } |
2353 | 2354 | ||
2354 | void atl1c_down(struct atl1c_adapter *adapter) | 2355 | static void atl1c_down(struct atl1c_adapter *adapter) |
2355 | { | 2356 | { |
2356 | struct net_device *netdev = adapter->netdev; | 2357 | struct net_device *netdev = adapter->netdev; |
2357 | 2358 | ||
@@ -2442,8 +2443,9 @@ static int atl1c_close(struct net_device *netdev) | |||
2442 | return 0; | 2443 | return 0; |
2443 | } | 2444 | } |
2444 | 2445 | ||
2445 | static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | 2446 | static int atl1c_suspend(struct device *dev) |
2446 | { | 2447 | { |
2448 | struct pci_dev *pdev = to_pci_dev(dev); | ||
2447 | struct net_device *netdev = pci_get_drvdata(pdev); | 2449 | struct net_device *netdev = pci_get_drvdata(pdev); |
2448 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 2450 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
2449 | struct atl1c_hw *hw = &adapter->hw; | 2451 | struct atl1c_hw *hw = &adapter->hw; |
@@ -2452,7 +2454,6 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2452 | u32 wol_ctrl_data = 0; | 2454 | u32 wol_ctrl_data = 0; |
2453 | u16 mii_intr_status_data = 0; | 2455 | u16 mii_intr_status_data = 0; |
2454 | u32 wufc = adapter->wol; | 2456 | u32 wufc = adapter->wol; |
2455 | int retval = 0; | ||
2456 | 2457 | ||
2457 | atl1c_disable_l0s_l1(hw); | 2458 | atl1c_disable_l0s_l1(hw); |
2458 | if (netif_running(netdev)) { | 2459 | if (netif_running(netdev)) { |
@@ -2460,9 +2461,6 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2460 | atl1c_down(adapter); | 2461 | atl1c_down(adapter); |
2461 | } | 2462 | } |
2462 | netif_device_detach(netdev); | 2463 | netif_device_detach(netdev); |
2463 | retval = pci_save_state(pdev); | ||
2464 | if (retval) | ||
2465 | return retval; | ||
2466 | 2464 | ||
2467 | if (wufc) | 2465 | if (wufc) |
2468 | if (atl1c_phy_power_saving(hw) != 0) | 2466 | if (atl1c_phy_power_saving(hw) != 0) |
@@ -2523,12 +2521,8 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2523 | AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); | 2521 | AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); |
2524 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | 2522 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); |
2525 | 2523 | ||
2526 | /* pcie patch */ | ||
2527 | device_set_wakeup_enable(&pdev->dev, 1); | ||
2528 | |||
2529 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT | | 2524 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT | |
2530 | GPHY_CTRL_EXT_RESET); | 2525 | GPHY_CTRL_EXT_RESET); |
2531 | pci_prepare_to_sleep(pdev); | ||
2532 | } else { | 2526 | } else { |
2533 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING); | 2527 | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING); |
2534 | master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; | 2528 | master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; |
@@ -2538,25 +2532,18 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2538 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); | 2532 | AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); |
2539 | AT_WRITE_REG(hw, REG_WOL_CTRL, 0); | 2533 | AT_WRITE_REG(hw, REG_WOL_CTRL, 0); |
2540 | hw->phy_configured = false; /* re-init PHY when resume */ | 2534 | hw->phy_configured = false; /* re-init PHY when resume */ |
2541 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); | ||
2542 | } | 2535 | } |
2543 | 2536 | ||
2544 | pci_disable_device(pdev); | ||
2545 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
2546 | |||
2547 | return 0; | 2537 | return 0; |
2548 | } | 2538 | } |
2549 | 2539 | ||
2550 | static int atl1c_resume(struct pci_dev *pdev) | 2540 | #ifdef CONFIG_PM_SLEEP |
2541 | static int atl1c_resume(struct device *dev) | ||
2551 | { | 2542 | { |
2543 | struct pci_dev *pdev = to_pci_dev(dev); | ||
2552 | struct net_device *netdev = pci_get_drvdata(pdev); | 2544 | struct net_device *netdev = pci_get_drvdata(pdev); |
2553 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 2545 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
2554 | 2546 | ||
2555 | pci_set_power_state(pdev, PCI_D0); | ||
2556 | pci_restore_state(pdev); | ||
2557 | pci_enable_wake(pdev, PCI_D3hot, 0); | ||
2558 | pci_enable_wake(pdev, PCI_D3cold, 0); | ||
2559 | |||
2560 | AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); | 2547 | AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); |
2561 | atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE | | 2548 | atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE | |
2562 | ATL1C_PCIE_PHY_RESET); | 2549 | ATL1C_PCIE_PHY_RESET); |
@@ -2577,10 +2564,16 @@ static int atl1c_resume(struct pci_dev *pdev) | |||
2577 | 2564 | ||
2578 | return 0; | 2565 | return 0; |
2579 | } | 2566 | } |
2567 | #endif | ||
2580 | 2568 | ||
2581 | static void atl1c_shutdown(struct pci_dev *pdev) | 2569 | static void atl1c_shutdown(struct pci_dev *pdev) |
2582 | { | 2570 | { |
2583 | atl1c_suspend(pdev, PMSG_SUSPEND); | 2571 | struct net_device *netdev = pci_get_drvdata(pdev); |
2572 | struct atl1c_adapter *adapter = netdev_priv(netdev); | ||
2573 | |||
2574 | atl1c_suspend(&pdev->dev); | ||
2575 | pci_wake_from_d3(pdev, adapter->wol); | ||
2576 | pci_set_power_state(pdev, PCI_D3hot); | ||
2584 | } | 2577 | } |
2585 | 2578 | ||
2586 | static const struct net_device_ops atl1c_netdev_ops = { | 2579 | static const struct net_device_ops atl1c_netdev_ops = { |
@@ -2591,6 +2584,7 @@ static const struct net_device_ops atl1c_netdev_ops = { | |||
2591 | .ndo_set_mac_address = atl1c_set_mac_addr, | 2584 | .ndo_set_mac_address = atl1c_set_mac_addr, |
2592 | .ndo_set_multicast_list = atl1c_set_multi, | 2585 | .ndo_set_multicast_list = atl1c_set_multi, |
2593 | .ndo_change_mtu = atl1c_change_mtu, | 2586 | .ndo_change_mtu = atl1c_change_mtu, |
2587 | .ndo_fix_features = atl1c_fix_features, | ||
2594 | .ndo_do_ioctl = atl1c_ioctl, | 2588 | .ndo_do_ioctl = atl1c_ioctl, |
2595 | .ndo_tx_timeout = atl1c_tx_timeout, | 2589 | .ndo_tx_timeout = atl1c_tx_timeout, |
2596 | .ndo_get_stats = atl1c_get_stats, | 2590 | .ndo_get_stats = atl1c_get_stats, |
@@ -2611,12 +2605,13 @@ static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev) | |||
2611 | atl1c_set_ethtool_ops(netdev); | 2605 | atl1c_set_ethtool_ops(netdev); |
2612 | 2606 | ||
2613 | /* TODO: add when ready */ | 2607 | /* TODO: add when ready */ |
2614 | netdev->features = NETIF_F_SG | | 2608 | netdev->hw_features = NETIF_F_SG | |
2615 | NETIF_F_HW_CSUM | | 2609 | NETIF_F_HW_CSUM | |
2616 | NETIF_F_HW_VLAN_TX | | 2610 | NETIF_F_HW_VLAN_TX | |
2617 | NETIF_F_HW_VLAN_RX | | ||
2618 | NETIF_F_TSO | | 2611 | NETIF_F_TSO | |
2619 | NETIF_F_TSO6; | 2612 | NETIF_F_TSO6; |
2613 | netdev->features = netdev->hw_features | | ||
2614 | NETIF_F_HW_VLAN_RX; | ||
2620 | return 0; | 2615 | return 0; |
2621 | } | 2616 | } |
2622 | 2617 | ||
@@ -2724,7 +2719,6 @@ static int __devinit atl1c_probe(struct pci_dev *pdev, | |||
2724 | goto err_reset; | 2719 | goto err_reset; |
2725 | } | 2720 | } |
2726 | 2721 | ||
2727 | device_init_wakeup(&pdev->dev, 1); | ||
2728 | /* reset the controller to | 2722 | /* reset the controller to |
2729 | * put the device in a known good starting state */ | 2723 | * put the device in a known good starting state */ |
2730 | err = atl1c_phy_init(&adapter->hw); | 2724 | err = atl1c_phy_init(&adapter->hw); |
@@ -2884,16 +2878,16 @@ static struct pci_error_handlers atl1c_err_handler = { | |||
2884 | .resume = atl1c_io_resume, | 2878 | .resume = atl1c_io_resume, |
2885 | }; | 2879 | }; |
2886 | 2880 | ||
2881 | static SIMPLE_DEV_PM_OPS(atl1c_pm_ops, atl1c_suspend, atl1c_resume); | ||
2882 | |||
2887 | static struct pci_driver atl1c_driver = { | 2883 | static struct pci_driver atl1c_driver = { |
2888 | .name = atl1c_driver_name, | 2884 | .name = atl1c_driver_name, |
2889 | .id_table = atl1c_pci_tbl, | 2885 | .id_table = atl1c_pci_tbl, |
2890 | .probe = atl1c_probe, | 2886 | .probe = atl1c_probe, |
2891 | .remove = __devexit_p(atl1c_remove), | 2887 | .remove = __devexit_p(atl1c_remove), |
2892 | /* Power Managment Hooks */ | ||
2893 | .suspend = atl1c_suspend, | ||
2894 | .resume = atl1c_resume, | ||
2895 | .shutdown = atl1c_shutdown, | 2888 | .shutdown = atl1c_shutdown, |
2896 | .err_handler = &atl1c_err_handler | 2889 | .err_handler = &atl1c_err_handler, |
2890 | .driver.pm = &atl1c_pm_ops, | ||
2897 | }; | 2891 | }; |
2898 | 2892 | ||
2899 | /* | 2893 | /* |