📄 qla2x00.h
字号:
#ifdef ISP2200#define GP_IDNN_LENGTH (256 * sizeof(port_data_t)) + 16#else#define GP_IDNN_LENGTH (126 * sizeof(port_data_t)) + 16#endiftypedef union{ struct { uint16_t buffer_length; uint16_t reserved; uint32_t buffer_address[2]; uint16_t subcommand_length; uint16_t reserved_1; uint16_t subcommand; uint16_t length; uint32_t reserved2; uint32_t protocol; uint8_t param[GP_IDNN_LENGTH - 28]; }req; struct { uint8_t revision; uint8_t inid[3]; uint8_t fcstype; uint8_t subtype; uint8_t options; uint8_t reserved; uint16_t response; uint16_t residual; uint8_t reserved1; uint8_t reason_code; uint8_t explanation_code; uint8_t vendor_unique;#ifdef ISP2200 port_data_t port_data[256];#else port_data_t port_data[126];#endif }rsp;}gp_idnn_t;#ifdef ISP2200#define GN_LIST_LENGTH 256 * sizeof(port_list_entry_t)#else#define GN_LIST_LENGTH 126 * sizeof(port_list_entry_t)#endif/* * Structure used in Get Port List mailbox command (0x75). */typedef struct{ uint8_t name[8]; uint16_t loop_id;}port_list_entry_t;/* * Driver Device Database structure. */typedef struct{ uint32_t ls_name; uint32_t ms_name; uint32_t ls_wwn; uint32_t ms_wwn; uint16_t loop_id; uint8_t port_id[3];}device_data_t;/* * Port Database structure definition * Little endian except where noted. */#define PORT_DATABASE_SIZE 128 /* bytes */typedef struct { uint8_t options; uint8_t control; uint8_t master_state; uint8_t slave_state;#define PD_STATE_DISCOVERY 0#define PD_STATE_WAIT_DISCOVERY_ACK 1#define PD_STATE_PORT_LOGIN 2#define PD_STATE_WAIT_PORT_LOGIN_ACK 3#define PD_STATE_PROCESS_LOGIN 4#define PD_STATE_WAIT_PROCESS_LOGIN_ACK 5#define PD_STATE_PORT_LOGGED_IN 6#define PD_STATE_PORT_UNAVAILABLE 7#define PD_STATE_PROCESS_LOGOUT 8#define PD_STATE_WAIT_PROCESS_LOGOUT_ACK 9#define PD_STATE_PORT_LOGOUT 10#define PD_STATE_WAIT_PORT_LOGOUT_ACK 11 uint8_t reserved[2]; uint8_t hard_address; uint8_t reserved_1; uint8_t port_id[4]; uint8_t node_name[8]; /* Big endian. */ uint8_t port_name[8]; /* Big endian. */ uint16_t execution_throttle; uint16_t execution_count; uint8_t reset_count; uint8_t reserved_2; uint16_t resource_allocation; uint16_t current_allocation; uint16_t queue_head; uint16_t queue_tail; uint16_t transmit_execution_list_next; uint16_t transmit_execution_list_previous; uint16_t common_features; uint16_t total_concurrent_sequences; uint16_t RO_by_information_category; uint8_t recipient; uint8_t initiator; uint16_t receive_data_size; uint16_t concurrent_sequences; uint16_t open_sequences_per_exchange; uint16_t lun_abort_flags; uint16_t lun_stop_flags; uint16_t stop_queue_head; uint16_t stop_queue_tail; uint16_t port_retry_timer; uint16_t next_sequence_id; uint16_t frame_count; uint16_t PRLI_payload_length; uint8_t prli_svc_param_word_0[2]; /* Big endian */ /* Bits 15-0 of word 0 */ uint8_t prli_svc_param_word_3[2]; /* Big endian */ /* Bits 15-0 of word 3 */ uint16_t loop_id; uint16_t extended_lun_info_list_pointer; uint16_t extended_lun_stop_list_pointer;} port_database_t;/* * Registered State Change Notification structures. */typedef struct { port_id_t d_id; uint8_t format;} rscn_t;#ifdef FC_IP_SUPPORT/* * Definitions for IP support */#define LOOP_ID_MASK 0x00FF#define PLE_NOT_SCSI_DEVICE 0x8000 /* Upper bit of loop ID set if not SCSI *//* Firmware IP initialization control block definitions */typedef struct _IPInitBlock{ uint8_t cVersion; uint8_t cReserved1; uint16_t wIpFirmwareOptions; uint16_t wIpHeaderSize; uint16_t wIpMTUSize; uint16_t wIpBufferSize; uint16_t wReserved2; uint16_t wReserved3; uint16_t wReserved4; uint16_t wReserved5; uint16_t wIpQueueSize; uint16_t wIpLowWaterMark; uint16_t wIpQueueAddr[4]; uint16_t wIpQueueInPointer; uint16_t wIpFastPostCount; uint16_t wIpBufferContainerCount; uint16_t wIpIocbResourceAllocation;} IP_INIT_BLOCK, *PIP_INIT_BLOCK;#define IPIB_VERSION 0x01#define IPIB_LOW_WATER_MARK 0#define IPIB_FAST_POST_COUNT 4#define IPIB_BUFFER_CONTAINER_COUNT 64#define IPIB_IOCB_RESERVE_COUNT 250/* IP firmware options */#define IPIB_OPTION_64BIT_ADDRESSING 0x0001#define IPIB_OPTION_NO_BROADCAST_FASTPOST 0x0002#define IPIB_OPTION_OUT_OF_BUFFERS_EVENT 0x0004/* IP device data structure */typedef struct _IpDeviceBlock{ uint32_t lDeviceFlags; uint16_t wLoopId; uint16_t wUnused1; uint8_t acWorldWideName[8]; uint8_t acPortId[3]; uint8_t cUnused2; struct _IpDeviceBlock *pNextIpDevice; struct _IpDeviceBlock *pLastIpDevice; uint32_t lUnused3;} IP_DEVICE_BLOCK, *PIP_DEVICE_BLOCK;#define IP_DEV_FLAG_PRESENT 0x00000001 #define IP_DEV_FLAG_PUBLIC_DEVICE 0x00000002#define PUBLIC_LOOP_DEVICE ((uint16_t)-1)/* Maximum number of IP connections */#define QLLAN_MAX_IP_DEVICES 64/* IP IOCB types */#define ET_IP_COMMAND_32 0x13#define ET_IP_COMMAND_64 0x1B#define ET_IP_RECEIVE 0x23#define ET_IP_RECEIVE_CONTINUATION 0x2B#define ET_IP_FARP_REQUEST 0x30/* Data segment descriptor structures */typedef struct{ uint32_t lBase; uint32_t lCount;} DATA_SEG;typedef struct{ uint32_t lBase[2]; uint32_t lCount;} DATA_SEG_A64;/* IP Command IOCB structure */typedef struct _IpCommandEntry{ uint32_t lHeader; uint32_t lHandle; uint8_t cReserved1; uint8_t cLoopId; uint16_t wCompletionStatus; uint16_t wControlFlags; uint16_t wReserved2; uint16_t wTimeout; uint16_t wSegmentCount; uint16_t wServiceClass; uint16_t wReserved3[7]; uint32_t lTotalByteCount; union { DATA_SEG asDataSeg[3]; DATA_SEG_A64 asDataSeg64[2]; } ds;} IP_COMMAND_ENTRY, *PIP_COMMAND_ENTRY;/* IP Receive IOCB structure */#define IP_RECEIVE_ENTRY_MAX_HANDLES 24typedef struct _IpReceiveEntry{ uint8_t cEntryType; uint8_t cEntryCount; uint8_t cSegmentCount; uint8_t cEntryStatus; uint16_t wS_IDLow; uint8_t cS_IDHigh; uint8_t cReserved1; uint8_t cReserved2; uint8_t cLoopId; uint16_t wCompletionStatus; uint16_t wServiceClass; uint16_t wSequenseLength; uint16_t waBufferHandle[IP_RECEIVE_ENTRY_MAX_HANDLES];} IP_RECEIVE_ENTRY, *PIP_RECEIVE_ENTRY;/* IP Receive IOCB completion status bits */#define IP_REC_STATUS_SPLIT_BUFFER 0x0001/* IP FARP Request IOCB structure */typedef struct _IpFarpRequestEntry{ uint8_t cEntryType; uint8_t cEntryCount; uint8_t cReserved1; uint8_t cEntryStatus; uint16_t wRequesterPortIdLow; uint8_t cRequesterPortIdHigh; uint8_t cReserved2; uint8_t acRequesterPortName[8];} IP_FARP_REQUEST_ENTRY, *PIP_FARP_REQUEST_ENTRY;/* IP mailbox commands */#define MBC_INITIALIZE_IP 0x0077#define MBC_SEND_FARP_REQUEST 0x0078/* Fabric login mailbox command option bits */#define MBC_NO_PLOGI_IF_LOGGED_IN 0x01#define MBC_NO_PROCESS_LOGIN 0x02/* Mailbox command completion status */#define MBS_PORT_ID_IN_USE 0x4007#define MBS_LOOP_ID_IN_USE 0x4008#define MBS_ALL_LOOP_IDS_IN_USE 0x4009#define MBS_NAME_SERVER_NOT_LOGGED_IN 0x400A/* IP async events */#define MBA_IP_TRANSMIT_COMPLETE 0x8022#define MBA_IP_RECEIVE_COMPLETE 0x8023#define MBA_IP_BROADCAST_RECEIVED 0x8024#define MBA_IP_RECEIVE_BUFFERS_LOW 0x8025#define MBA_IP_OUT_OF_BUFFERS 0x8026#define MBA_IP_RECEIVE_COMPLETE_SPLIT 0x8027/* FARP request payload structure */typedef struct _IpSendFarpPayload{ uint8_t cMatchAddressCode; uint8_t acReserved1[3]; uint8_t cResponderFlags; uint8_t acReserved2[3]; uint8_t acRequesterPortName[8]; uint8_t acRequesterNodeName[8]; uint8_t acResponderPortName[8]; uint8_t acResponderNodeName[8];} IP_SEND_FARP_PAYLOAD, *PIP_SEND_FARP_PAYLOAD;#define IP_FARP_MATCH_PORTNAME 0x01#define IP_FARP_REQUEST_LOGIN 0x01#endif /* FC_IP_SUPPORT *//* * Linux Host Adapter structure */typedef struct scsi_qla_host{ /* ISP ring lock, rings, and indexes */ request_t req[REQUEST_ENTRY_CNT+1]; response_t res[RESPONSE_ENTRY_CNT+1]; /* Linux adapter configuration data */ struct Scsi_Host *host; /* pointer to host data */ struct scsi_qla_host *next; device_reg_t *iobase; /* Base Memory-mapped I/O address */#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95) struct pci_dev *pdev;#endif uint8_t pci_bus; uint8_t pci_device_fn; uint8_t devnum; volatile unsigned char *mmpbase; /* memory mapped address */ unsigned long host_no; unsigned long instance; uint8_t revision; uint8_t ports; unsigned long actthreads; unsigned long qthreads; unsigned long isr_count; /* Interrupt count */ unsigned long spurious_int; uint32_t device_id; /* ISP connection configuration data */ uint16_t max_public_loop_ids; uint16_t min_external_loopid; /* First external loop Id */ uint8_t current_topology; /* Current ISP configuration */ uint8_t prev_topology; /* Previous ISP configuration */ #define ISP_CFG_NL 1 #define ISP_CFG_N 2 #define ISP_CFG_FL 4 #define ISP_CFG_F 8 uint8_t id; /* Host adapter SCSI id */ uint16_t loop_id; /* Host adapter loop id */ uint8_t port_id[3]; /* Host adapter port id */ uint8_t operating_mode; /* current F/W operating mode */ /* 0 - LOOP, 1 - P2P, 2 - LOOP_P2P, 3 - P2P_LOOP */ /* NVRAM configuration data */ uint16_t loop_reset_delay; /* Loop reset delay. */ uint16_t hiwat; /* High water mark per device. */ uint16_t execution_throttle; /* queue depth */ uint16_t minimum_timeout; /* Minimum timeout. */ uint8_t retry_count; uint8_t login_timeout; uint8_t port_down_retry_count; uint8_t loop_down_timeout; uint16_t max_luns; uint16_t max_targets; /* Device TGT/LUN queues. */ tgt_t *tgt[MAX_BUSES][MAX_FIBRE_DEVICES]; /* Logical un
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -