ss = sscd.cd_devs[unit];
ss = ss_cd.cd_devs[unit];
ssopen(dev, flag, mode, p)	dev_t dev;	int flag;	int mode;	struct proc *p;{	int unit;	u_int ssmode;	int error = 0;	struct ss_softc *ss;	struct scsi_link *sc_link;	unit = SSUNIT(dev);	if (unit >= sscd.cd_ndevs)		return (ENXIO);	ss = sscd.cd_devs[unit];	if (!ss)		return (ENXIO);	ssmode = SSMODE(dev);	sc_link = ss->sc_link;	SC_DEBUG(sc_link, SDEV_DB1, ("open: dev=0x%x (unit %d (of %d))\n", dev,	    unit, sscd.cd_ndevs));	if (sc_link->flags & SDEV_OPEN) {		printf("%s: already open\n", ss->sc_dev.dv_xname);		return (EBUSY);	}	/*	 * Catch any unit attention errors.	 *	 * SCSI_IGNORE_MEDIA_CHANGE: when you have an ADF, some scanners	 * consider paper to be a changeable media	 *	 */	error = scsi_test_unit_ready(sc_link,	    SCSI_IGNORE_MEDIA_CHANGE | SCSI_IGNORE_ILLEGAL_REQUEST |	    (ssmode == MODE_CONTROL ? SCSI_IGNORE_NOT_READY : 0));	if (error)		goto bad;	sc_link->flags |= SDEV_OPEN;	/* unit attn are now errors */	/*	 * If the mode is 3 (e.g. minor = 3,7,11,15)	 * then the device has been opened to set defaults	 * This mode does NOT ALLOW I/O, only ioctls	 */	if (ssmode == MODE_CONTROL)		return (0);	SC_DEBUG(sc_link, SDEV_DB2, ("open complete\n"));	return (0);bad:	sc_link->flags &= ~SDEV_OPEN;	return (error);}