Linux Audio

Check our new training course

Loading...
v3.1
   1/*
   2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
 
   3 * All rights reserved
   4 * www.brocade.com
   5 *
   6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
   7 *
   8 * This program is free software; you can redistribute it and/or modify it
   9 * under the terms of the GNU General Public License (GPL) Version 2 as
  10 * published by the Free Software Foundation
  11 *
  12 * This program is distributed in the hope that it will be useful, but
  13 * WITHOUT ANY WARRANTY; without even the implied warranty of
  14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15 * General Public License for more details.
  16 */
  17
  18#ifndef __BFA_DEFS_SVC_H__
  19#define __BFA_DEFS_SVC_H__
  20
  21#include "bfa_defs.h"
  22#include "bfa_fc.h"
  23#include "bfi.h"
  24
  25#define BFA_IOCFC_INTR_DELAY	1125
  26#define BFA_IOCFC_INTR_LATENCY	225
  27#define BFA_IOCFCOE_INTR_DELAY	25
  28#define BFA_IOCFCOE_INTR_LATENCY 5
  29
  30/*
  31 * Interrupt coalescing configuration.
  32 */
  33#pragma pack(1)
  34struct bfa_iocfc_intr_attr_s {
  35	u8		coalesce;	/*  enable/disable coalescing */
  36	u8		rsvd[3];
  37	__be16	latency;	/*  latency in microseconds   */
  38	__be16	delay;		/*  delay in microseconds     */
  39};
  40
  41/*
  42 * IOC firmware configuraton
  43 */
  44struct bfa_iocfc_fwcfg_s {
  45	u16        num_fabrics;	/*  number of fabrics		*/
  46	u16        num_lports;	/*  number of local lports	*/
  47	u16        num_rports;	/*  number of remote ports	*/
  48	u16        num_ioim_reqs;	/*  number of IO reqs		*/
  49	u16        num_tskim_reqs;	/*  task management requests	*/
  50	u16	   num_fwtio_reqs;	/* number of TM IO reqs in FW */
  51	u16        num_fcxp_reqs;	/*  unassisted FC exchanges	*/
  52	u16        num_uf_bufs;	/*  unsolicited recv buffers	*/
  53	u8		num_cqs;
  54	u8		fw_tick_res;	/*  FW clock resolution in ms */
  55	u8		rsvd[2];
  56};
  57#pragma pack()
  58
  59struct bfa_iocfc_drvcfg_s {
  60	u16        num_reqq_elems;	/*  number of req queue elements */
  61	u16        num_rspq_elems;	/*  number of rsp queue elements */
  62	u16        num_sgpgs;	/*  number of total SG pages	  */
  63	u16        num_sboot_tgts;	/*  number of SAN boot targets	  */
  64	u16        num_sboot_luns;	/*  number of SAN boot luns	  */
  65	u16	    ioc_recover;	/*  IOC recovery mode		  */
  66	u16	    min_cfg;	/*  minimum configuration	  */
  67	u16        path_tov;	/*  device path timeout	  */
  68	u16		num_tio_reqs;   /*!< number of TM IO reqs	*/
  69	u8		port_mode;
  70	u8		rsvd_a;
  71	bfa_boolean_t   delay_comp; /*  delay completion of
  72							failed inflight IOs */
  73	u16		num_ttsk_reqs;	 /* TM task management requests */
  74	u32		rsvd;
  75};
  76
  77/*
  78 * IOC configuration
  79 */
  80struct bfa_iocfc_cfg_s {
  81	struct bfa_iocfc_fwcfg_s	fwcfg;	/*  firmware side config */
  82	struct bfa_iocfc_drvcfg_s	drvcfg;	/*  driver side config	  */
  83};
  84
  85/*
  86 * IOC firmware IO stats
  87 */
  88struct bfa_fw_ioim_stats_s {
  89	u32	host_abort;		/*  IO aborted by host driver*/
  90	u32	host_cleanup;		/*  IO clean up by host driver */
  91
  92	u32	fw_io_timeout;		/*  IOs timedout */
  93	u32	fw_frm_parse;		/*  frame parsed by f/w */
  94	u32	fw_frm_data;		/*  fcp_data frame parsed by f/w */
  95	u32	fw_frm_rsp;		/*  fcp_rsp frame parsed by f/w */
  96	u32	fw_frm_xfer_rdy;	/*  xfer_rdy frame parsed by f/w */
  97	u32	fw_frm_bls_acc;		/*  BLS ACC  frame parsed by f/w */
  98	u32	fw_frm_tgt_abort;	/*  target ABTS parsed by f/w */
  99	u32	fw_frm_unknown;		/*  unknown parsed by f/w */
 100	u32	fw_data_dma;		/*  f/w DMA'ed the data frame */
 101	u32	fw_frm_drop;		/*  f/w drop the frame */
 102
 103	u32	rec_timeout;		/*  FW rec timed out */
 104	u32	error_rec;			/*  FW sending rec on
 105							* an error condition*/
 106	u32	wait_for_si;		/*  FW wait for SI */
 107	u32	rec_rsp_inval;		/*  REC rsp invalid */
 
 
 
 108	u32	seqr_io_abort;		/*  target does not know cmd so abort */
 109	u32	seqr_io_retry;		/*  SEQR failed so retry IO */
 110
 111	u32	itn_cisc_upd_rsp;	/*  ITN cisc updated on fcp_rsp */
 112	u32	itn_cisc_upd_data;	/*  ITN cisc updated on fcp_data */
 113	u32	itn_cisc_upd_xfer_rdy;	/*  ITN cisc updated on fcp_data */
 114
 115	u32	fcp_data_lost;		/*  fcp data lost */
 116
 117	u32	ro_set_in_xfer_rdy;	/*  Target set RO in Xfer_rdy frame */
 118	u32	xfer_rdy_ooo_err;	/*  Out of order Xfer_rdy received */
 119	u32	xfer_rdy_unknown_err;	/*  unknown error in xfer_rdy frame */
 120
 121	u32	io_abort_timeout;	/*  ABTS timedout  */
 122	u32	sler_initiated;		/*  SLER initiated */
 123
 124	u32	unexp_fcp_rsp;		/*  fcp response in wrong state */
 125
 126	u32	fcp_rsp_under_run;	/*  fcp rsp IO underrun */
 127	u32        fcp_rsp_under_run_wr;   /*  fcp rsp IO underrun for write */
 128	u32	fcp_rsp_under_run_err;	/*  fcp rsp IO underrun error */
 129	u32        fcp_rsp_resid_inval;    /*  invalid residue */
 130	u32	fcp_rsp_over_run;	/*  fcp rsp IO overrun */
 131	u32	fcp_rsp_over_run_err;	/*  fcp rsp IO overrun error */
 132	u32	fcp_rsp_proto_err;	/*  protocol error in fcp rsp */
 133	u32	fcp_rsp_sense_err;	/*  error in sense info in fcp rsp */
 134	u32	fcp_conf_req;		/*  FCP conf requested */
 135
 136	u32	tgt_aborted_io;		/*  target initiated abort */
 137
 138	u32	ioh_edtov_timeout_event;/*  IOH edtov timer popped */
 139	u32	ioh_fcp_rsp_excp_event;	/*  IOH FCP_RSP exception */
 140	u32	ioh_fcp_conf_event;	/*  IOH FCP_CONF */
 141	u32	ioh_mult_frm_rsp_event;	/*  IOH multi_frame FCP_RSP */
 142	u32	ioh_hit_class2_event;	/*  IOH hit class2 */
 143	u32	ioh_miss_other_event;	/*  IOH miss other */
 144	u32	ioh_seq_cnt_err_event;	/*  IOH seq cnt error */
 145	u32	ioh_len_err_event;		/*  IOH len error - fcp_dl !=
 146							* bytes xfered */
 147	u32	ioh_seq_len_err_event;	/*  IOH seq len error */
 148	u32	ioh_data_oor_event;	/*  Data out of range */
 149	u32	ioh_ro_ooo_event;	/*  Relative offset out of range */
 150	u32	ioh_cpu_owned_event;	/*  IOH hit -iost owned by f/w */
 151	u32	ioh_unexp_frame_event;	/*  unexpected frame received
 152						 *   count */
 153	u32	ioh_err_int;		/*  IOH error int during data-phase
 154						 *   for scsi write
 155						 */
 156};
 157
 158struct bfa_fw_tio_stats_s {
 159	u32	tio_conf_proc;	/* TIO CONF processed */
 160	u32	tio_conf_drop;      /* TIO CONF dropped */
 161	u32	tio_cleanup_req;    /* TIO cleanup requested */
 162	u32	tio_cleanup_comp;   /* TIO cleanup completed */
 163	u32	tio_abort_rsp;      /* TIO abort response */
 164	u32	tio_abort_rsp_comp; /* TIO abort rsp completed */
 165	u32	tio_abts_req;       /* TIO ABTS requested */
 166	u32	tio_abts_ack;       /* TIO ABTS ack-ed */
 167	u32	tio_abts_ack_nocomp; /* TIO ABTS ack-ed but not completed */
 168	u32	tio_abts_tmo;       /* TIO ABTS timeout */
 169	u32	tio_snsdata_dma;    /* TIO sense data DMA */
 170	u32	tio_rxwchan_wait; /* TIO waiting for RX wait channel */
 171	u32	tio_rxwchan_avail; /* TIO RX wait channel available */
 172	u32	tio_hit_bls;        /* TIO IOH BLS event */
 173	u32	tio_uf_recv;        /* TIO received UF */
 174	u32	tio_rd_invalid_sm; /* TIO read reqst in wrong state machine */
 175	u32	tio_wr_invalid_sm;/* TIO write reqst in wrong state machine */
 176
 177	u32	ds_rxwchan_wait; /* DS waiting for RX wait channel */
 178	u32	ds_rxwchan_avail; /* DS RX wait channel available */
 179	u32	ds_unaligned_rd;    /* DS unaligned read */
 180	u32	ds_rdcomp_invalid_sm; /* DS read completed in wrong state machine */
 181	u32	ds_wrcomp_invalid_sm; /* DS write completed in wrong state machine */
 
 
 182	u32	ds_flush_req;       /* DS flush requested */
 183	u32	ds_flush_comp;      /* DS flush completed */
 184	u32	ds_xfrdy_exp;       /* DS XFER_RDY expired */
 185	u32	ds_seq_cnt_err;     /* DS seq cnt error */
 186	u32	ds_seq_len_err;     /* DS seq len error */
 187	u32	ds_data_oor;        /* DS data out of order */
 188	u32	ds_hit_bls;     /* DS hit BLS */
 189	u32	ds_edtov_timer_exp; /* DS edtov expired */
 190	u32	ds_cpu_owned;       /* DS cpu owned */
 191	u32	ds_hit_class2;      /* DS hit class2 */
 192	u32	ds_length_err;      /* DS length error */
 193	u32	ds_ro_ooo_err;      /* DS relative offset out-of-order error */
 194	u32	ds_rectov_timer_exp;    /* DS rectov expired */
 195	u32	ds_unexp_fr_err;    /* DS unexp frame error */
 196};
 197
 198/*
 199 * IOC firmware IO stats
 200 */
 201struct bfa_fw_io_stats_s {
 202	struct bfa_fw_ioim_stats_s	ioim_stats;
 203	struct bfa_fw_tio_stats_s	tio_stats;
 204};
 205
 206/*
 207 * IOC port firmware stats
 208 */
 209
 210struct bfa_fw_port_fpg_stats_s {
 211    u32    intr_evt;
 212    u32    intr;
 213    u32    intr_excess;
 214    u32    intr_cause0;
 215    u32    intr_other;
 216    u32    intr_other_ign;
 217    u32    sig_lost;
 218    u32    sig_regained;
 219    u32    sync_lost;
 220    u32    sync_to;
 221    u32    sync_regained;
 222    u32    div2_overflow;
 223    u32    div2_underflow;
 224    u32    efifo_overflow;
 225    u32    efifo_underflow;
 226    u32    idle_rx;
 227    u32    lrr_rx;
 228    u32    lr_rx;
 229    u32    ols_rx;
 230    u32    nos_rx;
 231    u32    lip_rx;
 232    u32    arbf0_rx;
 233    u32    arb_rx;
 234    u32    mrk_rx;
 235    u32    const_mrk_rx;
 236    u32    prim_unknown;
 237};
 238
 239
 240struct bfa_fw_port_lksm_stats_s {
 241    u32    hwsm_success;       /*  hwsm state machine success          */
 242    u32    hwsm_fails;         /*  hwsm fails                          */
 243    u32    hwsm_wdtov;         /*  hwsm timed out                      */
 244    u32    swsm_success;       /*  swsm success                        */
 245    u32    swsm_fails;         /*  swsm fails                          */
 246    u32    swsm_wdtov;         /*  swsm timed out                      */
 247    u32    busybufs;           /*  link init failed due to busybuf     */
 248    u32    buf_waits;          /*  bufwait state entries               */
 249    u32    link_fails;         /*  link failures                       */
 250    u32    psp_errors;         /*  primitive sequence protocol errors  */
 251    u32    lr_unexp;           /*  No. of times LR rx-ed unexpectedly  */
 252    u32    lrr_unexp;          /*  No. of times LRR rx-ed unexpectedly */
 253    u32    lr_tx;              /*  No. of times LR tx started          */
 254    u32    lrr_tx;             /*  No. of times LRR tx started         */
 255    u32    ols_tx;             /*  No. of times OLS tx started         */
 256    u32    nos_tx;             /*  No. of times NOS tx started         */
 257    u32    hwsm_lrr_rx;        /*  No. of times LRR rx-ed by HWSM      */
 258    u32    hwsm_lr_rx;         /*  No. of times LR rx-ed by HWSM      */
 259	u32	bbsc_lr;	/* LKSM LR tx for credit recovery	*/
 260};
 261
 262struct bfa_fw_port_snsm_stats_s {
 263    u32    hwsm_success;       /*  Successful hwsm terminations        */
 264    u32    hwsm_fails;         /*  hwsm fail count                     */
 265    u32    hwsm_wdtov;         /*  hwsm timed out                      */
 266    u32    swsm_success;       /*  swsm success                        */
 267    u32    swsm_wdtov;         /*  swsm timed out                      */
 268    u32    error_resets;       /*  error resets initiated by upsm      */
 269    u32    sync_lost;          /*  Sync loss count                     */
 270    u32    sig_lost;           /*  Signal loss count                   */
 271	u32	asn8g_attempts;	/* SNSM HWSM at 8Gbps attempts */
 
 
 
 272};
 273
 274struct bfa_fw_port_physm_stats_s {
 275    u32    module_inserts;     /*  Module insert count                 */
 276    u32    module_xtracts;     /*  Module extracts count               */
 277    u32    module_invalids;    /*  Invalid module inserted count       */
 278    u32    module_read_ign;    /*  Module validation status ignored    */
 279    u32    laser_faults;       /*  Laser fault count                   */
 280    u32    rsvd;
 281};
 282
 283struct bfa_fw_fip_stats_s {
 284    u32    vlan_req;           /*  vlan discovery requests             */
 285    u32    vlan_notify;        /*  vlan notifications                  */
 286    u32    vlan_err;           /*  vlan response error                 */
 287    u32    vlan_timeouts;      /*  vlan disvoery timeouts              */
 288    u32    vlan_invalids;      /*  invalid vlan in discovery advert.   */
 289    u32    disc_req;           /*  Discovery solicit requests          */
 290    u32    disc_rsp;           /*  Discovery solicit response          */
 291    u32    disc_err;           /*  Discovery advt. parse errors        */
 292    u32    disc_unsol;         /*  Discovery unsolicited               */
 293    u32    disc_timeouts;      /*  Discovery timeouts                  */
 294    u32    disc_fcf_unavail;   /*  Discovery FCF Not Avail.            */
 295    u32    linksvc_unsupp;     /*  Unsupported link service req        */
 296    u32    linksvc_err;        /*  Parse error in link service req     */
 297    u32    logo_req;           /*  FIP logos received                  */
 298    u32    clrvlink_req;       /*  Clear virtual link req              */
 299    u32    op_unsupp;          /*  Unsupported FIP operation           */
 300    u32    untagged;           /*  Untagged frames (ignored)           */
 301    u32    invalid_version;    /*  Invalid FIP version                 */
 302};
 303
 304struct bfa_fw_lps_stats_s {
 305    u32    mac_invalids;       /*  Invalid mac assigned                */
 306    u32    rsvd;
 307};
 308
 309struct bfa_fw_fcoe_stats_s {
 310    u32    cee_linkups;        /*  CEE link up count                   */
 311    u32    cee_linkdns;        /*  CEE link down count                 */
 312    u32    fip_linkups;        /*  FIP link up count                   */
 313    u32    fip_linkdns;        /*  FIP link up count                   */
 314    u32    fip_fails;          /*  FIP fail count                      */
 315    u32    mac_invalids;       /*  Invalid mac assigned                */
 316};
 317
 318/*
 319 * IOC firmware FCoE port stats
 320 */
 321struct bfa_fw_fcoe_port_stats_s {
 322	struct bfa_fw_fcoe_stats_s  fcoe_stats;
 323	struct bfa_fw_fip_stats_s   fip_stats;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 324};
 325
 326/*
 327 * IOC firmware FC uport stats
 328 */
 329struct bfa_fw_fc_uport_stats_s {
 330	struct bfa_fw_port_snsm_stats_s		snsm_stats;
 331	struct bfa_fw_port_lksm_stats_s		lksm_stats;
 
 332};
 333
 334/*
 335 * IOC firmware FC port stats
 336 */
 337union bfa_fw_fc_port_stats_s {
 338	struct bfa_fw_fc_uport_stats_s	fc_stats;
 339	struct bfa_fw_fcoe_port_stats_s	fcoe_stats;
 340};
 341
 342/*
 343 * IOC firmware port stats
 344 */
 345struct bfa_fw_port_stats_s {
 346	struct bfa_fw_port_fpg_stats_s		fpg_stats;
 347	struct bfa_fw_port_physm_stats_s	physm_stats;
 348	union  bfa_fw_fc_port_stats_s		fc_port;
 349};
 350
 351/*
 352 * fcxchg module statistics
 353 */
 354struct bfa_fw_fcxchg_stats_s {
 355	u32	ua_tag_inv;
 356	u32	ua_state_inv;
 357};
 358
 359struct bfa_fw_lpsm_stats_s {
 360	u32	cls_rx;
 361	u32	cls_tx;
 362};
 363
 364/*
 365 *  Trunk statistics
 366 */
 367struct bfa_fw_trunk_stats_s {
 368	u32 emt_recvd;		/*  Trunk EMT received		*/
 369	u32 emt_accepted;		/*  Trunk EMT Accepted		*/
 370	u32 emt_rejected;		/*  Trunk EMT rejected		*/
 371	u32 etp_recvd;		/*  Trunk ETP received		*/
 372	u32 etp_accepted;		/*  Trunk ETP Accepted		*/
 373	u32 etp_rejected;		/*  Trunk ETP rejected		*/
 374	u32 lr_recvd;		/*  Trunk LR received		*/
 375	u32 rsvd;			/*  padding for 64 bit alignment */
 376};
 377
 378struct bfa_fw_advsm_stats_s {
 379	u32 flogi_sent;		/*  Flogi sent			*/
 380	u32 flogi_acc_recvd;	/*  Flogi Acc received		*/
 381	u32 flogi_rjt_recvd;	/*  Flogi rejects received	*/
 382	u32 flogi_retries;		/*  Flogi retries		*/
 383
 384	u32 elp_recvd;		/*  ELP received		*/
 385	u32 elp_accepted;		/*  ELP Accepted		*/
 386	u32 elp_rejected;		/*  ELP rejected		*/
 387	u32 elp_dropped;		/*  ELP dropped		*/
 
 
 
 
 
 
 388};
 389
 390/*
 391 * IOCFC firmware stats
 392 */
 393struct bfa_fw_iocfc_stats_s {
 394	u32	cfg_reqs;	/*  cfg request */
 395	u32	updq_reqs;	/*  update queue request */
 396	u32	ic_reqs;	/*  interrupt coalesce reqs */
 397	u32	unknown_reqs;
 398	u32	set_intr_reqs;	/*  set interrupt reqs */
 399};
 400
 401/*
 402 * IOC attributes returned in queries
 403 */
 404struct bfa_iocfc_attr_s {
 405	struct bfa_iocfc_cfg_s		config;		/*  IOCFC config   */
 406	struct bfa_iocfc_intr_attr_s	intr_attr;	/*  interrupt attr */
 407};
 408
 409/*
 410 * Eth_sndrcv mod stats
 411 */
 412struct bfa_fw_eth_sndrcv_stats_s {
 413	u32	crc_err;
 414	u32	rsvd;		/*  64bit align    */
 415};
 416
 417/*
 418 * CT MAC mod stats
 419 */
 420struct bfa_fw_mac_mod_stats_s {
 421	u32	mac_on;		/*  MAC got turned-on */
 422	u32	link_up;	/*  link-up */
 423	u32	signal_off;	/*  lost signal */
 424	u32	dfe_on;		/*  DFE on */
 425	u32	mac_reset;	/*  # of MAC reset to bring lnk up */
 426	u32	pcs_reset;	/*  # of PCS reset to bring lnk up */
 427	u32	loopback;	/*  MAC got into serdes loopback */
 428	u32	lb_mac_reset;
 429			/*  # of MAC reset to bring link up in loopback */
 430	u32	lb_pcs_reset;
 431			/*  # of PCS reset to bring link up in loopback */
 432	u32	rsvd;		/*  64bit align    */
 433};
 434
 435/*
 436 * CT MOD stats
 437 */
 438struct bfa_fw_ct_mod_stats_s {
 439	u32	rxa_rds_undrun;	/*  RxA RDS underrun */
 440	u32	rad_bpc_ovfl;	/*  RAD BPC overflow */
 441	u32	rad_rlb_bpc_ovfl; /*  RAD RLB BPC overflow */
 442	u32	bpc_fcs_err;	/*  BPC FCS_ERR */
 443	u32	txa_tso_hdr;	/*  TxA TSO header too long */
 444	u32	rsvd;		/*  64bit align    */
 445};
 446
 447/*
 
 
 
 
 
 
 
 
 448 * IOC firmware stats
 449 */
 450struct bfa_fw_stats_s {
 451	struct bfa_fw_ioc_stats_s	ioc_stats;
 452	struct bfa_fw_iocfc_stats_s	iocfc_stats;
 453	struct bfa_fw_io_stats_s	io_stats;
 454	struct bfa_fw_port_stats_s	port_stats;
 455	struct bfa_fw_fcxchg_stats_s	fcxchg_stats;
 456	struct bfa_fw_lpsm_stats_s	lpsm_stats;
 457	struct bfa_fw_lps_stats_s	lps_stats;
 458	struct bfa_fw_trunk_stats_s	trunk_stats;
 459	struct bfa_fw_advsm_stats_s	advsm_stats;
 460	struct bfa_fw_mac_mod_stats_s	macmod_stats;
 461	struct bfa_fw_ct_mod_stats_s	ctmod_stats;
 462	struct bfa_fw_eth_sndrcv_stats_s	ethsndrcv_stats;
 
 463};
 464
 465#define BFA_IOCFC_PATHTOV_MAX	60
 466#define BFA_IOCFC_QDEPTH_MAX	2000
 467
 468/*
 469 * QoS states
 470 */
 471enum bfa_qos_state {
 472	BFA_QOS_DISABLED = 0,		/* QoS is disabled */
 473	BFA_QOS_ONLINE = 1,		/*  QoS is online */
 474	BFA_QOS_OFFLINE = 2,		/*  QoS is offline */
 475};
 476
 477/*
 478 * QoS  Priority levels.
 479 */
 480enum bfa_qos_priority {
 481	BFA_QOS_UNKNOWN = 0,
 482	BFA_QOS_HIGH  = 1,	/*  QoS Priority Level High */
 483	BFA_QOS_MED  =  2,	/*  QoS Priority Level Medium */
 484	BFA_QOS_LOW  =  3,	/*  QoS Priority Level Low */
 485};
 486
 487/*
 488 * QoS  bandwidth allocation for each priority level
 489 */
 490enum bfa_qos_bw_alloc {
 491	BFA_QOS_BW_HIGH  = 60,	/*  bandwidth allocation for High */
 492	BFA_QOS_BW_MED  =  30,	/*  bandwidth allocation for Medium */
 493	BFA_QOS_BW_LOW  =  10,	/*  bandwidth allocation for Low */
 494};
 495#pragma pack(1)
 
 
 
 
 
 
 
 
 496/*
 497 * QoS attribute returned in QoS Query
 498 */
 499struct bfa_qos_attr_s {
 500	u8		state;		/*  QoS current state */
 501	u8		rsvd[3];
 502	u32  total_bb_cr;		/*  Total BB Credits */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 503};
 504
 505/*
 506 * These fields should be displayed only from the CLI.
 507 * There will be a separate BFAL API (get_qos_vc_attr ?)
 508 * to retrieve this.
 509 *
 510 */
 511#define  BFA_QOS_MAX_VC  16
 512
 513struct bfa_qos_vc_info_s {
 514	u8 vc_credit;
 515	u8 borrow_credit;
 516	u8 priority;
 517	u8 resvd;
 518};
 519
 520struct bfa_qos_vc_attr_s {
 521	u16  total_vc_count;                    /*  Total VC Count */
 522	u16  shared_credit;
 523	u32  elp_opmode_flags;
 524	struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC];  /*   as many as
 525							    * total_vc_count */
 526};
 527
 528/*
 529 * QoS statistics
 530 */
 531struct bfa_qos_stats_s {
 532	u32	flogi_sent;		/*  QoS Flogi sent */
 533	u32	flogi_acc_recvd;	/*  QoS Flogi Acc received */
 534	u32	flogi_rjt_recvd; /*  QoS Flogi rejects received */
 535	u32	flogi_retries;		/*  QoS Flogi retries */
 536
 537	u32	elp_recvd;		/*  QoS ELP received */
 538	u32	elp_accepted;		/*  QoS ELP Accepted */
 539	u32	elp_rejected;       /*  QoS ELP rejected */
 540	u32	elp_dropped;        /*  QoS ELP dropped  */
 541
 542	u32	qos_rscn_recvd;     /*  QoS RSCN received */
 543	u32	rsvd;		    /* padding for 64 bit alignment */
 544};
 545
 546/*
 547 * FCoE statistics
 548 */
 549struct bfa_fcoe_stats_s {
 550	u64	secs_reset;	/*  Seconds since stats reset	     */
 551	u64	cee_linkups;	/*  CEE link up		     */
 552	u64	cee_linkdns;	/*  CEE link down		     */
 553	u64	fip_linkups;	/*  FIP link up		     */
 554	u64	fip_linkdns;	/*  FIP link down		     */
 555	u64	fip_fails;	/*  FIP failures		     */
 556	u64	mac_invalids;	/*  Invalid mac assignments	     */
 557	u64	vlan_req;	/*  Vlan requests		     */
 558	u64	vlan_notify;	/*  Vlan notifications		     */
 559	u64	vlan_err;	/*  Vlan notification errors	     */
 560	u64	vlan_timeouts;	/*  Vlan request timeouts	     */
 561	u64	vlan_invalids;	/*  Vlan invalids		     */
 562	u64	disc_req;	/*  Discovery requests		     */
 563	u64	disc_rsp;	/*  Discovery responses	     */
 564	u64	disc_err;	/*  Discovery error frames	     */
 565	u64	disc_unsol;	/*  Discovery unsolicited	     */
 566	u64	disc_timeouts;	/*  Discovery timeouts		     */
 567	u64	disc_fcf_unavail; /*  Discovery FCF not avail	     */
 568	u64	linksvc_unsupp;	/*  FIP link service req unsupp.    */
 569	u64	linksvc_err;	/*  FIP link service req errors     */
 570	u64	logo_req;	/*  FIP logos received		     */
 571	u64	clrvlink_req;	/*  Clear virtual link requests     */
 572	u64	op_unsupp;	/*  FIP operation unsupp.	     */
 573	u64	untagged;	/*  FIP untagged frames	     */
 574	u64	txf_ucast;	/*  Tx FCoE unicast frames	     */
 575	u64	txf_ucast_vlan;	/*  Tx FCoE unicast vlan frames     */
 576	u64	txf_ucast_octets; /*  Tx FCoE unicast octets	     */
 577	u64	txf_mcast;	/*  Tx FCoE multicast frames	     */
 578	u64	txf_mcast_vlan;	/*  Tx FCoE multicast vlan frames   */
 579	u64	txf_mcast_octets; /*  Tx FCoE multicast octets	     */
 580	u64	txf_bcast;	/*  Tx FCoE broadcast frames	     */
 581	u64	txf_bcast_vlan;	/*  Tx FCoE broadcast vlan frames   */
 582	u64	txf_bcast_octets; /*  Tx FCoE broadcast octets	     */
 583	u64	txf_timeout;	/*  Tx timeouts		     */
 584	u64	txf_parity_errors; /*  Transmit parity err	     */
 585	u64	txf_fid_parity_errors; /*  Transmit FID parity err  */
 586	u64	rxf_ucast_octets; /*  Rx FCoE unicast octets	     */
 587	u64	rxf_ucast;	/*  Rx FCoE unicast frames	     */
 588	u64	rxf_ucast_vlan;	/*  Rx FCoE unicast vlan frames     */
 589	u64	rxf_mcast_octets; /*  Rx FCoE multicast octets	     */
 590	u64	rxf_mcast;	/*  Rx FCoE multicast frames	     */
 591	u64	rxf_mcast_vlan;	/*  Rx FCoE multicast vlan frames   */
 592	u64	rxf_bcast_octets; /*  Rx FCoE broadcast octets	     */
 593	u64	rxf_bcast;	/*  Rx FCoE broadcast frames	     */
 594	u64	rxf_bcast_vlan;	/*  Rx FCoE broadcast vlan frames   */
 595};
 596
 597/*
 598 * QoS or FCoE stats (fcport stats excluding physical FC port stats)
 599 */
 600union bfa_fcport_stats_u {
 601	struct bfa_qos_stats_s	fcqos;
 602	struct bfa_fcoe_stats_s	fcoe;
 603};
 604#pragma pack()
 605
 606struct bfa_fcpim_del_itn_stats_s {
 607	u32	del_itn_iocomp_aborted;	   /* Aborted IO requests	      */
 608	u32	del_itn_iocomp_timedout;   /* IO timeouts		      */
 609	u32	del_itn_iocom_sqer_needed; /* IO retry for SQ error recovery  */
 610	u32	del_itn_iocom_res_free;    /* Delayed freeing of IO resources */
 611	u32	del_itn_iocom_hostabrts;   /* Host IO abort requests	      */
 612	u32	del_itn_total_ios;	   /* Total IO count		      */
 613	u32	del_io_iocdowns;	   /* IO cleaned-up due to IOC down   */
 614	u32	del_tm_iocdowns;	   /* TM cleaned-up due to IOC down   */
 615};
 616
 617struct bfa_itnim_iostats_s {
 618
 619	u32	total_ios;		/*  Total IO Requests		*/
 620	u32	input_reqs;		/*  Data in-bound requests	*/
 621	u32	output_reqs;		/*  Data out-bound requests	*/
 622	u32	io_comps;		/*  Total IO Completions	*/
 623	u32	wr_throughput;		/*  Write data transferred in bytes */
 624	u32	rd_throughput;		/*  Read data transferred in bytes  */
 625
 626	u32	iocomp_ok;		/*  Slowpath IO completions	*/
 627	u32	iocomp_underrun;	/*  IO underrun		*/
 628	u32	iocomp_overrun;		/*  IO overrun			*/
 629	u32	qwait;			/*  IO Request-Q wait		*/
 630	u32	qresumes;		/*  IO Request-Q wait done	*/
 631	u32	no_iotags;		/*  No free IO tag		*/
 632	u32	iocomp_timedout;	/*  IO timeouts		*/
 633	u32	iocom_nexus_abort;	/*  IO failure due to target offline */
 634	u32	iocom_proto_err;	/*  IO protocol errors		*/
 635	u32	iocom_dif_err;		/*  IO SBC-3 protection errors	*/
 636
 637	u32	iocom_sqer_needed;	/*  fcp-2 error recovery failed	*/
 638	u32	iocom_res_free;		/*  Delayed freeing of IO tag	*/
 639
 640
 641	u32	io_aborts;		/*  Host IO abort requests	*/
 642	u32	iocom_hostabrts;	/*  Host IO abort completions	*/
 643	u32	io_cleanups;		/*  IO clean-up requests	*/
 644	u32	path_tov_expired;	/*  IO path tov expired	*/
 645	u32	iocomp_aborted;		/*  IO abort completions	*/
 646	u32	io_iocdowns;		/*  IO cleaned-up due to IOC down */
 647	u32	iocom_utags;		/*  IO comp with unknown tags	*/
 648
 649	u32	io_tmaborts;		/*  Abort request due to TM command */
 650	u32	tm_io_comps;		/* Abort completion due to TM command */
 651
 652	u32	creates;		/*  IT Nexus create requests	*/
 653	u32	fw_create;		/*  IT Nexus FW create requests	*/
 654	u32	create_comps;		/*  IT Nexus FW create completions */
 655	u32	onlines;		/*  IT Nexus onlines		*/
 656	u32	offlines;		/*  IT Nexus offlines		*/
 657	u32	fw_delete;		/*  IT Nexus FW delete requests	*/
 658	u32	delete_comps;		/*  IT Nexus FW delete completions */
 659	u32	deletes;		/*  IT Nexus delete requests	   */
 660	u32	sler_events;		/*  SLER events		*/
 661	u32	ioc_disabled;		/*  Num IOC disables		*/
 662	u32	cleanup_comps;		/*  IT Nexus cleanup completions    */
 663
 664	u32	tm_cmnds;		/*  TM Requests		*/
 665	u32	tm_fw_rsps;		/*  TM Completions		*/
 666	u32	tm_success;		/*  TM initiated IO cleanup success */
 667	u32	tm_failures;		/*  TM initiated IO cleanup failure */
 668	u32	no_tskims;		/*  No free TM tag		*/
 669	u32	tm_qwait;		/*  TM Request-Q wait		*/
 670	u32	tm_qresumes;		/*  TM Request-Q wait done	*/
 671
 672	u32	tm_iocdowns;		/*  TM cleaned-up due to IOC down   */
 673	u32	tm_cleanups;		/*  TM cleanup requests	*/
 674	u32	tm_cleanup_comps;	/*  TM cleanup completions	*/
 675	u32	lm_lun_across_sg;	/*  LM lun is across sg data buf */
 676	u32	lm_lun_not_sup;		/*  LM lun not supported */
 677	u32	lm_rpl_data_changed;	/*  LM report-lun data changed */
 678	u32	lm_wire_residue_changed; /* LM report-lun rsp residue changed */
 679	u32	lm_small_buf_addresidue; /* LM buf smaller than reported cnt */
 680	u32	lm_lun_not_rdy;		/* LM lun not ready */
 681};
 682
 683/* Modify char* port_stt[] in bfal_port.c if a new state was added */
 684enum bfa_port_states {
 685	BFA_PORT_ST_UNINIT		= 1,
 686	BFA_PORT_ST_ENABLING_QWAIT	= 2,
 687	BFA_PORT_ST_ENABLING		= 3,
 688	BFA_PORT_ST_LINKDOWN		= 4,
 689	BFA_PORT_ST_LINKUP		= 5,
 690	BFA_PORT_ST_DISABLING_QWAIT	= 6,
 691	BFA_PORT_ST_DISABLING		= 7,
 692	BFA_PORT_ST_DISABLED		= 8,
 693	BFA_PORT_ST_STOPPED		= 9,
 694	BFA_PORT_ST_IOCDOWN		= 10,
 695	BFA_PORT_ST_IOCDIS		= 11,
 696	BFA_PORT_ST_FWMISMATCH		= 12,
 697	BFA_PORT_ST_PREBOOT_DISABLED	= 13,
 698	BFA_PORT_ST_TOGGLING_QWAIT	= 14,
 699	BFA_PORT_ST_ACQ_ADDR		= 15,
 
 
 700	BFA_PORT_ST_MAX_STATE,
 701};
 702
 703/*
 704 *	Port operational type (in sync with SNIA port type).
 705 */
 706enum bfa_port_type {
 707	BFA_PORT_TYPE_UNKNOWN	= 1,	/*  port type is unknown */
 708	BFA_PORT_TYPE_NPORT	= 5,	/*  P2P with switched fabric */
 709	BFA_PORT_TYPE_NLPORT	= 6,	/*  public loop */
 710	BFA_PORT_TYPE_LPORT	= 20,	/*  private loop */
 711	BFA_PORT_TYPE_P2P	= 21,	/*  P2P with no switched fabric */
 712	BFA_PORT_TYPE_VPORT	= 22,	/*  NPIV - virtual port */
 713};
 714
 715/*
 716 *	Port topology setting. A port's topology and fabric login status
 717 *	determine its operational type.
 718 */
 719enum bfa_port_topology {
 720	BFA_PORT_TOPOLOGY_NONE = 0,	/*  No valid topology */
 721	BFA_PORT_TOPOLOGY_P2P  = 1,	/*  P2P only */
 722	BFA_PORT_TOPOLOGY_LOOP = 2,	/*  LOOP topology */
 723	BFA_PORT_TOPOLOGY_AUTO = 3,	/*  auto topology selection */
 
 
 724};
 725
 726/*
 727 *	Physical port loopback types.
 728 */
 729enum bfa_port_opmode {
 730	BFA_PORT_OPMODE_NORMAL   = 0x00, /*  normal non-loopback mode */
 731	BFA_PORT_OPMODE_LB_INT   = 0x01, /*  internal loop back */
 732	BFA_PORT_OPMODE_LB_SLW   = 0x02, /*  serial link wrapback (serdes) */
 733	BFA_PORT_OPMODE_LB_EXT   = 0x04, /*  external loop back (serdes) */
 734	BFA_PORT_OPMODE_LB_CBL   = 0x08, /*  cabled loop back */
 735	BFA_PORT_OPMODE_LB_NLINT = 0x20, /*  NL_Port internal loopback */
 736};
 737
 738#define BFA_PORT_OPMODE_LB_HARD(_mode)			\
 739	((_mode == BFA_PORT_OPMODE_LB_INT) ||		\
 740	(_mode == BFA_PORT_OPMODE_LB_SLW) ||		\
 741	(_mode == BFA_PORT_OPMODE_LB_EXT))
 742
 743/*
 744 *	Port link state
 745 */
 746enum bfa_port_linkstate {
 747	BFA_PORT_LINKUP		= 1,	/*  Physical port/Trunk link up */
 748	BFA_PORT_LINKDOWN	= 2,	/*  Physical port/Trunk link down */
 749};
 750
 751/*
 752 *	Port link state reason code
 753 */
 754enum bfa_port_linkstate_rsn {
 755	BFA_PORT_LINKSTATE_RSN_NONE		= 0,
 756	BFA_PORT_LINKSTATE_RSN_DISABLED		= 1,
 757	BFA_PORT_LINKSTATE_RSN_RX_NOS		= 2,
 758	BFA_PORT_LINKSTATE_RSN_RX_OLS		= 3,
 759	BFA_PORT_LINKSTATE_RSN_RX_LIP		= 4,
 760	BFA_PORT_LINKSTATE_RSN_RX_LIPF7		= 5,
 761	BFA_PORT_LINKSTATE_RSN_SFP_REMOVED	= 6,
 762	BFA_PORT_LINKSTATE_RSN_PORT_FAULT	= 7,
 763	BFA_PORT_LINKSTATE_RSN_RX_LOS		= 8,
 764	BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT	= 9,
 765	BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT	= 10,
 766	BFA_PORT_LINKSTATE_RSN_TIMEOUT		= 11,
 
 767
 768
 769
 770	/* CEE related reason codes/errors */
 771	CEE_LLDP_INFO_AGED_OUT			= 20,
 772	CEE_LLDP_SHUTDOWN_TLV_RCVD		= 21,
 773	CEE_PEER_NOT_ADVERTISE_DCBX		= 22,
 774	CEE_PEER_NOT_ADVERTISE_PG		= 23,
 775	CEE_PEER_NOT_ADVERTISE_PFC		= 24,
 776	CEE_PEER_NOT_ADVERTISE_FCOE		= 25,
 777	CEE_PG_NOT_COMPATIBLE			= 26,
 778	CEE_PFC_NOT_COMPATIBLE			= 27,
 779	CEE_FCOE_NOT_COMPATIBLE			= 28,
 780	CEE_BAD_PG_RCVD				= 29,
 781	CEE_BAD_BW_RCVD				= 30,
 782	CEE_BAD_PFC_RCVD			= 31,
 783	CEE_BAD_APP_PRI_RCVD			= 32,
 784	CEE_FCOE_PRI_PFC_OFF			= 33,
 785	CEE_DUP_CONTROL_TLV_RCVD		= 34,
 786	CEE_DUP_FEAT_TLV_RCVD			= 35,
 787	CEE_APPLY_NEW_CFG			= 36, /* reason, not error */
 788	CEE_PROTOCOL_INIT			= 37, /* reason, not error */
 789	CEE_PHY_LINK_DOWN			= 38,
 790	CEE_LLS_FCOE_ABSENT			= 39,
 791	CEE_LLS_FCOE_DOWN			= 40,
 792	CEE_ISCSI_NOT_COMPATIBLE		= 41,
 793	CEE_ISCSI_PRI_PFC_OFF			= 42,
 794	CEE_ISCSI_PRI_OVERLAP_FCOE_PRI		= 43
 795};
 796
 797#define MAX_LUN_MASK_CFG 16
 798
 799/*
 800 * Initially flash content may be fff. On making LUN mask enable and disable
 801 * state chnage.  when report lun command is being processed it goes from
 802 * BFA_LUN_MASK_ACTIVE to BFA_LUN_MASK_FETCH and comes back to
 803 * BFA_LUN_MASK_ACTIVE.
 804 */
 805enum bfa_ioim_lun_mask_state_s {
 806	BFA_IOIM_LUN_MASK_INACTIVE = 0,
 807	BFA_IOIM_LUN_MASK_ACTIVE = 1,
 808	BFA_IOIM_LUN_MASK_FETCHED = 2,
 809};
 810
 811enum bfa_lunmask_state_s {
 812	BFA_LUNMASK_DISABLED = 0x00,
 813	BFA_LUNMASK_ENABLED = 0x01,
 814	BFA_LUNMASK_MINCFG = 0x02,
 815	BFA_LUNMASK_UNINITIALIZED = 0xff,
 816};
 817
 
 
 
 
 
 
 
 
 
 818#pragma pack(1)
 819/*
 820 * LUN mask configuration
 821 */
 822struct bfa_lun_mask_s {
 823	wwn_t		lp_wwn;
 824	wwn_t		rp_wwn;
 825	struct scsi_lun	lun;
 826	u8		ua;
 827	u8		rsvd[3];
 828	u16		rp_tag;
 829	u8		lp_tag;
 830	u8		state;
 831};
 832
 833#define MAX_LUN_MASK_CFG 16
 834struct bfa_lunmask_cfg_s {
 835	u32	status;
 836	u32	rsvd;
 837	struct bfa_lun_mask_s	lun_list[MAX_LUN_MASK_CFG];
 838};
 839
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 840/*
 841 *      Physical port configuration
 842 */
 843struct bfa_port_cfg_s {
 844	u8	 topology;	/*  bfa_port_topology		*/
 845	u8	 speed;		/*  enum bfa_port_speed	*/
 846	u8	 trunked;	/*  trunked or not		*/
 847	u8	 qos_enabled;	/*  qos enabled or not		*/
 848	u8	 cfg_hardalpa;	/*  is hard alpa configured	*/
 849	u8	 hardalpa;	/*  configured hard alpa	*/
 850	__be16	 maxfrsize;	/*  maximum frame size		*/
 851	u8	 rx_bbcredit;	/*  receive buffer credits	*/
 852	u8	 tx_bbcredit;	/*  transmit buffer credits	*/
 853	u8	 ratelimit;	/*  ratelimit enabled or not	*/
 854	u8	 trl_def_speed;	/*  ratelimit default speed	*/
 855	u8	bb_scn;		/*  BB_SCN value from FLOGI Exchg */
 856	u8	bb_scn_state;	/*  Config state of BB_SCN */
 857	u8	faa_state;	/*  FAA enabled/disabled        */
 858	u8	rsvd[1];
 859	u16 path_tov;	/*  device path timeout	*/
 860	u16 q_depth;	/*  SCSI Queue depth		*/
 
 861};
 862#pragma pack()
 863
 864/*
 865 *	Port attribute values.
 866 */
 867struct bfa_port_attr_s {
 868	/*
 869	 * Static fields
 870	 */
 871	wwn_t	   nwwn;		/*  node wwn */
 872	wwn_t	   pwwn;		/*  port wwn */
 873	wwn_t	   factorynwwn;	/*  factory node wwn */
 874	wwn_t	   factorypwwn;	/*  factory port wwn */
 875	enum fc_cos	cos_supported;	/*  supported class of services */
 876	u32	rsvd;
 
 877	struct fc_symname_s	port_symname;	/*  port symbolic name */
 878	enum bfa_port_speed speed_supported; /*  supported speeds */
 879	bfa_boolean_t   pbind_enabled;
 880
 881	/*
 882	 * Configured values
 883	 */
 884	struct bfa_port_cfg_s pport_cfg;	/*  pport cfg */
 885
 886	/*
 887	 * Dynamic field - info from BFA
 888	 */
 889	enum bfa_port_states	port_state;	/*  current port state */
 890	enum bfa_port_speed	speed;		/*  current speed */
 891	enum bfa_port_topology	topology;	/*  current topology */
 892	bfa_boolean_t		beacon;		/*  current beacon status */
 893	bfa_boolean_t		link_e2e_beacon; /*  link beacon is on */
 894	bfa_boolean_t	bbsc_op_status;	/* fc credit recovery oper state */
 
 
 895
 896	/*
 897	 * Dynamic field - info from FCS
 898	 */
 899	u32		pid;		/*  port ID */
 900	enum bfa_port_type	port_type;	/*  current topology */
 901	u32		loopback;	/*  external loopback */
 902	u32		authfail;	/*  auth fail state */
 903
 904	/* FCoE specific  */
 905	u16		fcoe_vlan;
 906	u8			rsvd1[2];
 907};
 908
 909/*
 910 *	      Port FCP mappings.
 911 */
 912struct bfa_port_fcpmap_s {
 913	char		osdevname[256];
 914	u32	bus;
 915	u32	target;
 916	u32	oslun;
 917	u32	fcid;
 918	wwn_t	   nwwn;
 919	wwn_t	   pwwn;
 920	u64	fcplun;
 921	char		luid[256];
 922};
 923
 924/*
 925 *	      Port RNID info.
 926 */
 927struct bfa_port_rnid_s {
 928	wwn_t	     wwn;
 929	u32	  unittype;
 930	u32	  portid;
 931	u32	  attached_nodes_num;
 932	u16	  ip_version;
 933	u16	  udp_port;
 934	u8	   ipaddr[16];
 935	u16	  rsvd;
 936	u16	  topologydiscoveryflags;
 937};
 938
 939#pragma pack(1)
 940struct bfa_fcport_fcf_s {
 941	wwn_t	   name;	   /*  FCF name		 */
 942	wwn_t	   fabric_name;    /*  Fabric Name	      */
 943	u8		fipenabled;	/*  FIP enabled or not */
 944	u8		fipfailed;	/*  FIP failed or not	*/
 945	u8		resv[2];
 946	u8	 pri;	    /*  FCF priority	     */
 947	u8	 version;	/*  FIP version used	 */
 948	u8	 available;      /*  Available  for  login    */
 949	u8	 fka_disabled;   /*  FKA is disabled	  */
 950	u8	 maxsz_verified; /*  FCoE max size verified   */
 951	u8	 fc_map[3];      /*  FC map		   */
 952	__be16	 vlan;	   /*  FCoE vlan tag/priority   */
 953	u32	fka_adv_per;    /*  FIP  ka advert. period   */
 954	mac_t	   mac;	    /*  FCF mac		  */
 955};
 956
 957/*
 958 *	Trunk states for BCU/BFAL
 959 */
 960enum bfa_trunk_state {
 961	BFA_TRUNK_DISABLED	= 0,	/*  Trunk is not configured	*/
 962	BFA_TRUNK_ONLINE	= 1,	/*  Trunk is online		*/
 963	BFA_TRUNK_OFFLINE	= 2,	/*  Trunk is offline		*/
 964};
 965
 966/*
 967 *	VC attributes for trunked link
 968 */
 969struct bfa_trunk_vc_attr_s {
 970	u32 bb_credit;
 971	u32 elp_opmode_flags;
 972	u32 req_credit;
 973	u16 vc_credits[8];
 974};
 975
 
 
 
 
 
 
 
 976/*
 977 *	Link state information
 978 */
 979struct bfa_port_link_s {
 980	u8	 linkstate;	/*  Link state bfa_port_linkstate */
 981	u8	 linkstate_rsn;	/*  bfa_port_linkstate_rsn_t */
 982	u8	 topology;	/*  P2P/LOOP bfa_port_topology */
 983	u8	 speed;		/*  Link speed (1/2/4/8 G) */
 984	u32	linkstate_opt;  /*  Linkstate optional data (debug) */
 985	u8	 trunked;	/*  Trunked or not (1 or 0) */
 986	u8	 resvd[3];
 
 987	struct bfa_qos_attr_s  qos_attr;   /* QoS Attributes */
 988	union {
 989		struct bfa_qos_vc_attr_s qos_vc_attr;  /*  VC info from ELP */
 990		struct bfa_trunk_vc_attr_s trunk_vc_attr;
 991		struct bfa_fcport_fcf_s fcf; /*  FCF information (for FCoE) */
 992	} vc_fcf;
 
 
 
 
 
 
 993};
 994#pragma pack()
 995
 996enum bfa_trunk_link_fctl {
 997	BFA_TRUNK_LINK_FCTL_NORMAL,
 998	BFA_TRUNK_LINK_FCTL_VC,
 999	BFA_TRUNK_LINK_FCTL_VC_QOS,
1000};
1001
1002enum bfa_trunk_link_state {
1003	BFA_TRUNK_LINK_STATE_UP = 1,		/* link part of trunk */
1004	BFA_TRUNK_LINK_STATE_DN_LINKDN = 2,	/* physical link down */
1005	BFA_TRUNK_LINK_STATE_DN_GRP_MIS = 3,	/* trunk group different */
1006	BFA_TRUNK_LINK_STATE_DN_SPD_MIS = 4,	/* speed mismatch */
1007	BFA_TRUNK_LINK_STATE_DN_MODE_MIS = 5,	/* remote port not trunked */
1008};
1009
1010#define BFA_TRUNK_MAX_PORTS	2
1011struct bfa_trunk_link_attr_s {
1012	wwn_t    trunk_wwn;
1013	enum bfa_trunk_link_fctl fctl;
1014	enum bfa_trunk_link_state link_state;
1015	enum bfa_port_speed	speed;
1016	u32 deskew;
1017};
1018
1019struct bfa_trunk_attr_s {
1020	enum bfa_trunk_state	state;
1021	enum bfa_port_speed	speed;
1022	u32		port_id;
1023	u32		rsvd;
1024	struct bfa_trunk_link_attr_s link_attr[BFA_TRUNK_MAX_PORTS];
1025};
1026
1027struct bfa_rport_hal_stats_s {
1028	u32        sm_un_cr;	    /*  uninit: create events      */
1029	u32        sm_un_unexp;	    /*  uninit: exception events   */
1030	u32        sm_cr_on;	    /*  created: online events     */
1031	u32        sm_cr_del;	    /*  created: delete events     */
1032	u32        sm_cr_hwf;	    /*  created: IOC down          */
1033	u32        sm_cr_unexp;	    /*  created: exception events  */
1034	u32        sm_fwc_rsp;	    /*  fw create: f/w responses   */
1035	u32        sm_fwc_del;	    /*  fw create: delete events   */
1036	u32        sm_fwc_off;	    /*  fw create: offline events  */
1037	u32        sm_fwc_hwf;	    /*  fw create: IOC down        */
1038	u32        sm_fwc_unexp;	    /*  fw create: exception events*/
1039	u32        sm_on_off;	    /*  online: offline events     */
1040	u32        sm_on_del;	    /*  online: delete events      */
1041	u32        sm_on_hwf;	    /*  online: IOC down events    */
1042	u32        sm_on_unexp;	    /*  online: exception events   */
1043	u32        sm_fwd_rsp;	    /*  fw delete: fw responses    */
1044	u32        sm_fwd_del;	    /*  fw delete: delete events   */
1045	u32        sm_fwd_hwf;	    /*  fw delete: IOC down events */
1046	u32        sm_fwd_unexp;	    /*  fw delete: exception events*/
1047	u32        sm_off_del;	    /*  offline: delete events     */
1048	u32        sm_off_on;	    /*  offline: online events     */
1049	u32        sm_off_hwf;	    /*  offline: IOC down events   */
1050	u32        sm_off_unexp;	    /*  offline: exception events  */
1051	u32        sm_del_fwrsp;	    /*  delete: fw responses       */
1052	u32        sm_del_hwf;	    /*  delete: IOC down events    */
1053	u32        sm_del_unexp;	    /*  delete: exception events   */
1054	u32        sm_delp_fwrsp;	    /*  delete pend: fw responses  */
1055	u32        sm_delp_hwf;	    /*  delete pend: IOC downs     */
1056	u32        sm_delp_unexp;	    /*  delete pend: exceptions    */
1057	u32        sm_offp_fwrsp;	    /*  off-pending: fw responses  */
1058	u32        sm_offp_del;	    /*  off-pending: deletes       */
1059	u32        sm_offp_hwf;	    /*  off-pending: IOC downs     */
1060	u32        sm_offp_unexp;	    /*  off-pending: exceptions    */
1061	u32        sm_iocd_off;	    /*  IOC down: offline events   */
1062	u32        sm_iocd_del;	    /*  IOC down: delete events    */
1063	u32        sm_iocd_on;	    /*  IOC down: online events    */
1064	u32        sm_iocd_unexp;	    /*  IOC down: exceptions       */
1065	u32        rsvd;
1066};
1067#pragma pack(1)
1068/*
1069 *  Rport's QoS attributes
1070 */
1071struct bfa_rport_qos_attr_s {
1072	u8			qos_priority;  /*  rport's QoS priority   */
1073	u8			rsvd[3];
1074	u32	       qos_flow_id;	  /*  QoS flow Id	 */
1075};
1076#pragma pack()
1077
1078#define BFA_IOBUCKET_MAX 14
1079
1080struct bfa_itnim_latency_s {
1081	u32 min[BFA_IOBUCKET_MAX];
1082	u32 max[BFA_IOBUCKET_MAX];
1083	u32 count[BFA_IOBUCKET_MAX];
1084	u32 avg[BFA_IOBUCKET_MAX];
1085};
1086
1087struct bfa_itnim_ioprofile_s {
1088	u32 clock_res_mul;
1089	u32 clock_res_div;
1090	u32 index;
1091	u32 io_profile_start_time;	/*  IO profile start time	*/
1092	u32 iocomps[BFA_IOBUCKET_MAX];	/*  IO completed	*/
1093	struct bfa_itnim_latency_s io_latency;
1094};
1095
1096/*
1097 *	vHBA port attribute values.
1098 */
1099struct bfa_vhba_attr_s {
1100	wwn_t	nwwn;       /* node wwn */
1101	wwn_t	pwwn;       /* port wwn */
1102	u32	pid;        /* port ID */
1103	bfa_boolean_t       io_profile; /* get it from fcpim mod */
1104	bfa_boolean_t       plog_enabled;   /* portlog is enabled */
1105	u16	path_tov;
1106	u8	rsvd[2];
1107};
1108
1109/*
1110 * FC physical port statistics.
1111 */
1112struct bfa_port_fc_stats_s {
1113	u64     secs_reset;     /*  Seconds since stats is reset */
1114	u64     tx_frames;      /*  Tx frames                   */
1115	u64     tx_words;       /*  Tx words                    */
1116	u64     tx_lip;         /*  Tx LIP                      */
 
 
 
1117	u64     tx_nos;         /*  Tx NOS                      */
1118	u64     tx_ols;         /*  Tx OLS                      */
1119	u64     tx_lr;          /*  Tx LR                       */
1120	u64     tx_lrr;         /*  Tx LRR                      */
1121	u64     rx_frames;      /*  Rx frames                   */
1122	u64     rx_words;       /*  Rx words                    */
1123	u64     lip_count;      /*  Rx LIP                      */
 
 
 
1124	u64     nos_count;      /*  Rx NOS                      */
1125	u64     ols_count;      /*  Rx OLS                      */
1126	u64     lr_count;       /*  Rx LR                       */
1127	u64     lrr_count;      /*  Rx LRR                      */
1128	u64     invalid_crcs;   /*  Rx CRC err frames           */
1129	u64     invalid_crc_gd_eof; /*  Rx CRC err good EOF frames */
1130	u64     undersized_frm; /*  Rx undersized frames        */
1131	u64     oversized_frm;  /*  Rx oversized frames */
1132	u64     bad_eof_frm;    /*  Rx frames with bad EOF      */
1133	u64     error_frames;   /*  Errored frames              */
1134	u64     dropped_frames; /*  Dropped frames              */
1135	u64     link_failures;  /*  Link Failure (LF) count     */
1136	u64     loss_of_syncs;  /*  Loss of sync count          */
1137	u64     loss_of_signals; /*  Loss of signal count       */
1138	u64     primseq_errs;   /*  Primitive sequence protocol err. */
1139	u64     bad_os_count;   /*  Invalid ordered sets        */
1140	u64     err_enc_out;    /*  Encoding err nonframe_8b10b */
1141	u64     err_enc;        /*  Encoding err frame_8b10b    */
1142	u64	bbsc_frames_lost; /* Credit Recovery-Frames Lost  */
1143	u64	bbsc_credits_lost; /* Credit Recovery-Credits Lost */
1144	u64	bbsc_link_resets; /* Credit Recovery-Link Resets   */
 
 
 
1145};
1146
1147/*
1148 * Eth Physical Port statistics.
1149 */
1150struct bfa_port_eth_stats_s {
1151	u64     secs_reset;     /*  Seconds since stats is reset */
1152	u64     frame_64;       /*  Frames 64 bytes             */
1153	u64     frame_65_127;   /*  Frames 65-127 bytes */
1154	u64     frame_128_255;  /*  Frames 128-255 bytes        */
1155	u64     frame_256_511;  /*  Frames 256-511 bytes        */
1156	u64     frame_512_1023; /*  Frames 512-1023 bytes       */
1157	u64     frame_1024_1518; /*  Frames 1024-1518 bytes     */
1158	u64     frame_1519_1522; /*  Frames 1519-1522 bytes     */
1159	u64     tx_bytes;       /*  Tx bytes                    */
1160	u64     tx_packets;      /*  Tx packets         */
1161	u64     tx_mcast_packets; /*  Tx multicast packets      */
1162	u64     tx_bcast_packets; /*  Tx broadcast packets      */
1163	u64     tx_control_frame; /*  Tx control frame          */
1164	u64     tx_drop;        /*  Tx drops                    */
1165	u64     tx_jabber;      /*  Tx jabber                   */
1166	u64     tx_fcs_error;   /*  Tx FCS errors               */
1167	u64     tx_fragments;   /*  Tx fragments                */
1168	u64     rx_bytes;       /*  Rx bytes                    */
1169	u64     rx_packets;     /*  Rx packets                  */
1170	u64     rx_mcast_packets; /*  Rx multicast packets      */
1171	u64     rx_bcast_packets; /*  Rx broadcast packets      */
1172	u64     rx_control_frames; /*  Rx control frames        */
1173	u64     rx_unknown_opcode; /*  Rx unknown opcode        */
1174	u64     rx_drop;        /*  Rx drops                    */
1175	u64     rx_jabber;      /*  Rx jabber                   */
1176	u64     rx_fcs_error;   /*  Rx FCS errors               */
1177	u64     rx_alignment_error; /*  Rx alignment errors     */
1178	u64     rx_frame_length_error; /*  Rx frame len errors  */
1179	u64     rx_code_error;  /*  Rx code errors              */
1180	u64     rx_fragments;   /*  Rx fragments                */
1181	u64     rx_pause;       /*  Rx pause                    */
1182	u64     rx_zero_pause;  /*  Rx zero pause               */
1183	u64     tx_pause;       /*  Tx pause                    */
1184	u64     tx_zero_pause;  /*  Tx zero pause               */
1185	u64     rx_fcoe_pause;  /*  Rx FCoE pause               */
1186	u64     rx_fcoe_zero_pause; /*  Rx FCoE zero pause      */
1187	u64     tx_fcoe_pause;  /*  Tx FCoE pause               */
1188	u64     tx_fcoe_zero_pause; /*  Tx FCoE zero pause      */
1189	u64     rx_iscsi_pause; /*  Rx iSCSI pause              */
1190	u64     rx_iscsi_zero_pause; /*  Rx iSCSI zero pause    */
1191	u64     tx_iscsi_pause; /*  Tx iSCSI pause              */
1192	u64     tx_iscsi_zero_pause; /*  Tx iSCSI zero pause    */
1193};
1194
1195/*
1196 *              Port statistics.
1197 */
1198union bfa_port_stats_u {
1199	struct bfa_port_fc_stats_s      fc;
1200	struct bfa_port_eth_stats_s     eth;
1201};
1202
1203struct bfa_port_cfg_mode_s {
1204	u16		max_pf;
1205	u16		max_vf;
1206	enum bfa_mode_s	mode;
1207};
1208
1209#pragma pack(1)
1210
1211#define BFA_CEE_LLDP_MAX_STRING_LEN	(128)
1212#define BFA_CEE_DCBX_MAX_PRIORITY	(8)
1213#define BFA_CEE_DCBX_MAX_PGID		(8)
1214
1215struct bfa_cee_lldp_str_s {
1216	u8	sub_type;
1217	u8	len;
1218	u8	rsvd[2];
1219	u8	value[BFA_CEE_LLDP_MAX_STRING_LEN];
1220};
1221
1222struct bfa_cee_lldp_cfg_s {
1223	struct bfa_cee_lldp_str_s chassis_id;
1224	struct bfa_cee_lldp_str_s port_id;
1225	struct bfa_cee_lldp_str_s port_desc;
1226	struct bfa_cee_lldp_str_s sys_name;
1227	struct bfa_cee_lldp_str_s sys_desc;
1228	struct bfa_cee_lldp_str_s mgmt_addr;
1229	u16	time_to_live;
1230	u16	enabled_system_cap;
1231};
1232
1233/* CEE/DCBX parameters */
1234struct bfa_cee_dcbx_cfg_s {
1235	u8	pgid[BFA_CEE_DCBX_MAX_PRIORITY];
1236	u8	pg_percentage[BFA_CEE_DCBX_MAX_PGID];
1237	u8	pfc_primap; /* bitmap of priorties with PFC enabled */
1238	u8	fcoe_primap; /* bitmap of priorities used for FcoE traffic */
1239	u8	iscsi_primap; /* bitmap of priorities used for iSCSI traffic */
1240	u8	dcbx_version; /* operating version:CEE or preCEE */
1241	u8	lls_fcoe; /* FCoE Logical Link Status */
1242	u8	lls_lan; /* LAN Logical Link Status */
1243	u8	rsvd[2];
1244};
1245
1246/* CEE Query */
1247struct bfa_cee_attr_s {
1248	u8	cee_status;
1249	u8	error_reason;
1250	struct bfa_cee_lldp_cfg_s lldp_remote;
1251	struct bfa_cee_dcbx_cfg_s dcbx_remote;
1252	mac_t src_mac;
1253	u8	link_speed;
1254	u8	nw_priority;
1255	u8	filler[2];
1256};
1257
1258/* LLDP/DCBX/CEE Statistics */
1259struct bfa_cee_stats_s {
1260	u32		lldp_tx_frames;		/* LLDP Tx Frames */
1261	u32		lldp_rx_frames;		/* LLDP Rx Frames */
1262	u32		lldp_rx_frames_invalid; /* LLDP Rx Frames invalid */
1263	u32		lldp_rx_frames_new;     /* LLDP Rx Frames new */
1264	u32		lldp_tlvs_unrecognized; /* LLDP Rx unrecog. TLVs */
1265	u32		lldp_rx_shutdown_tlvs;  /* LLDP Rx shutdown TLVs */
1266	u32		lldp_info_aged_out;     /* LLDP remote info aged */
1267	u32		dcbx_phylink_ups;       /* DCBX phy link ups */
1268	u32		dcbx_phylink_downs;     /* DCBX phy link downs */
1269	u32		dcbx_rx_tlvs;           /* DCBX Rx TLVs */
1270	u32		dcbx_rx_tlvs_invalid;   /* DCBX Rx TLVs invalid */
1271	u32		dcbx_control_tlv_error; /* DCBX control TLV errors */
1272	u32		dcbx_feature_tlv_error; /* DCBX feature TLV errors */
1273	u32		dcbx_cee_cfg_new;       /* DCBX new CEE cfg rcvd */
1274	u32		cee_status_down;        /* DCB status down */
1275	u32		cee_status_up;          /* DCB status up */
1276	u32		cee_hw_cfg_changed;     /* DCB hw cfg changed */
1277	u32		cee_rx_invalid_cfg;     /* DCB invalid cfg */
1278};
1279
1280#pragma pack()
1281
1282/*
1283 *			AEN related definitions
1284 */
1285#define BFAD_NL_VENDOR_ID (((u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) \
1286			   | BFA_PCI_VENDOR_ID_BROCADE)
1287
1288/* BFA remote port events */
1289enum bfa_rport_aen_event {
1290	BFA_RPORT_AEN_ONLINE     = 1,   /* RPort online event */
1291	BFA_RPORT_AEN_OFFLINE    = 2,   /* RPort offline event */
1292	BFA_RPORT_AEN_DISCONNECT = 3,   /* RPort disconnect event */
1293	BFA_RPORT_AEN_QOS_PRIO   = 4,   /* QOS priority change event */
1294	BFA_RPORT_AEN_QOS_FLOWID = 5,   /* QOS flow Id change event */
1295};
1296
1297struct bfa_rport_aen_data_s {
1298	u16             vf_id;  /* vf_id of this logical port */
1299	u16             rsvd[3];
1300	wwn_t           ppwwn;  /* WWN of its physical port */
1301	wwn_t           lpwwn;  /* WWN of this logical port */
1302	wwn_t           rpwwn;  /* WWN of this remote port */
1303	union {
1304		struct bfa_rport_qos_attr_s qos;
1305	} priv;
1306};
1307
1308union bfa_aen_data_u {
1309	struct bfa_adapter_aen_data_s	adapter;
1310	struct bfa_port_aen_data_s	port;
1311	struct bfa_lport_aen_data_s	lport;
1312	struct bfa_rport_aen_data_s	rport;
1313	struct bfa_itnim_aen_data_s	itnim;
1314	struct bfa_audit_aen_data_s	audit;
1315	struct bfa_ioc_aen_data_s	ioc;
1316};
1317
1318#define BFA_AEN_MAX_ENTRY	512
1319
1320struct bfa_aen_entry_s {
1321	struct list_head	qe;
1322	enum bfa_aen_category   aen_category;
1323	u32                     aen_type;
1324	union bfa_aen_data_u    aen_data;
1325	struct timeval          aen_tv;
1326	u32                     seq_num;
1327	u32                     bfad_num;
1328};
1329
1330#endif /* __BFA_DEFS_SVC_H__ */
v4.6
   1/*
   2 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
   3 * Copyright (c) 2014- QLogic Corporation.
   4 * All rights reserved
   5 * www.qlogic.com
   6 *
   7 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
   8 *
   9 * This program is free software; you can redistribute it and/or modify it
  10 * under the terms of the GNU General Public License (GPL) Version 2 as
  11 * published by the Free Software Foundation
  12 *
  13 * This program is distributed in the hope that it will be useful, but
  14 * WITHOUT ANY WARRANTY; without even the implied warranty of
  15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16 * General Public License for more details.
  17 */
  18
  19#ifndef __BFA_DEFS_SVC_H__
  20#define __BFA_DEFS_SVC_H__
  21
  22#include "bfa_defs.h"
  23#include "bfa_fc.h"
  24#include "bfi.h"
  25
  26#define BFA_IOCFC_INTR_DELAY	1125
  27#define BFA_IOCFC_INTR_LATENCY	225
  28#define BFA_IOCFCOE_INTR_DELAY	25
  29#define BFA_IOCFCOE_INTR_LATENCY 5
  30
  31/*
  32 * Interrupt coalescing configuration.
  33 */
  34#pragma pack(1)
  35struct bfa_iocfc_intr_attr_s {
  36	u8		coalesce;	/*  enable/disable coalescing */
  37	u8		rsvd[3];
  38	__be16		latency;	/*  latency in microseconds   */
  39	__be16		delay;		/*  delay in microseconds     */
  40};
  41
  42/*
  43 * IOC firmware configuraton
  44 */
  45struct bfa_iocfc_fwcfg_s {
  46	u16		num_fabrics;	/*  number of fabrics		*/
  47	u16		num_lports;	/*  number of local lports	*/
  48	u16		num_rports;	/*  number of remote ports	*/
  49	u16		num_ioim_reqs;	/*  number of IO reqs		*/
  50	u16		num_tskim_reqs;	/*  task management requests	*/
  51	u16		num_fwtio_reqs;	/* number of TM IO reqs in FW   */
  52	u16		num_fcxp_reqs;	/*  unassisted FC exchanges	*/
  53	u16		num_uf_bufs;	/*  unsolicited recv buffers	*/
  54	u8		num_cqs;
  55	u8		fw_tick_res;	/*  FW clock resolution in ms */
  56	u8		rsvd[6];
  57};
  58#pragma pack()
  59
  60struct bfa_iocfc_drvcfg_s {
  61	u16		num_reqq_elems;	/*  number of req queue elements */
  62	u16		num_rspq_elems;	/*  number of rsp queue elements */
  63	u16		num_sgpgs;	/*  number of total SG pages	 */
  64	u16		num_sboot_tgts;	/*  number of SAN boot targets	 */
  65	u16		num_sboot_luns;	/*  number of SAN boot luns	 */
  66	u16		ioc_recover;	/*  IOC recovery mode		 */
  67	u16		min_cfg;	/*  minimum configuration	 */
  68	u16		path_tov;	/*  device path timeout		*/
  69	u16		num_tio_reqs;	/* number of TM IO reqs	*/
  70	u8		port_mode;
  71	u8		rsvd_a;
  72	bfa_boolean_t	delay_comp;	/* delay completion of failed
  73					 * inflight IOs */
  74	u16		num_ttsk_reqs;	 /* TM task management requests */
  75	u32		rsvd;
  76};
  77
  78/*
  79 * IOC configuration
  80 */
  81struct bfa_iocfc_cfg_s {
  82	struct bfa_iocfc_fwcfg_s	fwcfg;	/*  firmware side config */
  83	struct bfa_iocfc_drvcfg_s	drvcfg;	/*  driver side config	  */
  84};
  85
  86/*
  87 * IOC firmware IO stats
  88 */
  89struct bfa_fw_ioim_stats_s {
  90	u32	host_abort;		/*  IO aborted by host driver*/
  91	u32	host_cleanup;		/*  IO clean up by host driver */
  92
  93	u32	fw_io_timeout;		/*  IOs timedout */
  94	u32	fw_frm_parse;		/*  frame parsed by f/w */
  95	u32	fw_frm_data;		/*  fcp_data frame parsed by f/w */
  96	u32	fw_frm_rsp;		/*  fcp_rsp frame parsed by f/w */
  97	u32	fw_frm_xfer_rdy;	/*  xfer_rdy frame parsed by f/w */
  98	u32	fw_frm_bls_acc;		/*  BLS ACC  frame parsed by f/w */
  99	u32	fw_frm_tgt_abort;	/*  target ABTS parsed by f/w */
 100	u32	fw_frm_unknown;		/*  unknown parsed by f/w */
 101	u32	fw_data_dma;		/*  f/w DMA'ed the data frame */
 102	u32	fw_frm_drop;		/*  f/w drop the frame */
 103
 104	u32	rec_timeout;		/*  FW rec timed out */
 105	u32	error_rec;		/*  FW sending rec on
 106					 *  an error condition*/
 107	u32	wait_for_si;		/*  FW wait for SI */
 108	u32	rec_rsp_inval;		/*  REC rsp invalid */
 109	u32     rec_rsp_xchg_comp;	/*  REC rsp xchg complete */
 110	u32     rec_rsp_rd_si_ownd;	/*  REC rsp read si owned */
 111
 112	u32	seqr_io_abort;		/*  target does not know cmd so abort */
 113	u32	seqr_io_retry;		/*  SEQR failed so retry IO */
 114
 115	u32	itn_cisc_upd_rsp;	/*  ITN cisc updated on fcp_rsp */
 116	u32	itn_cisc_upd_data;	/*  ITN cisc updated on fcp_data */
 117	u32	itn_cisc_upd_xfer_rdy;	/*  ITN cisc updated on fcp_data */
 118
 119	u32	fcp_data_lost;		/*  fcp data lost */
 120
 121	u32	ro_set_in_xfer_rdy;	/*  Target set RO in Xfer_rdy frame */
 122	u32	xfer_rdy_ooo_err;	/*  Out of order Xfer_rdy received */
 123	u32	xfer_rdy_unknown_err;	/*  unknown error in xfer_rdy frame */
 124
 125	u32	io_abort_timeout;	/*  ABTS timedout  */
 126	u32	sler_initiated;		/*  SLER initiated */
 127
 128	u32	unexp_fcp_rsp;		/*  fcp response in wrong state */
 129
 130	u32	fcp_rsp_under_run;	/*  fcp rsp IO underrun */
 131	u32     fcp_rsp_under_run_wr;   /*  fcp rsp IO underrun for write */
 132	u32	fcp_rsp_under_run_err;	/*  fcp rsp IO underrun error */
 133	u32     fcp_rsp_resid_inval;    /*  invalid residue */
 134	u32	fcp_rsp_over_run;	/*  fcp rsp IO overrun */
 135	u32	fcp_rsp_over_run_err;	/*  fcp rsp IO overrun error */
 136	u32	fcp_rsp_proto_err;	/*  protocol error in fcp rsp */
 137	u32	fcp_rsp_sense_err;	/*  error in sense info in fcp rsp */
 138	u32	fcp_conf_req;		/*  FCP conf requested */
 139
 140	u32	tgt_aborted_io;		/*  target initiated abort */
 141
 142	u32	ioh_edtov_timeout_event;/*  IOH edtov timer popped */
 143	u32	ioh_fcp_rsp_excp_event;	/*  IOH FCP_RSP exception */
 144	u32	ioh_fcp_conf_event;	/*  IOH FCP_CONF */
 145	u32	ioh_mult_frm_rsp_event;	/*  IOH multi_frame FCP_RSP */
 146	u32	ioh_hit_class2_event;	/*  IOH hit class2 */
 147	u32	ioh_miss_other_event;	/*  IOH miss other */
 148	u32	ioh_seq_cnt_err_event;	/*  IOH seq cnt error */
 149	u32	ioh_len_err_event;	/*  IOH len error - fcp_dl !=
 150					 *  bytes xfered */
 151	u32	ioh_seq_len_err_event;	/*  IOH seq len error */
 152	u32	ioh_data_oor_event;	/*  Data out of range */
 153	u32	ioh_ro_ooo_event;	/*  Relative offset out of range */
 154	u32	ioh_cpu_owned_event;	/*  IOH hit -iost owned by f/w */
 155	u32	ioh_unexp_frame_event;	/*  unexpected frame received
 156					 *  count */
 157	u32	ioh_err_int;		/*  IOH error int during data-phase
 158					 *  for scsi write */
 
 159};
 160
 161struct bfa_fw_tio_stats_s {
 162	u32	tio_conf_proc;	    /* TIO CONF processed */
 163	u32	tio_conf_drop;      /* TIO CONF dropped */
 164	u32	tio_cleanup_req;    /* TIO cleanup requested */
 165	u32	tio_cleanup_comp;   /* TIO cleanup completed */
 166	u32	tio_abort_rsp;      /* TIO abort response */
 167	u32	tio_abort_rsp_comp; /* TIO abort rsp completed */
 168	u32	tio_abts_req;       /* TIO ABTS requested */
 169	u32	tio_abts_ack;       /* TIO ABTS ack-ed */
 170	u32	tio_abts_ack_nocomp;/* TIO ABTS ack-ed but not completed */
 171	u32	tio_abts_tmo;       /* TIO ABTS timeout */
 172	u32	tio_snsdata_dma;    /* TIO sense data DMA */
 173	u32	tio_rxwchan_wait;   /* TIO waiting for RX wait channel */
 174	u32	tio_rxwchan_avail;  /* TIO RX wait channel available */
 175	u32	tio_hit_bls;        /* TIO IOH BLS event */
 176	u32	tio_uf_recv;        /* TIO received UF */
 177	u32	tio_rd_invalid_sm;  /* TIO read reqst in wrong state machine */
 178	u32	tio_wr_invalid_sm;  /* TIO write reqst in wrong state machine */
 179
 180	u32	ds_rxwchan_wait;    /* DS waiting for RX wait channel */
 181	u32	ds_rxwchan_avail;   /* DS RX wait channel available */
 182	u32	ds_unaligned_rd;    /* DS unaligned read */
 183	u32	ds_rdcomp_invalid_sm; /* DS read completed in wrong state
 184				       * machine */
 185	u32	ds_wrcomp_invalid_sm; /* DS write completed in wrong state
 186				       * machine */
 187	u32	ds_flush_req;       /* DS flush requested */
 188	u32	ds_flush_comp;      /* DS flush completed */
 189	u32	ds_xfrdy_exp;       /* DS XFER_RDY expired */
 190	u32	ds_seq_cnt_err;     /* DS seq cnt error */
 191	u32	ds_seq_len_err;     /* DS seq len error */
 192	u32	ds_data_oor;        /* DS data out of order */
 193	u32	ds_hit_bls;	    /* DS hit BLS */
 194	u32	ds_edtov_timer_exp; /* DS edtov expired */
 195	u32	ds_cpu_owned;       /* DS cpu owned */
 196	u32	ds_hit_class2;      /* DS hit class2 */
 197	u32	ds_length_err;      /* DS length error */
 198	u32	ds_ro_ooo_err;      /* DS relative offset out-of-order error */
 199	u32	ds_rectov_timer_exp;/* DS rectov expired */
 200	u32	ds_unexp_fr_err;    /* DS unexp frame error */
 201};
 202
 203/*
 204 * IOC firmware IO stats
 205 */
 206struct bfa_fw_io_stats_s {
 207	struct bfa_fw_ioim_stats_s	ioim_stats;
 208	struct bfa_fw_tio_stats_s	tio_stats;
 209};
 210
 211/*
 212 * IOC port firmware stats
 213 */
 214
 215struct bfa_fw_port_fpg_stats_s {
 216	u32    intr_evt;
 217	u32    intr;
 218	u32    intr_excess;
 219	u32    intr_cause0;
 220	u32    intr_other;
 221	u32    intr_other_ign;
 222	u32    sig_lost;
 223	u32    sig_regained;
 224	u32    sync_lost;
 225	u32    sync_to;
 226	u32    sync_regained;
 227	u32    div2_overflow;
 228	u32    div2_underflow;
 229	u32    efifo_overflow;
 230	u32    efifo_underflow;
 231	u32    idle_rx;
 232	u32    lrr_rx;
 233	u32    lr_rx;
 234	u32    ols_rx;
 235	u32    nos_rx;
 236	u32    lip_rx;
 237	u32    arbf0_rx;
 238	u32    arb_rx;
 239	u32    mrk_rx;
 240	u32    const_mrk_rx;
 241	u32    prim_unknown;
 242};
 243
 244
 245struct bfa_fw_port_lksm_stats_s {
 246	u32    hwsm_success;       /*  hwsm state machine success          */
 247	u32    hwsm_fails;         /*  hwsm fails                          */
 248	u32    hwsm_wdtov;         /*  hwsm timed out                      */
 249	u32    swsm_success;       /*  swsm success                        */
 250	u32    swsm_fails;         /*  swsm fails                          */
 251	u32    swsm_wdtov;         /*  swsm timed out                      */
 252	u32    busybufs;           /*  link init failed due to busybuf     */
 253	u32    buf_waits;          /*  bufwait state entries               */
 254	u32    link_fails;         /*  link failures                       */
 255	u32    psp_errors;         /*  primitive sequence protocol errors  */
 256	u32    lr_unexp;           /*  No. of times LR rx-ed unexpectedly  */
 257	u32    lrr_unexp;          /*  No. of times LRR rx-ed unexpectedly */
 258	u32    lr_tx;              /*  No. of times LR tx started          */
 259	u32    lrr_tx;             /*  No. of times LRR tx started         */
 260	u32    ols_tx;             /*  No. of times OLS tx started         */
 261	u32    nos_tx;             /*  No. of times NOS tx started         */
 262	u32    hwsm_lrr_rx;        /*  No. of times LRR rx-ed by HWSM      */
 263	u32    hwsm_lr_rx;         /*  No. of times LR rx-ed by HWSM       */
 
 264};
 265
 266struct bfa_fw_port_snsm_stats_s {
 267	u32    hwsm_success;       /*  Successful hwsm terminations        */
 268	u32    hwsm_fails;         /*  hwsm fail count                     */
 269	u32    hwsm_wdtov;         /*  hwsm timed out                      */
 270	u32    swsm_success;       /*  swsm success                        */
 271	u32    swsm_wdtov;         /*  swsm timed out                      */
 272	u32    error_resets;       /*  error resets initiated by upsm      */
 273	u32    sync_lost;          /*  Sync loss count                     */
 274	u32    sig_lost;           /*  Signal loss count                   */
 275	u32    asn8g_attempts;	   /* SNSM HWSM at 8Gbps attempts	   */
 276	u32    adapt_success;	   /* SNSM adaptation success	*/
 277	u32    adapt_fails;	   /* SNSM adaptation failures */
 278	u32    adapt_ign_fails;	   /* SNSM adaptation failures ignored */
 279};
 280
 281struct bfa_fw_port_physm_stats_s {
 282	u32    module_inserts;     /*  Module insert count                 */
 283	u32    module_xtracts;     /*  Module extracts count               */
 284	u32    module_invalids;    /*  Invalid module inserted count       */
 285	u32    module_read_ign;    /*  Module validation status ignored    */
 286	u32    laser_faults;       /*  Laser fault count                   */
 287	u32    rsvd;
 288};
 289
 290struct bfa_fw_fip_stats_s {
 291	u32    vlan_req;           /*  vlan discovery requests             */
 292	u32    vlan_notify;        /*  vlan notifications                  */
 293	u32    vlan_err;           /*  vlan response error                 */
 294	u32    vlan_timeouts;      /*  vlan disvoery timeouts              */
 295	u32    vlan_invalids;      /*  invalid vlan in discovery advert.   */
 296	u32    disc_req;           /*  Discovery solicit requests          */
 297	u32    disc_rsp;           /*  Discovery solicit response          */
 298	u32    disc_err;           /*  Discovery advt. parse errors        */
 299	u32    disc_unsol;         /*  Discovery unsolicited               */
 300	u32    disc_timeouts;      /*  Discovery timeouts                  */
 301	u32    disc_fcf_unavail;   /*  Discovery FCF Not Avail.            */
 302	u32    linksvc_unsupp;     /*  Unsupported link service req        */
 303	u32    linksvc_err;        /*  Parse error in link service req     */
 304	u32    logo_req;           /*  FIP logos received                  */
 305	u32    clrvlink_req;       /*  Clear virtual link req              */
 306	u32    op_unsupp;          /*  Unsupported FIP operation           */
 307	u32    untagged;           /*  Untagged frames (ignored)           */
 308	u32    invalid_version;    /*  Invalid FIP version                 */
 309};
 310
 311struct bfa_fw_lps_stats_s {
 312	u32    mac_invalids;       /*  Invalid mac assigned                */
 313	u32    rsvd;
 314};
 315
 316struct bfa_fw_fcoe_stats_s {
 317	u32    cee_linkups;        /*  CEE link up count                   */
 318	u32    cee_linkdns;        /*  CEE link down count                 */
 319	u32    fip_linkups;        /*  FIP link up count                   */
 320	u32    fip_linkdns;        /*  FIP link up count                   */
 321	u32    fip_fails;          /*  FIP fail count                      */
 322	u32    mac_invalids;       /*  Invalid mac assigned                */
 323};
 324
 325/*
 326 * IOC firmware FCoE port stats
 327 */
 328struct bfa_fw_fcoe_port_stats_s {
 329	struct bfa_fw_fcoe_stats_s		fcoe_stats;
 330	struct bfa_fw_fip_stats_s		fip_stats;
 331};
 332
 333/**
 334 * @brief LPSM statistics
 335 */
 336struct bfa_fw_lpsm_stats_s {
 337	u32	cls_rx;		/* LPSM cls_rx			*/
 338	u32	cls_tx;		/* LPSM cls_tx			*/
 339	u32	arbf0_rx;	/* LPSM abrf0 rcvd		*/
 340	u32	arbf0_tx;	/* LPSM abrf0 xmit		*/
 341	u32	init_rx;	/* LPSM loop init start		*/
 342	u32	unexp_hwst;	/* LPSM unknown hw state	*/
 343	u32	unexp_frame;	/* LPSM unknown_frame		*/
 344	u32	unexp_prim;	/* LPSM unexpected primitive	*/
 345	u32	prev_alpa_unavail; /* LPSM prev alpa unavailable */
 346	u32	alpa_unavail;	/* LPSM alpa not available	*/
 347	u32	lip_rx;		/* LPSM lip rcvd		*/
 348	u32	lip_f7f7_rx;	/* LPSM lip f7f7 rcvd		*/
 349	u32	lip_f8_rx;	/* LPSM lip f8 rcvd		*/
 350	u32	lip_f8f7_rx;	/* LPSM lip f8f7 rcvd		*/
 351	u32	lip_other_rx;	/* LPSM lip other rcvd		*/
 352	u32	lip_tx;		/* LPSM lip xmit		*/
 353	u32	retry_tov;	/* LPSM retry TOV		*/
 354	u32	lip_tov;	/* LPSM LIP wait TOV		*/
 355	u32	idle_tov;	/* LPSM idle wait TOV		*/
 356	u32	arbf0_tov;	/* LPSM arbfo wait TOV		*/
 357	u32	stop_loop_tov;	/* LPSM stop loop wait TOV	*/
 358	u32	lixa_tov;	/* LPSM lisa wait TOV		*/
 359	u32	lixx_tov;	/* LPSM lilp/lirp wait TOV	*/
 360	u32	cls_tov;	/* LPSM cls wait TOV		*/
 361	u32	sler;		/* LPSM SLER recvd		*/
 362	u32	failed;		/* LPSM failed			*/
 363	u32	success;	/* LPSM online			*/
 364};
 365
 366/*
 367 * IOC firmware FC uport stats
 368 */
 369struct bfa_fw_fc_uport_stats_s {
 370	struct bfa_fw_port_snsm_stats_s		snsm_stats;
 371	struct bfa_fw_port_lksm_stats_s		lksm_stats;
 372	struct bfa_fw_lpsm_stats_s		lpsm_stats;
 373};
 374
 375/*
 376 * IOC firmware FC port stats
 377 */
 378union bfa_fw_fc_port_stats_s {
 379	struct bfa_fw_fc_uport_stats_s		fc_stats;
 380	struct bfa_fw_fcoe_port_stats_s		fcoe_stats;
 381};
 382
 383/*
 384 * IOC firmware port stats
 385 */
 386struct bfa_fw_port_stats_s {
 387	struct bfa_fw_port_fpg_stats_s		fpg_stats;
 388	struct bfa_fw_port_physm_stats_s	physm_stats;
 389	union  bfa_fw_fc_port_stats_s		fc_port;
 390};
 391
 392/*
 393 * fcxchg module statistics
 394 */
 395struct bfa_fw_fcxchg_stats_s {
 396	u32	ua_tag_inv;
 397	u32	ua_state_inv;
 398};
 399
 
 
 
 
 
 400/*
 401 *  Trunk statistics
 402 */
 403struct bfa_fw_trunk_stats_s {
 404	u32 emt_recvd;		/*  Trunk EMT received		*/
 405	u32 emt_accepted;	/*  Trunk EMT Accepted		*/
 406	u32 emt_rejected;	/*  Trunk EMT rejected		*/
 407	u32 etp_recvd;		/*  Trunk ETP received		*/
 408	u32 etp_accepted;	/*  Trunk ETP Accepted		*/
 409	u32 etp_rejected;	/*  Trunk ETP rejected		*/
 410	u32 lr_recvd;		/*  Trunk LR received		*/
 411	u32 rsvd;		/*  padding for 64 bit alignment */
 412};
 413
 414struct bfa_fw_aport_stats_s {
 415	u32 flogi_sent;		/*  Flogi sent			*/
 416	u32 flogi_acc_recvd;	/*  Flogi Acc received		*/
 417	u32 flogi_rjt_recvd;	/*  Flogi rejects received	*/
 418	u32 flogi_retries;	/*  Flogi retries		*/
 419
 420	u32 elp_recvd;		/*  ELP received		*/
 421	u32 elp_accepted;	/*  ELP Accepted		*/
 422	u32 elp_rejected;	/*  ELP rejected		*/
 423	u32 elp_dropped;	/*  ELP dropped			*/
 424
 425	u32 bbcr_lr_count;	/*!< BBCR Link Resets		*/
 426	u32 frame_lost_intrs;	/*!< BBCR Frame loss intrs	*/
 427	u32 rrdy_lost_intrs;	/*!< BBCR Rrdy loss intrs	*/
 428
 429	u32 rsvd;
 430};
 431
 432/*
 433 * IOCFC firmware stats
 434 */
 435struct bfa_fw_iocfc_stats_s {
 436	u32	cfg_reqs;	/*  cfg request */
 437	u32	updq_reqs;	/*  update queue request */
 438	u32	ic_reqs;	/*  interrupt coalesce reqs */
 439	u32	unknown_reqs;
 440	u32	set_intr_reqs;	/*  set interrupt reqs */
 441};
 442
 443/*
 444 * IOC attributes returned in queries
 445 */
 446struct bfa_iocfc_attr_s {
 447	struct bfa_iocfc_cfg_s		config;		/*  IOCFC config   */
 448	struct bfa_iocfc_intr_attr_s	intr_attr;	/*  interrupt attr */
 449};
 450
 451/*
 452 * Eth_sndrcv mod stats
 453 */
 454struct bfa_fw_eth_sndrcv_stats_s {
 455	u32	crc_err;
 456	u32	rsvd;		/*  64bit align    */
 457};
 458
 459/*
 460 * CT MAC mod stats
 461 */
 462struct bfa_fw_mac_mod_stats_s {
 463	u32	mac_on;		/*  MAC got turned-on */
 464	u32	link_up;	/*  link-up */
 465	u32	signal_off;	/*  lost signal */
 466	u32	dfe_on;		/*  DFE on */
 467	u32	mac_reset;	/*  # of MAC reset to bring lnk up */
 468	u32	pcs_reset;	/*  # of PCS reset to bring lnk up */
 469	u32	loopback;	/*  MAC got into serdes loopback */
 470	u32	lb_mac_reset;
 471			/*  # of MAC reset to bring link up in loopback */
 472	u32	lb_pcs_reset;
 473			/*  # of PCS reset to bring link up in loopback */
 474	u32	rsvd;		/*  64bit align    */
 475};
 476
 477/*
 478 * CT MOD stats
 479 */
 480struct bfa_fw_ct_mod_stats_s {
 481	u32	rxa_rds_undrun;	/*  RxA RDS underrun */
 482	u32	rad_bpc_ovfl;	/*  RAD BPC overflow */
 483	u32	rad_rlb_bpc_ovfl; /*  RAD RLB BPC overflow */
 484	u32	bpc_fcs_err;	/*  BPC FCS_ERR */
 485	u32	txa_tso_hdr;	/*  TxA TSO header too long */
 486	u32	rsvd;		/*  64bit align    */
 487};
 488
 489/*
 490 * RDS mod stats
 491 */
 492struct bfa_fw_rds_stats_s {
 493	u32	no_fid_drop_err; /* RDS no fid drop error */
 494	u32	rsvd;		 /* 64bit align */
 495};
 496
 497/*
 498 * IOC firmware stats
 499 */
 500struct bfa_fw_stats_s {
 501	struct bfa_fw_ioc_stats_s	ioc_stats;
 502	struct bfa_fw_iocfc_stats_s	iocfc_stats;
 503	struct bfa_fw_io_stats_s	io_stats;
 504	struct bfa_fw_port_stats_s	port_stats;
 505	struct bfa_fw_fcxchg_stats_s	fcxchg_stats;
 
 506	struct bfa_fw_lps_stats_s	lps_stats;
 507	struct bfa_fw_trunk_stats_s	trunk_stats;
 508	struct bfa_fw_aport_stats_s	aport_stats;
 509	struct bfa_fw_mac_mod_stats_s	macmod_stats;
 510	struct bfa_fw_ct_mod_stats_s	ctmod_stats;
 511	struct bfa_fw_eth_sndrcv_stats_s	ethsndrcv_stats;
 512	struct bfa_fw_rds_stats_s	rds_stats;
 513};
 514
 515#define BFA_IOCFC_PATHTOV_MAX	60
 516#define BFA_IOCFC_QDEPTH_MAX	2000
 517
 518/*
 519 * QoS states
 520 */
 521enum bfa_qos_state {
 522	BFA_QOS_DISABLED = 0,		/* QoS is disabled */
 523	BFA_QOS_ONLINE = 1,		/*  QoS is online */
 524	BFA_QOS_OFFLINE = 2,		/*  QoS is offline */
 525};
 526
 527/*
 528 * QoS  Priority levels.
 529 */
 530enum bfa_qos_priority {
 531	BFA_QOS_UNKNOWN = 0,
 532	BFA_QOS_HIGH  = 1,	/*  QoS Priority Level High */
 533	BFA_QOS_MED  =  2,	/*  QoS Priority Level Medium */
 534	BFA_QOS_LOW  =  3,	/*  QoS Priority Level Low */
 535};
 536
 537/*
 538 * QoS  bandwidth allocation for each priority level
 539 */
 540enum bfa_qos_bw_alloc {
 541	BFA_QOS_BW_HIGH  = 60,	/*  bandwidth allocation for High */
 542	BFA_QOS_BW_MED  =  30,	/*  bandwidth allocation for Medium */
 543	BFA_QOS_BW_LOW  =  10,	/*  bandwidth allocation for Low */
 544};
 545#pragma pack(1)
 546
 547struct bfa_qos_bw_s {
 548	u8	qos_bw_set;
 549	u8	high;
 550	u8	med;
 551	u8	low;
 552};
 553
 554/*
 555 * QoS attribute returned in QoS Query
 556 */
 557struct bfa_qos_attr_s {
 558	u8	state;		/*  QoS current state */
 559	u8	rsvd1[3];
 560	u32	total_bb_cr;	/*  Total BB Credits */
 561	struct bfa_qos_bw_s qos_bw;	/* QOS bw cfg */
 562	struct bfa_qos_bw_s qos_bw_op;	/* QOS bw operational */
 563};
 564
 565enum bfa_bbcr_state {
 566	BFA_BBCR_DISABLED,	/*!< BBCR is disable */
 567	BFA_BBCR_ONLINE,	/*!< BBCR is online  */
 568	BFA_BBCR_OFFLINE,	/*!< BBCR is offline */
 569};
 570
 571enum bfa_bbcr_err_reason {
 572	BFA_BBCR_ERR_REASON_NONE, /*!< Unknown */
 573	BFA_BBCR_ERR_REASON_SPEED_UNSUP, /*!< Port speed < max sup_speed */
 574	BFA_BBCR_ERR_REASON_PEER_UNSUP,	/*!< BBCR is disable on peer port */
 575	BFA_BBCR_ERR_REASON_NON_BRCD_SW, /*!< Connected to non BRCD switch */
 576	BFA_BBCR_ERR_REASON_FLOGI_RJT, /*!< Login rejected by the switch */
 577};
 578
 579struct bfa_bbcr_attr_s {
 580	u8	state;
 581	u8	peer_bb_scn;
 582	u8	reason;
 583	u8	rsvd;
 584};
 585
 586/*
 587 * These fields should be displayed only from the CLI.
 588 * There will be a separate BFAL API (get_qos_vc_attr ?)
 589 * to retrieve this.
 590 *
 591 */
 592#define  BFA_QOS_MAX_VC  16
 593
 594struct bfa_qos_vc_info_s {
 595	u8 vc_credit;
 596	u8 borrow_credit;
 597	u8 priority;
 598	u8 resvd;
 599};
 600
 601struct bfa_qos_vc_attr_s {
 602	u16  total_vc_count;                    /*  Total VC Count */
 603	u16  shared_credit;
 604	u32  elp_opmode_flags;
 605	struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC];  /* as many as
 606							    * total_vc_count */
 607};
 608
 609/*
 610 * QoS statistics
 611 */
 612struct bfa_qos_stats_s {
 613	u32	flogi_sent;		/*  QoS Flogi sent */
 614	u32	flogi_acc_recvd;	/*  QoS Flogi Acc received */
 615	u32	flogi_rjt_recvd;	/*  QoS Flogi rejects received */
 616	u32	flogi_retries;		/*  QoS Flogi retries */
 617
 618	u32	elp_recvd;		/*  QoS ELP received */
 619	u32	elp_accepted;		/*  QoS ELP Accepted */
 620	u32	elp_rejected;		/*  QoS ELP rejected */
 621	u32	elp_dropped;		/*  QoS ELP dropped  */
 622
 623	u32	qos_rscn_recvd;		/*  QoS RSCN received */
 624	u32	rsvd;			/* padding for 64 bit alignment */
 625};
 626
 627/*
 628 * FCoE statistics
 629 */
 630struct bfa_fcoe_stats_s {
 631	u64	secs_reset;	/*  Seconds since stats reset	     */
 632	u64	cee_linkups;	/*  CEE link up			     */
 633	u64	cee_linkdns;	/*  CEE link down		     */
 634	u64	fip_linkups;	/*  FIP link up			     */
 635	u64	fip_linkdns;	/*  FIP link down		     */
 636	u64	fip_fails;	/*  FIP failures		     */
 637	u64	mac_invalids;	/*  Invalid mac assignments	     */
 638	u64	vlan_req;	/*  Vlan requests		     */
 639	u64	vlan_notify;	/*  Vlan notifications		     */
 640	u64	vlan_err;	/*  Vlan notification errors	     */
 641	u64	vlan_timeouts;	/*  Vlan request timeouts	     */
 642	u64	vlan_invalids;	/*  Vlan invalids		     */
 643	u64	disc_req;	/*  Discovery requests		     */
 644	u64	disc_rsp;	/*  Discovery responses		     */
 645	u64	disc_err;	/*  Discovery error frames	     */
 646	u64	disc_unsol;	/*  Discovery unsolicited	     */
 647	u64	disc_timeouts;	/*  Discovery timeouts		     */
 648	u64	disc_fcf_unavail; /*  Discovery FCF not avail	     */
 649	u64	linksvc_unsupp;	/*  FIP link service req unsupp	     */
 650	u64	linksvc_err;	/*  FIP link service req errors	     */
 651	u64	logo_req;	/*  FIP logos received		     */
 652	u64	clrvlink_req;	/*  Clear virtual link requests	     */
 653	u64	op_unsupp;	/*  FIP operation unsupp.	     */
 654	u64	untagged;	/*  FIP untagged frames		     */
 655	u64	txf_ucast;	/*  Tx FCoE unicast frames	     */
 656	u64	txf_ucast_vlan;	/*  Tx FCoE unicast vlan frames      */
 657	u64	txf_ucast_octets; /*  Tx FCoE unicast octets	     */
 658	u64	txf_mcast;	/*  Tx FCoE multicast frames	     */
 659	u64	txf_mcast_vlan;	/*  Tx FCoE multicast vlan frames    */
 660	u64	txf_mcast_octets; /*  Tx FCoE multicast octets	     */
 661	u64	txf_bcast;	/*  Tx FCoE broadcast frames	     */
 662	u64	txf_bcast_vlan;	/*  Tx FCoE broadcast vlan frames    */
 663	u64	txf_bcast_octets; /*  Tx FCoE broadcast octets	     */
 664	u64	txf_timeout;	  /*  Tx timeouts		     */
 665	u64	txf_parity_errors; /*  Transmit parity err	     */
 666	u64	txf_fid_parity_errors; /*  Transmit FID parity err   */
 667	u64	rxf_ucast_octets; /*  Rx FCoE unicast octets	     */
 668	u64	rxf_ucast;	/*  Rx FCoE unicast frames	     */
 669	u64	rxf_ucast_vlan;	/*  Rx FCoE unicast vlan frames	     */
 670	u64	rxf_mcast_octets; /*  Rx FCoE multicast octets	     */
 671	u64	rxf_mcast;	/*  Rx FCoE multicast frames	     */
 672	u64	rxf_mcast_vlan;	/*  Rx FCoE multicast vlan frames    */
 673	u64	rxf_bcast_octets; /*  Rx FCoE broadcast octets	     */
 674	u64	rxf_bcast;	/*  Rx FCoE broadcast frames	     */
 675	u64	rxf_bcast_vlan;	/*  Rx FCoE broadcast vlan frames    */
 676};
 677
 678/*
 679 * QoS or FCoE stats (fcport stats excluding physical FC port stats)
 680 */
 681union bfa_fcport_stats_u {
 682	struct bfa_qos_stats_s	fcqos;
 683	struct bfa_fcoe_stats_s	fcoe;
 684};
 685#pragma pack()
 686
 687struct bfa_fcpim_del_itn_stats_s {
 688	u32	del_itn_iocomp_aborted;	   /* Aborted IO requests	      */
 689	u32	del_itn_iocomp_timedout;   /* IO timeouts		      */
 690	u32	del_itn_iocom_sqer_needed; /* IO retry for SQ error recovery  */
 691	u32	del_itn_iocom_res_free;    /* Delayed freeing of IO resources */
 692	u32	del_itn_iocom_hostabrts;   /* Host IO abort requests	      */
 693	u32	del_itn_total_ios;	   /* Total IO count		      */
 694	u32	del_io_iocdowns;	   /* IO cleaned-up due to IOC down   */
 695	u32	del_tm_iocdowns;	   /* TM cleaned-up due to IOC down   */
 696};
 697
 698struct bfa_itnim_iostats_s {
 699
 700	u32	total_ios;		/*  Total IO Requests		*/
 701	u32	input_reqs;		/*  Data in-bound requests	*/
 702	u32	output_reqs;		/*  Data out-bound requests	*/
 703	u32	io_comps;		/*  Total IO Completions	*/
 704	u32	wr_throughput;		/*  Write data transferred in bytes */
 705	u32	rd_throughput;		/*  Read data transferred in bytes  */
 706
 707	u32	iocomp_ok;		/*  Slowpath IO completions	*/
 708	u32	iocomp_underrun;	/*  IO underrun		*/
 709	u32	iocomp_overrun;		/*  IO overrun			*/
 710	u32	qwait;			/*  IO Request-Q wait		*/
 711	u32	qresumes;		/*  IO Request-Q wait done	*/
 712	u32	no_iotags;		/*  No free IO tag		*/
 713	u32	iocomp_timedout;	/*  IO timeouts		*/
 714	u32	iocom_nexus_abort;	/*  IO failure due to target offline */
 715	u32	iocom_proto_err;	/*  IO protocol errors		*/
 716	u32	iocom_dif_err;		/*  IO SBC-3 protection errors	*/
 717
 718	u32	iocom_sqer_needed;	/*  fcp-2 error recovery failed	*/
 719	u32	iocom_res_free;		/*  Delayed freeing of IO tag	*/
 720
 721
 722	u32	io_aborts;		/*  Host IO abort requests	*/
 723	u32	iocom_hostabrts;	/*  Host IO abort completions	*/
 724	u32	io_cleanups;		/*  IO clean-up requests	*/
 725	u32	path_tov_expired;	/*  IO path tov expired	*/
 726	u32	iocomp_aborted;		/*  IO abort completions	*/
 727	u32	io_iocdowns;		/*  IO cleaned-up due to IOC down */
 728	u32	iocom_utags;		/*  IO comp with unknown tags	*/
 729
 730	u32	io_tmaborts;		/*  Abort request due to TM command */
 731	u32	tm_io_comps;		/* Abort completion due to TM command */
 732
 733	u32	creates;		/*  IT Nexus create requests	*/
 734	u32	fw_create;		/*  IT Nexus FW create requests	*/
 735	u32	create_comps;		/*  IT Nexus FW create completions */
 736	u32	onlines;		/*  IT Nexus onlines		*/
 737	u32	offlines;		/*  IT Nexus offlines		*/
 738	u32	fw_delete;		/*  IT Nexus FW delete requests	*/
 739	u32	delete_comps;		/*  IT Nexus FW delete completions */
 740	u32	deletes;		/*  IT Nexus delete requests	   */
 741	u32	sler_events;		/*  SLER events		*/
 742	u32	ioc_disabled;		/*  Num IOC disables		*/
 743	u32	cleanup_comps;		/*  IT Nexus cleanup completions    */
 744
 745	u32	tm_cmnds;		/*  TM Requests		*/
 746	u32	tm_fw_rsps;		/*  TM Completions		*/
 747	u32	tm_success;		/*  TM initiated IO cleanup success */
 748	u32	tm_failures;		/*  TM initiated IO cleanup failure */
 749	u32	no_tskims;		/*  No free TM tag		*/
 750	u32	tm_qwait;		/*  TM Request-Q wait		*/
 751	u32	tm_qresumes;		/*  TM Request-Q wait done	*/
 752
 753	u32	tm_iocdowns;		/*  TM cleaned-up due to IOC down   */
 754	u32	tm_cleanups;		/*  TM cleanup requests	*/
 755	u32	tm_cleanup_comps;	/*  TM cleanup completions	*/
 756	u32	rsvd[6];
 
 
 
 
 
 757};
 758
 759/* Modify char* port_stt[] in bfal_port.c if a new state was added */
 760enum bfa_port_states {
 761	BFA_PORT_ST_UNINIT		= 1,
 762	BFA_PORT_ST_ENABLING_QWAIT	= 2,
 763	BFA_PORT_ST_ENABLING		= 3,
 764	BFA_PORT_ST_LINKDOWN		= 4,
 765	BFA_PORT_ST_LINKUP		= 5,
 766	BFA_PORT_ST_DISABLING_QWAIT	= 6,
 767	BFA_PORT_ST_DISABLING		= 7,
 768	BFA_PORT_ST_DISABLED		= 8,
 769	BFA_PORT_ST_STOPPED		= 9,
 770	BFA_PORT_ST_IOCDOWN		= 10,
 771	BFA_PORT_ST_IOCDIS		= 11,
 772	BFA_PORT_ST_FWMISMATCH		= 12,
 773	BFA_PORT_ST_PREBOOT_DISABLED	= 13,
 774	BFA_PORT_ST_TOGGLING_QWAIT	= 14,
 775	BFA_PORT_ST_FAA_MISCONFIG	= 15,
 776	BFA_PORT_ST_DPORT		= 16,
 777	BFA_PORT_ST_DDPORT		= 17,
 778	BFA_PORT_ST_MAX_STATE,
 779};
 780
 781/*
 782 *	Port operational type (in sync with SNIA port type).
 783 */
 784enum bfa_port_type {
 785	BFA_PORT_TYPE_UNKNOWN	= 1,	/*  port type is unknown */
 786	BFA_PORT_TYPE_NPORT	= 5,	/*  P2P with switched fabric */
 787	BFA_PORT_TYPE_NLPORT	= 6,	/*  public loop */
 788	BFA_PORT_TYPE_LPORT	= 20,	/*  private loop */
 789	BFA_PORT_TYPE_P2P	= 21,	/*  P2P with no switched fabric */
 790	BFA_PORT_TYPE_VPORT	= 22,	/*  NPIV - virtual port */
 791};
 792
 793/*
 794 *	Port topology setting. A port's topology and fabric login status
 795 *	determine its operational type.
 796 */
 797enum bfa_port_topology {
 798	BFA_PORT_TOPOLOGY_NONE = 0,	/*  No valid topology */
 799	BFA_PORT_TOPOLOGY_P2P_OLD_VER = 1, /* P2P def for older ver */
 800	BFA_PORT_TOPOLOGY_LOOP = 2,	/* LOOP topology */
 801	BFA_PORT_TOPOLOGY_AUTO_OLD_VER = 3, /* auto def for older ver */
 802	BFA_PORT_TOPOLOGY_AUTO = 4,	/* auto topology selection */
 803	BFA_PORT_TOPOLOGY_P2P = 5,	/* P2P only */
 804};
 805
 806/*
 807 *	Physical port loopback types.
 808 */
 809enum bfa_port_opmode {
 810	BFA_PORT_OPMODE_NORMAL   = 0x00, /*  normal non-loopback mode */
 811	BFA_PORT_OPMODE_LB_INT   = 0x01, /*  internal loop back */
 812	BFA_PORT_OPMODE_LB_SLW   = 0x02, /*  serial link wrapback (serdes) */
 813	BFA_PORT_OPMODE_LB_EXT   = 0x04, /*  external loop back (serdes) */
 814	BFA_PORT_OPMODE_LB_CBL   = 0x08, /*  cabled loop back */
 815	BFA_PORT_OPMODE_LB_NLINT = 0x20, /*  NL_Port internal loopback */
 816};
 817
 818#define BFA_PORT_OPMODE_LB_HARD(_mode)			\
 819	((_mode == BFA_PORT_OPMODE_LB_INT) ||		\
 820	(_mode == BFA_PORT_OPMODE_LB_SLW) ||		\
 821	(_mode == BFA_PORT_OPMODE_LB_EXT))
 822
 823/*
 824 *	Port link state
 825 */
 826enum bfa_port_linkstate {
 827	BFA_PORT_LINKUP		= 1,	/*  Physical port/Trunk link up */
 828	BFA_PORT_LINKDOWN	= 2,	/*  Physical port/Trunk link down */
 829};
 830
 831/*
 832 *	Port link state reason code
 833 */
 834enum bfa_port_linkstate_rsn {
 835	BFA_PORT_LINKSTATE_RSN_NONE		= 0,
 836	BFA_PORT_LINKSTATE_RSN_DISABLED		= 1,
 837	BFA_PORT_LINKSTATE_RSN_RX_NOS		= 2,
 838	BFA_PORT_LINKSTATE_RSN_RX_OLS		= 3,
 839	BFA_PORT_LINKSTATE_RSN_RX_LIP		= 4,
 840	BFA_PORT_LINKSTATE_RSN_RX_LIPF7		= 5,
 841	BFA_PORT_LINKSTATE_RSN_SFP_REMOVED	= 6,
 842	BFA_PORT_LINKSTATE_RSN_PORT_FAULT	= 7,
 843	BFA_PORT_LINKSTATE_RSN_RX_LOS		= 8,
 844	BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT	= 9,
 845	BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT	= 10,
 846	BFA_PORT_LINKSTATE_RSN_TIMEOUT		= 11,
 847	BFA_PORT_LINKSTATE_RSN_FAA_MISCONFIG	= 12,
 848
 849
 850
 851	/* CEE related reason codes/errors */
 852	CEE_LLDP_INFO_AGED_OUT			= 20,
 853	CEE_LLDP_SHUTDOWN_TLV_RCVD		= 21,
 854	CEE_PEER_NOT_ADVERTISE_DCBX		= 22,
 855	CEE_PEER_NOT_ADVERTISE_PG		= 23,
 856	CEE_PEER_NOT_ADVERTISE_PFC		= 24,
 857	CEE_PEER_NOT_ADVERTISE_FCOE		= 25,
 858	CEE_PG_NOT_COMPATIBLE			= 26,
 859	CEE_PFC_NOT_COMPATIBLE			= 27,
 860	CEE_FCOE_NOT_COMPATIBLE			= 28,
 861	CEE_BAD_PG_RCVD				= 29,
 862	CEE_BAD_BW_RCVD				= 30,
 863	CEE_BAD_PFC_RCVD			= 31,
 864	CEE_BAD_APP_PRI_RCVD			= 32,
 865	CEE_FCOE_PRI_PFC_OFF			= 33,
 866	CEE_DUP_CONTROL_TLV_RCVD		= 34,
 867	CEE_DUP_FEAT_TLV_RCVD			= 35,
 868	CEE_APPLY_NEW_CFG			= 36, /* reason, not error */
 869	CEE_PROTOCOL_INIT			= 37, /* reason, not error */
 870	CEE_PHY_LINK_DOWN			= 38,
 871	CEE_LLS_FCOE_ABSENT			= 39,
 872	CEE_LLS_FCOE_DOWN			= 40,
 873	CEE_ISCSI_NOT_COMPATIBLE		= 41,
 874	CEE_ISCSI_PRI_PFC_OFF			= 42,
 875	CEE_ISCSI_PRI_OVERLAP_FCOE_PRI		= 43
 876};
 877
 878#define MAX_LUN_MASK_CFG 16
 879
 880/*
 881 * Initially flash content may be fff. On making LUN mask enable and disable
 882 * state chnage.  when report lun command is being processed it goes from
 883 * BFA_LUN_MASK_ACTIVE to BFA_LUN_MASK_FETCH and comes back to
 884 * BFA_LUN_MASK_ACTIVE.
 885 */
 886enum bfa_ioim_lun_mask_state_s {
 887	BFA_IOIM_LUN_MASK_INACTIVE = 0,
 888	BFA_IOIM_LUN_MASK_ACTIVE = 1,
 889	BFA_IOIM_LUN_MASK_FETCHED = 2,
 890};
 891
 892enum bfa_lunmask_state_s {
 893	BFA_LUNMASK_DISABLED = 0x00,
 894	BFA_LUNMASK_ENABLED = 0x01,
 895	BFA_LUNMASK_MINCFG = 0x02,
 896	BFA_LUNMASK_UNINITIALIZED = 0xff,
 897};
 898
 899/**
 900 * FEC states
 901 */
 902enum bfa_fec_state_s {
 903	BFA_FEC_ONLINE = 1,		/*!< FEC is online */
 904	BFA_FEC_OFFLINE = 2,		/*!< FEC is offline */
 905	BFA_FEC_OFFLINE_NOT_16G = 3,	/*!< FEC is offline (speed not 16Gig) */
 906};
 907
 908#pragma pack(1)
 909/*
 910 * LUN mask configuration
 911 */
 912struct bfa_lun_mask_s {
 913	wwn_t		lp_wwn;
 914	wwn_t		rp_wwn;
 915	struct scsi_lun	lun;
 916	u8		ua;
 917	u8		rsvd[3];
 918	u16		rp_tag;
 919	u8		lp_tag;
 920	u8		state;
 921};
 922
 923#define MAX_LUN_MASK_CFG 16
 924struct bfa_lunmask_cfg_s {
 925	u32	status;
 926	u32	rsvd;
 927	struct bfa_lun_mask_s	lun_list[MAX_LUN_MASK_CFG];
 928};
 929
 930struct bfa_throttle_cfg_s {
 931	u16	is_valid;
 932	u16	value;
 933	u32	rsvd;
 934};
 935
 936struct bfa_defs_fcpim_throttle_s {
 937	u16	max_value;
 938	u16	cur_value;
 939	u16	cfg_value;
 940	u16	rsvd;
 941};
 942
 943#define BFA_BB_SCN_DEF 3
 944#define BFA_BB_SCN_MAX 0x0F
 945
 946/*
 947 *      Physical port configuration
 948 */
 949struct bfa_port_cfg_s {
 950	u8	 topology;	/*  bfa_port_topology		*/
 951	u8	 speed;		/*  enum bfa_port_speed	*/
 952	u8	 trunked;	/*  trunked or not		*/
 953	u8	 qos_enabled;	/*  qos enabled or not		*/
 954	u8	 cfg_hardalpa;	/*  is hard alpa configured	*/
 955	u8	 hardalpa;	/*  configured hard alpa	*/
 956	__be16	 maxfrsize;	/*  maximum frame size		*/
 957	u8	 rx_bbcredit;	/*  receive buffer credits	*/
 958	u8	 tx_bbcredit;	/*  transmit buffer credits	*/
 959	u8	 ratelimit;	/*  ratelimit enabled or not	*/
 960	u8	 trl_def_speed;	/*  ratelimit default speed	*/
 961	u8	 bb_cr_enabled; /*!< Config state of BB_SCN	*/
 962	u8	 bb_scn;	/*!< BB_SCN value for FLOGI Exchg */
 963	u8	 faa_state;	/*  FAA enabled/disabled        */
 964	u8	 rsvd1;
 965	u16	 path_tov;	/*  device path timeout	*/
 966	u16	 q_depth;	/*  SCSI Queue depth		*/
 967	struct bfa_qos_bw_s qos_bw;	/* QOS bandwidth	*/
 968};
 969#pragma pack()
 970
 971/*
 972 *	Port attribute values.
 973 */
 974struct bfa_port_attr_s {
 975	/*
 976	 * Static fields
 977	 */
 978	wwn_t			nwwn;		/*  node wwn */
 979	wwn_t			pwwn;		/*  port wwn */
 980	wwn_t			factorynwwn;	/*  factory node wwn */
 981	wwn_t			factorypwwn;	/*  factory port wwn */
 982	enum fc_cos		cos_supported;	/*  supported class of
 983						 *  services */
 984	u32			rsvd;
 985	struct fc_symname_s	port_symname;	/*  port symbolic name */
 986	enum bfa_port_speed	speed_supported; /* supported speeds */
 987	bfa_boolean_t		pbind_enabled;
 988
 989	/*
 990	 * Configured values
 991	 */
 992	struct bfa_port_cfg_s	pport_cfg;	/*  pport cfg */
 993
 994	/*
 995	 * Dynamic field - info from BFA
 996	 */
 997	enum bfa_port_states	port_state;	/*  current port state */
 998	enum bfa_port_speed	speed;		/*  current speed */
 999	enum bfa_port_topology	topology;	/*  current topology */
1000	bfa_boolean_t		beacon;		/*  current beacon status */
1001	bfa_boolean_t		link_e2e_beacon; /* link beacon is on */
1002	bfa_boolean_t		bbsc_op_status;	/* fc credit recovery oper
1003						 * state */
1004	enum bfa_fec_state_s	fec_state;	/*!< current FEC state */
1005
1006	/*
1007	 * Dynamic field - info from FCS
1008	 */
1009	u32			pid;		/*  port ID */
1010	enum bfa_port_type	port_type;	/*  current topology */
1011	u32			loopback;	/*  external loopback */
1012	u32			authfail;	/*  auth fail state */
1013
1014	/* FCoE specific  */
1015	u16			fcoe_vlan;
1016	u8			rsvd1[2];
1017};
1018
1019/*
1020 *	      Port FCP mappings.
1021 */
1022struct bfa_port_fcpmap_s {
1023	char	osdevname[256];
1024	u32	bus;
1025	u32	target;
1026	u32	oslun;
1027	u32	fcid;
1028	wwn_t	nwwn;
1029	wwn_t	pwwn;
1030	u64	fcplun;
1031	char	luid[256];
1032};
1033
1034/*
1035 *	      Port RNID info.
1036 */
1037struct bfa_port_rnid_s {
1038	wwn_t	  wwn;
1039	u32	  unittype;
1040	u32	  portid;
1041	u32	  attached_nodes_num;
1042	u16	  ip_version;
1043	u16	  udp_port;
1044	u8	  ipaddr[16];
1045	u16	  rsvd;
1046	u16	  topologydiscoveryflags;
1047};
1048
1049#pragma pack(1)
1050struct bfa_fcport_fcf_s {
1051	wwn_t	name;		/*  FCF name		   */
1052	wwn_t	fabric_name;    /*  Fabric Name		   */
1053	u8	fipenabled;	/*  FIP enabled or not	   */
1054	u8	fipfailed;	/*  FIP failed or not	   */
1055	u8	resv[2];
1056	u8	pri;		/*  FCF priority	   */
1057	u8	version;	/*  FIP version used	   */
1058	u8	available;      /*  Available for login    */
1059	u8	fka_disabled;   /*  FKA is disabled	   */
1060	u8	maxsz_verified; /*  FCoE max size verified */
1061	u8	fc_map[3];      /*  FC map		   */
1062	__be16	vlan;		/*  FCoE vlan tag/priority */
1063	u32	fka_adv_per;    /*  FIP  ka advert. period */
1064	mac_t	mac;		/*  FCF mac		   */
1065};
1066
1067/*
1068 *	Trunk states for BCU/BFAL
1069 */
1070enum bfa_trunk_state {
1071	BFA_TRUNK_DISABLED	= 0,	/*  Trunk is not configured	*/
1072	BFA_TRUNK_ONLINE	= 1,	/*  Trunk is online		*/
1073	BFA_TRUNK_OFFLINE	= 2,	/*  Trunk is offline		*/
1074};
1075
1076/*
1077 *	VC attributes for trunked link
1078 */
1079struct bfa_trunk_vc_attr_s {
1080	u32 bb_credit;
1081	u32 elp_opmode_flags;
1082	u32 req_credit;
1083	u16 vc_credits[8];
1084};
1085
1086struct bfa_fcport_loop_info_s {
1087	u8	myalpa;		/* alpa claimed */
1088	u8	alpabm_val;	/* alpa bitmap valid or not (1 or 0) */
1089	u8	resvd[6];
1090	struct fc_alpabm_s alpabm;	/* alpa bitmap */
1091};
1092
1093/*
1094 *	Link state information
1095 */
1096struct bfa_port_link_s {
1097	u8	 linkstate;	/*  Link state bfa_port_linkstate */
1098	u8	 linkstate_rsn;	/*  bfa_port_linkstate_rsn_t */
1099	u8	 topology;	/*  P2P/LOOP bfa_port_topology */
1100	u8	 speed;		/*  Link speed (1/2/4/8 G) */
1101	u32	 linkstate_opt; /*  Linkstate optional data (debug) */
1102	u8	 trunked;	/*  Trunked or not (1 or 0) */
1103	u8	 fec_state;	/*!< State of FEC */
1104	u8	 resvd[6];
1105	struct bfa_qos_attr_s  qos_attr;   /* QoS Attributes */
1106	union {
1107		struct bfa_fcport_loop_info_s loop_info;
1108		struct bfa_bbcr_attr_s bbcr_attr;
1109		union {
1110			struct bfa_qos_vc_attr_s qos_vc_attr;
1111					/*  VC info from ELP */
1112			struct bfa_trunk_vc_attr_s trunk_vc_attr;
1113			struct bfa_fcport_fcf_s fcf;
1114					/*  FCF information (for FCoE) */
1115		} vc_fcf;
1116	} attr;
1117};
1118#pragma pack()
1119
1120enum bfa_trunk_link_fctl {
1121	BFA_TRUNK_LINK_FCTL_NORMAL,
1122	BFA_TRUNK_LINK_FCTL_VC,
1123	BFA_TRUNK_LINK_FCTL_VC_QOS,
1124};
1125
1126enum bfa_trunk_link_state {
1127	BFA_TRUNK_LINK_STATE_UP = 1,		/* link part of trunk */
1128	BFA_TRUNK_LINK_STATE_DN_LINKDN = 2,	/* physical link down */
1129	BFA_TRUNK_LINK_STATE_DN_GRP_MIS = 3,	/* trunk group different */
1130	BFA_TRUNK_LINK_STATE_DN_SPD_MIS = 4,	/* speed mismatch */
1131	BFA_TRUNK_LINK_STATE_DN_MODE_MIS = 5,	/* remote port not trunked */
1132};
1133
1134#define BFA_TRUNK_MAX_PORTS	2
1135struct bfa_trunk_link_attr_s {
1136	wwn_t    trunk_wwn;
1137	enum bfa_trunk_link_fctl fctl;
1138	enum bfa_trunk_link_state link_state;
1139	enum bfa_port_speed	speed;
1140	u32 deskew;
1141};
1142
1143struct bfa_trunk_attr_s {
1144	enum bfa_trunk_state	state;
1145	enum bfa_port_speed	speed;
1146	u32		port_id;
1147	u32		rsvd;
1148	struct bfa_trunk_link_attr_s link_attr[BFA_TRUNK_MAX_PORTS];
1149};
1150
1151struct bfa_rport_hal_stats_s {
1152	u32        sm_un_cr;	    /*  uninit: create events      */
1153	u32        sm_un_unexp;	    /*  uninit: exception events   */
1154	u32        sm_cr_on;	    /*  created: online events     */
1155	u32        sm_cr_del;	    /*  created: delete events     */
1156	u32        sm_cr_hwf;	    /*  created: IOC down          */
1157	u32        sm_cr_unexp;	    /*  created: exception events  */
1158	u32        sm_fwc_rsp;	    /*  fw create: f/w responses   */
1159	u32        sm_fwc_del;	    /*  fw create: delete events   */
1160	u32        sm_fwc_off;	    /*  fw create: offline events  */
1161	u32        sm_fwc_hwf;	    /*  fw create: IOC down        */
1162	u32        sm_fwc_unexp;    /*  fw create: exception events*/
1163	u32        sm_on_off;	    /*  online: offline events     */
1164	u32        sm_on_del;	    /*  online: delete events      */
1165	u32        sm_on_hwf;	    /*  online: IOC down events    */
1166	u32        sm_on_unexp;	    /*  online: exception events   */
1167	u32        sm_fwd_rsp;	    /*  fw delete: fw responses    */
1168	u32        sm_fwd_del;	    /*  fw delete: delete events   */
1169	u32        sm_fwd_hwf;	    /*  fw delete: IOC down events */
1170	u32        sm_fwd_unexp;    /*  fw delete: exception events*/
1171	u32        sm_off_del;	    /*  offline: delete events     */
1172	u32        sm_off_on;	    /*  offline: online events     */
1173	u32        sm_off_hwf;	    /*  offline: IOC down events   */
1174	u32        sm_off_unexp;    /*  offline: exception events  */
1175	u32        sm_del_fwrsp;    /*  delete: fw responses       */
1176	u32        sm_del_hwf;	    /*  delete: IOC down events    */
1177	u32        sm_del_unexp;    /*  delete: exception events   */
1178	u32        sm_delp_fwrsp;   /*  delete pend: fw responses  */
1179	u32        sm_delp_hwf;	    /*  delete pend: IOC downs     */
1180	u32        sm_delp_unexp;   /*  delete pend: exceptions    */
1181	u32        sm_offp_fwrsp;   /*  off-pending: fw responses  */
1182	u32        sm_offp_del;	    /*  off-pending: deletes       */
1183	u32        sm_offp_hwf;	    /*  off-pending: IOC downs     */
1184	u32        sm_offp_unexp;   /*  off-pending: exceptions    */
1185	u32        sm_iocd_off;	    /*  IOC down: offline events   */
1186	u32        sm_iocd_del;	    /*  IOC down: delete events    */
1187	u32        sm_iocd_on;	    /*  IOC down: online events    */
1188	u32        sm_iocd_unexp;   /*  IOC down: exceptions       */
1189	u32        rsvd;
1190};
1191#pragma pack(1)
1192/*
1193 *  Rport's QoS attributes
1194 */
1195struct bfa_rport_qos_attr_s {
1196	u8		qos_priority;	/*  rport's QoS priority   */
1197	u8		rsvd[3];
1198	u32		qos_flow_id;	/*  QoS flow Id	 */
1199};
1200#pragma pack()
1201
1202#define BFA_IOBUCKET_MAX 14
1203
1204struct bfa_itnim_latency_s {
1205	u32 min[BFA_IOBUCKET_MAX];
1206	u32 max[BFA_IOBUCKET_MAX];
1207	u32 count[BFA_IOBUCKET_MAX];
1208	u32 avg[BFA_IOBUCKET_MAX];
1209};
1210
1211struct bfa_itnim_ioprofile_s {
1212	u32 clock_res_mul;
1213	u32 clock_res_div;
1214	u32 index;
1215	u32 io_profile_start_time;	/*  IO profile start time	*/
1216	u32 iocomps[BFA_IOBUCKET_MAX];	/*  IO completed	*/
1217	struct bfa_itnim_latency_s io_latency;
1218};
1219
1220/*
1221 *	vHBA port attribute values.
1222 */
1223struct bfa_vhba_attr_s {
1224	wwn_t	nwwn;       /* node wwn */
1225	wwn_t	pwwn;       /* port wwn */
1226	u32	pid;        /* port ID */
1227	bfa_boolean_t       io_profile; /* get it from fcpim mod */
1228	bfa_boolean_t       plog_enabled;   /* portlog is enabled */
1229	u16	path_tov;
1230	u8	rsvd[2];
1231};
1232
1233/*
1234 * FC physical port statistics.
1235 */
1236struct bfa_port_fc_stats_s {
1237	u64     secs_reset;     /*  Seconds since stats is reset */
1238	u64     tx_frames;      /*  Tx frames                   */
1239	u64     tx_words;       /*  Tx words                    */
1240	u64     tx_lip;         /*  Tx LIP                      */
1241	u64	tx_lip_f7f7;	/*  Tx LIP_F7F7		*/
1242	u64	tx_lip_f8f7;	/*  Tx LIP_F8F7		*/
1243	u64	tx_arbf0;	/*  Tx ARB F0			*/
1244	u64     tx_nos;         /*  Tx NOS                      */
1245	u64     tx_ols;         /*  Tx OLS                      */
1246	u64     tx_lr;          /*  Tx LR                       */
1247	u64     tx_lrr;         /*  Tx LRR                      */
1248	u64     rx_frames;      /*  Rx frames                   */
1249	u64     rx_words;       /*  Rx words                    */
1250	u64     lip_count;      /*  Rx LIP                      */
1251	u64	rx_lip_f7f7;	/*  Rx LIP_F7F7		*/
1252	u64	rx_lip_f8f7;	/*  Rx LIP_F8F7		*/
1253	u64	rx_arbf0;	/*  Rx ARB F0			*/
1254	u64     nos_count;      /*  Rx NOS                      */
1255	u64     ols_count;      /*  Rx OLS                      */
1256	u64     lr_count;       /*  Rx LR                       */
1257	u64     lrr_count;      /*  Rx LRR                      */
1258	u64     invalid_crcs;   /*  Rx CRC err frames           */
1259	u64     invalid_crc_gd_eof; /*  Rx CRC err good EOF frames */
1260	u64     undersized_frm; /*  Rx undersized frames        */
1261	u64     oversized_frm;  /*  Rx oversized frames */
1262	u64     bad_eof_frm;    /*  Rx frames with bad EOF      */
1263	u64     error_frames;   /*  Errored frames              */
1264	u64     dropped_frames; /*  Dropped frames              */
1265	u64     link_failures;  /*  Link Failure (LF) count     */
1266	u64     loss_of_syncs;  /*  Loss of sync count          */
1267	u64     loss_of_signals; /*  Loss of signal count       */
1268	u64     primseq_errs;   /*  Primitive sequence protocol err. */
1269	u64     bad_os_count;   /*  Invalid ordered sets        */
1270	u64     err_enc_out;    /*  Encoding err nonframe_8b10b */
1271	u64     err_enc;        /*  Encoding err frame_8b10b    */
1272	u64	bbcr_frames_lost; /*!< BBCR Frames Lost */
1273	u64	bbcr_rrdys_lost; /*!< BBCR RRDYs Lost */
1274	u64	bbcr_link_resets; /*!< BBCR Link Resets */
1275	u64	bbcr_frame_lost_intrs; /*!< BBCR Frame loss intrs */
1276	u64	bbcr_rrdy_lost_intrs; /*!< BBCR Rrdy loss intrs */
1277	u64	loop_timeouts;	/*  Loop timeouts		*/
1278};
1279
1280/*
1281 * Eth Physical Port statistics.
1282 */
1283struct bfa_port_eth_stats_s {
1284	u64     secs_reset;     /*  Seconds since stats is reset */
1285	u64     frame_64;       /*  Frames 64 bytes             */
1286	u64     frame_65_127;   /*  Frames 65-127 bytes */
1287	u64     frame_128_255;  /*  Frames 128-255 bytes        */
1288	u64     frame_256_511;  /*  Frames 256-511 bytes        */
1289	u64     frame_512_1023; /*  Frames 512-1023 bytes       */
1290	u64     frame_1024_1518; /*  Frames 1024-1518 bytes     */
1291	u64     frame_1519_1522; /*  Frames 1519-1522 bytes     */
1292	u64     tx_bytes;       /*  Tx bytes                    */
1293	u64     tx_packets;      /*  Tx packets         */
1294	u64     tx_mcast_packets; /*  Tx multicast packets      */
1295	u64     tx_bcast_packets; /*  Tx broadcast packets      */
1296	u64     tx_control_frame; /*  Tx control frame          */
1297	u64     tx_drop;        /*  Tx drops                    */
1298	u64     tx_jabber;      /*  Tx jabber                   */
1299	u64     tx_fcs_error;   /*  Tx FCS errors               */
1300	u64     tx_fragments;   /*  Tx fragments                */
1301	u64     rx_bytes;       /*  Rx bytes                    */
1302	u64     rx_packets;     /*  Rx packets                  */
1303	u64     rx_mcast_packets; /*  Rx multicast packets      */
1304	u64     rx_bcast_packets; /*  Rx broadcast packets      */
1305	u64     rx_control_frames; /*  Rx control frames        */
1306	u64     rx_unknown_opcode; /*  Rx unknown opcode        */
1307	u64     rx_drop;        /*  Rx drops                    */
1308	u64     rx_jabber;      /*  Rx jabber                   */
1309	u64     rx_fcs_error;   /*  Rx FCS errors               */
1310	u64     rx_alignment_error; /*  Rx alignment errors     */
1311	u64     rx_frame_length_error; /*  Rx frame len errors  */
1312	u64     rx_code_error;  /*  Rx code errors              */
1313	u64     rx_fragments;   /*  Rx fragments                */
1314	u64     rx_pause;       /*  Rx pause                    */
1315	u64     rx_zero_pause;  /*  Rx zero pause               */
1316	u64     tx_pause;       /*  Tx pause                    */
1317	u64     tx_zero_pause;  /*  Tx zero pause               */
1318	u64     rx_fcoe_pause;  /*  Rx FCoE pause               */
1319	u64     rx_fcoe_zero_pause; /*  Rx FCoE zero pause      */
1320	u64     tx_fcoe_pause;  /*  Tx FCoE pause               */
1321	u64     tx_fcoe_zero_pause; /*  Tx FCoE zero pause      */
1322	u64     rx_iscsi_pause; /*  Rx iSCSI pause              */
1323	u64     rx_iscsi_zero_pause; /*  Rx iSCSI zero pause    */
1324	u64     tx_iscsi_pause; /*  Tx iSCSI pause              */
1325	u64     tx_iscsi_zero_pause; /*  Tx iSCSI zero pause    */
1326};
1327
1328/*
1329 *              Port statistics.
1330 */
1331union bfa_port_stats_u {
1332	struct bfa_port_fc_stats_s      fc;
1333	struct bfa_port_eth_stats_s     eth;
1334};
1335
1336struct bfa_port_cfg_mode_s {
1337	u16		max_pf;
1338	u16		max_vf;
1339	enum bfa_mode_s	mode;
1340};
1341
1342#pragma pack(1)
1343
1344#define BFA_CEE_LLDP_MAX_STRING_LEN	(128)
1345#define BFA_CEE_DCBX_MAX_PRIORITY	(8)
1346#define BFA_CEE_DCBX_MAX_PGID		(8)
1347
1348struct bfa_cee_lldp_str_s {
1349	u8	sub_type;
1350	u8	len;
1351	u8	rsvd[2];
1352	u8	value[BFA_CEE_LLDP_MAX_STRING_LEN];
1353};
1354
1355struct bfa_cee_lldp_cfg_s {
1356	struct bfa_cee_lldp_str_s chassis_id;
1357	struct bfa_cee_lldp_str_s port_id;
1358	struct bfa_cee_lldp_str_s port_desc;
1359	struct bfa_cee_lldp_str_s sys_name;
1360	struct bfa_cee_lldp_str_s sys_desc;
1361	struct bfa_cee_lldp_str_s mgmt_addr;
1362	u16	time_to_live;
1363	u16	enabled_system_cap;
1364};
1365
1366/* CEE/DCBX parameters */
1367struct bfa_cee_dcbx_cfg_s {
1368	u8	pgid[BFA_CEE_DCBX_MAX_PRIORITY];
1369	u8	pg_percentage[BFA_CEE_DCBX_MAX_PGID];
1370	u8	pfc_primap; /* bitmap of priorties with PFC enabled */
1371	u8	fcoe_primap; /* bitmap of priorities used for FcoE traffic */
1372	u8	iscsi_primap; /* bitmap of priorities used for iSCSI traffic */
1373	u8	dcbx_version; /* operating version:CEE or preCEE */
1374	u8	lls_fcoe; /* FCoE Logical Link Status */
1375	u8	lls_lan; /* LAN Logical Link Status */
1376	u8	rsvd[2];
1377};
1378
1379/* CEE Query */
1380struct bfa_cee_attr_s {
1381	u8	cee_status;
1382	u8	error_reason;
1383	struct bfa_cee_lldp_cfg_s lldp_remote;
1384	struct bfa_cee_dcbx_cfg_s dcbx_remote;
1385	mac_t src_mac;
1386	u8	link_speed;
1387	u8	nw_priority;
1388	u8	filler[2];
1389};
1390
1391/* LLDP/DCBX/CEE Statistics */
1392struct bfa_cee_stats_s {
1393	u32		lldp_tx_frames;		/* LLDP Tx Frames */
1394	u32		lldp_rx_frames;		/* LLDP Rx Frames */
1395	u32		lldp_rx_frames_invalid; /* LLDP Rx Frames invalid */
1396	u32		lldp_rx_frames_new;     /* LLDP Rx Frames new */
1397	u32		lldp_tlvs_unrecognized; /* LLDP Rx unrecog. TLVs */
1398	u32		lldp_rx_shutdown_tlvs;  /* LLDP Rx shutdown TLVs */
1399	u32		lldp_info_aged_out;     /* LLDP remote info aged */
1400	u32		dcbx_phylink_ups;       /* DCBX phy link ups */
1401	u32		dcbx_phylink_downs;     /* DCBX phy link downs */
1402	u32		dcbx_rx_tlvs;           /* DCBX Rx TLVs */
1403	u32		dcbx_rx_tlvs_invalid;   /* DCBX Rx TLVs invalid */
1404	u32		dcbx_control_tlv_error; /* DCBX control TLV errors */
1405	u32		dcbx_feature_tlv_error; /* DCBX feature TLV errors */
1406	u32		dcbx_cee_cfg_new;       /* DCBX new CEE cfg rcvd */
1407	u32		cee_status_down;        /* DCB status down */
1408	u32		cee_status_up;          /* DCB status up */
1409	u32		cee_hw_cfg_changed;     /* DCB hw cfg changed */
1410	u32		cee_rx_invalid_cfg;     /* DCB invalid cfg */
1411};
1412
1413#pragma pack()
1414
1415/*
1416 *			AEN related definitions
1417 */
1418#define BFAD_NL_VENDOR_ID (((u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) \
1419			   | BFA_PCI_VENDOR_ID_BROCADE)
1420
1421/* BFA remote port events */
1422enum bfa_rport_aen_event {
1423	BFA_RPORT_AEN_ONLINE     = 1,   /* RPort online event */
1424	BFA_RPORT_AEN_OFFLINE    = 2,   /* RPort offline event */
1425	BFA_RPORT_AEN_DISCONNECT = 3,   /* RPort disconnect event */
1426	BFA_RPORT_AEN_QOS_PRIO   = 4,   /* QOS priority change event */
1427	BFA_RPORT_AEN_QOS_FLOWID = 5,   /* QOS flow Id change event */
1428};
1429
1430struct bfa_rport_aen_data_s {
1431	u16             vf_id;  /* vf_id of this logical port */
1432	u16             rsvd[3];
1433	wwn_t           ppwwn;  /* WWN of its physical port */
1434	wwn_t           lpwwn;  /* WWN of this logical port */
1435	wwn_t           rpwwn;  /* WWN of this remote port */
1436	union {
1437		struct bfa_rport_qos_attr_s qos;
1438	} priv;
1439};
1440
1441union bfa_aen_data_u {
1442	struct bfa_adapter_aen_data_s	adapter;
1443	struct bfa_port_aen_data_s	port;
1444	struct bfa_lport_aen_data_s	lport;
1445	struct bfa_rport_aen_data_s	rport;
1446	struct bfa_itnim_aen_data_s	itnim;
1447	struct bfa_audit_aen_data_s	audit;
1448	struct bfa_ioc_aen_data_s	ioc;
1449};
1450
1451#define BFA_AEN_MAX_ENTRY	512
1452
1453struct bfa_aen_entry_s {
1454	struct list_head	qe;
1455	enum bfa_aen_category   aen_category;
1456	u32                     aen_type;
1457	union bfa_aen_data_u    aen_data;
1458	struct timeval          aen_tv;
1459	u32                     seq_num;
1460	u32                     bfad_num;
1461};
1462
1463#endif /* __BFA_DEFS_SVC_H__ */