linux/drivers/ide/ide-cd_ioctl.c
<<
v3162/spa v3 162/formv3 162a v316 href="../linux+v3.7.4/drivers/ide/ide-cd_ioctl.c"> v3162img src="../.static/gfx/right.png" alt=">>"> 2/spa v3 2spa class="lxr_search"> v3 ="+search" method="post" onsubmit="return do_search(this);"> v3162input typ hidden" nam navtarget" >> "> v3162input typ text" nam search" id search"> v3162butt3 typ submit">Search v316Prefs3 162/a> 2/spa v3v316 62/divv3v316 62form ac> ="ajax+*" method="post" onsubmit="return false;"> 2input typ hidden" nam ajax_lookup" id ajax_lookup" >> "> v316 62/formv3 v316 62div class="headingbott3m">3 2div id file_contents"v
6 612/a>2spa  class="comment">/*2/spa v36 622/a>2spa  class="comment"> * cdrom.c IOCTLs handling for ide-cd driver.2/spa v36 632/a>2spa  class="comment"> *2/spa v36 642/a>2spa  class="comment"> * Copyright (C) 1994-1996  Scott Snyder <snyder@fnald0.fnal.gov>2/spa v36 652/a>2spa  class="comment"> * Copyright (C) 1996-1998  Erik Andersen <andersee@debian.org>2/spa v36 662/a>2spa  class="comment"> * Copyright (C) 1998-2000  Jens Axboe <axboe@suse.de>2/spa v36 672/a>2spa  class="comment"> */2/spa v36 682/a> 6 692/a>#include <linux/kernel.h2/a>> 6 
  
a>#include <linux/cdrom.h2/a>> 6 11 
a>#include <linux/gfp.h2/a>> 6 12 
a>#include <linux/ide.h2/a>> 6 13 
a>#include <scsi/scsi.h2/a>> 6 142/a> 6 15 
a>#include "ide-cd.h2/a>" 6 162/a> 6 172/a>2spa  class="comment">/****************************************************************************2/spa v36 182/a>2spa  class="comment"> * Other driver requests (open, close, check media change).2/spa v36 192/a>2spa  class="comment"> */2/spa v36 2  
a>int62a href="+code=ide_cdrom_open_real" class="sref">ide_cdrom_open_real 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, int62a href="+code=purpose" class="sref">purpose 
a>)36 21 
a>{36 22 
a>        return 0; 6 23 
a>} 6 242/a> 6 252/a>2spa  class="comment">/*2/spa v36 262/a>2spa  class="comment"> * Close down the device.  In>>
idate all cached blocks.2/spa v36 272/a>2spa  class="comment"> */2/spa v36 282/a>void62a href="+code=ide_cdrom_release_real" class="sref">ide_cdrom_release_real 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>)36 29 
a>{36 30 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6 312/a> 6 32 
a>        if (!2a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=use_count" class="sref">use_count 
a>)36 33 
a>                2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> &= ~2a href="+code=IDE_AFLAG_TOC_VALID" class="sref">IDE_AFLAG_TOC_VALID 
a>; 6 34 
a>} 6 352/a> 6 362/a>2spa  class="comment">/*2/spa v36 372/a>2spa  class="comment"> * add logic to try GET_EVENT command first to check for media and tray2/spa v36 382/a>2spa  class="comment"> * status. this should be supported by newer cd-r/w and all DVD etc2/spa v36 392/a>2spa  class="comment"> * drives2/spa v36 402/a>2spa  class="comment"> */2/spa v36 41 
a>int62a href="+code=ide_cdrom_drive_status" class="sref">ide_cdrom_drive_status 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, int62a href="+code=slot_nr" class="sref">slot_nr 
a>)36 42 
a>{36 43 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6 44 
a>        struct62a href="+code=media_event_desc" class="sref">media_event_desc 
a> 2a href="+code=med" class="sref">med 
a>; 6 45 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=sense" class="sref">sense 
a>; 6 46 
a>        int62a href="+code=stat" class="sref">stat 
a>; 6 472/a> 6 48 
a>        if (2a href="+code=slot_nr" class="sref">slot_nr 
a> !=62a href="+code=CDSL_CURRENT" class="sref">CDSL_CURRENT 
a>)36 49 
a>                return -2a href="+code=EINVAL" class="sref">EINVAL 
a>; 6 502/a> 6 51 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=cdrom_check_status" class="sref">cdrom_check_status 
a>(2a href="+code=drive" class="sref">drive 
a>, &2a href="+code=sense" class="sref">sense 
a>); 6 52 
a>        if (!2a href="+code=stat" class="sref">stat 
a> || 2a href="+code=sense" class="sref">sense 
a>.2a href="+code=sense_key" class="sref">sense_key 
a> ==62a href="+code=UNIT_ATTENTION" class="sref">UNIT_ATTENTION 
a>)36 53 
a>                return 2a href="+code=CDS_DISC_OK" class="sref">CDS_DISC_OK 
a>; 6 542/a> 6 55 
a>        if (!2a href="+code=cdrom_get_media_event" class="sref">cdrom_get_media_event 
a>(2a href="+code=cdi" class="sref">cdi 
a>, &2a href="+code=med" class="sref">med 
a>)) {36 56 
a>                if (2a href="+code=med" class="sref">med 
a>.2a href="+code=media_present" class="sref">media_present 
a>)36 57 
a>                        return 2a href="+code=CDS_DISC_OK" class="sref">CDS_DISC_OK 
a>; 6 58 
a>                else if (2a href="+code=med" class="sref">med 
a>.2a href="+code=door_open" class="sref">door_open 
a>)36 59 
a>                        return 2a href="+code=CDS_TRAY_OPEN" class="sref">CDS_TRAY_OPEN 
a>; 6 60 
a>                else 6 61 
a>                        return 2a href="+code=CDS_NO_DISC" class="sref">CDS_NO_DISC 
a>; 6 62 
a>        } 6 632/a> 6 64 
a>        if (2a href="+code=sense" class="sref">sense 
a>.2a href="+code=sense_key" class="sref">sense_key 
a> ==62a href="+code=NOT_READY" class="sref">NOT_READY 
a> && 2a href="+code=sense" class="sref">sense 
a>.2a href="+code=asc" class="sref">asc 
a> ==60x04 6 65 
a>                        && 2a href="+code=sense" class="sref">sense 
a>.2a href="+code=ascq" class="sref">ascq 
a> ==60x04)36 66 
a>                return 2a href="+code=CDS_DISC_OK" class="sref">CDS_DISC_OK 
a>; 6 672/a> 6 68 
a>        2spa  class="comment">/*2/spa v36 692/a>2spa  class="comment">         * If not using Mt Fuji extended media tray reports,2/spa v36 702/a>2spa  class="comment">         * just return TRAY_OPEN since ATAPI doesn't provide2/spa v36 712/a>2spa  class="comment">         * any other way to detect this...2/spa v36 722/a>2spa  class="comment">         */2/spa v36 73 
a>        if (2a href="+code=sense" class="sref">sense 
a>.2a href="+code=sense_key" class="sref">sense_key 
a> ==62a href="+code=NOT_READY" class="sref">NOT_READY 
a>) {36 74 
a>                if (2a href="+code=sense" class="sref">sense 
a>.2a href="+code=asc" class="sref">asc 
a> ==60x3a && 2a href="+code=sense" class="sref">sense 
a>.2a href="+code=ascq" class="sref">ascq 
a> ==61)36 75 
a>                        return 2a href="+code=CDS_NO_DISC" class="sref">CDS_NO_DISC 
a>; 6 76 
a>                else 6 77 
a>                        return 2a href="+code=CDS_TRAY_OPEN" class="sref">CDS_TRAY_OPEN 
a>; 6 78 
a>        } 6 79 
a>        return 2a href="+code=CDS_DRIVE_NOT_READY" class="sref">CDS_DRIVE_NOT_READY 
a>; 6 80 
a>} 6 812/a> 6 822/a>2spa  class="comment">/*2/spa v36 832/a>2spa  class="comment"> * ide-cd always generates media changed event if media is missing, which6 842/a>2spa  class="comment"> * makes it impossible to use for proper event reporting, so disk->events2/spa v36 852/a>2spa  class="comment"> * is cleared to 0 and the following func>
   is used only to trigger2/spa v36 862/a>2spa  class="comment"> * re>>
idat
   and never propagated to userland.2/spa v36 872/a>2spa  class="comment"> */2/spa v36 88 
a>unsigned int62a href="+code=ide_cdrom_check_events_real" class="sref">ide_cdrom_check_events_real 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>,36 89 
a>                                         unsigned int62a href="+code=clearing" class="sref">clearing 
a>, int62a href="+code=slot_nr" class="sref">slot_nr 
a>)36 90 
a>{36 91 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6 92 
a>        int62a href="+code=retval" class="sref">retval 
a>; 6 932/a> 6 94 
a>        if (2a href="+code=slot_nr" class="sref">slot_nr 
a> ==62a href="+code=CDSL_CURRENT" class="sref">CDSL_CURRENT 
a>) {36 95 
a>                (void)62a href="+code=cdrom_check_status" class="sref">cdrom_check_status 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=NULL" class="sref">NULL 
a>); 6 96 
a>                2a href="+code=retval" class="sref">retval 
a> =6(2a href="+code=drive" class="sref">drive 
a>->2a href="+code=dev_flags" class="sref">dev_flags 
a> & 2a href="+code=IDE_DFLAG_MEDIA_CHANGED" class="sref">IDE_DFLAG_MEDIA_CHANGED 
a>) ? 1 : 0; 6 97 
a>                2a href="+code=drive" class="sref">drive 
a>->2a href="+code=dev_flags" class="sref">dev_flags 
a> &= ~2a href="+code=IDE_DFLAG_MEDIA_CHANGED" class="sref">IDE_DFLAG_MEDIA_CHANGED 
a>; 6 98 
a>                return 2a href="+code=retval" class="sref">retval 
a> ? 2a href="+code=DISK_EVENT_MEDIA_CHANGE" class="sref">DISK_EVENT_MEDIA_CHANGE 
a> : 0; 6 99 
a>        } else {36100 
a>                return 0; 6101 
a>        } 6102 
a>} 61032/a> 61042/a>2spa  class="comment">/* Eject the disk if EJECTFLAG is 0.2/spa v361052/a>2spa  class="comment">   If EJECTFLAG is 1, try to reload the disk. */2/spa v36106 
a>static36107 
a>int62a href="+code=cdrom_eject" class="sref">cdrom_eject 
a>(2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a>, int62a href="+code=ejectflag" class="sref">ejectflag 
a>,36108 
a>                struct62a href="+code=request_sense" class="sref">request_sense 
a> *2a href="+code=sense" class="sref">sense 
a>)36109 
a>{36110 
a>        struct62a href="+code=cdrom_info" class="sref">cdrom_info 
a> *2a href="+code=cd" class="sref">cd 
a> =62a href="+code=drive" class="sref">drive 
a>->2a href="+code=driver_data" class="sref">driver_data 
a>; 6111 
a>        struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a> =6&2a href="+code=cd" class="sref">cd 
a>->2a href="+code=devinfo" class="sref">devinfo 
a>; 6112 
a>        char62a href="+code=loej" class="sref">loej 
a> =60x02; 6113 
a>        unsigned char62a href="+code=cmd" class="sref">cmd 
a>[2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>]; 61142/a> 6115 
a>        if ((2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> & 2a href="+code=IDE_AFLAG_NO_EJECT" class="sref">IDE_AFLAG_NO_EJECT 
a>) && !2a href="+code=ejectflag" class="sref">ejectflag 
a>)36116 
a>                return -2a href="+code=EDRIVE_CANT_DO_THIS" class="sref">EDRIVE_CANT_DO_THIS 
a>; 61172/a> 6118 
a>        2spa  class="comment">/* reload fails on some drives, if the tray is locked */2/spa v36119 
a>        if ((2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> & 2a href="+code=IDE_AFLAG_DOOR_LOCKED" class="sref">IDE_AFLAG_DOOR_LOCKED 
a>) && 2a href="+code=ejectflag" class="sref">ejectflag 
a>)36120 
a>                return 0; 61212/a> 6122 
a>        2spa  class="comment">/* only tell drive to close tray if open, if it can do that */2/spa v36123 
a>        if (2a href="+code=ejectflag" class="sref">ejectflag 
a> && (2a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=mask" class="sref">mask 
a> & 2a href="+code=CDC_CLOSE_TRAY" class="sref">CDC_CLOSE_TRAY 
a>))36124 
a>                2a href="+code=loej" class="sref">loej 
a> =60; 61252/a> 6126 
a>        2a href="+code=memset" class="sref">memset 
a>(2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>); 61272/a> 6128 
a>        2a href="+code=cmd" class="sref">cmd 
a>[0] =62a href="+code=GPCMD_START_STOP_UNIT" class="sref">GPCMD_START_STOP_UNIT 
a>; 6129 
a>        2a href="+code=cmd" class="sref">cmd 
a>[4] =62a href="+code=loej" class="sref">loej 
a> | (2a href="+code=ejectflag" class="sref">ejectflag 
a> !=60); 61302/a> 6131 
a>        return 2a href="+code=ide_cd_queue_pc" class="sref">ide_cd_queue_pc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=NULL" class="sref">NULL 
a>, 2a href="+code=NULL" class="sref">NULL 
a>, 2a href="+code=sense" class="sref">sense 
a>, 0, 0); 6132 
a>} 61332/a> 61342/a>2spa  class="comment">/* Lock the door if LOCKFLAG is nonzero; unlock it otherwise. */2/spa v361352/a>static361362/a>int62a href="+code=ide_cd_lockdoor" class="sref">ide_cd_lockdoor 
a>(2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a>, int62a href="+code=lockflag" class="sref">lockflag 
a>,36137 
a>                    struct62a href="+code=request_sense" class="sref">request_sense 
a> *2a href="+code=sense" class="sref">sense 
a>)361382/a>{36139 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=my_sense" class="sref">my_sense 
a>; 6140 
a>        int62a href="+code=stat" class="sref">stat 
a>; 61412/a> 6142 
a>        if (2a href="+code=sense" class="sref">sense 
a> ==62a href="+code=NULL" class="sref">NULL 
a>) 6143 
a>                2a href="+code=sense" class="sref">sense 
a> = &2a href="+code=my_sense" class="sref">my_sense 
a>; 61442/a> 6145 
a>        2spa  class="comment">/* If the drive cannot lock the door, just pretend. */2/spa v36146 
a>        if ((2a href="+code=drive" class="sref">drive 
a>->2a href="+code=dev_flags" class="sref">dev_flags 
a> & 2a href="+code=IDE_DFLAG_DOORLOCKING" class="sref">IDE_DFLAG_DOORLOCKING 
a>) ==60) {36147 
a>                2a href="+code=stat" class="sref">stat 
a> =60; 6148 
a>        } else {36149 
a>                unsigned char62a href="+code=cmd" class="sref">cmd 
a>[2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>]; 61502/a> 6151 
a>                2a href="+code=memset" class="sref">memset 
a>(2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>); 6152 
a> 6153 
a>                2a href="+code=cmd" class="sref">cmd 
a>[0] =62a href="+code=GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL" class="sref">GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 
a>; 6154 
a>                2a href="+code=cmd" class="sref">cmd 
a>[4] =62a href="+code=lockflag" class="sref">lockflag 
a> ? 1 : 0; 61552/a> 6156 
a>                2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_queue_pc" class="sref">ide_cd_queue_pc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=NULL" class="sref">NULL 
a>, 2a href="+code=NULL" class="sref">NULL 
a>, 6157 
a>                                       2a href="+code=sense" class="sref">sense 
a>, 0, 0); 6158 
a>        } 6159 
a> 6160 
a>        2spa  class="comment">/* If we got a  illegal field error, the drive2/spa v361612/a>2spa  class="comment">           probably cannot lock the door. */2/spa v36162 
a>        if (2a href="+code=stat" class="sref">stat 
a> !=60 &&36163 
a>            2a href="+code=sense" class="sref">sense 
a>->2a href="+code=sense_key" class="sref">sense_key 
a> ==62a href="+code=ILLEGAL_REQUEST" class="sref">ILLEGAL_REQUEST 
a> &&36164 
a>            (2a href="+code=sense" class="sref">sense 
a>->2a href="+code=asc" class="sref">asc 
a> ==60x24 || 2a href="+code=sense" class="sref">sense 
a>->2a href="+code=asc" class="sref">asc 
a> ==60x20)) {36165 
a>                2a href="+code=printk" class="sref">printk 
a>(2a href="+code=KERN_ERR" class="sref">KERN_ERR 
a> 2spa  class="string">"%s: door locking not supported\n"6166 
a>                        2a href="+code=drive" class="sref">drive 
a>->2a href="+code=nam " class="sref">nam  
a>); 6167 
a>                2a href="+code=drive" class="sref">drive 
a>->2a href="+code=dev_flags" class="sref">dev_flags 
a> &= ~2a href="+code=IDE_DFLAG_DOORLOCKING" class="sref">IDE_DFLAG_DOORLOCKING 
a>; 6168 
a>                2a href="+code=stat" class="sref">stat 
a> =60; 6169 
a>        } 61702/a> 6171 
a>        2spa  class="comment">/* no medium, that's alright. */2/spa v36172 
a>        if (2a href="+code=stat" class="sref">stat 
a> !=60 && 2a href="+code=sense" class="sref">sense 
a>->2a href="+code=sense_key" class="sref">sense_key 
a> ==62a href="+code=NOT_READY" class="sref">NOT_READY 
a> && 2a href="+code=sense" class="sref">sense 
a>->2a href="+code=asc" class="sref">asc 
a> ==60x3a) 6173 
a>                2a href="+code=stat" class="sref">stat 
a> =60; 61742/a> 6175 
a>        if (2a href="+code=stat" class="sref">stat 
a> ==60) {36176 
a>                if (2a href="+code=lockflag" class="sref">lockflag 
a>) 6177 
a>                        2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> |=62a href="+code=IDE_AFLAG_DOOR_LOCKED" class="sref">IDE_AFLAG_DOOR_LOCKED 
a>; 6178 
a>                else 6179 
a>                        2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> &= ~2a href="+code=IDE_AFLAG_DOOR_LOCKED" class="sref">IDE_AFLAG_DOOR_LOCKED 
a>; 6180 
a>        } 61812/a> 6182 
a>        return 2a href="+code=stat" class="sref">stat 
a>; 6183 
a>} 61842/a> 61852/a>int62a href="+code=ide_cdrom_tray_move" class="sref">ide_cdrom_tray_move 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, int62a href="+code=posit
  " class="sref">posit
   
