ql_mbx.h revision 93c20f2609342fd05f6625f16dfcb9348e7977f2
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright 2008 QLogic Corporation */
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _QL_MBX_H
#define _QL_MBX_H
/*
* ISP2xxx Solaris Fibre Channel Adapter (FCA) driver header file.
*
* ***********************************************************************
* * **
* * NOTICE **
* * COPYRIGHT (C) 1996-2008 QLOGIC CORPORATION **
* * ALL RIGHTS RESERVED **
* * **
* ***********************************************************************
*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* ISP mailbox Self-Test status codes
*/
#define MBS_FRM_ALIVE 0 /* Firmware Alive. */
/*
* 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_POST_ERROR 0x4004
#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
#define MBS_LOOP_DOWN 0x400B
#define MBS_LOOP_BACK_ERROR 0x400C
#define MBS_CHECKSUM_ERROR 0x4010
/*
* Sub-error Codes for Mailbox Command Completion Status Code 4005h
*/
#define MBSS_NO_LINK 0x0001
#define MBSS_IOCB_ALLOC_ERR 0x0002
#define MBSS_ECB_ALLOC_ERR 0x0003
#define MBSS_CMD_FAILURE 0x0004
#define MBSS_NO_FABRIC 0x0005
#define MBSS_FIRMWARE_NOT_RDY 0x0007
#define MBSS_INITIATOR_DISABLED 0x0008
#define MBSS_NOT_LOGGED_IN 0x0009
#define MBSS_PARTIAL_DATA_XFER 0x000A
#define MBSS_TOPOLOGY_ERR 0x0016
#define MBSS_CHIP_RESET_NEEDED 0x0017
#define MBSS_MULTIPLE_OPEN_EXCH 0x0018
#define MBSS_IOCB_COUNT_ERR 0x0019
#define MBSS_CMD_AFTER_FW_INIT_ERR 0x001A
/*
* ISP mailbox asynchronous event status codes
*/
/* occurred. */
/* used. */
/* Driver defined. */
/*
* Mailbox 23 event codes
*/
#define MBX23_MBX_OR_ASYNC_EVENT 0x0
#define MBX23_RESPONSE_QUEUE_UPDATE 0x1
#define MBX23_SCSI_COMPLETION 0x2
/*
* Menlo alert event defines
*/
#define MLA_PANIC_RECOVERY 0x1
#define MLA_LOGIN_OPERATIONAL_FW 0x2
#define MLA_LOGIN_DIAGNOSTIC_FW 0x3
#define MLA_LOGIN_GOLDEN_FW 0x4
#define MLA_REJECT_RESPONSE 0x5
/*
* ISP mailbox commands
*/
/* Private Data Counts */
/*
* Mbc 20h (Get ID) returns the switch capabilities in mailbox7.
* The extra bits were added with 4.00.28 MID firmware.
*/
#define FLOGI_SEQ_DEL BIT_8
#define FLOGI_VSAN_SUPPORT BIT_12
#define FLOGI_SP_SUPPORT BIT_13
/*
* Driver Mailbox command definitions.
*/
/* Mailbox command parameter structure definition. */
typedef struct mbx_cmd {
} mbx_cmd_t;
/* Returned Mailbox registers. */
typedef struct ql_mbx_data {
/* Mailbox bit definitions for out_mb and in_mb */
/*
* 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_SYNC 4
#define FSTATE_ERROR 5
#define FSTATE_NON_PART 7
/*
* 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_GPIO BIT_6
#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_REV_LOOPBACK BIT_1
#define FO2_ENABLE_ATIO_TYPE_3 BIT_0
#define FO3_STARTUP_OPTS_VALID BIT_5
#define FO3_AE_RND_ERROR BIT_1
#define FO3_ENABLE_EMERG_IOCB BIT_0
#define FO13_LESB_NO_RESET BIT_0
/*
* f/w trace options
*/
#define FTO_EXTENABLE 4
#define FTO_EXTDISABLE 5
#define FTO_FCEENABLE 8
#define FTO_FCEDISABLE 9
/*
* fw_attributes defines from firmware version mailbox command
*/
#define FWATTRIB_EF 0x7
#define FWATTRIB_TP 0x17
#define FWATTRIB_IP 0x37
#define FWATTRIB_TPX 0x117
#define FWATTRIB_IPX 0x137
#define FWATTRIB_FL 0x217
#define FWATTRIB_FPX 0x317
/*
* Diagnostic ELS ECHO parameter structure definition.
*/
typedef struct echo {
} echo_t;
/*
* LFA command structure.
*/
#define LFA_PAYLOAD_SIZE 38
typedef struct lfa_cmd {
} lfa_cmd_t;
/*
* Deivce ID list definitions.
*/
struct ql_dev_id {
};
struct ql_ex_dev_id {
};
struct ql_24_dev_id {
};
typedef union ql_dev_id_list {
struct ql_dev_id d;
struct ql_ex_dev_id d_ex;
struct ql_24_dev_id d_24;
/* Define maximum number of device list entries.. */
/* Define size of Loop Position Map. */
/*
* Port Database structure definition
* Little endian except where noted.
*/
typedef struct port_database_23 {
/* Bits 15-0 of word 0 */
/* Bits 15-0 of word 3 */
typedef struct port_database_24 {
/* Bits 15-0 of word 0 */
/* Bits 15-0 of word 3 */
/*
* Port database slave/master/current_login/ast_stable_login 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
#define PD_PORT_LOGIN(tq) \
/*
* ql_login_lport() options
*/
#define LLF_NONE 0
/*
* ql_login_fport() options
*/
#define LFF_NONE 0
#define LFF_NO_PLOGI BIT_0
#define LFF_NO_PRLI BIT_1
/*
* ql_get_port_database() options
*/
#define PDF_NONE 0
/*
* ql_get_adapter_id() returned connection types
*/
#define CNX_LOOP_NO_FABRIC 0
#define CNX_FLPORT_IN_LOOP 1
#define CNX_NPORT_2_NPORT_P2P 2
#define CNX_FLPORT_P2P 3
#define CNX_NPORT_2_NPORT_NO_TGT_RSP 4
/*
* Global Data in ql_mbx.c source file.
*/
/*
* Global Function Prototypes in ql_mbx.c source file.
*/
int ql_initialize_ip(ql_adapter_state_t *);
int ql_shutdown_ip(ql_adapter_state_t *);
int ql_online_selftest(ql_adapter_state_t *);
ql_mbx_data_t *);
ql_mbx_data_t *);
uint8_t);
uint8_t);
int ql_loop_reset(ql_adapter_state_t *);
int ql_initiate_lip(ql_adapter_state_t *);
int ql_full_login_lip(ql_adapter_state_t *);
int ql_verify_checksum(ql_adapter_state_t *);
int ql_execute_fw(ql_adapter_state_t *);
int ql_init_firmware(ql_adapter_state_t *);
uint32_t, ql_mbx_data_t *);
ql_mbx_data_t *);
int ql_stop_firmware(ql_adapter_state_t *);
#ifdef __cplusplus
}
#endif
#endif /* _QL_MBX_H */