aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth.c
diff options
context:
space:
mode:
authorLi Yang <leoli@freescale.com>2007-03-06 03:53:46 -0500
committerJeff Garzik <jeff@garzik.org>2007-03-06 06:10:01 -0500
commita394f013f05ba083d8547551280e0309ca70b08d (patch)
tree59882986e88fc194bafeb0b6708b98ec5e117be2 /drivers/net/ucc_geth.c
parent6006f7f517b9a754e4c4628755c62872e322c68a (diff)
ucc_geth: Fix BD processing
Fix broken BD processing code. Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r--drivers/net/ucc_geth.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 885e73d731c2..639e1e6913bf 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3598,9 +3598,9 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
3598 3598
3599 /* Move to next BD in the ring */ 3599 /* Move to next BD in the ring */
3600 if (!(bd_status & T_W)) 3600 if (!(bd_status & T_W))
3601 ugeth->txBd[txQ] = bd + sizeof(struct qe_bd); 3601 bd += sizeof(struct qe_bd);
3602 else 3602 else
3603 ugeth->txBd[txQ] = ugeth->p_tx_bd_ring[txQ]; 3603 bd = ugeth->p_tx_bd_ring[txQ];
3604 3604
3605 /* If the next BD still needs to be cleaned up, then the bds 3605 /* If the next BD still needs to be cleaned up, then the bds
3606 are full. We need to tell the kernel to stop sending us stuff. */ 3606 are full. We need to tell the kernel to stop sending us stuff. */
@@ -3609,6 +3609,8 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
3609 netif_stop_queue(dev); 3609 netif_stop_queue(dev);
3610 } 3610 }
3611 3611
3612 ugeth->txBd[txQ] = bd;
3613
3612 if (ugeth->p_scheduler) { 3614 if (ugeth->p_scheduler) {
3613 ugeth->cpucount[txQ]++; 3615 ugeth->cpucount[txQ]++;
3614 /* Indicate to QE that there are more Tx bds ready for 3616 /* Indicate to QE that there are more Tx bds ready for
@@ -3722,7 +3724,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
3722 /* Handle the transmitted buffer and release */ 3724 /* Handle the transmitted buffer and release */
3723 /* the BD to be used with the current frame */ 3725 /* the BD to be used with the current frame */
3724 3726
3725 if ((bd = ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0)) 3727 if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
3726 break; 3728 break;
3727 3729
3728 ugeth->stats.tx_packets++; 3730 ugeth->stats.tx_packets++;
@@ -3741,10 +3743,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
3741 3743
3742 /* Advance the confirmation BD pointer */ 3744 /* Advance the confirmation BD pointer */
3743 if (!(bd_status & T_W)) 3745 if (!(bd_status & T_W))
3744 ugeth->confBd[txQ] += sizeof(struct qe_bd); 3746 bd += sizeof(struct qe_bd);
3745 else 3747 else
3746 ugeth->confBd[txQ] = ugeth->p_tx_bd_ring[txQ]; 3748 bd = ugeth->p_tx_bd_ring[txQ];
3749 bd_status = in_be32((u32 *)bd);
3747 } 3750 }
3751 ugeth->confBd[txQ] = bd;
3748 return 0; 3752 return 0;
3749} 3753}
3750 3754