Subject: Re: kern/34045: ath0 not working on Lenovo T60 laptop under -current: pci_mem_find problems
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Martin Husemann <martin@duskware.de>
List: netbsd-bugs
Date: 07/31/2006 23:10:04
The following reply was made to PR kern/34045; it has been noted by GNATS.
From: Martin Husemann <martin@duskware.de>
To: Brian de Alwis <bsd@cs.ubc.ca>, gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/34045: ath0 not working on Lenovo T60 laptop under -current: pci_mem_find problems
Date: Tue, 1 Aug 2006 01:09:41 +0200
--DocE+STaALJfprDB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Could you try this patch?
Thanks,
Martin
--DocE+STaALJfprDB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch
Index: if_ath_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ath_pci.c,v
retrieving revision 1.15
diff -u -r1.15 if_ath_pci.c
--- if_ath_pci.c 14 Jul 2006 13:37:25 -0000 1.15
+++ if_ath_pci.c 31 Jul 2006 23:07:30 -0000
@@ -169,6 +169,7 @@
struct pci_attach_args *pa = aux;
pci_chipset_tag_t pc = pa->pa_pc;
pci_intr_handle_t ih;
+ pcireg_t mem_type;
void *phook;
const char *intrstr = NULL;
@@ -182,7 +183,13 @@
/*
* Setup memory-mapping of PCI registers.
*/
- if (pci_mapreg_map(pa, BS_BAR, PCI_MAPREG_TYPE_MEM, 0, &psc->sc_iot,
+ mem_type = pci_mapreg_type(pc, pa->pa_tag, BS_BAR);
+ if (mem_type != PCI_MAPREG_TYPE_MEM &&
+ mem_type != PCI_MAPREG_MEM_TYPE_64BIT) {
+ aprint_error("bad pci register type %d\n", (int)mem_type);
+ goto bad;
+ }
+ if (pci_mapreg_map(pa, BS_BAR, mem_type, 0, &psc->sc_iot,
&psc->sc_ioh, NULL, NULL)) {
aprint_error("cannot map register space\n");
goto bad;
--DocE+STaALJfprDB--