Date: Wed, 29 Aug 2001 22:05:52 -0600 From: Warner Losh <imp@harmony.village.org> To: Allen Landsidel <all@biosys.net>, freebsd-mobile@FreeBSD.ORG Subject: Re: Getting closer.. Message-ID: <200108300405.f7U45qn17415@harmony.village.org> In-Reply-To: Your message of "Wed, 29 Aug 2001 22:02:29 MDT." <200108300402.f7U42Tn17359@harmony.village.org> References: <200108300402.f7U42Tn17359@harmony.village.org> <5.1.0.14.0.20010829235424.00c34fd0@rfnj.org> <Your message of "Wed, 29 Aug 2001 21:46:57 EDT." <5.1.0.14.0.20010829214607.00bc6628@rfnj.org> <5.1.0.14.0.20010829214607.00bc6628@rfnj.org>
next in thread | previous in thread | raw e-mail | index | archive | help
No, try this one instead... The last one wasn't right.
Warner
Index: pcic_pci.c
===================================================================
RCS file: /cache/ncvs/src/sys/pccard/pcic_pci.c,v
retrieving revision 1.54.2.12
diff -u -r1.54.2.12 pcic_pci.c
--- pcic_pci.c 2001/08/27 16:34:03 1.54.2.12
+++ pcic_pci.c 2001/08/30 04:04:15
@@ -706,8 +706,10 @@
struct pcic_slot *sp;
struct pcic_softc *sc;
u_int32_t sockbase;
+ u_int32_t stat;
struct pcic_pci_table *itm;
int rid;
+ int i;
struct resource *r = NULL;
int error;
u_long irq = 0;
@@ -732,15 +734,19 @@
&sc->iorid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
if (sc->iores == NULL)
return (ENOMEM);
- sp->getb = pcic_getb_io;
- sp->putb = pcic_putb_io;
sp->bst = rman_get_bustag(sc->iores);
sp->bsh = rman_get_bushandle(sc->iores);
- sp->offset = pci_get_function(dev) * PCIC_SLOT_SIZE;
sp->controller = PCIC_PD672X;
sp->revision = 0;
sc->flags = PCIC_PD_POWER;
itm = pcic_pci_lookup(device_id, &pcic_pci_devs[0]);
+ for (i = 0; i < 2; i++) {
+ sp[i].getb = pcic_getb_io;
+ sp[i].putb = pcic_putb_io;
+ sp[i].offset = i * PCIC_SLOT_SIZE;
+ if (sp[i].getb(sp, PCIC_ID_REV) & 0xc0 == 0x80)
+ sp[i].slt = (struct slot *) 1;
+ }
} else {
sc->memrid = CB_PCI_SOCKET_BASE;
sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY,
@@ -763,11 +769,11 @@
sp->revision = 0;
sc->flags = PCIC_DF_POWER;
}
+ sp->slt = (struct slot *) 1;
}
sc->dev = dev;
sc->csc_route = pcic_intr_path;
sc->func_route = pcic_intr_path;
- sp->slt = (struct slot *) 1;
if (sc->csc_route == pcic_iw_pci) {
rid = 0;
@@ -827,6 +833,8 @@
}
}
+ stat = bus_space_read_4(sp->bst, sp->bsh, CB_SOCKET_STATE);
+ sc->cd_present = (stat & CB_SS_CD) == 0;
return (pcic_attach(dev));
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108300405.f7U45qn17415>
