diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/b44.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 17 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 51 |
7 files changed, 39 insertions, 50 deletions
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_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 03f3935fd8c2..7aee46983be4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -523,7 +523,6 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
523 | skb = build_skb(data); | 523 | skb = build_skb(data); |
524 | 524 | ||
525 | if (likely(skb)) { | 525 | if (likely(skb)) { |
526 | |||
527 | #ifdef BNX2X_STOP_ON_ERROR | 526 | #ifdef BNX2X_STOP_ON_ERROR |
528 | if (pad + len > fp->rx_buf_size) { | 527 | if (pad + len > fp->rx_buf_size) { |
529 | BNX2X_ERR("skb_put is about to fail... " | 528 | BNX2X_ERR("skb_put is about to fail... " |
@@ -557,7 +556,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
557 | 556 | ||
558 | return; | 557 | return; |
559 | } | 558 | } |
560 | 559 | kfree(new_data); | |
561 | drop: | 560 | drop: |
562 | /* drop the packet and keep the buffer in the bin */ | 561 | /* drop the packet and keep the buffer in the bin */ |
563 | DP(NETIF_MSG_RX_STATUS, | 562 | DP(NETIF_MSG_RX_STATUS, |
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, |