akaros/kern/drivers/net/bnx2x/bnx2x_mfw_req.h
<<
>>
Prefs
   1/* bnx2x_mfw_req.h: Broadcom Everest network driver.
   2 *
   3 * Copyright (c) 2012-2013 Broadcom Corporation
   4 *
   5 * This program is free software; you can redistribute it and/or modify
   6 * it under the terms of the GNU General Public License as published by
   7 * the Free Software Foundation.
   8 */
   9
  10#pragma once
  11
  12#define PORT_0                  0
  13#define PORT_1                  1
  14#define PORT_MAX                2
  15#define NVM_PATH_MAX            2
  16
  17/* FCoE capabilities required from the driver */
  18struct fcoe_capabilities {
  19        uint32_t capability1;
  20        /* Maximum number of I/Os per connection */
  21        #define FCOE_IOS_PER_CONNECTION_MASK    0x0000ffff
  22        #define FCOE_IOS_PER_CONNECTION_SHIFT   0
  23        /* Maximum number of Logins per port */
  24        #define FCOE_LOGINS_PER_PORT_MASK       0xffff0000
  25        #define FCOE_LOGINS_PER_PORT_SHIFT   16
  26
  27        uint32_t capability2;
  28        /* Maximum number of exchanges */
  29        #define FCOE_NUMBER_OF_EXCHANGES_MASK   0x0000ffff
  30        #define FCOE_NUMBER_OF_EXCHANGES_SHIFT  0
  31        /* Maximum NPIV WWN per port */
  32        #define FCOE_NPIV_WWN_PER_PORT_MASK     0xffff0000
  33        #define FCOE_NPIV_WWN_PER_PORT_SHIFT    16
  34
  35        uint32_t capability3;
  36        /* Maximum number of targets supported */
  37        #define FCOE_TARGETS_SUPPORTED_MASK     0x0000ffff
  38        #define FCOE_TARGETS_SUPPORTED_SHIFT    0
  39        /* Maximum number of outstanding commands across all connections */
  40        #define FCOE_OUTSTANDING_COMMANDS_MASK  0xffff0000
  41        #define FCOE_OUTSTANDING_COMMANDS_SHIFT 16
  42
  43        uint32_t capability4;
  44        #define FCOE_CAPABILITY4_STATEFUL                       0x00000001
  45        #define FCOE_CAPABILITY4_STATELESS                      0x00000002
  46        #define FCOE_CAPABILITY4_CAPABILITIES_REPORTED_VALID    0x00000004
  47};
  48
  49struct glob_ncsi_oem_data {
  50        uint32_t driver_version;
  51        uint32_t unused[3];
  52        struct fcoe_capabilities fcoe_features[NVM_PATH_MAX][PORT_MAX];
  53};
  54
  55/* current drv_info version */
  56#define DRV_INFO_CUR_VER 2
  57
  58/* drv_info op codes supported */
  59enum drv_info_opcode {
  60        ETH_STATS_OPCODE,
  61        FCOE_STATS_OPCODE,
  62        ISCSI_STATS_OPCODE
  63};
  64
  65#define ETH_STAT_INFO_VERSION_LEN       12
  66/*  Per PCI Function Ethernet Statistics required from the driver */
  67struct eth_stats_info {
  68        /* Function's Driver Version. padded to 12 */
  69        uint8_t version[ETH_STAT_INFO_VERSION_LEN];
  70        /* Locally Admin Addr. BigEndian EIU48. Actual size is 6 bytes */
  71        uint8_t mac_local[8];
  72        uint8_t mac_add1[8];            /* Additional Programmed MAC Addr 1. */
  73        uint8_t mac_add2[8];            /* Additional Programmed MAC Addr 2. */
  74        uint32_t mtu_size;              /* MTU Size. Note   : Negotiated MTU */
  75        uint32_t feature_flags; /* Feature_Flags. */
  76#define FEATURE_ETH_CHKSUM_OFFLOAD_MASK         0x01
  77#define FEATURE_ETH_LSO_MASK                    0x02
  78#define FEATURE_ETH_BOOTMODE_MASK               0x1C
  79#define FEATURE_ETH_BOOTMODE_SHIFT              2
  80#define FEATURE_ETH_BOOTMODE_NONE               (0x0 << 2)
  81#define FEATURE_ETH_BOOTMODE_PXE                (0x1 << 2)
  82#define FEATURE_ETH_BOOTMODE_ISCSI              (0x2 << 2)
  83#define FEATURE_ETH_BOOTMODE_FCOE               (0x3 << 2)
  84#define FEATURE_ETH_TOE_MASK                    0x20
  85        uint32_t lso_max_size;  /* LSO MaxOffloadSize. */
  86        uint32_t lso_min_seg_cnt;       /* LSO MinSegmentCount. */
  87        /* Num Offloaded Connections TCP_IPv4. */
  88        uint32_t ipv4_ofld_cnt;
  89        /* Num Offloaded Connections TCP_IPv6. */
  90        uint32_t ipv6_ofld_cnt;
  91        uint32_t promiscuous_mode;      /* Promiscuous Mode. non-zero true */
  92        uint32_t txq_size;              /* TX Descriptors Queue Size */
  93        uint32_t rxq_size;              /* RX Descriptors Queue Size */
  94        /* TX Descriptor Queue Avg Depth. % Avg Queue Depth since last poll */
  95        uint32_t txq_avg_depth;
  96        /* RX Descriptors Queue Avg Depth. % Avg Queue Depth since last poll */
  97        uint32_t rxq_avg_depth;
  98        /* IOV_Offload. 0=none; 1=MultiQueue, 2=VEB 3= VEPA*/
  99        uint32_t iov_offload;
 100        /* Number of NetQueue/VMQ Config'd. */
 101        uint32_t netq_cnt;
 102        uint32_t vf_cnt;                /* Num VF assigned to this PF. */
 103};
 104
 105/*  Per PCI Function FCOE Statistics required from the driver */
 106struct fcoe_stats_info {
 107        uint8_t version[12];            /* Function's Driver Version. */
 108        uint8_t mac_local[8];   /* Locally Admin Addr. */
 109        uint8_t mac_add1[8];            /* Additional Programmed MAC Addr 1. */
 110        uint8_t mac_add2[8];            /* Additional Programmed MAC Addr 2. */
 111        /* QoS Priority (per 802.1p). 0-7255 */
 112        uint32_t qos_priority;
 113        uint32_t txq_size;              /* FCoE TX Descriptors Queue Size. */
 114        uint32_t rxq_size;              /* FCoE RX Descriptors Queue Size. */
 115        /* FCoE TX Descriptor Queue Avg Depth. */
 116        uint32_t txq_avg_depth;
 117        /* FCoE RX Descriptors Queue Avg Depth. */
 118        uint32_t rxq_avg_depth;
 119        uint32_t rx_frames_lo;  /* FCoE RX Frames received. */
 120        uint32_t rx_frames_hi;  /* FCoE RX Frames received. */
 121        uint32_t rx_bytes_lo;   /* FCoE RX Bytes received. */
 122        uint32_t rx_bytes_hi;   /* FCoE RX Bytes received. */
 123        uint32_t tx_frames_lo;  /* FCoE TX Frames sent. */
 124        uint32_t tx_frames_hi;  /* FCoE TX Frames sent. */
 125        uint32_t tx_bytes_lo;   /* FCoE TX Bytes sent. */
 126        uint32_t tx_bytes_hi;   /* FCoE TX Bytes sent. */
 127};
 128
 129/* Per PCI  Function iSCSI Statistics required from the driver*/
 130struct iscsi_stats_info {
 131        uint8_t version[12];            /* Function's Driver Version. */
 132        uint8_t mac_local[8];   /* Locally Admin iSCSI MAC Addr. */
 133        uint8_t mac_add1[8];            /* Additional Programmed MAC Addr 1. */
 134        /* QoS Priority (per 802.1p). 0-7255 */
 135        uint32_t qos_priority;
 136        uint8_t initiator_name[64];     /* iSCSI Boot Initiator Node name. */
 137        uint8_t ww_port_name[64];       /* iSCSI World wide port name */
 138        uint8_t boot_target_name[64];/* iSCSI Boot Target Name. */
 139        uint8_t boot_target_ip[16];     /* iSCSI Boot Target IP. */
 140        uint32_t boot_target_portal;    /* iSCSI Boot Target Portal. */
 141        uint8_t boot_init_ip[16];       /* iSCSI Boot Initiator IP Address. */
 142        uint32_t max_frame_size;        /* Max Frame Size. bytes */
 143        uint32_t txq_size;              /* PDU TX Descriptors Queue Size. */
 144        uint32_t rxq_size;              /* PDU RX Descriptors Queue Size. */
 145        uint32_t txq_avg_depth; /* PDU TX Descriptor Queue Avg Depth. */
 146        uint32_t rxq_avg_depth; /* PDU RX Descriptors Queue Avg Depth. */
 147        uint32_t rx_pdus_lo;            /* iSCSI PDUs received. */
 148        uint32_t rx_pdus_hi;            /* iSCSI PDUs received. */
 149        uint32_t rx_bytes_lo;   /* iSCSI RX Bytes received. */
 150        uint32_t rx_bytes_hi;   /* iSCSI RX Bytes received. */
 151        uint32_t tx_pdus_lo;            /* iSCSI PDUs sent. */
 152        uint32_t tx_pdus_hi;            /* iSCSI PDUs sent. */
 153        uint32_t tx_bytes_lo;   /* iSCSI PDU TX Bytes sent. */
 154        uint32_t tx_bytes_hi;   /* iSCSI PDU TX Bytes sent. */
 155        uint32_t pcp_prior_map_tbl;     /* C-PCP to S-PCP Priority MapTable.
 156                                 * 9 nibbles, the position of each nibble
 157                                 * represents the C-PCP value, the value
 158                                 * of the nibble = S-PCP value.
 159                                 */
 160};
 161
 162union drv_info_to_mcp {
 163        struct eth_stats_info   ether_stat;
 164        struct fcoe_stats_info  fcoe_stat;
 165        struct iscsi_stats_info iscsi_stat;
 166};
 167