diff options
author | David S. Miller <davem@davemloft.net> | 2011-10-24 18:18:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-24 18:18:09 -0400 |
commit | 1805b2f04855f07afe3a71d620a68f483b0ed74f (patch) | |
tree | b823b90f37f5404fcaef70f785c70112ca74a329 /drivers/net/ethernet | |
parent | 78d81d15b74246c7cedf84894434890b33da3907 (diff) | |
parent | f42af6c486aa5ca6ee62800cb45c5b252020509d (diff) |
Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 18 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/jme.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 90 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 2 |
7 files changed, 86 insertions, 48 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 2f92487724c6..627a5807836d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -234,13 +234,19 @@ do { \ | |||
234 | * FUNC_N_CLID_X = N * NUM_SPECIAL_CLIENTS + FUNC_0_CLID_X | 234 | * FUNC_N_CLID_X = N * NUM_SPECIAL_CLIENTS + FUNC_0_CLID_X |
235 | * | 235 | * |
236 | */ | 236 | */ |
237 | /* iSCSI L2 */ | 237 | enum { |
238 | #define BNX2X_ISCSI_ETH_CL_ID_IDX 1 | 238 | BNX2X_ISCSI_ETH_CL_ID_IDX, |
239 | #define BNX2X_ISCSI_ETH_CID 49 | 239 | BNX2X_FCOE_ETH_CL_ID_IDX, |
240 | BNX2X_MAX_CNIC_ETH_CL_ID_IDX, | ||
241 | }; | ||
240 | 242 | ||
241 | /* FCoE L2 */ | 243 | #define BNX2X_CNIC_START_ETH_CID 48 |
242 | #define BNX2X_FCOE_ETH_CL_ID_IDX 2 | 244 | enum { |
243 | #define BNX2X_FCOE_ETH_CID 50 | 245 | /* iSCSI L2 */ |
246 | BNX2X_ISCSI_ETH_CID = BNX2X_CNIC_START_ETH_CID, | ||
247 | /* FCoE L2 */ | ||
248 | BNX2X_FCOE_ETH_CID, | ||
249 | }; | ||
244 | 250 | ||
245 | /** Additional rings budgeting */ | 251 | /** Additional rings budgeting */ |
246 | #ifdef BCM_CNIC | 252 | #ifdef BCM_CNIC |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index 5b1f9b5ec499..283d663da180 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -1297,7 +1297,7 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp, | |||
1297 | static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx) | 1297 | static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx) |
1298 | { | 1298 | { |
1299 | return bp->cnic_base_cl_id + cl_idx + | 1299 | return bp->cnic_base_cl_id + cl_idx + |
1300 | (bp->pf_num >> 1) * NON_ETH_CONTEXT_USE; | 1300 | (bp->pf_num >> 1) * BNX2X_MAX_CNIC_ETH_CL_ID_IDX; |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | static inline u8 bnx2x_cnic_fw_sb_id(struct bnx2x *bp) | 1303 | static inline u8 bnx2x_cnic_fw_sb_id(struct bnx2x *bp) |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index b89027c61937..b865e9fdd089 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -6529,12 +6529,12 @@ static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last) | |||
6529 | 6529 | ||
6530 | /* Workaround 4GB and 40-bit hardware DMA bugs. */ | 6530 | /* Workaround 4GB and 40-bit hardware DMA bugs. */ |
6531 | static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, | 6531 | static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, |
6532 | struct sk_buff *skb, | 6532 | struct sk_buff **pskb, |
6533 | u32 *entry, u32 *budget, | 6533 | u32 *entry, u32 *budget, |
6534 | u32 base_flags, u32 mss, u32 vlan) | 6534 | u32 base_flags, u32 mss, u32 vlan) |
6535 | { | 6535 | { |
6536 | struct tg3 *tp = tnapi->tp; | 6536 | struct tg3 *tp = tnapi->tp; |
6537 | struct sk_buff *new_skb; | 6537 | struct sk_buff *new_skb, *skb = *pskb; |
6538 | dma_addr_t new_addr = 0; | 6538 | dma_addr_t new_addr = 0; |
6539 | int ret = 0; | 6539 | int ret = 0; |
6540 | 6540 | ||
@@ -6576,7 +6576,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, | |||
6576 | } | 6576 | } |
6577 | 6577 | ||
6578 | dev_kfree_skb(skb); | 6578 | dev_kfree_skb(skb); |
6579 | 6579 | *pskb = new_skb; | |
6580 | return ret; | 6580 | return ret; |
6581 | } | 6581 | } |
6582 | 6582 | ||
@@ -6803,7 +6803,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6803 | */ | 6803 | */ |
6804 | entry = tnapi->tx_prod; | 6804 | entry = tnapi->tx_prod; |
6805 | budget = tg3_tx_avail(tnapi); | 6805 | budget = tg3_tx_avail(tnapi); |
6806 | if (tigon3_dma_hwbug_workaround(tnapi, skb, &entry, &budget, | 6806 | if (tigon3_dma_hwbug_workaround(tnapi, &skb, &entry, &budget, |
6807 | base_flags, mss, vlan)) | 6807 | base_flags, mss, vlan)) |
6808 | goto out_unlock; | 6808 | goto out_unlock; |
6809 | } | 6809 | } |
@@ -15668,7 +15668,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev) | |||
15668 | 15668 | ||
15669 | cancel_work_sync(&tp->reset_task); | 15669 | cancel_work_sync(&tp->reset_task); |
15670 | 15670 | ||
15671 | if (!tg3_flag(tp, USE_PHYLIB)) { | 15671 | if (tg3_flag(tp, USE_PHYLIB)) { |
15672 | tg3_phy_fini(tp); | 15672 | tg3_phy_fini(tp); |
15673 | tg3_mdio_fini(tp); | 15673 | tg3_mdio_fini(tp); |
15674 | } | 15674 | } |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 7a0c746f2749..7becff1f387d 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
@@ -3132,6 +3132,9 @@ jme_suspend(struct device *dev) | |||
3132 | struct net_device *netdev = pci_get_drvdata(pdev); | 3132 | struct net_device *netdev = pci_get_drvdata(pdev); |
3133 | struct jme_adapter *jme = netdev_priv(netdev); | 3133 | struct jme_adapter *jme = netdev_priv(netdev); |
3134 | 3134 | ||
3135 | if (!netif_running(netdev)) | ||
3136 | return 0; | ||
3137 | |||
3135 | atomic_dec(&jme->link_changing); | 3138 | atomic_dec(&jme->link_changing); |
3136 | 3139 | ||
3137 | netif_device_detach(netdev); | 3140 | netif_device_detach(netdev); |
@@ -3172,6 +3175,9 @@ jme_resume(struct device *dev) | |||
3172 | struct net_device *netdev = pci_get_drvdata(pdev); | 3175 | struct net_device *netdev = pci_get_drvdata(pdev); |
3173 | struct jme_adapter *jme = netdev_priv(netdev); | 3176 | struct jme_adapter *jme = netdev_priv(netdev); |
3174 | 3177 | ||
3178 | if (!netif_running(netdev)) | ||
3179 | return 0; | ||
3180 | |||
3175 | jme_clear_pm(jme); | 3181 | jme_clear_pm(jme); |
3176 | jme_phy_on(jme); | 3182 | jme_phy_on(jme); |
3177 | if (test_bit(JME_FLAG_SSET, &jme->flags)) | 3183 | if (test_bit(JME_FLAG_SSET, &jme->flags)) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 75338eb88e88..90f2cd24faac 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c | |||
@@ -172,7 +172,7 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv, | |||
172 | memset(ring->buf, 0, ring->buf_size); | 172 | memset(ring->buf, 0, ring->buf_size); |
173 | 173 | ||
174 | ring->qp_state = MLX4_QP_STATE_RST; | 174 | ring->qp_state = MLX4_QP_STATE_RST; |
175 | ring->doorbell_qpn = swab32(ring->qp.qpn << 8); | 175 | ring->doorbell_qpn = ring->qp.qpn << 8; |
176 | 176 | ||
177 | mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn, | 177 | mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn, |
178 | ring->cqn, &ring->context); | 178 | ring->cqn, &ring->context); |
@@ -779,7 +779,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
779 | skb_orphan(skb); | 779 | skb_orphan(skb); |
780 | 780 | ||
781 | if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) { | 781 | if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) { |
782 | *(u32 *) (&tx_desc->ctrl.vlan_tag) |= ring->doorbell_qpn; | 782 | *(__be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn); |
783 | op_own |= htonl((bf_index & 0xffff) << 8); | 783 | op_own |= htonl((bf_index & 0xffff) << 8); |
784 | /* Ensure new descirptor hits memory | 784 | /* Ensure new descirptor hits memory |
785 | * before setting ownership of this descriptor to HW */ | 785 | * before setting ownership of this descriptor to HW */ |
@@ -800,7 +800,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
800 | wmb(); | 800 | wmb(); |
801 | tx_desc->ctrl.owner_opcode = op_own; | 801 | tx_desc->ctrl.owner_opcode = op_own; |
802 | wmb(); | 802 | wmb(); |
803 | writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL); | 803 | iowrite32be(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL); |
804 | } | 804 | } |
805 | 805 | ||
806 | /* Poll CQ here */ | 806 | /* Poll CQ here */ |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index aa39e771175c..92b45f08858f 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -2937,7 +2937,7 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp) | |||
2937 | rtl_writephy(tp, 0x1f, 0x0004); | 2937 | rtl_writephy(tp, 0x1f, 0x0004); |
2938 | rtl_writephy(tp, 0x1f, 0x0007); | 2938 | rtl_writephy(tp, 0x1f, 0x0007); |
2939 | rtl_writephy(tp, 0x1e, 0x0020); | 2939 | rtl_writephy(tp, 0x1e, 0x0020); |
2940 | rtl_w1w0_phy(tp, 0x06, 0x0000, 0x0100); | 2940 | rtl_w1w0_phy(tp, 0x15, 0x0000, 0x0100); |
2941 | rtl_writephy(tp, 0x1f, 0x0002); | 2941 | rtl_writephy(tp, 0x1f, 0x0002); |
2942 | rtl_writephy(tp, 0x1f, 0x0000); | 2942 | rtl_writephy(tp, 0x1f, 0x0000); |
2943 | rtl_writephy(tp, 0x0d, 0x0007); | 2943 | rtl_writephy(tp, 0x0d, 0x0007); |
@@ -3491,6 +3491,37 @@ static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp) | |||
3491 | } | 3491 | } |
3492 | } | 3492 | } |
3493 | 3493 | ||
3494 | static void rtl_wol_suspend_quirk(struct rtl8169_private *tp) | ||
3495 | { | ||
3496 | void __iomem *ioaddr = tp->mmio_addr; | ||
3497 | |||
3498 | switch (tp->mac_version) { | ||
3499 | case RTL_GIGA_MAC_VER_29: | ||
3500 | case RTL_GIGA_MAC_VER_30: | ||
3501 | case RTL_GIGA_MAC_VER_32: | ||
3502 | case RTL_GIGA_MAC_VER_33: | ||
3503 | case RTL_GIGA_MAC_VER_34: | ||
3504 | RTL_W32(RxConfig, RTL_R32(RxConfig) | | ||
3505 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys); | ||
3506 | break; | ||
3507 | default: | ||
3508 | break; | ||
3509 | } | ||
3510 | } | ||
3511 | |||
3512 | static bool rtl_wol_pll_power_down(struct rtl8169_private *tp) | ||
3513 | { | ||
3514 | if (!(__rtl8169_get_wol(tp) & WAKE_ANY)) | ||
3515 | return false; | ||
3516 | |||
3517 | rtl_writephy(tp, 0x1f, 0x0000); | ||
3518 | rtl_writephy(tp, MII_BMCR, 0x0000); | ||
3519 | |||
3520 | rtl_wol_suspend_quirk(tp); | ||
3521 | |||
3522 | return true; | ||
3523 | } | ||
3524 | |||
3494 | static void r810x_phy_power_down(struct rtl8169_private *tp) | 3525 | static void r810x_phy_power_down(struct rtl8169_private *tp) |
3495 | { | 3526 | { |
3496 | rtl_writephy(tp, 0x1f, 0x0000); | 3527 | rtl_writephy(tp, 0x1f, 0x0000); |
@@ -3505,18 +3536,8 @@ static void r810x_phy_power_up(struct rtl8169_private *tp) | |||
3505 | 3536 | ||
3506 | static void r810x_pll_power_down(struct rtl8169_private *tp) | 3537 | static void r810x_pll_power_down(struct rtl8169_private *tp) |
3507 | { | 3538 | { |
3508 | void __iomem *ioaddr = tp->mmio_addr; | 3539 | if (rtl_wol_pll_power_down(tp)) |
3509 | |||
3510 | if (__rtl8169_get_wol(tp) & WAKE_ANY) { | ||
3511 | rtl_writephy(tp, 0x1f, 0x0000); | ||
3512 | rtl_writephy(tp, MII_BMCR, 0x0000); | ||
3513 | |||
3514 | if (tp->mac_version == RTL_GIGA_MAC_VER_29 || | ||
3515 | tp->mac_version == RTL_GIGA_MAC_VER_30) | ||
3516 | RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | | ||
3517 | AcceptMulticast | AcceptMyPhys); | ||
3518 | return; | 3540 | return; |
3519 | } | ||
3520 | 3541 | ||
3521 | r810x_phy_power_down(tp); | 3542 | r810x_phy_power_down(tp); |
3522 | } | 3543 | } |
@@ -3605,17 +3626,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) | |||
3605 | tp->mac_version == RTL_GIGA_MAC_VER_33) | 3626 | tp->mac_version == RTL_GIGA_MAC_VER_33) |
3606 | rtl_ephy_write(ioaddr, 0x19, 0xff64); | 3627 | rtl_ephy_write(ioaddr, 0x19, 0xff64); |
3607 | 3628 | ||
3608 | if (__rtl8169_get_wol(tp) & WAKE_ANY) { | 3629 | if (rtl_wol_pll_power_down(tp)) |
3609 | rtl_writephy(tp, 0x1f, 0x0000); | ||
3610 | rtl_writephy(tp, MII_BMCR, 0x0000); | ||
3611 | |||
3612 | if (tp->mac_version == RTL_GIGA_MAC_VER_32 || | ||
3613 | tp->mac_version == RTL_GIGA_MAC_VER_33 || | ||
3614 | tp->mac_version == RTL_GIGA_MAC_VER_34) | ||
3615 | RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | | ||
3616 | AcceptMulticast | AcceptMyPhys); | ||
3617 | return; | 3630 | return; |
3618 | } | ||
3619 | 3631 | ||
3620 | r8168_phy_power_down(tp); | 3632 | r8168_phy_power_down(tp); |
3621 | 3633 | ||
@@ -6161,11 +6173,30 @@ static const struct dev_pm_ops rtl8169_pm_ops = { | |||
6161 | 6173 | ||
6162 | #endif /* !CONFIG_PM */ | 6174 | #endif /* !CONFIG_PM */ |
6163 | 6175 | ||
6176 | static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp) | ||
6177 | { | ||
6178 | void __iomem *ioaddr = tp->mmio_addr; | ||
6179 | |||
6180 | /* WoL fails with 8168b when the receiver is disabled. */ | ||
6181 | switch (tp->mac_version) { | ||
6182 | case RTL_GIGA_MAC_VER_11: | ||
6183 | case RTL_GIGA_MAC_VER_12: | ||
6184 | case RTL_GIGA_MAC_VER_17: | ||
6185 | pci_clear_master(tp->pci_dev); | ||
6186 | |||
6187 | RTL_W8(ChipCmd, CmdRxEnb); | ||
6188 | /* PCI commit */ | ||
6189 | RTL_R8(ChipCmd); | ||
6190 | break; | ||
6191 | default: | ||
6192 | break; | ||
6193 | } | ||
6194 | } | ||
6195 | |||
6164 | static void rtl_shutdown(struct pci_dev *pdev) | 6196 | static void rtl_shutdown(struct pci_dev *pdev) |
6165 | { | 6197 | { |
6166 | struct net_device *dev = pci_get_drvdata(pdev); | 6198 | struct net_device *dev = pci_get_drvdata(pdev); |
6167 | struct rtl8169_private *tp = netdev_priv(dev); | 6199 | struct rtl8169_private *tp = netdev_priv(dev); |
6168 | void __iomem *ioaddr = tp->mmio_addr; | ||
6169 | 6200 | ||
6170 | rtl8169_net_suspend(dev); | 6201 | rtl8169_net_suspend(dev); |
6171 | 6202 | ||
@@ -6179,16 +6210,9 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
6179 | spin_unlock_irq(&tp->lock); | 6210 | spin_unlock_irq(&tp->lock); |
6180 | 6211 | ||
6181 | if (system_state == SYSTEM_POWER_OFF) { | 6212 | if (system_state == SYSTEM_POWER_OFF) { |
6182 | /* WoL fails with 8168b when the receiver is disabled. */ | 6213 | if (__rtl8169_get_wol(tp) & WAKE_ANY) { |
6183 | if ((tp->mac_version == RTL_GIGA_MAC_VER_11 || | 6214 | rtl_wol_suspend_quirk(tp); |
6184 | tp->mac_version == RTL_GIGA_MAC_VER_12 || | 6215 | rtl_wol_shutdown_quirk(tp); |
6185 | tp->mac_version == RTL_GIGA_MAC_VER_17) && | ||
6186 | (tp->features & RTL_FEATURE_WOL)) { | ||
6187 | pci_clear_master(pdev); | ||
6188 | |||
6189 | RTL_W8(ChipCmd, CmdRxEnb); | ||
6190 | /* PCI commit */ | ||
6191 | RTL_R8(ChipCmd); | ||
6192 | } | 6216 | } |
6193 | 6217 | ||
6194 | pci_wake_from_d3(pdev, true); | 6218 | pci_wake_from_d3(pdev, true); |
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index a3aa4c0e87f3..d2be42aafbef 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -26,6 +26,7 @@ | |||
26 | * LAN9215, LAN9216, LAN9217, LAN9218 | 26 | * LAN9215, LAN9216, LAN9217, LAN9218 |
27 | * LAN9210, LAN9211 | 27 | * LAN9210, LAN9211 |
28 | * LAN9220, LAN9221 | 28 | * LAN9220, LAN9221 |
29 | * LAN89218 | ||
29 | * | 30 | * |
30 | */ | 31 | */ |
31 | 32 | ||
@@ -1987,6 +1988,7 @@ static int __devinit smsc911x_init(struct net_device *dev) | |||
1987 | case 0x01170000: | 1988 | case 0x01170000: |
1988 | case 0x01160000: | 1989 | case 0x01160000: |
1989 | case 0x01150000: | 1990 | case 0x01150000: |
1991 | case 0x218A0000: | ||
1990 | /* LAN911[5678] family */ | 1992 | /* LAN911[5678] family */ |
1991 | pdata->generation = pdata->idrev & 0x0000FFFF; | 1993 | pdata->generation = pdata->idrev & 0x0000FFFF; |
1992 | break; | 1994 | break; |