a>) 61862/a>{36187 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6188 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=sense" class="sref">sense 
a>; 6189 
a> 6190 
a>        if (2a href="+code=posit
  " class="sref">posit
   
a>) {36191 
a>                int62a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_lockdoor" class="sref">ide_cd_lockdoor 
a>(2a href="+code=drive" class="sref">drive 
a>, 0, &2a href="+code=sense" class="sref">sense 
a>); 6192 
a> 6193 
a>                if (2a href="+code=stat" class="sref">stat 
a>) 6194 
a>                        return 2a href="+code=stat" class="sref">stat 
a>; 6195 
a>        } 61962/a> 6197 
a>        return 2a href="+code=cdrom_eject" class="sref">cdrom_eject 
a>(2a href="+code=drive" class="sref">drive 
a>, !2a href="+code=posit
  " class="sref">posit
   
a>, &2a href="+code=sense" class="sref">sense 
a>); 6198 
a>} 6199 
a> 620  
a>int62a href="+code=ide_cdrom_lock_door" class="sref">ide_cdrom_lock_door 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, int62a href="+code=lock" class="sref">lock 
a>) 6201 
a>{36202 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 62032/a> 6204 
a>        return 2a href="+code=ide_cd_lockdoor" class="sref">ide_cd_lockdoor 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=lock" class="sref">lock 
a>, 2a href="+code=NULL" class="sref">NULL 
a>); 62052/a>} 62062/a> 62072/a>2spa  class="comment">/*2/spa v362082/a>2spa  class="comment"> * ATAPI devices are free to select the speed you request or any slower2/spa v362092/a>2spa  class="comment"> * rate. :-(  Requesting too fast a speed will _not_ produce a  error.2/spa v362102/a>2spa  class="comment"> */2/spa v36211 
a>int62a href="+code=ide_cdrom_select_speed" class="sref">ide_cdrom_select_speed 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, int62a href="+code=speed" class="sref">speed 
a>) 6212 
a>{36213 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6214 
a>        struct62a href="+code=cdrom_info" class="sref">cdrom_info 
a> *2a href="+code=cd" class="sref">cd 
a> =62a href="+code=drive" class="sref">drive 
a>->2a href="+code=driver_data" class="sref">driver_data 
a>; 6215 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=sense" class="sref">sense 
a>; 6216 
a>        2a href="+code=u8" class="sref">u8 
a> 2a href="+code=buf" class="sref">buf 
a>[2a href="+code=ATAPI_CAPABILITIES_PAGE_SIZE" class="sref">ATAPI_CAPABILITIES_PAGE_SIZE 
a>]; 6217 
a>        int62a href="+code=stat" class="sref">stat 
a>; 6218 
a>        unsigned char62a href="+code=cmd" class="sref">cmd 
a>[2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>]; 6219 
a> 6220 
a>        if (2a href="+code=speed" class="sref">speed 
a> ==60) 6221 
a>                2a href="+code=speed" class="sref">speed 
a> = 0xffff; 2spa  class="comment">/* set to max */2/spa v36222 
a>        else 6223 
a>                2a href="+code=speed" class="sref">speed 
a> *=6177;   2spa  class="comment">/* Nx to kbytes/s */2/spa v362242/a> 6225 
a>        2a href="+code=memset" class="sref">memset 
a>(2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>); 62262/a> 6227 
a>        2a href="+code=cmd" class="sref">cmd 
a>[0] =62a href="+code=GPCMD_SET_SPEED" class="sref">GPCMD_SET_SPEED 
a>; 6228 
a>        2spa  class="comment">/* Read Drive speed in kbytes/second MSB/LSB */2/spa v36229 
a>        2a href="+code=cmd" class="sref">cmd 
a>[2] =6(2a href="+code=speed" class="sref">speed 
a> >> 8) & 0xff; 6230 
a>        2a href="+code=cmd" class="sref">cmd 
a>[3] =62a href="+code=speed" class="sref">speed 
a> & 0xff; 6231 
a>        if ((2a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=mask" class="sref">mask 
a> & (2a href="+code=CDC_CD_R" class="sref">CDC_CD_R 
a> | 2a href="+code=CDC_CD_RW" class="sref">CDC_CD_RW 
a> | 2a href="+code=CDC_DVD_R" class="sref">CDC_DVD_R 
a>)) != 6232 
a>            (2a href="+code=CDC_CD_R" class="sref">CDC_CD_R 
a> | 2a href="+code=CDC_CD_RW" class="sref">CDC_CD_RW 
a> | 2a href="+code=CDC_DVD_R" class="sref">CDC_DVD_R 
a>)) {36233 
a>                2spa  class="comment">/* Write Drive speed in kbytes/second MSB/LSB */2/spa v36234 
a>                2a href="+code=cmd" class="sref">cmd 
a>[4] =6(2a href="+code=speed" class="sref">speed 
a> >> 8) & 0xff; 6235 
a>                2a href="+code=cmd" class="sref">cmd 
a>[5] =62a href="+code=speed" class="sref">speed 
a> & 0xff; 6236 
a>        } 62372/a> 6238 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_queue_pc" class="sref">ide_cd_queue_pc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=NULL" class="sref">NULL 
a>, 2a href="+code=NULL" class="sref">NULL 
a>, &2a href="+code=sense" class="sref">sense 
a>, 0, 0); 6239 
a> 6240 
a>        if (!2a href="+code=ide_cdrom_get_capabilities" class="sref">ide_cdrom_get_capabilities 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=buf" class="sref">buf 
a>)) {36241 
a>                2a href="+code=ide_cdrom_update_speed" class="sref">ide_cdrom_update_speed 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=buf" class="sref">buf 
a>); 6242 
a>                2a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=speed" class="sref">speed 
a> = 2a href="+code=cd" class="sref">cd 
a>->2a href="+code=current_speed" class="sref">current_speed 
a>; 6243 
a>        } 62442/a> 6245 
a>        return 0; 6246 
a>} 62472/a> 6248 
a>int62a href="+code=ide_cdrom_get_last_sess
  " class="sref">ide_cdrom_get_last_sess
   
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, 6249 
a>                               struct62a href="+code=cdrom_multisess
  " class="sref">cdrom_multisess
   
a> *2a href="+code=ms_info" class="sref">ms_info 
a>) 6250 
a>{36251 
a>        struct62a href="+code=atapi_toc" class="sref">atapi_toc 
a> *2a href="+code=toc" class="sref">toc 
a>; 6252 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6253 
a>        struct62a href="+code=cdrom_info" class="sref">cdrom_info 
a> *2a href="+code=info" class="sref">info 
a> =62a href="+code=drive" class="sref">drive 
a>->2a href="+code=driver_data" class="sref">driver_data 
a>; 6254 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=sense" class="sref">sense 
a>; 6255 
a>        int62a href="+code=ret" class="sref">ret 
a>; 62562/a> 6257 
a>        if ((2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> & 2a href="+code=IDE_AFLAG_TOC_VALID" class="sref">IDE_AFLAG_TOC_VALID 
a>) ==60 || !2a href="+code=info" class="sref">info 
a>->2a href="+code=toc" class="sref">toc 
a>) {36258 
a>                2a href="+code=ret" class="sref">ret 
a> =62a href="+code=ide_cd_read_toc" class="sref">ide_cd_read_toc 
a>(2a href="+code=drive" class="sref">drive 
a>, &2a href="+code=sense" class="sref">sense 
a>); 6259 
a>                if (2a href="+code=ret" class="sref">ret 
a>) 6260 
a>                        return 2a href="+code=ret" class="sref">ret 
a>; 6261 
a>        } 6262 
a> 6263 
a>        2a href="+code=toc" class="sref">toc 
a> =62a href="+code=info" class="sref">info 
a>->2a href="+code=toc" class="sref">toc 
a>; 6264 
a>        2a href="+code=ms_info" class="sref">ms_info 
a>->2a href="+code=addr" class="sref">addr 
a>.2a href="+code=lba" class="sref">lba 
a> =62a href="+code=toc" class="sref">toc 
a>->2a href="+code=last_sess
  _lba" class="sref">last_sess
  _lba 
a>; 6265 
a>        2a href="+code=ms_info" class="sref">ms_info 
a>->2a href="+code=xa_flag" class="sref">xa_flag 
a> =62a href="+code=toc" class="sref">toc 
a>->2a href="+code=xa_flag" class="sref">xa_flag 
a>; 62662/a> 6267 
a>        return 0; 6268 
a>} 6269 
a> 627  
a>int62a href="+code=ide_cdrom_get_mc " class="sref">ide_cdrom_get_mc  
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, 6271 
a>                      struct62a href="+code=cdrom_mc " class="sref">cdrom_mc  
a> *2a href="+code=mcn_info" class="sref">mcn_info 
a>) 6272 
a>{36273 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6274 
a>        int62a href="+code=stat" class="sref">stat 
a>, 2a href="+code=mcnle " class="sref">mcnle  
a>; 6275 
a>        char62a href="+code=buf" class="sref">buf 
a>[24]; 6276 
a>        unsigned char62a href="+code=cmd" class="sref">cmd 
a>[2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>]; 6277 
a>        unsigned 2a href="+code=le " class="sref">le  
a> =6sizeof(2a href="+code=buf" class="sref">buf 
a>); 6278 
a> 6279 
a>        2a href="+code=memset" class="sref">memset 
a>(2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>); 62802/a> 6281 
a>        2a href="+code=cmd" class="sref">cmd 
a>[0] =62a href="+code=GPCMD_READ_SUBCHANNEL" class="sref">GPCMD_READ_SUBCHANNEL 
a>; 6282 
a>        2a href="+code=cmd" class="sref">cmd 
a>[1] =62;             2spa  class="comment">/* MSF address
ng */2/spa v36283 
a>        2a href="+code=cmd" class="sref">cmd 
a>[2] =60x40;  2spa  class="comment">/* request subQ data */2/spa v36284 
a>        2a href="+code=cmd" class="sref">cmd 
a>[3] =62;             2spa  class="comment">/* format */2/spa v36285 
a>        2a href="+code=cmd" class="sref">cmd 
a>[8] =62a href="+code=le " class="sref">le  
a>; 62862/a> 6287 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_queue_pc" class="sref">ide_cd_queue_pc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=buf" class="sref">buf 
a>, &2a href="+code=le " class="sref">le  
a>, 2a href="+code=NULL" class="sref">NULL 
a>, 0, 0); 6288 
a>        if (2a href="+code=stat" class="sref">stat 
a>) 6289 
a>                return 2a href="+code=stat" class="sref">stat 
a>; 62902/a> 6291 
a>        2a href="+code=mcnle " class="sref">mcnle  
a> =6sizeof(2a href="+code=mcn_info" class="sref">mcn_info 
a>->2a href="+code=medium_catalog_number" class="sref">medium_catalog_number 
a>) - 1; 6292 
a>        2a href="+code=memcpy" class="sref">memcpy 
a>(2a href="+code=mcn_info" class="sref">mcn_info 
a>->2a href="+code=medium_catalog_number" class="sref">medium_catalog_number 
a>, 2a href="+code=buf" class="sref">buf 
a> + 9, 2a href="+code=mcnle " class="sref">mcnle  
a>); 6293 
a>        2a href="+code=mcn_info" class="sref">mcn_info 
a>->2a href="+code=medium_catalog_number" class="sref">medium_catalog_number 
a>[2a href="+code=mcnle " class="sref">mcnle  
a>] =62spa  class="string">'\0'2/spa v; 62942/a> 6295 
a>        return 0; 6296 
a>} 62972/a> 6298 
a>int62a href="+code=ide_cdrom_reset" class="sref">ide_cdrom_reset 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>) 6299 
a>{36300 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6301 
a>        struct62a href="+code=cdrom_info" class="sref">cdrom_info 
a> *2a href="+code=cd" class="sref">cd 
a> =62a href="+code=drive" class="sref">drive 
a>->2a href="+code=driver_data" class="sref">driver_data 
a>; 6302 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=sense" class="sref">sense 
a>; 6303 
a>        struct62a href="+code=request" class="sref">request 
a> *2a href="+code=rq" class="sref">rq 
a>; 6304 
a>        int62a href="+code=ret" class="sref">ret 
a>; 63052/a> 6306 
a>        2a href="+code=rq" class="sref">rq 
a> =62a href="+code=blk_get_request" class="sref">blk_get_request 
a>(2a href="+code=drive" class="sref">drive 
a>->2a href="+code=queue" class="sref">queue 
a>, 2a href="+code=READ" class="sref">READ 
a>, 2a href="+code=__GFP_WAIT" class="sref">__GFP_WAIT 
a>); 6307 
a>        2a href="+code=rq" class="sref">rq 
a>->2a href="+code=cmd_type" class="sref">cmd_type 
a> =62a href="+code=REQ_TYPE_SPECIAL" class="sref">REQ_TYPE_SPECIAL 
a>; 6308 
a>        2a href="+code=rq" class="sref">rq 
a>->2a href="+code=cmd_flags" class="sref">cmd_flags 
a> =62a href="+code=REQ_QUIET" class="sref">REQ_QUIET 
a>; 6309 
a>        2a href="+code=ret" class="sref">ret 
a> =62a href="+code=blk_execute_rq" class="sref">blk_execute_rq 
a>(2a href="+code=drive" class="sref">drive 
a>->2a href="+code=queue" class="sref">queue 
a>, 2a href="+code=cd" class="sref">cd 
a>->2a href="+code=disk" class="sref">disk 
a>, 2a href="+code=rq" class="sref">rq 
a>, 0); 6310 
a>        2a href="+code=blk_put_request" class="sref">blk_put_request 
a>(2a href="+code=rq" class="sref">rq 
a>); 6311 
a>        2spa  class="comment">/*2/spa v36312 
a>2spa  class="comment">         * A reset will unlock the door. If it was previously locked,2/spa v36313 
a>2spa  class="comment">         * lock it again.2/spa v36314 
a>2spa  class="comment">         */2/spa v36315 
a>        if (2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> & 2a href="+code=IDE_AFLAG_DOOR_LOCKED" class="sref">IDE_AFLAG_DOOR_LOCKED 
a>) 6316 
a>                (void)2a href="+code=ide_cd_lockdoor" class="sref">ide_cd_lockdoor 
a>(2a href="+code=drive" class="sref">drive 
a>, 1, &2a href="+code=sense" class="sref">sense 
a>); 63172/a> 6318 
a>        return 2a href="+code=ret" class="sref">ret 
a>; 6319 
a>} 63202/a> 6321 
a>static int62a href="+code=ide_cd_get_toc_entry" class="sref">ide_cd_get_toc_entry 
a>(2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a>, int62a href="+code=track" class="sref">track 
a>, 6322 
a>                                struct62a href="+code=atapi_toc_entry" class="sref">atapi_toc_entry 
a> **2a href="+code=ent" class="sref">ent 
a>) 6323 
a>{36324 
a>        struct62a href="+code=cdrom_info" class="sref">cdrom_info 
a> *2a href="+code=info" class="sref">info 
a> =62a href="+code=drive" class="sref">drive 
a>->2a href="+code=driver_data" class="sref">driver_data 
a>; 6325 
a>        struct62a href="+code=atapi_toc" class="sref">atapi_toc 
a> *2a href="+code=toc" class="sref">toc 
a> =62a href="+code=info" class="sref">info 
a>->2a href="+code=toc" class="sref">toc 
a>; 6326 
a>        int62a href="+code=ntracks" class="sref">ntracks 
a>; 63272/a> 6328 
a>        2spa  class="comment">/*2/spa v363292/a>2spa  class="comment">         * don't serve cached data, if the toc isn't valid2/spa v363302/a>2spa  class="comment">         */2/spa v36331 
a>        if ((2a href="+code=drive" class="sref">drive 
a>->2a href="+code=atapi_flags" class="sref">atapi_flags 
a> & 2a href="+code=IDE_AFLAG_TOC_VALID" class="sref">IDE_AFLAG_TOC_VALID 
a>) ==60) 6332 
a>                return -2a href="+code=EINVAL" class="sref">EINVAL 
a>; 63332/a> 6334 
a>        2spa  class="comment">/* Check validity of requested track number. */2/spa v36335 
a>        2a href="+code=ntracks" class="sref">ntracks 
a> =62a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=last_track" class="sref">last_track 
a> -62a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=first_track" class="sref">first_track 
a> + 1; 63362/a> 6337 
a>        if (2a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=first_track" class="sref">first_track 
a> ==62a href="+code=CDROM_LEADOUT" class="sref">CDROM_LEADOUT 
a>) 6338 
a>                2a href="+code=ntracks" class="sref">ntracks 
a> =60; 6339 
a> 6340 
a>        if (2a href="+code=track" class="sref">track 
a> ==62a href="+code=CDROM_LEADOUT" class="sref">CDROM_LEADOUT 
a>) 6341 
a>                *2a href="+code=ent" class="sref">ent 
a> =6&2a href="+code=toc" class="sref">toc 
a>->2a href="+code=ent" class="sref">ent 
a>[2a href="+code=ntracks" class="sref">ntracks 
a>]; 6342 
a>        else if (2a href="+code=track" class="sref">track 
a> < 2a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=first_track" class="sref">first_track 
a> || 2a href="+code=track" class="sref">track 
a> > 2a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=last_track" class="sref">last_track 
a>) 6343 
a>                return -2a href="+code=EINVAL" class="sref">EINVAL 
a>; 6344 
a>        else 6345 
a>                *2a href="+code=ent" class="sref">ent 
a> =6&2a href="+code=toc" class="sref">toc 
a>->2a href="+code=ent" class="sref">ent 
a>[2a href="+code=track" class="sref">track 
a> -62a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=first_track" class="sref">first_track 
a>]; 63462/a> 6347 
a>        return 0; 6348 
a>} 6349 
a> 6350 
a>static int62a href="+code=ide_cd_fake_play_trkind" class="sref">ide_cd_fake_play_trkind 
a>(2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a>, void *2a href="+code=arg" class="sref">arg 
a>) 6351 
a>{36352 
a>        struct62a href="+code=cdrom_ti" class="sref">cdrom_ti 
a> *2a href="+code=ti" class="sref">ti 
a> =62a href="+code=arg" class="sref">arg 
a>; 6353 
a>        struct62a href="+code=atapi_toc_entry" class="sref">atapi_toc_entry 
a> *2a href="+code=first_toc" class="sref">first_toc 
a>, *2a href="+code=last_toc" class="sref">last_toc 
a>; 6354 
a>        unsigned long62a href="+code=lba_start" class="sref">lba_start 
a>, 2a href="+code=lba_end" class="sref">lba_end 
a>; 6355 
a>        int62a href="+code=stat" class="sref">stat 
a>; 6356 
a>        struct62a href="+code=request_sense" class="sref">request_sense 
a> 2a href="+code=sense" class="sref">sense 
a>; 6357 
a>        unsigned char62a href="+code=cmd" class="sref">cmd 
a>[2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>]; 6358 
a> 6359 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_get_toc_entry" class="sref">ide_cd_get_toc_entry 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=ti" class="sref">ti 
a>->2a href="+code=cdti_trk0" class="sref">cdti_trk0 
a>, &2a href="+code=first_toc" class="sref">first_toc 
a>); 6360 
a>        if (2a href="+code=stat" class="sref">stat 
a>) 6361 
a>                return 2a href="+code=stat" class="sref">stat 
a>; 6362 
a> 6363 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_get_toc_entry" class="sref">ide_cd_get_toc_entry 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=ti" class="sref">ti 
a>->2a href="+code=cdti_trk1" class="sref">cdti_trk1 
a>, &2a href="+code=last_toc" class="sref">last_toc 
a>); 6364 
a>        if (2a href="+code=stat" class="sref">stat 
a>) 6365 
a>                return 2a href="+code=stat" class="sref">stat 
a>; 63662/a> 6367 
a>        if (2a href="+code=ti" class="sref">ti 
a>->2a href="+code=cdti_trk1" class="sref">cdti_trk1 
a> !=62a href="+code=CDROM_LEADOUT" class="sref">CDROM_LEADOUT 
a>) 6368 
a>                ++2a href="+code=last_toc" class="sref">last_toc 
a>; 6369 
a>        2a href="+code=lba_start" class="sref">lba_start 
a> =62a href="+code=first_toc" class="sref">first_toc 
a>->2a href="+code=addr" class="sref">addr 
a>.2a href="+code=lba" class="sref">lba 
a>; 6370 
a>        2a href="+code=lba_end" class="sref">lba_end 
a>   =62a href="+code=last_toc" class="sref">last_toc 
a>->2a href="+code=addr" class="sref">addr 
a>.2a href="+code=lba" class="sref">lba 
a>; 6371 
a> 6372 
a>        if (2a href="+code=lba_end" class="sref">lba_end 
a> <=62a href="+code=lba_start" class="sref">lba_start 
a>) 6373 
a>                return -2a href="+code=EINVAL" class="sref">EINVAL 
a>; 63742/a> 6375 
a>        2a href="+code=memset" class="sref">memset 
a>(2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=BLK_MAX_CDB" class="sref">BLK_MAX_CDB 
a>); 63762/a> 6377 
a>        2a href="+code=cmd" class="sref">cmd 
a>[0] =62a href="+code=GPCMD_PLAY_AUDIO_MSF" class="sref">GPCMD_PLAY_AUDIO_MSF 
a>; 6378 
a>        2a href="+code=lba_to_msf" class="sref">lba_to_msf 
a>(2a href="+code=lba_start" class="sref">lba_start 
a>,   &2a href="+code=cmd" class="sref">cmd 
a>[3], &2a href="+code=cmd" class="sref">cmd 
a>[4], &2a href="+code=cmd" class="sref">cmd 
a>[5]); 6379 
a>        2a href="+code=lba_to_msf" class="sref">lba_to_msf 
a>(2a href="+code=lba_end" class="sref">lba_end 
a> - 1, &2a href="+code=cmd" class="sref">cmd 
a>[6], &2a href="+code=cmd" class="sref">cmd 
a>[7], &2a href="+code=cmd" class="sref">cmd 
a>[8]); 63802/a> 6381 
a>        return 2a href="+code=ide_cd_queue_pc" class="sref">ide_cd_queue_pc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=cmd" class="sref">cmd 
a>, 0, 2a href="+code=NULL" class="sref">NULL 
a>, 2a href="+code=NULL" class="sref">NULL 
a>, &2a href="+code=sense" class="sref">sense 
a>, 0, 0); 6382 
a>} 63832/a> 6384 
a>static int62a href="+code=ide_cd_read_tochdr" class="sref">ide_cd_read_tochdr 
a>(2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a>, void *2a href="+code=arg" class="sref">arg 
a>) 6385 
a>{36386 
a>        struct62a href="+code=cdrom_info" class="sref">cdrom_info 
a> *2a href="+code=cd" class="sref">cd 
a> =62a href="+code=drive" class="sref">drive 
a>->2a href="+code=driver_data" class="sref">driver_data 
a>; 6387 
a>        struct62a href="+code=cdrom_tochdr" class="sref">cdrom_tochdr 
a> *2a href="+code=tochdr" class="sref">tochdr 
a> =62a href="+code=arg" class="sref">arg 
a>; 6388 
a>        struct62a href="+code=atapi_toc" class="sref">atapi_toc 
a> *2a href="+code=toc" class="sref">toc 
a>; 6389 
a>        int62a href="+code=stat" class="sref">stat 
a>; 63902/a> 6391 
a>        2spa  class="comment">/* Make sure our saved TOC is valid. */2/spa v36392 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_read_toc" class="sref">ide_cd_read_toc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=NULL" class="sref">NULL 
a>); 6393 
a>        if (2a href="+code=stat" class="sref">stat 
a>) 6394 
a>                return 2a href="+code=stat" class="sref">stat 
a>; 63952/a> 6396 
a>        2a href="+code=toc" class="sref">toc 
a> =62a href="+code=cd" class="sref">cd 
a>->2a href="+code=toc" class="sref">toc 
a>; 6397 
a>        2a href="+code=tochdr" class="sref">tochdr 
a>->2a href="+code=cdth_trk0" class="sref">cdth_trk0 
a> =62a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=first_track" class="sref">first_track 
a>; 6398 
a>        2a href="+code=tochdr" class="sref">tochdr 
a>->2a href="+code=cdth_trk1" class="sref">cdth_trk1 
a> =62a href="+code=toc" class="sref">toc 
a>->2a href="+code=hdr" class="sref">hdr 
a>.2a href="+code=last_track" class="sref">last_track 
a>; 6399 
a> 6400 
a>        return 0; 6401 
a>} 6402 
a> 6403 
a>static int62a href="+code=ide_cd_read_tocentry" class="sref">ide_cd_read_tocentry 
a>(2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a>, void *2a href="+code=arg" class="sref">arg 
a>) 6404 
a>{36405 
a>        struct62a href="+code=cdrom_tocentry" class="sref">cdrom_tocentry 
a> *2a href="+code=tocentry" class="sref">tocentry 
a> =62a href="+code=arg" class="sref">arg 
a>; 6406 
a>        struct62a href="+code=atapi_toc_entry" class="sref">atapi_toc_entry 
a> *2a href="+code=toce" class="sref">toce 
a>; 6407 
a>        int62a href="+code=stat" class="sref">stat 
a>; 6408 
a> 6409 
a>        2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_get_toc_entry" class="sref">ide_cd_get_toc_entry 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_track" class="sref">cdte_track 
a>, &2a href="+code=toce" class="sref">toce 
a>); 6410 
a>        if (2a href="+code=stat" class="sref">stat 
a>) 6411 
a>                return 2a href="+code=stat" class="sref">stat 
a>; 6412 
a> 6413 
a>        2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_ctrl" class="sref">cdte_ctrl 
a> =62a href="+code=toce" class="sref">toce 
a>->2a href="+code=control" class="sref">control 
a>; 6414 
a>        2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_adr" class="sref">cdte_adr 
a>  =62a href="+code=toce" class="sref">toce 
a>->2a href="+code=adr" class="sref">adr 
a>; 6415 
a>        if (2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_format" class="sref">cdte_format 
a> ==62a href="+code=CDROM_MSF" class="sref">CDROM_MSF 
a>) {36416 
a>                2a href="+code=lba_to_msf" class="sref">lba_to_msf 
a>(2a href="+code=toce" class="sref">toce 
a>->2a href="+code=addr" class="sref">addr 
a>.2a href="+code=lba" class="sref">lba 
a>, 6417 
a>                           &2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_addr" class="sref">cdte_addr 
a>.2a href="+code=msf" class="sref">msf 
a>.2a href="+code=minute" class="sref">minute 
a>, 6418 
a>                           &2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_addr" class="sref">cdte_addr 
a>.2a href="+code=msf" class="sref">msf 
a>.2a href="+code=second" class="sref">second 
a>, 6419 
a>                           &2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_addr" class="sref">cdte_addr 
a>.2a href="+code=msf" class="sref">msf 
a>.2a href="+code=fram " class="sref">fram  
a>); 6420 
a>        } else 6421 
a>                2a href="+code=tocentry" class="sref">tocentry 
a>->2a href="+code=cdte_addr" class="sref">cdte_addr 
a>.2a href="+code=lba" class="sref">lba 
a> =62a href="+code=toce" class="sref">toce 
a>->2a href="+code=addr" class="sref">addr 
a>.2a href="+code=lba" class="sref">lba 
a>; 6422 
a> 6423 
a>        return 0; 6424 
a>} 64252/a> 6426 
a>int62a href="+code=ide_cdrom_audio_ioctl" class="sref">ide_cdrom_audio_ioctl 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, 6427 
a>                          unsigned int62a href="+code=cmd" class="sref">cmd 
a>, void *2a href="+code=arg" class="sref">arg 
a>) 6428 
a>{36429 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 64302/a> 6431 
a>        switch (2a href="+code=cmd" class="sref">cmd 
a>) {36432 
a>        2spa  class="comment">/*2/spa v36433 
a>2spa  class="comment">         * emulate PLAY_AUDIO_TI command with PLAY_AUDIO_10, since 
spa v36434 
a>2spa  class="comment">         * atapi doesn't support it 
spa v36435 
a>2spa  class="comment">         */2/spa v36436 
a>        case62a href="+code=CDROMPLAYTRKIND" class="sref">CDROMPLAYTRKIND 
a>:36437 
a>                return 2a href="+code=ide_cd_fake_play_trkind" class="sref">ide_cd_fake_play_trkind 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=arg" class="sref">arg 
a>); 6438 
a>        case62a href="+code=CDROMREADTOCHDR" class="sref">CDROMREADTOCHDR 
a>:36439 
a>                return 2a href="+code=ide_cd_read_tochdr" class="sref">ide_cd_read_tochdr 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=arg" class="sref">arg 
a>); 6440 
a>        case62a href="+code=CDROMREADTOCENTRY" class="sref">CDROMREADTOCENTRY 
a>:36441 
a>                return 2a href="+code=ide_cd_read_tocentry" class="sref">ide_cd_read_tocentry 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=arg" class="sref">arg 
a>); 6442 
a>        default:36443 
a>                return -2a href="+code=EINVAL" class="sref">EINVAL 
a>; 6444 
a>        } 6445 
a>} 64462/a> 6447 
a>2spa  class="comment">/* the generic packet interface to cdrom.c */2/spa v36448 
a>int62a href="+code=ide_cdrom_packet" class="sref">ide_cdrom_packet 
a>(struct62a href="+code=cdrom_device_info" class="sref">cdrom_device_info 
a> *2a href="+code=cdi" class="sref">cdi 
a>, 6449 
a>                            struct62a href="+code=packet_command" class="sref">packet_command 
a> *2a href="+code=cgc" class="sref">cgc 
a>) 6450 
a>{36451 
a>        2a href="+code=ide_drive_t" class="sref">ide_drive_t 
a> *2a href="+code=drive" class="sref">drive 
a> =62a href="+code=cdi" class="sref">cdi 
a>->2a href="+code=handle" class="sref">handle 
a>; 6452 
a>        unsigned int62a href="+code=flags" class="sref">flags 
a> =60; 6453 
a>        unsigned 2a href="+code=le " class="sref">le  
a> =62a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=bufle " class="sref">bufle  
a>; 64542/a> 6455 
a>        if (2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=timeout" class="sref">timeout 
a> <=60) 6456 
a>                2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=timeout" class="sref">timeout 
a> =62a href="+code=ATAPI_WAIT_PC" class="sref">ATAPI_WAIT_PC 
a>; 64572/a> 6458 
a>        2spa  class="comment">/* here we queue the commands from the uniform CD-ROM2/spa v364592/a>2spa  class="comment">           layer. the packet must be complete, as we do not 
spa v364602/a>2spa  class="comment">           touch it at all. */2/spa v36461 
a> 6462 
a>        if (2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=data_directio " class="sref">data_directio  
a> ==62a href="+code=CGC_DATA_WRITE" class="sref">CGC_DATA_WRITE 
a>) 6463 
a>                2a href="+code=flags" class="sref">flags 
a> |=62a href="+code=REQ_WRITE" class="sref">REQ_WRITE 
a>; 64642/a> 6465 
a>        if (2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=sense" class="sref">sense 
a>) 6466 
a>                2a href="+code=memset" class="sref">memset 
a>(2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=sense" class="sref">sense 
a>, 0, sizeof(struct62a href="+code=request_sense" class="sref">request_sense 
a>)); 64672/a> 6468 
a>        if (2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=quiet" class="sref">quiet 
a>) 6469 
a>                2a href="+code=flags" class="sref">flags 
a> |=62a href="+code=REQ_QUIET" class="sref">REQ_QUIET 
a>; 64702/a> 6471 
a>        2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=stat" class="sref">stat 
a> =62a href="+code=ide_cd_queue_pc" class="sref">ide_cd_queue_pc 
a>(2a href="+code=drive" class="sref">drive 
a>, 2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=cmd" class="sref">cmd 
a>, 6472 
a>                                    2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=data_directio " class="sref">data_directio  
a> ==62a href="+code=CGC_DATA_WRITE" class="sref">CGC_DATA_WRITE 
a>, 6473 
a>                                    2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=buffer" class="sref">buffer 
a>, &2a href="+code=le " class="sref">le  
a>, 6474 
a>                                    2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=sense" class="sref">sense 
a>, 2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=timeout" class="sref">timeout 
a>, 2a href="+code=flags" class="sref">flags 
a>); 6475 
a>        if (!2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=stat" class="sref">stat 
a>) 6476 
a>                2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=bufle " class="sref">bufle  
a> -=62a href="+code=le " class="sref">le  
a>; 6477 
a>        return 2a href="+code=cgc" class="sref">cgc 
a>->2a href="+code=stat" class="sref">stat 
a>; 6478 
a>} 6479 
a>
lxr.linux.no kindly hosted by Redpill Linpro AS a>, provider of Linux consulting and operatio s services since 1995.