emlxs_menlo.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 Emulex. All rights reserved.
* Use is subject to License terms.
*/
#ifndef _EMLXS_MENLO_H
#define _EMLXS_MENLO_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef MENLO_SUPPORT
/*
* COMMANDS
*/
typedef struct menlo_init_cmd {
typedef struct menlo_fw_download_cmd {
/* aligned) */
#define MENLO_IMAGE_TYPE_OP 1
#define MENLO_IMAGE_TYPE_DIAG 2
/* Followed by length bytes of firmware image */
/* Firmware image will be in Little Endian format */
typedef struct menlo_memory_cmd {
typedef struct menlo_fte_insert_cmd {
#define MENLO_SRC_MASK_FALSE 0
#define MENLO_SRC_MASK_TRUE 1
typedef struct menlo_fte_delete_cmd {
typedef struct menlo_get_cmd {
/* MENLO_CMD_GET_PORT_STATS */
#define MENLO_PORT_ETH0 0
#define MENLO_PORT_ETH1 1
#define MENLO_PORT_NSL0 2
#define MENLO_PORT_NSL1 3
#define MENLO_PORT_FC0 4
#define MENLO_PORT_FC1 5
/* MENLO_CMD_GET_LIF_STATS */
#define MENLO_LIF_ETH0 0
#define MENLO_LIF_ETH1 1
#define MENLO_LIF_FC0 2
#define MENLO_LIF_FC1 3
/* MENLO_CMD_GET_LB_MODE */
#define MENLO_NSL_PORT_ID_0 0
#define MENLO_NSL_PORT_ID_1 1
typedef struct menlo_set_cmd {
/* MENLO_CMD_SET_PAUSE values */
#define MENLO_PAUSE_TYPE_SP 1
#define MENLO_PAUSE_TYPE_PPP 2
/* PPP Priority bits: [ ][ ][ ][ ][X][ ][ ][ ] */
/* COS: 7 6 5 4 3 2 1 0 */
#define MENLO_PPP_COS0 0x01
#define MENLO_PPP_COS1 0x02
#define MENLO_PPP_COS2 0x04
#define MENLO_PPP_COS3 0x08
#define MENLO_PPP_COS4 0x10
#define MENLO_PPP_COS5 0x20
#define MENLO_PPP_COS6 0x40
#define MENLO_PPP_COS7 0x80
/* MENLO_CMD_SET_FCOE_COS values */
#define MENLO_FCOE_COS 3
/* MENLO_CMD_SET_UIF_PORT_TYPE values */
#define MENLO_PORT_TYPE_ACCESS 1
#define MENLO_PORT_TYPE_TRUNK 2
/* MENLO_CMD_SET_MODE values */
#define MENLO_MAINTENANCE_MODE_DISABLE 0
#define MENLO_MAINTENANCE_MODE_ENABLE 1
typedef struct menlo_loopback_cmd {
#define MENLO_NSL_PORT_ID_0 0
#define MENLO_NSL_PORT_ID_1 1
#define MENLO_LOOPBACK_DISABLE 0
#define MENLO_LOOPBACK_ENABLE 1
typedef struct menlo_reset_cmd {
#define MENLO_FW_OPERATIONAL 0
#define MENLO_FW_GOLDEN 1
typedef struct menlo_fru_data_cmd {
/* Valid flags */
#define MENLO_FLAG_SINGLE_CHANNEL 0x00000001
#define MENLO_FLAG_DUAL_CHANNEL 0x00000002
typedef struct menlo_diag_cmd {
/* loop_count > 0 indicates number of test iterations */
/* NOTE : one test iteration takes approximately 2-3 seconds */
/* performed */
/*
* test_bitmap = 0 will result in a MENLO_ERR_INVALID_FLAG
* error
*/
typedef union menlo_cmd {
/* Command codes */
#define MENLO_CMD_INITIALIZE 0x00000001
#define MENLO_CMD_FW_DOWNLOAD 0x00000002
#define MENLO_CMD_READ_MEMORY 0x00000003
#define MENLO_CMD_WRITE_MEMORY 0x00000004
#define MENLO_CMD_FTE_INSERT 0x00000005
#define MENLO_CMD_FTE_DELETE 0x00000006
#define MENLO_CMD_GET_INIT 0x00000007
#define MENLO_CMD_GET_CONFIG 0x00000008
#define MENLO_CMD_GET_PORT_STATS 0x00000009
#define MENLO_CMD_GET_LIF_STATS 0x0000000A
#define MENLO_CMD_GET_ASIC_STATS 0x0000000B
#define MENLO_CMD_GET_LOG_CONFIG 0x0000000C
#define MENLO_CMD_GET_LOG_DATA 0x0000000D
#define MENLO_CMD_GET_PANIC_LOG 0x0000000E
#define MENLO_CMD_GET_LB_MODE 0x0000000F
#define MENLO_CMD_SET_PAUSE 0x00000010
#define MENLO_CMD_SET_FCOE_COS 0x00000011
#define MENLO_CMD_SET_UIF_PORT_TYPE 0x00000012
#define MENLO_CMD_DIAGNOSTICS 0x00000013
#define MENLO_CMD_LOOPBACK 0x00000014
#define MENLO_CMD_GET_FTABLE 0x00000015
#define MENLO_CMD_GET_SFP_DATA 0x00000016
#define MENLO_CMD_SET_FRU_DATA 0x00000017
#define MENLO_CMD_GET_FRU_DATA 0x00000018
#define MENLO_CMD_SET_FCOE_FORMAT 0x00000019
#define MENLO_CMD_GET_DIAG_LOG 0x00000020
#define MENLO_CMD_PANIC 0x00000021
/* Zephyr specific Menlo commands */
#define MENLO_CMD_RESET 0x80000001
#define MENLO_CMD_SET_MODE 0x80000002
} menlo_cmd_t;
/*
* RESPONSES
*/
typedef struct menlo_init_rsp {
#define MENLO_RESET_STATUS_NORMAL 0
#define MENLO_RESET_STATUS_PANIC 1
#define MENLO_MAINTENANCE_MODE_DISABLE 0
#define MENLO_MAINTENANCE_MODE_ENABLE 1
#define MENLO_FW_TYPE_OPERATIONAL 0xABCD0001
#define MENLO_FW_TYPE_GOLDEN 0xABCD0002
#define MENLO_FW_TYPE_DIAG 0xABCD0003
#define MENLO_MAX_FC_PORTS 2
#define MENLO_MAX_UIF_PORTS 2
typedef struct menlo_get_config_rsp {
/* MENLO_CMD_GET_LOG_CONFIG */
/* for MENLO_CMD_GET_PANIC_LOG */
/* below) */
/* (See below) */
/* set (See below) */
#define FCOE_FRAME_FORMAT_T1 0x00000002
#define FCOE_FRAME_FORMAT_T2 0x00000004
#define FCOE_FRAME_FORMAT_T3 0x00000008
#define FCOE_FRAME_FORMAT_T4 0x00000010
#define FCOE_FRAME_FORMAT_T5 0x00000020
#define FCOE_FRAME_FORMAT_T6 0x00000040
#define FCOE_FRAME_FORMAT_T7 0x00000080
#define FCOE_FRAME_FORMAT_T8 0x00000100
#define FCOE_FRAME_FORMAT_T9 0x00000200
#define FCOE_FRAME_FORMAT_T10 0x00000400
#define FCOE_FRAME_FORMAT_T11 0x00000800
#define FCOE_FRAME_FORMAT_T12 0x00001000
#define FCOE_FRAME_FORMAT_T13 0x00002000
#define FCOE_FRAME_FORMAT_T14 0x00004000
#define FCOE_FRAME_FORMAT_T15 0x00008000
typedef struct menlo_fc_stats_rsp {
typedef struct menlo_network_stats_rsp {
typedef struct menlo_lif_stats_rsp {
typedef struct menlo_asic_stats_rsp {
#define MENLO_LOG_NAME_SIZE 20
typedef struct menlo_log {
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
char name[MENLO_LOG_NAME_SIZE];
} menlo_log_t;
typedef struct menlo_log_config_rsp {
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
typedef struct menlo_log_data_rsp {
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
/* [menlo_log_t.entry_size] */
#define MENLO_NUM_GP_REGS 32
typedef struct menlo_panic_log_data_rsp {
#define MENLO_PANIC_TYPE_SOLICITED 0xdead0001
#define MENLO_PANIC_TYPE_EXCEPTION 0xdead0002
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
typedef struct menlo_lb_mode_rsp {
#define MENLO_MAX_FTABLE_ENTRIES 256
typedef struct menlo_fte {
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
} menlo_fte_t;
typedef struct menlo_ftable_rsp {
#define MENLO_SFP_PAGE_SIZE 256
typedef struct menlo_sfp_rsp {
typedef struct menlo_fru_data_rsp {
typedef struct menlo_diag_log_data_rsp {
/* (bytes) */
typedef struct menlo_diag_log {
/* menlo_diag_log_entry_t.data array */
/* requested */
/* completed */
#define DIAG_TEST_STATUS_SUCCESS 0xD0000001
#define DIAG_TEST_STATUS_FAIL 0xD0000002
#define DIAG_TEST_STATUS_ABORT 0xD0000003
typedef struct menlo_diag_log_entry {
/* above */
typedef union menlo_rsp {
/* Response codes */
#define MENLO_RSP_SUCCESS 0x00000000
#define MENLO_ERR_FAILED 0x00000001
#define MENLO_ERR_INVALID_CMD 0x00000002
#define MENLO_ERR_INVALID_CREDIT 0x00000003
#define MENLO_ERR_INVALID_SIZE 0x00000004
#define MENLO_ERR_INVALID_ADDRESS 0x00000005
#define MENLO_ERR_INVALID_CONTEXT 0x00000006
#define MENLO_ERR_INVALID_LENGTH 0x00000007
#define MENLO_ERR_INVALID_TYPE 0x00000008
#define MENLO_ERR_INVALID_DATA 0x00000009
#define MENLO_ERR_INVALID_VALUE1 0x0000000A
#define MENLO_ERR_INVALID_VALUE2 0x0000000B
#define MENLO_ERR_INVALID_MASK 0x0000000C
#define MENLO_ERR_CHECKSUM 0x0000000D
#define MENLO_ERR_UNKNOWN_FCID 0x0000000E
#define MENLO_ERR_UNKNOWN_WWN 0x0000000F
#define MENLO_ERR_BUSY 0x00000010
#define MENLO_ERR_INVALID_FLAG 0x00000011
#define MENLO_ERR_SFP_ABSENT 0x00000012
} menlo_rsp_t;
/*
* FIRMWARE IMAGE
*/
typedef struct menlo_image_hdr {
/* The version header structure needs to be a multiple of 4 bytes */
typedef struct menlo_version_hdr {
/* Type */
#define MENLO_IMAGE_TYPE_FIRMWARE 1
#define MENLO_IMAGE_TYPE_DIAGNOSTICS 2
/* end */
#endif /* MENLO_SUPPORT */
#ifdef __cplusplus
}
#endif
#endif /* _EMLXS_MENLO_H */