linux/drivers/scsi/bfa/include/cna/pstats/phyport_defs.h
<<
>>
Prefs
   1/*
   2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
   3 * All rights reserved.
   4 *
   5 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
   6 *
   7 * This program is free software; you can redistribute it and/or modify it
   8 * under the terms of the GNU General Public License (GPL) Version 2 as
   9 * published by the Free Software Foundation
  10 *
  11 * This program is distributed in the hope that it will be useful, but
  12 * WITHOUT ANY WARRANTY; without even the implied warranty of
  13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14 * General Public License for more details.
  15 */
  16
  17#ifndef __PHYPORT_DEFS_H__
  18#define __PHYPORT_DEFS_H__
  19
  20#define BNA_TXF_ID_MAX          64
  21#define BNA_RXF_ID_MAX          64
  22
  23/*
  24 * Statistics
  25 */
  26
  27/*
  28 * TxF Frame Statistics
  29 */
  30struct bna_stats_txf {
  31        u64        ucast_octets;
  32        u64        ucast;
  33        u64        ucast_vlan;
  34
  35        u64        mcast_octets;
  36        u64        mcast;
  37        u64        mcast_vlan;
  38
  39        u64        bcast_octets;
  40        u64        bcast;
  41        u64        bcast_vlan;
  42
  43        u64        errors;
  44        u64        filter_vlan; /* frames filtered due to VLAN */
  45        u64        filter_mac_sa;       /* frames filtered due to SA check */
  46};
  47
  48/*
  49 * RxF Frame Statistics
  50 */
  51struct bna_stats_rxf {
  52        u64        ucast_octets;
  53        u64        ucast;
  54        u64        ucast_vlan;
  55
  56        u64        mcast_octets;
  57        u64        mcast;
  58        u64        mcast_vlan;
  59
  60        u64        bcast_octets;
  61        u64        bcast;
  62        u64        bcast_vlan;
  63        u64        frame_drops;
  64};
  65
  66/*
  67 * FC Tx Frame Statistics
  68 */
  69struct bna_stats_fc_tx {
  70        u64        txf_ucast_octets;
  71        u64        txf_ucast;
  72        u64        txf_ucast_vlan;
  73
  74        u64        txf_mcast_octets;
  75        u64        txf_mcast;
  76        u64        txf_mcast_vlan;
  77
  78        u64        txf_bcast_octets;
  79        u64        txf_bcast;
  80        u64        txf_bcast_vlan;
  81
  82        u64        txf_parity_errors;
  83        u64        txf_timeout;
  84        u64        txf_fid_parity_errors;
  85};
  86
  87/*
  88 * FC Rx Frame Statistics
  89 */
  90struct bna_stats_fc_rx {
  91        u64        rxf_ucast_octets;
  92        u64        rxf_ucast;
  93        u64        rxf_ucast_vlan;
  94
  95        u64        rxf_mcast_octets;
  96        u64        rxf_mcast;
  97        u64        rxf_mcast_vlan;
  98
  99        u64        rxf_bcast_octets;
 100        u64        rxf_bcast;
 101        u64        rxf_bcast_vlan;
 102};
 103
 104/*
 105 * RAD Frame Statistics
 106 */
 107struct cna_stats_rad {
 108        u64        rx_frames;
 109        u64        rx_octets;
 110        u64        rx_vlan_frames;
 111
 112        u64        rx_ucast;
 113        u64        rx_ucast_octets;
 114        u64        rx_ucast_vlan;
 115
 116        u64        rx_mcast;
 117        u64        rx_mcast_octets;
 118        u64        rx_mcast_vlan;
 119
 120        u64        rx_bcast;
 121        u64        rx_bcast_octets;
 122        u64        rx_bcast_vlan;
 123
 124        u64        rx_drops;
 125};
 126
 127/*
 128 * BPC Tx Registers
 129 */
 130struct cna_stats_bpc_tx {
 131        u64        tx_pause[8];
 132        u64        tx_zero_pause[8];    /*  Pause cancellation */
 133        u64        tx_first_pause[8];   /*  Pause initiation rather
 134                                                 *than retention */
 135};
 136
 137/*
 138 * BPC Rx Registers
 139 */
 140struct cna_stats_bpc_rx {
 141        u64        rx_pause[8];
 142        u64        rx_zero_pause[8];    /*  Pause cancellation */
 143        u64        rx_first_pause[8];   /*  Pause initiation rather
 144                                                 *than retention */
 145};
 146
 147/*
 148 * MAC Rx Statistics
 149 */
 150struct cna_stats_mac_rx {
 151        u64        frame_64;    /* both rx and tx counter */
 152        u64        frame_65_127;        /* both rx and tx counter */
 153        u64        frame_128_255;       /* both rx and tx counter */
 154        u64        frame_256_511;       /* both rx and tx counter */
 155        u64        frame_512_1023;      /* both rx and tx counter */
 156        u64        frame_1024_1518;     /* both rx and tx counter */
 157        u64        frame_1518_1522;     /* both rx and tx counter */
 158        u64        rx_bytes;
 159        u64        rx_packets;
 160        u64        rx_fcs_error;
 161        u64        rx_multicast;
 162        u64        rx_broadcast;
 163        u64        rx_control_frames;
 164        u64        rx_pause;
 165        u64        rx_unknown_opcode;
 166        u64        rx_alignment_error;
 167        u64        rx_frame_length_error;
 168        u64        rx_code_error;
 169        u64        rx_carrier_sense_error;
 170        u64        rx_undersize;
 171        u64        rx_oversize;
 172        u64        rx_fragments;
 173        u64        rx_jabber;
 174        u64        rx_drop;
 175};
 176
 177/*
 178 * MAC Tx Statistics
 179 */
 180struct cna_stats_mac_tx {
 181        u64        tx_bytes;
 182        u64        tx_packets;
 183        u64        tx_multicast;
 184        u64        tx_broadcast;
 185        u64        tx_pause;
 186        u64        tx_deferral;
 187        u64        tx_excessive_deferral;
 188        u64        tx_single_collision;
 189        u64        tx_muliple_collision;
 190        u64        tx_late_collision;
 191        u64        tx_excessive_collision;
 192        u64        tx_total_collision;
 193        u64        tx_pause_honored;
 194        u64        tx_drop;
 195        u64        tx_jabber;
 196        u64        tx_fcs_error;
 197        u64        tx_control_frame;
 198        u64        tx_oversize;
 199        u64        tx_undersize;
 200        u64        tx_fragments;
 201};
 202
 203/*
 204 * Complete statistics
 205 */
 206struct bna_stats {
 207        struct cna_stats_mac_rx mac_rx_stats;
 208        struct cna_stats_bpc_rx bpc_rx_stats;
 209        struct cna_stats_rad rad_stats;
 210        struct bna_stats_fc_rx fc_rx_stats;
 211        struct cna_stats_mac_tx mac_tx_stats;
 212        struct cna_stats_bpc_tx bpc_tx_stats;
 213        struct bna_stats_fc_tx fc_tx_stats;
 214        struct bna_stats_rxf rxf_stats[BNA_TXF_ID_MAX];
 215        struct bna_stats_txf txf_stats[BNA_RXF_ID_MAX];
 216};
 217
 218#endif
 219