Subject: Re: `ath' cannot attach to `pci'
To: Joel CARNAT <joel@carnat.net>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-xen
Date: 03/29/2006 00:14:47
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Mar 28, 2006 at 11:03:00PM +0200, Joel CARNAT wrote:
> Hi,
> 
> can I use my Atheros WiFi card (PCI) on NetBSD/xen ?
> 
> I have just uncommented "ath*    at pci? dev ? function ?" from GENERIC
> and when using "config", I get:
> 	`ath' cannot attach to `pci'

Hi,
can you try the attached patch ? With this a kenrel builds for me, but I
can't test it.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: xen/conf/Makefile.xen
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/conf/Makefile.xen,v
retrieving revision 1.5
diff -u -r1.5 Makefile.xen
--- xen/conf/Makefile.xen	21 Jun 2004 18:20:09 -0000	1.5
+++ xen/conf/Makefile.xen	28 Mar 2006 22:08:30 -0000
@@ -111,6 +111,22 @@
 
 %RULES
 
+# XXX - Ugly, but make doesn't easily handle .o.uue (assumes it's a suffix)
+# XXX - Also, config has no simple was to just add foo.o to the Makefile. 
+#       It needs a pathname of some sort for "object"        
+.if !empty(OBJS:M\/athhal-elf.o)
+OBJS:=${OBJS:C/\/athhal-elf.o/athhal-elf.o/}
+ 
+.PATH: $S/../contrib/sys/arch/i386/dev
+ATH_UUDEC?=	@${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \
+		${_MKSHECHO}\
+		${UUDECODE} -p $> \> ${.TARGET}; \
+		rm -f ${.TARGET}; \
+		${UUDECODE} -p $> > ${.TARGET}
+athhal-elf.o: athhal-elf-o.uue
+	${ATH_UUDEC}
+.endif
+
 ##
 ## (9) port independent kernel machinery
 ##
Index: xen/conf/files.xen
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/conf/files.xen,v
retrieving revision 1.18.2.7
diff -u -r1.18.2.7 files.xen
--- xen/conf/files.xen	5 Jan 2006 05:28:11 -0000	1.18.2.7
+++ xen/conf/files.xen	28 Mar 2006 22:08:30 -0000
@@ -159,6 +159,11 @@
 include "dev/pci/files.agp"
 file 	arch/i386/pci/agp_machdep.c	agp
 file	arch/xen/xen/pciide_machdep.c	pciide_common
+
+# Atheros 5210/5211/5212 Hardware Abstraction Layer (HAL)
+include	"dev/pci/files.ath"
+object	/athhal-elf.o	ath
+
 #
 # Machine-independent ISA devices
 #

--opJtzjQTFsWo+cga--