pcic->sc_memh = memh;
if (bus_space_map(pia->pia_memt, pia->pia_maddr, pia->pia_msize, 0, &pcic->sc_memh)) return 0;
pcic_probe(parent, self, aux)	struct device	*parent;	void		*self;	void            *aux;{	struct pcic_softc *pcic = self;	struct pcicmaster_softc *pcicm = (struct pcicmaster_softc *) parent;	struct pcic_attach_args *pia = aux;	bus_space_handle_t memh;	u_int           chip_inf = 0, ochip_inf = 0;	int first = 1;	int             i, j, maxslot;	bzero(pcic->slot, sizeof(pcic->slot));	if (PDEBUG(PCDCONF)) {		printf("pcic_probe controller %d unit %d\n", pia->pia_ctlr,		       pcic->sc_dev.dv_unit);		delay(2000000);	}	if (pcicm->sc_slavestate[pia->pia_ctlr] != SLAVE_FOUND)		return 0;	if (pcic->sc_dev.dv_cfdata->cf_loc[1] == -1 ||	    pcic->sc_dev.dv_cfdata->cf_loc[2] == 0)		return 0;	/*	 * select register offsets based on which controller we are.	 * 2 pcic controllers (w/ 2 slots each) possible at each	 * IO port location, for a total of 8 possible PCMCIA slots.	 *	 * for VLSI controllers, we probe up to 4 slots for the same chip type,	 * and handle them on one controller.  This is slightly	 * cheating (two separate pcic's are required for 4 slots, according	 * to the i82365 spec).	 * 	 * For other controllers, we only take up to 2 slots.	 */	pcic->sc_ioh = pia->pia_ioh;	pcic->sc_iot = pia->pia_iot;	pcic->sc_adapter.nslots = 0;	maxslot = 2;	for (i = j = 0; i < maxslot; i++) {	    pcic->slot[j].reg_off = 0x80 * pia->pia_ctlr + 0x40 * i;	    pcic->slot[j].chip = pcic;	    chip_inf = pcic_rd(&pcic->slot[j], PCIC_ID_REV);	    if (PDEBUG(PCDCONF)) {		printf("pcic_probe read info %x\n", chip_inf);		delay(2000000);	    }	    if (!first && ochip_inf != chip_inf)		continue;		/* don't attach, it's different */	    ochip_inf = chip_inf;	    switch (chip_inf) {	    case PCIC_INTEL0:		pcic->chip_inf = PCMICA_CHIP_82365_0;		goto ok;	    case PCIC_INTEL1:		pcic->chip_inf = PCMICA_CHIP_82365_1;		goto ok;	    case PCIC_IBM1:		pcic->chip_inf = PCMICA_CHIP_IBM_1;		goto ok;	    case PCIC_146FC6:		pcic->chip_inf = PCMICA_CHIP_146FC6;		maxslot = 4;		goto ok;	    case PCIC_146FC7:		pcic->chip_inf = PCMICA_CHIP_146FC7;		maxslot = 4;		goto ok;	    case PCIC_IBM2:		pcic->chip_inf = PCMICA_CHIP_IBM_2;	ok:		if (first) {		    pcic->sc_adapter.adapter_softc = (void *)pcic;		    pcic->sc_adapter.chip_link = &pcic_funcs;		    pcic->sc_adapter.bus_link = &pcmcia_isa_link;		    pcicm->sc_ctlrs[pia->pia_ctlr] = pcic;		    pcicm->sc_slavestate[pia->pia_ctlr] = SLAVE_CONFIGURED;		    first = 0;		}		pcic->sc_adapter.nslots++;		j++;	    default:		if (PDEBUG(PCDCONF)) {		    printf("found ID %x at pcic%d position\n",			   chip_inf & 0xff, pcic->sc_dev.dv_unit);		}		continue;	    }	}	if (pcic->sc_adapter.nslots != 0) {		pcic->sc_memh = memh;		return 1;	}	if (PDEBUG(PCDCONF)) {		printf("pcic_probe failed\n");		delay(2000000);	}	bus_space_unmap(pia->pia_memt, memh, pia->pia_msize);	return 0;}