📄 qla_def.h
字号:
volatile uint16_t mailbox13; volatile uint16_t mailbox14; volatile uint16_t mailbox15; volatile uint16_t mailbox16; volatile uint16_t mailbox17; volatile uint16_t mailbox18; volatile uint16_t mailbox19; volatile uint16_t mailbox20; volatile uint16_t mailbox21; volatile uint16_t mailbox22; volatile uint16_t mailbox23; /* Also probe reg. */ } __attribute__((packed)) isp2200; } u_end;} device_reg_t;#define ISP_REQ_Q_IN(ha, reg) \ (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ &(reg)->u.isp2100.mailbox4 : \ &(reg)->u.isp2300.req_q_in)#define ISP_REQ_Q_OUT(ha, reg) \ (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ &(reg)->u.isp2100.mailbox4 : \ &(reg)->u.isp2300.req_q_out)#define ISP_RSP_Q_IN(ha, reg) \ (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ &(reg)->u.isp2100.mailbox5 : \ &(reg)->u.isp2300.rsp_q_in)#define ISP_RSP_Q_OUT(ha, reg) \ (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ &(reg)->u.isp2100.mailbox5 : \ &(reg)->u.isp2300.rsp_q_out)#define MAILBOX_REG(ha, reg, num) \ (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ (num < 8 ? \ &(reg)->u.isp2100.mailbox0 + (num) : \ &(reg)->u_end.isp2200.mailbox8 + (num) - 8) : \ &(reg)->u.isp2300.mailbox0 + (num))#define RD_MAILBOX_REG(ha, reg, num) \ RD_REG_WORD(MAILBOX_REG(ha, reg, num))#define WRT_MAILBOX_REG(ha, reg, num, data) \ WRT_REG_WORD(MAILBOX_REG(ha, reg, num), data)#define FB_CMD_REG(ha, reg) \ (IS_QLA2100(ha) || IS_QLA2200(ha) ? \ &(reg)->fb_cmd_2100 : \ &(reg)->u.isp2300.fb_cmd)#define RD_FB_CMD_REG(ha, reg) \ RD_REG_WORD(FB_CMD_REG(ha, reg))#define WRT_FB_CMD_REG(ha, reg, data) \ WRT_REG_WORD(FB_CMD_REG(ha, reg), data)typedef struct { uint32_t out_mb; /* outbound from driver */ uint32_t in_mb; /* Incoming from RISC */ uint16_t mb[MAILBOX_REGISTER_COUNT]; long buf_size; void *bufp; uint32_t tov; uint8_t flags;#define MBX_DMA_IN BIT_0#define MBX_DMA_OUT BIT_1#define IOCTL_CMD BIT_2} mbx_cmd_t;#define MBX_TOV_SECONDS 30/* * ISP product identification definitions in mailboxes after reset. */#define PROD_ID_1 0x4953#define PROD_ID_2 0x0000#define PROD_ID_2a 0x5020#define PROD_ID_3 0x2020/* * ISP mailbox Self-Test status codes */#define MBS_FRM_ALIVE 0 /* Firmware Alive. */#define MBS_CHKSUM_ERR 1 /* Checksum Error. */#define MBS_BUSY 4 /* Busy. *//* * ISP mailbox command complete status codes */#define MBS_COMMAND_COMPLETE 0x4000#define MBS_INVALID_COMMAND 0x4001#define MBS_HOST_INTERFACE_ERROR 0x4002#define MBS_TEST_FAILED 0x4003#define MBS_COMMAND_ERROR 0x4005#define MBS_COMMAND_PARAMETER_ERROR 0x4006#define MBS_PORT_ID_USED 0x4007#define MBS_LOOP_ID_USED 0x4008#define MBS_ALL_IDS_IN_USE 0x4009#define MBS_NOT_LOGGED_IN 0x400A/* * ISP mailbox asynchronous event status codes */#define MBA_ASYNC_EVENT 0x8000 /* Asynchronous event. */#define MBA_RESET 0x8001 /* Reset Detected. */#define MBA_SYSTEM_ERR 0x8002 /* System Error. */#define MBA_REQ_TRANSFER_ERR 0x8003 /* Request Transfer Error. */#define MBA_RSP_TRANSFER_ERR 0x8004 /* Response Transfer Error. */#define MBA_WAKEUP_THRES 0x8005 /* Request Queue Wake-up. */#define MBA_LIP_OCCURRED 0x8010 /* Loop Initialization Procedure */ /* occurred. */#define MBA_LOOP_UP 0x8011 /* FC Loop UP. */#define MBA_LOOP_DOWN 0x8012 /* FC Loop Down. */#define MBA_LIP_RESET 0x8013 /* LIP reset occurred. */#define MBA_PORT_UPDATE 0x8014 /* Port Database update. */#define MBA_RSCN_UPDATE 0x8015 /* Register State Chg Notification. */#define MBA_LIP_F8 0x8016 /* Received a LIP F8. */#define MBA_LOOP_INIT_ERR 0x8017 /* Loop Initialization Error. */#define MBA_FABRIC_AUTH_REQ 0x801b /* Fabric Authentication Required. */#define MBA_SCSI_COMPLETION 0x8020 /* SCSI Command Complete. */#define MBA_CTIO_COMPLETION 0x8021 /* CTIO Complete. */#define MBA_IP_COMPLETION 0x8022 /* IP Transmit Command Complete. */#define MBA_IP_RECEIVE 0x8023 /* IP Received. */#define MBA_IP_BROADCAST 0x8024 /* IP Broadcast Received. */#define MBA_IP_LOW_WATER_MARK 0x8025 /* IP Low Water Mark reached. */#define MBA_IP_RCV_BUFFER_EMPTY 0x8026 /* IP receive buffer queue empty. */#define MBA_IP_HDR_DATA_SPLIT 0x8027 /* IP header/data splitting feature */ /* used. */#define MBA_POINT_TO_POINT 0x8030 /* Point to point mode. */#define MBA_CMPLT_1_16BIT 0x8031 /* Completion 1 16bit IOSB. */#define MBA_CMPLT_2_16BIT 0x8032 /* Completion 2 16bit IOSB. */#define MBA_CMPLT_3_16BIT 0x8033 /* Completion 3 16bit IOSB. */#define MBA_CMPLT_4_16BIT 0x8034 /* Completion 4 16bit IOSB. */#define MBA_CMPLT_5_16BIT 0x8035 /* Completion 5 16bit IOSB. */#define MBA_CHG_IN_CONNECTION 0x8036 /* Change in connection mode. */#define MBA_RIO_RESPONSE 0x8040 /* RIO response queue update. */#define MBA_ZIO_RESPONSE 0x8040 /* ZIO response queue update. */#define MBA_CMPLT_2_32BIT 0x8042 /* Completion 2 32bit IOSB. */#define MBA_BYPASS_NOTIFICATION 0x8043 /* Auto bypass notification. */#define MBA_DISCARD_RND_FRAME 0x8048 /* discard RND frame due to error. */#define MBA_REJECTED_FCP_CMD 0x8049 /* rejected FCP_CMD. *//* * Firmware options 1, 2, 3. */#define FO1_AE_ON_LIPF8 BIT_0#define FO1_AE_ALL_LIP_RESET BIT_1#define FO1_CTIO_RETRY BIT_3#define FO1_DISABLE_LIP_F7_SW BIT_4#define FO1_DISABLE_100MS_LOS_WAIT BIT_5#define FO1_DISABLE_GPIO6_7 BIT_6#define FO1_AE_ON_LOOP_INIT_ERR BIT_7#define FO1_SET_EMPHASIS_SWING BIT_8#define FO1_AE_AUTO_BYPASS BIT_9#define FO1_ENABLE_PURE_IOCB BIT_10#define FO1_AE_PLOGI_RJT BIT_11#define FO1_ENABLE_ABORT_SEQUENCE BIT_12#define FO1_AE_QUEUE_FULL BIT_13#define FO2_ENABLE_ATIO_TYPE_3 BIT_0#define FO2_REV_LOOPBACK BIT_1#define FO3_ENABLE_EMERG_IOCB BIT_0#define FO3_AE_RND_ERROR BIT_1/* * ISP mailbox commands */#define MBC_LOAD_RAM 1 /* Load RAM. */#define MBC_EXECUTE_FIRMWARE 2 /* Execute firmware. */#define MBC_WRITE_RAM_WORD 4 /* Write RAM word. */#define MBC_READ_RAM_WORD 5 /* Read RAM word. */#define MBC_MAILBOX_REGISTER_TEST 6 /* Wrap incoming mailboxes */#define MBC_VERIFY_CHECKSUM 7 /* Verify checksum. */#define MBC_GET_FIRMWARE_VERSION 8 /* Get firmware revision. */#define MBC_LOAD_RISC_RAM 9 /* Load RAM command. */#define MBC_DUMP_RISC_RAM 0xa /* Dump RAM command. */#define MBC_LOAD_RISC_RAM_EXTENDED 0xb /* Load RAM extended. */#define MBC_DUMP_RISC_RAM_EXTENDED 0xc /* Dump RAM extended. */#define MBC_WRITE_RAM_WORD_EXTENDED 0xd /* Write RAM word extended */#define MBC_READ_RAM_EXTENDED 0xf /* Read RAM extended. */#define MBC_IOCB_COMMAND 0x12 /* Execute IOCB command. */#define MBC_ABORT_COMMAND 0x15 /* Abort IOCB command. */#define MBC_ABORT_DEVICE 0x16 /* Abort device (ID/LUN). */#define MBC_ABORT_TARGET 0x17 /* Abort target (ID). */#define MBC_RESET 0x18 /* Reset. */#define MBC_GET_ADAPTER_LOOP_ID 0x20 /* Get loop id of ISP2200. */#define MBC_GET_RETRY_COUNT 0x22 /* Get f/w retry cnt/delay. */#define MBC_DISABLE_VI 0x24 /* Disable VI operation. */#define MBC_ENABLE_VI 0x25 /* Enable VI operation. */#define MBC_GET_FIRMWARE_OPTION 0x28 /* Get Firmware Options. */#define MBC_SET_FIRMWARE_OPTION 0x38 /* Set Firmware Options. */#define MBC_LOOP_PORT_BYPASS 0x40 /* Loop Port Bypass. */#define MBC_LOOP_PORT_ENABLE 0x41 /* Loop Port Enable. */#define MBC_GET_RESOURCE_COUNTS 0x42 /* Get Resource Counts. */#define MBC_NON_PARTICIPATE 0x43 /* Non-Participating Mode. */#define MBC_DIAGNOSTIC_ECHO 0x44 /* Diagnostic echo. */#define MBC_DIAGNOSTIC_LOOP_BACK 0x45 /* Diagnostic loop back. */#define MBC_ONLINE_SELF_TEST 0x46 /* Online self-test. */#define MBC_ENHANCED_GET_PORT_DATABASE 0x47 /* Get port database + login */#define MBC_RESET_LINK_STATUS 0x52 /* Reset Link Error Status */#define MBC_IOCB_COMMAND_A64 0x54 /* Execute IOCB command (64) */#define MBC_SEND_RNID_ELS 0x57 /* Send RNID ELS request */#define MBC_SET_RNID_PARAMS 0x59 /* Set RNID parameters */#define MBC_GET_RNID_PARAMS 0x5a /* Data Rate */#define MBC_DATA_RATE 0x5d /* Get RNID parameters */#define MBC_INITIALIZE_FIRMWARE 0x60 /* Initialize firmware */#define MBC_INITIATE_LIP 0x62 /* Initiate Loop */ /* Initialization Procedure */#define MBC_GET_FC_AL_POSITION_MAP 0x63 /* Get FC_AL Position Map. */#define MBC_GET_PORT_DATABASE 0x64 /* Get Port Database. */#define MBC_CLEAR_ACA 0x65 /* Clear ACA. */#define MBC_TARGET_RESET 0x66 /* Target Reset. */#define MBC_CLEAR_TASK_SET 0x67 /* Clear Task Set. */#define MBC_ABORT_TASK_SET 0x68 /* Abort Task Set. */#define MBC_GET_FIRMWARE_STATE 0x69 /* Get firmware state. */#define MBC_GET_PORT_NAME 0x6a /* Get port name. */#define MBC_GET_LINK_STATUS 0x6b /* Get port link status. */#define MBC_LIP_RESET 0x6c /* LIP reset. */#define MBC_SEND_SNS_COMMAND 0x6e /* Send Simple Name Server */ /* commandd. */#define MBC_LOGIN_FABRIC_PORT 0x6f /* Login fabric port. */#define MBC_SEND_CHANGE_REQUEST 0x70 /* Send Change Request. */#define MBC_LOGOUT_FABRIC_PORT 0x71 /* Logout fabric port. */#define MBC_LIP_FULL_LOGIN 0x72 /* Full login LIP. */#define MBC_LOGIN_LOOP_PORT 0x74 /* Login Loop Port. */#define MBC_PORT_NODE_NAME_LIST 0x75 /* Get port/node name list. */#define MBC_INITIALIZE_RECEIVE_QUEUE 0x77 /* Initialize receive queue */#define MBC_UNLOAD_IP 0x79 /* Shutdown IP */#define MBC_GET_ID_LIST 0x7C /* Get Port ID list. */#define MBC_SEND_LFA_COMMAND 0x7D /* Send Loop Fabric Address */#define MBC_LUN_RESET 0x7E /* Send LUN reset *//* Firmware return data sizes */#define FCAL_MAP_SIZE 128/* Mailbox bit definitions for out_mb and in_mb */#define MBX_31 BIT_31#define MBX_30 BIT_30#define MBX_29 BIT_29#define MBX_28 BIT_28#define MBX_27 BIT_27#define MBX_26 BIT_26#define MBX_25 BIT_25#define MBX_24 BIT_24#define MBX_23 BIT_23#define MBX_22 BIT_22#define MBX_21 BIT_21#define MBX_20 BIT_20#define MBX_19 BIT_19#define MBX_18 BIT_18#define MBX_17 BIT_17#define MBX_16 BIT_16#define MBX_15 BIT_15#define MBX_14 BIT_14#define MBX_13 BIT_13#define MBX_12 BIT_12#define MBX_11 BIT_11#define MBX_10 BIT_10#define MBX_9 BIT_9#define MBX_8 BIT_8#define MBX_7 BIT_7#define MBX_6 BIT_6#define MBX_5 BIT_5#define MBX_4 BIT_4#define MBX_3 BIT_3#define MBX_2 BIT_2#define MBX_1 BIT_1#define MBX_0 BIT_0/* * Firmware state codes from get firmware state mailbox command */#define FSTATE_CONFIG_WAIT 0#define FSTATE_WAIT_AL_PA 1#define FSTATE_WAIT_LOGIN 2#define FSTATE_READY 3#define FSTATE_LOSS_OF_SYNC 4#define FSTATE_ERROR 5#define FSTATE_REINIT 6#define FSTATE_NON_PART 7#define FSTATE_CONFIG_CORRECT 0#define FSTATE_P2P_RCV_LIP 1#define FSTATE_P2P_CHOOSE_LOOP 2#define FSTATE_P2P_RCV_UNIDEN_LIP 3#define FSTATE_FATAL_ERROR 4#define FSTATE_LOOP_BACK_CONN 5/* * 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; uint8_t reserved[2]; uint8_t hard_address; uint8_t reserved_1; uint8_t port_id[4]; uint8_t node_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE]; 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;/* * Port database slave/master states */#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/* * ISP Initialization Control Block. * Little endian except where noted. */#define ICB_VERSION 1typedef struct { uint8_t version; uint8_t reserved_1; /* * LSB BIT 0 = Enable Hard Loop Id * LSB BIT 1 = Enable Fairness * LSB BIT 2 = Enable Full-Duplex * LSB BIT 3 = Enable Fast Posting * LSB BIT 4 = Enable Target Mode * LSB BIT 5 = Disable Initiator Mode * LSB BIT 6 = Enable ADISC * LSB BIT 7 = Enable Target Inquiry Data * * MSB BIT 0 = Enable PDBC Notify * MSB BIT 1 = Non Participating LIP * MSB BIT 2 = Descending Loop ID Search * MSB BIT 3 = Acquire Loop ID in LIPA * MSB BIT 4 = Stop PortQ on Full Status * MSB BIT 5 = Full Login after LIP * MSB BIT 6 = Node Name Option * MSB BIT 7 = Ext IFWCB enable bit */ uint8_t firmware_options[2]; uint16_t frame_payload_size; uint16_t max_iocb_allocation; uint16_t execution_throttle; uint8_t retry_count; uint8_t retry_delay; /* unused */ uint8_t port_name[WWN_SIZE]; /* Big endian. */ uint16_t hard_address; uint8_t inquiry_data; uint8_t login_timeout; uint8_t node_name[WWN_SIZE]; /* Big endian. */ uint16_t request_q_outpointer; uint16_t response_q_inpointer; uint16_t request_q_length; uint16_t response_q_length; uint32_t request_q_address[2]; uint32_t response_q_address[2]; uint16_t lun_enables; uint8_t command_resource_count; uint8_t immediate_notify_resource_count; uint16_t timeout; uint8_t reserved_2[2]; /* * LSB BIT 0 = Timer Operation mode bit 0 * LSB BIT 1 = Timer Operation mode bit 1 * LSB BIT 2 = Timer Operation mode bit 2 * LSB BIT 3 = Timer Operation mode bit 3 * LSB BIT 4 = Init Config Mode bit 0 * LSB BIT 5 = Init Config Mode bit 1 * LSB BIT 6 = Init Config Mode bit 2 * LSB BIT 7 = Enable Non part on LIHA failure * * MSB BIT 0 = Enable class 2 * MSB BIT 1 = Enable ACK0 * MSB BIT 2 = * MSB BIT 3 = * MSB BIT 4 = FC Tape Enable * MSB BIT 5 = Enable FC Confirm * MSB BIT 6 = Enable command queuing in target mode * MSB BIT 7 = No Logo On Link Down */ uint8_t add_firmware_options[2]; uint8_t response_accumulation_timer; uint8_t interrupt_delay_timer; /* * LSB BIT 0 = Enable Read xfr_rdy * LSB BIT 1 = Soft ID only * LSB BIT 2 = * LSB BIT 3 = * LSB BIT 4 = FCP RSP Payload [0] * LSB BIT 5 = FCP RSP Payload [1] / Sbus enable - 2200 * LSB BIT 6 = Enable Out-of-Order frame handling * LSB BIT 7 = Disable Automatic PLOGI on Local Loop * * MSB BIT 0 = Sbus enable - 2300 * MSB BIT 1 = * MSB BIT 2 = * MSB BIT 3 = * MSB BIT 4 = * MSB BIT 5 = enable 50 ohm termination * MSB BIT 6 = Data Rate (2300 only) * MSB BIT 7 = Data Rate (2300 only) */ uint8_t special_options[2]; uint8_t reserved_3[26];} init_cb_t;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -