if ((ideboot || scsiboot) && (scsidev == NULL)) {
if (ctrlrdev == NULL) {
dec_eb164_device_register(dev, aux)	struct device *dev;	void *aux;{	static int found, initted, scsiboot, ideboot, netboot;	static struct device *pcidev, *scsidev;	struct bootdev_data *b = bootdev_data;	struct device *parent = dev->dv_parent;	struct cfdata *cf = dev->dv_cfdata;	struct cfdriver *cd = cf->cf_driver;	if (found)		return;	if (!initted) {		scsiboot = (strcmp(b->protocol, "SCSI") == 0);		netboot = (strcmp(b->protocol, "BOOTP") == 0) ||		    (strcmp(b->protocol, "MOP") == 0);		/*		 * Add an extra check to boot from ide drives:		 * Newer SRM firmware use the protocol identifier IDE,		 * older SRM firmware use the protocol identifier SCSI.		 */		ideboot = (strcmp(b->protocol, "IDE") == 0);		DR_VERBOSE(printf("scsiboot = %d, ideboot = %d, netboot = %d\n",		    scsiboot, ideboot, netboot));		initted = 1;	}	if (pcidev == NULL) {		if (strcmp(cd->cd_name, "pci"))			return;		else {			struct pcibus_attach_args *pba = aux;			if ((b->slot / 1000) != pba->pba_bus)				return;				pcidev = dev;			DR_VERBOSE(printf("\npcidev = %s\n",			    pcidev->dv_xname));			return;		}	}	if ((ideboot || scsiboot) && (scsidev == NULL)) {		if (parent != pcidev)			return;		else {			struct pci_attach_args *pa = aux;			if (b->slot % 1000 / 100 != pa->pa_function)				return;			if (b->slot % 100 != pa->pa_device)				return;				scsidev = dev;			DR_VERBOSE(printf("\nscsidev = %s\n",			    scsidev->dv_xname));			return;		}	}	if (scsiboot &&	    (!strcmp(cd->cd_name, "sd") ||	     !strcmp(cd->cd_name, "st") ||	     !strcmp(cd->cd_name, "cd"))) {		struct scsibus_attach_args *sa = aux;		if (parent->dv_parent != scsidev)			return;		if (b->unit / 100 != sa->sa_sc_link->target)			return;		/* XXX LUN! */		switch (b->boot_dev_type) {		case 0:			if (strcmp(cd->cd_name, "sd") &&			    strcmp(cd->cd_name, "cd"))				return;			break;		case 1:			if (strcmp(cd->cd_name, "st"))				return;			break;		default:			return;		}		/* we've found it! */		booted_device = dev;		DR_VERBOSE(printf("\nbooted_device = %s\n",		    booted_device->dv_xname));		found = 1;	}	/*	 * Support to boot from IDE drives.	 */	if ((ideboot || scsiboot) && !strcmp(cd->cd_name, "wd")) {		struct ata_atapi_attach *aa_link = aux;		if ((strncmp("pciide", parent->dv_xname, 6) != 0)) {			return;		} else {			if (parent != scsidev)				return;		}		DR_VERBOSE(printf("\nAtapi info: drive: %d, channel %d\n",		    aa_link->aa_drv_data->drive, aa_link->aa_channel));		DR_VERBOSE(printf("Bootdev info: unit: %d, channel: %d\n",		    b->unit, b->channel));		if (b->unit != aa_link->aa_drv_data->drive ||		    b->channel != aa_link->aa_channel)			return;		/* we've found it! */		booted_device = dev;		DR_VERBOSE(printf("booted_device = %s\n",		    booted_device->dv_xname));		found = 1;	}	if (netboot) {		if (parent != pcidev)			return;		else {			struct pci_attach_args *pa = aux;			if ((b->slot % 1000) != pa->pa_device)				return;			/* XXX function? */				booted_device = dev;			DR_VERBOSE(printf("\nbooted_device = %s\n",			    booted_device->dv_xname));			found = 1;			return;		}	}}