Subject: kern/12356: an driver alignment problem on netbsd/alpha
To: None <gnats-bugs@gnats.netbsd.org>
From: None <feico@pasta.cs.uit.no>
List: netbsd-bugs
Date: 03/08/2001 12:57:44
>Number:         12356
>Category:       kern
>Synopsis:       an driver alignment problem on netbsd/alpha
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 08 03:58:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Feico Dillema
>Release:        NetBSD-1.5 and NetBSD-current Mar 8 2001
>Organization:
University of Tromsoe
>Environment:
System: NetBSD 1.5.x Architecture: alpha Machine: DEC Multia
>Description:
	an driver does not work on alpha due to alignment problem
>How-To-Repeat:
	insert Cisco Aironet card in your alpha box, configure the
interface. try to ping the machine and the machine will panic. pinging
from the machine will not put anything on the wire.
>Fix:
	the fix is simple and has been `stolen' from the wi driver
(sys/dev/pcmcia/if_wi.c). The patch below is for the NetBSD-1.5.1
branch, but it should also apply for NetBSD­current but at line 403 of
an.c.

--- an.c	Thu Mar  8 12:52:09 2001
+++ an.c.alpha	Thu Mar  8 12:50:24 2001
@@ -387,6 +387,9 @@
 
 	m->m_pkthdr.rcvif = ifp;
 
+        /* Align the data after the ethernet header */
+        m->m_data = (caddr_t) ALIGN(m->m_data + sizeof(struct ether_header))
+            - sizeof(struct ether_header);  
 	eh = mtod(m, struct ether_header *);
 
 #ifdef ANCACHE
>Release-Note:
>Audit-Trail:
>Unformatted: