From: lamont@b180.mmjgroup.com (LaMont Jones)
To: parisc-linux@parisc-linux.org
Cc: lamont@hp.com
Subject: [parisc-linux] airo.c fix for hppa and others
Date: Thu, 5 Dec 2002 15:18:45 -0700 [thread overview]
Message-ID: <20021205221845.GA22847@b180.mmjgroup.com> (raw)
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)
next reply other threads:[~2002-12-05 22:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-05 22:18 LaMont Jones [this message]
2002-12-06 0:16 ` [parisc-linux] Re: airo.c fix for hppa and others LaMont Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021205221845.GA22847@b180.mmjgroup.com \
--to=lamont@b180.mmjgroup.com \
--cc=lamont@hp.com \
--cc=parisc-linux@parisc-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox