1*e979c658Sreinoud /* $NetBSD: uscsilib_machdep.h,v 1.1 2008/05/14 16:49:48 reinoud Exp $ */
2*e979c658Sreinoud 
3*e979c658Sreinoud /*
4*e979c658Sreinoud  * Copyright (c) 2003, 2004, 2005, 2006, 2008 Reinoud Zandijk
5*e979c658Sreinoud  * All rights reserved.
6*e979c658Sreinoud  *
7*e979c658Sreinoud  * Redistribution and use in source and binary forms, with or without
8*e979c658Sreinoud  * modification, are permitted provided that the following conditions
9*e979c658Sreinoud  * are met:
10*e979c658Sreinoud  * 1. Redistributions of source code must retain the above copyright
11*e979c658Sreinoud  *    notice, this list of conditions and the following disclaimer.
12*e979c658Sreinoud  * 2. Redistributions in binary form must reproduce the above copyright
13*e979c658Sreinoud  *    notice, this list of conditions and the following disclaimer in the
14*e979c658Sreinoud  *    documentation and/or other materials provided with the distribution.
15*e979c658Sreinoud  *
16*e979c658Sreinoud  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17*e979c658Sreinoud  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18*e979c658Sreinoud  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19*e979c658Sreinoud  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20*e979c658Sreinoud  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21*e979c658Sreinoud  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22*e979c658Sreinoud  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23*e979c658Sreinoud  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24*e979c658Sreinoud  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25*e979c658Sreinoud  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*e979c658Sreinoud  *
27*e979c658Sreinoud  */
28*e979c658Sreinoud 
29*e979c658Sreinoud #ifndef _USCSILIB_MACHDEP_H_
30*e979c658Sreinoud #define _USCSILIB_MACHDEP_H_
31*e979c658Sreinoud 
32*e979c658Sreinoud #ifndef _DEV_SCSIPI_SCSIPI_ALL_H_
33*e979c658Sreinoud #	define SSD_KEY         0x0F
34*e979c658Sreinoud #	define SSD_ILI         0x20
35*e979c658Sreinoud #	define SSD_EOM         0x40
36*e979c658Sreinoud #	define SSD_FILEMARK    0x80
37*e979c658Sreinoud #	define SKEY_NO_SENSE           0x00
38*e979c658Sreinoud #	define SKEY_RECOVERED_ERROR    0x01
39*e979c658Sreinoud #	define SKEY_NOT_READY          0x02
40*e979c658Sreinoud #	define SKEY_MEDIUM_ERROR       0x03
41*e979c658Sreinoud #	define SKEY_HARDWARE_ERROR     0x04
42*e979c658Sreinoud #	define SKEY_ILLEGAL_REQUEST    0x05
43*e979c658Sreinoud #	define SKEY_UNIT_ATTENTION     0x06
44*e979c658Sreinoud #	define SKEY_WRITE_PROTECT      0x07
45*e979c658Sreinoud #	define SKEY_BLANK_CHECK        0x08
46*e979c658Sreinoud #	define SKEY_VENDOR_UNIQUE      0x09
47*e979c658Sreinoud #	define SKEY_COPY_ABORTED       0x0A
48*e979c658Sreinoud #	define SKEY_ABORTED_COMMAND    0x0B
49*e979c658Sreinoud #	define SKEY_EQUAL              0x0C
50*e979c658Sreinoud #	define SKEY_VOLUME_OVERFLOW    0x0D
51*e979c658Sreinoud #	define SKEY_MISCOMPARE         0x0E
52*e979c658Sreinoud #	define SKEY_RESERVED           0x0F
53*e979c658Sreinoud #endif
54*e979c658Sreinoud 
55*e979c658Sreinoud 
56*e979c658Sreinoud #ifndef SCSI
57*e979c658Sreinoud #	define SCSI_READCMD  0
58*e979c658Sreinoud #	define SCSI_WRITECMD 0
59*e979c658Sreinoud struct scsi_addr;
60*e979c658Sreinoud int    scsilib_verbose;
61*e979c658Sreinoud #endif
62*e979c658Sreinoud 
63*e979c658Sreinoud 
64*e979c658Sreinoud #ifdef USCSI_SCSIPI
65*e979c658Sreinoud #	include <sys/scsiio.h>
66*e979c658Sreinoud #	define SCSI_READCMD   SCCMD_READ
67*e979c658Sreinoud #	define SCSI_WRITECMD  SCCMD_WRITE
68*e979c658Sreinoud #	define SCSI_NODATACMD SCCMD_WRITE
69*e979c658Sreinoud #endif
70*e979c658Sreinoud 
71*e979c658Sreinoud 
72*e979c658Sreinoud #ifdef USCSI_LINUX_SCSI
73*e979c658Sreinoud #	include <scsi/sg.h>
74*e979c658Sreinoud #	define SCSI_READCMD   SG_DXFER_FROM_DEV
75*e979c658Sreinoud #	define SCSI_WRITECMD  SG_DXFER_TO_DEV
76*e979c658Sreinoud #	define SCSI_NODATACMD SC_DXFER_NONE
77*e979c658Sreinoud #endif
78*e979c658Sreinoud 
79*e979c658Sreinoud 
80*e979c658Sreinoud #ifdef USCSI_FREEBSD_CAM
81*e979c658Sreinoud #	include <camlib.h>
82*e979c658Sreinoud #	include <cam/scsi/scsi_message.h>
83*e979c658Sreinoud #	define SCSI_READCMD	1
84*e979c658Sreinoud #	define SCSI_WRITECMD	2
85*e979c658Sreinoud #	define SCSI_NODATACMD	0
86*e979c658Sreinoud #endif
87*e979c658Sreinoud 
88*e979c658Sreinoud 
89*e979c658Sreinoud #endif /* _USCSILIB_MACHDEP_H_ */
90*e979c658Sreinoud 
91