linux/drivers/ide/ide-cd_ioctl.c
<<
> 2.6/spa > 2.6/form> 2.6a > 2. href="../linux+v3.7.5/drivers/ide/ide-cd_ioctl.c">> 2.6img src="../.static/gfx/right.png" alt=">>">> 6/spa > > 6spa class="lxr_search">> > 2.6input typionhidden" namionnavtarget" /option">> 2.6input typiontext" namionsearch" idonsearch">> 2.6butt14Search 2.6/form> 6/spa > > 6spa class="lxr_prefs"> 2.6a href="+prefs?return=drivers/ide/ide-cd_ioctl.c"> 2. onclick="return ajax_prefs();">> 2.Prefs 2.6/a>> 6/spa > 2. .6/div> 2. .6form ac ="ajax+*" method="post" onsubmit="return false;">> 6input typionhidden" namionajax_lookup" idonajax_lookup" /option">> 2. .6/form> > 2. .6div class="headingbott1m">
2.
2. 2. .6div idonsearch_results" class="search_results" 2> 2. .6/div> 6div idoncontent"> 6div idonfile_contents">
. .16/a>6spa  class="comment">/*6/spa >
. .26/a>6spa  class="comment"> * cdrom.c IOCTLs handling for ide-cd driver.6/spa >
. .36/a>6spa  class="comment"> *6/spa >
. .46/a>6spa  class="comment"> * Copyright (C) 1994-1996  Scott Snyder <snyder@fnald0.fnal.gov>6/spa >
. .56/a>6spa  class="comment"> * Copyright (C) 1996-1998  Erik Andersen <andersee@debian.org>6/spa >
. .66/a>6spa  class="comment"> * Copyright (C) 1998-2000  Jens Axboe <axboe@suse.de>6/spa >
. .76/a>6spa  class="comment"> */6/spa >
. .86/a>>. .96/a>#include <linux/kernel.h6/a>>>. ptioa>#include <linux/cdrom.h6/a>>>. 11ioa>#include <linux/gfp.h6/a>>>. 12ioa>#include <linux/ide.h6/a>>>. 13ioa>#include <scsi/scsi.h6/a>>>. 146/a>>. 15ioa>#include "ide-cd.h6/a>">. 166/a>>. 176/a>6spa  class="comment">/****************************************************************************6/spa >
. 186/a>6spa  class="comment"> * Other driver requests (open, close, check media change).6/spa >
. 196/a>6spa  class="comment"> */6/spa >
. 2tioa>int.6a href="+code=ide_cdrom_open_real" class="sref">ide_cdrom_open_realioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+code=cdi" class="sref">cdiioa>, int.6a href="+code=purpose" class="sref">purposeioa>)
. 21ioa>{
. 22ioa>        return 0;>. 23ioa>}>. 246/a>>. 256/a>6spa  class="comment">/*6/spa >
. 266/a>6spa  class="comment"> * Close down the device.  In/opidate all cached blocks.6/spa >
. 276/a>6spa  class="comment"> */6/spa >
. 286/a>void.6a href="+code=ide_cdrom_release_real" class="sref">ide_cdrom_release_realioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+code=cdi" class="sref">cdiioa>)
. 29ioa>{
. 30ioa>        6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">handleioa>;>. 316/a>>. 32ioa>        if (!6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=use_count" class="sref">use_countioa>)
. 33ioa>                6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="sref">atapi_flagsioa> &= ~6a href="+code=IDE_AFLAG_TOC_VALID" class="sref">IDE_AFLAG_TOC_VALIDioa>;>. 34ioa>}>. 356/a>>. 366/a>6spa  class="comment">/*6/spa >
. 376/a>6spa  class="comment"> * add logic to try GET_EVENT command first to check for media and tray6/spa >
. 386/a>6spa  class="comment"> * status. this should be supported by newer cd-r/w and all DVD etc6/spa >
. 396/a>6spa  class="comment"> * drives6/spa >
. 406/a>6spa  class="comment"> */6/spa >
. 41ioa>int.6a href="+code=ide_cdrom_drive_status" class="sref">ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+code=cdi" class="sref">cdiioa>, int.6a href="+code=slot_nr" class="sref">slot_nrioa>)
. 42ioa>{
. 43ioa>        6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">handleioa>;>. 44ioa>        struct.6a href="+code=media_event_desc" class="sref">media_event_descioa> 6a href="+code=med" class="sref">medioa>;>. 45ioa>        struct.6a href="+code=request_sense" class="sref">request_senseioa> 6a href="+code=sense" class="sref">senseioa>;>. 46ioa>        int.6a href="+code=stat" class="sref">statioa>;>. 476/a>>. 48ioa>        if (6a href="+code=slot_nr" class="sref">slot_nrioa> !=.6a href="+code=CDSL_CURRENT" class="sref">CDSL_CURRENTioa>)
. 49ioa>                return -6a href="+code=EINVAL" class="sref">EINVALioa>;>. 506/a>>. 51ioa>        6a href="+code=stat" class="sref">statioa> =.6a href="+code=cdrom_check_status" class="sref">cdrom_check_statusioa>(6a href="+code=drive" class="sref">driveioa>, &6a href="+code=sense" class="sref">senseioa>);>. 52ioa>        if (!6a href="+code=stat" class="sref">statioa> || 6a href="+code=sense" class="sref">senseioa>.6a href="+code=sense_key" class="sref">sense_keyioa> ==.6a href="+code=UNIT_ATTENTION" class="sref">UNIT_ATTENTIONioa>)
. 53ioa>                return 6a href="+code=CDS_DISC_OK" class="sref">CDS_DISC_OKioa>;>. 546/a>>. 55ioa>        if (!6a href="+code=cdrom_get_media_event" class="sref">cdrom_get_media_eventioa>(6a href="+code=cdi" class="sref">cdiioa>, &6a href="+code=med" class="sref">medioa>)) {
. 56ioa>                if (6a href="+code=med" class="sref">medioa>.6a href="+code=media_present" class="sref">media_presentioa>)
. 57ioa>                        return 6a href="+code=CDS_DISC_OK" class="sref">CDS_DISC_OKioa>;>. 58ioa>                else if (6a href="+code=med" class="sref">medioa>.6a href="+code=door_open" class="sref">door_openioa>)
. 59ioa>                        return 6a href="+code=CDS_TRAY_OPEN" class="sref">CDS_TRAY_OPENioa>;>. 60ioa>                else>. 61ioa>                        return 6a href="+code=CDS_NO_DISC" class="sref">CDS_NO_DISCioa>;>. 62ioa>        }>. 636/a>>. 64ioa>        if (6a href="+code=sense" class="sref">senseioa>.6a href="+code=sense_key" class="sref">sense_keyioa> ==.6a href="+code=NOT_READY" class="sref">NOT_READYioa> && 6a href="+code=sense" class="sref">senseioa>.6a href="+code=asc" class="sref">ascioa> ==.0x04>. 65ioa>                        && 6a href="+code=sense" class="sref">senseioa>.6a href="+code=ascq" class="sref">ascqioa> ==.0x04)
. 66ioa>                return 6a href="+code=CDS_DISC_OK" class="sref">CDS_DISC_OKioa>;>. 676/a>>. 68ioa>        6spa  class="comment">/*6/spa >
. 696/a>6spa  class="comment">         * If not using Mt Fuji extended media tray reports,6/spa >
. 706/a>6spa  class="comment">         * just return TRAY_OPEN since ATAPI doesn't provide6/spa >
. 716/a>6spa  class="comment">         * any other way to detect this...6/spa >
. 726/a>6spa  class="comment">         */6/spa >
. 73ioa>        if (6a href="+code=sense" class="sref">senseioa>.6a href="+code=sense_key" class="sref">sense_keyioa> ==.6a href="+code=NOT_READY" class="sref">NOT_READYioa>) {
. 74ioa>                if (6a href="+code=sense" class="sref">senseioa>.6a href="+code=asc" class="sref">ascioa> ==.0x3a && 6a href="+code=sense" class="sref">senseioa>.6a href="+code=ascq" class="sref">ascqioa> ==.1)
. 75ioa>                        return 6a href="+code=CDS_NO_DISC" class="sref">CDS_NO_DISCioa>;>. 76ioa>                else>. 77ioa>                        return 6a href="+code=CDS_TRAY_OPEN" class="sref">CDS_TRAY_OPENioa>;>. 78ioa>        }>. 79ioa>        return 6a href="+code=CDS_DRIVE_NOT_READY" class="sref">CDS_DRIVE_NOT_READYioa>;>. 80ioa>}>. 816/a>>. 826/a>6spa  class="comment">/*6/spa >
. 836/a>6spa  class="comment"> * ide-cd always generates media changed event if media is missing, which
. 846/a>6spa  class="comment"> * makes it impossible to use for proper event reporting, so disk->events6/spa >
. 856/a>6spa  class="comment"> * is cleared to 0 and the following func
	   is used only to trigger6/spa >
. 866/a>6spa  class="comment"> * re/opidat	   and never propagated to userland.6/spa >
. 876/a>6spa  class="comment"> */6/spa >
. 88ioa>unsigned int.6a href="+code=ide_cdrom_check_events_real" class="sref">ide_cdrom_check_events_realioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+code=cdi" class="sref">cdiioa>,
. 89ioa>                                         unsigned int.6a href="+code=clearing" class="sref">clearingioa>, int.6a href="+code=slot_nr" class="sref">slot_nrioa>)
. 90ioa>{
. 91ioa>        6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">handleioa>;>. 92ioa>        int.6a href="+code=retval" class="sref">retvalioa>;>. 936/a>>. 94ioa>        if (6a href="+code=slot_nr" class="sref">slot_nrioa> ==.6a href="+code=CDSL_CURRENT" class="sref">CDSL_CURRENTioa>) {
. 95ioa>                (void).6a href="+code=cdrom_check_status" class="sref">cdrom_check_statusioa>(6a href="+code=drive" class="sref">driveioa>, 6a href="+code=NULL" class="sref">NULLioa>);>. 96ioa>                6a href="+code=retval" class="sref">retvalioa> =.(6a href="+code=drive" class="sref">driveioa>->6a href="+code=dev_flags" class="sref">dev_flagsioa> & 6a href="+code=IDE_DFLAG_MEDIA_CHANGED" class="sref">IDE_DFLAG_MEDIA_CHANGEDioa>) ? 1 : 0;>. 97ioa>                6a href="+code=drive" class="sref">driveioa>->6a href="+code=dev_flags" class="sref">dev_flagsioa> &= ~6a href="+code=IDE_DFLAG_MEDIA_CHANGED" class="sref">IDE_DFLAG_MEDIA_CHANGEDioa>;>. 98ioa>                return 6a href="+code=retval" class="sref">retvalioa> ? 6a href="+code=DISK_EVENT_MEDIA_CHANGE" class="sref">DISK_EVENT_MEDIA_CHANGEioa> : 0;>. 99ioa>        } else {
.100ioa>                return 0;>.101ioa>        }>.102ioa>}>.1036/a>>.1046/a>6spa  class="comment">/* Eject the disk if EJECTFLAG is 0.6/spa >
.1056/a>6spa  class="comment">   If EJECTFLAG is 1, try to reload the disk. */6/spa >
.106ioa>static
.107ioa>int.6a href="+code=cdrom_eject" class="sref">cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa>, int.6a href="+code=ejectflag" class="sref">ejectflagioa>,
.108ioa>                struct.6a href="+code=request_sense" class="sref">request_senseioa> *6a href="+code=sense" class="sref">senseioa>)
.109ioa>{
.110ioa>        struct.6a href="+code=cdrom_info" class="sref">cdrom_infoioa> *6a href="+code=cd" class="sref">cdioa> =.6a href="+code=drive" class="sref">driveioa>->6a href="+code=driver_data" class="sref">driver_dataioa>;>.111ioa>        struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+code=cdi" class="sref">cdiioa> =.&6a href="+code=cd" class="sref">cdioa>->6a href="+code=devinfo" class="sref">devinfoioa>;>.112ioa>        char.6a href="+code=loej" class="sref">loejioa> =.0x02;>.113ioa>        unsigned char.6a href="+code=cmd" class="sref">cmdioa>[6a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDBioa>];>.1146/a>>.115ioa>        if ((6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="sref">atapi_flagsioa> & 6a href="+code=IDE_AFLAG_NO_EJECT" class="sref">IDE_AFLAG_NO_EJECTioa>) && !6a href="+code=ejectflag" class="sref">ejectflagioa>)
.116ioa>                return -6a href="+code=EDRIVE_CANT_DO_THIS" class="sref">EDRIVE_CANT_DO_THISioa>;>.1176/a>>.118ioa>        6spa  class="comment">/* reload fails on some drives, if the tray is locked */6/spa >
.119ioa>        if ((6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="sref">atapi_flagsioa> & 6a href="+code=IDE_AFLAG_DOOR_LOCKED" class="sref">IDE_AFLAG_DOOR_LOCKEDioa>) && 6a href="+code=ejectflag" class="sref">ejectflagioa>)
.120ioa>                return 0;>.1216/a>>.122ioa>        6spa  class="comment">/* only tell drive to close tray if open, if it can do that */6/spa >
.123ioa>        if (6a href="+code=ejectflag" class="sref">ejectflagioa> && (6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=mask" class="sref">maskioa> & 6a href="+code=CDC_CLOSE_TRAY" class="sref">CDC_CLOSE_TRAYioa>))
.124ioa>                6a href="+code=loej" class="sref">loejioa> =.0;>.1256/a>>.126ioa>        6a href="+code=memset" class="sref">memsetioa>(6a href="+code=cmd" class="sref">cmdioa>, 0, 6a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDBioa>);>.1276/a>>.128ioa>        6a href="+code=cmd" class="sref">cmdioa>[0] =.6a href="+code=GPCMD_START_STOP_UNIT" class="sref">GPCMD_START_STOP_UNITioa>;>.129ioa>        6a href="+code=cmd" class="sref">cmdioa>[4] =.6a href="+code=loej" class="sref">loejioa> bPtl.c#uriv="+code=BLK_MAX_CDB" class="sref">BLK_MAX">. 29ioa1>{
;>cdrom_check_statusioa>(6a href="+coe=memset" class="sref">memsetioa>(6a href="+cde=drive" class="sref">drivtioa>(6a href="+cde=drive" class="sref">drivtioa>(6a href="+c" class="sref">request_senseimsetiv="+code=BLK_MAX_CDB" class="sref">BLK_MAX">.1216/a>a>>)
;>nonzero;don">/*ent"71">.wiseent">   If EJECTFLAG is 1, try to reload the disk.">. 34ioa1>}>.1065">. 356/1a>>/*cosp=sense" class=""+code_">/*cosphref="+code=cdrom_eject" class="sref">cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=d">/*ej" class="sref">lo">/*ej" .6a href="+code=ejectflag" class="sref">ejec">/*6/spa1 >
.108ioa>                struct.6a href="+code=request_sense" class="sref">request_senseioa> *6a href="+code=sense" class="sref">tray6/spa1 >

. 45ioa>        struct.6a href="+code=request_sensmy45">. 45ioa>        smy45">. ART_STOP_UNIT" class="sref">GPCMD_START_STOPives6/spa1 >
. 46ioa>        int.6a href="+code=stat" class="sref1> */6/spa1 >
)
request_senseihref="+code=sense_kee=drive" class="sref">driveL121" idonL121" class="line" namionL121lcountioa1>{
request_senseihrentioa>(6a href="+codey45">. 45ioa>        smy45">. ART_STOP_UNIT" class="sref">GPCMD_START_STOPi.h6/a>>;>medioa1>;>/*ass="cosp,mionL7p clendent">   If EJECTFLAG is 1, try to reload the disk.>senseioa1>;>.119ioa>        if ((6a href="+code=drive" class="sref">driveioa>->6a href="+code=dev_flags" class="srde=IE_AFINGa> &= ~6a href="+codede=IE_AFINGG_DOORnsei+code=CDSL_CURRENT" class="sref">CDSL_CUR1">statioa1>;>. 51ioa>        6a href="+code=loej" class="sref">loe7">. 476/1a>>. 99ioa>      URRENTioa1>)
.113ioa>        unsigned char.6a href="+code=cmd" class="sref">cmdioa>[6a href="+code=BLK_MAX_CDB" class="sref">BLK_MAXEINVALioa1>;>. 506/1a>>.126ioa>        6a href="+code=memset" class="sref">memsetioa>(6a href="+code=cmd" class="sref">cmdioa>, 0, 6a href="+code=BLK_MAX_CDB" class="sref">BLK_MAXsenseioa>1);>BLK_MAXscountioa1>)
.128ioa>        6a href="+code=cmdPR+code=ALLOW=DISKUM_REMO 49ioa>           de=cmdPR+code=ALLOW=DISKUM_REMO 49ART_STOP_UNIT" class="sref">GPCMD_START_STOPISC_OKioa1>;>.129ioa>        6a href="+code/*ej" class="sref">lo">/*ej" .6a HANGED" class="sref">IDE_DFLAG_MEDIA_CHANGEDioa14">. 546/1a>>))1 {
. 51ioa>    "line" namionL9"+code_queue_pe=sense" class=""+code_queue_perom_check_status" class="sref">cdrom_check_statusioa>(6a href="+coe=memset" class="sref">memsetioa>(6a href="+cde=drive" class="sref">drivtioa>(6a href="+cde=drive" class="sref">drivtL125" idonL125" class="line" namionL125m>statioa1>)
request_senseimsetiv="+code=BLK_MAX_CDB" class="sref">BLK_MAXISC_OKioa1>;>. 78io1r_openioa1>)
. 78io1Y_OPENioa1>;>   If EJECTFLAG is 1, try to reload the disk.       el1se>6sbably>>/*L69"l>/*ass="cospent">   If EJECTFLAG is 1, try to reload the disk.O_DISCioa1>;>. 51ioa>  urivhref="+codeEJECTFLAG is 1, try to reload the disk.Ocountioa1 }>request_senseiif ((6a href="+code=ode=sense" class="sref">senseioa>.6a href="+code=sense_kILLEGAL_REQUES_flagsioa> & LLEGAL_REQUES_(6a href="+codeEJECTFLAG is 1, try to reload the disk.OSC_OKioa1a>>request_senseiif ((6a href="+code=dde=sense" class="sref">senseio24  if (!6a href="+code=stat" class="sref">statioaif ((6a href="+code=dde=sense" class="sref">senseio20a>, &6a href="+code=med" class="sref">1oa> ==.0x104>/*clasL69">6spa  cl\ndonL15"   If tL125" idonL125" class="line" namionL12566/a>";>.119ioa>        if ((6a href="+code=rs/ionL119">.119ioars/ihref="+code=BLK_MAX_CDB" class="sref">BLK_MAXISC_OKioa1>;>. 97ioa>                6a href="+code=drive" class="sref">driveioa>->6a href="+code=dev_flags" class="srefde=IE_AFINGa> &= ~6a href="+codede=IE_AFINGG_DO"+code=BLK_MAX_CDB" class="sref">BLK_MAXISC_OKioa1a>>. 51ioa>        6a href="+code=loej" class="sref">loe">/*6/spa1 >
. 78io1rts,6/spa1 >

   If EJECTFLAG is 1, try to reload the disk.s...6/spa1 >
. 51ioa>  urivhref="+coden class="line" n" class="sref">request_senseiif ((6a href="+code=ode=sense" class="sref">senseioa>.6a href="+code=sense_key" class="sref">sense_keyioa> ==.6a href="+code=NOT_READY" class="sref">NOT_READYioa> &&if ((6a href="+code=dde=sense" class="sref">senseio3aeL121" idonL121" class="line" namionL121  */6/spa1 >
. 51ioa>        6a href="+code=loej" class="sref">loeEADYioa>)1 {
 ==.11)
. 51ioa>   sei+code=CDSL_CURRENT" class="sref">CDSL_CUR1O_DISCioa1>;>lo">/*ej" .6a eL121" idonL121" class="line" namionL121 ">. 166/a>>>. 97ioa>                6a href="+code=drive" class="sref">driveioa>->6a href=|ef="+code=sense_kIass="sref">atapi_flagsioa> & 6a href="+code=IDE_AFLAG_DO   6a href="+code=loej" class="sref">loeESC_OKioa1>;>loeE>/*6/spa1 }>. 97ioa>                6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="sref">">atapi_flagsioa> & 6a href="+code=IDE_AFLAG_DO   6a href="+code=loej" class="sref">loe_READYioa1>;>. 78io1">. 80ioa1>}>. 816/1a>>. 46ioa>        int.6a href="+code=stat" class="sref1">/*6/spa1 >


. 97ioa>  " namionL8spa _moonrom_c_status" class="sref">ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+coposiionLcdi" class="sreposiionL.6a eL121" idonL121" class="line" namionL121gger6/spa1 >
CDSL_CUR1and.6/spa1 >
cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">1> */6/spa1 >
. 45ioa>        struct.6a href="+code=request_sense" class="sref">request_senseioa> 6a href="+code=sense" class="sref"1f">cdiioa1>,
. 78io1lot_nrioa1>)
CDSL_CUR1">. 90ioa1>{
. 46ioa>        "line" namionL9"+code_">/*cosp=sense" class=""+code_">/*cosphref="+code=cdrom_ejass="sref">cdrom_check_statusio0ioa>(6a href="+code=drive" class="sref">driveioa>, &6a href="+code=sense" class="sref">1handleioa1>;>BLK_MAXretvalioa1>;>. 51ioa> eL121" idonL121" class="line" namionL1213">. 936/1a>>. 46ioa>        int.6a href="+code=stat" class="sref1RENTioa>)1 {
NULLioa>1);>) ? 1 : 10;>.107ioa>int.6a href="+code=cdrom_ejass="sref">cdrom_check_statusio class="sref">IDposiionLcdi" class="sreposiionL.6a ioa>(6a href="+code=drive" class="sref">driveioa>, &6a href="+code=sense" class="sref">1h */6/spa1>;>e).6/spa >>
. 78io2  } else 2
/*_cosp=sense" class=""+codeine"">/*_cosprom_c_status" class="sref">ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+co">/*class="sref">lo">/*oa> eL121" idonL121" class="line" namionL122 return 02>        2>cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">2>.102ioa>2>.1036/a2>/*cosp=sense" class=""+code_">/*cosphref="+code=cdrom_ejass="sref">cdrom_check_statusio> *6a href="+co">/*class="sref">lo">/*oa> ioa>(6a href="+code=drive" class="sref">driveioa>, 6a href="+code=NULL" class="sref"2 0.6/spa 2
stati2
. 256/a>6spa  class="comment"tflagioa>2
2
.109ioa>2
. 406/a>6spa  class="comment"2_dataioa>2>ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_infoioa> *6a href="+cospeed=sense" class="speedrom_eL121" idonL121" class="line" namionL122vinfoioa>2> =.0x022>cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">2_CDBioa>]2>.110ioa>        struct.6a href="+code=cdrom_info" class="sref">cdrom_infoioa> *6a href="+code=cd" class="sref">cdioa> =.6a href="+code=drive" class="sref">driveioa>->6a href="+code=driver_data" class="sref">drive2">.1146/a2>. 45ioa>        struct.6a href="+code=request_sense" class="sref">request_senseioa> 6a href="+code=sense" class="sref"2tflagioa>2
requu8="+code=request_sensbufass="sref">requbuf="+cned char.6a href"comm_CAPABILITIES_PAGE_SIZEass="sref">requ"comm_CAPABILITIES_PAGE_SIZE="+c="+code=BLK_MAX_CDB" class="sref">BLK_MA2_THISioa>2>. 46ioa>        int.6a href="+code=stat" class="sref2">.1176/a2>.113ioa>        unsigned char.6a href="+code=cmd" class="sref">cmdioa>[6a href="+code=BLK_MAX_CDB" class="sref">BLK_MA2 */6/spa 2
. 78io2tflagioa>2
. 78io2tdataioa>2>. 406/a>6spa  class="comment"2">.1216/a2>lo2 */6/spa 2
. 406/a>6spa  class="comment"2"CDBioa>]2
 =.02>.126ioa>        6a href="+code=memset" class="sref">memsetioa>(6a href="+code=cmd" class="sref">cmdioa>, 0, 6a href="+code=BLK_MAX_CDB" class="sref">BLK_MA2">.1256/a2>)2>.128ioa>        6a href="+code=cmd"ET_SPElagsioa> & 6ade=cmd"ET_SPEla       int.6a href="+code=stat" class="sref2">.1276/a2>speed in kbytes/second MSB/LSB="line" namionL40">. 406/a>6spa  class="comment"2"*/6/spa 2>.129ioa>2]   6a href="+code=r"peed=sense" class="speedrom_ > =.> =. 8OR_LOCK 0xff   int.6a href="+code=stat" class="sref2">. 29ioa2>{
.129ioa>3       6a href="+co"peed=sense" class="speedrom_ >LOCK 0xff   int.6a href="+code=stat" class="sref2"dataioa>2>;>ejectflagioa> && (6a href="+code=cdi" class="sref">cdiioa>->19" class="line"amp; D_Rcdi" class="sreamp; D_Rhref=|;6a href="+code=mask"D_RWcdi" class="sreamp; D_RWhref=|;6a href="+code=maskDVD_Rcdi" class="sreamp;DVD_Rhref=) !=  int.6a href="+code=stat" class="sref2">.1216/a2a>>)
speed in kbytes/second MSB/LSB="line" namionL40">. 406/a>6spa  class="comment"2_VALIDioa2>;>.129ioa>     6a href="+code=r"peed=sense" class="speedrom_ > =.> =. 8OR_LOCK 0xff   int.6a href="+code=stat" class="sref2"ioa> =.02>}>.129ioa>5       6a href="+co"peed=sense" class="speedrom_ >LOCK 0xff   int.6a href="+code=stat" class="sref2">.1256/a2a>>/*6/spa2 >

. 51ioa>    "line" namionL9"+code_queue_pe=sense" class=""+code_queue_perom_check_status" class="sref">cdrom_check_statusioa>(6a href="+coe=memset" class="sref">memsetioa>(6a href="+cde=drive" class="sref">drivtioa>(6a href="+cde=drive" class="sref">drivtia>(6a href="+code=drive" class="sref">driveioa>, msetiv="+code=BLK_MAX_CDB" class="sref">BLK_MA2 etc6/spa2 >
. 78io2ives6/spa2 >
ID"+codeine"get_capabilitiess="sref">drivei"+codeine"get_capabilitiesrom_check_status" class="sref">cdrom_check_statusioa>(6a href="+cobufass="sref">requbuf="+c=) .c#L42" idonL42" class="line" namionL422> */6/spa2 >
cdrom_check_statusioa>(6a href="+cobufass="sref">requbuf="+c="+code=BLK_MAX_CDB" class="sref">BLK_MA2lot_nrioa2>)
ejectflagioa> && (6a href="+cspeed=sense" class="speedrom_   ="+code=cdrom_info" class="sref">cdromp;& (6a href="+ccurrne"_speed=sense" class="currne"_speed       int.6a href="+code=stat" class="sref2lcountioa2>{
&g2;;>medioa2>;>.120ioa>              2>senseioa2>;>/*6/spa2>;>. 476/2a>>ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_inL127" idonL127" class="line" namionL1227etc6/spa2>)
ide_cdmulti hssonLcdi" class="sreide_cdmulti hssonLcdrom_device_info" clmsive_statusioa>(strucmsive_srom_eL121" idonL121" class="line" namionL122EINVALioa2>;>. 506/2a>>->oe=sense" class="sa>->oecdrom_device_info" cltoe=sense" class="toecdroine" namionL120">.120ioa>              2senseioa>2);>cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">2scountioa2>)
.110ioa>        struct.6a href="+code=cdrom_i110">.110ioa>      ct.6a hreinfoioa> *6a href="+code=cd" class="sref">cdioa> =.6a href="+code=drive" class="sref">driveioa>->6a href="+code=driver_data" class="sref">drive2ISC_OKioa2>;>. 45ioa>        struct.6a href="+code=request_sense" class="sref">request_senseioa> 6a href="+code=sense" class="sref"24">. 546/2a>>        str        int.6a href="+code=stat" class="sref2medioa>))2 {
statioa2>)
.119ioa>        if ((6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="srefTOC_VALIagsioa> & 6a href="+coTOC_VALIarom_e  sei  if class="sref">ID"10">.110ioa>      ct.6a hrif ((6a href="+code=toe=sense" class="toecdro) .c#L42" idonL42" class="line" namionL422ISC_OKioa2>;>        str        "line" namionL9"+code_readgtoe=sense" class=""+code_readgtoerom_check_status" class="sref">cdrom_check_statusioa>(6a href="+code=drive" class="sref">driveioa>, &6a href="+code=sense" class="sref">2r_openioa2>)
        str     eL121" idonL121" class="line" namionL122Y_OPENioa2>;>        str        int.6a href="+code=stat" class="sref2       el2se>.101io2O_DISCioa2>;>BLK_MA2Ocountioa2 }>.110ioa>      ct.6a hrif ((6a href="+code=toe=sense" class="toecdro   int.6a href="+code=stat" class="sref2 SC_OKioa2a>>(strucmsive_srom_if ((6a href="+code=dddp=sense" class="dddprom_.6a href="+code=lbss="sref">driveilbscdro   "line" namionL9toe=sense" class="toecdroif ((6a href="+code= hr6a hssonL_lbss="sref">driveilhr6a hssonL_lbscdro   int.6a href="+code=stat" class="sref2 ">. 546/204>loxa_ej" cdro   "line" namionL9toe=sense" class="toecdroif ((6a href="+code=xa_ej" class="sref">loxa_ej" cdro   int.6a href="+code=stat" class="sref2 edioa>))2;;>;>.120ioa>              2ISC_OKioa2a>>/*6/spa2 >
. 78io2rts,6/spa2 >
ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_inL127" idonL127" class="line" namionL122vide6/spa2 >
(strucmcnive_s    eL121" idonL121" class="line" namionL122s...6/spa2 >

cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">2EADYioa>)2 {
. 46ioa>     ioa>(6a href="+comcnleLcdi" class="sremcnleLa>->6a href="+code=handle" class="sref">2E">. 546/21)
requbuf="+cn24="+code=BLK_MAX_CDB" class="sref">BLK_MA2O_DISCioa2>;>.113ioa>        unsigned char.6a href="+code=cmd" class="sref">cmdioa>[6a href="+code=BLK_MAX_CDB" class="sref">BLK_MA2 ">. 166/2>>>requbuf="+c="+code=BLK_MAX_CDB" class="sref">BLK_MA2ESC_OKioa2>;>BLK_MA2E>/*6/spa2 }>.126ioa>        6a href="+code=memset" class="sref">memsetioa>(6a href="+code=cmd" class="sref">cmdioa>, 0, 6a href="+code=BLK_MAX_CDB" class="sref">BLK_MA2_READYioa2>;>. 80ioa2>}>.128ioa>        6a href="+code=cmda> =_SUBCHANNE9ioa>           de=cmda> =_SUBCHANNE9a>->6a href="+code=handle" class="sref">21">. 816/2a>>.128ioa>1    2;donL61"#L53"  nL118" class="line" namiMSF dddphssong="line" namionL40">. 406/a>6spa  class="comment"2">/*6/spa2 >
.129ioa>2]   0x40;idonL118" class="line" namionuct.6 subQ ;6a ="line" namionL40">. 406/a>6spa  class="comment"2"ADYioa>)2 >
.129ioa>3    2;donL61"#L53"  nL118" class="line" namiformtell drive to close tray if open, if it can do tha2ents6/spa2 >
.129ioa>8       6a href="+codeLcdi" class="sreleLa>->6a href="+code=handle" class="sref">21_DISCioa2 >

. 51ioa>    "line" namionL9"+code_queue_pe=sense" class=""+code_queue_perom_check_status" class="sref">cdrom_check_statusioa>(6a href="+coe=memset" class="sref">memsetioa>(6a href="+cbufass="sref">requbuf="+cioa>(6a href="+code=drdeLcdi" class="sreleLa>-&tioa>(6a href="+cde=drive" class="sref">drivtietiv="+code=BLK_MAX_CDB" class="sref">BLK_MA2> */6/spa2 >
. 51ioa> eL121" idonL121" class="line" namionL122f">cdiioa2>,
. 46ioa>        int.6a href="+code=stat" class="sref2lot_nrioa2>)
. 90ioa2>{
(strucmcnive_s    p;& (6a href="+co idum_c6a log_numbep=sense" class="o idum_c6a log_numbepcdro) - 1   int.6a href="+code=stat" class="sref2l">. 816/2>;>6iocperom_check_status" clmcnive_statusioa>(strucmcnive_s    p;& (6a href="+co idum_c6a log_numbep=sense" class="o idum_c6a log_numbepcdrotioa>(6a href="+cbufass="sref">requbuf="+c + 9ioa>(6a href="+comcnleLcdi" class="sremcnleLa>-&="+code=BLK_MAX_CDB" class="sref">BLK_MA2retvalioa2>;>(strucmcnive_s    p;& (6a href="+co idum_c6a log_numbep=sense" class="o idum_c6a log_numbepcdroned char.6a hrefmcnleLcdi" class="sremcnleLa>-&     c#L71" idonLst     f=    \0=    drive t"+code=BLK_MAX_CDB" class="sref">BLK_MA2rADYioa>)2a>>)2 {
.120ioa>              2>NULLioa>2);>) ? 1 : 20;>;>.12ass="line"phs" rom_c_status" class="sref">ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_ieL121" idonL121" class="line" namionL122>e).6/spa2>>
cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">3 return 03>.110ioa>        struct.6a href="+code=cdrom_info" class="sref">cdrom_infoioa> *6a href="+code=cd" class="sref">cdioa> =.6a href="+code=drive" class="sref">driveioa>->6a href="+code=driver_data" class="sref">drive3>        3>. 45ioa>        struct.6a href="+code=request_sense" class="sref">request_senseioa> 6a href="+code=sense" class="sref"3>.102ioa>3>        struct.6a href="+code=cdrom_irq45ioa>        stqenseioa> 6a href="+code=sense" class="sref"3>4102ioa>3>>>        str        int.6a href="+code=stat" class="sref3 0.6/spa 3
        sblk"get_truct.6rom_check_status" class="sref">cdrom_check_statusa> =.6a href="+code=queuesref">cdrom_chequeuecdrotioa>(6a href="+ca> =sref">cdrom_chea> =cdrotioa>(6a href="+c__GFP_WAI_flagsioa> &__GFP_WAI_a>-&="+code=BLK_MAX_CDB" class="sref">BLK_MA3ioa>stati3
        stqensep;& (6a href="+ccmd_typesref">cdrom_checmd_typeense_infoioa> *6a hrefREQ_TYPE_SPECI49ioa>           REQ_TYPE_SPECI49       int.6a href="+code=stat" class="sref3 8a>stati3
;>driveicmd_ clasense_infoioa> *6a hrefREQ_QUIE_flagsioa> &REQ_QUIE_       int.6a href="+code=stat" class="sref3 9a>stati3
>
        str        "line" namionL9blk"execute_rq45ioa>        sblk"execute_rqrom_check_status" class="sref">cdrom_check_statusa> =.6a href="+code=queuesref">cdrom_chequeuecdrotioa>(6a href="+cnfo" class="sref">cdromp;& (6a href="+cdie=cdi" class="sredie=cdrotioa>(6a href="+crq45ioa>        stqensetiv="+code=BLK_MAX_CDB" class="sref">BLK_MA3>.109ioa>3
        sblk"put_truct.6rom_check_status" clrq45ioa>        stqense="+code=BLK_MAX_CDB" class="sref">BLK_MA3>return 03>/*ass="cospenIf i  was7p cviouslyal>/*ed,drive to close tray if open, if it can do tha3v.102ioa>3>/*ai  againse down the device.  In/opidate all cached blo3_CDBioa>]3>.1146/a3>.119ioa>        if ((6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="sref">atapi_flagsioa> & 6a href="+code=IDE_AFLAG_DOeL121" idonL121" class="line" namionL123tflagioa>3
/*cosp=sense" class=""+code_">/*cosphref="+code=cdrom_ejass="sref">cdrom_check_statusio1ioa>(6a href="+code=drive" class="sref">driveioa>, &6a href="+code=sense" class="sref">3_THISioa>3>.1176/a3>        str        int.6a href="+code=stat" class="sref3 */6/spa 3
3
3>"+code_get_toc_clarehref="+code=cdrom_eject" class="sref">cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tinfoioa> *6a href="+cotra/*class="sref">lotra/*e_tin.c#L50" idonL50" class="line" namionL53tinfoioa>3>->oe_clare" class="sref">oa>->oe_clarehref=""+code=ide_driveclas class="sref">claG_DOeL121" idonL121" class="line" namionL123 */6/spa 3
]3
.110ioa>        struct.6a href="+code=cdrom_i110">.110ioa>      ct.6a hreinfoioa> *6a href="+code=cd" class="sref">cdioa> =.6a href="+code=drive" class="sref">driveioa>->6a href="+code=driver_data" class="sref">drive3jioa> =.03>->oe=sense" class="sa>->oecdrom_device_info" cltoe=sense" class="toecdro   "line" namionL9"10">.110ioa>      ct.6a hrif ((6a href="+code=toe=sense" class="toecdro   int.6a href="+code=stat" class="sref3">.1256/a3> *6a href="+contra/*ss="sref">driveintra/*scdro   int.6a href="+code=stat" class="sref3"THISioa>3>.1276/a3>. 29ioa3>{
3>;>.119ioa>        if ((6a href="+code=drive" class="sref">driveioa>->6a href="+code=atapi_flags" class="srefTOC_VALIagsioa> & 6a href="+coTOC_VALIarom_e  seieL121" idonL121" class="line" namionL123">.1216/a3a>>           EINV49cdro   int.6a href="+code=stat" class="sref3_countioa3>)
;>   If EJECTFLAG is 1, try to reload the disk3"ioa> =.03>}>driveintra/*scdro   "line" namionL9toe=sense" class="toecdroif ((6a href="+code=hdp=sense" class="hdprom_.6a href="+code=lhr6atra/*class="sref">lolhr6atra/*cdro - "line" namionL9toe=sense" class="toecdroif ((6a href="+code=hdp=sense" class="hdprom_.6a href="+code=firr6atra/*class="sref">lofirr6atra/*="+c + 1   int.6a href="+code=stat" class="sref3">.1256/a3a>>/*6/spa3 >
lofirr6atra/*="+c ref="+code=sense_kCDROM_LEADOU_flagsioa> &CDROM_LEADOU_G_DOeL121" idonL121" class="line" namionL123tray6/spa3 >
driveintra/*scdro   line" namionL120">.120ioa>              3 etc6/spa3 >
. 78io3ives6/spa3 >
 *6a href="+cotra/*class="sref">lotra/*e_ti ref="+code=sense_kCDROM_LEADOU_flagsioa> &CDROM_LEADOU_G_DOeL121" idonL121" class="line" namionL123> */6/spa3 >
claG_DO   a>(6a href="+code=drtoe=sense" class="toecdroif ((6a href="+code=clas class="sref">claG_DOned char.6a hrefntra/*ss="sref">driveintra/*scdro="+code=BLK_MAX_CDB" class="sref">BLK_MA3lot_nrioa3>)
 *6a href="+cotra/*class="sref">lotra/*e_ti <de=atapi_flags" ctoe=sense" class="toecdroif ((6a href="+code=hdp=sense" class="hdprom_.6a href="+code=firr6atra/*class="sref">lofirr6atra/*="+c ||;6a href="+code=tra/*class="sref">lotra/*e_ti >de=atapi_flags" ctoe=sense" class="toecdroif ((6a href="+code=hdp=sense" class="hdprom_.6a href="+code=lhr6atra/*class="sref">lolhr6atra/*cdroeL121" idonL121" class="line" namionL123>countioa3>{
           EINV49cdro   int.6a href="+code=stat" class="sref3i.h6/a>&g3;;>claG_DO   a>(6a href="+code=drtoe=sense" class="toecdroif ((6a href="+code=clas class="sref">claG_DOned char.6a hreftra/*class="sref">lotra/*e_ti - "line" namionL9toe=sense" class="toecdroif ((6a href="+code=hdp=sense" class="hdprom_.6a href="+code=firr6atra/*class="sref">lofirr6atra/*="+c="+code=BLK_MAX_CDB" class="sref">BLK_MA3l>.1256/a3>;>/*6/spa3>;>.120ioa>              37">. 476/3a>>)
. 78io3EINVALioa3>;>cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tinfvoid="+code=ide_drivear class="sref">loar cdroeL121" idonL121" class="line" namionL1230">. 506/3a>>3);>loar cdroine" namionL120">.120ioa>              3scountioa3>)
->oe_clare" class="sref">oa>->oe_clarehref="6a href="+code=firr6atoe=sense" class="firr6atoee_tinf"6a href="+code=lhr6atoe=sense" class="lhr6atoecdroine" namionL120">.120ioa>              3s.h6/a>&g3>;>cdrom_ejdba_oa>r=cdrotioa>(6a href="+cdba_end=sense" class="dba_endcdroine" namionL120">.120ioa>              3sioa> =.03a>>. 46ioa>        int.6a href="+code=stat" class="sref3medioa>))3 {
. 45ioa>        struct.6a href="+code=request_sense" class="sref">request_senseioa> 6a href="+code=sense" class="sref"3m>statioa3>)
.113ioa>        unsigned char.6a href="+code=cmd" class="sref">cmdioa>[6a href="+code=BLK_MAX_CDB" class="sref">BLK_MA3ISC_OKioa3>;>BLK_MA3r_openioa3>)
. 51ioa>    "line" namionL9"+code_get_toc_clare" class="sref">"+code_get_toc_clarehref="+code=cdrom_ejass="sref">cdrom_check_statusioa>(6a href="+cotdrive" class="srsdcdrop;& (6a href="+ccdtiatrk0rive" class="sreftiatrk0atusioa>(6a href="+code=drfirr6atoe=sense" class="firr6atoee_ti&6a href="+code=sense" class="sref">3Y_OPENioa3>;>. 51ioa> eL121" idonL121" class="line" namionL123       el3se>. 46ioa>        int.6a href="+code=stat" class="sref3O_DISCioa3>;>BLK_MA3Ocountioa3 }>. 51ioa>    "line" namionL9"+code_get_toc_clare" class="sref">"+code_get_toc_clarehref="+code=cdrom_ejass="sref">cdrom_check_statusioa>(6a href="+cotdrive" class="srsdcdrop;& (6a href="+ccdtiatrk1rive" class="sreftiatrk1atusioa>(6a href="+code=drlhr6atoe=sense" class="lhr6atoecdro&6a href="+code=sense" class="sref">3Y.h6/a>&g3a>>. 51ioa> eL121" idonL121" class="line" namionL123 ioa> =.0304>. 46ioa>        int.6a href="+code=stat" class="sref3Oedioa>))3;;>;> &CDROM_LEADOU_G_DOeL121" idonL121" class="line" namionL123ISC_OKioa3a>>.120ioa>              3">/*6/spa3 >
cdrom_ejdba_oa>r=cdro   "line" namionL9firr6atoe=sense" class="firr6atoee_tiif ((6a href="+code=dddp=sense" class="dddprom_.6a href="+code=lbss="sref">driveilbscdroine" namionL120">.120ioa>              3rts,6/spa3 >
driveilbscdroine" namionL120">.120ioa>              3r      el3 >
.120ioa>              3r_DISCioa3 >
r="sref">cdrom_ejdba_oa>r=cdroeL121" idonL121" class="line" namionL123  */6/spa3 >
           EINV49cdro   int.6a href="+code=stat" class="sref3EADYioa>)3 {
. 546/31)
.126ioa>        6a href="+code=memset" class="sref">memsetioa>(6a href="+code=cmd" class="sref">cmdioa>, 0, 6a href="+code=BLK_MAX_CDB" class="sref">BLK_MA3O_DISCioa3>;>. 166/3>>>.128ioa>        6a href="+code=cmdPLAY_AUDIO_MSFe" namionL128">de=cmdPLAY_AUDIO_MSFcdro   int.6a href="+code=stat" class="sref3ESC_OKioa3>;>requdba_to_msf       6a href="+coddba_oa>r="sref">cdrom_ejdba_oa>r=cdroti oa>(6a href="+code=drline" namionL129">.129ioa>3 ioa>(6a href="+code=drline" namionL129">.129ioa>  ioa>(6a href="+code=drline" namionL129">.129ioa>5]="+code=BLK_MAX_CDB" class="sref">BLK_MA3O>/*6/spa3 }>requdba_to_msf       6a href="+coddba_end=sense" class="dba_endcdro -o1ioa>(6a href="+code=drline" namionL129">.129ioa>6 ioa>(6a href="+code=drline" namionL129">.129ioa>7 ioa>(6a href="+code=drline" namionL129">.129ioa>8]="+code=BLK_MAX_CDB" class="sref">BLK_MA3_READYioa3>;>. 80ioa3>}>cdrom_check_statusioa>(6a href="+coe=memset" class="sref">memsetioa>(6a href="+cde=drive" class="sref">drivtioa>(6a href="+cde=drive" class="sref">drivtia>(6a href="+code=drive" class="sref">driveioa>, msetiv="+code=BLK_MAX_CDB" class="sref">BLK_MA31">. 816/3a>>/*6/spa3 >
)3 >
cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tinfvoid="+code=ide_drivear class="sref">loar cdroeL121" idonL121" class="line" namionL123ents6/spa3 >

.110ioa>        struct.6a href="+code=cdrom_info" class="sref">cdrom_infoioa> *6a href="+code=cd" class="sref">cdioa> =.6a href="+code=drive" class="sref">driveioa>->6a href="+code=driver_data" class="sref">drive3and.6/spa3 >
loar cdroine" namionL120">.120ioa>              3> */6/spa3 >
->oe=sense" class="sa>->oecdrom_device_info" cltoe=sense" class="toecdroine" namionL120">.120ioa>              3f">cdiioa3>,
. 46ioa>        int.6a href="+code=stat" class="sref3lot_nrioa3>)
. 90ioa3>{
   If EJECTFLAG is 1, try to reload the disk3l">. 816/3>;>. 51ioa>    "line" namionL9"+code_readgtoe=sense" class=""+code_readgtoerom_check_status" class="sref">cdrom_check_statusiooa>(6a href="+cde=drive" class="sref">driv="+code=BLK_MAX_CDB" class="sref">BLK_MA3retvalioa3>;>. 51ioa> eL121" idonL121" class="line" namionL123rADYioa>)3a>>. 46ioa>        int.6a href="+code=stat" class="sref3RENTioa>)3 {
NULLioa>3);>cdromp;& (6a href="+ctoe=sense" class="toecdroine" namionL120">.120ioa>              3>) ? 1 : 30;>lofirr6atra/*="+cine" namionL120">.120ioa>              3> */6/spa3>;>lolhr6atra/*cdroine" namionL120">.120ioa>              3>">cdiioa3>>
. 78io4  } else 4
.120ioa>              4 return 04>        4>BLK_MA4>.102ioa>4>"+code_readgtoeclarehref="+code=cdrom_eject" class="sref">cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tinfvoid="+code=ide_drivear class="sref">loar cdroeL121" idonL121" class="line" namionL124>4102ioa>4>>>mionL8soeclarecdrom_device_info" cltoeclare" class="sref">soeclarecdromef="+code=sense_kar class="sref">loar cdroine" namionL120">.120ioa>              4 */6/spa 4
->oe_clare" class="sref">oa>->oe_clarehref="6a href="+code=soec" class="sref">soeccdroine" namionL120">.120ioa>              4 7/6/spa 4
;>. 46ioa>        int.6a href="+code=stat" class="sref4 8a>stati4
;>BLK_MA4 9a>stati4
>
. 51ioa>    "line" namionL9"+code_get_toc_clare" class="sref">"+code_get_toc_clarehref="+code=cdrom_ejass="sref">cdrom_check_statusioa>(6a href="+cotoeclare" class="sref">soeclarecdrop;& (6a href="+ccdteatra/*class="sref">locdteatra/*drivtia>(6a href="+code=drsoec" class="sref">soeccdro="+code=BLK_MAX_CDB" class="sref">BLK_MA4>.109ioa>4
. 51ioa> eL121" idonL121" class="line" namionL124>return 04>. 46ioa>        int.6a href="+code=stat" class="sref4vinfoioa>4>BLK_MA4v.102ioa>4>soeclarecdrop;& (6a href="+ccdteactrlclass="sref">locdteactrlatus   "line" namionL9toec" class="sref">soeccdrop;& (6a href="+ccolarolclass="sref">locolarol       int.6a href="+code=stat" class="sref4v4102ioa>4>soeclarecdrop;& (6a href="+ccdteaadp=sense" class="miteaadpl.c#L1  "line" namionL9toec" class="sref">soeccdrop;& (6a href="+cadp=sense" class="adpl.c#   int.6a href="+code=stat" class="sref4v0.6/spa 4>soeclarecdrop;& (6a href="+ccdteaformte=sense" class="miteaformteatus  ef="+code=sense_kCDROM_MSFe" namionL128">CDROM_MSFoa> e .c#L42" idonL42" class="line" namionL424tflagioa>4
requdba_to_msf       6a href="+codtoec" class="sref">soeccdrop;& (6a href="+caddp=sense" class="dddprom_.6a href="+code=lbss="sref">driveilbscdron.c#L50" idonL50" class="line" namionL54_THISioa>4>(6a href="+code=drsoeclare" class="sref">soeclarecdrop;& (6a href="+ccdteaaddp=sense" class="miteaaddprom_.6a href="+code=msfass="sref">requmsf    .6a href="+code=minutc" class="sref">minutccdron.c#L50" idonL50" class="line" namionL54_8a>stati4>(6a href="+code=drsoeclare" class="sref">soeclarecdrop;& (6a href="+ccdteaaddp=sense" class="miteaaddprom_.6a href="+code=msfass="sref">requmsf    .6a href="+code=secolfo" class="sref"secolfcdron.c#L50" idonL50" class="line" namionL54_9a>stati4
(6a href="+code=drsoeclare" class="sref">soeclarecdrop;& (6a href="+ccdteaaddp=sense" class="miteaaddprom_.6a href="+code=msfass="sref">requmsf    .6a href="+code=frideclass="sref">lofridecdro="+code=BLK_MAX_CDB" class="sref">BLK_MA4tflagioa>4
soeclarecdrop;& (6a href="+ccdteaaddp=sense" class="miteaaddprom_.6a href="+code=lbss="sref">driveilbscdro   "line" namionL9toec" class="sref">soeccdrop;& (6a href="+caddp=sense" class="dddprom_.6a href="+code=lbss="sref">driveilbscdro"+code=BLK_MAX_CDB" class="sref">BLK_MA4tinfoioa>4>BLK_MA4 */6/spa 4
.120ioa>              4"CDBioa>]4
 =.04>.1256/a4>"+codeine"audio namio     _status" class="sref">ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_inL127" idonL127" class="line" namionL124"THISioa>4>memsvoid="+code=ide_drivear class="sref">loar cdroeL121" idonL121" class="line" namionL124">.1276/a4>cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">4">. 29ioa4>{
4>;>mee .c#L42" idonL42" class="line" namionL424">.1216/a4a>>)
]4>;>-& doesn=    t support itcdive to close tray if open, if it can do tha4_ioa> =.04>}>.1256/a4a>>4 >
cdrom_check_statusioa>(6a href="+coar class="sref">loar cdroegt;6a href="+code=handle" class="sref">4">.1276/a4 >

cdrom_check_statusioa>(6a href="+coar class="sref">loar cdroegt;6a href="+code=handle" class="sref">4ives6/spa4 >
"+code_readgtoeclarehref="+code=cdrom_ejass="sref">cdrom_check_statusioa>(6a href="+coar class="sref">loar cdroegt;6a href="+code=handle" class="sref">4i>.1216/a4>)
countioa4>{
           EINV49cdro   int.6a href="+code=stat" class="sref4i.h6/a>&g4;;> =.04>;>.1256/a4>;>/*6/spa4>;>. 476/4a>>"+codeine"packet     _status" class="sref">ide_cdrom_drive_statusioa>(struct.6a href="+code=cdrom_device_info" class="sref">cdrom_device_inL127" idonL127" class="line" namionL1247etc6/spa4>)
cdrom_dpacket_71" cdicdrom_device_info" clage=sense" class="agecdroeL121" idonL121" class="line" namionL124EINVALioa4>;>. 506/4a>>cdrom_ejectioa>(6a href="+code=ide_drive_t" class="sref">ide_drive_tioa> *6a href="+code=drive" class="sref">driveioa> =.6a href="+code=cdi" class="sref">cdiioa>->6a href="+code=handle" class="sref">4senseioa>4);>drivei clasense_inline" namionL120">.120ioa>              4scountioa4>)
4s.h6/a>&g4>;> =.04a>>cdrom_ejtimeou=l.c#L<d  ieL121" idonL121" class="line" namionL124medioa>))4 {
cdrom_ejtimeou=l.c#La> *6a href="+codATAPI_WAI__PC"sref">cdrom_ejATAPI_WAI__PCa>->6a href="+code=handle" class="sref">4s>/*6/spa4>)
;>;>   If EJECTFLAG is 1, try to reload the disk4       el4se>.120ioa>              4O_DISCioa4>;> & 6aCGC_DATA_WRITEcdroeL121" idonL121" class="line" namionL124Ocountioa4 }>drivei clasense_|infoioa> *6a hrefREQ_WRITEgsioa> & 6aREQ_WRITEa>->6a href="+code=handle" class="sref">4Y.h6/a>&g4a>> =.0404>driveioa>, &L114" idonL114" class="line" namionL114 edioa>))4;;>.126ioa>        6a href="+codege=sense" class="agecdroveioa> =.6a href="+cive" class="sref">driveioa>, msetisizeof _status" class="sref">namionL45">. 45ioa>        struct.6a href="+c)egt;6a href="+code=handle" class="sref">4ISC_OKioa4>;>>.12qui" a>, &L114" idonL114" class="line" namionL114 _openioa4 >
drivei clasense_|infoioa> *6a hrefREQ_QUIE_flagsioa> &REQ_QUIE_       int.6a href="+code=stat" class="sref4rts,6/spa4 >

. 51ioa>    "line" namionL9"+code_queue_pe=sense" class=""+code_queue_perom_check_status" class="sref">cdrom_check_statusioa>(6a href="+coege=sense" class="agecdroveioa> =.6a href="+ce=memset" class="sref">mem.c#L50" idonL50" class="line" namionL54r_DISCioa4 >
 & 6aCGC_DATA_WRITEcdrom.c#L50" idonL50" class="line" namionL54rcountioa4 >
&g4 {
driveioa>, msonL129" class="ege=sense" class="agecdroveioa> =.6a href="+ctimeou="sref">cdrom_ejtimeou=l.c#msonL129" class=" class="sref">drivei clasenseegt;6a href="+code=handle" class="sref">4E">. 546/41)
. 51ioa> &L114" idonL114" class="line" namionL114O_DISCioa4>;>4ESC_OKioa4>>>. 51ioa> gt;6a href="+code=handle" class="sref">4ESC_OKioa4>;>/*6/spa4 }>LXR 40" unityl.c#msthis experi claal 3" cioL byn#L23" idomailto:lxp@"drux.norelxp@"drux.nol.c#.


lxp."drux.no kindly ho.6ed byn#L23" idohttp://www.redpill-"drpro.noreRedpill Ldrpro ASl.c#msprov"lir ofiLdrux 40nsulting cdi operatioLs services sinec 1995.