[Prism54-devel] sparc64 patch

Clint Adams schizo@debian.org
Mon, 19 Jan 2004 21:31:07 -0500


Redone with ptrdiff_t; not sure if this is a legitimate use, but it
fails to work just as well as the other way.

Index: ksrc/islpci_eth.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.c,v
retrieving revision 1.21
diff -u -r1.21 islpci_eth.c
--- ksrc/islpci_eth.c	8 Jan 2004 04:14:40 -0000	1.21
+++ ksrc/islpci_eth.c	20 Jan 2004 02:29:03 -0000
@@ -155,9 +155,9 @@
 	/* Check alignment and WDS frame formatting. The start of the packet should
 	 * be aligned on a 4-byte boundary. If WDS is enabled add another 6 bytes
 	 * and add WDS address information */
-	if (((int) skb->data & 0x03) | init_wds) {
+	if (((ptrdiff_t) skb->data & 0x03) | init_wds) {
 		/* get the number of bytes to add and re-allign */
-		offset = (4 - (int) skb->data) & 0x03;
+		offset = (4 - (ptrdiff_t) skb->data) & 0x03;
 		offset += init_wds ? 6 : 0;
 
 		/* check whether the current skb can be used  */
@@ -170,7 +170,7 @@
 #endif
 
 			/* allign the buffer on 4-byte boundary */
-			skb_reserve(skb, (4 - (int) skb->data) & 0x03);
+			skb_reserve(skb, (4 - (ptrdiff_t) skb->data) & 0x03);
 			if (init_wds) {
 				/* wds requires an additional address field of 6 bytes */
 				skb_put(skb, 6);
@@ -190,7 +190,7 @@
 		} else {
 			newskb =
 			    dev_alloc_skb(init_wds ? skb->len + 6 : skb->len);
-			newskb_offset = (4 - (int) newskb->data) & 0x03;
+			newskb_offset = (4 - (ptrdiff_t) newskb->data) & 0x03;
 
 			/* Check if newskb->data is aligned */
 			if (newskb_offset)
@@ -320,7 +320,7 @@
 #endif
 	struct sk_buff *skb;
 	u16 size;
-	u32 index, offset;
+	ptrdiff_t index, offset;
 	unsigned char *src;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
@@ -332,8 +332,8 @@
 	index = priv->free_data_rx % ISL38XX_CB_RX_QSIZE;
 	size = le16_to_cpu(control_block->rx_data_low[index].size);
 	skb = priv->data_low_rx[index];
-	offset = ((u32) le32_to_cpu(control_block->rx_data_low[index].address) -
-		  (u32) skb->data) & 3;
+	offset = ((ptrdiff_t) le32_to_cpu(control_block->rx_data_low[index].address) -
+		  (ptrdiff_t) skb->data) & 3;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
 	DEBUG(SHOW_TRACING,
Index: ksrc/islpci_mgt.h
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.h,v
retrieving revision 1.19.2.1
diff -u -r1.19.2.1 islpci_mgt.h
--- ksrc/islpci_mgt.h	11 Jan 2004 19:41:45 -0000	1.19.2.1
+++ ksrc/islpci_mgt.h	20 Jan 2004 02:29:03 -0000
@@ -75,7 +75,7 @@
 #define SHOW_QUEUE_INDEXES                      0x10
 #define SHOW_PIMFOR_FRAMES                      0x20
 #define SHOW_BUFFER_CONTENTS                    0x40
-#define VERBOSE                                 0x01
+#define VERBOSE                                 0xFF
 
 /* Default card definitions */
 #define CARD_DEFAULT_CHANNEL                    6