.. | .. |
---|
24 | 24 | * http://sg.danny.cz/sg [alternatively check the MAINTAINERS file] |
---|
25 | 25 | * The documentation for the sg version 3 driver can be found at: |
---|
26 | 26 | * http://sg.danny.cz/sg/p/sg_v3_ho.html |
---|
27 | | - * Also see: <kernel_source>/Documentation/scsi/scsi-generic.txt |
---|
| 27 | + * Also see: <kernel_source>/Documentation/scsi/scsi-generic.rst |
---|
28 | 28 | * |
---|
29 | 29 | * For utility and test programs see: http://sg.danny.cz/sg/sg3_utils.html |
---|
30 | 30 | */ |
---|
.. | .. |
---|
68 | 68 | unsigned int info; /* [o] auxiliary information */ |
---|
69 | 69 | } sg_io_hdr_t; /* 64 bytes long (on i386) */ |
---|
70 | 70 | |
---|
| 71 | +#if defined(__KERNEL__) |
---|
| 72 | +#include <linux/compat.h> |
---|
| 73 | + |
---|
| 74 | +struct compat_sg_io_hdr { |
---|
| 75 | + compat_int_t interface_id; /* [i] 'S' for SCSI generic (required) */ |
---|
| 76 | + compat_int_t dxfer_direction; /* [i] data transfer direction */ |
---|
| 77 | + unsigned char cmd_len; /* [i] SCSI command length ( <= 16 bytes) */ |
---|
| 78 | + unsigned char mx_sb_len; /* [i] max length to write to sbp */ |
---|
| 79 | + unsigned short iovec_count; /* [i] 0 implies no scatter gather */ |
---|
| 80 | + compat_uint_t dxfer_len; /* [i] byte count of data transfer */ |
---|
| 81 | + compat_uint_t dxferp; /* [i], [*io] points to data transfer memory |
---|
| 82 | + or scatter gather list */ |
---|
| 83 | + compat_uptr_t cmdp; /* [i], [*i] points to command to perform */ |
---|
| 84 | + compat_uptr_t sbp; /* [i], [*o] points to sense_buffer memory */ |
---|
| 85 | + compat_uint_t timeout; /* [i] MAX_UINT->no timeout (unit: millisec) */ |
---|
| 86 | + compat_uint_t flags; /* [i] 0 -> default, see SG_FLAG... */ |
---|
| 87 | + compat_int_t pack_id; /* [i->o] unused internally (normally) */ |
---|
| 88 | + compat_uptr_t usr_ptr; /* [i->o] unused internally */ |
---|
| 89 | + unsigned char status; /* [o] scsi status */ |
---|
| 90 | + unsigned char masked_status; /* [o] shifted, masked scsi status */ |
---|
| 91 | + unsigned char msg_status; /* [o] messaging level data (optional) */ |
---|
| 92 | + unsigned char sb_len_wr; /* [o] byte count actually written to sbp */ |
---|
| 93 | + unsigned short host_status; /* [o] errors from host adapter */ |
---|
| 94 | + unsigned short driver_status; /* [o] errors from software driver */ |
---|
| 95 | + compat_int_t resid; /* [o] dxfer_len - actual_transferred */ |
---|
| 96 | + compat_uint_t duration; /* [o] time taken by cmd (unit: millisec) */ |
---|
| 97 | + compat_uint_t info; /* [o] auxiliary information */ |
---|
| 98 | +}; |
---|
| 99 | +#endif |
---|
| 100 | + |
---|
71 | 101 | #define SG_INTERFACE_ID_ORIG 'S' |
---|
72 | 102 | |
---|
73 | 103 | /* Use negative values to flag difference from original sg_header structure */ |
---|