📄 qla_def.h
字号:
#define CS_QUEUE_FULL 0x1C /* Queue Full. */#define CS_PORT_UNAVAILABLE 0x28 /* Port unavailable */ /* (selection timeout) */#define CS_PORT_LOGGED_OUT 0x29 /* Port Logged Out */#define CS_PORT_CONFIG_CHG 0x2A /* Port Configuration Changed */#define CS_PORT_BUSY 0x2B /* Port Busy */#define CS_COMPLETE_CHKCOND 0x30 /* Error? */#define CS_BAD_PAYLOAD 0x80 /* Driver defined */#define CS_UNKNOWN 0x81 /* Driver defined */#define CS_RETRY 0x82 /* Driver defined */#define CS_LOOP_DOWN_ABORT 0x83 /* Driver defined *//* * Status entry status flags */#define SF_ABTS_TERMINATED BIT_10#define SF_LOGOUT_SENT BIT_13/* * ISP queue - status continuation entry structure definition. */#define STATUS_CONT_TYPE 0x10 /* Status continuation entry. */typedef struct { uint8_t entry_type; /* Entry type. */ uint8_t entry_count; /* Entry count. */ uint8_t sys_define; /* System defined. */ uint8_t entry_status; /* Entry Status. */ uint8_t data[60]; /* data */} sts_cont_entry_t;/* * ISP queue - RIO Type 1 status entry (32 bit I/O entry handles) * structure definition. */#define STATUS_TYPE_21 0x21 /* Status entry. */typedef struct { uint8_t entry_type; /* Entry type. */ uint8_t entry_count; /* Entry count. */ uint8_t handle_count; /* Handle count. */ uint8_t entry_status; /* Entry Status. */ uint32_t handle[15]; /* System handles. */} sts21_entry_t;/* * ISP queue - RIO Type 2 status entry (16 bit I/O entry handles) * structure definition. */#define STATUS_TYPE_22 0x22 /* Status entry. */typedef struct { uint8_t entry_type; /* Entry type. */ uint8_t entry_count; /* Entry count. */ uint8_t handle_count; /* Handle count. */ uint8_t entry_status; /* Entry Status. */ uint16_t handle[30]; /* System handles. */} sts22_entry_t;/* * ISP queue - marker entry structure definition. */#define MARKER_TYPE 0x04 /* Marker entry. */typedef struct { uint8_t entry_type; /* Entry type. */ uint8_t entry_count; /* Entry count. */ uint8_t handle_count; /* Handle count. */ uint8_t entry_status; /* Entry Status. */ uint32_t sys_define_2; /* System defined. */ target_id_t target; /* SCSI ID */ uint8_t modifier; /* Modifier (7-0). */#define MK_SYNC_ID_LUN 0 /* Synchronize ID/LUN */#define MK_SYNC_ID 1 /* Synchronize ID */#define MK_SYNC_ALL 2 /* Synchronize all ID/LUN */#define MK_SYNC_LIP 3 /* Synchronize all ID/LUN, */ /* clear port changed, */ /* use sequence number. */ uint8_t reserved_1; uint16_t sequence_number; /* Sequence number of event */ uint16_t lun; /* SCSI LUN */ uint8_t reserved_2[48];} mrk_entry_t;/* * ISP queue - Management Server entry structure definition. */#define MS_IOCB_TYPE 0x29 /* Management Server IOCB entry */typedef struct { uint8_t entry_type; /* Entry type. */ uint8_t entry_count; /* Entry count. */ uint8_t handle_count; /* Handle count. */ uint8_t entry_status; /* Entry Status. */ uint32_t handle1; /* System handle. */ target_id_t loop_id; uint16_t status; uint16_t control_flags; /* Control flags. */ uint16_t reserved2; uint16_t timeout; uint16_t cmd_dsd_count; uint16_t total_dsd_count; uint8_t type; uint8_t r_ctl; uint16_t rx_id; uint16_t reserved3; uint32_t handle2; uint32_t rsp_bytecount; uint32_t req_bytecount; uint32_t dseg_req_address[2]; /* Data segment 0 address. */ uint32_t dseg_req_length; /* Data segment 0 length. */ uint32_t dseg_rsp_address[2]; /* Data segment 1 address. */ uint32_t dseg_rsp_length; /* Data segment 1 length. */} ms_iocb_entry_t;/* * ISP queue - Mailbox Command entry structure definition. */#define MBX_IOCB_TYPE 0x39struct mbx_entry { uint8_t entry_type; uint8_t entry_count; uint8_t sys_define1; /* Use sys_define1 for source type */#define SOURCE_SCSI 0x00#define SOURCE_IP 0x01#define SOURCE_VI 0x02#define SOURCE_SCTP 0x03#define SOURCE_MP 0x04#define SOURCE_MPIOCTL 0x05#define SOURCE_ASYNC_IOCB 0x07 uint8_t entry_status; uint32_t handle; target_id_t loop_id; uint16_t status; uint16_t state_flags; uint16_t status_flags; uint32_t sys_define2[2]; uint16_t mb0; uint16_t mb1; uint16_t mb2; uint16_t mb3; uint16_t mb6; uint16_t mb7; uint16_t mb9; uint16_t mb10; uint32_t reserved_2[2]; uint8_t node_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE];};/* * ISP request and response queue entry sizes */#define RESPONSE_ENTRY_SIZE (sizeof(response_t))#define REQUEST_ENTRY_SIZE (sizeof(request_t))/* * 24 bit port ID type definition. */typedef union { uint32_t b24 : 24; struct { uint8_t d_id[3]; uint8_t rsvd_1; } r; struct { uint8_t al_pa; uint8_t area; uint8_t domain; uint8_t rsvd_1; } b;} port_id_t;#define INVALID_PORT_ID 0xFFFFFF/* * Switch info gathering structure. */typedef struct { port_id_t d_id; uint8_t node_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE]; uint32_t type;#define SW_TYPE_IP BIT_1#define SW_TYPE_SCSI BIT_0} sw_info_t;/* * 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_RESET_CNTS 1 /* Lun */#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;/* * Fibre channel port type. */ typedef enum { FCT_UNKNOWN, FCT_RSCN, FCT_SWITCH, FCT_BROADCAST, FCT_INITIATOR, FCT_TARGET} fc_port_type_t;/* * Fibre channel port structure. */typedef struct fc_port { struct list_head list; struct list_head fcluns; struct scsi_qla_host *ha; struct scsi_qla_host *vis_ha; /* only used when suspending lun */ uint8_t node_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE]; port_id_t d_id; uint16_t loop_id; uint16_t old_loop_id; fc_port_type_t port_type; atomic_t state; uint32_t flags; os_tgt_t *tgt_queue; uint16_t os_target_id; uint16_t iodesc_idx_sent; int port_login_retry_count; int login_retry; atomic_t port_down_timer; uint8_t device_type; uint8_t unused; uint8_t mp_byte; /* multi-path byte (not used) */ uint8_t cur_path; /* current path id */ lun_bit_mask_t lun_mask;} fc_port_t;/* * Fibre channel port/lun states. */#define FCS_UNCONFIGURED 1#define FCS_DEVICE_DEAD 2#define FCS_DEVICE_LOST 3#define FCS_ONLINE 4#define FCS_NOT_SUPPORTED 5#define FCS_FAILOVER 6#define FCS_FAILOVER_FAILED 7/* * FC port flags. */#define FCF_FABRIC_DEVICE BIT_0#define FCF_LOGIN_NEEDED BIT_1#define FCF_FO_MASKED BIT_2#define FCF_FAILOVER_NEEDED BIT_3#define FCF_RESET_NEEDED BIT_4#define FCF_PERSISTENT_BOUND BIT_5#define FCF_TAPE_PRESENT BIT_6#define FCF_FARP_DONE BIT_7#define FCF_FARP_FAILED BIT_8#define FCF_FARP_REPLY_NEEDED BIT_9#define FCF_AUTH_REQ BIT_10#define FCF_SEND_AUTH_REQ BIT_11#define FCF_RECEIVE_AUTH_REQ BIT_12#define FCF_AUTH_SUCCESS BIT_13#define FCF_RLC_SUPPORT BIT_14#define FCF_CONFIG BIT_15 /* Needed? */#define FCF_RESCAN_NEEDED BIT_16#define FCF_XP_DEVICE BIT_17#define FCF_MSA_DEVICE BIT_18#define FCF_EVA_DEVICE BIT_19#define FCF_MSA_PORT_ACTIVE BIT_20#define FCF_FAILBACK_DISABLE BIT_21#define FCF_FAILOVER_DISABLE BIT_22#define FCF_DSXXX_DEVICE BIT_23#define FCF_AA_EVA_DEVICE BIT_24/* No loop ID flag. */#define FC_NO_LOOP_ID 0x1000/* * Fibre channel LUN structure. */typedef struct fc_lun { struct list_head list; fc_port_t *fcport; fc_port_t *o_fcport; uint16_t lun; atomic_t state; uint8_t device_type; uint8_t max_path_retries; uint32_t flags;} fc_lun_t;#define FLF_VISIBLE_LUN BIT_0#define FLF_ACTIVE_LUN BIT_1/* * FC-CT interface * * NOTE: All structures are big-endian in form. */#define CT_REJECT_RESPONSE 0x8001#define CT_ACCEPT_RESPONSE 0x8002#define NS_N_PORT_TYPE 0x01#define NS_NL_PORT_TYPE 0x02#define NS_NX_PORT_TYPE 0x7F#define GA_NXT_CMD 0x100#define GA_NXT_REQ_SIZE (16 + 4)#define GA_NXT_RSP_SIZE (16 + 620)#define GID_PT_CMD 0x1A1#define GID_PT_REQ_SIZE (16 + 4)#define GID_PT_RSP_SIZE (16 + (MAX_FIBRE_DEVICES * 4))#define GPN_ID_CMD 0x112#define GPN_ID_REQ_SIZE (16 + 4)#define GPN_ID_RSP_SIZE (16 + 8)#define GNN_ID_CMD 0x113#define GNN_ID_REQ_SIZE (16 + 4)#define GNN_ID_RSP_SIZE (16 + 8)#define GFT_ID_CMD 0x117#define GFT_ID_REQ_SIZE (16 + 4)#define GFT_ID_RSP_SIZE (16 + 32)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -