Commit 68fd20d3 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] 3c501 - fix end of small packet clearing

parent efa0596f
......@@ -36,6 +36,10 @@
Check up pass for 2.5. Nothing significant changed
20021009 Alan Cox <alan@redhat.com>
Fixed zero fill corner case
20030104 Alan Cox <alan@redhat.com>
For the avoidance of doubt the "preferred form" of this code is one which
is in an open non patent encumbered format. Where cryptographic key signing
......@@ -421,8 +425,15 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
do
{
int gp_start = 0x800 - (ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN);
int len = skb->len;
int pad = 0;
int gp_start;
unsigned char *buf = skb->data;
if (len < ETH_ZLEN)
pad = ETH_ZLEN - len;
gp_start = 0x800 - ( len + pad );
lp->tx_pkt_start = gp_start;
lp->collisions = 0;
......@@ -450,7 +461,11 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
outw(0x00, RX_BUF_CLR); /* Set rx packet area to 0. */
outw(gp_start, GP_LOW); /* aim - packet will be loaded into buffer start */
outsb(DATAPORT,buf,skb->len); /* load buffer (usual thing each byte increments the pointer) */
outsb(DATAPORT,buf,len); /* load buffer (usual thing each byte increments the pointer) */
if (pad) {
while(pad--) /* Zero fill buffer tail */
outb(0, DATAPORT);
}
outw(gp_start, GP_LOW); /* the board reuses the same register */
if(lp->loading != 2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment