Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] airo.c fix for hppa and others
@ 2002-12-05 22:18 LaMont Jones
  2002-12-06  0:16 ` [parisc-linux] " LaMont Jones
  0 siblings, 1 reply; 2+ messages in thread
From: LaMont Jones @ 2002-12-05 22:18 UTC (permalink / raw)
  To: parisc-linux; +Cc: lamont

Here's the patch that actually works.

airo.c is vs 2.4.20, the checksum.h patch (which is purely performance) is vs
2.4.19 which is probably the same as 2.4.20...

The airo.c patch is critical and sufficient.  The other is for comment,
should anyone care.

lamont

diff -ur x/kernel-source-2.4.19-hppa/drivers/net/wireless/airo.c kernel-source-2.4.19-hppa/drivers/net/wireless/airo.c
--- x/kernel-source-2.4.19-hppa/drivers/net/wireless/airo.c	2002-12-05 15:13:42.000000000 -0700
+++ kernel-source-2.4.19-hppa/drivers/net/wireless/airo.c	2002-12-05 15:15:24.000000000 -0700
@@ -1966,7 +1966,7 @@
 #pragma pack()
 			u16 gap;
 			u16 tmpbuf[4];
-			u16 *buffer;
+			u16 *buffer=NULL;
 
 			fid = IN4500( apriv, RXFID );
 
@@ -2011,13 +2011,14 @@
 				} else
 					hdrlen = ETH_ALEN * 2;
 
-				skb = dev_alloc_skb( len + hdrlen + 2 );
+				skb = dev_alloc_skb( len + hdrlen + 4 );
 				if ( !skb ) {
 					apriv->stats.rx_dropped++;
 					len = 0;
 				}
 			}
 			if (len) {
+				skb_reserve(skb, 2);	/* Align IP on 16 byte boundaries */
 				buffer = (u16*)skb_put (skb, len + hdrlen);
 				if (apriv->flags & FLAG_802_11) {
 					buffer[0] = fc;
@@ -4008,6 +4009,10 @@
 {
 	struct net_device *dev;
 
+	if (pci_enable_device(pdev))
+		return -ENODEV;
+	pci_set_master(pdev);
+
 	dev = init_airo_card(pdev->irq,	pdev->resource[2].start, 0);
 	if (!dev)
 		return -ENODEV;
diff -ur x/kernel-source-2.4.19-hppa/include/asm-parisc/checksum.h kernel-source-2.4.19-hppa/include/asm-parisc/checksum.h
--- x/kernel-source-2.4.19-hppa/include/asm-parisc/checksum.h	2002-02-12 22:16:45.000000000 -0700
+++ kernel-source-2.4.19-hppa/include/asm-parisc/checksum.h	2002-12-05 12:03:48.000000000 -0700
@@ -54,7 +54,8 @@
 /*
  *	Optimized for IP headers, which always checksum on 4 octet boundaries.
  *
- *	Written by Randolph Chung <tausq@debian.org>
+ *	Written by Randolph Chung <tausq@debian.org>, and then mucked with by
+ *	LaMont Jones <lamont@debian.org>
  */
 static inline unsigned short ip_fast_csum(unsigned char * iph,
 					  unsigned int ihl) {
@@ -63,27 +64,23 @@
 
 	__asm__ __volatile__ (
 "	ldws,ma		4(%1), %0\n"
-"	addi		-4, %2, %2\n"
-"	comib,>=	0, %2, 2f\n"
+"	addib,<=	-4, %2, 2f\n"
 "\n"
-"	ldws,ma		4(%1), %%r19\n"
-"	add		%0, %%r19, %0\n"
-"	ldws,ma		4(%1), %%r19\n"
-"	addc		%0, %%r19, %0\n"
-"	ldws,ma		4(%1), %%r19\n"
+"	ldws		4(%1), %%r20\n"
+"	ldws		8(%1), %%r21\n"
+"	add		%0, %%r20, %0\n"
+"	ldws,ma		12(%1), %%r19\n"
+"	addc		%0, %%r21, %0\n"
 "	addc		%0, %%r19, %0\n"
 "1:	ldws,ma		4(%1), %%r19\n"
-"	addib,<>	-1, %2, 1b\n"
+"	addib,<		0, %2, 1b\n"
 "	addc		%0, %%r19, %0\n"
-"	addc		%0, %%r0, %0\n"
 "\n"
-"	zdepi		-1, 31, 16, %%r19\n"
-"	and		%0, %%r19, %%r20\n"
+"	extru		%0, 31, 16, %%r20\n"
 "	extru		%0, 15, 16, %%r21\n"
-"	add		%%r20, %%r21, %0\n"
-"	and		%0, %%r19, %%r20\n"
+"	addc		%%r20, %%r21, %0\n"
 "	extru		%0, 15, 16, %%r21\n"
-"	add		%%r20, %%r21, %0\n"
+"	add		%0, %%r21, %0\n"
 "	subi		-1, %0, %0\n"
 "2:\n"
 	: "=r" (sum), "=r" (iph), "=r" (ihl)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [parisc-linux] Re: airo.c fix for hppa and others
  2002-12-05 22:18 [parisc-linux] airo.c fix for hppa and others LaMont Jones
@ 2002-12-06  0:16 ` LaMont Jones
  0 siblings, 0 replies; 2+ messages in thread
From: LaMont Jones @ 2002-12-06  0:16 UTC (permalink / raw)
  To: LaMont Jones; +Cc: lamont

On Thu, Dec 05, 2002 at 03:18:45PM -0700, LaMont Jones wrote:

And lets not forget the (already committed?) dino patch:

lamont

diff -ur x/kernel-source-2.4.19-hppa/drivers/gsc/dino.c kernel-source-2.4.19-hppa/drivers/gsc/dino.c
--- x/kernel-source-2.4.19-hppa/drivers/gsc/dino.c	2002-07-14 13:51:42.000000000 -0600
+++ kernel-source-2.4.19-hppa/drivers/gsc/dino.c	2002-12-04 07:07:52.000000000 -0700
@@ -251,7 +251,7 @@
 	unsigned long flags; \
 	spin_lock_irqsave(&(DINO_DEV(d)->dinosaur_pen), flags); \
 	/* tell HW which IO Port address */ \
-	gsc_writel((u32) addr & ~3, d->base_addr + DINO_PCI_ADDR); \
+	gsc_writel((u32) addr, d->base_addr + DINO_PCI_ADDR); \
 	/* generate I/O PORT read cycle */ \
 	v = gsc_read##type(d->base_addr+DINO_IO_DATA+(addr&mask)); \
 	spin_unlock_irqrestore(&(DINO_DEV(d)->dinosaur_pen), flags); \

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-06  0:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-05 22:18 [parisc-linux] airo.c fix for hppa and others LaMont Jones
2002-12-06  0:16 ` [parisc-linux] " LaMont Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox