📄 scsiconf.h
字号:
struct scsi_xfer { LIST_ENTRY(scsi_xfer) free_list; int flags; struct scsi_link *sc_link; /* all about our device and adapter */ int retries; /* the number of times to retry */ int timeout; /* in milliseconds */ struct scsi_generic *cmd; /* The scsi command to execute */ int cmdlen; /* how long it is */ u_char *data; /* dma address OR a uio address */ int datalen; /* data len (blank if uio) */ size_t resid; /* how much buffer was not touched */ int error; /* an error value */ struct buf *bp; /* If we need to associate with a buf */ struct scsi_sense_data sense; /* 32 bytes*/ /* * Believe it or not, Some targets fall on the ground with * anything but a certain sense length. */ int req_sense_length; /* Explicit request sense length */ u_int8_t status; /* SCSI status */ struct scsi_generic cmdstore; /* stash the command in here */};/* * Per-request Flag values */#define SCSI_NOSLEEP 0x00001 /* don't sleep */#define SCSI_POLL 0x00002 /* poll for completion */#define SCSI_AUTOCONF 0x00003 /* shorthand for SCSI_POLL | SCSI_NOSLEEP */#define SCSI_USER 0x00004 /* Is a user cmd, call scsi_user_done */#define ITSDONE 0x00008 /* the transfer is as done as it gets */#define SCSI_SILENT 0x00020 /* don't announce NOT READY or MEDIA CHANGE */#define SCSI_IGNORE_NOT_READY 0x00040 /* ignore NOT READY */#define SCSI_IGNORE_MEDIA_CHANGE 0x00080 /* ignore MEDIA CHANGE */#define SCSI_IGNORE_ILLEGAL_REQUEST 0x00100 /* ignore ILLEGAL REQUEST */#define SCSI_RESET 0x00200 /* Reset the device in question */#define SCSI_DATA_UIO 0x00400 /* The data address refers to a UIO */#define SCSI_DATA_IN 0x00800 /* expect data to come INTO memory */#define SCSI_DATA_OUT 0x01000 /* expect data to flow OUT of memory */#define SCSI_TARGET 0x02000 /* This defines a TARGET mode op. */#define SCSI_ESCAPE 0x04000 /* Escape operation */#define SCSI_URGENT 0x08000 /* Urgent operation (e.g., HTAG) */#define SCSI_PRIVATE 0xf0000 /* private to each HBA flags *//* * Escape op codes. This provides an extensible setup for operations * that are not scsi commands. They are intended for modal operations. */#define SCSI_OP_TARGET 0x0001#define SCSI_OP_RESET 0x0002#define SCSI_OP_BDINFO 0x0003/* * Error values an adapter driver may return */#define XS_NOERROR 0 /* there is no error, (sense is invalid) */#define XS_SENSE 1 /* Check the returned sense for the error */#define XS_DRIVER_STUFFUP 2 /* Driver failed to perform operation */#define XS_SELTIMEOUT 3 /* The device timed out.. turned off? */#define XS_TIMEOUT 4 /* The Timeout reported was caught by SW */#define XS_BUSY 5 /* The device busy, try again later? */#define XS_SHORTSENSE 6 /* Check the ATAPI sense for the error */#define XS_RESET 8 /* bus was reset; possible retry command */caddr_t scsi_inqmatch __P((struct scsi_inquiry_data *, caddr_t, int, int, int *));void scsi_init __P((void));struct scsi_xfer * scsi_get_xs __P((struct scsi_link *, int));void scsi_free_xs __P((struct scsi_xfer *, int));int scsi_execute_xs __P((struct scsi_xfer *));u_long scsi_size __P((struct scsi_link *, int));int scsi_test_unit_ready __P((struct scsi_link *, int));int scsi_change_def __P((struct scsi_link *, int));int scsi_inquire __P((struct scsi_link *, struct scsi_inquiry_data *, int));int scsi_prevent __P((struct scsi_link *, int, int));int scsi_start __P((struct scsi_link *, int, int));void scsi_done __P((struct scsi_xfer *));void scsi_user_done __P((struct scsi_xfer *));int scsi_scsi_cmd __P((struct scsi_link *, struct scsi_generic *, int cmdlen, u_char *data_addr, int datalen, int retries, int timeout, struct buf *bp, int flags));int scsi_do_ioctl __P((struct scsi_link *, dev_t, u_long, caddr_t, int, struct proc *));int scsi_do_safeioctl __P((struct scsi_link *, dev_t, u_long, caddr_t, int, struct proc *));void sc_print_addr __P((struct scsi_link *));void show_scsi_xs __P((struct scsi_xfer *));void scsi_print_sense __P((struct scsi_xfer *, int));void show_scsi_cmd __P((struct scsi_xfer *));void show_mem __P((u_char *, int));int scsi_probe_busses __P((int, int, int));void scsi_strvis __P((u_char *, u_char *, int));static __inline void _lto2b __P((u_int32_t val, u_int8_t *bytes));static __inline void _lto3b __P((u_int32_t val, u_int8_t *bytes));static __inline void _lto4b __P((u_int32_t val, u_int8_t *bytes));static __inline u_int32_t _2btol __P((u_int8_t *bytes));static __inline u_int32_t _3btol __P((u_int8_t *bytes));static __inline u_int32_t _4btol __P((u_int8_t *bytes));static __inline void _lto2l __P((u_int32_t val, u_int8_t *bytes));static __inline void _lto3l __P((u_int32_t val, u_int8_t *bytes));static __inline void _lto4l __P((u_int32_t val, u_int8_t *bytes));static __inline u_int32_t _2ltol __P((u_int8_t *bytes));static __inline u_int32_t _3ltol __P((u_int8_t *bytes));static __inline u_int32_t _4ltol __P((u_int8_t *bytes));static __inline void_lto2b(val, bytes) u_int32_t val; u_int8_t *bytes;{ bytes[0] = (val >> 8) & 0xff; bytes[1] = val & 0xff;}static __inline void_lto3b(val, bytes) u_int32_t val; u_int8_t *bytes;{ bytes[0] = (val >> 16) & 0xff; bytes[1] = (val >> 8) & 0xff; bytes[2] = val & 0xff;}static __inline void_lto4b(val, bytes) u_int32_t val; u_int8_t *bytes;{ bytes[0] = (val >> 24) & 0xff; bytes[1] = (val >> 16) & 0xff; bytes[2] = (val >> 8) & 0xff; bytes[3] = val & 0xff;}static __inline u_int32_t_2btol(bytes) u_int8_t *bytes;{ register u_int32_t rv; rv = (bytes[0] << 8) | bytes[1]; return (rv);}static __inline u_int32_t_3btol(bytes) u_int8_t *bytes;{ register u_int32_t rv; rv = (bytes[0] << 16) | (bytes[1] << 8) | bytes[2]; return (rv);}static __inline u_int32_t_4btol(bytes) u_int8_t *bytes;{ register u_int32_t rv; rv = (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]; return (rv);}static __inline void_lto2l(val, bytes) u_int32_t val; u_int8_t *bytes;{ bytes[0] = val & 0xff; bytes[1] = (val >> 8) & 0xff;}static __inline void_lto3l(val, bytes) u_int32_t val; u_int8_t *bytes;{ bytes[0] = val & 0xff; bytes[1] = (val >> 8) & 0xff; bytes[2] = (val >> 16) & 0xff;}static __inline void_lto4l(val, bytes) u_int32_t val; u_int8_t *bytes;{ bytes[0] = val & 0xff; bytes[1] = (val >> 8) & 0xff; bytes[2] = (val >> 16) & 0xff; bytes[3] = (val >> 24) & 0xff;}static __inline u_int32_t_2ltol(bytes) u_int8_t *bytes;{ register u_int32_t rv; rv = bytes[0] | (bytes[1] << 8); return (rv);}static __inline u_int32_t_3ltol(bytes) u_int8_t *bytes;{ register u_int32_t rv; rv = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16); return (rv);}static __inline u_int32_t_4ltol(bytes) u_int8_t *bytes;{ register u_int32_t rv; rv = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24); return (rv);}#endif /* SCSI_SCSICONF_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -