int unit;
ssioctl(dev, cmd, addr, flag, p)	dev_t dev;	u_long cmd;	caddr_t addr;	int flag;	struct proc *p;{	struct ss_softc *ss = sscd.cd_devs[SSUNIT(dev)];	int error = 0;	int unit;	struct scan_io *sio;	switch (cmd) {	case SCIOCGET:		if (ss->special->get_params) {			/* call special handler */			error = (ss->special->get_params)(ss);			if (error)				return (error);		} else {			/* XXX add code for SCSI2 scanner, if any */			return (EOPNOTSUPP);		}		bcopy(&ss->sio, addr, sizeof(struct scan_io));		break;	case SCIOCSET:		sio = (struct scan_io *)addr;		if (ss->special->set_params) {			/* call special handler */			error = (ss->special->set_params)(ss, sio);			if (error)				return (error);		} else {			/* XXX add code for SCSI2 scanner, if any */			return (EOPNOTSUPP);		}		break;	case SCIOCRESTART:		if (ss->special->rewind_scanner ) {			/* call special handler */			error = (ss->special->rewind_scanner)(ss);			if (error)				return (error);		} else			/* XXX add code for SCSI2 scanner, if any */			return (EOPNOTSUPP);		ss->flags &= ~SSF_TRIGGERED;		break;#ifdef NOTYET	case SCAN_USE_ADF:		break;#endif	default:		if (SSMODE(dev) != MODE_CONTROL)			return (ENOTTY);		return (scsi_do_ioctl(ss->sc_link, dev, cmd, addr, flag, p));	}	return (error);}