Skip to content

Commit

Permalink
ucc_geth: Fix BD processing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Yang authored and Jeff Garzik committed Mar 6, 2007
1 parent 6006f7f commit a394f01
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3598,9 +3598,9 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)

/* Move to next BD in the ring */
if (!(bd_status & T_W))
ugeth->txBd[txQ] = bd + sizeof(struct qe_bd);
bd += sizeof(struct qe_bd);
else
ugeth->txBd[txQ] = ugeth->p_tx_bd_ring[txQ];
bd = ugeth->p_tx_bd_ring[txQ];

/* If the next BD still needs to be cleaned up, then the bds
are full. We need to tell the kernel to stop sending us stuff. */
Expand All @@ -3609,6 +3609,8 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
}

ugeth->txBd[txQ] = bd;

if (ugeth->p_scheduler) {
ugeth->cpucount[txQ]++;
/* Indicate to QE that there are more Tx bds ready for
Expand Down Expand Up @@ -3722,7 +3724,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
/* Handle the transmitted buffer and release */
/* the BD to be used with the current frame */

if ((bd = ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
break;

ugeth->stats.tx_packets++;
Expand All @@ -3741,10 +3743,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)

/* Advance the confirmation BD pointer */
if (!(bd_status & T_W))
ugeth->confBd[txQ] += sizeof(struct qe_bd);
bd += sizeof(struct qe_bd);
else
ugeth->confBd[txQ] = ugeth->p_tx_bd_ring[txQ];
bd = ugeth->p_tx_bd_ring[txQ];
bd_status = in_be32((u32 *)bd);
}
ugeth->confBd[txQ] = bd;
return 0;
}

Expand Down

0 comments on commit a394f01

Please sign in to comment.