patch-2.4.21 linux-2.4.21/drivers/net/ni5010.c
Next file: linux-2.4.21/drivers/net/ni52.c
Previous file: linux-2.4.21/drivers/net/mii.c
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
2003-06-13 07:51:35.000000000 -0700
- Orig file:
linux-2.4.20/drivers/net/ni5010.c
- Orig date:
2001-09-30 12:26:07.000000000 -0700
diff -urN linux-2.4.20/drivers/net/ni5010.c linux-2.4.21/drivers/net/ni5010.c
@@ -114,7 +114,7 @@
static int process_xmt_interrupt(struct net_device *dev);
#define tx_done(dev) 1
-static void hardware_send_packet(struct net_device *dev, char *buf, int length);
+static void hardware_send_packet(struct net_device *dev, char *buf, int length, int pad);
static void chipset_init(struct net_device *dev, int startp);
static void dump_packet(void *buf, int len);
static void ni5010_show_registers(struct net_device *dev);
@@ -437,7 +437,7 @@
*/
netif_stop_queue(dev);
- hardware_send_packet(dev, (unsigned char *)skb->data, length);
+ hardware_send_packet(dev, (unsigned char *)skb->data, skb->len, length-skb->len);
dev->trans_start = jiffies;
dev_kfree_skb (skb);
return 0;
@@ -661,7 +661,7 @@
}
}
-static void hardware_send_packet(struct net_device *dev, char *buf, int length)
+static void hardware_send_packet(struct net_device *dev, char *buf, int length, int pad)
{
struct ni5010_local *lp = (struct ni5010_local *)dev->priv;
int ioaddr = dev->base_addr;
@@ -686,8 +686,8 @@
if (NI5010_DEBUG > 3) dump_packet(buf, length);
- buf_offs = NI5010_BUFSIZE - length;
- lp->o_pkt_size = length;
+ buf_offs = NI5010_BUFSIZE - length - pad;
+ lp->o_pkt_size = length + pad;
save_flags(flags);
cli();
@@ -698,6 +698,9 @@
outw(buf_offs, IE_GP); /* Point GP at start of packet */
outsb(IE_XBUF, buf, length); /* Put data in buffer */
+ while(pad--)
+ outb(0, IE_XBUF);
+
outw(buf_offs, IE_GP); /* Rewrite where packet starts */
/* should work without that outb() (Crynwr used it) */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)