diff options
-rw-r--r-- | drivers/net/sky2.c | 27 | ||||
-rw-r--r-- | drivers/net/sky2.h | 2 |
2 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index f3a8243219ae..0792031a5cf9 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -826,7 +826,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
826 | sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); | 826 | sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); |
827 | sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); | 827 | sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); |
828 | 828 | ||
829 | if (!(hw->flags & SKY2_HW_RAMBUFFER)) { | 829 | /* On chips without ram buffer, pause is controled by MAC level */ |
830 | if (sky2_read8(hw, B2_E_0) == 0) { | ||
830 | sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); | 831 | sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); |
831 | sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); | 832 | sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); |
832 | 833 | ||
@@ -1281,7 +1282,7 @@ static int sky2_up(struct net_device *dev) | |||
1281 | struct sky2_port *sky2 = netdev_priv(dev); | 1282 | struct sky2_port *sky2 = netdev_priv(dev); |
1282 | struct sky2_hw *hw = sky2->hw; | 1283 | struct sky2_hw *hw = sky2->hw; |
1283 | unsigned port = sky2->port; | 1284 | unsigned port = sky2->port; |
1284 | u32 imask; | 1285 | u32 imask, ramsize; |
1285 | int cap, err = -ENOMEM; | 1286 | int cap, err = -ENOMEM; |
1286 | struct net_device *otherdev = hw->dev[sky2->port^1]; | 1287 | struct net_device *otherdev = hw->dev[sky2->port^1]; |
1287 | 1288 | ||
@@ -1336,13 +1337,12 @@ static int sky2_up(struct net_device *dev) | |||
1336 | 1337 | ||
1337 | sky2_mac_init(hw, port); | 1338 | sky2_mac_init(hw, port); |
1338 | 1339 | ||
1339 | if (hw->flags & SKY2_HW_RAMBUFFER) { | 1340 | /* Register is number of 4K blocks on internal RAM buffer. */ |
1340 | /* Register is number of 4K blocks on internal RAM buffer. */ | 1341 | ramsize = sky2_read8(hw, B2_E_0) * 4; |
1341 | u32 ramsize = sky2_read8(hw, B2_E_0) * 4; | 1342 | if (ramsize > 0) { |
1342 | u32 rxspace; | 1343 | u32 rxspace; |
1343 | 1344 | ||
1344 | printk(KERN_DEBUG PFX "%s: ram buffer %dK\n", dev->name, ramsize); | 1345 | pr_debug(PFX "%s: ram buffer %dK\n", dev->name, ramsize); |
1345 | |||
1346 | if (ramsize < 16) | 1346 | if (ramsize < 16) |
1347 | rxspace = ramsize / 2; | 1347 | rxspace = ramsize / 2; |
1348 | else | 1348 | else |
@@ -2005,7 +2005,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
2005 | 2005 | ||
2006 | synchronize_irq(hw->pdev->irq); | 2006 | synchronize_irq(hw->pdev->irq); |
2007 | 2007 | ||
2008 | if (!(hw->flags & SKY2_HW_RAMBUFFER)) | 2008 | if (sky2_read8(hw, B2_E_0) == 0) |
2009 | sky2_set_tx_stfwd(hw, port); | 2009 | sky2_set_tx_stfwd(hw, port); |
2010 | 2010 | ||
2011 | ctl = gma_read16(hw, port, GM_GP_CTRL); | 2011 | ctl = gma_read16(hw, port, GM_GP_CTRL); |
@@ -2536,7 +2536,7 @@ static void sky2_watchdog(unsigned long arg) | |||
2536 | ++active; | 2536 | ++active; |
2537 | 2537 | ||
2538 | /* For chips with Rx FIFO, check if stuck */ | 2538 | /* For chips with Rx FIFO, check if stuck */ |
2539 | if ((hw->flags & SKY2_HW_RAMBUFFER) && | 2539 | if ((hw->flags & SKY2_HW_FIFO_HANG_CHECK) && |
2540 | sky2_rx_hung(dev)) { | 2540 | sky2_rx_hung(dev)) { |
2541 | pr_info(PFX "%s: receiver hang detected\n", | 2541 | pr_info(PFX "%s: receiver hang detected\n", |
2542 | dev->name); | 2542 | dev->name); |
@@ -2694,8 +2694,10 @@ static int __devinit sky2_init(struct sky2_hw *hw) | |||
2694 | switch(hw->chip_id) { | 2694 | switch(hw->chip_id) { |
2695 | case CHIP_ID_YUKON_XL: | 2695 | case CHIP_ID_YUKON_XL: |
2696 | hw->flags = SKY2_HW_GIGABIT | 2696 | hw->flags = SKY2_HW_GIGABIT |
2697 | | SKY2_HW_NEWER_PHY | 2697 | | SKY2_HW_NEWER_PHY; |
2698 | | SKY2_HW_RAMBUFFER; | 2698 | if (hw->chip_rev < 3) |
2699 | hw->flags |= SKY2_HW_FIFO_HANG_CHECK; | ||
2700 | |||
2699 | break; | 2701 | break; |
2700 | 2702 | ||
2701 | case CHIP_ID_YUKON_EC_U: | 2703 | case CHIP_ID_YUKON_EC_U: |
@@ -2721,11 +2723,10 @@ static int __devinit sky2_init(struct sky2_hw *hw) | |||
2721 | dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n"); | 2723 | dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n"); |
2722 | return -EOPNOTSUPP; | 2724 | return -EOPNOTSUPP; |
2723 | } | 2725 | } |
2724 | hw->flags = SKY2_HW_GIGABIT | SKY2_HW_RAMBUFFER; | 2726 | hw->flags = SKY2_HW_GIGABIT | SKY2_HW_FIFO_HANG_CHECK; |
2725 | break; | 2727 | break; |
2726 | 2728 | ||
2727 | case CHIP_ID_YUKON_FE: | 2729 | case CHIP_ID_YUKON_FE: |
2728 | hw->flags = SKY2_HW_RAMBUFFER; | ||
2729 | break; | 2730 | break; |
2730 | 2731 | ||
2731 | case CHIP_ID_YUKON_FE_P: | 2732 | case CHIP_ID_YUKON_FE_P: |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 69cd98400fe6..8bc5c54e3efa 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -2063,7 +2063,7 @@ struct sky2_hw { | |||
2063 | #define SKY2_HW_FIBRE_PHY 0x00000002 | 2063 | #define SKY2_HW_FIBRE_PHY 0x00000002 |
2064 | #define SKY2_HW_GIGABIT 0x00000004 | 2064 | #define SKY2_HW_GIGABIT 0x00000004 |
2065 | #define SKY2_HW_NEWER_PHY 0x00000008 | 2065 | #define SKY2_HW_NEWER_PHY 0x00000008 |
2066 | #define SKY2_HW_RAMBUFFER 0x00000010 /* chip has RAM FIFO */ | 2066 | #define SKY2_HW_FIFO_HANG_CHECK 0x00000010 |
2067 | #define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */ | 2067 | #define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */ |
2068 | #define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */ | 2068 | #define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */ |
2069 | #define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */ | 2069 | #define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */ |