#if FALLBACK 
#ifdef FALLBACK 
static int mcdx_open(struct cdrom_device_info *cdi, int purpose){	struct s_drive_stuff *stuffp;	xtrace(OPENCLOSE, "open()\n");	stuffp = cdi->handle;	if (!stuffp->present)		return -ENXIO;	/* Make the modules looking used ... (thanx bjorn).	 * But we shouldn't forget to decrement the module counter	 * on error return */	/* this is only done to test if the drive talks with us */	if (-1 == mcdx_getstatus(stuffp, 1))		return -EIO;	if (stuffp->xxx) {		xtrace(OPENCLOSE, "open() media changed\n");		stuffp->audiostatus = CDROM_AUDIO_INVALID;		stuffp->readcmd = 0;		xtrace(OPENCLOSE, "open() Request multisession info\n");		if (-1 ==		    mcdx_requestmultidiskinfo(stuffp, &stuffp->multi, 6))			xinfo("No multidiskinfo\n");	} else {		/* multisession ? */		if (!stuffp->multi.multi)			stuffp->multi.msf_last.second = 2;		xtrace(OPENCLOSE, "open() MS: %d, last @ %02x:%02x.%02x\n",		       stuffp->multi.multi,		       stuffp->multi.msf_last.minute,		       stuffp->multi.msf_last.second,		       stuffp->multi.msf_last.frame);		{;		}		/* got multisession information */		/* request the disks table of contents (aka diskinfo) */		if (-1 == mcdx_requesttocdata(stuffp, &stuffp->di, 1)) {			stuffp->lastsector = -1;		} else {			stuffp->lastsector = (CD_FRAMESIZE / 512)			    * msf2log(&stuffp->di.msf_leadout) - 1;			xtrace(OPENCLOSE,			       "open() start %d (%02x:%02x.%02x) %d\n",			       stuffp->di.n_first,			       stuffp->di.msf_first.minute,			       stuffp->di.msf_first.second,			       stuffp->di.msf_first.frame,			       msf2log(&stuffp->di.msf_first));			xtrace(OPENCLOSE,			       "open() last %d (%02x:%02x.%02x) %d\n",			       stuffp->di.n_last,			       stuffp->di.msf_leadout.minute,			       stuffp->di.msf_leadout.second,			       stuffp->di.msf_leadout.frame,			       msf2log(&stuffp->di.msf_leadout));		}		if (stuffp->toc) {			xtrace(MALLOC, "open() free old toc @ %p\n",			       stuffp->toc);			kfree(stuffp->toc);			stuffp->toc = NULL;		}		xtrace(OPENCLOSE, "open() init irq generation\n");		if (-1 == mcdx_config(stuffp, 1))			return -EIO;#if FALLBACK		/* Set the read speed */		xwarn("AAA %x AAA\n", stuffp->readcmd);		if (stuffp->readerrs)			stuffp->readcmd = READ1X;		else			stuffp->readcmd =			    stuffp->present | SINGLE ? READ1X : READ2X;		xwarn("XXX %x XXX\n", stuffp->readcmd);#else		stuffp->readcmd =		    stuffp->present | SINGLE ? READ1X : READ2X;#endif		/* try to get the first sector, iff any ... */		if (stuffp->lastsector >= 0) {			char buf[512];			int ans;			int tries;			stuffp->xa = 0;			stuffp->audio = 0;			for (tries = 6; tries; tries--) {				stuffp->introk = 1;				xtrace(OPENCLOSE, "open() try as %s\n",				       stuffp->xa ? "XA" : "normal");				/* set data mode */				if (-1 == (ans = mcdx_setdatamode(stuffp,								  stuffp->								  xa ?								  MODE2 :								  MODE1,								  1))) {					/* return -EIO; */					stuffp->xa = 0;					break;				}				if ((stuffp->audio = e_audio(ans)))					break;				while (0 ==				       (ans =					mcdx_transfer(stuffp, buf, 0, 1)));				if (ans == 1)					break;				stuffp->xa = !stuffp->xa;			}		}		/* xa disks will be read in raw mode, others not */		if (-1 == mcdx_setdrivemode(stuffp,					    stuffp->xa ? RAW : COOKED,					    1))			return -EIO;		if (stuffp->audio) {			xinfo("open() audio disk found\n");		} else if (stuffp->lastsector >= 0) {			xinfo("open() %s%s disk found\n",			      stuffp->xa ? "XA / " : "",			      stuffp->multi.			      multi ? "Multi Session" : "Single Session");		}	}	stuffp->xxx = 0;	stuffp->users++;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/44456d37b59d8e541936ed26d8b6e08d27e88ac1/mcdx.c/clean/drivers/cdrom/mcdx.c