/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_ADAPTERS_TAVOR_IOCTL_H
#define _SYS_IB_ADAPTERS_TAVOR_IOCTL_H
/*
* Contains all of the prototypes, #defines, and structures necessary
* for all ioctl access into the driver. This includes everything
* necessary for updating firmware, accessing the tavor flash device,
* providing interfaces for VTS.
*/
#ifdef __cplusplus
extern "C" {
#endif
int *rvalp);
/*
* Enumerated type for the Tavor ioctl() interface types
*/
#ifdef DEBUG
typedef enum {
#else
typedef enum {
#endif /* DEBUG */
/*
* Specific operations for each of the flash ioctl interfaces
*/
/*
* Default values for the flash (overridden by CFI info, if available)
*/
/*
* CFI (Common Flash Interface) initialization
*/
/*
* Needed for compatability
*/
/*
* Expand CFI data size to support the Intel Expanded Command Set.
*/
/*
* Mellanox uses two different parallel Flash devices for their
* HCAs that tavor supports. They are the AMD AM29LV033C and the
* Intel 28F320J3C. The AM29LV033C utilizes the AMD Standard CFI
* command set while the 28F320J3C utliizes the Intel Extended
* CFI command set.
*/
/*
* The firmware version structure used in TAVOR_IOCTL_INFO and
* TAVOR_IOCTL_FLASH_INIT interfaces. The structure consists of major,
* minor and subminor portions for firmware revision number.
*/
typedef struct tavor_fw_info_ioctl_s {
/*
* structure used for read, write, and erase flash routines
* Supported fields for each type:
* read_sector: tf_type, tf_sector, tf_sector_num
* read_quadlet: tf_type, tf_addr, tf_quadlet
* write_sector: tf_type, tf_sector, tf_sector_num
* write_byte: tf_type, tf_addr, tf_byte
* erase_sector: tf_type, tf_sector_num
* erase_chip: tf_type
*
* The 'tf_sector' field must point to a sector sized portion of memory, as
*/
typedef struct tavor_flash_ioctl_s {
/* Structure used for flash init interface */
typedef struct tavor_flash_init_ioctl_s {
int tf_pn_len;
/*
* The "trg_reg_set" field indicates the register set (the BAR) from which
* the access is desired (TAVOR_CMD_BAR, TAVOR_UAR_BAR, or TAVOR_DDR_BAR).
* The "trg_offset" and "trg_data" fields indicate the register and either
*/
typedef struct tavor_reg_ioctl_s {
/*
* Tavor VTS IOCTL revision number. This revision number is currently
* expected to be passed in all Tavor VTS ioctl interfaces.
*/
/*
* The port structure used in TAVOR_IOCTL_PORTS interface.
* Each port has an associated guid, port number, and IBA-defined
* logical port state.
*/
typedef struct tavor_stat_port_ioctl_s {
/*
* The structure used for the TAVOR_IOCTL_PORTS interface.
* The number of ports and a buffer large enough for 256
* port structures will be supplied by the caller. The
* revision should be set to TAVOR_VTS_IOCTL_REVISION. The
* number of ports ("tp_num_ports") is always returned,
* regardless of success or failure otherwise.
*/
typedef struct tavor_ports_ioctl_s {
/*
* The structure used for TAVOR_IOCTL_DDR_READ interface.
* It includes byte offset within DDR from which to read
* a 32-bit value (offset will be rounded off to 32-bit
* alignment).
*/
typedef struct tavor_ddr_read_ioctl_s {
/*
* These are the status codes that can be returned by the
* TAVOR_IOCTL_LOOPBACK test. They are returned as part of
* the tavor_loopback_ioctl_t struct (below).
*/
typedef enum {
/*
* The structure used for TAVOR_IOCTL_LOOPBACK interface.
* It defines the port number, number of iterations, wait duration,
* number of retries and the data pattern to be sent. Upon return,
* the driver will supply the number of iterations succesfully
* completed, and the kind of failure (if any, along with the failing
* data pattern).
*/
typedef struct tavor_loopback_ioctl_s {
/*
* The structure used for the TAVOR_IOCTL_INFO interface. It
* includes firmware version, hardware version, accessable
* range of adapter DDR memory, and adapter flash memory size.
*/
typedef struct tavor_info_ioctl_s {
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_ADAPTERS_TAVOR_IOCTL_H */