/*
* 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 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _HDRS_HERMON_IB_H
#define _HDRS_HERMON_IB_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* ConnectX (hermon) specific definitions.
*/
/*
* The reference for the definitions in this file is the
*
* Mellanox HCA Flash Programming Application Note
* (Mellanox document number 2205AN)
* rev 1.45, 2007. Chapter 4 in particular.
*/
#include "MELLANOX.h"
/*
* Image Info section: Refer Mellanox App note 1.45, Section 4.4
*
* The Image Info section contains management information about the
* firmware image. It consists of a series of consecutive data tags.
* Each tag contains a 32-bit header, providing a TagID which indicates
* the data type, and the size of the data in the tag.
*/
enum tag_ids {
/* 0x9 - 0xFE are reserved */
};
enum tag_sizes {
CNX_END_TAG_SZ = 0
};
/*
* Image Info Format revision (TagID - CNX_IMAGE_INFO_REV).
* Provides the format revision of the Image Info section. Currently it is 0x1
*/
/*
* Firmware Version (TagID - CNX_FW_VER)
* Provides the major, minor and sub-minor versions of the firmware image.
*/
typedef struct cnx_fw_rev_s {
} cnx_fw_rev_t;
/*
* Firmware Build Time (TagID - CNX_FW_BUILD_TIME)
* Provides the data and time of the firmware image build.
*/
typedef struct cnx_fw_build_time_tag {
/*
* Device Type (TagID - CNX_DEV_TYPE)
* The device type tag is only 4 bytes long, so we don't bother to
* declare a separate struct for it.
*
* The CNX_MASK_DEV_TYPE_REV provides the mask to extract the hardware
* device's PCI Revision ID.
* The CNX_MASK_DEV_TYPE_ID provides the mask to extract the hardware
* device's PCI Device ID.
*/
/*
* The PSID (TagID - CNX_PSID) and VSD (TagID - CNX_VSD) tag contents are
* just bytes without any specific structure, so we'll declare their sizes
* but nothing else.
*/
/*
* VSD Vendor ID (TagID - CNX_VSD_VENDOR_ID)
* The VSD Vendor ID tag holds the PCISIG vendor ID of the vendor that
* fills the VSD tag.
*/
typedef struct cnx_img_info_s {
/*
* ConnectX Devices Firmware Image Format
*/
0x4D544657,
0x8CDFD000,
0xDEAD9270,
0x4154BEEF };
/*
* ConnectX Devices GUID Section Structure.
*
* Of all the structures we poke around with, we're packing
* these because we frequently have to operate on them as
* plain old byte arrays. If we don't pack it then the compiler
* will "properly" align it for us - which results in a
* structure that's a l l s p r e a d o u t.
*/
#pragma pack(1)
/* 0x32 - 0x37 - Port1 MAC [47:0] */
/* 0x3A - 0x3F - Port2 MAC [47:0] */
#pragma pack()
/* we hook this struct into vpr->encap_ident */
typedef struct ib_cnx_encap_ident_s {
/* Used during write for validation */
/*
* Common Flash Interface data.
*/
typedef union cfi_u {
} cfi_t;
/* used by both identify and verifier plugin */
int is_image);
/* Validate the handle */
#define CNX_I_CHECK_HANDLE(s) \
#ifdef __cplusplus
}
#endif
#endif /* _HDRS_HERMON_IB_H */