linux/drivers/scsi/ch.c
<<
>>
Prefs
   1/*
   2 * SCSI Media Changer device driver for Linux 2.6
   3 *
   4 *     (c) 1996-2003 Gerd Knorr <kraxel@bytesex.org>
   5 *
   6 */
   7
   8#define VERSION "0.25"
   9
  10#include <linux/module.h>
  11#include <linux/init.h>
  12#include <linux/fs.h>
  13#include <linux/kernel.h>
  14#include <linux/mm.h>
  15#include <linux/major.h>
  16#include <linux/string.h>
  17#include <linux/errno.h>
  18#include <linux/interrupt.h>
  19#include <linux/blkdev.h>
  20#include <linux/completion.h>
  21#include <linux/compat.h>
  22#include <linux/chio.h>                 /* here are all the ioctls */
  23#include <linux/mutex.h>
  24#include <linux/idr.h>
  25#include <linux/slab.h>
  26
  27#include <scsi/scsi.h>
  28#include <scsi/scsi_cmnd.h>
  29#include <scsi/scsi_driver.h>
  30#include <scsi/scsi_ioctl.h>
  31#include <scsi/scsi_host.h>
  32#include <scsi/scsi_device.h>
  33#include <scsi/scsi_eh.h>
  34#include <scsi/scsi_dbg.h>
  35
  36#define CH_DT_MAX       16
  37#define CH_TYPES        8
  38#define CH_MAX_DEVS     128
  39
  40MODULE_DESCRIPTION("device driver for scsi media changer devices");
  41MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org>");
  42MODULE_LICENSE("GPL");
  43MODULE_ALIAS_CHARDEV_MAJOR(SCSI_CHANGER_MAJOR);
  44MODULE_ALIAS_SCSI_DEVICE(TYPE_MEDIUM_CHANGER);
  45
  46static DEFINE_MUTEX(ch_mutex);
  47static int init = 1;
  48module_param(init, int, 0444);
  49MODULE_PARM_DESC(init, \
  50    "initialize element status on driver load (default: on)");
  51
  52static int timeout_move = 300;
  53module_param(timeout_move, int, 0644);
  54MODULE_PARM_DESC(timeout_move,"timeout for move commands "
  55                 "(default: 300 seconds)");
  56
  57static int timeout_init = 3600;
  58module_param(timeout_init, int, 0644);
  59MODULE_PARM_DESC(timeout_init,"timeout for INITIALIZE ELEMENT STATUS "
  60                 "(default: 3600 seconds)");
  61
  62static int verbose = 1;
  63module_param(verbose, int, 0644);
  64MODULE_PARM_DESC(verbose,"be verbose (default: on)");
  65
  66static int debug = 0;
  67module_param(debug, int, 0644);
  68MODULE_PARM_DESC(debug,"enable/disable debug messages, also prints more "
  69                 "detailed sense codes on scsi errors (default: off)");
  70
  71static int dt_id[CH_DT_MAX] = { [ 0 ... (CH_DT_MAX-1) ] = -1 };
  72static int dt_lun[CH_DT_MAX];
  73module_param_array(dt_id,  int, NULL, 0444);
  74module_param_array(dt_lun, int, NULL, 0444);
  75
  76/* tell the driver about vendor-specific slots */
  77static int vendor_firsts[CH_TYPES-4];
  78static int vendor_counts[CH_TYPES-4];
  79module_param_array(vendor_firsts, int, NULL, 0444);
  80module_param_array(vendor_counts, int, NULL, 0444);
  81
  82static const char * vendor_labels[CH_TYPES-4] = {
  83        "v0", "v1", "v2", "v3"
  84};
  85// module_param_string_array(vendor_labels, NULL, 0444);
  86
  87#define DPRINTK(fmt, arg...)                                            \
  88do {                                                                    \
  89        if (debug)                                                      \
  90                printk(KERN_DEBUG "%s: " fmt, ch->name, ##arg);         \
  91} while (0)
  92#define VPRINTK(level, fmt, arg...)                                     \
  93do {                                                                    \
  94        if (verbose)                                                    \
  95                printk(level "%s: " fmt, ch->name, ##arg);              \
  96} while (0)
  97
  98/* ------------------------------------------------------------------- */
  99
 100#define MAX_RETRIES   1
 101
 102static struct class * ch_sysfs_class;
 103
 104typedef struct {
 105        struct list_head    list;
 106        int                 minor;
 107        char                name[8];
 108        struct scsi_device  *device;
 109        struct scsi_device  **dt;        /* ptrs to data transfer elements */
 110        u_int               firsts[CH_TYPES];
 111        u_int               counts[CH_TYPES];
 112        u_int               unit_attention;
 113        u_int               voltags;
 114        struct mutex        lock;
 115} scsi_changer;
 116
 117static DEFINE_IDR(ch_index_idr);
 118static DEFINE_SPINLOCK(ch_index_lock);
 119
 120static const struct {
 121        unsigned char  sense;
 122        unsigned char  asc;
 123        unsigned char  ascq;
 124        int            errno;
 125} ch_err[] = {
 126/* Just filled in what looks right. Hav'nt checked any standard paper for
 127   these errno assignments, so they may be wrong... */
 128        {
 129                .sense  = ILLEGAL_REQUEST,
 130                .asc    = 0x21,
 131                .ascq   = 0x01,
 132                .errno  = EBADSLT, /* Invalid element address */
 133        },{
 134                .sense  = ILLEGAL_REQUEST,
 135                .asc    = 0x28,
 136                .ascq   = 0x01,
 137                .errno  = EBADE,   /* Import or export element accessed */
 138        },{
 139                .sense  = ILLEGAL_REQUEST,
 140                .asc    = 0x3B,
 141                .ascq   = 0x0D,
 142                .errno  = EXFULL,  /* Medium destination element full */
 143        },{
 144                .sense  = ILLEGAL_REQUEST,
 145                .asc    = 0x3B,
 146                .ascq   = 0x0E,
 147                .errno  = EBADE,   /* Medium source element empty */
 148        },{
 149                .sense  = ILLEGAL_REQUEST,
 150                .asc    = 0x20,
 151                .ascq   = 0x00,
 152                .errno  = EBADRQC, /* Invalid command operation code */
 153        },{
 154                /* end of list */
 155        }
 156};
 157
 158/* ------------------------------------------------------------------- */
 159
 160static int ch_find_errno(struct scsi_sense_hdr *sshdr)
 161{
 162        int i,errno = 0;
 163
 164        /* Check to see if additional sense information is available */
 165        if (scsi_sense_valid(sshdr) &&
 166            sshdr->asc != 0) {
 167                for (i = 0; ch_err[i].errno != 0; i++) {
 168                        if (ch_err[i].sense == sshdr->sense_key &&
 169                            ch_err[i].asc   == sshdr->asc &&
 170                            ch_err[i].ascq  == sshdr->ascq) {
 171                                errno = -ch_err[i].errno;
 172                                break;
 173                        }
 174                }
 175        }
 176        if (errno == 0)
 177                errno = -EIO;
 178        return errno;
 179}
 180
 181static int
 182ch_do_scsi(scsi_changer *ch, unsigned char *cmd,
 183           void *buffer, unsigned buflength,
 184           enum dma_data_direction direction)
 185{
 186        int errno, retries = 0, timeout, result;
 187        struct scsi_sense_hdr sshdr;
 188
 189        timeout = (cmd[0] == INITIALIZE_ELEMENT_STATUS)
 190                ? timeout_init : timeout_move;
 191
 192 retry:
 193        errno = 0;
 194        if (debug) {
 195                DPRINTK("command: ");
 196                __scsi_print_command(cmd);
 197        }
 198
 199        result = scsi_execute_req(ch->device, cmd, direction, buffer,
 200                                  buflength, &sshdr, timeout * HZ,
 201                                  MAX_RETRIES, NULL);
 202
 203        DPRINTK("result: 0x%x\n",result);
 204        if (driver_byte(result) & DRIVER_SENSE) {
 205                if (debug)
 206                        scsi_print_sense_hdr(ch->name, &sshdr);
 207                errno = ch_find_errno(&sshdr);
 208
 209                switch(sshdr.sense_key) {
 210                case UNIT_ATTENTION:
 211                        ch->unit_attention = 1;
 212                        if (retries++ < 3)
 213                                goto retry;
 214                        break;
 215                }
 216        }
 217        return errno;
 218}
 219
 220/* ------------------------------------------------------------------------ */
 221
 222static int
 223ch_elem_to_typecode(scsi_changer *ch, u_int elem)
 224{
 225        int i;
 226
 227        for (i = 0; i < CH_TYPES; i++) {
 228                if (elem >= ch->firsts[i]  &&
 229                    elem <  ch->firsts[i] +
 230                    ch->counts[i])
 231                        return i+1;
 232        }
 233        return 0;
 234}
 235
 236static int
 237ch_read_element_status(scsi_changer *ch, u_int elem, char *data)
 238{
 239        u_char  cmd[12];
 240        u_char  *buffer;
 241        int     result;
 242
 243        buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
 244        if(!buffer)
 245                return -ENOMEM;
 246
 247 retry:
 248        memset(cmd,0,sizeof(cmd));
 249        cmd[0] = READ_ELEMENT_STATUS;
 250        cmd[1] = (ch->device->lun << 5) |
 251                (ch->voltags ? 0x10 : 0) |
 252                ch_elem_to_typecode(ch,elem);
 253        cmd[2] = (elem >> 8) & 0xff;
 254        cmd[3] = elem        & 0xff;
 255        cmd[5] = 1;
 256        cmd[9] = 255;
 257        if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256, DMA_FROM_DEVICE))) {
 258                if (((buffer[16] << 8) | buffer[17]) != elem) {
 259                        DPRINTK("asked for element 0x%02x, got 0x%02xc#L25e243        sshdr);
(sshdr 116ref="drivers/scsi/ch.c#L152" id="L1521i8 class="line" name="L238"> 238{
buffer[16] << 8) |3drivers/scsi/ch.c#L140" i1ta)
EXFULL,L254" id="L254" class="lin6UEST" class="sref">ILLEGAL_REQUESTnt"L257" class="lin8="L165"> 165        if ( 161{
errno = -errno = 0;
 163
ILLEGAL_REQUESTnt"ef="+code=elem" class="sref_elem_to_typecodL257" class="lin8="L165"> 165        if (elem
2shdr) &&
 251                ([17]) != asc != 0) {
 251                (193        i++) {
  92#define "a>        if ( &&
 213                                goto asc &&
ascq) {
 259                        DPRIx failedref">DPRINTK(ch,errno;
ILLEGAL_REQUESTnt"L257" class="lin8="L165"> 165        if ( 241        int      1742/a>                }
25"> 175        }
errno == 0)
EIO;
ch_read_element_status(errno;
 179}
(u_char  * 180
 24.c#L256" id="L256" class="line" name="L256ref">u_char   181static int
cmd,
  92#define "a>        if (buflength,
 248        memset(cmd,0,sizeof(direction)
 249        < href="+code=cmd" class="sref">cmd[0] == 2ame="L185"> 185{
 249        < href="+code=cmd" class="sref">cmd[1] = (ch->device>cmd,0,sizeof(result;
(result = ch_do_scsi(ch, bufferNON 65        if (sshdr;
  92#define DPRINTK        if ( 188
(u_char  *timeout_move;
 191
retry:
 20" i7ch_read_element_status(errno = 0;
debug) {
 239        devicef="+code=elem" class="srefid=">u_char  *2and: ");
 240        u_char  *cmd);
 241  >( 165( 165u_char  * 197        }
 11(u_char  * 198
buffer,
 243        buffer = kmalloc(512, GFP_KERNEL | HZ,
 244        if(!NULL);
 245                return - 202
result);
 248        memset(cmd,0,sizeof(DRIVER_SENSE) {
 249        MODEresult          return -nd: ");
 249        < href="+code=cmd" class="sref">cmd[1] = (ch->device>cmd,0,sizeof(sshdr);
 20x1d>cmd,0,sizeof( 197        }
 256         208
 199        result = ch_do_scsi(ch, , buffer, 256,         sense_key) {
driv/scsi/ch.c#L224" id="L224" cla3ass="sref3>UNIT_ATTENTION:
|= (1ef">devi3r/a>         = 1;
 1999        result = ch_do_scsi(ch, , buffer, 256,         ++ < 3)
retry;
driv/scsi/ch.c#L224" id="L224" cla3ass="sref3              break;
        < href="+code=cmd" class="sref">cmd[1] =  ch-> scsi/ch.c#L224" id="L224" cla3a6s="sref3/a>                }
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+ ="L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+ 7">u_char  * 216        }
 230                    ch-> scsi/ch.c#L224" id="L224" cla3a8dr" cla3ss="sref">errno;
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+ 8"L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+ 9">u_char  * 218}
        < href="+code=cmd" class="sref">cmd[1] =  ch-> scsi/ch.c#L224" id="L224" cla3ss="line"3name="L219"> 219
sshdr);
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+10"L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+11">u_char  * 230                    ch-> scsi/ch.c#L224" id="L224" cla3sNULL" cl3name="L221"> 221
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+12"L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+13">u_char  * 222static int
        < href="+code=cmd" class="sref">cmd[1] =  ch->buCHET_I "sre"> scsi/ch.c#L224" id="L224" cla3setry" cl3ass="sref">elem)
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+14"L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+15">u_char  * 224{
        < href="+code=cmd" class="sref">cmd[1] =  ch->buCHET_I "sre"> scsi/ch.c#L224" id="L224" cla3s6s="sref3 class="sref">i;
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+d="L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+d7">u_char  * 226
 230                    ch-> scsi/ch.c#L224" id="L224" cla3s8dr" cla3ss="sref">i++) {
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+d8"L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+19">u_char  *i]  &&
        < href="+code=cmd" class="sref">cmd[1] =  ch-> scsi/ch.c#L224" id="L224" cla3+code=i" 3lass="sref">i] +
sshdr 116ref="drivers/scsi/ch.c#L152" i>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+20"L1521i8 class="line" name="L238"> 238{
buffer[1>sshdr 116ref="drivers/scsi/ch.c#L152" i3]+21">u_char  *i])
sshdr 116  92#define "asked for element 0x%02x,3+code=i" 3lass="sref">i+1;
cmd[1] =  ch-> 232        }
        < href="+code=cmd" class="sref">cmd[1] =  ch->         2333/a>        return 0;
  92#define "asked for element 0x%02x,3+ss="sref3ame="L234"> 234}
cmd[1] =  ch-> 235
 230                    ch->         236static int
  92#define "asked for element 0x%02x,3+8dr" cla3ass="sref">data)
cmd[1] =  ch->buCHET_I "sre";asked for element 0x%02x,3+ass="sre3ame="L238"> 238{
cmd[1] =  ch->buCHET_I "sre"r/a>        cmd[12];
  92#define "asked for element 0x%02x,3ffer" cla3s="sref">buffer;
 211                        ch->result;
cmd[1] =  ch->         242
GFP_DMA);
  92#define DPRINTK        if (buffer)
ENOMEM;
 246
retry:
 227        for ( < CH_TYPES; cmd));
ch->counts[REA3_ELEMENT_STATUS;

3un << 5) |
ch->counts[ ? 0x10 : 0) |

elem);
        < href="+code=cmd" class="sref">cmd[1] =  ch->ch->        ch->        if (cmd[1] =  ch->ch->        ch->        if (        & 0xff;
          92#define "asked for element 0x%02x,3" class="3ref">cmd[5] = 1;
( 165(ch->(ch->cmd[9] = 255;
ch->        if ())) {
elem) {
       3sshdr)1scsi/ch.c#L220" id="L220look up the class=s of the cs=" trans#L1lass="srs---------------------------------------3L140" i1t3)
cmd[1] = iver_byte" classd9"> 199        bu49        < href="+code=cmd" class="sref">cmd[1] =  ch->m(cmd[1] = iver_byte" classd9"> 1);asked for element 0x%02x,3href="dri3ame="L161"> 161{
kmallocl>        if (errno = 0;
 163
cmd[1] = iver_byte" classd9"> 1)"sref">CH_TYPES; elem
        ILLEGAL_REQUESTnt"L257" class="lin8="L165"> 165        if (3shdr) &&
 245                return -asc != 0) {
i++) {
 &&
 227        foine" name="L229"> 229        49        < href="+code=cmd" class="sref">cmd[1] =  ch->        foine" name="L229"> 229  ss="sref">CH_TYPES; asc &&
ch-> 165        ascq) {
errno;
 228    ass="sref">i = 0; DT_MAXse" class="srefCH DT_MAXvers/sss="sref"> <-55t; 8) |  165ch-> 228  ]="sref">CH_TYPES;         < me="L165"> 165 165ch-> 228  ]        ch-> 228  ]        elem                }
  92#define DPRIx: [insmod op>-&g] string">"asked for element 0x%02x,3 ="sref">35"> 175        }
         229  s1" class="line" name="L211"> 211                        ch->        if (errno == 0)
 237
EIO;
 25>( 211                        ch->(CH_TYPES; errno;
  92#define DPRIx: dDPRINTKref">CH_TYPES;  179}
sshdr);
( 211                        ch->        if ( 180
[17]) !=  181static int
  92#define DPRIx: f">DPRINTK( 211                        ch->        if (cmd,
[3] 80="sref">CH_TYPES; buflength,
          92#define DPRINTK        if (direction)
        cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]r198) |         if (3ame="L185"> 185{
f="+code=elem" class="srefi="L1/a>[3] 30"="sref">CH_TYPES; result;
  92#define DPRINTK        if (sshdr;
        cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]r198) |         if ( 188
)
sshdr);
( 165cmd[1] = (ch-> 165        if (timeout_move;
( 191
[3] 20="49        < me="L165"> 165u_char  *retry:
[3] 10="49        [37>u_char  *errno = 0;
debug) {
3and: ");
 165CH_TYPES; cmd);
  92#define DPRINTK( 165(
 197        }
cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]r1        if ( 198
 2lemenclass=_lookupf">bu49        < href="+code=cmd" class="sref">cmd[1] = (ch->        if (buffer,
sshdr);
cmd[1] = (ch->        if (timeout_move;
 165(
NULL);
cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]="sref">CH_TYPES;  202
result);
          92#define DPRINTK        if (DRIVER_SENSE) {
          92#define DPRINTK        if (ss="sref">cmd);
        cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]1                endor name="L228"> 2 endor hre>        if ("> 197        }
cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]1               m   lref="+code=cmd"m   l hre>        if (ame="L198"> 198
cmd[1] = iver_byte" classd9"> 1f">ch-> 228  ]1               rev name="L228"> 2revs="sa>        if (sense_key) {
sshdr);
UNIT_ATTENTION:
 = 1;
++ < 3)
cmd[1] = (1955        retry;
cmd[1] =ss="lin6UEST" class="sref">ILLEGAL_REQUESTnt"L257" class="lin8="L165"> 165        if (
                }
         216        }
errno;
 218}
 219
ss-----------------------------4sss="sref4---------- */
 221
-&g">ILLEGAL_REQUESTnt"lemenclass="sref">ch_read_element_status( d,  d,  228  ,h.c#L186" id="L186" roscslin6UEST" class=roscsl65 222static int
elem)
cmd[1] =39" class="line" name="L239"> 239         224{

i;
 259                        DPRINTK(ch, 226
i++) {
cmd[1] =  ch->ch,i]  &&
 248        memset(cmd,0,sizeof(i] +
99<8) | 
i])
> 249        < href="+code=cmd" class="sref">cmd[1] = (ch->device>cmd,0,sizeof(i+1;
> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof( 232        }
> 2"8) |         return 0;
cmd[1] =53" class="line" name="L254">> 2memset( 228   9">ch">chlass1/a>[3] ff>cmd,0,sizeof( 234}
> 2"8) |  228   99999991/a>[3] ff>cmd,0,sizeof( 235
> 249                 236static int
result = ch_do_scsi(ch, bufferNON 65        if (data)
 238{
cmd[12];
buffer;
ILLEGAL_REQUESTnt"lemenclass="sref">ch_read_element_status( d,  d,  d,   ,h.c#L186" id="L186" roscslin6UEST" class=roscsl65result;
 242
 239        ch,GFP_DMA);
ch,buffer)
 259                        chlclass="sref">DPRINTK(  a>        if (ENOMEM;
 246
cmd[1] =  ch->ch,retry:
 248        memset(cmd,0,sizeof(cmd));
99<8) |  245MOVE_MEDIU= hre>        if (REA4_ELEMENT_STATUS;
> 249        < href="+code=cmd" class="sref">cmd[1] = (ch->device>cmd,0,sizeof(4un << 5) |
> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof( ? 0x10 : 0) |
> 2"8) | elem);
> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof(cmd[1] =53" class="line" name="L255">> 2"8) | > 2memset(   9">ch">chlass1/a>[3] ff>cmd,0,sizeof(cmd[5] = 1;
> 2"8) |    99999991/a>[3] ff>cmd,0,sizeof(cmd[9] = 255;
                ))) {
result = ch_do_scsi(ch, bufferNON 65        if (elem) {
ss-----------------------------4L140" i1t4)
 161{
ILLEGAL_REQUESTnt"lemenclass="sref">ch_read_element_status( d,  d, errno = 0;
 d, ,  d,  163
elem
 239        ch,4shdr) &&
asc != 0) {
 259                        chlclass="s =">chlclass="sref">DPRINTK/scsi/ch.c#L246" id="L246" cl4"etry" cl4ss="sref">i++) {
, 
 &&
asc &&
ch->cmd[1] =  ch->ch,ascq) {
 248        memset(cmd,0,sizeof(errno;
99<8) |  245EXCHANGE_MEDIU= hre>        if (> 249        < href="+code=cmd" class="sref">cmd[1] = (ch->device>cmd,0,sizeof(cmd[1] =53" class="line" name="L252">> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof(elem                }
> 2"8) | 45"> 175        }
> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof(errno == 0)
> 2"8) | EIO;
> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof(errno;
> 2"8) | [3] ff>cmd,0,sizeof( 179}
> 2memset(ch">chlass1/a>[3] ff>cmd,0,sizeof( 180
> 2"8) |  181static int
((cmd,0,sizeof(cmd,
buflength,
result = ch_do_scsi(ch, bufferNON 65        if (elemdirection)
4ame="L185"> 185{
result;
sshdr;
( 188
)
sshdr).c#L186" id="L186"  href="+code=counts" >        if (timeout_move;
 191
 227        for ( < CH_TYPES; retry:
errno = 0;
ch->ch"> x7f ||"8) | ch->elemdebug) {
ch->4and: ");
cmd);
ch-> 197        }
ch-> 198
ch->buffer,
sshdr).c#L232" id="L232" class="line5f1er" cla5s">timeout_move;
 191
retry:
result);
ILLEGAL_REQUESTnt"lemenclass="sref">ch_read_element_status( d,  228  ,#L222" id="L222" class="line"5u5t" clas5="sref">debug) {
  ,h.c#L186" id="L186" cleclass="line" nameclecl="srcmd,  23(CH_TYPES; ss="sref">cmd);
 239        ch,"> 197        }
 239( 165ch,ame="L198"> 198
ch,sense_key) {
ss-----------------------------5ass="sref5>UNIT_ATTENTION:
 165        bu512cmd, kmallocl>        if ( = 1;
 165++ < 3)
 245                return -retry;
ch, 259                        chl\code=Dass="s\code=Dref">DPRINTK/scsi/ch.c#L246" id="L246" cl5a6s="sref5/a>                }
DPRINTKDPRINTK/scsi/ch.c#L246" id="L246" cl5a7s="sref56"> 216        }
  L?as          DPRINTKDPRINTK/scsi/ch.c#L246" id="L246" cl5a8s="sref5ss="sref">errno;
 228  ,h 218}
 248        memset(cmd,0,sizeof( 219
99<8) | 
 2memset(cmd[1] = (ch->device) |-----------------------------5sNULL" cl5name="L221"> 221
 =  228  ">cmd,0,sizeof( 222static int
 2memset( 228    >ch">chlass1/a>[3] ff>cmd,0,sizeof(elem)
cmd[1] =55" class="line" name="L253">9<8) |  228   99999991/a>[3] ff>cmd,0,sizeof( 224{
 249        < leclass="line" nameclecl="srcmd,0,sizeof(i;
  L?a0x0d :23x0ca        if ( 226
(  L?a0x0b :23x0a">cmd,0,sizeof(i++) {
i]  &&
= 25e>cmd,0,sizeof(i] +
ss-----------------------------5"+code=i"5class="sref">i])
 165cmd,0,sizeof(i+1;
 165cmd,0,sizeof( 232        }
        return 0;
cmd[1] =resulclass="line" namresulc65 249        < hf="+code=result" class="sref">result = ch_do_scsi(ch 165, bufferTO_DEVIC 65cmd,0,sizeof( 234}
ILLEGAL_REQUESTnt"L257" class="lin8="L165"> 165        if ( 235
ch, 236static int
data)
 238{
 23g"+code=ch_LEGAL_REQUESTnt"lemenclass="sref">ch_read_element_status(49        <__us="sref">ch_read_e__us="s(  a/scsi/ch.c#L208" id="L208" cl5cmd" clas5="sref">cmd[12];
CH_TYPES; buffer;
 23        result;
 23ch, 242
        if (GFP_DMA);
ch,buffer)
[emset(cmd[1] =lockass="line" namelock=ch_a>        if (ENOMEM;
 227        for ((cmd[1] =coun href="+code=ch" coun hultch-> < CH_TYPES;  246
 23readr28ch,retry:
 = ch_do_scsicmd[1] =  ch->, CH_TYPES; cmd));
 245" class="line" Ief="+code=errno" Iets" >        if (REA5_ELEMENT_STATUS;
sshdr);
        if ( << 5) |
 ? 0x10 : 0) |
ch_read_eput_us="=ch_LEGAL_REQUESTnt"df="+code=elem" class="srefi2]"sref">ch_do_scsidesiver_byte" classdesia>  s1" class="line"="+code=CH_TYPES" claa>        if (elem);
[3"L228" class="lCESTATUS_EXCEPnse" class="srefCESTATUS_EXCEPna>  a/scsi/ch.c#L208" id="L208" cl5sA" class5;> 8) & 0xff;
  92#define DPRINTK/scsi/ch.c#L246" id="L246" cl5sss="sref5>        & 0xff;
cmd[1] =  ch->cmd[5] = 1;

cmd[9] = 255;
 28) |  23readr28ch,))) {
ch_do_scsicmd[1] =  ch->,         if (elem) {
       5sshdr);
        if ()
 161{
[emset(cmd[1] =lockass="line" namelock=ch_a>        if (errno = 0;
        if ( 163


5shdr) &&
asc != 0) {
i++) {
 &&
((asc &&
CH_TYPES; ascq) {
ch_read_element_status(cmd[1] =pES
errno;
ch_read_elemenclass=_putult = cmd[1] = (
cmd[1] =fill=result" class=fillscmd[1] =pES        if (                }
        55"> 175        }
errno == 0)
EIO;
errno;
(( 179}
CH_TYPES;  180
ch_read_element_status( 181static int
ch_read_em n "65 28) | ch_read_eim n "65        if (cmd,
buflength,
cmd[1] =mutex_lockass="line" name=utex_lock=ch_L1/a>[emset(        if (direction)
[emset(        if (5ame="L185"> 185{
[emset(ch_do_scsim n "sref">ch_read_em n "65        if (result;
sshdr;
 = cmd[1] = (CH_TYPES;  188
[emset(        if (ch->[emset(        if (timeout_move;
 191
retry:
[emset(        if (errno = 0;
ch,elemdebug) {
cmd[1] =pES5and: ");
[emset(        if (cmd);
 197        }
 198
buffer,
timeout_move;
ch_read_element_status( 191
retry:
ch">"L228" class="lCH_TYPESse" class="srefCH_TYPESvers/s||"L186" id="L186" uniclass="line" namenicsch">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->errno = 0;
debug) {
        nd: ");
ss="sref">cmd);
"> 197        }
( 198
(sense_key) {
CH_TYPES; UNIT_ATTENTION:
ch_read_element_status(cmd[1] =pES
 = 1;
        if (++ < 3)
ch_read_e__us="s( 2(void>49        <__us="sref">ch_read_e__us="s()"L228" class="lar"=result" class=ar"s        if (retry;
ch,CH_TYPES;                 }
CH_TYPES;  216        }
CH_TYPES; errno;
 2statu_paramnvers/f">cmd[1] =paramne" name="L237">paramnvers>        if ( 218}
 219
ch->paramnvers.186" id="L186" tp_curpick="sref">ch_read_etp_curpick="="sr> 23        
ch->paramnvers.186" id="L186" tp_npick="ne" name="L237"> p_npick="nvers/s">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->ch, 221
paramnvers.186" id="L186" tp_nslo href="+code=ch" cp_nslo hvers/scs">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->ch, 222static int
ch->paramnvers.186" id="L186" tp_nportalne" name="L237"> p_nportalnvers/s">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->ch,elem)
ch->paramnvers.186" id="L186" tp_nhne" name="L237"> p_nhnvers/sc">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->ch, 224{

i;
ch_read_ecopy_to_us="ult = [emset(paramnvers, sref">memset(paramnvers))a/scsi/ch.c#L208" id="L208" cl6ss="line"6name="L226"> 226

i++) {
i]  &&
i] +
CH_TYPES; i])
CH_TYPES; i+1;
 2statu_vendou_paramnvers/f">cmd[1] =vparamne" name="L237">vparamnvers>        if ( 232        }
        return 0;
ch-> 241/a>[emset(vparamnverss="sref">memset(vparamnversf">cmd,0,sizeof( 234}
cmd[1] =coun href="+code=ch" coun hultch->CH_TYPES;  235
vparamnvers.186" id="L186" tvp_n1se" class="sreftvp_n1vers/s">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->cmd,0,sizeof( 236static int
 = vparamnvers.186" id="L186" tvp_label1se" class="sreftvp_label1verssa> = vendou_labelnultcmd,0,sizeof(data)
 238{
cmd[1] =coun href="+code=ch" coun hultch->CH_TYPES; cmd[12];
sshdr);
(vparamnvers.186" id="L186" tvp_n2se" class="sreftvp_n2vers/s">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->cmd,0,sizeof(buffer;
 = vparamnvers.186" id="L186" tvp_label2se" class="sreftvp_label2verssa> = vendou_labelnultcmd,0,sizeof(result;
 242
cmd[1] =coun href="+code=ch" coun hultch->CH_TYPES; GFP_DMA);
vparamnvers.186" id="L186" tvp_n3se" class="sreftvp_n3vers/s">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->cmd,0,sizeof(buffer)
 = vparamnvers.186" id="L186" tvp_label3se" class="sreftvp_label3verssa> = vendou_labelnultcmd,0,sizeof(ENOMEM;
 246
cmd[1] =coun href="+code=ch" coun hultch->CH_TYPES; retry:
vparamnvers.186" id="L186" tvp_n4se" class="sreftvp_n4vers/s">"L228" class="l href="+code=cmd" class="sref">cmd[1] =coun href="+code=ch" coun hultch->cmd,0,sizeof(cmd));
 = vparamnvers.186" id="L186" tvp_label4se" class="sreftvp_label4verssa> = vendou_labelnultcmd,0,sizeof(REA6_ELEMENT_STATUS;
sshdr);
 << 5) |
ch_read_ecopy_to_us="ult = [emset(vparamnverss sref">memset(vparamnversf"a/scsi/ch.c#L208" id="L208" cl6scode=i" 6gs ? 0x10 : 0) |

elem);
        & 0xff;

cmd[5] = 1;
CH_TYPES; cmd[9] = 255;
CH_TYPES; ))) {
cmd[1] =pose" name="L237">ponvers>        if (elem) {
       6sshdr);
ch_read_ecopy_from_us=""> 241/a>[emset(ponvers"sref">ch_do_scsiar"p=result" class=ar"p="sr, sref">d="L228" class="lpose" name="L237">ponversf"a/scsi/ch.c#L208" id="L208" cl6L140" i1t6)

 161{
errno = 0;
ch_do_scsipose" name="L237">ponvers.186" id="L186" tp_type=result" class=tp_typeass="sref">ch_do_scsipose" name="L237">ponvers.186" id="L186" tp_uniclass="line" namtp_unicversf"hsref">CH_TYPES;  163
 259                        DPRINTKcmd,0,sizeof(

) &&
asc != 0) {
[emset(cmd[1] =lockass="line" namelock=ch_a>        if (i++) {
 28) |  =  &&
cmd[1] =  ch->ponvers.186" id="L186" tp_type=result" class=tp_typeass=] +sref">ch_do_scsipose" name="L237">ponvers.186" id="L186" tp_uniclass="line" namtp_unicversc/scsi/ch.c#L246" id="L246" cl6lass="sre6">asc &&
sshdr);
ponvers.186" id="L186" tp_flagne" name="L237"> p_flagn">ssh1/a>[3"L228" class="lCP_INVERnse" class="srefCP_INVERn=ch_a>        if (ascq) {
ch->[emset(cmd[1] =lockass="line" namelock=ch_a>        if (errno;
        if (ch,                }
CH_TYPES; 65"> 175        }
CH_TYPES; errno == 0)
cmd[1] =mvass="line" name=v65        if (EIO;
errno;
ch_read_ecopy_from_us=""> 241/a>[emset(ch_do_scsiar"p=result" class=ar"p="sr, sref">d="L228" class="lmvass="line" name=v65 179}
sshdr);

 180

 181static int
ch_do_scsimvass="line" name=v65ch_do_scsimvass="line" name=v65cmd,
ch_do_scsimvass="line" name=v65ch->CH_TYPES; buflength,
 259                        DPRINTKcmd,0,sizeof(direction)

6ame="L185"> 185{
result;
sshdr;
[emset(cmd[1] =lockass="line" namelock=ch_a>        if ( 188
 28) | )
cmd[1] =  ch->ch_do_scsimvass="line" name=v65timeout_move;
cmd[1] =  ch->ch_do_scsimvass="line" name=v65 191
 m_flagn">ssh1/a>[3"L228" class="lCM_INVERnse" class="srefCM_INVERn=ch_a>        if (retry:
ch->[emset(cmd[1] =lockass="line" namelock=ch_a>        if (errno = 0;
        if (elemdebug) {
6and: ");
cmd);
CH_TYPES;  197        }
CH_TYPES;  198
cmd[1] =mvass="line" name=v65        if (buffer,
ss-----------------------------7f1er" cla7s">timeout_move;
ch_read_ecopy_from_us=""> 241/a>[emset(ch_do_scsiar"p=result" class=ar"p="sr, sref">d="L228" class="lmvass="line" name=v65 191

retry:
errno = 0;
ch_do_scsimvass="line" name=v65ch_do_scsimvass="line" name=v65debug) {
ch_do_scsimvass="line" name=v65ch_do_scsimvass="line" name=v65nd: ");
ch_do_scsimvass="line" name=v65ch_do_scsimvass="line" name=v65CH_TYPES; ss="sref">cmd);
 259                        DPRINTKcmd,0,sizeof("> 197        }

ame="L198"> 198
sense_key) {
ss-----------------------------7ass="sref7>UNIT_ATTENTION:
ch->[emset(cmd[1] =lockass="line" namelock=ch_a>        if ( = 1;
 28) | 
++ < 3)
 = retry;
cmd[1] =  ch->ch_do_scsimvass="line" name=v65cmd[1] =  ch->ch_do_scsimvass="line" name=v65                }
cmd[1] =  ch->ch_do_scsimvass="line" name=v65 216        }
ch_do_scsimvass="line" name=v65 e_flagn">ssh1/a>[3"L228" class="lCE_INVERn1se" class="srefCE_INVERn1ass="sref">ch_do_scsimvass="line" name=v65 e_flagn">ssh1/a>[3"L228" class="lCE_INVERn2se" class="srefCE_INVERn2=ch_a>        if (errno;
ch->[emset(cmd[1] =lockass="line" namelock=ch_a>        if ( 218}
        if ( 219


 221
CH_TYPES;  222static int
CH_TYPES; elem)
 2statu_e8cmd[1] =c>ne" name="L237"> envers>        if ( 224{

i;
, 219
vendou_labelnultcmd,0,ass="sref7>UNIT_13".vers/scsi/ch.c#L207"""""7""" i7="L245" class="line" F24"> 224{
 e_flagnsde=cmd" class="sref">nsde=cmINVERnlt; 0sshdr;
 e_flagnsde=cmd" class="sref">nsde=cmINVERn) != retry:
[emse="+coa>
 = cmd,0,ass="sref7d="L23 198
7L228"73mset(
;  e_flagnsde=cmd" class="sref">nsde=cmINVEscsi/ch.c#L206" iea 6ref="62ivers/scsi/c7ame="L237"> e_flagnsd_status(CH_TYPES;  2statu_vendou_p7ramnv7rs/f">cmd[1] =vparamne" name="L737">vpara7nvers>        if (
 2paramne" 7ame="L237">vparamnverss=7sref"7memset(ch->)

ch->)
7lass="sre7tvp_label1verssa> = [emseizeof(data)
[1] =7oun href="+code=ch" coun7hult<7">ch->; ;  219
 =  224{

i = 1;
"71ive/ch.c#LLLLL id="L228" class="lcopy_dne" name="L237"e="L219"> 219
 = 1;
"71ivess="line7sss="sref7---------- */,0,7izeof(result;
vendou_labelnultcmd,0,ass="sref7[1] =7oun href="+code=ch" coun7hult<74ass=6              break;
[1]7=coun href="+code=ch" co7n hul7ch->retry:
errno = 0;
 = 1;
"71iveme="L237"> e_flaggede=cmd" class="sref">gede=cmers/scsi/ch.c#L214".c = 1;
"71iveme="L237"> e_flagged/.186" id="L186" te_ged/.181ivess              break;
[1] =7tvp_label3verssa> = cmd,0,ass="sref7md,0,7izeof(ENOMEM;
 = 1;
"71iveme="L237"> e_flaggede=cmd" class="sref">gede=cmers/ href="+code=ch" cl = 1;
"71iveme="L237"> e_flagged/.186" id="L186" te_ged/.181iveltcmd,0,ass="sref7mass="sre7oun href="+code=ch" coun7hult<74tu_movtvers/f">cmd[1] =mvass="7md[1]7=coun href="+code=ch" co7n hul7ch->
 = r!href="+coa>
,0,7izeof(;
cmd,0,ass="sref7vparamne"7name="L237">vparamnverss7sref"7memset(ss-----------------------------7ass="sref7>UNIT_ATTENTION:
ch->cmd[1] =vparamne" name="L7f ();
cmd,0,sizeovoltag_xsir>="+coa>
 2d="L23ch->)
 241/a>[emset(cmd,0,ass="sref7vd,0,7ef="65ivers/scsi/chcase>7L228"75sref">ENOMEM;
i++) {LusINVERnlt;nlt; 5) " class=te_fdsttypeass="sref">cONvers:re7">CH_TYPES; cmd[9] =         f="64ivers/scsi/ch.c#L206".c#L232" id="L232" class="line6csvoltag cOd[1]7sitiogsi_changer" classs7atu_p75f">ch->errno = 0;
 241/a>[emset(p7nvers>        if ( 241/a>[emset(,0,7csiar"p=result" class=ar7p="sr7 sref">d="L228" class=ass=fills 241/a>[emset((        if (p7nvers76ass=6              break;
    7                   ; 
errno = 0;

 241/a>[emset(r!href="+coa>
; c       if7() &&
 e_flaggedTYPES; 
7L1/a>[ems7t(cmd[1] 6ame="L1e" class="srefC2ttention = 1;
"71iveme="L237"> e_flagged>ssh1/a>[3"L228" clasgs="lCE_INVERs/scsi/ch.c#L170"">ch-> =  224{
c +sref">c7_do_scsipose" name="L2377>ponv7rs.186" id="L186" tp_uniclass="line" ne" class="srefC2ttention = 1;
"71iveme="L237"> e_flaggederrno/a>[3"L228" clasgs=errnoINVEref="+coa>
cmd,0,ass="sref7flagne" n7me="L237"> p_flagn">ssh17a>[3"7228" class="lCP_INVERnnnnnnnnns="line" nXIef="+code=errno" n7L1/a>[ems7t(cmd[1] f="+code24"> 224{
c sref FAU76ref="67ivers/scsi/ch.c#7212" 77sref">result;
 e_flagged>ssh1/a>[3"L228" clasgs="lCE_INVER|= cmd,0,ass="sref7f ( =  224{
 e_flagged>ssh1/a>[3"L228" clasgs="lCE_INVER|= cmd,0,ass="sref7f5ivers/s7 }
7VEvers:re7">CH_TYPES; 65"> 175                     fors> 224{
; ;
; c 1/a>[ems7t_statu_movt=result" cla7s="ss77ss="sref">cmd[1] 6ame="L1111111111111111124"> 224{
; c a href="7v65        if (; vparamnvers.186" id="L186" tvp_n4se" class="i/a>; cref">ch_d7_scsiar"p=result" class=7r"p="7r, sref">d="L228" class="lmvasdstuniclass="lineame="L1e" class="srefC2ttention = 1;
"71iveme="L237"> e_flaggedTde=cmd" class="sref">cgmd[1] =  ref="+coa>
; sshdr);
 e_flaggedTde/.186" id="L186" te_gede_srctype=rers/scsi/ch.c#L168la7a     if (; [ems7nvers>        if (> 224{
cr5ivers/s7rs/scsi/ch.c#LLLLL""""""7" id=7L245" class="line" BADDDDDDDDDDDDDDDDDe" class="srefC2ttention = 1;
"71iveme="L237"> e_flagged>ssh1/a>[3"L228" clasgs="lCE_INVER|= 6a78ef">65"> 175                     e" class="srefC2ttention = 1;
"71iveme="L237"> e_flaggedi6ref="61iverss="sgedi6f">65"ef="+coa>
[ems7L206".c#L232" id="L232" 7lass=7line6s class="6s="sref                e" class="srefC2ttention = 1;
"71iveme="L237"> e_flaggedLusref">i++) {ggedLusINVEref="+coa>
cmd[1]         s="line" nXIef="+code=errno" n7> 28) | <7 href="+ 23movt=result" 7lass=7s_movtvers/a> =  224{
c">ch_do_s7simvass="line" name=v65<7.186"7id="L186" tm_fromuniclass="line" namtme" class="srefC2ttention = 1;
"71iveme="L237"> e_flagged>ssh1/a>[3"L228" clasgs="lCE_INVER|= ch_7o_scsimvass="line" name=765cmd,0,sizeoE 6r]> cla7sref">errno ttention = 1;
"71iveme="L237"> e_flaggedproltag/a>[3"L228" clasgs=proltagers/sass=fills m_flagn">ssh17a>[3"7228" class="lCM_INVERn        s="line" nXIef="+code=errno" n7> ((cmd[1] f="+code24"> 224{
c"7ivers/s76ref="69ivers/scsi/ch.c#7214" 79 id="L186" te_srcuniclass="lin h_=utee" class="srefC2ttention = 1;
"71iveme="L237"> e_flagged>ssh1/a>[3"L228" clasgs="lCE_INVER|= 79245" class="line" BADDDDDDDDDDDDDDDDDe" class="srefCE 6r]>cmd,0,sizeoE 6r]> cla7sref">errno ttention = 1;
"71iveme="L237"> e_flaggedaroltag/a>[3"L228" clasgs=aroltagers/sass=fills65"> 175             s="line" nXIef="+code=errno" n7>1/a>[ems7ef="69ivers/scsi/chcase>7L228"79ine6s class="6s="sref} else 6ref="64ivers/scsi/ch.c#L206".c#L232" id="L232" class="line6csvoltag c"a href="7">CH_TYPES;  197     n h_=utee" class="srefC2h.c#L206".c#L232" id="L232" class="line6csvoltag ch->CH_TYPES; ss="sref">cmddevict has no rolume tag support.c#L207""""""""".c#L111" id="L1 name="L259"> 28ine" name8v65        if ( 28i2e" name8v_scsimvass="line" name=8r"p="8r, sref">d="L228" class="line" nXIef="+code=errno" n8 7ref="708vers/scsi/ch.c#L212"""""8""" i80
 28i4ref="708v(

errno;
ch->cmd[1] =c>ne" nam8h_do_scsi8vass="line" name=v65sshdr);
 << 5) |
 = 1;
"71ive/cL237"e="L219"> 219
 = 1;
"71ivess="line7sss="sref7---------- */8h_do_scsi8vass="line" name=v65vendou_labelnultcmd,0,ass="sref89    8                   ; cmd,0,ass="sref899/a>    8 >CH_TYPES; 8me="L198"> 198
 8L1/a>[ems8t(cmd" class=te_sdsttypeass="sref">8claretval8ef="+code=cmd"retval65ss-----------------------------7ass="sref7>UNIT_ATTENTION:
ch-> =         if (:
errno ATTENTION:

errno;
ch->ch_do_s8simvass="line" name=v65<8.186"8id="L186" te_fdstunicl=lockass="line" namelock=ch_a>        if ( 28">ch_do_s8simvass="line" name=v65<8.186"8id="L186" te_ss="line" nXIef="+code=errno" n8     8="L237"> e_flagn">ssh1/a8[3"L281tu_movtvers/f">cmd[1] =mvass="8L1/a>[ems8t(cmd7---------- */

 88}
8al65  8     if ([3"L228" clascsi/chsset_roltag 2872ivers/s8si/ch.c#L232" id="L232" 8lass=82ndou_labelne" name="L2 class=fills
"L2282s/f">cmd[1] =vparamne" name="L8USvers:re8">CH_TYPES;  222static24"> 224{

i 224{
 2statu_e8DPRINTKcm1_SNIT_A9"L237">vendou_labelnultcmd,0,ass="sref8="L237"> 8nvers>        if (debug) {

retry:
errno = 0;
 e_flagsvde=cmd" class="sref">svde=cmers/scsi/ch.c#L214".c e_flagsvd/.186" id="L186" te_svd/.18="+css"" class=te_sdsttypeass="sref">8a    8vers/scsi/ch.c#L207"""""8""" i8="L245" class="line" FFFFFFFFFe="L237"> e_fla5CH_TYPES; ss="sref">cmdSVOLTAGef="70ivers/scsi/ch.c#L207""""""""".c#L111" id="L1 name="L259"> 28/1/a>[ems8="+coa>
 = ,0,sizeof("> 197        }
 = ] +
( e_flagsvde=cmd" class="sref">svde=cmers/]eref="+code=ch" cl e_flagsvd/.186" id="L186" te_svd/.18="+c"sref7>"> 197        }
CH_TYPES; (ss-----------------------------7ass="sref7>UNIT_ATTENTION:
ch-> 2statu_vendou_p8ramnv83
[3"L228" clascsset_roltagerrno = 0;
vpara8nvers>        if ( =  e_flagsvd>ssh1/a>[3"L228" classvd>ssh1"""""n1se" class="srefCE_INSV_AVOLTAG5ivers        ifSV_AVOLTAG1ivet" class=te_sdsttypeass=] +sre83nt_s="li8ame="L237">vparamnverss=8sref"83 id="L186" te_srcuniclass="lin h_=ute6ame="Le" class="srefC e_flagsvd>ssh1/a>[3"L228" classvd>ssh1"""""n1se" class="srefCE_INSV_CLEARTAG5ivers        ifSV_CLEARTAG1ivet" class=te_sdsttypeass=] +sre83"L237"> 8oun href="+code=ch" coun8hult<8">ch-> e_flagsvdroltag/a>[3"L228" classvdroltagex_lockass="line" name=utex_lock=ch8aspan>
ch->)

errno;
ch-> =         if ( 28M1/a>[ems8izeof([1] =8oun href="+code=ch" coun8hult<84e="L198"> 198
(
 8lass="sre8tvp_label2verssa> = errno = 0;
,0,8izeof(cmd[1] =vparamne" name="L8[1] =8oun href="+code=ch" coun8hult<84445" class="ls="line" nXIef="+code=errno" n8chs="line" nXIef="+code=errno" n8<"L237"> 8tvp_label3verssa> = debug) {
,0,8izeof(debug) {
cmd[1] =mvass="8md[1]8=coun href="+code=ch" co8n hul8ch int
CH_TYPES<">CH_TYPES<8" clascsi/chsref">CH_TYPES<">45" c" class=te_sdsttypeass="sref">8lass="sre8tvp_label4verssa> = nsde=cmINVEass="line" name=utex_unlock=ch8md,0,8izeof({
vparamnverss8sref"8memset}ass="line" name=utex_unlock=ch8md,0,8vers/scsi/ch.c#L212"""""8""" i85s/f">#def.c#------- */
CH_TYPES<8" cla>
MENT_S------ */ss="sref#39;cf#39;""""""", 8, int
CH_TYPES<">CH_TYPES<8" clascsi/chsref">CH_TYPES<">45" ="line7sss="sref7---------- */8f (chTYPEic longf="+coa>
:

,0,8ef="65ivers/scsi/chcase>8L228"85sref"" class=te_sdsttypeass="sref">8lass="sre8">CH_TYPES; cmderrno = 0;

[1]8sitiogsi_changer" classs8atu_p85f">chss="line" name=utex_unlock=ch8="L237">p8nvers>        if ( 224{
8=d,0,8csiar"p=result" class=ar8p="sr86ine7 class="s7---------- */

 8=paramne"8vers/scsi/ch.c#L211"""""8""" i86emset(

 8=d,0,8nvers>        if (

 8= (p8nvers86


 8=="L23cmd<8=5ivers/s8rs/scsi/ch.c#LLLLL""""""8" id=8L245" class="l7---------- */
 8       if8() &&7---------- */

 8L1/a>[ems8t(cmd7---------- */

 8 = 
 8 +sref">c8_do_scsipose" name="L2378>ponv8rs.186" id="L186" tp_uxsi_cha="+coa>
        if (errnofilmd" class="sref"filmMENTtcsi/ch.c#L214".c< 6ref="61iverss="s 67ref, href="+coa>
 p_flagn">ssh18a>[3"87ine7 class="s7---------- */
CH_TYPES<8" cla>
MENToa>
 8L1/a>[ems8t(cmd" class=te_sdsttypeass="sref">8 sref FAU86ref="67ivers/scsi/ch.c#8212" 87sref">result;
CH_TYPES<">CH_TYPES<8" clascsi/chsref">CH_TYPES<">45" ce" class="srefCCH_TYPES<8" clase<">45" ass="line" name=utex_unlock=ch8f ( = errno_status(cmd[1] =c>ne" nam8f5ivers/s8 }
 224{

i;">CH_TYPES<8" clase<">45" , (voidS------ */
 219
CH_TYPES<8" clase<">45" ss="line7sss="sref7---------- */8VEvers:re8">CH_TYPES; 65"> 175             meterref">DPRINTKcm1_SNIT_A9"L237">vendou_labelnultcmd,0,ass="sref8 1/a>[ems8t_statu_movt=result" cla8s="ss87ss="sref">cmd[1] 24"> 224{
CH_TYPES<8" clase<">45" me="L237"> e_flagnsde=cmd" class="sref">nsde=cmINVERnlt; 0sshdr;
CH_TYPES<8" clase<">45" me="L237"> e_flagnsde=cmd" class="sref">nsde=cmINVERn) != retry:

cmd,0,ass="sref8ref">ch_d8_scsiar"p=result" class=8r"p="88e="L198"> 198
sshdr);
errno_status(errno a ">CH_TYPES<8" clase<">45" me="L237"> e_flagnsd_status([ems8nvers>        if (
; CH_TYPES<8" clase<">45" me="L237"> e_flagnsde=cmd" class="sref">nsde=cmINVEscsi/ch.c#L206" i_status(
 8h7ivers/s8                       <8 href8"+code=DCHIOMOVE: inva"+7f7s="sref7_fmass=/>//Lxsi_chame="_ioct___fmpat(chL232"devict, s 6, (void*)ne");"""""""a>
 8r5ivers/s8rs/scsi/ch.c#LLLLL""""""8" id=8L245" class="line" BADxsi_chanamelock=1sllt" cNOIOCTLCMDa 5ref="58iverscNOIOCTLCMDelnultcmd,0,ass="sref8rEvers:re8(6a88ef">6tcmd,0,ass="sref8r1/a>[ems8L206".c#L232" id="L232" 8lass=8line6s class="s="line" nXIef="+code=errno" n8ha href="8t( 28) | <8 href="+ 23movt=result" 8lass=8s_movt#endif="line" nXIef="+code=errno" n8>6ref="688simvass="line" name=v65<8.186"89ine"7name="L219"> 219
ch_8o_scsimvass="line" name=865/* ------------------------------------------------------------------------ */"""""""a>
 8flagne" n8me="L237"> m_flagn">ssh18a>[3"89s/f">cmd[1] =vparamne" name="L8> (( = 1;devict7ref_*sref">errno_ed="L186" te_flag_ed8s5ivers/s8     if (89245" class="l int
 = 1;me="_devict7ref_*sref">errnos6ref="61iverss="sdnlocref="+coa>
 = 1;to_k;
<_devictsref7>nd: "cmd,0,ass="sref8fEvers:re8si/ch.c#L232" id="L232" 8lass=89ef">65"> 175< int
errnotion<__ed="L186" te_flagtion<__edelnultcmd,0,ass="sref8>1/a>[ems8ef="69ivers/scsi/chcase>8L228"89ine6s class="" class=fillscmd,0,ass="sref8"a href="8">CH_TYPES;  197errno = 0;
cmd,0,ass="sref9" t_statu9ext_stat=result" class="9statu90e="L198"> 198
        if ( 224{
:
:_MEDIUM_2" claRd="L228" clasxsi_chanamelock=1sllt" cNODEV72ivers        cNODEVers/ltcmd,0,ass="sref9"3e" name9ve="L237"> m_flagn">ssh19""" i90s/f">cmd[1] =vparamne" name="L9i4ref="709v(
errno = 0;

*sref">errno = 0;
cmd,0,ass="sref9ch_do_scs9mvass="line" name=v65 224{
cmd,0,ass="sref9h_do_scsi9vass="line" name=v656tcmd,0,ass="sref99    9                   r!href="+coa>
i        if (cmd,0,ass="sref9       if9(9me="L198"> 198
{
ss----------spinE="71s="sref7 class="sref">iss----------a  index_="711ive=ltcmd,0,ass="sref9L1/a>[ems9t(cmdsi/ch.c#L206" iref="63ivers/scsi/reype=rershref="+coa>
i        if ();
icmd,0,ass="sref9L3e" name9ef="+code=cmd"retval65{
        if (spinERn2=chs="sref7 class="sref">iss----------a  index_="711ive=ltcmd,0,ass="sref9L4ref="709
 224{
ch_do_s9simvass="line" name=v65<9.186"9id="L186" te_fdstuniclgoto vers/scsi/ch.c#fret_" id=212"" id="L2fret_" 1iveltcmd,0,ass="sref9 _do_scsi9simvass="line" name=v65<9.186"91ef">6tcmd,0,ass="sref9     9="L237"> e_flagn">ssh1/a9[3"L291e=DCHIOEXCHANf">rlass="sref">iretry9L1/a>[ems9t(ch->
cmd,0,ass="sref98}
        if (cmd,0,ass="sref98csi/ch.c9     if (
cmd,0,ass="sref984ref="709">CH_TYPES; errnosprintf_a>        if (sprintfsref7>nd: ");
cmdch%d#L207""""""""sass=fillscmd,0,ass="sref9ent_s="li9e" name="L237"> 2statu_e9cmd[1] =c>ne" nam9="L237"> 9nvers>        if ({
ss----------a  sysfs_tion
nd: ");
);
    9vers/scsi/ch.c#L207"""""9""" i9="L245" class="line" FFFFFFFFF==========s+7f7s="sref7>ss="sref">cmds%s#L207""""""""scsi/ch.c#L206" ian>);
cmd,0,ass="sref9e1/a>[ems9="+coa>
 f">rlass="sref">ind: "9d="L23ss----------print1sref7>nd: "cmdch%d: devict_creatt failed.c#L207""""""""s" class=te_sdsttypeass=] +sre9>] +
({
cmd,0,ass="sref9d2ivers/s9">CH_TYPES; (
nd: "cmd,0,ass="sref9d3e" name9="L237"> 2statu_vendou_p9ramnv93cmd,0,ass="sref937">vpara9nvers>        if (vparamnverss=9sref"93="linvers/f">cmd[1] =c>ne" nam93"L237"> 9oun href="+code=ch" coun9hult<936a href="+ 23 224{
ich->
ch->lass="sref">i
    9tvp_label1verssa> = cmd[3"L228" clascsreadconfigsref7>nd: ");
[ems9izeof( f">rlass="sref">i = nd: ":
errno ATTENTION:
 219
 = cmdsi/ch.c#L206" idevsset_drv_status(nd: ");
ss----------s_evsprint1sref7>nd: "
cmdAttachedame=" scsi/ch %s.c#L207""""""""scsi/ch.c#L206" ian>);
cmd,0,ass="sref9[1] =9oun href="+code=ch" coun9hult<94ass=6              break;
ch-> 9tvp_label3verssa> =  9md,0,9izeof(ch->lass="sref">ii        if (cmd,0,ass="sref9mass="sre9oun href="+code=ch" coun9hult<94tu_movers/scsi/ch.c#fret_" id=212"" id="L2fret_" 1iveoa>
 9m1/a>[ems9=coun href="+code=ch" co9n hul94" cl67"> 197 = 1;kfrethref="class="line6csan>);
 = vparamnverss9sref"95ndou_="line" nXIef="+code=errno" n9md,0,9vers/scsi/ch.c#L212"""""9""" i95s/f">TYPEic " class=fillserrno_ed="L186" te_flag_ed9d="L23        if (errno = 0;

(nd: " 9si/ch.c#L232" id="L232" 9lass=95emdebug) {
,0,9ef="65ivers/scsi/chcase>9L228"95f">ch->lass="sref">iss----------spinE="71s="sref7 class="sref">iss----------a  index_="711ive=ltcmd,0,ass="sref9lass="sre9">CH_TYPES; cmdi        if (cmd,0,ass="sref9md[1]9sitiogsi_changer" classs9atu_p95" cl67"> 197        if (spinERn2=chs="sref7 class="sref">iss----------a  index_="711ive=ltcmd,0,ass="sref9="L237">p9nvers>        if ( 198
{
cmd,0,sizeodevict_de ino>sref7>nd: "ss----------a  sysfs_tionnd: "cmd,0,ass="sref9=ass="sre9vers/scsi/ch.c#L211"""""9""" i96ss="sref">cmdsi/ch.c#L206" ikfretention = 1;kfrethref="class="line6csan>);
cmd,0,ass="sref9=d,0,9nvers>        if ({
 = 1;kfrethref="class="line6csan>);
p9nvers96
ch->chs="line" nXIef="+code=errno" n9=5ivers/s9rs/scsi/ch.c#LLLLL""""""9" id=96emdebug) {
TYPEic  int
        if ( = 1;an_templatters/ref" class=te_sdsttypeass="sref">9L1/a>[ems9t(cmdme="L237"> e_flaown/aa>        if ( = y:
 me="L237"> e_flagendrva>        if ( =ef" class=te_sdsttypeass="sref">9 +sref">c9_do_scsipose" name="L2379>ponv9rs.186" id="L186" tp_ume="L237"> e_flaa hr>);
ss="sref">cmdch&L207""""""""s" class=te_sdsttypeass=] +sre9flagne" n9me="L237"> p_flagn">ssh19a>[3"97mset( e_flaprobch.c#L163" id="Lprobchref= y:
( e_flaremove72ivers        removes="s y:
,0,96ref="67ivers/scsi/ch.c#9212" 97sref">result<}s" class=te_sdsttypeass=] +sre9f (cmd[1] =c>ne" nam9f5ivers/s9 }
ss----------a si/chsfop9VEvers:re9">CH_TYPES; 65"> 175 e_flaown/aa>        if ( = y:
[ems9t_statu_movt=result" cla9s="ss97ss="sref">cmdme="L237"> e_flaopena>        if ((:
 me="L237"> e_flarelease72ivers        releasetiogvers/a> y:
ch_d9_scsiar"p=result" class=9r"p="980tiogvers/a> me="L237"> e_flaRn2=ched ioct_a>        if (        if (sshdr);
debug) {
[ems9nvers>        if ( e_flag=mpat_ioct_a>        if (:
,0,9vass="line" name=v65 e_flallseech-> =efe="L237"> e_flaaoop_llseech->debug) {
6a98rTYPEic " class=fills[ems9L206".c#L232" id="L232" 9lass=9line6s" class=te_sdsttypeass="sref">9ha href="9t( f class=fills 28) | <9 href="+ 23movt=result" 9lass=99e="L198"> 198
{
ss----------print1sref7>nd: "ss="sref">cmdSCSI Media Ccsi/ch a>
{
cmd .c#L207""""""""".c#L111" id="L1 name="L259"> 29sref">ch_9o_scsimvass="line" name=965cmdsi/ch.c#L206" ian_sysfs_tionss----------a  sysfs_tion:
ss="sref">cmdse="_scsi/ch#L207""""""""".c#L111" id="L1 name="L259"> 29sd,0,9me="L237"> m_flagn">ssh19a>[3"99sref">resultrlass="sref">ind: "ss----------a  sysfs_tion9> (( = 
nd: "ss----------a  sysfs_tion 29s7ivers/s96ref="69ivers/scsi/ch.c#9214" 99+code=DCHIOMOVE: inva=lockass="line" namelocc     if (5ivers/s9     if (99245" class="ls="line" nXIef="+code=errno" n9fEvers:re9si/ch.c#L232" id="L232" 9lass=99f">ch->lass="sref">i
nd: "cmdch&L207""""""""sef7 class="sref">iss----------a si/chsfop 29s1/a>[ems9ef="69ivers/scsi/chcase>9L228"99e=DCHIOEXCHANf">rlass="sref">i9>a href="9">CH_TYPES; ch->
ss----------print1sref7>+7f7s="sref7>ss="sref">cmdUnable to get majoh %d foh SCSI-Ccsi/ch.c#L207""""""""s" class=te_sdsttypeass=] +sre10" t_statu10" t__TYPES; 10" ">ch->
;  class=te_sdsttypeass=] +sre10"1t_statu10"imvass="line" name=v65<10"im>10"mset(10"245" class="ls="line" nXIef="+code=errno" n10"3t_statu10"e="L237"> m_flagn">ssh110"e=>10"
        if (i = 1;an_templatters/me="L237"> e_flagendrva>        if ( 210"4t_statu10"(10"4=DCHIOEXCHANf">rlass="sref">i 210"5t_statu10"ref="69ivers/scsi/ch.c#10"re>10"+code=DCHIOMOVE: invagoto vers/scsi/ch.c#fail>CH_TYPES<8" clafail>pe=rckass="line" name=utex_lock=ch10"6t_statu10"    if (10"245" class="lxsi_chascsi/ch.c#L170"">ch->10"ef">6tcmd,0,ass="sref10"8t_statu10"f="69ivers/scsi/chcase>10"f=>10"8s="s/s="line" namelofail>CH_TYPES<8" clafail>pe=roa>
 10"9t_statu10">CH_TYPES; C>10"" cl67"> 197nd: "cmdch&L207""""""""s.c#L111" id="L1 name="L259"> 2101 t_statu10(10(
 1011t_statu10L259".c#L232" id="L232" 10L25>10(EMENT_STATUS< 224{
cmd,0,sizeoeion<_de ino>sref7>nd: "ss----------a  sysfs_tion 210(2t_statu10t(10(3">chs="line" nXIef="+code=errno" n10(4t_statu10
10(f">chTYPEic voidS------ */10(6ne6s" class=te_sdsttypeass="sref">10(7t_statu10simvass="line" name=v65<10sim>10(f">ch->lass="sref">i        if (i = 1;an_templatters/me="L237"> e_flagendrva>        if ( 21018t_statu10="L237"> e_flagn">ssh1/a10="L>10(ine"6f">cmdnd: "cmdch&L207""""""""s.c#L111" id="L1 name="L259"> 21019t_statu10t( 197cmd,0,sizeoeion<_de ino>sref7>nd: "ss----------a  sysfs_tion 2102 t_statu107ref="71ivers/scsi/ch.c#107re>107r cl67"> 197cmd,0,sizeoidr3de ino>s="sref7 class="sref">i        if ( 21021t_statu10     if (107ndou_="line" nXIef="+code=errno" n1073t_statu107ref="72ivers/scsi/chcas107re>1073">chlass="sref">ind: " 21024t_statu10">CH_TYPES; C>1074">chlass="sref">ind: " 21025t_statu10e" name="L237"> 2statu_e10e" >107="linvers/f">cmd[1] =c>ne" nam1076t_statu10nvers>        if (107em/*"""""""a>
 1077t_statu107ref="72ivers        if 107re>1077m * Local variables:"""""""a>
 1078t_statu10vers/scsi/ch.c#L207"""""10ver>1078m * c-basic-offset: 8"""""""a>
 1079t_statu10="+coa>
1079m * End:"""""""a>
 103 t_statu10         */"""""""a>
 10 1t_statu10ef="63ivers/scsi/chcase>10ef=>10 EMENT#/pre>
The original LXR software by th-------- */http://sourceforge.net/projects/lxh">LXR _fmaunityINVEslxh@/scux.noers/m lxh./scux.no kindly hostcd by ------ */http://www.redpill-/scpro.no">Redpill Lscpro ASINVEs