diff options
author | David S. Miller <davem@davemloft.net> | 2012-03-19 16:46:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-19 16:46:22 -0400 |
commit | 277074777cd9c004b1ac32689772370c38fd00e2 (patch) | |
tree | c8a1e7586cc9b16bcd662db6735acca6b9c5c558 /drivers/net/ethernet | |
parent | 4da0bd736552e6377b407b3c3d3ae518ebbdd269 (diff) | |
parent | 5407b14c6792d6ff122ecb1a2a6acffad60ef389 (diff) |
Merge branch 'gianfar-bql' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 22 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 |
3 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index adb0ae4e4195..d9428f0e738a 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -104,10 +104,7 @@ | |||
104 | #include "fsl_pq_mdio.h" | 104 | #include "fsl_pq_mdio.h" |
105 | 105 | ||
106 | #define TX_TIMEOUT (1*HZ) | 106 | #define TX_TIMEOUT (1*HZ) |
107 | #undef BRIEF_GFAR_ERRORS | ||
108 | #undef VERBOSE_GFAR_ERRORS | ||
109 | 107 | ||
110 | const char gfar_driver_name[] = "Gianfar Ethernet"; | ||
111 | const char gfar_driver_version[] = "1.3"; | 108 | const char gfar_driver_version[] = "1.3"; |
112 | 109 | ||
113 | static int gfar_enet_open(struct net_device *dev); | 110 | static int gfar_enet_open(struct net_device *dev); |
@@ -1755,9 +1752,12 @@ static void free_skb_resources(struct gfar_private *priv) | |||
1755 | 1752 | ||
1756 | /* Go through all the buffer descriptors and free their data buffers */ | 1753 | /* Go through all the buffer descriptors and free their data buffers */ |
1757 | for (i = 0; i < priv->num_tx_queues; i++) { | 1754 | for (i = 0; i < priv->num_tx_queues; i++) { |
1755 | struct netdev_queue *txq; | ||
1758 | tx_queue = priv->tx_queue[i]; | 1756 | tx_queue = priv->tx_queue[i]; |
1757 | txq = netdev_get_tx_queue(tx_queue->dev, tx_queue->qindex); | ||
1759 | if(tx_queue->tx_skbuff) | 1758 | if(tx_queue->tx_skbuff) |
1760 | free_skb_tx_queue(tx_queue); | 1759 | free_skb_tx_queue(tx_queue); |
1760 | netdev_tx_reset_queue(txq); | ||
1761 | } | 1761 | } |
1762 | 1762 | ||
1763 | for (i = 0; i < priv->num_rx_queues; i++) { | 1763 | for (i = 0; i < priv->num_rx_queues; i++) { |
@@ -2217,6 +2217,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2217 | lstatus |= BD_LFLAG(TXBD_CRC | TXBD_READY) | skb_headlen(skb); | 2217 | lstatus |= BD_LFLAG(TXBD_CRC | TXBD_READY) | skb_headlen(skb); |
2218 | } | 2218 | } |
2219 | 2219 | ||
2220 | netdev_tx_sent_queue(txq, skb->len); | ||
2221 | |||
2220 | /* | 2222 | /* |
2221 | * We can work in parallel with gfar_clean_tx_ring(), except | 2223 | * We can work in parallel with gfar_clean_tx_ring(), except |
2222 | * when modifying num_txbdfree. Note that we didn't grab the lock | 2224 | * when modifying num_txbdfree. Note that we didn't grab the lock |
@@ -2460,6 +2462,7 @@ static void gfar_align_skb(struct sk_buff *skb) | |||
2460 | static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) | 2462 | static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) |
2461 | { | 2463 | { |
2462 | struct net_device *dev = tx_queue->dev; | 2464 | struct net_device *dev = tx_queue->dev; |
2465 | struct netdev_queue *txq; | ||
2463 | struct gfar_private *priv = netdev_priv(dev); | 2466 | struct gfar_private *priv = netdev_priv(dev); |
2464 | struct gfar_priv_rx_q *rx_queue = NULL; | 2467 | struct gfar_priv_rx_q *rx_queue = NULL; |
2465 | struct txbd8 *bdp, *next = NULL; | 2468 | struct txbd8 *bdp, *next = NULL; |
@@ -2471,10 +2474,13 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) | |||
2471 | int frags = 0, nr_txbds = 0; | 2474 | int frags = 0, nr_txbds = 0; |
2472 | int i; | 2475 | int i; |
2473 | int howmany = 0; | 2476 | int howmany = 0; |
2477 | int tqi = tx_queue->qindex; | ||
2478 | unsigned int bytes_sent = 0; | ||
2474 | u32 lstatus; | 2479 | u32 lstatus; |
2475 | size_t buflen; | 2480 | size_t buflen; |
2476 | 2481 | ||
2477 | rx_queue = priv->rx_queue[tx_queue->qindex]; | 2482 | rx_queue = priv->rx_queue[tqi]; |
2483 | txq = netdev_get_tx_queue(dev, tqi); | ||
2478 | bdp = tx_queue->dirty_tx; | 2484 | bdp = tx_queue->dirty_tx; |
2479 | skb_dirtytx = tx_queue->skb_dirtytx; | 2485 | skb_dirtytx = tx_queue->skb_dirtytx; |
2480 | 2486 | ||
@@ -2533,6 +2539,8 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) | |||
2533 | bdp = next_txbd(bdp, base, tx_ring_size); | 2539 | bdp = next_txbd(bdp, base, tx_ring_size); |
2534 | } | 2540 | } |
2535 | 2541 | ||
2542 | bytes_sent += skb->len; | ||
2543 | |||
2536 | /* | 2544 | /* |
2537 | * If there's room in the queue (limit it to rx_buffer_size) | 2545 | * If there's room in the queue (limit it to rx_buffer_size) |
2538 | * we add this skb back into the pool, if it's the right size | 2546 | * we add this skb back into the pool, if it's the right size |
@@ -2557,13 +2565,15 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue) | |||
2557 | } | 2565 | } |
2558 | 2566 | ||
2559 | /* If we freed a buffer, we can restart transmission, if necessary */ | 2567 | /* If we freed a buffer, we can restart transmission, if necessary */ |
2560 | if (__netif_subqueue_stopped(dev, tx_queue->qindex) && tx_queue->num_txbdfree) | 2568 | if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree) |
2561 | netif_wake_subqueue(dev, tx_queue->qindex); | 2569 | netif_wake_subqueue(dev, tqi); |
2562 | 2570 | ||
2563 | /* Update dirty indicators */ | 2571 | /* Update dirty indicators */ |
2564 | tx_queue->skb_dirtytx = skb_dirtytx; | 2572 | tx_queue->skb_dirtytx = skb_dirtytx; |
2565 | tx_queue->dirty_tx = bdp; | 2573 | tx_queue->dirty_tx = bdp; |
2566 | 2574 | ||
2575 | netdev_tx_completed_queue(txq, howmany, bytes_sent); | ||
2576 | |||
2567 | return howmany; | 2577 | return howmany; |
2568 | } | 2578 | } |
2569 | 2579 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 4fe0f342acec..fc2488adca36 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h | |||
@@ -78,11 +78,8 @@ struct ethtool_rx_list { | |||
78 | #define INCREMENTAL_BUFFER_SIZE 512 | 78 | #define INCREMENTAL_BUFFER_SIZE 512 |
79 | 79 | ||
80 | #define PHY_INIT_TIMEOUT 100000 | 80 | #define PHY_INIT_TIMEOUT 100000 |
81 | #define GFAR_PHY_CHANGE_TIME 2 | ||
82 | 81 | ||
83 | #define DEVICE_NAME "%s: Gianfar Ethernet Controller Version 1.2, " | ||
84 | #define DRV_NAME "gfar-enet" | 82 | #define DRV_NAME "gfar-enet" |
85 | extern const char gfar_driver_name[]; | ||
86 | extern const char gfar_driver_version[]; | 83 | extern const char gfar_driver_version[]; |
87 | 84 | ||
88 | /* MAXIMUM NUMBER OF QUEUES SUPPORTED */ | 85 | /* MAXIMUM NUMBER OF QUEUES SUPPORTED */ |
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 5a78d55f46e7..8d74efd04bb9 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c | |||
@@ -58,7 +58,7 @@ static void gfar_gringparam(struct net_device *dev, struct ethtool_ringparam *rv | |||
58 | static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rvals); | 58 | static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rvals); |
59 | static void gfar_gdrvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo); | 59 | static void gfar_gdrvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo); |
60 | 60 | ||
61 | static char stat_gstrings[][ETH_GSTRING_LEN] = { | 61 | static const char stat_gstrings[][ETH_GSTRING_LEN] = { |
62 | "rx-dropped-by-kernel", | 62 | "rx-dropped-by-kernel", |
63 | "rx-large-frame-errors", | 63 | "rx-large-frame-errors", |
64 | "rx-short-frame-errors", | 64 | "rx-short-frame-errors", |