/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2007-2017 QLogic Corporation. All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"16* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS19* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR20* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF21* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS22* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN23* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)24* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF25* THE POSSIBILITY OF SUCH DAMAGE.26*/2728#include <sys/cdefs.h>29#ifndef ECORE_MFW_REQ_H30#define ECORE_MFW_REQ_H31323334#define PORT_0 035#define PORT_1 136#define PORT_MAX 237#define NVM_PATH_MAX 23839/* FCoE capabilities required from the driver */40struct fcoe_capabilities {41uint32_t capability1;42/* Maximum number of I/Os per connection */43#define FCOE_IOS_PER_CONNECTION_MASK 0x0000ffff44#define FCOE_IOS_PER_CONNECTION_SHIFT 045/* Maximum number of Logins per port */46#define FCOE_LOGINS_PER_PORT_MASK 0xffff000047#define FCOE_LOGINS_PER_PORT_SHIFT 164849uint32_t capability2;50/* Maximum number of exchanges */51#define FCOE_NUMBER_OF_EXCHANGES_MASK 0x0000ffff52#define FCOE_NUMBER_OF_EXCHANGES_SHIFT 053/* Maximum NPIV WWN per port */54#define FCOE_NPIV_WWN_PER_PORT_MASK 0xffff000055#define FCOE_NPIV_WWN_PER_PORT_SHIFT 165657uint32_t capability3;58/* Maximum number of targets supported */59#define FCOE_TARGETS_SUPPORTED_MASK 0x0000ffff60#define FCOE_TARGETS_SUPPORTED_SHIFT 061/* Maximum number of outstanding commands across all connections */62#define FCOE_OUTSTANDING_COMMANDS_MASK 0xffff000063#define FCOE_OUTSTANDING_COMMANDS_SHIFT 166465uint32_t capability4;66#define FCOE_CAPABILITY4_STATEFUL 0x0000000167#define FCOE_CAPABILITY4_STATELESS 0x0000000268#define FCOE_CAPABILITY4_CAPABILITIES_REPORTED_VALID 0x0000000469};7071struct glob_ncsi_oem_data72{73uint32_t driver_version;74uint32_t unused[3];75struct fcoe_capabilities fcoe_features[NVM_PATH_MAX][PORT_MAX];76};7778/* current drv_info version */79#define DRV_INFO_CUR_VER 28081/* drv_info op codes supported */82enum drv_info_opcode {83ETH_STATS_OPCODE,84FCOE_STATS_OPCODE,85ISCSI_STATS_OPCODE86};8788#define ETH_STAT_INFO_VERSION_LEN 1289/* Per PCI Function Ethernet Statistics required from the driver */90struct eth_stats_info {91/* Function's Driver Version. padded to 12 */92uint8_t version[ETH_STAT_INFO_VERSION_LEN];93/* Locally Admin Addr. BigEndian EIU48. Actual size is 6 bytes */94uint8_t mac_local[8];95uint8_t mac_add1[8]; /* Additional Programmed MAC Addr 1. */96uint8_t mac_add2[8]; /* Additional Programmed MAC Addr 2. */97uint32_t mtu_size; /* MTU Size. Note : Negotiated MTU */98uint32_t feature_flags; /* Feature_Flags. */99#define FEATURE_ETH_CHKSUM_OFFLOAD_MASK 0x01100#define FEATURE_ETH_LSO_MASK 0x02101#define FEATURE_ETH_BOOTMODE_MASK 0x1C102#define FEATURE_ETH_BOOTMODE_SHIFT 2103#define FEATURE_ETH_BOOTMODE_NONE (0x0 << 2)104#define FEATURE_ETH_BOOTMODE_PXE (0x1 << 2)105#define FEATURE_ETH_BOOTMODE_ISCSI (0x2 << 2)106#define FEATURE_ETH_BOOTMODE_FCOE (0x3 << 2)107#define FEATURE_ETH_TOE_MASK 0x20108uint32_t lso_max_size; /* LSO MaxOffloadSize. */109uint32_t lso_min_seg_cnt; /* LSO MinSegmentCount. */110/* Num Offloaded Connections TCP_IPv4. */111uint32_t ipv4_ofld_cnt;112/* Num Offloaded Connections TCP_IPv6. */113uint32_t ipv6_ofld_cnt;114uint32_t promiscuous_mode; /* Promiscuous Mode. non-zero true */115uint32_t txq_size; /* TX Descriptors Queue Size */116uint32_t rxq_size; /* RX Descriptors Queue Size */117/* TX Descriptor Queue Avg Depth. % Avg Queue Depth since last poll */118uint32_t txq_avg_depth;119/* RX Descriptors Queue Avg Depth. % Avg Queue Depth since last poll */120uint32_t rxq_avg_depth;121/* IOV_Offload. 0=none; 1=MultiQueue, 2=VEB 3= VEPA*/122uint32_t iov_offload;123/* Number of NetQueue/VMQ Config'd. */124uint32_t netq_cnt;125uint32_t vf_cnt; /* Num VF assigned to this PF. */126};127128/* Per PCI Function FCOE Statistics required from the driver */129struct fcoe_stats_info {130uint8_t version[12]; /* Function's Driver Version. */131uint8_t mac_local[8]; /* Locally Admin Addr. */132uint8_t mac_add1[8]; /* Additional Programmed MAC Addr 1. */133uint8_t mac_add2[8]; /* Additional Programmed MAC Addr 2. */134/* QoS Priority (per 802.1p). 0-7255 */135uint32_t qos_priority;136uint32_t txq_size; /* FCoE TX Descriptors Queue Size. */137uint32_t rxq_size; /* FCoE RX Descriptors Queue Size. */138/* FCoE TX Descriptor Queue Avg Depth. */139uint32_t txq_avg_depth;140/* FCoE RX Descriptors Queue Avg Depth. */141uint32_t rxq_avg_depth;142uint32_t rx_frames_lo; /* FCoE RX Frames received. */143uint32_t rx_frames_hi; /* FCoE RX Frames received. */144uint32_t rx_bytes_lo; /* FCoE RX Bytes received. */145uint32_t rx_bytes_hi; /* FCoE RX Bytes received. */146uint32_t tx_frames_lo; /* FCoE TX Frames sent. */147uint32_t tx_frames_hi; /* FCoE TX Frames sent. */148uint32_t tx_bytes_lo; /* FCoE TX Bytes sent. */149uint32_t tx_bytes_hi; /* FCoE TX Bytes sent. */150uint32_t rx_fcs_errors; /* number of receive packets with FCS errors */151uint32_t rx_fc_crc_errors; /* number of FC frames with CRC errors*/152uint32_t fip_login_failures; /* number of FCoE/FIP Login failures */153};154155/* Per PCI Function iSCSI Statistics required from the driver*/156struct iscsi_stats_info {157uint8_t version[12]; /* Function's Driver Version. */158uint8_t mac_local[8]; /* Locally Admin iSCSI MAC Addr. */159uint8_t mac_add1[8]; /* Additional Programmed MAC Addr 1. */160/* QoS Priority (per 802.1p). 0-7255 */161uint32_t qos_priority;162163uint8_t initiator_name[64]; /* iSCSI Boot Initiator Node name. */164165uint8_t ww_port_name[64]; /* iSCSI World wide port name */166167uint8_t boot_target_name[64];/* iSCSI Boot Target Name. */168169uint8_t boot_target_ip[16]; /* iSCSI Boot Target IP. */170uint32_t boot_target_portal; /* iSCSI Boot Target Portal. */171uint8_t boot_init_ip[16]; /* iSCSI Boot Initiator IP Address. */172uint32_t max_frame_size; /* Max Frame Size. bytes */173uint32_t txq_size; /* PDU TX Descriptors Queue Size. */174uint32_t rxq_size; /* PDU RX Descriptors Queue Size. */175176uint32_t txq_avg_depth; /*PDU TX Descriptor Queue Avg Depth. */177uint32_t rxq_avg_depth; /*PDU RX Descriptors Queue Avg Depth. */178uint32_t rx_pdus_lo; /* iSCSI PDUs received. */179uint32_t rx_pdus_hi; /* iSCSI PDUs received. */180181uint32_t rx_bytes_lo; /* iSCSI RX Bytes received. */182uint32_t rx_bytes_hi; /* iSCSI RX Bytes received. */183uint32_t tx_pdus_lo; /* iSCSI PDUs sent. */184uint32_t tx_pdus_hi; /* iSCSI PDUs sent. */185186uint32_t tx_bytes_lo; /* iSCSI PDU TX Bytes sent. */187uint32_t tx_bytes_hi; /* iSCSI PDU TX Bytes sent. */188uint32_t pcp_prior_map_tbl; /*C-PCP to S-PCP Priority MapTable.1899 nibbles, the position of each nibble190represents the C-PCP value, the value191of the nibble = S-PCP value.*/192};193194union drv_info_to_mcp {195struct eth_stats_info ether_stat;196struct fcoe_stats_info fcoe_stat;197struct iscsi_stats_info iscsi_stat;198};199200201#endif /* ECORE_MFW_REQ_H */202203204205