The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/scsi/scsi_disk.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * SCSI interface description
    3  */
    4 
    5 /*
    6  * Some lines of this file come from a file of the name "scsi.h"
    7  * distributed by OSF as part of mach2.5,
    8  *  so the following disclaimer has been kept.
    9  *
   10  * Copyright 1990 by Open Software Foundation,
   11  * Grenoble, FRANCE
   12  *
   13  *              All Rights Reserved
   14  *
   15  *   Permission to use, copy, modify, and distribute this software and
   16  * its documentation for any purpose and without fee is hereby granted,
   17  * provided that the above copyright notice appears in all copies and
   18  * that both the copyright notice and this permission notice appear in
   19  * supporting documentation, and that the name of OSF or Open Software
   20  * Foundation not be used in advertising or publicity pertaining to
   21  * distribution of the software without specific, written prior
   22  * permission.
   23  *
   24  *   OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
   25  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
   26  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
   27  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
   28  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
   29  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
   30  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   31  */
   32 
   33 /*
   34  * Largely written by Julian Elischer (julian@tfs.com)
   35  * for TRW Financial Systems.
   36  *
   37  * TRW Financial Systems, in accordance with their agreement with Carnegie
   38  * Mellon University, makes this software available to CMU to distribute
   39  * or use in any manner that they see fit as long as this message is kept with
   40  * the software. For this reason TFS also grants any other persons or
   41  * organisations permission to use or modify this software.
   42  *
   43  * TFS supplies this software to be publicly redistributed
   44  * on the understanding that TFS is not responsible for the correct
   45  * functioning of this software in any circumstances.
   46  *
   47  * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
   48  *
   49  * $FreeBSD: src/sys/scsi/scsi_disk.h,v 1.9.4.1 1999/09/05 08:21:42 peter Exp $
   50  */
   51 
   52 /*
   53  * SCSI command format
   54  */
   55 
   56 #ifndef _SCSI_SCSI_DISK_H
   57 #define _SCSI_SCSI_DISK_H 1
   58 
   59 struct scsi_reassign_blocks
   60 {
   61         u_char  op_code;
   62         u_char  byte2;
   63         u_char  unused[3];
   64         u_char  control;
   65 };
   66 
   67 struct scsi_rw
   68 {
   69         u_char  op_code;
   70         u_char  addr_2;         /* Most significant */
   71 #define SRW_TOPADDR     0x1F    /* only 5 bits here */
   72         u_char  addr_1;
   73         u_char  addr_0;         /* least significant */
   74         u_char  length;
   75         u_char  control;
   76 };
   77 
   78 struct scsi_rw_big
   79 {
   80         u_char  op_code;
   81         u_char  byte2;
   82 #define SRWB_RELADDR    0x01
   83         u_char  addr_3;         /* Most significant */
   84         u_char  addr_2;
   85         u_char  addr_1;
   86         u_char  addr_0;         /* least significant */
   87         u_char  reserved;
   88         u_char  length2;
   89         u_char  length1;
   90         u_char  control;
   91 };
   92 
   93 struct scsi_read_capacity
   94 {
   95         u_char  op_code;
   96         u_char  byte2;
   97         u_char  addr_3; /* Most Significant */
   98         u_char  addr_2;
   99         u_char  addr_1;
  100         u_char  addr_0; /* Least Significant */
  101         u_char  unused[3];
  102         u_char  control;
  103 };
  104 
  105 struct scsi_start_stop
  106 {
  107         u_char  op_code;
  108         u_char  byte2;
  109         u_char  unused[2];
  110         u_char  how;
  111 #define SSS_START               0x01
  112 #define SSS_LOEJ                0x02
  113         u_char  control;
  114 };
  115 
  116 
  117 
  118 /*
  119  * Opcodes
  120  */
  121 
  122 #define REASSIGN_BLOCKS         0x07
  123 #define READ_COMMAND            0x08
  124 #define WRITE_COMMAND           0x0a
  125 #define MODE_SELECT             0x15
  126 #define MODE_SENSE              0x1a
  127 #define START_STOP              0x1b
  128 #define PREVENT_ALLOW           0x1e
  129 #define READ_CAPACITY           0x25
  130 #define READ_BIG                0x28
  131 #define WRITE_BIG               0x2a
  132 
  133 
  134 
  135 struct scsi_read_cap_data
  136 {
  137         u_char  addr_3; /* Most significant */
  138         u_char  addr_2;
  139         u_char  addr_1;
  140         u_char  addr_0; /* Least significant */
  141         u_char  length_3;       /* Most significant */
  142         u_char  length_2;
  143         u_char  length_1;
  144         u_char  length_0;       /* Least significant */
  145 };
  146 
  147 struct scsi_reassign_blocks_data
  148 {
  149         u_char  reserved[2];
  150         u_char  length_msb;
  151         u_char  length_lsb;
  152         struct
  153         {
  154                 u_char  dlbaddr_3;      /* defect logical block address (MSB) */
  155                 u_char  dlbaddr_2;
  156                 u_char  dlbaddr_1;
  157                 u_char  dlbaddr_0;      /* defect logical block address (LSB) */
  158         } defect_descriptor[1];
  159 };
  160 
  161 union   disk_pages /* this is the structure copied from osf */
  162 {
  163         struct page_disk_format {
  164            u_char pg_code;      /* page code (should be 3)            */
  165 #define DISK_PGCODE     0x3F    /* only 6 bits valid */
  166            u_char pg_length;    /* page length (should be 0x16)       */
  167            u_char trk_z_1;      /* tracks per zone (MSB)              */
  168            u_char trk_z_0;      /* tracks per zone (LSB)              */
  169            u_char alt_sec_1;    /* alternate sectors per zone (MSB)   */
  170            u_char alt_sec_0;    /* alternate sectors per zone (LSB)   */
  171            u_char alt_trk_z_1;  /* alternate tracks per zone (MSB)    */
  172            u_char alt_trk_z_0;  /* alternate tracks per zone (LSB)    */
  173            u_char alt_trk_v_1;  /* alternate tracks per volume (MSB)  */
  174            u_char alt_trk_v_0;  /* alternate tracks per volume (LSB)  */
  175            u_char ph_sec_t_1;   /* physical sectors per track (MSB)   */
  176            u_char ph_sec_t_0;   /* physical sectors per track (LSB)   */
  177            u_char bytes_s_1;    /* bytes per sector (MSB)             */
  178            u_char bytes_s_0;    /* bytes per sector (LSB)             */
  179            u_char interleave_1;/* interleave (MSB)                    */
  180            u_char interleave_0;/* interleave (LSB)                    */
  181            u_char trk_skew_1;   /* track skew factor (MSB)            */
  182            u_char trk_skew_0;   /* track skew factor (LSB)            */
  183            u_char cyl_skew_1;   /* cylinder skew (MSB)                */
  184            u_char cyl_skew_0;   /* cylinder skew (LSB)                */
  185            u_char flags;        /* various */
  186 #define         DISK_FMT_SURF   0x10
  187 #define         DISK_FMT_RMB    0x20
  188 #define         DISK_FMT_HSEC   0x40
  189 #define         DISK_FMT_SSEC   0x80
  190            u_char reserved21;
  191            u_char reserved22;
  192            u_char reserved23;
  193         } disk_format;
  194         struct page_rigid_geometry {
  195            u_char pg_code;      /* page code (should be 4)            */
  196            u_char pg_length;    /* page length (should be 0x16)       */
  197            u_char ncyl_2;       /* number of cylinders (MSB)          */
  198            u_char ncyl_1;       /* number of cylinders                */
  199            u_char ncyl_0;       /* number of cylinders (LSB)          */
  200            u_char nheads;       /* number of heads                    */
  201            u_char st_cyl_wp_2;  /* starting cyl., write precomp (MSB) */
  202            u_char st_cyl_wp_1;  /* starting cyl., write precomp       */
  203            u_char st_cyl_wp_0;  /* starting cyl., write precomp (LSB) */
  204            u_char st_cyl_rwc_2;/* starting cyl., red. write cur (MSB)*/
  205            u_char st_cyl_rwc_1;/* starting cyl., red. write cur      */
  206            u_char st_cyl_rwc_0;/* starting cyl., red. write cur (LSB)*/
  207            u_char driv_step_1;  /* drive step rate (MSB)              */
  208            u_char driv_step_0;  /* drive step rate (LSB)              */
  209            u_char land_zone_2;  /* landing zone cylinder (MSB)        */
  210            u_char land_zone_1;  /* landing zone cylinder              */
  211            u_char land_zone_0;  /* landing zone cylinder (LSB)        */
  212            u_char rpl;          /* rotational position locking (2 bits) */
  213            u_char rot_offset;   /* rotational offset */
  214            u_char reserved19;
  215            u_char medium_rot_rate_1; /* medium rotation rate (RPM) (MSB) */
  216            u_char medium_rot_rate_0; /* medium rotation rate (RPM) (LSB) */
  217            u_char reserved22;
  218            u_char reserved23;
  219         } rigid_geometry;
  220 } ;
  221 #endif /* _SCSI_SCSI_DISK_H*/

Cache object: 01265a89fc0d565ef934350abfe1ee36


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.