patch-1.3.6 linux/drivers/net/hp100.c

Next file: linux/drivers/net/ibmtr.c
Previous file: linux/drivers/net/ewrk3.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.5/linux/drivers/net/hp100.c linux/drivers/net/hp100.c
@@ -585,7 +585,12 @@
       printk( "hp100_rx: new packet - length = %d, errors = 0x%x, dest = 0x%x\n",
       	header & HP100_PKT_LEN_MASK, ( header >> 16 ) & 0xfff8, ( header >> 16 ) & 7 );
 #endif
-      skb = alloc_skb( ( pkt_len + 3 ) & ~3, GFP_ATOMIC );
+      /*
+       * NOTE! This (and the skb_put() below) depends on the skb-functions
+       * allocating more than asked (notably, aligning the request up to
+       * the next 16-byte length).
+       */
+      skb = dev_alloc_skb(pkt_len);
       if ( skb == NULL )
         {
 #ifdef HP100_DEBUG
@@ -595,9 +600,8 @@
         }
        else
         {
-          skb -> len = pkt_len;
           skb -> dev = dev;
-          insl( ioaddr + HP100_REG_DATA32, skb -> data, ( pkt_len + 3 ) >> 2 );
+          insl( ioaddr + HP100_REG_DATA32, skb_put(pkt_len), ( pkt_len + 3 ) >> 2 );
           skb->protocol=eth_type_trans(skb,dev);
           netif_rx( skb );
           lp -> stats.rx_packets++;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this