Home | History | Annotate | Line # | Download | only in scsipi
scsipi_disk.h revision 1.4
      1 /*	$NetBSD: scsipi_disk.h,v 1.4 1998/02/13 04:19:32 enami Exp $	*/
      2 
      3 /*
      4  * SCSI and SCSI-like interfaces description
      5  */
      6 
      7 #ifndef _DEV_SCSIPI_SCSIPI_DISK_H_
      8 #define _DEV_SCSIPI_SCSIPI_DISK_H_
      9 
     10 /*
     11  * Some lines of this file come from a file of the name "scsi.h"
     12  * distributed by OSF as part of mach2.5,
     13  *  so the following disclaimer has been kept.
     14  *
     15  * Copyright 1990 by Open Software Foundation,
     16  * Grenoble, FRANCE
     17  *
     18  * 		All Rights Reserved
     19  *
     20  *   Permission to use, copy, modify, and distribute this software and
     21  * its documentation for any purpose and without fee is hereby granted,
     22  * provided that the above copyright notice appears in all copies and
     23  * that both the copyright notice and this permission notice appear in
     24  * supporting documentation, and that the name of OSF or Open Software
     25  * Foundation not be used in advertising or publicity pertaining to
     26  * distribution of the software without specific, written prior
     27  * permission.
     28  *
     29  *   OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
     30  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
     31  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
     32  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
     33  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
     34  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
     35  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     36  */
     37 
     38 /*
     39  * Largely written by Julian Elischer (julian (at) tfs.com)
     40  * for TRW Financial Systems.
     41  *
     42  * TRW Financial Systems, in accordance with their agreement with Carnegie
     43  * Mellon University, makes this software available to CMU to distribute
     44  * or use in any manner that they see fit as long as this message is kept with
     45  * the software. For this reason TFS also grants any other persons or
     46  * organisations permission to use or modify this software.
     47  *
     48  * TFS supplies this software to be publicly redistributed
     49  * on the understanding that TFS is not responsible for the correct
     50  * functioning of this software in any circumstances.
     51  *
     52  * Ported to run under 386BSD by Julian Elischer (julian (at) tfs.com) Sept 1992
     53  */
     54 
     55 /*
     56  * SCSI command format
     57  */
     58 
     59 #define	READ_BIG		0x28
     60 #define WRITE_BIG		0x2a
     61 struct scsipi_rw_big {
     62 	u_int8_t opcode;
     63 	u_int8_t byte2;
     64 #define	SRWB_RELADDR	0x01
     65 	u_int8_t addr[4];
     66 	u_int8_t reserved;
     67 	u_int8_t length[2];
     68 	u_int8_t control;
     69 };
     70 
     71 #define	READ_CAPACITY		0x25
     72 struct scsipi_read_capacity {
     73 	u_int8_t opcode;
     74 	u_int8_t byte2;
     75 	u_int8_t addr[4];
     76 	u_int8_t unused[3];
     77 	u_int8_t control;
     78 };
     79 
     80 #define START_STOP		0x1b
     81 struct scsipi_start_stop {
     82 	u_int8_t opcode;
     83 	u_int8_t byte2;
     84 	u_int8_t unused[2];
     85 	u_int8_t how;
     86 #define	SSS_STOP		0x00
     87 #define	SSS_START		0x01
     88 #define	SSS_LOEJ		0x02
     89 	u_int8_t control;
     90 };
     91 
     92 
     93 /* DATAs definitions for the above commands */
     94 
     95 struct scsipi_read_cap_data {
     96 	u_int8_t addr[4];
     97 	u_int8_t length[4];
     98 };
     99 
    100 #endif /* _DEV_SCSIPI_SCSIPI_DISK_H_ */
    101