-/*
- * Inquiry command structure.
- */
-#define INQ_DATA_SIZE 36
-
-/*
- * Inquiry mailbox IOCB packet definition.
- */
-typedef struct {
- union {
- cmd_a64_entry_t cmd;
- sts_entry_t rsp;
- } p;
- uint8_t inq[INQ_DATA_SIZE];
-} inq_cmd_rsp_t;
-
-/*
- * Report LUN command structure.
- */
-#define CHAR_TO_SHORT(a, b) (uint16_t)((uint8_t)b << 8 | (uint8_t)a)
-
-typedef struct {
- uint32_t len;
- uint32_t rsrv;
-} rpt_hdr_t;
-
-typedef struct {
- struct {
- uint8_t b : 6;
- uint8_t address_method : 2;
- } msb;
- uint8_t lsb;
- uint8_t unused[6];
-} rpt_lun_t;
-
-typedef struct {
- rpt_hdr_t hdr;
- rpt_lun_t lst[MAX_LUNS];
-} rpt_lun_lst_t;
-
-/*
- * Report Lun mailbox IOCB packet definition.
- */
-typedef struct {
- union {
- cmd_a64_entry_t cmd;
- sts_entry_t rsp;
- } p;
- rpt_lun_lst_t list;
-} rpt_lun_cmd_rsp_t;
-
-/*
- * SCSI Target Queue structure
- */
-typedef struct os_tgt {
- struct os_lun *olun[MAX_LUNS]; /* LUN context pointer. */
- struct fc_port *fcport;
- unsigned long flags;
- uint8_t port_down_retry_count;
- uint32_t down_timer;
- struct scsi_qla_host *ha;
-
- /* Persistent binding information */
- port_id_t d_id;
- uint8_t node_name[WWN_SIZE];
- uint8_t port_name[WWN_SIZE];
-} os_tgt_t;
-
-/*
- * SCSI Target Queue flags
- */
-#define TQF_ONLINE 0 /* Device online to OS. */
-#define TQF_SUSPENDED 1
-#define TQF_RETRY_CMDS 2
-
-/*
- * SCSI LUN Queue structure
- */
-typedef struct os_lun {
- struct fc_lun *fclun; /* FC LUN context pointer. */
- spinlock_t q_lock; /* Lun Lock */
-
- unsigned long q_flag;
-#define LUN_MPIO_BUSY 2 /* Lun is changing paths */
-#define LUN_EXEC_DELAYED 7 /* Lun execution is delayed */
-
- u_long q_timeout; /* total command timeouts */
- atomic_t q_timer; /* suspend timer */
- uint32_t q_count; /* current count */
- uint32_t q_max; /* maxmum count lun can be suspended */
- uint8_t q_state; /* lun State */
-#define LUN_STATE_READY 1 /* lun is ready for i/o */
-#define LUN_STATE_RUN 2 /* lun has a timer running */
-#define LUN_STATE_WAIT 3 /* lun is suspended */
-#define LUN_STATE_TIMEOUT 4 /* lun has timed out */
-
- u_long io_cnt; /* total xfer count since boot */
- u_long out_cnt; /* total outstanding IO count */
- u_long w_cnt; /* total writes */
- u_long r_cnt; /* total reads */
- u_long avg_time; /* */
-} os_lun_t;
-
-
-/* LUN BitMask structure definition, array of 32bit words,
- * 1 bit per lun. When bit == 1, the lun is masked.
- * Most significant bit of mask[0] is lun 0, bit 24 is lun 7.
- */
-typedef struct lun_bit_mask {
- /* Must allocate at least enough bits to accomodate all LUNs */
-#if ((MAX_FIBRE_LUNS & 0x7) == 0)
- uint8_t mask[MAX_FIBRE_LUNS >> 3];
-#else
- uint8_t mask[(MAX_FIBRE_LUNS + 8) >> 3];
-#endif
-} lun_bit_mask_t;
-