linux/drivers/scsi/sr_ioctl.c
<<
>>
Prefs
   1#include <linux/kernel.h>
   2#include <linux/mm.h>
   3#include <linux/fs.h>
   4#include <linux/errno.h>
   5#include <linux/string.h>
   6#include <linux/blkdev.h>
   7#include <linux/module.h>
   8#include <linux/blkpg.h>
   9#include <linux/cdrom.h>
  10#include <linux/delay.h>
  11#include <linux/slab.h>
  12#include <asm/io.h>
  13#include <asm/uaccess.h>
  14
  15#include <scsi/scsi.h>
  16#include <scsi/scsi_dbg.h>
  17#include <scsi/scsi_device.h>
  18#include <scsi/scsi_eh.h>
  19#include <scsi/scsi_host.h>
  20#include <scsi/scsi_ioctl.h>
  21#include <scsi/scsi_cmnd.h>
  22
  23#include "sr.h"
  24
  25#if 0
  26#define DEBUG
  27#endif
  28
  29/* The sr_is_xa() seems to trigger firmware bugs with some drives :-(
  30 * It is off by default and can be turned on with this module parameter */
  31static int xa_test = 0;
  32
  33module_param(xa_test, int, S_IRUGO | S_IWUSR);
  34
  35/* primitive to determine whether we need to have GFP_DMA set based on
  36 * the status of the unchecked_isa_dma flag in the host structure */
  37#define SR_GFP_DMA(cd) (((cd)->device->host->unchecked_isa_dma) ? GFP_DMA : 0)
  38
  39
  40static int sr_read_tochdr(struct cdrom_device_info *cdi,
  41                struct cdrom_tochdr *tochdr)
  42{
  43        struct scsi_cd *cd = cdi->handle;
  44        struct packet_command cgc;
  45        int result;
  46        unsigned char *buffer;
  47
  48        buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
  49        if (!buffer)
  50                return -ENOMEM;
  51
  52        memset(&cgc, 0, sizeof(struct packet_command));
  53        cgc.timeout = IOCTL_TIMEOUT;
  54        cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
  55        cgc.cmd[8] = 12;                /* LSB of length */
  56        cgc.buffer = buffer;
  57        cgc.buflen = 12;
  58        cgc.quiet = 1;
  59        cgc.data_direction = DMA_FROM_DEVICE;
  60
  61        result = sr_do_ioctl(cd, &cgc);
  62
  63        tochdr->cdth_trk0 = buffer[2];
  64        tochdr->cdth_trk1 = buffer[3];
  65
  66        kfree(buffer);
  67        return result;
  68}
  69
  70static int sr_read_tocentry(struct cdrom_device_info *cdi,
  71                struct cdrom_tocentry *tocentry)
  72{
  73        struct scsi_cd *cd = cdi->handle;
  74        struct packet_command cgc;
  75        int result;
  76        unsigned char *buffer;
  77
  78        buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
  79        if (!buffer)
  80                return -ENOMEM;
  81
  82        memset(&cgc, 0, sizeof(struct packet_command));
  83        cgc.timeout = IOCTL_TIMEOUT;
  84        cgc.cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
  85        cgc.cmd[1] |= (tocentry->cdte_format == CDROM_MSF) ? 0x02 : 0;
  86        cgc.cmd[6] = tocentry->cdte_track;
  87        cgc.cmd[8] = 12;                /* LSB of length */
  88        cgc.buffer = buffer;
  89        cgc.buflen = 12;
  90        cgc.data_direction = DMA_FROM_DEVICE;
  91
  92        result = sr_do_ioctl(cd, &cgc);
  93
  94        tocentry->cdte_ctrl = buffer[5] & 0xf;
  95        tocentry->cdte_adr = buffer[5] >> 4;
  96        tocentry->cdte_datamode = (tocentry->cdte_ctrl & 0x04) ? 1 : 0;
  97        if (tocentry->cdte_format == CDROM_MSF) {
  98                tocentry->cdte_addr.msf.minute = buffer[9];
  99                tocentry->cdte_addr.msf.second = buffer[10];
 100                tocentry->cdte_addr.msf.frame = buffer[11];
 101        } else
 102                tocentry->cdte_addr.lba = (((((buffer[8] << 8) + buffer[9]) << 8)
 103                        + buffer[10]) << 8) + buffer[11];
 104
 105        kfree(buffer);
 106        return result;
 107}
 108
 109#define IOCTL_RETRIES 3
 110
 111/* ATAPI drives don't have a SCMD_PLAYAUDIO_TI command.  When these drives
 112   are emulating a SCSI device via the idescsi module, they need to have
 113   CDROMPLAYTRKIND commands translated into CDROMPLAYMSF commands for them */
 114
 115static int sr_fake_playtrkind(struct cdrom_device_info *cdi, struct cdrom_ti *ti)
 116{
 117        struct cdrom_tocentry trk0_te, trk1_te;
 118        struct cdrom_tochdr tochdr;
 119        struct packet_command cgc;
 120        int ntracks, ret;
 121
 122        ret = sr_read_tochdr(cdi, &tochdr);
 123        if (ret)
 124                return ret;
 125
 126        ntracks = tochdr.cdth_trk1 - tochdr.cdth_trk0 + 1;
 127        
 128        if (ti->cdti_trk1 == ntracks) 
 129                ti->cdti_trk1 = CDROM_LEADOUT;
 130        else if (ti->cdti_trk1 != CDROM_LEADOUT)
 131                ti->cdti_trk1 ++;
 132
 133        trk0_te.cdte_track = ti->cdti_trk0;
 134        trk0_te.cdte_format = CDROM_MSF;
 135        trk1_te.cdte_track = ti->cdti_trk1;
 136        trk1_te.cdte_format = CDROM_MSF;
 137        
 138        ret = sr_read_tocentry(cdi, &  39ret)
 1 40ret;
 1 41ret = sr_read_tocentry(cdi, &trk1_te. 131                 1 42ret)
 1 43ret;
  134 1 45memset(&cgc, 0, sizeof(struct packet_command));
 1 46cgc.cmd[6] = CDROM_READ_SF c__TI cocla
 1 47cgc.cmd[8] = 3a href="+code=tocente" class="sref">trk0_te.cdte_addr.msf.minute =  1 48        cgc.cmd[8] = 4a href="+code=tocente" class="sref">trk0_te.cdte_addr.msf.second =  1 49cgc.cmd[8] = 5a href="+code=tocente" class="sref">trk0_te.cdte_addr.msf.frame =  1 50cgc.cmd[6] = trk1_te.cdte_addr.msf.minute =  1 51cgc.cmd[6] = 7a href="+code=tocente" class="sref">trk1_te.cdte_addr.msf.second =  1 52        cgc.cmd[8] = 12;  ef="+code=tocente" class="sref">trk1_te.cdte_addr.msf.frame =  1 53        cgc.data_direction = DMA_FROM_NONa=  1 54        cgc.timeout = IOCTL_TIMEOUT;
 1 55        sr_do_ioctl(cdi->handle;
cgc);
 1 56     href="drivers/scsi/sr_ioctl.c#L108" id="L57" c1lass="line" name="L57"> 1 57 1 58     c int sr_fake_rkin_d" clacdrom_device_info *cdi,
 1 59cdrom_ti *ti)
 1 60
 1 61     href="drivers/scsi/sr_ioctl.c#L117" id="L62" c1lass="line" name="L62"> 1 62scsi_cd *cd = cdi->handle;
 1 63        packet_command cgc;
 1 64        result;
 1 65
 1 66        memset(&cgc, 0, sizeof(struct packet_command));
 1 67cgc.timeout = IOCTL_TIMEOUT;
 1 68cgc.cmd[8] = CDROM_READ_SF c_TI comm
 1 69cgc.cmd[8] = 4a href="+code=tocentass="sref">ti->cdti_trk0;
 1 70cgc.cmd[6] = 5a href="+code=tocentass="sref">ti->cdti_trk0 1 71cgc.cmd[6] = 7a href="+code=tocentass="sref">ti->cdti_trk1;
 1 72cgc.cmd[8] = 12;  ef="+code=tocentass="sref">ti->cdti_trk1 1 73cgc.data_direction = DMA_FROM_NONa=  1 74 1 75result = sr_do_ioctl(cd, &cgc);
 1 76        unsigresult = IOCTLMDRIVE_CANT_DcomHIa
 1 77result = sr_fake_playtrkind(strucef="+code=cdi" class="sref">cdi,
ti-> href="drivers/scsi/sr_ioctl.c#L93" i1d="L68" c1lass="line" name="L78"> 1 78 1 79        if (!n result;
 1 80     href="drivers/scsi/sr_ioctl.c#L108" id="L81" c1lass="line" name="L81"> 1 81
 1 82   ar/* We do our own!n 
 1 83   CDROMerror resu is.  NllystatuUNIT_ATTENTION resu will automint >llyn>
 1 84      class="comment">   CDROMclear af/
 1 85 1 86     a href="+code=sr_fake_ctl" class="sref">sr_do_ioctl(sr_doSdcd = packet_command cgc);
 1 87     href="drivers/scsi/sr_ioctl.c#L117" id="L88" c1lass="line" name="L88"> 1 88deviccdsr_doSDev
 1 89sr_readsr_reasa>;
 1 90result;
resulerr= result 1 91resultresulsensecgc);
resulsense 1 92 1 93sr_doSDev
cd = device->href="drivers/scsi/sr_ioctl.c#L119" id="L74" c1lass="line" name="L94"> 1 94 1 95        resulsense 1 96        resulsensekmalloc(32, DMA_FSCSI_SENSE_BUFFERSIZa
GFP_KERNEL |  1 97resulsense 1 98                resulerr= ENOMEM;
 1 99                timeoa> = 2100                2101        } elseref="drivers/scsi/sr_ioctl.c#L108" 2d2"L101" 2lass="line" name="L92"> 21022103           ef="+code=ret" clarass="sref">sr_reclara    :ref="drivers/scsi/sr_ioctl.c#L133" 2d4"L103" 2lass="line" name="L94"> 2104(k_when_processing_errorsss="sref">resulsd(k_when_processing_errors32, sr_doSDev
2105        resulerr= ENOMEM 2106timeoa> =  2107 2108
2109memset(&ef="+code=buffesensess="sref">resulsenseresulsense2110result = minut_dsr_doSDev
cgc);
cmd[8] =h ef="+code=tocenclass="sref">cgc);
data_direction = 2111cgc);
buffer);
cgc);
buflen = 12, (*resulsense2112cgc);
timeout = IOCTL_RETRIES 3
GFP_KNULa| 21132114l(stasensess="sref">resul_dl(stasense32, <(*resulsenseresulsensesr_reasa>;
21152116   ar/* Minia>lMerror rhecking.  Ign , and reportstatut
2117minutrs/scs_byla32, result = 2118sr_reasa>;
sr_rea"nse_kea2119sr_reUNIT_ATTENTION    :ref="drivers/scsi/sr_ioctl.c#L133" 2d="L120" 2lass="line" name="L120">2120sr_doSDev
cmd2121cgc);
memsequila;
2122cdte_printa32, cdte_L"%s: disc ahange detn
cd = cdi,
framena> = 2123        if (<   result2124                returrrrrrrrrrrrrrrrrgoto ef="+code=ENOMEclarass="sref">sr_reclara    href="drivers/scsi/sr_ioctl.c#L93" i2d="L105" 2lass="line" name="L125">2125resulerr= ENOMEMDIUa    href="drivers/scsi/sr_ioctl.c#L93" i2d="L116" 2lass="line" name="L126">21262127GFP_KNOT_TOC_Y    :reclass="comment">   ar/* This happ"ns 
2128sr_reasa>;
cgc2129                sr_reasa>;
cgc2130   ar/* a"nse: Logt >l unit is ineprocessengtbent" SCStocey pan>
2131                cgc);
memsequila;
2132cdte_printa32, cdte_L"%s: _MSF< notStocey yet.\n"n>
cd = cdi,
framena> = 2133result2134   ar/* aleep 2 a"c and ara againepan>
2135sr_reasleep32, <2 href="drivers/scsi/sr_ioctl.c#L93" i2d="L116" 2lass="line" name="L136">2136sr_reclara    href="drivers/scsi/sr_ioctl.c#L93" i2d="L137" 2lass="line" name="L137">21372138   ar/* 20 a"csemulatnough?epan>
2 39resulerr= ENOMEMDIUa    href="drivers/scsi/sr_ioctl.c#L93" i2d="L40" c2lass="line" name="L40"> 2 40 2 41 2 42 2 43cgc);
memsequila;
 2134cdte_printa32, cdte_L"%s: _MSF< notStocey.  Make suulatatru is a disc inetaturs/sc.\n"n>
cd = cdi,
framena> =  2 45frameREBUG 2 46sr_read"sr"n>
sr_reasa>;
 2 47 2 48resulerr= ENOMEMDIUa    href="drivers/scsi/sr_ioctl.c#L93" i2d="L119" 2lass="line" name="L49"> 2 49 2 50IOCTL_LLEGARIESQUESa    :ref="drivers/scsi/sr_ioctl.c#L133" 2d="L51" c2lass="line" name="L51"> 2 51resulerr= cdte_MIO    href="drivers/scsi/sr_ioctl.c#L93" i2d="L52" c2lass="line" name="L52"> 2 52sr_reasa>;
cgc 2 53sr_reasa>;
cgc 2 54   ar/* a"nse: Invalidands for opera/a>  resu pan>
 2 55resulerr= IOCTLMDRIVE_CANT_DcomHIa
 2 56     #ifdefref="+code=DMA_FREBUGss="sref">frameREBUG 2 57packe__adcgc);
cmd[8] = href="drivers/scsi/sr_ioctl.c#L93" i2d="L58" c2lass="line" name="L58"> 2 58sr_read"sr"n>
sr_reasa>;
 2 59 2 60 2 61 2 62cdte_printa32, cdte_L"%s: _MSF< (.c#L1)Merror,ands for: "n>
cd = cdi,
framena> =  2 63packe__adcgc);
cmd[8] = href="drivers/scsi/sr_ioctl.c#L93" i2d="L64" c2lass="line" name="L64"> 2 64sr_read"sr"n>
sr_reasa>;
 2 65resulerr= cdte_MIO    href="drivers/scsi/sr_ioctl.c#L93" i2d="L66" c2lass="line" name="L66"> 2 66 2 67 2 68 2 69   ar/* Wake up aeprocessewaia SCShem e via tpan>
 2 70timeoa> =  2 71cgc);
resulsense 2 72resulkfree32, resulsense 2 73cgc.cdte_stla= resulerr=  2 74resulerr=  2 75 2 76     ref="drivers/scsi/sr_ioctl.c#L108" 2d="L67" c2lass="line" name="L77"> 2 77   ar/* ----------------------------------------------------------------------tpan>
 2 78   ar/* interfaa tto _ti
 2 79     ref="drivers/scsi/sr_ioctl.c#L114" 2d="L80" c2lass="line" name="L80"> 2 80     a href="+code=sr_fake_tray_movess="sref">resulse_tray_move32, cdrom_device_info *cdi,
resulpos 2 81 2 82sr_doSdcd = cdi->handle;
 2 83packet_command cgc;
 2 84 2 85memset(&cgc, 0, sizeof(struct packet_command));
 2 86cgc.cmd[6] = cmd 2 87cgc.cmd[8] = 4a hrresulpos   ar/* clos tpan>
   ar/* eje hrpan>
 2 88cgc.data_direction = DMA_FROM_NONa=  2 89cgc.timeout = IOCTL_TIMEOUT;
 2 90sr_do_ioctl(cd = cgc);
 2 91 2 92 2 93(k_dooass="sref">sr_reae_a>(k_dooa32, cdrom_device_info *cdi,
cdi(k 2 94 2 95sr_doSdcd = cdi->handle;
 2 96 2 97sr_do_ccd = device->h ef="+code=tocena>(kss="sref">cdi(k 2 98                IOCTLSCSI_REMOVAL_PREVENa     :hef="+code=trk1_SCSI_REMOVAL_ALLOWss="sref">IOCTLSCSI_REMOVAL_ALLOW;
 2 99     eref="drivers/scsi/sr_ioctl.c#L108" 3d="L100" 3lass="line" name="L100">31003101     a href="+code=sr_fake_cs/sc_stlausss="sref">resulse_cs/sc_stlaus32, cdrom_device_info *cdi,
cdte_sloa 31023103scsi_cd *cd = cdi->handle;
 3104sr_readsr_reasa>;
3105        cgccmd 3106 3107IOCTLCDSL_CURRENa     !href="+code=sr_do_loass="sref">cdte_sloa 3108   ar/* we have no ahanger supportspan>
3109cdte_MINVAL= 31103111sr_readcd = device->h ef="+code=tocenSROUT" class="sref">IOCTLSROUT" cla>h ef="+code=tocenMAXIES" class="sref">IOCTLMAXIES" cla= sr_reasa>;
3112IOCTLCDS_DISC_OK= 31133114   ar/* SK/ASC/ASCQengt2/4/1 means "unit is bent" SCStocey"span>
3115sr_readsr_reasa>;
sr_reasa>;
sr_rea"nse_keaGFP_KNOT_TOC_Y    ref="drivers/scsi/sr_ioctl.c#L114" 3d6"L105" 3lass="line" name="L116">3116sr_reasa>;
cgcsr_reasa>;
cgc3117GFP_KCDS_DRIVE_NOT_TOC_Y= 31183119cdrom_devicget_media_ev   cdi,
cmd3120cmdcdromcedia_pres   3121IOCTLCDS_DISC_OK= 3122cmdbufledooa_opla3123        if (<   sr_reCDS_TRAY_OPEN= 3124                retur3125sr_reCDS_NO_DISC= 312631273128   ar/*n>
3129      class="comment">   CDROMMMMMMM* SK/ASC/ASCQengt2/4/2 means "initi>l(sa/a>  t
3130   CDROMMMMMMM* Using CD_TRAY_OPEN t s ineassSTART_STOP_UNITtto _los n>
3131      class="comment">   CDROMMMMMMM* tatutray, which tl(sa/a>  t   .n>
3132   arROMMMMMMM*an>
3133sr_readsr_reasa>;
sr_reasa>;
sr_rea"nse_keaGFP_KNOT_TOC_Y    ref="drivers/scsi/sr_ioctl.c#L114" 3d="L114" 3lass="line" name="L134">3134sr_reasa>;
cgcsr_reasa>;
cgc3135sr_reCDS_TRAY_OPEN= 31363137   ar/*n>
3138   arROMMMMMMM*  ? 1;isShemmat ineprogresse.. butatatru must be a disc pres   !n>
3 39   CDROMMMMMMM*an>
 3 40sr_reasa>;
sr_rea"nse_keaGFP_KNOT_TOC_Y    rsr_reasa>;
cgc 3 41IOCTLCDS_DISC_OK=  3 42 3 43   ar/*n>
 3134   CDROMMMMMMM* If notSusing Mt Fuji extended cediautray reports,n>
 3 45   CDROMMMMMMM* just n -
 3 46   CDROMMMMMMM* any otatr way to detn
 3 47   arROMMMMMMM*an>
 3 48sr_readsr_reasa>;
 3 49   ar/* 0x3a;isSmedium notSpres   M*an>
 3 50sr_reasa>;
cgc 3 51sr_reCDS_NO_DISC=  3 52 3 53sr_reCDS_TRAY_OPEN=  3 54 3 55GFP_KCDS_DRIVE_NOT_TOC_Y=  3 56     eref="drivers/scsi/sr_ioctl.c#L108" 3d="L57" c3lass="line" name="L57"> 3 57 3 58resulse_cisk_stlaus32, cdrom_device_info *cdi,
 3 59 3 60sr_doSdcd = cdi->handle;
 3 61sr_re_devictocclasr_retoc_h
 3 62sr_re_devictoc   rahandltoc_a
 3 63cdicgcresulhave_diretracks=  3 64 3 65   ar/* lookShem eire tracksM*an>
 3 66cgcsr_re_r_tocectocclacdi,
sr_retoc_h
 3 67cgc 3 68cgcENOMEMDIUa    ) ?)ef="+code=ret" CDS_NO_DISCss="sref">sr_reCDS_NO_DISC= cdte_CDS_NO_INFO
 3 69 3 70cdisr_retoc_h
cdith_trk0
cdisr_retoc_h
cdith_trk1
cdi 3 71handltoc_a
cdite_track> href="+code=sr_doass="sref">cdi 3 72handltoc_a
cdite_hemmat> href="+code=sr_do_MSF<_LBAss="sref">cdte_CDSF<_LBA>href="drivers/scsi/sr_ioctl.c#L74" i3d="L133" 3lass="line" name="L73"> 3 73sr_recr_tocectoc   racdi,
handltoc_a
 3 74cdte_CDS_NO_INFO
 3 75handltoc_a
sr_docdte_ctra    rIOCTLCDSF<_DATA_TRACK    ) href="drivers/scsi/sr_ioctl.c#L98" i3d="L66" c3lass="line" name="L76"> 3 76resulhave_diretracks=  3 77 3 78 3 79 3 80resulhave_diretracks=  3 81cdte_CDS_AUDIO
 3 82 3 83cd = cd 3 84cdi 3 85 3 86cdi 3 87 3 88 3 89data_ke_get_"litasesscla32, cdrom_device_info *cdi,
 3 90data__devicmultisesscla*cdromms" cla=  3 91 3 92sr_doSdcd = cdi->handle;
 3 93 3 94cdromms" cla= sr_readla
sr_relba= cd = memsets"offcla
 3 95cdromms" cla= cdcd = cdcd = memsets"offcla
 3 96 3 97 3 98     eref="drivers/scsi/sr_ioctl.c#L108" 3d="L79" c3lass="line" name="L99"> 3 994100data_ke_get_mca32, cdrom_device_info *cdi,
data__devicmca*data_mca*4101 4102sr_doSdcd = cdi->handle;
4103packet_command cgc;
 4104sr_rebuffea= cgccdte_GFP_Lcdte_SROGFP_DMAcd = 4105        cgc 
 4106 4107sr_rebuffea=  4108ass="sref">ENOMEMa    href="drivers/scsi/sr_ioctl.c#L93" i4d="L109" 4lass="line" name="L109">41094110memset(&cgc, 0, sizeof(struct packet_command));
4111cgc, 0, ref="+code=cmd" class="sref">cmd[6] = cdte_GREAD_TOC__SUBCHANaEL    href="drivers/scsi/sr_ioctl.c#L93" i4d2"L101" 4lass="line" name="L112">4112cgc, 0, ref="+code=cmd" class="sref">cmd[6] = 2a hr0x40;    ar/* I do wantatat subahannel /a> M*an>
4113cgc.cmd[6] = 3a hr0x02;    ar/* G/sc meSmedium catalog number /a> M*an>
4114cgc.cmd[6] = 8a hr24href="drivers/scsi/sr_ioctl.c#L93" i4d="L105" 4lass="line" name="L115">4115cgc.sr_rebuffea= sr_rebuffea= 4116cgc.buflebuflla= 4117cgc.data_direction = data_ROM_FSF<_DEVICE= 4118cgc.timeout = IOCTL_TIMEOUT;
4119 ss="sref">cgc 
sr_do_ioctl(cd = cgc);
41204121sr_retdata_mca*sr_retsr_rebuffea= 4122data_mca*sr_ret41234124resulkfree32, sr_rebuffea= 4125 ss="sref">cgc 
412641274128cdte_se_res a32, cdrom_device_info *cdi,
41294130413141324133cmdcdrom_device_info *cdi,
cmd41344135sr_doSdcd = cdi->handle;
4136packet_command cgc;
41374138cmd4 39cmd   ar/* s a to maxM*an>
 4 40 4 41cmd   ar/* Nx to kbyte/sM*an>
 4 42 4 43memset(&cgc, 0, sizeof(struct packet_command));
 4134cgc.cmd[6] = sr_do_READ_SET_SPEED
   ar/* SET CD SPEEDM*an>
 4 45cgc.cmd[6] = 2a hrhef="+code=packecpeeass="sref">cmd   ar/* MSBrhem kpeea (in kbytei/sec)M*an>
 4 46cgc.cmd[6] = 3a href="+code=GPCMDcpeeass="sref">cmd   ar/* LSBr*an>
 4 47cgc.data_direction = DMA_FROM_NONa=  4 48cgc.timeout = IOCTL_TIMEOUT;
 4 49 4 50sr_do_ioctl(cd = cgc);
 4 51cdte_EIO
 4 52 4 53 4 54 4 55   CD/* -----------------------------------------------------------------------tpan>
 4 56   CD/*atais;isScallea byatat generic _ti
 4 57   ar/*abecauseatat generic _ti
 4 58   ar/*aonly _ti) _ti
 4 59   CD/* se_cisk_stlaus interfacerhem tat generic _ti
 4 60 4 61sr_do_ioauditl" cla32, cdrom_device_info *cdi,
cmd[6] =, voidhref="+code=cdi" argss="sref">cmd 4 62 4 63cmd[6] =) href="drivers/scsi/sr_ioctl.c#L98" i4d="L64" c4lass="line" name="L64"> 4 64cmd 4 65sr_re_r_tocectocclacdi,
cmd 4 66GFP_KCDSF 4 67sr_recr_tocectoc   racdi,
cmd 4 68sr_doCDSF 4 69packecr_play_trkilacdi,
cmd 4 70 4 71cdte_MINVAL=  4 72 4 73 4 74 4 75   CD/* -----------------------------------------------------------------------n>
 4 76   CDR*Sa fun  to toce all sortsengtfunny _ti 4 77   arR* sr_i-3 mmc _d));
 4 78   arR*n>
 4 79   CDR* lba:      namar ba>(k adlaessn>
 4 80   CDR*Shemmat:  0 = eire (anytaing)n>
 4 81   CDR*     
 4 82   arR*     
 4 83   arR*     
 4 84   CDR*     
 4 85   CDR*     
 4 86   CDR*Sblkf(st: 2048 | 2336 | 2340 | 235   
 4 87   arR*an>
 4 88 4 89cdsr_doSdcd = timeodesa
sr_relba= cdicdi 4 90 4 91packet_command cgc;
 4 92 4 93DMA_FREBUG 4 94cdi"%s: kr_tocecla lba=%dShemmat=%dSblkf(st=%d\n"n>
 4 95cd = cdi,
cdisr_relba= cdicdi 4 96 4 97 4 98memset(&cgc, 0, sizeof(struct packet_command));
 4 99cgc, 0, ref="+code=cmd" class="sref">cmd[6] = sr_do_READ_TOC__CD
   ar/* TOC__CDR*an>
5100cgc, 0, ref="+code=cmd" class="sref">cmd[6] = 1a hrhref="+code=cd" chemmatss="sref">cdi5101cgc, 0, ref="+code=cmd" class="sref">cmd[6] = 2a hrhunsignea char) hef="+code=packelbass="sref">sr_relba=  5102cgc.cmd[6] = 3a hrhunsignea char) hef="+code=packelbass="sref">sr_relba=  5103cgc.cmd[6] = 4a hrhunsignea char) hef="+code=packelbass="sref">sr_relba=  5104cgc.cmd[6] = 5a hrhunsignea char) ef="+code=packelbass="sref">sr_relba=  5105cgc.cmd[6] = 8a hr href="drivers/scsi/sr_ioctl.c#L127" 5d6"L105" 5lass="line" name="L96"> 5106cdi 5107 5108cgc.cmd[6] = 9a hr0x58href="drivers/scsi/sr_ioctl.c#L127" 5d9"L105" 5lass="line" name="L99"> 510951105111cgc.cmd[6] = 9a hr0x78href="drivers/scsi/sr_ioctl.c#L127" 5d2"L101" 5lass="line" name="L112">511251135114cgc.cmd[6] = 9a hr0xf8href="drivers/scsi/sr_ioctl.c#L127" 5d5"L101" 5lass="line" name="L115">511551165117cgc.cmd[6] = 9a hr0x10href="drivers/scsi/sr_ioctl.c#L93" i5d8"L105" 5lass="line" name="L118">511851195120cgc, 0, ref="+code=cmd" buffeass="sref">sr_rebuffea= timeodesa
5121cgc.buflebuflla= cdi5122cgc.data_direction = data_ROM_FSF<_DEVICE= 5123cgc.timeout = IOCTL_TIMEOUT;
5124sr_do_ioctl(cd = cgc);
512551265127   ar/*n>
5128   arR* toce sectorsSwithaba>(kf(sts otatr thass2048n>
5129   CDR*an>
51305131cdsr_doSdcd = sr_relba= cditimeodesa
51325133packet_command cgc;
5134cgc51355136   ar/* we  ra tat TOC_ CD nd  first...R*an>
5137cd = data_tocecd_knowa32, a href="drivers/scsi/sr_ioctl.c#L98" i5d="L128" 5lass="line" name="L138">5138cgccdcd = timeodesa
sr_relba= cdi5 39cdicgc 5 40cgc 5 41cd = data_tocecd_knowa32,  hr0href="drivers/scsi/sr_ioctl.c#L93" i5d="L42" c5lass="line" name="L42"> 5 42cdi"CDSF< does' hrsupport TOC_ CD (0xbe) nd \n"n>
 5 43   ar/* fall aa hr n -ra tat otatr wayR*an>
 5134 5 45   ar/* ...Ra htais;fails, we twitch tat ba>(kf(stSusing MODE SELECTR*an>
 5 46cdicd = timeodeinfo= cdi 5 47cgcsr_reke_set_ba>(klengthcd = cdi 5 48cgc 5 49 5 50DMA_FREBUG 5 51cdi"%s: kr_tocecsector lba=%dSblkf(st=%d\n"n>
cd = cdi,
cdisr_relba= cdi 5 52 5 53 5 54memset(&cgc, 0, sizeof(struct packet_command));
 5 55cgc.cmd[6] = sr_do_READ_TOC__1     href="drivers/scsi/sr_ioctl.c#L83" i5d6"L105" 5lass="line" name="L56"> 5 56cgc.cmd[6] = 2a hrhunsignea char) hef="+code=packelbass="sref">sr_relba=  5 57cgc.cmd[6] = 3a hrhunsignea char) hef="+code=packelbass="sref">sr_relba=  5 58cgc.cmd[6] = 4a hrhunsignea char) hef="+code=packelbass="sref">sr_relba=  5 59cgc, 0, ref="+code=cmd" class="sref">cmd[6] = 5a hrhunsignea char) ef="+code=packelbass="sref">sr_relba=  5 60cgc, 0, ref="+code=cmd" class="sref">cmd[6] = 8a hr href="drivers/scsi/sr_ioctl.c#L127" 5d="L61" c5lass="line" name="L61"> 5 61cgc.sr_rebuffea= timeodesa
 5 62cgc.buflebuflla= cdi 5 63cgc.data_direction = data_ROM_FSF<_DEVICE=  5 64cgc.timeout = IOCTL_TIMEOUT;
 5 65cgcsr_do_ioctl(cd = cgc);
 5 66 5 67cgc 5 68 5 69 5 70   CD/*n>
 5 71   CDR* toce a sector in raw mNOM to checkatat sector hemmat&g
 5 72   arR* n -:r1 == mNOM2 (XA), 0 == mNOM1,< 0 == error &g
 5 73   arR*an>
 5 74 5 75sr_rekr_is_xasr_doSdcd =  5 76 5 77cd 5 78sr_reis_xa 5 79 5 80timeoxa_tesa=  5 81 5 82 5 83cdcgccdte_GFP_Lcdte_SROGFP_DMAcd =  5 84cd 5 85ass="sref">ENOMEMa    href="drivers/scsi/sr_ioctl.c#L93" i5d="L66" c5lass="line" name="L86"> 5 86cdcd = cd = memsets_offcla     + 16,ref="drivers/scsi/sr_ioctl.c#L109" 5d="L57" c5lass="line" name="L87"> 5 87memseCD_FSAMESIZE_RAW1= cd 5 88sr_reis_xacd 5 89 5 90   ar/* toce a raw sector hailea hem kome tocson.R*an>
 5 91sr_reis_xa 5 92 5 93resulkfree32, cd 5 94DMA_FREBUG 5 95cdi"%s: kr_is_xa: %d\n"n>
cd = cdi,
cdisr_reis_xa 5 96 5 97sr_reis_xa 5 98 5 99


Tat original LXR koftware byatat ef="drivehttp://sourcehemge.net/projects/lxr">LXR nt">unity al scsia> byaef="drivemailto:lxr@ naux.no">lxr@ naux.no lxr. naux.no kilaly hostea byaef="drivehttp://www.redpill- napro.no">Redpill Lnapro AS ing a> opera/a> s serinfos since 1995.