patch-2.2.16 linux/drivers/net/smc9194.c

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

diff -urN v2.2.15/linux/drivers/net/smc9194.c linux/drivers/net/smc9194.c
@@ -45,10 +45,12 @@
  .				 Fixed bug reported by Gardner Buchanan in
  .				   smc_enable, with outw instead of outb
  .	03/06/96  Erik Stahlman  Added hardware multicast from Peter Cammaert
+ .	04/14/00  Heiko Pruessing (SMA Regelsysteme)  Fixed bug in chip memory
+ .				 allocation
  ----------------------------------------------------------------------------*/
 
 static const char *version =
-	"smc9194.c:v0.12 03/06/96 by Erik Stahlman (erik@vt.edu)\n";
+	"smc9194.c:v0.13 04/14/00 by Erik Stahlman (erik@vt.edu)\n";
 
 #ifdef MODULE
 #include <linux/module.h>
@@ -562,11 +564,15 @@
 
 	length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
 
+		
 	/*
-	. the MMU wants the number of pages to be the number of 256 bytes
-    	. 'pages', minus 1 ( since a packet can't ever have 0 pages :) )
+	** The MMU wants the number of pages to be the number of 256 bytes
+	** 'pages', minus 1 ( since a packet can't ever have 0 pages :) )
+	**
+	** Pkt size for allocating is data length +6 (for additional status words,
+	** length and ctl!) If odd size last byte is included in this header.
 	*/
-	numPages = length / 256;
+	numPages =  ((length & 0xfffe) + 6) / 256;
 
 	if (numPages > 7 ) {
 		printk(CARDNAME": Far too big packet error. \n");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)