diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2008-09-11 22:59:59 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-24 18:54:59 -0400 |
commit | c44ade9ef8ffd73cb8b026065ade78bc0040f0b4 (patch) | |
tree | 4e873bc57bccb30e23cec99ed06ec58ba7251e39 /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | f08482766b7e3c0b2aaac4b68b30f33a91703aa3 (diff) |
ixgbe: update to latest common code module
This is a massive update that includes infrastructure for further patches
where we will add support for more phy types and eeprom types.
This code is shared as much as possible with other drivers, so the code may
seem a little obtuse at times but wherever possible we keep to the linux
style and methods.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 4701abf3a59b..ff4fac34a171 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -128,9 +128,10 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
128 | ecmd->advertising = (ADVERTISED_10000baseT_Full | | 128 | ecmd->advertising = (ADVERTISED_10000baseT_Full | |
129 | ADVERTISED_FIBRE); | 129 | ADVERTISED_FIBRE); |
130 | ecmd->port = PORT_FIBRE; | 130 | ecmd->port = PORT_FIBRE; |
131 | ecmd->autoneg = AUTONEG_DISABLE; | ||
131 | } | 132 | } |
132 | 133 | ||
133 | adapter->hw.mac.ops.check_link(hw, &(link_speed), &link_up, false); | 134 | hw->mac.ops.check_link(hw, &link_speed, &link_up, false); |
134 | if (link_up) { | 135 | if (link_up) { |
135 | ecmd->speed = (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? | 136 | ecmd->speed = (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? |
136 | SPEED_10000 : SPEED_1000; | 137 | SPEED_10000 : SPEED_1000; |
@@ -327,7 +328,7 @@ static void ixgbe_get_regs(struct net_device *netdev, | |||
327 | regs_buff[25] = IXGBE_READ_REG(hw, IXGBE_IVAR(0)); | 328 | regs_buff[25] = IXGBE_READ_REG(hw, IXGBE_IVAR(0)); |
328 | regs_buff[26] = IXGBE_READ_REG(hw, IXGBE_MSIXT); | 329 | regs_buff[26] = IXGBE_READ_REG(hw, IXGBE_MSIXT); |
329 | regs_buff[27] = IXGBE_READ_REG(hw, IXGBE_MSIXPBA); | 330 | regs_buff[27] = IXGBE_READ_REG(hw, IXGBE_MSIXPBA); |
330 | regs_buff[28] = IXGBE_READ_REG(hw, IXGBE_PBACL); | 331 | regs_buff[28] = IXGBE_READ_REG(hw, IXGBE_PBACL(0)); |
331 | regs_buff[29] = IXGBE_READ_REG(hw, IXGBE_GPIE); | 332 | regs_buff[29] = IXGBE_READ_REG(hw, IXGBE_GPIE); |
332 | 333 | ||
333 | /* Flow Control */ | 334 | /* Flow Control */ |
@@ -373,7 +374,7 @@ static void ixgbe_get_regs(struct net_device *netdev, | |||
373 | regs_buff[482 + i] = IXGBE_READ_REG(hw, IXGBE_RAL(i)); | 374 | regs_buff[482 + i] = IXGBE_READ_REG(hw, IXGBE_RAL(i)); |
374 | for (i = 0; i < 16; i++) | 375 | for (i = 0; i < 16; i++) |
375 | regs_buff[498 + i] = IXGBE_READ_REG(hw, IXGBE_RAH(i)); | 376 | regs_buff[498 + i] = IXGBE_READ_REG(hw, IXGBE_RAH(i)); |
376 | regs_buff[514] = IXGBE_READ_REG(hw, IXGBE_PSRTYPE); | 377 | regs_buff[514] = IXGBE_READ_REG(hw, IXGBE_PSRTYPE(0)); |
377 | regs_buff[515] = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 378 | regs_buff[515] = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
378 | regs_buff[516] = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); | 379 | regs_buff[516] = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); |
379 | regs_buff[517] = IXGBE_READ_REG(hw, IXGBE_MCSTCTRL); | 380 | regs_buff[517] = IXGBE_READ_REG(hw, IXGBE_MCSTCTRL); |
@@ -605,8 +606,8 @@ static int ixgbe_get_eeprom(struct net_device *netdev, | |||
605 | return -ENOMEM; | 606 | return -ENOMEM; |
606 | 607 | ||
607 | for (i = 0; i < eeprom_len; i++) { | 608 | for (i = 0; i < eeprom_len; i++) { |
608 | if ((ret_val = ixgbe_read_eeprom(hw, first_word + i, | 609 | if ((ret_val = hw->eeprom.ops.read(hw, first_word + i, |
609 | &eeprom_buff[i]))) | 610 | &eeprom_buff[i]))) |
610 | break; | 611 | break; |
611 | } | 612 | } |
612 | 613 | ||
@@ -807,7 +808,7 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | |||
807 | u8 *data) | 808 | u8 *data) |
808 | { | 809 | { |
809 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 810 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
810 | u8 *p = data; | 811 | char *p = (char *)data; |
811 | int i; | 812 | int i; |
812 | 813 | ||
813 | switch (stringset) { | 814 | switch (stringset) { |
@@ -857,16 +858,17 @@ static int ixgbe_nway_reset(struct net_device *netdev) | |||
857 | static int ixgbe_phys_id(struct net_device *netdev, u32 data) | 858 | static int ixgbe_phys_id(struct net_device *netdev, u32 data) |
858 | { | 859 | { |
859 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 860 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
860 | u32 led_reg = IXGBE_READ_REG(&adapter->hw, IXGBE_LEDCTL); | 861 | struct ixgbe_hw *hw = &adapter->hw; |
862 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
861 | u32 i; | 863 | u32 i; |
862 | 864 | ||
863 | if (!data || data > 300) | 865 | if (!data || data > 300) |
864 | data = 300; | 866 | data = 300; |
865 | 867 | ||
866 | for (i = 0; i < (data * 1000); i += 400) { | 868 | for (i = 0; i < (data * 1000); i += 400) { |
867 | ixgbe_led_on(&adapter->hw, IXGBE_LED_ON); | 869 | hw->mac.ops.led_on(hw, IXGBE_LED_ON); |
868 | msleep_interruptible(200); | 870 | msleep_interruptible(200); |
869 | ixgbe_led_off(&adapter->hw, IXGBE_LED_ON); | 871 | hw->mac.ops.led_off(hw, IXGBE_LED_ON); |
870 | msleep_interruptible(200); | 872 | msleep_interruptible(200); |
871 | } | 873 | } |
872 | 874 | ||