File: scsiUtils.h

package info (click to toggle)
ntop 3:3.3-11
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 12,772 kB
  • ctags: 7,534
  • sloc: ansic: 71,427; sh: 16,772; awk: 1,504; perl: 792; makefile: 782; php: 123; python: 23; sql: 13; sed: 11
file content (78 lines) | stat: -rw-r--r-- 3,156 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 *                          http://www.ntop.org
 *
 * Copyright (C) 1998-2007 Luca Deri <deri@ntop.org>
 *
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __SCSI_UTILS_H__
#define __SCSI_UTILS_H__

#define SCSI_DEV_BLOCK                   0x0
#define SCSI_DEV_SSC                     0x1
#define SCSI_DEV_PRINTER                 0x2
#define SCSI_DEV_WORM                    0x4
#define SCSI_DEV_CDROM                   0x5
#define SCSI_DEV_SMC                     0x8
#define SCSI_DEV_INITIATOR               0x12 /* Our own convention */
#define SCSI_DEV_UNKNOWN                 0x13 /* Our own convention */
#define SCSI_DEV_NODEV                   0x1F
#define SCSI_DEV_UNINIT                  0xFF

#define SCSI_READ_CMD                    0x1
#define SCSI_WR_CMD                      0x2
#define SCSI_NONRDWR_CMD                 0x3

#define SCSI_SPC2_INQUIRY                0x12
#define SCSI_SPC2_INQUIRY_EVPD           0xFF
#define SCSI_SPC2_REPORTLUNS             0xA0
#define SCSI_SBC2_READCAPACITY           0x25
#define SCSI_SBC2_READ6                  0x08
#define SCSI_SBC2_READ10                 0x28
#define SCSI_SBC2_READ12                 0xA8
#define SCSI_SBC2_READ16                 0x88
#define SCSI_SBC2_WRITE6                 0x0A
#define SCSI_SBC2_WRITE10                0x2A
#define SCSI_SBC2_WRITE12                0xAA
#define SCSI_SBC2_WRITE16                0x8A
#define SCSI_SSC2_READ6                  0x08
#define SCSI_SSC2_READ_16                0x88
#define SCSI_SSC2_READ_REVERSE_6         0x0F
#define SCSI_SSC2_READ_REVERSE_16        0x81
#define SCSI_SSC2_WRITE6                 0x0A
#define SCSI_SSC2_WRITE_16               0x8A

#define MAX_LUNS_SUPPORTED               256
#define MAX_LUNS_GRAPHED                 10
#define SCSI_VENDOR_ID_LEN               16

#define SCSI_STATUS_GOOD                 0
#define SCSI_STATUS_CHK_CONDITION        0x02
#define SCSI_STATUS_BUSY                 0x08
#define SCSI_STATUS_RESV_CONFLICT        0x18
#define SCSI_STATUS_TASK_SET_FULL        0x28
#define SCSI_STATUS_TASK_ABORTED         0x40 

#define SCSI_TM_ABORT_TASK_SET           0x2
#define SCSI_TM_CLEAR_TASK_SET           0x4
#define SCSI_TM_LUN_RESET                0x10
#define SCSI_TM_TARGET_RESET             0x20
#define SCSI_TM_CLEAR_ACA                0x40

#endif