diff options
Diffstat (limited to 'drivers/net/ethernet')
44 files changed, 263 insertions, 251 deletions
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index 8153a3e0a1a4..f9b74c0a8492 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c | |||
@@ -1842,7 +1842,7 @@ vortex_timer(unsigned long data) | |||
1842 | ok = 1; | 1842 | ok = 1; |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | if (!netif_carrier_ok(dev)) | 1845 | if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev)) |
1846 | next_tick = 5*HZ; | 1846 | next_tick = 5*HZ; |
1847 | 1847 | ||
1848 | if (vp->medialock) | 1848 | if (vp->medialock) |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index b8591246eb4c..47a9bb2c813c 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -1710,7 +1710,7 @@ static irqreturn_t atl1c_intr(int irq, void *data) | |||
1710 | "atl1c hardware error (status = 0x%x)\n", | 1710 | "atl1c hardware error (status = 0x%x)\n", |
1711 | status & ISR_ERROR); | 1711 | status & ISR_ERROR); |
1712 | /* reset MAC */ | 1712 | /* reset MAC */ |
1713 | adapter->work_event |= ATL1C_WORK_EVENT_RESET; | 1713 | set_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event); |
1714 | schedule_work(&adapter->common_task); | 1714 | schedule_work(&adapter->common_task); |
1715 | return IRQ_HANDLED; | 1715 | return IRQ_HANDLED; |
1716 | } | 1716 | } |
@@ -2244,10 +2244,6 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb, | |||
2244 | dev_info(&adapter->pdev->dev, "tx locked\n"); | 2244 | dev_info(&adapter->pdev->dev, "tx locked\n"); |
2245 | return NETDEV_TX_LOCKED; | 2245 | return NETDEV_TX_LOCKED; |
2246 | } | 2246 | } |
2247 | if (skb->mark == 0x01) | ||
2248 | type = atl1c_trans_high; | ||
2249 | else | ||
2250 | type = atl1c_trans_normal; | ||
2251 | 2247 | ||
2252 | if (atl1c_tpd_avail(adapter, type) < tpd_req) { | 2248 | if (atl1c_tpd_avail(adapter, type) < tpd_req) { |
2253 | /* no enough descriptor, just stop queue */ | 2249 | /* no enough descriptor, just stop queue */ |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 3fb66d09ece5..cab87456a34a 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
@@ -2339,7 +2339,7 @@ static inline int __init b44_pci_init(void) | |||
2339 | return err; | 2339 | return err; |
2340 | } | 2340 | } |
2341 | 2341 | ||
2342 | static inline void __exit b44_pci_exit(void) | 2342 | static inline void b44_pci_exit(void) |
2343 | { | 2343 | { |
2344 | #ifdef CONFIG_B44_PCI | 2344 | #ifdef CONFIG_B44_PCI |
2345 | ssb_pcihost_unregister(&b44_pci_driver); | 2345 | ssb_pcihost_unregister(&b44_pci_driver); |
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 986019b2c849..c7ca7ec065ee 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c | |||
@@ -797,7 +797,7 @@ static int bcm_enet_open(struct net_device *dev) | |||
797 | if (priv->has_phy) { | 797 | if (priv->has_phy) { |
798 | /* connect to PHY */ | 798 | /* connect to PHY */ |
799 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, | 799 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, |
800 | priv->mac_id ? "1" : "0", priv->phy_id); | 800 | priv->mii_bus->id, priv->phy_id); |
801 | 801 | ||
802 | phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0, | 802 | phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0, |
803 | PHY_INTERFACE_MODE_MII); | 803 | PHY_INTERFACE_MODE_MII); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 1e3f978ee6da..254521319150 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -117,10 +117,6 @@ static int dropless_fc; | |||
117 | module_param(dropless_fc, int, 0); | 117 | module_param(dropless_fc, int, 0); |
118 | MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring"); | 118 | MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring"); |
119 | 119 | ||
120 | static int poll; | ||
121 | module_param(poll, int, 0); | ||
122 | MODULE_PARM_DESC(poll, " Use polling (for debug)"); | ||
123 | |||
124 | static int mrrs = -1; | 120 | static int mrrs = -1; |
125 | module_param(mrrs, int, 0); | 121 | module_param(mrrs, int, 0); |
126 | MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)"); | 122 | MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)"); |
@@ -4834,20 +4830,11 @@ void bnx2x_drv_pulse(struct bnx2x *bp) | |||
4834 | 4830 | ||
4835 | static void bnx2x_timer(unsigned long data) | 4831 | static void bnx2x_timer(unsigned long data) |
4836 | { | 4832 | { |
4837 | u8 cos; | ||
4838 | struct bnx2x *bp = (struct bnx2x *) data; | 4833 | struct bnx2x *bp = (struct bnx2x *) data; |
4839 | 4834 | ||
4840 | if (!netif_running(bp->dev)) | 4835 | if (!netif_running(bp->dev)) |
4841 | return; | 4836 | return; |
4842 | 4837 | ||
4843 | if (poll) { | ||
4844 | struct bnx2x_fastpath *fp = &bp->fp[0]; | ||
4845 | |||
4846 | for_each_cos_in_tx_queue(fp, cos) | ||
4847 | bnx2x_tx_int(bp, &fp->txdata[cos]); | ||
4848 | bnx2x_rx_int(fp, 1000); | ||
4849 | } | ||
4850 | |||
4851 | if (!BP_NOMCP(bp)) { | 4838 | if (!BP_NOMCP(bp)) { |
4852 | int mb_idx = BP_FW_MB_IDX(bp); | 4839 | int mb_idx = BP_FW_MB_IDX(bp); |
4853 | u32 drv_pulse; | 4840 | u32 drv_pulse; |
@@ -10063,7 +10050,6 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp) | |||
10063 | static int __devinit bnx2x_init_bp(struct bnx2x *bp) | 10050 | static int __devinit bnx2x_init_bp(struct bnx2x *bp) |
10064 | { | 10051 | { |
10065 | int func; | 10052 | int func; |
10066 | int timer_interval; | ||
10067 | int rc; | 10053 | int rc; |
10068 | 10054 | ||
10069 | mutex_init(&bp->port.phy_mutex); | 10055 | mutex_init(&bp->port.phy_mutex); |
@@ -10139,8 +10125,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
10139 | bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR; | 10125 | bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR; |
10140 | bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR; | 10126 | bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR; |
10141 | 10127 | ||
10142 | timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ); | 10128 | bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ; |
10143 | bp->current_interval = (poll ? poll : timer_interval); | ||
10144 | 10129 | ||
10145 | init_timer(&bp->timer); | 10130 | init_timer(&bp->timer); |
10146 | bp->timer.expires = jiffies + bp->current_interval; | 10131 | bp->timer.expires = jiffies + bp->current_interval; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c index bc0121ac291e..1adef266fcd5 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | |||
@@ -1081,17 +1081,17 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
1081 | estats->rx_stat_ifhcinbadoctets_lo); | 1081 | estats->rx_stat_ifhcinbadoctets_lo); |
1082 | 1082 | ||
1083 | ADD_64(fstats->total_bytes_received_hi, | 1083 | ADD_64(fstats->total_bytes_received_hi, |
1084 | tfunc->rcv_error_bytes.hi, | 1084 | le32_to_cpu(tfunc->rcv_error_bytes.hi), |
1085 | fstats->total_bytes_received_lo, | 1085 | fstats->total_bytes_received_lo, |
1086 | tfunc->rcv_error_bytes.lo); | 1086 | le32_to_cpu(tfunc->rcv_error_bytes.lo)); |
1087 | 1087 | ||
1088 | memcpy(estats, &(fstats->total_bytes_received_hi), | 1088 | memcpy(estats, &(fstats->total_bytes_received_hi), |
1089 | sizeof(struct host_func_stats) - 2*sizeof(u32)); | 1089 | sizeof(struct host_func_stats) - 2*sizeof(u32)); |
1090 | 1090 | ||
1091 | ADD_64(estats->error_bytes_received_hi, | 1091 | ADD_64(estats->error_bytes_received_hi, |
1092 | tfunc->rcv_error_bytes.hi, | 1092 | le32_to_cpu(tfunc->rcv_error_bytes.hi), |
1093 | estats->error_bytes_received_lo, | 1093 | estats->error_bytes_received_lo, |
1094 | tfunc->rcv_error_bytes.lo); | 1094 | le32_to_cpu(tfunc->rcv_error_bytes.lo)); |
1095 | 1095 | ||
1096 | ADD_64(estats->etherstatsoverrsizepkts_hi, | 1096 | ADD_64(estats->etherstatsoverrsizepkts_hi, |
1097 | estats->rx_stat_dot3statsframestoolong_hi, | 1097 | estats->rx_stat_dot3statsframestoolong_hi, |
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index dd3a0a232ea0..818a573669e6 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr, | |||
3584 | fl6.flowi6_oif = dst_addr->sin6_scope_id; | 3584 | fl6.flowi6_oif = dst_addr->sin6_scope_id; |
3585 | 3585 | ||
3586 | *dst = ip6_route_output(&init_net, NULL, &fl6); | 3586 | *dst = ip6_route_output(&init_net, NULL, &fl6); |
3587 | if (*dst) | 3587 | if ((*dst)->error) { |
3588 | dst_release(*dst); | ||
3589 | *dst = NULL; | ||
3590 | return -ENETUNREACH; | ||
3591 | } else | ||
3588 | return 0; | 3592 | return 0; |
3589 | #endif | 3593 | #endif |
3590 | 3594 | ||
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index a1f2e0fed78b..35c2a202d67a 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -5352,7 +5352,7 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
5352 | } | 5352 | } |
5353 | } | 5353 | } |
5354 | 5354 | ||
5355 | netdev_completed_queue(tp->dev, pkts_compl, bytes_compl); | 5355 | netdev_tx_completed_queue(txq, pkts_compl, bytes_compl); |
5356 | 5356 | ||
5357 | tnapi->tx_cons = sw_idx; | 5357 | tnapi->tx_cons = sw_idx; |
5358 | 5358 | ||
@@ -6793,7 +6793,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6793 | } | 6793 | } |
6794 | 6794 | ||
6795 | skb_tx_timestamp(skb); | 6795 | skb_tx_timestamp(skb); |
6796 | netdev_sent_queue(tp->dev, skb->len); | 6796 | netdev_tx_sent_queue(txq, skb->len); |
6797 | 6797 | ||
6798 | /* Packets are ready, update Tx producer idx local and on card. */ | 6798 | /* Packets are ready, update Tx producer idx local and on card. */ |
6799 | tw32_tx_mbox(tnapi->prodmbox, entry); | 6799 | tw32_tx_mbox(tnapi->prodmbox, entry); |
@@ -7275,8 +7275,8 @@ static void tg3_free_rings(struct tg3 *tp) | |||
7275 | 7275 | ||
7276 | dev_kfree_skb_any(skb); | 7276 | dev_kfree_skb_any(skb); |
7277 | } | 7277 | } |
7278 | netdev_tx_reset_queue(netdev_get_tx_queue(tp->dev, j)); | ||
7278 | } | 7279 | } |
7279 | netdev_reset_queue(tp->dev); | ||
7280 | } | 7280 | } |
7281 | 7281 | ||
7282 | /* Initialize tx/rx rings for packet processing. | 7282 | /* Initialize tx/rx rings for packet processing. |
@@ -7886,10 +7886,8 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
7886 | return 0; | 7886 | return 0; |
7887 | } | 7887 | } |
7888 | 7888 | ||
7889 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *, | 7889 | static void tg3_get_nstats(struct tg3 *, struct rtnl_link_stats64 *); |
7890 | struct rtnl_link_stats64 *); | 7890 | static void tg3_get_estats(struct tg3 *, struct tg3_ethtool_stats *); |
7891 | static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *, | ||
7892 | struct tg3_ethtool_stats *); | ||
7893 | 7891 | ||
7894 | /* tp->lock is held. */ | 7892 | /* tp->lock is held. */ |
7895 | static int tg3_halt(struct tg3 *tp, int kind, int silent) | 7893 | static int tg3_halt(struct tg3 *tp, int kind, int silent) |
@@ -7910,7 +7908,7 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent) | |||
7910 | 7908 | ||
7911 | if (tp->hw_stats) { | 7909 | if (tp->hw_stats) { |
7912 | /* Save the stats across chip resets... */ | 7910 | /* Save the stats across chip resets... */ |
7913 | tg3_get_stats64(tp->dev, &tp->net_stats_prev), | 7911 | tg3_get_nstats(tp, &tp->net_stats_prev), |
7914 | tg3_get_estats(tp, &tp->estats_prev); | 7912 | tg3_get_estats(tp, &tp->estats_prev); |
7915 | 7913 | ||
7916 | /* And make sure the next sample is new data */ | 7914 | /* And make sure the next sample is new data */ |
@@ -9847,7 +9845,7 @@ static inline u64 get_stat64(tg3_stat64_t *val) | |||
9847 | return ((u64)val->high << 32) | ((u64)val->low); | 9845 | return ((u64)val->high << 32) | ((u64)val->low); |
9848 | } | 9846 | } |
9849 | 9847 | ||
9850 | static u64 calc_crc_errors(struct tg3 *tp) | 9848 | static u64 tg3_calc_crc_errors(struct tg3 *tp) |
9851 | { | 9849 | { |
9852 | struct tg3_hw_stats *hw_stats = tp->hw_stats; | 9850 | struct tg3_hw_stats *hw_stats = tp->hw_stats; |
9853 | 9851 | ||
@@ -9856,14 +9854,12 @@ static u64 calc_crc_errors(struct tg3 *tp) | |||
9856 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { | 9854 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { |
9857 | u32 val; | 9855 | u32 val; |
9858 | 9856 | ||
9859 | spin_lock_bh(&tp->lock); | ||
9860 | if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) { | 9857 | if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) { |
9861 | tg3_writephy(tp, MII_TG3_TEST1, | 9858 | tg3_writephy(tp, MII_TG3_TEST1, |
9862 | val | MII_TG3_TEST1_CRC_EN); | 9859 | val | MII_TG3_TEST1_CRC_EN); |
9863 | tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &val); | 9860 | tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &val); |
9864 | } else | 9861 | } else |
9865 | val = 0; | 9862 | val = 0; |
9866 | spin_unlock_bh(&tp->lock); | ||
9867 | 9863 | ||
9868 | tp->phy_crc_errors += val; | 9864 | tp->phy_crc_errors += val; |
9869 | 9865 | ||
@@ -9877,14 +9873,13 @@ static u64 calc_crc_errors(struct tg3 *tp) | |||
9877 | estats->member = old_estats->member + \ | 9873 | estats->member = old_estats->member + \ |
9878 | get_stat64(&hw_stats->member) | 9874 | get_stat64(&hw_stats->member) |
9879 | 9875 | ||
9880 | static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp, | 9876 | static void tg3_get_estats(struct tg3 *tp, struct tg3_ethtool_stats *estats) |
9881 | struct tg3_ethtool_stats *estats) | ||
9882 | { | 9877 | { |
9883 | struct tg3_ethtool_stats *old_estats = &tp->estats_prev; | 9878 | struct tg3_ethtool_stats *old_estats = &tp->estats_prev; |
9884 | struct tg3_hw_stats *hw_stats = tp->hw_stats; | 9879 | struct tg3_hw_stats *hw_stats = tp->hw_stats; |
9885 | 9880 | ||
9886 | if (!hw_stats) | 9881 | if (!hw_stats) |
9887 | return old_estats; | 9882 | return; |
9888 | 9883 | ||
9889 | ESTAT_ADD(rx_octets); | 9884 | ESTAT_ADD(rx_octets); |
9890 | ESTAT_ADD(rx_fragments); | 9885 | ESTAT_ADD(rx_fragments); |
@@ -9963,20 +9958,13 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp, | |||
9963 | ESTAT_ADD(nic_tx_threshold_hit); | 9958 | ESTAT_ADD(nic_tx_threshold_hit); |
9964 | 9959 | ||
9965 | ESTAT_ADD(mbuf_lwm_thresh_hit); | 9960 | ESTAT_ADD(mbuf_lwm_thresh_hit); |
9966 | |||
9967 | return estats; | ||
9968 | } | 9961 | } |
9969 | 9962 | ||
9970 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | 9963 | static void tg3_get_nstats(struct tg3 *tp, struct rtnl_link_stats64 *stats) |
9971 | struct rtnl_link_stats64 *stats) | ||
9972 | { | 9964 | { |
9973 | struct tg3 *tp = netdev_priv(dev); | ||
9974 | struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev; | 9965 | struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev; |
9975 | struct tg3_hw_stats *hw_stats = tp->hw_stats; | 9966 | struct tg3_hw_stats *hw_stats = tp->hw_stats; |
9976 | 9967 | ||
9977 | if (!hw_stats) | ||
9978 | return old_stats; | ||
9979 | |||
9980 | stats->rx_packets = old_stats->rx_packets + | 9968 | stats->rx_packets = old_stats->rx_packets + |
9981 | get_stat64(&hw_stats->rx_ucast_packets) + | 9969 | get_stat64(&hw_stats->rx_ucast_packets) + |
9982 | get_stat64(&hw_stats->rx_mcast_packets) + | 9970 | get_stat64(&hw_stats->rx_mcast_packets) + |
@@ -10019,15 +10007,13 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | |||
10019 | get_stat64(&hw_stats->tx_carrier_sense_errors); | 10007 | get_stat64(&hw_stats->tx_carrier_sense_errors); |
10020 | 10008 | ||
10021 | stats->rx_crc_errors = old_stats->rx_crc_errors + | 10009 | stats->rx_crc_errors = old_stats->rx_crc_errors + |
10022 | calc_crc_errors(tp); | 10010 | tg3_calc_crc_errors(tp); |
10023 | 10011 | ||
10024 | stats->rx_missed_errors = old_stats->rx_missed_errors + | 10012 | stats->rx_missed_errors = old_stats->rx_missed_errors + |
10025 | get_stat64(&hw_stats->rx_discards); | 10013 | get_stat64(&hw_stats->rx_discards); |
10026 | 10014 | ||
10027 | stats->rx_dropped = tp->rx_dropped; | 10015 | stats->rx_dropped = tp->rx_dropped; |
10028 | stats->tx_dropped = tp->tx_dropped; | 10016 | stats->tx_dropped = tp->tx_dropped; |
10029 | |||
10030 | return stats; | ||
10031 | } | 10017 | } |
10032 | 10018 | ||
10033 | static inline u32 calc_crc(unsigned char *buf, int len) | 10019 | static inline u32 calc_crc(unsigned char *buf, int len) |
@@ -15409,6 +15395,21 @@ static void __devinit tg3_init_coal(struct tg3 *tp) | |||
15409 | } | 15395 | } |
15410 | } | 15396 | } |
15411 | 15397 | ||
15398 | static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, | ||
15399 | struct rtnl_link_stats64 *stats) | ||
15400 | { | ||
15401 | struct tg3 *tp = netdev_priv(dev); | ||
15402 | |||
15403 | if (!tp->hw_stats) | ||
15404 | return &tp->net_stats_prev; | ||
15405 | |||
15406 | spin_lock_bh(&tp->lock); | ||
15407 | tg3_get_nstats(tp, stats); | ||
15408 | spin_unlock_bh(&tp->lock); | ||
15409 | |||
15410 | return stats; | ||
15411 | } | ||
15412 | |||
15412 | static const struct net_device_ops tg3_netdev_ops = { | 15413 | static const struct net_device_ops tg3_netdev_ops = { |
15413 | .ndo_open = tg3_open, | 15414 | .ndo_open = tg3_open, |
15414 | .ndo_stop = tg3_close, | 15415 | .ndo_stop = tg3_close, |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index e83d12c7bf20..9d76e59d9526 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -196,6 +196,8 @@ static DEFINE_PCI_DEVICE_TABLE(cxgb4_pci_tbl) = { | |||
196 | CH_DEVICE(0x4408, 4), | 196 | CH_DEVICE(0x4408, 4), |
197 | CH_DEVICE(0x4409, 4), | 197 | CH_DEVICE(0x4409, 4), |
198 | CH_DEVICE(0x440a, 4), | 198 | CH_DEVICE(0x440a, 4), |
199 | CH_DEVICE(0x440d, 4), | ||
200 | CH_DEVICE(0x440e, 4), | ||
199 | { 0, } | 201 | { 0, } |
200 | }; | 202 | }; |
201 | 203 | ||
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index e53365a71484..d963c1d57f71 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -2892,6 +2892,8 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = { | |||
2892 | CH_DEVICE(0x4808, 0), /* T420-cx */ | 2892 | CH_DEVICE(0x4808, 0), /* T420-cx */ |
2893 | CH_DEVICE(0x4809, 0), /* T420-bt */ | 2893 | CH_DEVICE(0x4809, 0), /* T420-bt */ |
2894 | CH_DEVICE(0x480a, 0), /* T404-bt */ | 2894 | CH_DEVICE(0x480a, 0), /* T404-bt */ |
2895 | CH_DEVICE(0x480d, 0), /* T480-cr */ | ||
2896 | CH_DEVICE(0x480e, 0), /* T440-lp-cr */ | ||
2895 | { 0, } | 2897 | { 0, } |
2896 | }; | 2898 | }; |
2897 | 2899 | ||
diff --git a/drivers/net/ethernet/cisco/enic/cq_enet_desc.h b/drivers/net/ethernet/cisco/enic/cq_enet_desc.h index c2c0680a1146..ac37cacc6136 100644 --- a/drivers/net/ethernet/cisco/enic/cq_enet_desc.h +++ b/drivers/net/ethernet/cisco/enic/cq_enet_desc.h | |||
@@ -157,7 +157,7 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc, | |||
157 | CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; | 157 | CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; |
158 | *fcoe_enc_error = (desc->flags & | 158 | *fcoe_enc_error = (desc->flags & |
159 | CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; | 159 | CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; |
160 | *fcoe_eof = (u8)((desc->checksum_fcoe >> | 160 | *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >> |
161 | CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & | 161 | CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & |
162 | CQ_ENET_RQ_DESC_FCOE_EOF_MASK); | 162 | CQ_ENET_RQ_DESC_FCOE_EOF_MASK); |
163 | *checksum = 0; | 163 | *checksum = 0; |
diff --git a/drivers/net/ethernet/cisco/enic/enic.h b/drivers/net/ethernet/cisco/enic/enic.h index ee93a2087fe6..c52295cd05ef 100644 --- a/drivers/net/ethernet/cisco/enic/enic.h +++ b/drivers/net/ethernet/cisco/enic/enic.h | |||
@@ -94,7 +94,7 @@ struct enic { | |||
94 | u32 rx_coalesce_usecs; | 94 | u32 rx_coalesce_usecs; |
95 | u32 tx_coalesce_usecs; | 95 | u32 tx_coalesce_usecs; |
96 | #ifdef CONFIG_PCI_IOV | 96 | #ifdef CONFIG_PCI_IOV |
97 | u32 num_vfs; | 97 | u16 num_vfs; |
98 | #endif | 98 | #endif |
99 | struct enic_port_profile *pp; | 99 | struct enic_port_profile *pp; |
100 | 100 | ||
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index ab3f67f980d8..0e4edd3b6bee 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -2370,7 +2370,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, | |||
2370 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); | 2370 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); |
2371 | if (pos) { | 2371 | if (pos) { |
2372 | pci_read_config_word(pdev, pos + PCI_SRIOV_TOTAL_VF, | 2372 | pci_read_config_word(pdev, pos + PCI_SRIOV_TOTAL_VF, |
2373 | (u16 *)&enic->num_vfs); | 2373 | &enic->num_vfs); |
2374 | if (enic->num_vfs) { | 2374 | if (enic->num_vfs) { |
2375 | err = pci_enable_sriov(pdev, enic->num_vfs); | 2375 | err = pci_enable_sriov(pdev, enic->num_vfs); |
2376 | if (err) { | 2376 | if (err) { |
diff --git a/drivers/net/ethernet/cisco/enic/enic_pp.c b/drivers/net/ethernet/cisco/enic/enic_pp.c index 22bf03a1829e..c347b6236f8f 100644 --- a/drivers/net/ethernet/cisco/enic/enic_pp.c +++ b/drivers/net/ethernet/cisco/enic/enic_pp.c | |||
@@ -72,7 +72,7 @@ static int enic_set_port_profile(struct enic *enic, int vf) | |||
72 | struct enic_port_profile *pp; | 72 | struct enic_port_profile *pp; |
73 | struct vic_provinfo *vp; | 73 | struct vic_provinfo *vp; |
74 | const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; | 74 | const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; |
75 | const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); | 75 | const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); |
76 | char uuid_str[38]; | 76 | char uuid_str[38]; |
77 | char client_mac_str[18]; | 77 | char client_mac_str[18]; |
78 | u8 *client_mac; | 78 | u8 *client_mac; |
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 1c7aad8fa19c..e92ef1bd732a 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c | |||
@@ -986,7 +986,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) | |||
986 | printk(KERN_INFO | 986 | printk(KERN_INFO |
987 | "%s: no PHY, assuming direct connection to switch\n", | 987 | "%s: no PHY, assuming direct connection to switch\n", |
988 | ndev->name); | 988 | ndev->name); |
989 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); | 989 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); |
990 | phy_id = 0; | 990 | phy_id = 0; |
991 | } | 991 | } |
992 | 992 | ||
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 5d5fb2627184..e6893cdfd13b 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -336,7 +336,9 @@ static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev, | |||
336 | stats->tx_bytes = tx_bytes; | 336 | stats->tx_bytes = tx_bytes; |
337 | stats->rx_packets = rx_packets; | 337 | stats->rx_packets = rx_packets; |
338 | 338 | ||
339 | return &port->stats; | 339 | stats->multicast = port->stats.multicast; |
340 | stats->rx_errors = port->stats.rx_errors; | ||
341 | return stats; | ||
340 | } | 342 | } |
341 | 343 | ||
342 | static void ehea_update_stats(struct work_struct *work) | 344 | static void ehea_update_stats(struct work_struct *work) |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 27d651a80f3f..55cbf65512c3 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
@@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu) | |||
2328 | ((new_mtu) < IPV6_MIN_MTU)) | 2328 | ((new_mtu) < IPV6_MIN_MTU)) |
2329 | return -EINVAL; | 2329 | return -EINVAL; |
2330 | 2330 | ||
2331 | if (new_mtu > 4000) { | ||
2332 | jme->reg_rxcs &= ~RXCS_FIFOTHNP; | ||
2333 | jme->reg_rxcs |= RXCS_FIFOTHNP_64QW; | ||
2334 | jme_restart_rx_engine(jme); | ||
2335 | } else { | ||
2336 | jme->reg_rxcs &= ~RXCS_FIFOTHNP; | ||
2337 | jme->reg_rxcs |= RXCS_FIFOTHNP_128QW; | ||
2338 | jme_restart_rx_engine(jme); | ||
2339 | } | ||
2340 | 2331 | ||
2341 | netdev->mtu = new_mtu; | 2332 | netdev->mtu = new_mtu; |
2342 | netdev_update_features(netdev); | 2333 | netdev_update_features(netdev); |
2343 | 2334 | ||
2335 | jme_restart_rx_engine(jme); | ||
2344 | jme_reset_link(jme); | 2336 | jme_reset_link(jme); |
2345 | 2337 | ||
2346 | return 0; | 2338 | return 0; |
diff --git a/drivers/net/ethernet/jme.h b/drivers/net/ethernet/jme.h index 4304072bd3c5..3efc897c9913 100644 --- a/drivers/net/ethernet/jme.h +++ b/drivers/net/ethernet/jme.h | |||
@@ -730,7 +730,7 @@ enum jme_rxcs_values { | |||
730 | RXCS_RETRYCNT_60 = 0x00000F00, | 730 | RXCS_RETRYCNT_60 = 0x00000F00, |
731 | 731 | ||
732 | RXCS_DEFAULT = RXCS_FIFOTHTP_128T | | 732 | RXCS_DEFAULT = RXCS_FIFOTHTP_128T | |
733 | RXCS_FIFOTHNP_128QW | | 733 | RXCS_FIFOTHNP_16QW | |
734 | RXCS_DMAREQSZ_128B | | 734 | RXCS_DMAREQSZ_128B | |
735 | RXCS_RETRYGAP_256ns | | 735 | RXCS_RETRYGAP_256ns | |
736 | RXCS_RETRYCNT_32, | 736 | RXCS_RETRYCNT_32, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 55d7bd4e210a..9129ace02560 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -815,8 +815,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) | |||
815 | int err; | 815 | int err; |
816 | int i; | 816 | int i; |
817 | 817 | ||
818 | priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map, | 818 | priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev), |
819 | mlx4_num_eq_uar(dev), GFP_KERNEL); | 819 | sizeof *priv->eq_table.uar_map, |
820 | GFP_KERNEL); | ||
820 | if (!priv->eq_table.uar_map) { | 821 | if (!priv->eq_table.uar_map) { |
821 | err = -ENOMEM; | 822 | err = -ENOMEM; |
822 | goto err_out_free; | 823 | goto err_out_free; |
@@ -1035,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1035 | struct mlx4_priv *priv = mlx4_priv(dev); | 1036 | struct mlx4_priv *priv = mlx4_priv(dev); |
1036 | int vec = 0, err = 0, i; | 1037 | int vec = 0, err = 0, i; |
1037 | 1038 | ||
1038 | spin_lock(&priv->msix_ctl.pool_lock); | 1039 | mutex_lock(&priv->msix_ctl.pool_lock); |
1039 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { | 1040 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { |
1040 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { | 1041 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { |
1041 | priv->msix_ctl.pool_bm |= 1ULL << i; | 1042 | priv->msix_ctl.pool_bm |= 1ULL << i; |
@@ -1057,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1057 | eq_set_ci(&priv->eq_table.eq[vec], 1); | 1058 | eq_set_ci(&priv->eq_table.eq[vec], 1); |
1058 | } | 1059 | } |
1059 | } | 1060 | } |
1060 | spin_unlock(&priv->msix_ctl.pool_lock); | 1061 | mutex_unlock(&priv->msix_ctl.pool_lock); |
1061 | 1062 | ||
1062 | if (vec) { | 1063 | if (vec) { |
1063 | *vector = vec; | 1064 | *vector = vec; |
@@ -1078,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec) | |||
1078 | if (likely(i >= 0)) { | 1079 | if (likely(i >= 0)) { |
1079 | /*sanity check , making sure were not trying to free irq's | 1080 | /*sanity check , making sure were not trying to free irq's |
1080 | Belonging to a legacy EQ*/ | 1081 | Belonging to a legacy EQ*/ |
1081 | spin_lock(&priv->msix_ctl.pool_lock); | 1082 | mutex_lock(&priv->msix_ctl.pool_lock); |
1082 | if (priv->msix_ctl.pool_bm & 1ULL << i) { | 1083 | if (priv->msix_ctl.pool_bm & 1ULL << i) { |
1083 | free_irq(priv->eq_table.eq[vec].irq, | 1084 | free_irq(priv->eq_table.eq[vec].irq, |
1084 | &priv->eq_table.eq[vec]); | 1085 | &priv->eq_table.eq[vec]); |
1085 | priv->msix_ctl.pool_bm &= ~(1ULL << i); | 1086 | priv->msix_ctl.pool_bm &= ~(1ULL << i); |
1086 | } | 1087 | } |
1087 | spin_unlock(&priv->msix_ctl.pool_lock); | 1088 | mutex_unlock(&priv->msix_ctl.pool_lock); |
1088 | } | 1089 | } |
1089 | 1090 | ||
1090 | } | 1091 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 8a21e10952ea..9ea7cabcaf3c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -685,7 +685,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
685 | return err; | 685 | return err; |
686 | } | 686 | } |
687 | 687 | ||
688 | static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) | 688 | int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) |
689 | { | 689 | { |
690 | struct mlx4_cmd_mailbox *outbox = ptr; | 690 | struct mlx4_cmd_mailbox *outbox = ptr; |
691 | 691 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 678558b502fc..d498f049c74e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev, | |||
531 | for (port = 0; port < dev->caps.num_ports; port++) { | 531 | for (port = 0; port < dev->caps.num_ports; port++) { |
532 | /* Change the port type only if the new type is different | 532 | /* Change the port type only if the new type is different |
533 | * from the current, and not set to Auto */ | 533 | * from the current, and not set to Auto */ |
534 | if (port_types[port] != dev->caps.port_type[port + 1]) { | 534 | if (port_types[port] != dev->caps.port_type[port + 1]) |
535 | change = 1; | 535 | change = 1; |
536 | dev->caps.port_type[port + 1] = port_types[port]; | ||
537 | } | ||
538 | } | 536 | } |
539 | if (change) { | 537 | if (change) { |
540 | mlx4_unregister_device(dev); | 538 | mlx4_unregister_device(dev); |
541 | for (port = 1; port <= dev->caps.num_ports; port++) { | 539 | for (port = 1; port <= dev->caps.num_ports; port++) { |
542 | mlx4_CLOSE_PORT(dev, port); | 540 | mlx4_CLOSE_PORT(dev, port); |
541 | dev->caps.port_type[port] = port_types[port - 1]; | ||
543 | err = mlx4_SET_PORT(dev, port); | 542 | err = mlx4_SET_PORT(dev, port); |
544 | if (err) { | 543 | if (err) { |
545 | mlx4_err(dev, "Failed to set port %d, " | 544 | mlx4_err(dev, "Failed to set port %d, " |
@@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev) | |||
986 | resource_size_t bf_len; | 985 | resource_size_t bf_len; |
987 | int err = 0; | 986 | int err = 0; |
988 | 987 | ||
988 | if (!dev->caps.bf_reg_size) | ||
989 | return -ENXIO; | ||
990 | |||
989 | bf_start = pci_resource_start(dev->pdev, 2) + | 991 | bf_start = pci_resource_start(dev->pdev, 2) + |
990 | (dev->caps.num_uars << PAGE_SHIFT); | 992 | (dev->caps.num_uars << PAGE_SHIFT); |
991 | bf_len = pci_resource_len(dev->pdev, 2) - | 993 | bf_len = pci_resource_len(dev->pdev, 2) - |
@@ -1825,7 +1827,7 @@ slave_start: | |||
1825 | goto err_master_mfunc; | 1827 | goto err_master_mfunc; |
1826 | 1828 | ||
1827 | priv->msix_ctl.pool_bm = 0; | 1829 | priv->msix_ctl.pool_bm = 0; |
1828 | spin_lock_init(&priv->msix_ctl.pool_lock); | 1830 | mutex_init(&priv->msix_ctl.pool_lock); |
1829 | 1831 | ||
1830 | mlx4_enable_msi_x(dev); | 1832 | mlx4_enable_msi_x(dev); |
1831 | if ((mlx4_is_mfunc(dev)) && | 1833 | if ((mlx4_is_mfunc(dev)) && |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index c92269f8c057..28f8251561f4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h | |||
@@ -697,7 +697,7 @@ struct mlx4_sense { | |||
697 | 697 | ||
698 | struct mlx4_msix_ctl { | 698 | struct mlx4_msix_ctl { |
699 | u64 pool_bm; | 699 | u64 pool_bm; |
700 | spinlock_t pool_lock; | 700 | struct mutex pool_lock; |
701 | }; | 701 | }; |
702 | 702 | ||
703 | struct mlx4_steer { | 703 | struct mlx4_steer { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index 8deeef98280c..25a80d71fb2a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c | |||
@@ -304,7 +304,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox | |||
304 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); | 304 | MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); |
305 | } | 305 | } |
306 | 306 | ||
307 | static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, | 307 | int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, |
308 | u32 *base_mridx) | 308 | u32 *base_mridx) |
309 | { | 309 | { |
310 | struct mlx4_priv *priv = mlx4_priv(dev); | 310 | struct mlx4_priv *priv = mlx4_priv(dev); |
@@ -320,14 +320,14 @@ static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, | |||
320 | } | 320 | } |
321 | EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); | 321 | EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); |
322 | 322 | ||
323 | static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) | 323 | void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) |
324 | { | 324 | { |
325 | struct mlx4_priv *priv = mlx4_priv(dev); | 325 | struct mlx4_priv *priv = mlx4_priv(dev); |
326 | mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); | 326 | mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); |
327 | } | 327 | } |
328 | EXPORT_SYMBOL_GPL(mlx4_mr_release_range); | 328 | EXPORT_SYMBOL_GPL(mlx4_mr_release_range); |
329 | 329 | ||
330 | static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, | 330 | int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, |
331 | u64 iova, u64 size, u32 access, int npages, | 331 | u64 iova, u64 size, u32 access, int npages, |
332 | int page_shift, struct mlx4_mr *mr) | 332 | int page_shift, struct mlx4_mr *mr) |
333 | { | 333 | { |
@@ -457,7 +457,7 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | |||
457 | } | 457 | } |
458 | EXPORT_SYMBOL_GPL(mlx4_mr_alloc); | 458 | EXPORT_SYMBOL_GPL(mlx4_mr_alloc); |
459 | 459 | ||
460 | static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) | 460 | void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) |
461 | { | 461 | { |
462 | int err; | 462 | int err; |
463 | 463 | ||
@@ -852,7 +852,7 @@ err_free: | |||
852 | } | 852 | } |
853 | EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); | 853 | EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); |
854 | 854 | ||
855 | static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, | 855 | int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, |
856 | u32 pd, u32 access, int max_pages, | 856 | u32 pd, u32 access, int max_pages, |
857 | int max_maps, u8 page_shift, struct mlx4_fmr *fmr) | 857 | int max_maps, u8 page_shift, struct mlx4_fmr *fmr) |
858 | { | 858 | { |
@@ -954,7 +954,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | |||
954 | } | 954 | } |
955 | EXPORT_SYMBOL_GPL(mlx4_fmr_free); | 955 | EXPORT_SYMBOL_GPL(mlx4_fmr_free); |
956 | 956 | ||
957 | static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) | 957 | int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) |
958 | { | 958 | { |
959 | if (fmr->maps) | 959 | if (fmr->maps) |
960 | return -EBUSY; | 960 | return -EBUSY; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c index 738f950a1ce5..fb2b36759cbf 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c | |||
@@ -151,11 +151,6 @@ static int __mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | |||
151 | context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; | 151 | context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; |
152 | } | 152 | } |
153 | 153 | ||
154 | port = ((context->pri_path.sched_queue >> 6) & 1) + 1; | ||
155 | if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) | ||
156 | context->pri_path.sched_queue = (context->pri_path.sched_queue & | ||
157 | 0xc3); | ||
158 | |||
159 | *(__be32 *) mailbox->buf = cpu_to_be32(optpar); | 154 | *(__be32 *) mailbox->buf = cpu_to_be32(optpar); |
160 | memcpy(mailbox->buf + 8, context, sizeof *context); | 155 | memcpy(mailbox->buf + 8, context, sizeof *context); |
161 | 156 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index dcd819bfb2f0..8752e6e08169 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
@@ -73,6 +73,7 @@ struct res_gid { | |||
73 | struct list_head list; | 73 | struct list_head list; |
74 | u8 gid[16]; | 74 | u8 gid[16]; |
75 | enum mlx4_protocol prot; | 75 | enum mlx4_protocol prot; |
76 | enum mlx4_steer_type steer; | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | enum res_qp_states { | 79 | enum res_qp_states { |
@@ -374,6 +375,7 @@ static struct res_common *alloc_qp_tr(int id) | |||
374 | 375 | ||
375 | ret->com.res_id = id; | 376 | ret->com.res_id = id; |
376 | ret->com.state = RES_QP_RESERVED; | 377 | ret->com.state = RES_QP_RESERVED; |
378 | ret->local_qpn = id; | ||
377 | INIT_LIST_HEAD(&ret->mcg_list); | 379 | INIT_LIST_HEAD(&ret->mcg_list); |
378 | spin_lock_init(&ret->mcg_spl); | 380 | spin_lock_init(&ret->mcg_spl); |
379 | 381 | ||
@@ -2253,8 +2255,7 @@ int mlx4_MODIFY_CQ_wrapper(struct mlx4_dev *dev, int slave, | |||
2253 | 2255 | ||
2254 | if (vhcr->op_modifier == 0) { | 2256 | if (vhcr->op_modifier == 0) { |
2255 | err = handle_resize(dev, slave, vhcr, inbox, outbox, cmd, cq); | 2257 | err = handle_resize(dev, slave, vhcr, inbox, outbox, cmd, cq); |
2256 | if (err) | 2258 | goto ex_put; |
2257 | goto ex_put; | ||
2258 | } | 2259 | } |
2259 | 2260 | ||
2260 | err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); | 2261 | err = mlx4_DMA_wrapper(dev, slave, vhcr, inbox, outbox, cmd); |
@@ -2479,7 +2480,8 @@ static struct res_gid *find_gid(struct mlx4_dev *dev, int slave, | |||
2479 | } | 2480 | } |
2480 | 2481 | ||
2481 | static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | 2482 | static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, |
2482 | u8 *gid, enum mlx4_protocol prot) | 2483 | u8 *gid, enum mlx4_protocol prot, |
2484 | enum mlx4_steer_type steer) | ||
2483 | { | 2485 | { |
2484 | struct res_gid *res; | 2486 | struct res_gid *res; |
2485 | int err; | 2487 | int err; |
@@ -2495,6 +2497,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | |||
2495 | } else { | 2497 | } else { |
2496 | memcpy(res->gid, gid, 16); | 2498 | memcpy(res->gid, gid, 16); |
2497 | res->prot = prot; | 2499 | res->prot = prot; |
2500 | res->steer = steer; | ||
2498 | list_add_tail(&res->list, &rqp->mcg_list); | 2501 | list_add_tail(&res->list, &rqp->mcg_list); |
2499 | err = 0; | 2502 | err = 0; |
2500 | } | 2503 | } |
@@ -2504,14 +2507,15 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | |||
2504 | } | 2507 | } |
2505 | 2508 | ||
2506 | static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, | 2509 | static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, |
2507 | u8 *gid, enum mlx4_protocol prot) | 2510 | u8 *gid, enum mlx4_protocol prot, |
2511 | enum mlx4_steer_type steer) | ||
2508 | { | 2512 | { |
2509 | struct res_gid *res; | 2513 | struct res_gid *res; |
2510 | int err; | 2514 | int err; |
2511 | 2515 | ||
2512 | spin_lock_irq(&rqp->mcg_spl); | 2516 | spin_lock_irq(&rqp->mcg_spl); |
2513 | res = find_gid(dev, slave, rqp, gid); | 2517 | res = find_gid(dev, slave, rqp, gid); |
2514 | if (!res || res->prot != prot) | 2518 | if (!res || res->prot != prot || res->steer != steer) |
2515 | err = -EINVAL; | 2519 | err = -EINVAL; |
2516 | else { | 2520 | else { |
2517 | list_del(&res->list); | 2521 | list_del(&res->list); |
@@ -2538,7 +2542,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2538 | int attach = vhcr->op_modifier; | 2542 | int attach = vhcr->op_modifier; |
2539 | int block_loopback = vhcr->in_modifier >> 31; | 2543 | int block_loopback = vhcr->in_modifier >> 31; |
2540 | u8 steer_type_mask = 2; | 2544 | u8 steer_type_mask = 2; |
2541 | enum mlx4_steer_type type = gid[7] & steer_type_mask; | 2545 | enum mlx4_steer_type type = (gid[7] & steer_type_mask) >> 1; |
2542 | 2546 | ||
2543 | qpn = vhcr->in_modifier & 0xffffff; | 2547 | qpn = vhcr->in_modifier & 0xffffff; |
2544 | err = get_res(dev, slave, qpn, RES_QP, &rqp); | 2548 | err = get_res(dev, slave, qpn, RES_QP, &rqp); |
@@ -2547,7 +2551,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2547 | 2551 | ||
2548 | qp.qpn = qpn; | 2552 | qp.qpn = qpn; |
2549 | if (attach) { | 2553 | if (attach) { |
2550 | err = add_mcg_res(dev, slave, rqp, gid, prot); | 2554 | err = add_mcg_res(dev, slave, rqp, gid, prot, type); |
2551 | if (err) | 2555 | if (err) |
2552 | goto ex_put; | 2556 | goto ex_put; |
2553 | 2557 | ||
@@ -2556,7 +2560,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2556 | if (err) | 2560 | if (err) |
2557 | goto ex_rem; | 2561 | goto ex_rem; |
2558 | } else { | 2562 | } else { |
2559 | err = rem_mcg_res(dev, slave, rqp, gid, prot); | 2563 | err = rem_mcg_res(dev, slave, rqp, gid, prot, type); |
2560 | if (err) | 2564 | if (err) |
2561 | goto ex_put; | 2565 | goto ex_put; |
2562 | err = mlx4_qp_detach_common(dev, &qp, gid, prot, type); | 2566 | err = mlx4_qp_detach_common(dev, &qp, gid, prot, type); |
@@ -2567,7 +2571,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
2567 | 2571 | ||
2568 | ex_rem: | 2572 | ex_rem: |
2569 | /* ignore error return below, already in error */ | 2573 | /* ignore error return below, already in error */ |
2570 | err1 = rem_mcg_res(dev, slave, rqp, gid, prot); | 2574 | err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type); |
2571 | ex_put: | 2575 | ex_put: |
2572 | put_res(dev, slave, qpn, RES_QP); | 2576 | put_res(dev, slave, qpn, RES_QP); |
2573 | 2577 | ||
@@ -2606,7 +2610,7 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp) | |||
2606 | list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) { | 2610 | list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) { |
2607 | qp.qpn = rqp->local_qpn; | 2611 | qp.qpn = rqp->local_qpn; |
2608 | err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot, | 2612 | err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot, |
2609 | MLX4_MC_STEER); | 2613 | rgid->steer); |
2610 | list_del(&rgid->list); | 2614 | list_del(&rgid->list); |
2611 | kfree(rgid); | 2615 | kfree(rgid); |
2612 | } | 2616 | } |
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index 6b35e7da9a9c..0c3e4005224d 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c | |||
@@ -583,7 +583,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks) | |||
583 | ks8851_dbg_dumpkkt(ks, rxpkt); | 583 | ks8851_dbg_dumpkkt(ks, rxpkt); |
584 | 584 | ||
585 | skb->protocol = eth_type_trans(skb, ks->netdev); | 585 | skb->protocol = eth_type_trans(skb, ks->netdev); |
586 | netif_rx(skb); | 586 | netif_rx_ni(skb); |
587 | 587 | ||
588 | ks->netdev->stats.rx_packets++; | 588 | ks->netdev->stats.rx_packets++; |
589 | ks->netdev->stats.rx_bytes += rxlen; | 589 | ks->netdev->stats.rx_bytes += rxlen; |
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index e58e78e5c930..2784bc706f1e 100644 --- a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c | |||
@@ -394,7 +394,6 @@ union ks_tx_hdr { | |||
394 | * @msg_enable : The message flags controlling driver output (see ethtool). | 394 | * @msg_enable : The message flags controlling driver output (see ethtool). |
395 | * @frame_cnt : number of frames received. | 395 | * @frame_cnt : number of frames received. |
396 | * @bus_width : i/o bus width. | 396 | * @bus_width : i/o bus width. |
397 | * @irq : irq number assigned to this device. | ||
398 | * @rc_rxqcr : Cached copy of KS_RXQCR. | 397 | * @rc_rxqcr : Cached copy of KS_RXQCR. |
399 | * @rc_txcr : Cached copy of KS_TXCR. | 398 | * @rc_txcr : Cached copy of KS_TXCR. |
400 | * @rc_ier : Cached copy of KS_IER. | 399 | * @rc_ier : Cached copy of KS_IER. |
@@ -441,7 +440,6 @@ struct ks_net { | |||
441 | u32 msg_enable; | 440 | u32 msg_enable; |
442 | u32 frame_cnt; | 441 | u32 frame_cnt; |
443 | int bus_width; | 442 | int bus_width; |
444 | int irq; | ||
445 | 443 | ||
446 | u16 rc_rxqcr; | 444 | u16 rc_rxqcr; |
447 | u16 rc_txcr; | 445 | u16 rc_txcr; |
@@ -907,10 +905,10 @@ static int ks_net_open(struct net_device *netdev) | |||
907 | netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); | 905 | netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); |
908 | 906 | ||
909 | /* reset the HW */ | 907 | /* reset the HW */ |
910 | err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); | 908 | err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); |
911 | 909 | ||
912 | if (err) { | 910 | if (err) { |
913 | pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err); | 911 | pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err); |
914 | return err; | 912 | return err; |
915 | } | 913 | } |
916 | 914 | ||
@@ -955,7 +953,7 @@ static int ks_net_stop(struct net_device *netdev) | |||
955 | 953 | ||
956 | /* set powermode to soft power down to save power */ | 954 | /* set powermode to soft power down to save power */ |
957 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); | 955 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); |
958 | free_irq(ks->irq, netdev); | 956 | free_irq(netdev->irq, netdev); |
959 | mutex_unlock(&ks->lock); | 957 | mutex_unlock(&ks->lock); |
960 | return 0; | 958 | return 0; |
961 | } | 959 | } |
@@ -1545,10 +1543,10 @@ static int __devinit ks8851_probe(struct platform_device *pdev) | |||
1545 | if (!ks->hw_addr_cmd) | 1543 | if (!ks->hw_addr_cmd) |
1546 | goto err_ioremap1; | 1544 | goto err_ioremap1; |
1547 | 1545 | ||
1548 | ks->irq = platform_get_irq(pdev, 0); | 1546 | netdev->irq = platform_get_irq(pdev, 0); |
1549 | 1547 | ||
1550 | if (ks->irq < 0) { | 1548 | if ((int)netdev->irq < 0) { |
1551 | err = ks->irq; | 1549 | err = netdev->irq; |
1552 | goto err_get_irq; | 1550 | goto err_get_irq; |
1553 | } | 1551 | } |
1554 | 1552 | ||
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c index 212f43b308a3..cd827ff4a021 100644 --- a/drivers/net/ethernet/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c | |||
@@ -670,7 +670,7 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev) | |||
670 | static int octeon_mgmt_init_phy(struct net_device *netdev) | 670 | static int octeon_mgmt_init_phy(struct net_device *netdev) |
671 | { | 671 | { |
672 | struct octeon_mgmt *p = netdev_priv(netdev); | 672 | struct octeon_mgmt *p = netdev_priv(netdev); |
673 | char phy_id[20]; | 673 | char phy_id[MII_BUS_ID_SIZE + 3]; |
674 | 674 | ||
675 | if (octeon_is_simulation()) { | 675 | if (octeon_is_simulation()) { |
676 | /* No PHYs in the simulator. */ | 676 | /* No PHYs in the simulator. */ |
@@ -678,7 +678,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev) | |||
678 | return 0; | 678 | return 0; |
679 | } | 679 | } |
680 | 680 | ||
681 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port); | 681 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port); |
682 | 682 | ||
683 | p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0, | 683 | p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0, |
684 | PHY_INTERFACE_MODE_MII); | 684 | PHY_INTERFACE_MODE_MII); |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c index 9cb5f912e489..29e23bec809c 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c | |||
@@ -321,10 +321,10 @@ static void pch_gbe_check_copper_options(struct pch_gbe_adapter *adapter) | |||
321 | pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n"); | 321 | pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n"); |
322 | hw->phy.autoneg_advertised = opt.def; | 322 | hw->phy.autoneg_advertised = opt.def; |
323 | } else { | 323 | } else { |
324 | hw->phy.autoneg_advertised = AutoNeg; | 324 | int tmp = AutoNeg; |
325 | pch_gbe_validate_option( | 325 | |
326 | (int *)(&hw->phy.autoneg_advertised), | 326 | pch_gbe_validate_option(&tmp, &opt, adapter); |
327 | &opt, adapter); | 327 | hw->phy.autoneg_advertised = tmp; |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
@@ -495,9 +495,10 @@ void pch_gbe_check_options(struct pch_gbe_adapter *adapter) | |||
495 | .arg = { .l = { .nr = (int)ARRAY_SIZE(fc_list), | 495 | .arg = { .l = { .nr = (int)ARRAY_SIZE(fc_list), |
496 | .p = fc_list } } | 496 | .p = fc_list } } |
497 | }; | 497 | }; |
498 | hw->mac.fc = FlowControl; | 498 | int tmp = FlowControl; |
499 | pch_gbe_validate_option((int *)(&hw->mac.fc), | 499 | |
500 | &opt, adapter); | 500 | pch_gbe_validate_option(&tmp, &opt, adapter); |
501 | hw->mac.fc = tmp; | ||
501 | } | 502 | } |
502 | 503 | ||
503 | pch_gbe_check_copper_options(adapter); | 504 | pch_gbe_check_copper_options(adapter); |
diff --git a/drivers/net/ethernet/packetengines/Kconfig b/drivers/net/ethernet/packetengines/Kconfig index b97132d9dff0..8f29feb35548 100644 --- a/drivers/net/ethernet/packetengines/Kconfig +++ b/drivers/net/ethernet/packetengines/Kconfig | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | config NET_PACKET_ENGINE | 5 | config NET_PACKET_ENGINE |
6 | bool "Packet Engine devices" | 6 | bool "Packet Engine devices" |
7 | default y | ||
7 | depends on PCI | 8 | depends on PCI |
8 | ---help--- | 9 | ---help--- |
9 | If you have a network (Ethernet) card belonging to this class, say Y | 10 | If you have a network (Ethernet) card belonging to this class, say Y |
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index 7931531c3a40..e61560e16385 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c | |||
@@ -3017,7 +3017,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3017 | (void __iomem *)port_regs; | 3017 | (void __iomem *)port_regs; |
3018 | u32 delay = 10; | 3018 | u32 delay = 10; |
3019 | int status = 0; | 3019 | int status = 0; |
3020 | unsigned long hw_flags = 0; | ||
3021 | 3020 | ||
3022 | if (ql_mii_setup(qdev)) | 3021 | if (ql_mii_setup(qdev)) |
3023 | return -1; | 3022 | return -1; |
@@ -3228,9 +3227,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3228 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); | 3227 | value = ql_read_page0_reg(qdev, &port_regs->portStatus); |
3229 | if (value & PORT_STATUS_IC) | 3228 | if (value & PORT_STATUS_IC) |
3230 | break; | 3229 | break; |
3231 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 3230 | spin_unlock_irq(&qdev->hw_lock); |
3232 | msleep(500); | 3231 | msleep(500); |
3233 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | 3232 | spin_lock_irq(&qdev->hw_lock); |
3234 | } while (--delay); | 3233 | } while (--delay); |
3235 | 3234 | ||
3236 | if (delay == 0) { | 3235 | if (delay == 0) { |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 7a0c800b50ad..bbacb3741ec0 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -3781,12 +3781,20 @@ static void rtl8169_init_ring_indexes(struct rtl8169_private *tp) | |||
3781 | 3781 | ||
3782 | static void rtl_hw_jumbo_enable(struct rtl8169_private *tp) | 3782 | static void rtl_hw_jumbo_enable(struct rtl8169_private *tp) |
3783 | { | 3783 | { |
3784 | void __iomem *ioaddr = tp->mmio_addr; | ||
3785 | |||
3786 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
3784 | rtl_generic_op(tp, tp->jumbo_ops.enable); | 3787 | rtl_generic_op(tp, tp->jumbo_ops.enable); |
3788 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
3785 | } | 3789 | } |
3786 | 3790 | ||
3787 | static void rtl_hw_jumbo_disable(struct rtl8169_private *tp) | 3791 | static void rtl_hw_jumbo_disable(struct rtl8169_private *tp) |
3788 | { | 3792 | { |
3793 | void __iomem *ioaddr = tp->mmio_addr; | ||
3794 | |||
3795 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
3789 | rtl_generic_op(tp, tp->jumbo_ops.disable); | 3796 | rtl_generic_op(tp, tp->jumbo_ops.disable); |
3797 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
3790 | } | 3798 | } |
3791 | 3799 | ||
3792 | static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp) | 3800 | static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp) |
@@ -6186,6 +6194,9 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
6186 | { | 6194 | { |
6187 | struct net_device *dev = pci_get_drvdata(pdev); | 6195 | struct net_device *dev = pci_get_drvdata(pdev); |
6188 | struct rtl8169_private *tp = netdev_priv(dev); | 6196 | struct rtl8169_private *tp = netdev_priv(dev); |
6197 | struct device *d = &pdev->dev; | ||
6198 | |||
6199 | pm_runtime_get_sync(d); | ||
6189 | 6200 | ||
6190 | rtl8169_net_suspend(dev); | 6201 | rtl8169_net_suspend(dev); |
6191 | 6202 | ||
@@ -6207,6 +6218,8 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
6207 | pci_wake_from_d3(pdev, true); | 6218 | pci_wake_from_d3(pdev, true); |
6208 | pci_set_power_state(pdev, PCI_D3hot); | 6219 | pci_set_power_state(pdev, PCI_D3hot); |
6209 | } | 6220 | } |
6221 | |||
6222 | pm_runtime_put_noidle(d); | ||
6210 | } | 6223 | } |
6211 | 6224 | ||
6212 | static struct pci_driver rtl8169_pci_driver = { | 6225 | static struct pci_driver rtl8169_pci_driver = { |
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index aca349861767..fc52fca74193 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
@@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue) | |||
156 | if (unlikely(!skb)) | 156 | if (unlikely(!skb)) |
157 | return -ENOMEM; | 157 | return -ENOMEM; |
158 | 158 | ||
159 | /* Adjust the SKB for padding and checksum */ | 159 | /* Adjust the SKB for padding */ |
160 | skb_reserve(skb, NET_IP_ALIGN); | 160 | skb_reserve(skb, NET_IP_ALIGN); |
161 | rx_buf->len = skb_len - NET_IP_ALIGN; | 161 | rx_buf->len = skb_len - NET_IP_ALIGN; |
162 | rx_buf->is_page = false; | 162 | rx_buf->is_page = false; |
163 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
164 | 163 | ||
165 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, | 164 | rx_buf->dma_addr = pci_map_single(efx->pci_dev, |
166 | skb->data, rx_buf->len, | 165 | skb->data, rx_buf->len, |
@@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel, | |||
496 | 495 | ||
497 | EFX_BUG_ON_PARANOID(!checksummed); | 496 | EFX_BUG_ON_PARANOID(!checksummed); |
498 | rx_buf->u.skb = NULL; | 497 | rx_buf->u.skb = NULL; |
498 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
499 | 499 | ||
500 | gro_result = napi_gro_receive(napi, skb); | 500 | gro_result = napi_gro_receive(napi, skb); |
501 | } | 501 | } |
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index d0b814ef0675..0319d640f728 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h | |||
@@ -67,6 +67,7 @@ struct stmmac_extra_stats { | |||
67 | unsigned long ipc_csum_error; | 67 | unsigned long ipc_csum_error; |
68 | unsigned long rx_collision; | 68 | unsigned long rx_collision; |
69 | unsigned long rx_crc; | 69 | unsigned long rx_crc; |
70 | unsigned long dribbling_bit; | ||
70 | unsigned long rx_length; | 71 | unsigned long rx_length; |
71 | unsigned long rx_mii; | 72 | unsigned long rx_mii; |
72 | unsigned long rx_multicast; | 73 | unsigned long rx_multicast; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c index d87976364ec5..ad1b627f8ec2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c | |||
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
201 | 201 | ||
202 | if (unlikely(p->des01.erx.dribbling)) { | 202 | if (unlikely(p->des01.erx.dribbling)) { |
203 | CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); | 203 | CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); |
204 | ret = discard_frame; | 204 | x->dribbling_bit++; |
205 | } | 205 | } |
206 | if (unlikely(p->des01.erx.sa_filter_fail)) { | 206 | if (unlikely(p->des01.erx.sa_filter_fail)) { |
207 | CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); | 207 | CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c index fda5d2b31d3a..25953bb45a73 100644 --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c | |||
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
104 | ret = discard_frame; | 104 | ret = discard_frame; |
105 | } | 105 | } |
106 | if (unlikely(p->des01.rx.dribbling)) | 106 | if (unlikely(p->des01.rx.dribbling)) |
107 | ret = discard_frame; | 107 | x->dribbling_bit++; |
108 | 108 | ||
109 | if (unlikely(p->des01.rx.length_error)) { | 109 | if (unlikely(p->des01.rx.length_error)) { |
110 | x->rx_length++; | 110 | x->rx_length++; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 120740020e2c..b4b095fdcf29 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h | |||
@@ -21,7 +21,7 @@ | |||
21 | *******************************************************************************/ | 21 | *******************************************************************************/ |
22 | 22 | ||
23 | #define STMMAC_RESOURCE_NAME "stmmaceth" | 23 | #define STMMAC_RESOURCE_NAME "stmmaceth" |
24 | #define DRV_MODULE_VERSION "Dec_2011" | 24 | #define DRV_MODULE_VERSION "Feb_2012" |
25 | #include <linux/stmmac.h> | 25 | #include <linux/stmmac.h> |
26 | #include <linux/phy.h> | 26 | #include <linux/phy.h> |
27 | #include "common.h" | 27 | #include "common.h" |
@@ -97,4 +97,5 @@ int stmmac_resume(struct net_device *ndev); | |||
97 | int stmmac_suspend(struct net_device *ndev); | 97 | int stmmac_suspend(struct net_device *ndev); |
98 | int stmmac_dvr_remove(struct net_device *ndev); | 98 | int stmmac_dvr_remove(struct net_device *ndev); |
99 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, | 99 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, |
100 | struct plat_stmmacenet_data *plat_dat); | 100 | struct plat_stmmacenet_data *plat_dat, |
101 | void __iomem *addr); | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 9573303a706b..f98e1511660f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | |||
@@ -47,23 +47,25 @@ struct stmmac_stats { | |||
47 | offsetof(struct stmmac_priv, xstats.m)} | 47 | offsetof(struct stmmac_priv, xstats.m)} |
48 | 48 | ||
49 | static const struct stmmac_stats stmmac_gstrings_stats[] = { | 49 | static const struct stmmac_stats stmmac_gstrings_stats[] = { |
50 | /* Transmit errors */ | ||
50 | STMMAC_STAT(tx_underflow), | 51 | STMMAC_STAT(tx_underflow), |
51 | STMMAC_STAT(tx_carrier), | 52 | STMMAC_STAT(tx_carrier), |
52 | STMMAC_STAT(tx_losscarrier), | 53 | STMMAC_STAT(tx_losscarrier), |
53 | STMMAC_STAT(vlan_tag), | 54 | STMMAC_STAT(vlan_tag), |
54 | STMMAC_STAT(tx_deferred), | 55 | STMMAC_STAT(tx_deferred), |
55 | STMMAC_STAT(tx_vlan), | 56 | STMMAC_STAT(tx_vlan), |
56 | STMMAC_STAT(rx_vlan), | ||
57 | STMMAC_STAT(tx_jabber), | 57 | STMMAC_STAT(tx_jabber), |
58 | STMMAC_STAT(tx_frame_flushed), | 58 | STMMAC_STAT(tx_frame_flushed), |
59 | STMMAC_STAT(tx_payload_error), | 59 | STMMAC_STAT(tx_payload_error), |
60 | STMMAC_STAT(tx_ip_header_error), | 60 | STMMAC_STAT(tx_ip_header_error), |
61 | /* Receive errors */ | ||
61 | STMMAC_STAT(rx_desc), | 62 | STMMAC_STAT(rx_desc), |
62 | STMMAC_STAT(sa_filter_fail), | 63 | STMMAC_STAT(sa_filter_fail), |
63 | STMMAC_STAT(overflow_error), | 64 | STMMAC_STAT(overflow_error), |
64 | STMMAC_STAT(ipc_csum_error), | 65 | STMMAC_STAT(ipc_csum_error), |
65 | STMMAC_STAT(rx_collision), | 66 | STMMAC_STAT(rx_collision), |
66 | STMMAC_STAT(rx_crc), | 67 | STMMAC_STAT(rx_crc), |
68 | STMMAC_STAT(dribbling_bit), | ||
67 | STMMAC_STAT(rx_length), | 69 | STMMAC_STAT(rx_length), |
68 | STMMAC_STAT(rx_mii), | 70 | STMMAC_STAT(rx_mii), |
69 | STMMAC_STAT(rx_multicast), | 71 | STMMAC_STAT(rx_multicast), |
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { | |||
73 | STMMAC_STAT(sa_rx_filter_fail), | 75 | STMMAC_STAT(sa_rx_filter_fail), |
74 | STMMAC_STAT(rx_missed_cntr), | 76 | STMMAC_STAT(rx_missed_cntr), |
75 | STMMAC_STAT(rx_overflow_cntr), | 77 | STMMAC_STAT(rx_overflow_cntr), |
78 | STMMAC_STAT(rx_vlan), | ||
79 | /* Tx/Rx IRQ errors */ | ||
76 | STMMAC_STAT(tx_undeflow_irq), | 80 | STMMAC_STAT(tx_undeflow_irq), |
77 | STMMAC_STAT(tx_process_stopped_irq), | 81 | STMMAC_STAT(tx_process_stopped_irq), |
78 | STMMAC_STAT(tx_jabber_irq), | 82 | STMMAC_STAT(tx_jabber_irq), |
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { | |||
82 | STMMAC_STAT(rx_watchdog_irq), | 86 | STMMAC_STAT(rx_watchdog_irq), |
83 | STMMAC_STAT(tx_early_irq), | 87 | STMMAC_STAT(tx_early_irq), |
84 | STMMAC_STAT(fatal_bus_error_irq), | 88 | STMMAC_STAT(fatal_bus_error_irq), |
89 | /* Extra info */ | ||
85 | STMMAC_STAT(threshold), | 90 | STMMAC_STAT(threshold), |
86 | STMMAC_STAT(tx_pkt_n), | 91 | STMMAC_STAT(tx_pkt_n), |
87 | STMMAC_STAT(rx_pkt_n), | 92 | STMMAC_STAT(rx_pkt_n), |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 96fa2da30763..6ee593a55a64 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -241,7 +241,7 @@ static void stmmac_adjust_link(struct net_device *dev) | |||
241 | case 1000: | 241 | case 1000: |
242 | if (likely(priv->plat->has_gmac)) | 242 | if (likely(priv->plat->has_gmac)) |
243 | ctrl &= ~priv->hw->link.port; | 243 | ctrl &= ~priv->hw->link.port; |
244 | stmmac_hw_fix_mac_speed(priv); | 244 | stmmac_hw_fix_mac_speed(priv); |
245 | break; | 245 | break; |
246 | case 100: | 246 | case 100: |
247 | case 10: | 247 | case 10: |
@@ -785,7 +785,7 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | |||
785 | u32 uid = ((hwid & 0x0000ff00) >> 8); | 785 | u32 uid = ((hwid & 0x0000ff00) >> 8); |
786 | u32 synid = (hwid & 0x000000ff); | 786 | u32 synid = (hwid & 0x000000ff); |
787 | 787 | ||
788 | pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n", | 788 | pr_info("stmmac - user ID: 0x%x, Synopsys ID: 0x%x\n", |
789 | uid, synid); | 789 | uid, synid); |
790 | 790 | ||
791 | return synid; | 791 | return synid; |
@@ -869,38 +869,6 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv) | |||
869 | return hw_cap; | 869 | return hw_cap; |
870 | } | 870 | } |
871 | 871 | ||
872 | /** | ||
873 | * stmmac_mac_device_setup | ||
874 | * @dev : device pointer | ||
875 | * Description: this is to attach the GMAC or MAC 10/100 | ||
876 | * main core structures that will be completed during the | ||
877 | * open step. | ||
878 | */ | ||
879 | static int stmmac_mac_device_setup(struct net_device *dev) | ||
880 | { | ||
881 | struct stmmac_priv *priv = netdev_priv(dev); | ||
882 | |||
883 | struct mac_device_info *device; | ||
884 | |||
885 | if (priv->plat->has_gmac) | ||
886 | device = dwmac1000_setup(priv->ioaddr); | ||
887 | else | ||
888 | device = dwmac100_setup(priv->ioaddr); | ||
889 | |||
890 | if (!device) | ||
891 | return -ENOMEM; | ||
892 | |||
893 | priv->hw = device; | ||
894 | priv->hw->ring = &ring_mode_ops; | ||
895 | |||
896 | if (device_can_wakeup(priv->device)) { | ||
897 | priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */ | ||
898 | enable_irq_wake(priv->wol_irq); | ||
899 | } | ||
900 | |||
901 | return 0; | ||
902 | } | ||
903 | |||
904 | static void stmmac_check_ether_addr(struct stmmac_priv *priv) | 872 | static void stmmac_check_ether_addr(struct stmmac_priv *priv) |
905 | { | 873 | { |
906 | /* verify if the MAC address is valid, in case of failures it | 874 | /* verify if the MAC address is valid, in case of failures it |
@@ -930,20 +898,8 @@ static int stmmac_open(struct net_device *dev) | |||
930 | struct stmmac_priv *priv = netdev_priv(dev); | 898 | struct stmmac_priv *priv = netdev_priv(dev); |
931 | int ret; | 899 | int ret; |
932 | 900 | ||
933 | /* MAC HW device setup */ | ||
934 | ret = stmmac_mac_device_setup(dev); | ||
935 | if (ret < 0) | ||
936 | return ret; | ||
937 | |||
938 | stmmac_check_ether_addr(priv); | 901 | stmmac_check_ether_addr(priv); |
939 | 902 | ||
940 | stmmac_verify_args(); | ||
941 | |||
942 | /* Override with kernel parameters if supplied XXX CRS XXX | ||
943 | * this needs to have multiple instances */ | ||
944 | if ((phyaddr >= 0) && (phyaddr <= 31)) | ||
945 | priv->plat->phy_addr = phyaddr; | ||
946 | |||
947 | /* MDIO bus Registration */ | 903 | /* MDIO bus Registration */ |
948 | ret = stmmac_mdio_register(dev); | 904 | ret = stmmac_mdio_register(dev); |
949 | if (ret < 0) { | 905 | if (ret < 0) { |
@@ -976,44 +932,6 @@ static int stmmac_open(struct net_device *dev) | |||
976 | goto open_error; | 932 | goto open_error; |
977 | } | 933 | } |
978 | 934 | ||
979 | stmmac_get_synopsys_id(priv); | ||
980 | |||
981 | priv->hw_cap_support = stmmac_get_hw_features(priv); | ||
982 | |||
983 | if (priv->hw_cap_support) { | ||
984 | pr_info(" Support DMA HW capability register"); | ||
985 | |||
986 | /* We can override some gmac/dma configuration fields: e.g. | ||
987 | * enh_desc, tx_coe (e.g. that are passed through the | ||
988 | * platform) with the values from the HW capability | ||
989 | * register (if supported). | ||
990 | */ | ||
991 | priv->plat->enh_desc = priv->dma_cap.enh_desc; | ||
992 | priv->plat->tx_coe = priv->dma_cap.tx_coe; | ||
993 | priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; | ||
994 | |||
995 | /* By default disable wol on magic frame if not supported */ | ||
996 | if (!priv->dma_cap.pmt_magic_frame) | ||
997 | priv->wolopts &= ~WAKE_MAGIC; | ||
998 | |||
999 | } else | ||
1000 | pr_info(" No HW DMA feature register supported"); | ||
1001 | |||
1002 | /* Select the enhnaced/normal descriptor structures */ | ||
1003 | stmmac_selec_desc_mode(priv); | ||
1004 | |||
1005 | /* PMT module is not integrated in all the MAC devices. */ | ||
1006 | if (priv->plat->pmt) { | ||
1007 | pr_info(" Remote wake-up capable\n"); | ||
1008 | device_set_wakeup_capable(priv->device, 1); | ||
1009 | } | ||
1010 | |||
1011 | priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); | ||
1012 | if (priv->rx_coe) | ||
1013 | pr_info(" Checksum Offload Engine supported\n"); | ||
1014 | if (priv->plat->tx_coe) | ||
1015 | pr_info(" Checksum insertion supported\n"); | ||
1016 | |||
1017 | /* Create and initialize the TX/RX descriptors chains. */ | 935 | /* Create and initialize the TX/RX descriptors chains. */ |
1018 | priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); | 936 | priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); |
1019 | priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); | 937 | priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); |
@@ -1030,14 +948,14 @@ static int stmmac_open(struct net_device *dev) | |||
1030 | 948 | ||
1031 | /* Copy the MAC addr into the HW */ | 949 | /* Copy the MAC addr into the HW */ |
1032 | priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0); | 950 | priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0); |
951 | |||
1033 | /* If required, perform hw setup of the bus. */ | 952 | /* If required, perform hw setup of the bus. */ |
1034 | if (priv->plat->bus_setup) | 953 | if (priv->plat->bus_setup) |
1035 | priv->plat->bus_setup(priv->ioaddr); | 954 | priv->plat->bus_setup(priv->ioaddr); |
955 | |||
1036 | /* Initialize the MAC Core */ | 956 | /* Initialize the MAC Core */ |
1037 | priv->hw->mac->core_init(priv->ioaddr); | 957 | priv->hw->mac->core_init(priv->ioaddr); |
1038 | 958 | ||
1039 | netdev_update_features(dev); | ||
1040 | |||
1041 | /* Request the IRQ lines */ | 959 | /* Request the IRQ lines */ |
1042 | ret = request_irq(dev->irq, stmmac_interrupt, | 960 | ret = request_irq(dev->irq, stmmac_interrupt, |
1043 | IRQF_SHARED, dev->name, dev); | 961 | IRQF_SHARED, dev->name, dev); |
@@ -1047,6 +965,17 @@ static int stmmac_open(struct net_device *dev) | |||
1047 | goto open_error; | 965 | goto open_error; |
1048 | } | 966 | } |
1049 | 967 | ||
968 | /* Request the Wake IRQ in case of another line is used for WoL */ | ||
969 | if (priv->wol_irq != dev->irq) { | ||
970 | ret = request_irq(priv->wol_irq, stmmac_interrupt, | ||
971 | IRQF_SHARED, dev->name, dev); | ||
972 | if (unlikely(ret < 0)) { | ||
973 | pr_err("%s: ERROR: allocating the ext WoL IRQ %d " | ||
974 | "(error: %d)\n", __func__, priv->wol_irq, ret); | ||
975 | goto open_error_wolirq; | ||
976 | } | ||
977 | } | ||
978 | |||
1050 | /* Enable the MAC Rx/Tx */ | 979 | /* Enable the MAC Rx/Tx */ |
1051 | stmmac_set_mac(priv->ioaddr, true); | 980 | stmmac_set_mac(priv->ioaddr, true); |
1052 | 981 | ||
@@ -1062,7 +991,7 @@ static int stmmac_open(struct net_device *dev) | |||
1062 | #ifdef CONFIG_STMMAC_DEBUG_FS | 991 | #ifdef CONFIG_STMMAC_DEBUG_FS |
1063 | ret = stmmac_init_fs(dev); | 992 | ret = stmmac_init_fs(dev); |
1064 | if (ret < 0) | 993 | if (ret < 0) |
1065 | pr_warning("\tFailed debugFS registration"); | 994 | pr_warning("%s: failed debugFS registration\n", __func__); |
1066 | #endif | 995 | #endif |
1067 | /* Start the ball rolling... */ | 996 | /* Start the ball rolling... */ |
1068 | DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); | 997 | DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); |
@@ -1072,6 +1001,7 @@ static int stmmac_open(struct net_device *dev) | |||
1072 | #ifdef CONFIG_STMMAC_TIMER | 1001 | #ifdef CONFIG_STMMAC_TIMER |
1073 | priv->tm->timer_start(tmrate); | 1002 | priv->tm->timer_start(tmrate); |
1074 | #endif | 1003 | #endif |
1004 | |||
1075 | /* Dump DMA/MAC registers */ | 1005 | /* Dump DMA/MAC registers */ |
1076 | if (netif_msg_hw(priv)) { | 1006 | if (netif_msg_hw(priv)) { |
1077 | priv->hw->mac->dump_regs(priv->ioaddr); | 1007 | priv->hw->mac->dump_regs(priv->ioaddr); |
@@ -1087,6 +1017,9 @@ static int stmmac_open(struct net_device *dev) | |||
1087 | 1017 | ||
1088 | return 0; | 1018 | return 0; |
1089 | 1019 | ||
1020 | open_error_wolirq: | ||
1021 | free_irq(dev->irq, dev); | ||
1022 | |||
1090 | open_error: | 1023 | open_error: |
1091 | #ifdef CONFIG_STMMAC_TIMER | 1024 | #ifdef CONFIG_STMMAC_TIMER |
1092 | kfree(priv->tm); | 1025 | kfree(priv->tm); |
@@ -1127,6 +1060,8 @@ static int stmmac_release(struct net_device *dev) | |||
1127 | 1060 | ||
1128 | /* Free the IRQ lines */ | 1061 | /* Free the IRQ lines */ |
1129 | free_irq(dev->irq, dev); | 1062 | free_irq(dev->irq, dev); |
1063 | if (priv->wol_irq != dev->irq) | ||
1064 | free_irq(priv->wol_irq, dev); | ||
1130 | 1065 | ||
1131 | /* Stop TX/RX DMA and clear the descriptors */ | 1066 | /* Stop TX/RX DMA and clear the descriptors */ |
1132 | priv->hw->dma->stop_tx(priv->ioaddr); | 1067 | priv->hw->dma->stop_tx(priv->ioaddr); |
@@ -1789,13 +1724,77 @@ static const struct net_device_ops stmmac_netdev_ops = { | |||
1789 | }; | 1724 | }; |
1790 | 1725 | ||
1791 | /** | 1726 | /** |
1727 | * stmmac_hw_init - Init the MAC device | ||
1728 | * @priv : pointer to the private device structure. | ||
1729 | * Description: this function detects which MAC device | ||
1730 | * (GMAC/MAC10-100) has to attached, checks the HW capability | ||
1731 | * (if supported) and sets the driver's features (for example | ||
1732 | * to use the ring or chaine mode or support the normal/enh | ||
1733 | * descriptor structure). | ||
1734 | */ | ||
1735 | static int stmmac_hw_init(struct stmmac_priv *priv) | ||
1736 | { | ||
1737 | int ret = 0; | ||
1738 | struct mac_device_info *mac; | ||
1739 | |||
1740 | /* Identify the MAC HW device */ | ||
1741 | if (priv->plat->has_gmac) | ||
1742 | mac = dwmac1000_setup(priv->ioaddr); | ||
1743 | else | ||
1744 | mac = dwmac100_setup(priv->ioaddr); | ||
1745 | if (!mac) | ||
1746 | return -ENOMEM; | ||
1747 | |||
1748 | priv->hw = mac; | ||
1749 | |||
1750 | /* To use the chained or ring mode */ | ||
1751 | priv->hw->ring = &ring_mode_ops; | ||
1752 | |||
1753 | /* Get and dump the chip ID */ | ||
1754 | stmmac_get_synopsys_id(priv); | ||
1755 | |||
1756 | /* Get the HW capability (new GMAC newer than 3.50a) */ | ||
1757 | priv->hw_cap_support = stmmac_get_hw_features(priv); | ||
1758 | if (priv->hw_cap_support) { | ||
1759 | pr_info(" DMA HW capability register supported"); | ||
1760 | |||
1761 | /* We can override some gmac/dma configuration fields: e.g. | ||
1762 | * enh_desc, tx_coe (e.g. that are passed through the | ||
1763 | * platform) with the values from the HW capability | ||
1764 | * register (if supported). | ||
1765 | */ | ||
1766 | priv->plat->enh_desc = priv->dma_cap.enh_desc; | ||
1767 | priv->plat->tx_coe = priv->dma_cap.tx_coe; | ||
1768 | priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; | ||
1769 | } else | ||
1770 | pr_info(" No HW DMA feature register supported"); | ||
1771 | |||
1772 | /* Select the enhnaced/normal descriptor structures */ | ||
1773 | stmmac_selec_desc_mode(priv); | ||
1774 | |||
1775 | priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); | ||
1776 | if (priv->rx_coe) | ||
1777 | pr_info(" RX Checksum Offload Engine supported\n"); | ||
1778 | if (priv->plat->tx_coe) | ||
1779 | pr_info(" TX Checksum insertion supported\n"); | ||
1780 | |||
1781 | if (priv->plat->pmt) { | ||
1782 | pr_info(" Wake-Up On Lan supported\n"); | ||
1783 | device_set_wakeup_capable(priv->device, 1); | ||
1784 | } | ||
1785 | |||
1786 | return ret; | ||
1787 | } | ||
1788 | |||
1789 | /** | ||
1792 | * stmmac_dvr_probe | 1790 | * stmmac_dvr_probe |
1793 | * @device: device pointer | 1791 | * @device: device pointer |
1794 | * Description: this is the main probe function used to | 1792 | * Description: this is the main probe function used to |
1795 | * call the alloc_etherdev, allocate the priv structure. | 1793 | * call the alloc_etherdev, allocate the priv structure. |
1796 | */ | 1794 | */ |
1797 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, | 1795 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, |
1798 | struct plat_stmmacenet_data *plat_dat) | 1796 | struct plat_stmmacenet_data *plat_dat, |
1797 | void __iomem *addr) | ||
1799 | { | 1798 | { |
1800 | int ret = 0; | 1799 | int ret = 0; |
1801 | struct net_device *ndev = NULL; | 1800 | struct net_device *ndev = NULL; |
@@ -1815,10 +1814,27 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
1815 | 1814 | ||
1816 | ether_setup(ndev); | 1815 | ether_setup(ndev); |
1817 | 1816 | ||
1818 | ndev->netdev_ops = &stmmac_netdev_ops; | ||
1819 | stmmac_set_ethtool_ops(ndev); | 1817 | stmmac_set_ethtool_ops(ndev); |
1818 | priv->pause = pause; | ||
1819 | priv->plat = plat_dat; | ||
1820 | priv->ioaddr = addr; | ||
1821 | priv->dev->base_addr = (unsigned long)addr; | ||
1822 | |||
1823 | /* Verify driver arguments */ | ||
1824 | stmmac_verify_args(); | ||
1825 | |||
1826 | /* Override with kernel parameters if supplied XXX CRS XXX | ||
1827 | * this needs to have multiple instances */ | ||
1828 | if ((phyaddr >= 0) && (phyaddr <= 31)) | ||
1829 | priv->plat->phy_addr = phyaddr; | ||
1830 | |||
1831 | /* Init MAC and get the capabilities */ | ||
1832 | stmmac_hw_init(priv); | ||
1833 | |||
1834 | ndev->netdev_ops = &stmmac_netdev_ops; | ||
1820 | 1835 | ||
1821 | ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 1836 | ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1837 | NETIF_F_RXCSUM; | ||
1822 | ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; | 1838 | ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; |
1823 | ndev->watchdog_timeo = msecs_to_jiffies(watchdog); | 1839 | ndev->watchdog_timeo = msecs_to_jiffies(watchdog); |
1824 | #ifdef STMMAC_VLAN_TAG_USED | 1840 | #ifdef STMMAC_VLAN_TAG_USED |
@@ -1830,8 +1846,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
1830 | if (flow_ctrl) | 1846 | if (flow_ctrl) |
1831 | priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ | 1847 | priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ |
1832 | 1848 | ||
1833 | priv->pause = pause; | ||
1834 | priv->plat = plat_dat; | ||
1835 | netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); | 1849 | netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); |
1836 | 1850 | ||
1837 | spin_lock_init(&priv->lock); | 1851 | spin_lock_init(&priv->lock); |
@@ -1839,15 +1853,10 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
1839 | 1853 | ||
1840 | ret = register_netdev(ndev); | 1854 | ret = register_netdev(ndev); |
1841 | if (ret) { | 1855 | if (ret) { |
1842 | pr_err("%s: ERROR %i registering the device\n", | 1856 | pr_err("%s: ERROR %i registering the device\n", __func__, ret); |
1843 | __func__, ret); | ||
1844 | goto error; | 1857 | goto error; |
1845 | } | 1858 | } |
1846 | 1859 | ||
1847 | DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", | ||
1848 | ndev->name, (ndev->features & NETIF_F_SG) ? "on" : "off", | ||
1849 | (ndev->features & NETIF_F_IP_CSUM) ? "on" : "off"); | ||
1850 | |||
1851 | return priv; | 1860 | return priv; |
1852 | 1861 | ||
1853 | error: | 1862 | error: |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index c796de9eed72..50ad5b80cfaf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | |||
@@ -96,13 +96,11 @@ static int __devinit stmmac_pci_probe(struct pci_dev *pdev, | |||
96 | 96 | ||
97 | stmmac_default_data(); | 97 | stmmac_default_data(); |
98 | 98 | ||
99 | priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat); | 99 | priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr); |
100 | if (!priv) { | 100 | if (!priv) { |
101 | pr_err("%s: main drivr probe failed", __func__); | 101 | pr_err("%s: main driver probe failed", __func__); |
102 | goto err_out; | 102 | goto err_out; |
103 | } | 103 | } |
104 | priv->ioaddr = addr; | ||
105 | priv->dev->base_addr = (unsigned long)addr; | ||
106 | priv->dev->irq = pdev->irq; | 104 | priv->dev->irq = pdev->irq; |
107 | priv->wol_irq = pdev->irq; | 105 | priv->wol_irq = pdev->irq; |
108 | 106 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 1ac83243649a..3aad9810237c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -59,16 +59,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
59 | goto out_release_region; | 59 | goto out_release_region; |
60 | } | 60 | } |
61 | plat_dat = pdev->dev.platform_data; | 61 | plat_dat = pdev->dev.platform_data; |
62 | priv = stmmac_dvr_probe(&(pdev->dev), plat_dat); | 62 | |
63 | /* Custom initialisation (if needed)*/ | ||
64 | if (plat_dat->init) { | ||
65 | ret = plat_dat->init(pdev); | ||
66 | if (unlikely(ret)) | ||
67 | goto out_unmap; | ||
68 | } | ||
69 | |||
70 | priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr); | ||
63 | if (!priv) { | 71 | if (!priv) { |
64 | pr_err("%s: main drivr probe failed", __func__); | 72 | pr_err("%s: main driver probe failed", __func__); |
65 | goto out_unmap; | 73 | goto out_unmap; |
66 | } | 74 | } |
67 | 75 | ||
68 | priv->ioaddr = addr; | ||
69 | /* Set the I/O base addr */ | ||
70 | priv->dev->base_addr = (unsigned long)addr; | ||
71 | |||
72 | /* Get the MAC information */ | 76 | /* Get the MAC information */ |
73 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); | 77 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); |
74 | if (priv->dev->irq == -ENXIO) { | 78 | if (priv->dev->irq == -ENXIO) { |
@@ -92,13 +96,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
92 | 96 | ||
93 | platform_set_drvdata(pdev, priv->dev); | 97 | platform_set_drvdata(pdev, priv->dev); |
94 | 98 | ||
95 | /* Custom initialisation */ | ||
96 | if (priv->plat->init) { | ||
97 | ret = priv->plat->init(pdev); | ||
98 | if (unlikely(ret)) | ||
99 | goto out_unmap; | ||
100 | } | ||
101 | |||
102 | pr_debug("STMMAC platform driver registration completed"); | 99 | pr_debug("STMMAC platform driver registration completed"); |
103 | 100 | ||
104 | return 0; | 101 | return 0; |
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c index 4d9a28ffd3c3..cbc8df78d84b 100644 --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c | |||
@@ -1122,7 +1122,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1122 | pdata = pdev->dev.platform_data; | 1122 | pdata = pdev->dev.platform_data; |
1123 | 1123 | ||
1124 | if (external_switch || dumb_switch) { | 1124 | if (external_switch || dumb_switch) { |
1125 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ | 1125 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ |
1126 | phy_id = pdev->id; | 1126 | phy_id = pdev->id; |
1127 | } else { | 1127 | } else { |
1128 | for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { | 1128 | for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { |
@@ -1138,7 +1138,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1138 | if (phy_id == PHY_MAX_ADDR) { | 1138 | if (phy_id == PHY_MAX_ADDR) { |
1139 | dev_err(&pdev->dev, "no PHY present, falling back " | 1139 | dev_err(&pdev->dev, "no PHY present, falling back " |
1140 | "to switch on MDIO bus 0\n"); | 1140 | "to switch on MDIO bus 0\n"); |
1141 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ | 1141 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ |
1142 | phy_id = pdev->id; | 1142 | phy_id = pdev->id; |
1143 | } | 1143 | } |
1144 | 1144 | ||
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 4fa0bcb25dfc..4b2f54565f64 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -1009,7 +1009,7 @@ static void emac_rx_handler(void *token, int len, int status) | |||
1009 | int ret; | 1009 | int ret; |
1010 | 1010 | ||
1011 | /* free and bail if we are shutting down */ | 1011 | /* free and bail if we are shutting down */ |
1012 | if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { | 1012 | if (unlikely(!netif_running(ndev))) { |
1013 | dev_kfree_skb_any(skb); | 1013 | dev_kfree_skb_any(skb); |
1014 | return; | 1014 | return; |
1015 | } | 1015 | } |
@@ -1038,7 +1038,9 @@ static void emac_rx_handler(void *token, int len, int status) | |||
1038 | recycle: | 1038 | recycle: |
1039 | ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, | 1039 | ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, |
1040 | skb_tailroom(skb), GFP_KERNEL); | 1040 | skb_tailroom(skb), GFP_KERNEL); |
1041 | if (WARN_ON(ret < 0)) | 1041 | |
1042 | WARN_ON(ret == -ENOMEM); | ||
1043 | if (unlikely(ret < 0)) | ||
1042 | dev_kfree_skb_any(skb); | 1044 | dev_kfree_skb_any(skb); |
1043 | } | 1045 | } |
1044 | 1046 | ||
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 72a854f05bb8..41a8b5a9849e 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c | |||
@@ -1416,7 +1416,8 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1416 | __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); | 1416 | __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); |
1417 | udelay(50); | 1417 | udelay(50); |
1418 | 1418 | ||
1419 | snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); | 1419 | snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, |
1420 | mdio_bus->id, plat->phy); | ||
1420 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, | 1421 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, |
1421 | PHY_INTERFACE_MODE_MII); | 1422 | PHY_INTERFACE_MODE_MII); |
1422 | if (IS_ERR(port->phydev)) { | 1423 | if (IS_ERR(port->phydev)) { |