diff options
Diffstat (limited to 'drivers/net/sky2.c')
| -rw-r--r-- | drivers/net/sky2.c | 27 | 
1 files changed, 17 insertions, 10 deletions
| diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index d8ec4c11fd49..3a086d3a7cbf 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/ethtool.h> | 33 | #include <linux/ethtool.h> | 
| 34 | #include <linux/pci.h> | 34 | #include <linux/pci.h> | 
| 35 | #include <linux/ip.h> | 35 | #include <linux/ip.h> | 
| 36 | #include <linux/slab.h> | ||
| 36 | #include <net/ip.h> | 37 | #include <net/ip.h> | 
| 37 | #include <linux/tcp.h> | 38 | #include <linux/tcp.h> | 
| 38 | #include <linux/in.h> | 39 | #include <linux/in.h> | 
| @@ -226,7 +227,7 @@ static void sky2_power_on(struct sky2_hw *hw) | |||
| 226 | /* disable Core Clock Division, */ | 227 | /* disable Core Clock Division, */ | 
| 227 | sky2_write32(hw, B2_Y2_CLK_CTRL, Y2_CLK_DIV_DIS); | 228 | sky2_write32(hw, B2_Y2_CLK_CTRL, Y2_CLK_DIV_DIS); | 
| 228 | 229 | ||
| 229 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) | 230 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > CHIP_REV_YU_XL_A1) | 
| 230 | /* enable bits are inverted */ | 231 | /* enable bits are inverted */ | 
| 231 | sky2_write8(hw, B2_Y2_CLK_GATE, | 232 | sky2_write8(hw, B2_Y2_CLK_GATE, | 
| 232 | Y2_PCI_CLK_LNK1_DIS | Y2_COR_CLK_LNK1_DIS | | 233 | Y2_PCI_CLK_LNK1_DIS | Y2_COR_CLK_LNK1_DIS | | 
| @@ -268,7 +269,7 @@ static void sky2_power_on(struct sky2_hw *hw) | |||
| 268 | 269 | ||
| 269 | static void sky2_power_aux(struct sky2_hw *hw) | 270 | static void sky2_power_aux(struct sky2_hw *hw) | 
| 270 | { | 271 | { | 
| 271 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) | 272 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > CHIP_REV_YU_XL_A1) | 
| 272 | sky2_write8(hw, B2_Y2_CLK_GATE, 0); | 273 | sky2_write8(hw, B2_Y2_CLK_GATE, 0); | 
| 273 | else | 274 | else | 
| 274 | /* enable bits are inverted */ | 275 | /* enable bits are inverted */ | 
| @@ -651,7 +652,7 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port) | |||
| 651 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); | 652 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); | 
| 652 | reg1 &= ~phy_power[port]; | 653 | reg1 &= ~phy_power[port]; | 
| 653 | 654 | ||
| 654 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1) | 655 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > CHIP_REV_YU_XL_A1) | 
| 655 | reg1 |= coma_mode[port]; | 656 | reg1 |= coma_mode[port]; | 
| 656 | 657 | ||
| 657 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); | 658 | sky2_pci_write32(hw, PCI_DEV_REG1, reg1); | 
| @@ -823,7 +824,9 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
| 823 | 824 | ||
| 824 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); | 825 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); | 
| 825 | 826 | ||
| 826 | if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 && port == 1) { | 827 | if (hw->chip_id == CHIP_ID_YUKON_XL && | 
| 828 | hw->chip_rev == CHIP_REV_YU_XL_A0 && | ||
| 829 | port == 1) { | ||
| 827 | /* WA DEV_472 -- looks like crossed wires on port 2 */ | 830 | /* WA DEV_472 -- looks like crossed wires on port 2 */ | 
| 828 | /* clear GMAC 1 Control reset */ | 831 | /* clear GMAC 1 Control reset */ | 
| 829 | sky2_write8(hw, SK_REG(0, GMAC_CTRL), GMC_RST_CLR); | 832 | sky2_write8(hw, SK_REG(0, GMAC_CTRL), GMC_RST_CLR); | 
| @@ -877,6 +880,10 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
| 877 | if (hw->dev[port]->mtu > ETH_DATA_LEN) | 880 | if (hw->dev[port]->mtu > ETH_DATA_LEN) | 
| 878 | reg |= GM_SMOD_JUMBO_ENA; | 881 | reg |= GM_SMOD_JUMBO_ENA; | 
| 879 | 882 | ||
| 883 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && | ||
| 884 | hw->chip_rev == CHIP_REV_YU_EC_U_B1) | ||
| 885 | reg |= GM_NEW_FLOW_CTRL; | ||
| 886 | |||
| 880 | gma_write16(hw, port, GM_SERIAL_MODE, reg); | 887 | gma_write16(hw, port, GM_SERIAL_MODE, reg); | 
| 881 | 888 | ||
| 882 | /* virtual address for data */ | 889 | /* virtual address for data */ | 
| @@ -1413,8 +1420,7 @@ static void sky2_rx_start(struct sky2_port *sky2) | |||
| 1413 | /* These chips have no ram buffer? | 1420 | /* These chips have no ram buffer? | 
| 1414 | * MAC Rx RAM Read is controlled by hardware */ | 1421 | * MAC Rx RAM Read is controlled by hardware */ | 
| 1415 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && | 1422 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && | 
| 1416 | (hw->chip_rev == CHIP_REV_YU_EC_U_A1 || | 1423 | hw->chip_rev > CHIP_REV_YU_EC_U_A0) | 
| 1417 | hw->chip_rev == CHIP_REV_YU_EC_U_B0)) | ||
| 1418 | sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS); | 1424 | sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS); | 
| 1419 | 1425 | ||
| 1420 | sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); | 1426 | sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); | 
| @@ -2141,7 +2147,8 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port) | |||
| 2141 | istatus, phystat); | 2147 | istatus, phystat); | 
| 2142 | 2148 | ||
| 2143 | if (istatus & PHY_M_IS_AN_COMPL) { | 2149 | if (istatus & PHY_M_IS_AN_COMPL) { | 
| 2144 | if (sky2_autoneg_done(sky2, phystat) == 0) | 2150 | if (sky2_autoneg_done(sky2, phystat) == 0 && | 
| 2151 | !netif_carrier_ok(dev)) | ||
| 2145 | sky2_link_up(sky2); | 2152 | sky2_link_up(sky2); | 
| 2146 | goto out; | 2153 | goto out; | 
| 2147 | } | 2154 | } | 
| @@ -3621,7 +3628,7 @@ static void sky2_set_multicast(struct net_device *dev) | |||
| 3621 | struct sky2_port *sky2 = netdev_priv(dev); | 3628 | struct sky2_port *sky2 = netdev_priv(dev); | 
| 3622 | struct sky2_hw *hw = sky2->hw; | 3629 | struct sky2_hw *hw = sky2->hw; | 
| 3623 | unsigned port = sky2->port; | 3630 | unsigned port = sky2->port; | 
| 3624 | struct dev_mc_list *list; | 3631 | struct netdev_hw_addr *ha; | 
| 3625 | u16 reg; | 3632 | u16 reg; | 
| 3626 | u8 filter[8]; | 3633 | u8 filter[8]; | 
| 3627 | int rx_pause; | 3634 | int rx_pause; | 
| @@ -3645,8 +3652,8 @@ static void sky2_set_multicast(struct net_device *dev) | |||
| 3645 | if (rx_pause) | 3652 | if (rx_pause) | 
| 3646 | sky2_add_filter(filter, pause_mc_addr); | 3653 | sky2_add_filter(filter, pause_mc_addr); | 
| 3647 | 3654 | ||
| 3648 | netdev_for_each_mc_addr(list, dev) | 3655 | netdev_for_each_mc_addr(ha, dev) | 
| 3649 | sky2_add_filter(filter, list->dmi_addr); | 3656 | sky2_add_filter(filter, ha->addr); | 
| 3650 | } | 3657 | } | 
| 3651 | 3658 | ||
| 3652 | gma_write16(hw, port, GM_MC_ADDR_H1, | 3659 | gma_write16(hw, port, GM_MC_ADDR_H1, | 
