| OLD | NEW |
| 1 #ifndef _SCSI_SG_H | 1 #ifndef _SCSI_SG_H |
| 2 #define _SCSI_SG_H | 2 #define _SCSI_SG_H |
| 3 | 3 |
| 4 #define SG_DXFER_NONE -1 | 4 #define SG_DXFER_NONE -1 |
| 5 #define SG_DXFER_TO_DEV -2 | 5 #define SG_DXFER_TO_DEV -2 |
| 6 #define SG_DXFER_FROM_DEV -3 | 6 #define SG_DXFER_FROM_DEV -3 |
| 7 #define SG_DXFER_TO_FROM_DEV -4 | 7 #define SG_DXFER_TO_FROM_DEV -4 |
| 8 #define SG_FLAG_DIRECT_IO 1 | 8 #define SG_FLAG_DIRECT_IO 1 |
| 9 #define SG_FLAG_LUN_INHIBIT 2 | 9 #define SG_FLAG_LUN_INHIBIT 2 |
| 10 #define SG_FLAG_NO_DXFER 0x10000 | 10 #define SG_FLAG_NO_DXFER 0x10000 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ | 45 #define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ |
| 46 #define SG_MAX_QUEUE 16 | 46 #define SG_MAX_QUEUE 16 |
| 47 #define SG_BIG_BUFF SG_DEF_RESERVED_SIZE | 47 #define SG_BIG_BUFF SG_DEF_RESERVED_SIZE |
| 48 #define SG_MAX_SENSE 16 | 48 #define SG_MAX_SENSE 16 |
| 49 #define SG_SET_TIMEOUT 0x2201 | 49 #define SG_SET_TIMEOUT 0x2201 |
| 50 #define SG_GET_TIMEOUT 0x2202 | 50 #define SG_GET_TIMEOUT 0x2202 |
| 51 #define SG_GET_COMMAND_Q 0x2270 | 51 #define SG_GET_COMMAND_Q 0x2270 |
| 52 #define SG_SET_COMMAND_Q 0x2271 | 52 #define SG_SET_COMMAND_Q 0x2271 |
| 53 #define SG_SET_DEBUG 0x227e | 53 #define SG_SET_DEBUG 0x227e |
| 54 #define SG_NEXT_CMD_LEN 0x2283 | 54 #define SG_NEXT_CMD_LEN 0x2283 |
| 55 #define SG_DEFAULT_TIMEOUT (60*100) /* 60*HZ */ | 55 #define SG_DEFAULT_TIMEOUT (60 * 100) /* 60*HZ */ |
| 56 #define SG_DEF_COMMAND_Q 0 | 56 #define SG_DEF_COMMAND_Q 0 |
| 57 #define SG_DEF_UNDERRUN_FLAG 0 | 57 #define SG_DEF_UNDERRUN_FLAG 0 |
| 58 | 58 |
| 59 typedef struct sg_iovec { | 59 typedef struct sg_iovec { |
| 60 » void *iov_base; | 60 void* iov_base; |
| 61 » unsigned long iov_len; | 61 unsigned long iov_len; |
| 62 } sg_iovec_t; | 62 } sg_iovec_t; |
| 63 | 63 |
| 64 typedef struct sg_io_hdr { | 64 typedef struct sg_io_hdr { |
| 65 » int interface_id; | 65 int interface_id; |
| 66 » int dxfer_direction; | 66 int dxfer_direction; |
| 67 » unsigned char cmd_len; | 67 unsigned char cmd_len; |
| 68 » unsigned char mx_sb_len; | 68 unsigned char mx_sb_len; |
| 69 » unsigned short iovec_count; | 69 unsigned short iovec_count; |
| 70 » unsigned dxfer_len; | 70 unsigned dxfer_len; |
| 71 » void *dxferp; | 71 void* dxferp; |
| 72 » unsigned char *cmdp; | 72 unsigned char* cmdp; |
| 73 » unsigned char *sbp; | 73 unsigned char* sbp; |
| 74 » unsigned timeout; | 74 unsigned timeout; |
| 75 » unsigned flags; | 75 unsigned flags; |
| 76 » int pack_id; | 76 int pack_id; |
| 77 » void *usr_ptr; | 77 void* usr_ptr; |
| 78 » unsigned char status; | 78 unsigned char status; |
| 79 » unsigned char masked_status; | 79 unsigned char masked_status; |
| 80 » unsigned char msg_status; | 80 unsigned char msg_status; |
| 81 » unsigned char sb_len_wr; | 81 unsigned char sb_len_wr; |
| 82 » unsigned short host_status; | 82 unsigned short host_status; |
| 83 » unsigned short driver_status; | 83 unsigned short driver_status; |
| 84 » int resid; | 84 int resid; |
| 85 » unsigned int duration; | 85 unsigned int duration; |
| 86 » unsigned int info; | 86 unsigned int info; |
| 87 } sg_io_hdr_t; | 87 } sg_io_hdr_t; |
| 88 | 88 |
| 89 struct sg_scsi_id { | 89 struct sg_scsi_id { |
| 90 » int host_no; | 90 int host_no; |
| 91 » int channel; | 91 int channel; |
| 92 » int scsi_id; | 92 int scsi_id; |
| 93 » int lun; | 93 int lun; |
| 94 » int scsi_type; | 94 int scsi_type; |
| 95 » short h_cmd_per_lun; | 95 short h_cmd_per_lun; |
| 96 » short d_queue_depth; | 96 short d_queue_depth; |
| 97 » int unused[2]; | 97 int unused[2]; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 typedef struct sg_req_info { | 100 typedef struct sg_req_info { |
| 101 » char req_state; | 101 char req_state; |
| 102 » char orphan; | 102 char orphan; |
| 103 » char sg_io_owned; | 103 char sg_io_owned; |
| 104 » char problem; | 104 char problem; |
| 105 » int pack_id; | 105 int pack_id; |
| 106 » void *usr_ptr; | 106 void* usr_ptr; |
| 107 » unsigned duration; | 107 unsigned duration; |
| 108 » int unused; | 108 int unused; |
| 109 } sg_req_info_t; | 109 } sg_req_info_t; |
| 110 | 110 |
| 111 typedef struct sg_io_hdr Sg_io_hdr; | 111 typedef struct sg_io_hdr Sg_io_hdr; |
| 112 typedef struct sg_io_vec Sg_io_vec; | 112 typedef struct sg_io_vec Sg_io_vec; |
| 113 typedef struct sg_scsi_id Sg_scsi_id; | 113 typedef struct sg_scsi_id Sg_scsi_id; |
| 114 typedef struct sg_req_info Sg_req_info; | 114 typedef struct sg_req_info Sg_req_info; |
| 115 | 115 |
| 116 struct sg_header { | 116 struct sg_header { |
| 117 » int pack_len; | 117 int pack_len; |
| 118 » int reply_len; | 118 int reply_len; |
| 119 » int pack_id; | 119 int pack_id; |
| 120 » int result; | 120 int result; |
| 121 » unsigned twelve_byte:1; | 121 unsigned twelve_byte : 1; |
| 122 » unsigned target_status:5; | 122 unsigned target_status : 5; |
| 123 » unsigned host_status:8; | 123 unsigned host_status : 8; |
| 124 » unsigned driver_status:8; | 124 unsigned driver_status : 8; |
| 125 » unsigned other_flags:10; | 125 unsigned other_flags : 10; |
| 126 » unsigned char sense_buffer[SG_MAX_SENSE]; | 126 unsigned char sense_buffer[SG_MAX_SENSE]; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 #endif | 129 #endif |
| OLD | NEW |