oce_hw_eth.h revision 4d0e50075058332ce0cd62bc2669a8a4dea45da0
/*
* 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 2009 Emulex. All rights reserved.
* Use is subject to license terms.
*/
/*
* header file containing the data structure definitions for the NIC
* subsystetm
*/
#ifndef _OCE_HW_ETH_H_
#define _OCE_HW_ETH_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <oce_hw.h>
#define NIC_WQE_SIZE 16
/* NIC packet type */
#define NIC_UNICAST 0x00
#define NIC_MULTICAST 0x01
#define NIC_BROADCAST 0x02
/* HDS type */
#define NIC_HDS_NO_SPLIT 0x00
#define NIC_HDS_SPLIT_L3PL 0x01
#define NIC_HDS_SPLIT_L4PL 0x02
/* NIC WQ types */
#define NIC_WQ_TYPE_FORWARDING 0x01
#define NIC_WQ_TYPE_STANDARD 0x02
#define NIC_WQ_TYPE_LOW_LATENCY 0x04
#pragma pack(1)
enum {
OPCODE_GET_NIC_STATS = 4,
OPCODE_CREATE_NIC_WQ = 7,
OPCODE_CREATE_NIC_RQ = 8,
OPCODE_DELETE_NIC_WQ = 9,
OPCODE_DELETE_NIC_RQ = 10,
OPCODE_CREATE_NIC_RSS_CQ = 11,
OPCODE_DELETE_NIC_RSS_CQ = 12,
OPCODE_SET_RSS_EQ_MSI = 13,
OPCODE_CREATE_NIC_HDS_RQ = 14,
OPCODE_DELETE_NIC_HDS_RQ = 15,
};
/* NIC header WQE */
struct oce_nic_hdr_wqe {
union {
struct {
#ifdef _BIG_ENDIAN
/* dw0 */
/* dw1 */
/* dw2 */
/* dw3 */
#else
/* dw0 */
/* dw1 */
/* dw2 */
/* dw3 */
#endif
}s;
}u0;
};
/* NIC fragment WQE */
struct oce_nic_frag_wqe {
union {
struct {
/* dw0 */
/* dw1 */
/* dw2 */
}s;
}u0;
};
/* Ethernet Tx Completion Descriptor */
struct oce_nic_tx_cqe {
union {
struct {
#ifdef _BIG_ENDIAN
/* dw 0 */
/* dw 1 */
/* dw 2 */
/* dw 3 */
#else
/* dw 0 */
/* dw 1 */
/* dw 2 */
/* dw 3 */
#endif
}s;
}u0;
};
/* Receive Queue Entry (RQE) */
struct oce_nic_rqe {
union {
struct {
}s;
}u0;
};
/* NIC Receive CQE */
struct oce_nic_rx_cqe {
union {
struct {
#ifdef _BIG_ENDIAN
/* dw 0 */
/* dw 1 */
/* dw 2 */
/* dw 3 */
#else
/* dw 0 */
/* dw 1 */
/* dw 2 */
/* dw 3 */
#endif
}s;
}u0;
};
#define RQ_CQE_VALID_MASK 0x80
struct mbx_config_nic_promiscuous {
union {
struct {
#ifdef _BIG_ENDIAN
#else
#endif
}req;
struct {
}rsp;
}params;
};
/* [07] OPCODE_CREATE_NIC_WQ */
struct mbx_create_nic_wq {
/* dw0 - dw3 */
union {
struct {
#ifdef _BIG_ENDIAN
/* dw4 */
/* dw5 */
/* dw6 */
/* dw7 */
#else
/* dw4 */
/* dw5 */
/* dw6 */
/* dw7 */
#endif
/* dw8 - dw20 */
/* dw21 - dw36 */
}req;
struct {
}rsp;
}params;
};
/* [09] OPCODE_DELETE_NIC_WQ */
struct mbx_delete_nic_wq {
/* dw0 - dw3 */
union {
struct {
#ifdef _BIG_ENDIAN
/* dw4 */
#else
/* dw4 */
#endif
}req;
struct {
}rsp;
}params;
};
/* [08] OPCODE_CREATE_NIC_RQ */
struct mbx_create_nic_rq {
/* dw0 - dw3 */
union {
struct {
#ifdef _BIG_ENDIAN
/* dw4 */
#else
/* dw4 */
#endif
/* dw5 - dw8 */
/* dw9 */
#ifdef _BIG_ENDIAN
/* dw10 */
#else
/* dw10 */
#endif
/* dw11 */
}req;
struct {
/* dw4 */
union {
struct {
} s;
}u0;
}rsp;
}params;
};
/* [10] OPCODE_DELETE_NIC_RQ */
struct mbx_delete_nic_rq {
/* dw0 - dw3 */
union {
struct {
#ifdef _BIG_ENDIAN
/* dw4 */
#else
/* dw4 */
#endif
}req;
struct {
/* dw4 */
}rsp;
}params;
};
struct rx_port_stats {
};
struct rx_stats {
/* dw 0-131 --2 X 66 */
/* dw 132-147 --16 */
/* fcoe is not relevent */
};
struct tx_counter {
};
struct tx_stats {
struct tx_counter ct1pt0_xmt_ipv4_ctrs;
struct tx_counter ct1pt0_xmt_ipv6_ctrs;
struct tx_counter ct1pt0_rexmt_ipv4_ctrs;
struct tx_counter ct1pt0_rexmt_ipv6_ctrs;
struct tx_counter ct1pt1_xmt_ipv4_ctrs;
struct tx_counter ct1pt1_xmt_ipv6_ctrs;
struct tx_counter ct1pt1_rexmt_ipv4_ctrs;
struct tx_counter ct1pt1_rexmt_ipv6_ctrs;
struct tx_counter ct2pt0_xmt_ipv4_ctrs;
struct tx_counter ct2pt0_xmt_ipv6_ctrs;
struct tx_counter ct2pt0_rexmt_ipv4_ctrs;
struct tx_counter ct2pt0_rexmt_ipv6_ctrs;
struct tx_counter ct2pt1_xmt_ipv4_ctrs;
struct tx_counter ct2pt1_xmt_ipv6_ctrs;
struct tx_counter ct2pt1_rexmt_ipv4_ctrs;
struct tx_counter ct2pt1_rexmt_ipv6_ctrs;
};
struct rx_err_stats {
};
struct mem_stats {
};
/* [04] OPCODE_GET_NIC_STATS */
struct mbx_get_nic_stats {
/* dw0 - dw3 */
union {
struct {
}req;
struct {
struct rx_err_stats err_rx;
}rsp;
}params;
};
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif /* _OCE_HW_ETH_H_ */