From owner-freebsd-mobile Tue Feb 13 14:11:13 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from mta07-svc.ntlworld.com (mta07-svc.ntlworld.com [62.253.162.47]) by hub.freebsd.org (Postfix) with ESMTP id 0695437B6A3 for ; Tue, 13 Feb 2001 14:11:02 -0800 (PST) Received: from dmlb.org ([62.253.135.104]) by mta07-svc.ntlworld.com (InterMail vM.4.01.02.27 201-229-119-110) with ESMTP id <20010213221044.KWZP26323.mta07-svc.ntlworld.com@dmlb.org>; Tue, 13 Feb 2001 22:10:44 +0000 Received: from dmlb by dmlb.org with local (Exim 3.03 #1) id 14Snf2-0000DO-00; Tue, 13 Feb 2001 22:11:00 +0000 Content-Length: 6532 Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_=XFMail.1.3.p0.FreeBSD:010213221059:723=_" In-Reply-To: <200102062325.f16NPL987114@harmony.village.org> Date: Tue, 13 Feb 2001 22:10:59 -0000 (GMT) From: Duncan Barclay To: Warner Losh Subject: Re: AiroNet 'No card in database for "(null)"("(null)")' problem Cc: Anton Blanchard , Chris Yeoh , freebsd-mobile@FreeBSD.ORG, Greg Lehey , Simon Epsteyn Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This message is in MIME format --_=XFMail.1.3.p0.FreeBSD:010213221059:723=_ Content-Type: text/plain; charset=us-ascii On 06-Feb-01 Warner Losh wrote: > In message Simon > Epsteyn writes: >: On Tue, 6 Feb 2001, Warner Losh wrote: >: >: > In message >: > Simon Epsteyn writes: >: > : One could say "It's a pity this card doesn't work in FreeBSD" :) >: > >: > But it does work on FreeBSD. I have a very similar card that probes >: > w/o a problem. I think it may be a memory conflict. You'll notice >: > that Linux uses high memory (0x68000000) while we're trying to use >: > memory in the isa hole. >: >: Correct, I've helped people set up similiar cards on different laptops >: w/out any problems, the question is what do I do in FreeBSD to get it to >: work? > > Configure it correctly :-). We're working on making it easier to > configure, but right now it is a bit of a pain. Most of the pain is > well documented in the archives. Attached are patches that use a sysctl to change the start and end of where pccard thinks the ISA hole is. >: Is there a way to see what is using 0xd0000 area or a way to make pccardd >: use high memory? 0xd0000 is not pccardd - it's /sys/pccard stuff. Duncan --- ________________________________________________________________________ Duncan Barclay | God smiles upon the little children, dmlb@dmlb.org | the alcoholics, and the permanently stoned. dmlb@freebsd.org| Steven King --_=XFMail.1.3.p0.FreeBSD:010213221059:723=_ Content-Disposition: attachment; filename="sys.pccard.patch" Content-Transfer-Encoding: 7bit Content-Description: sys.pccard.patch Content-Type: text/plain; charset=us-ascii; name=sys.pccard.patch; SizeOnDisk=4650 Index: cardinfo.h =================================================================== RCS file: /steer/ncvs/src/sys/pccard/cardinfo.h,v retrieving revision 1.19 diff -u -r1.19 cardinfo.h --- cardinfo.h 2000/10/26 19:46:20 1.19 +++ cardinfo.h 2001/01/28 12:28:57 @@ -123,8 +123,8 @@ struct slotstate { enum cardstate state; /* Current state of slot */ enum cardstate laststate; /* Previous state of slot */ - int maxmem; /* Max allowed memory windows */ - int maxio; /* Max allowed I/O windows */ +/*XXX*/ int maxmem; /* Max allowed memory windows */ +/*XXX*/ int maxio; /* Max allowed I/O windows */ int irqs; /* Bitmap of IRQs allowed */ int flags; /* Capability flags */ }; @@ -152,6 +152,7 @@ /* * Other system limits */ +/* XXX */ #define MAXSLOT 16 #define NUM_MEM_WINDOWS 10 #define NUM_IO_WINDOWS 6 Index: pccard.c =================================================================== RCS file: /steer/ncvs/src/sys/pccard/pccard.c,v retrieving revision 1.116 diff -u -r1.116 pccard.c --- pccard.c 2001/01/09 04:33:39 1.116 +++ pccard.c 2001/01/28 12:28:23 @@ -376,12 +376,12 @@ if (pccard_mem == 0) return(ENOMEM); for (win = 0; win < slt->ctrl->maxmem; win++) - if ((slt->mem[win].flags & MDF_ACTIVE) == 0) +/*XXX*/ if ((slt->mem[win].flags & MDF_ACTIVE) == 0) break; if (win >= slt->ctrl->maxmem) return(EBUSY); mp = &slt->mem[win]; - oldmap = *mp; + oldmap = *mp; mp->flags = slt->rwmem|MDF_ACTIVE; while (uio->uio_resid && error == 0) { mp->card = uio->uio_offset; @@ -422,7 +422,7 @@ if (pccard_mem == 0) return(ENOMEM); for (win = 0; win < slt->ctrl->maxmem; win++) - if ((slt->mem[win].flags & MDF_ACTIVE) == 0) +/*XXX*/ if ((slt->mem[win].flags & MDF_ACTIVE) == 0) break; if (win >= slt->ctrl->maxmem) return(EBUSY); Index: pccard_nbk.c =================================================================== RCS file: /steer/ncvs/src/sys/pccard/pccard_nbk.c,v retrieving revision 1.25 diff -u -r1.25 pccard_nbk.c --- pccard_nbk.c 2001/01/09 04:33:39 1.25 +++ pccard_nbk.c 2001/01/28 20:11:03 @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -77,6 +78,16 @@ #define PCCARD_DEVINFO(d) (struct pccard_devinfo *) device_get_ivars(d) +SYSCTL_NODE(_machdep, OID_AUTO, pccard, CTLFLAG_RW, 0, "pccard"); + +static u_long pcic_mem_start = 0xd0000; +static u_long pcic_mem_end = 0xdffff; + +SYSCTL_ULONG(_machdep_pccard, OID_AUTO, pcic_mem_start, CTLFLAG_RW, + &pcic_mem_start, 0, ""); +SYSCTL_ULONG(_machdep_pccard, OID_AUTO, pcic_mem_end, CTLFLAG_RW, + &pcic_mem_end, 0, ""); + /* * glue for NEWCARD/OLDCARD compat layer */ @@ -215,7 +226,7 @@ { /* * Consider adding a resource definition. We allow rid 0 for - * irq, 0-3 for memory and 0-1 for ports + * irq, 0-4 for memory and 0-1 for ports */ int passthrough = (device_get_parent(child) != bus); int isdefault; @@ -225,8 +236,8 @@ struct resource *res; if (start == 0 && end == ~0 && type == SYS_RES_MEMORY && count != 1) { - start = 0xd0000; - end = 0xdffff; + start = pcic_mem_start; + end = pcic_mem_end; } isdefault = (start == 0UL && end == ~0UL); if (!passthrough && !isdefault) { @@ -254,6 +265,7 @@ default: return 0; } +printf("resource_list_add rid %d, start %lx, end %lx, count %lx\n", *rid, start , end, count); resource_list_add(rl, type, *rid, start, end, count); } } Index: pcic.c =================================================================== RCS file: /steer/ncvs/src/sys/pccard/pcic.c,v retrieving revision 1.103 diff -u -r1.103 pcic.c --- pcic.c 2001/01/09 23:39:32 1.103 +++ pcic.c 2001/01/28 19:57:27 @@ -44,6 +44,7 @@ #include #include +#include #include "card_if.h" /* @@ -158,6 +159,8 @@ struct mem_desc *mp = &slt->mem[win]; int reg = win * PCIC_MEMSIZE + PCIC_MEMBASE; + if (win < 0 || win >= slt->ctrl->maxmem) + panic("Illegal PCIC MEMORY window request!"); if (mp->flags & MDF_ACTIVE) { unsigned long sys_addr = (uintptr_t)(void *)mp->start >> 12; /* @@ -929,14 +932,17 @@ case SYS_RES_MEMORY: { struct mem_desc *mp = &devi->slt->mem[rid]; switch (value) { - case 0: + case PCCARD_A_MEM_COM: mp->flags &= ~MDF_ATTR; break; - case 1: + case PCCARD_A_MEM_ATTR: mp->flags |= MDF_ATTR; break; - case 2: + case PCCARD_A_MEM_8BIT: mp->flags &= ~MDF_16BITS; + break; + case PCCARD_A_MEM_16BIT: + mp->flags |= MDF_16BITS; break; } err = pcic_memory(devi->slt, rid); --_=XFMail.1.3.p0.FreeBSD:010213221059:723=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message