int print_type = 0; char *mtype;
acdattach(parent, self, aux)	struct device *parent, *self;	void *aux;{	struct acd_softc *acd = (void *)self;	struct at_dev_link *sa = aux;	struct mode_sense cmd;	struct cappage cap;	int print_type = 0;	char *mtype;	printf("\n");	sa->device_softc = acd;	sa->start = acdstart;	sa->done = acddone;	sa->flags |= ADEV_REMOVABLE;	sa->openings = 1;	acd->ad_link = sa;	/*	 * Initialize and attach the disk structure.	 */	acd->sc_dk.dk_driver = &acddkdriver;	acd->sc_dk.dk_name = acd->sc_dev.dv_xname;	disk_attach(&acd->sc_dk);	dk_establish(&acd->sc_dk, &acd->sc_dev);   	(void)atapi_test_unit_ready(sa, A_POLLED | A_SILENT); 	delay(1000);	(void)atapi_test_unit_ready(sa, A_POLLED | A_SILENT);	/* To clear media change, etc ...*/	bzero(&cmd, sizeof(cmd));	cmd.operation_code = ATAPI_MODE_SENSE;	cmd.page_code_control = CAP_PAGE;	_lto2b(sizeof(cap), cmd.length);	if (atapi_exec_cmd(sa, &cmd , sizeof(cmd), &cap, sizeof(cap),	    B_READ, A_POLLED) != 0) {		printf("%s: can't MODE SENSE: atapi_exec_cmd failed\n",		    self->dv_xname);		return;	}	/* Determine media type. */	switch (cap.medium_type) {	case MDT_UNKNOWN:		mtype = "medium type unknown";		break;	case MDT_DATA_120:		mtype = "120mm data disc";		break;	case MDT_AUDIO_120:		mtype = "120mm audio disc";		break;	case MDT_COMB_120:		mtype = "120mm data/audio disc";		break;	case MDT_PHOTO_120:		mtype = "120mm photo disc";		break;	case MDT_DATA_80:		mtype = "80mm data disc";		break;	case MDT_AUDIO_80:		mtype = "80mm audio disc";		break;	case MDT_COMB_80:		mtype = "80mm data/audio disc";		break;	case MDT_PHOTO_80:		mtype = "80mm photo disc";		break;	case MDT_NO_DISC:		mtype = "drive empty";		break;	case MDT_DOOR_OPEN:		mtype = "door open";		break;	case MDT_FMT_ERROR:		mtype = "medium format error";		break;	default:		mtype = "unknown type";		print_type = 1;		break;	}	/*	 * Display information about the drive.	 */	printf("%s: %s", self->dv_xname, mtype);	if (print_type)		printf(" (type 0x%x)", cap.medium_type);	printf("\n");}