[SCSI] bfa: Support for FC BB credit recovery
[pandora-kernel.git] / drivers / scsi / bfa / bfa_defs_svc.h
index 76ea10d..c06359b 100644 (file)
@@ -257,7 +257,6 @@ struct bfa_fw_port_lksm_stats_s {
        u32    nos_tx;             /*  No. of times NOS tx started         */
        u32    hwsm_lrr_rx;        /*  No. of times LRR rx-ed by HWSM      */
        u32    hwsm_lr_rx;         /*  No. of times LR rx-ed by HWSM       */
-       u32    bbsc_lr;            /* LKSM LR tx for credit recovery       */
 };
 
 struct bfa_fw_port_snsm_stats_s {
@@ -270,6 +269,9 @@ struct bfa_fw_port_snsm_stats_s {
        u32    sync_lost;          /*  Sync loss count                     */
        u32    sig_lost;           /*  Signal loss count                   */
        u32    asn8g_attempts;     /* SNSM HWSM at 8Gbps attempts          */
+       u32    adapt_success;      /* SNSM adaptation success   */
+       u32    adapt_fails;        /* SNSM adaptation failures */
+       u32    adapt_ign_fails;    /* SNSM adaptation failures ignored */
 };
 
 struct bfa_fw_port_physm_stats_s {
@@ -405,7 +407,7 @@ struct bfa_fw_trunk_stats_s {
        u32 rsvd;               /*  padding for 64 bit alignment */
 };
 
-struct bfa_fw_advsm_stats_s {
+struct bfa_fw_aport_stats_s {
        u32 flogi_sent;         /*  Flogi sent                  */
        u32 flogi_acc_recvd;    /*  Flogi Acc received          */
        u32 flogi_rjt_recvd;    /*  Flogi rejects received      */
@@ -415,6 +417,12 @@ struct bfa_fw_advsm_stats_s {
        u32 elp_accepted;       /*  ELP Accepted                */
        u32 elp_rejected;       /*  ELP rejected                */
        u32 elp_dropped;        /*  ELP dropped                 */
+
+       u32 bbcr_lr_count;      /*!< BBCR Link Resets           */
+       u32 frame_lost_intrs;   /*!< BBCR Frame loss intrs      */
+       u32 rrdy_lost_intrs;    /*!< BBCR Rrdy loss intrs       */
+
+       u32 rsvd;
 };
 
 /*
@@ -485,7 +493,7 @@ struct bfa_fw_stats_s {
        struct bfa_fw_fcxchg_stats_s    fcxchg_stats;
        struct bfa_fw_lps_stats_s       lps_stats;
        struct bfa_fw_trunk_stats_s     trunk_stats;
-       struct bfa_fw_advsm_stats_s     advsm_stats;
+       struct bfa_fw_aport_stats_s     aport_stats;
        struct bfa_fw_mac_mod_stats_s   macmod_stats;
        struct bfa_fw_ct_mod_stats_s    ctmod_stats;
        struct bfa_fw_eth_sndrcv_stats_s        ethsndrcv_stats;
@@ -522,6 +530,14 @@ enum bfa_qos_bw_alloc {
        BFA_QOS_BW_LOW  =  10,  /*  bandwidth allocation for Low */
 };
 #pragma pack(1)
+
+struct bfa_qos_bw_s {
+       u8      qos_bw_set;
+       u8      high;
+       u8      med;
+       u8      low;
+};
+
 /*
  * QoS attribute returned in QoS Query
  */
@@ -529,7 +545,29 @@ struct bfa_qos_attr_s {
        u8      state;          /*  QoS current state */
        u8      rsvd1[3];
        u32     total_bb_cr;    /*  Total BB Credits */
-       u32     rsvd2[2];
+       struct bfa_qos_bw_s qos_bw;     /* QOS bw cfg */
+       struct bfa_qos_bw_s qos_bw_op;  /* QOS bw operational */
+};
+
+enum bfa_bbcr_state {
+       BFA_BBCR_DISABLED,      /*!< BBCR is disable */
+       BFA_BBCR_ONLINE,        /*!< BBCR is online  */
+       BFA_BBCR_OFFLINE,       /*!< BBCR is offline */
+};
+
+enum bfa_bbcr_err_reason {
+       BFA_BBCR_ERR_REASON_NONE, /*!< Unknown */
+       BFA_BBCR_ERR_REASON_SPEED_UNSUP, /*!< Port speed < max sup_speed */
+       BFA_BBCR_ERR_REASON_PEER_UNSUP, /*!< BBCR is disable on peer port */
+       BFA_BBCR_ERR_REASON_NON_BRCD_SW, /*!< Connected to non BRCD switch */
+       BFA_BBCR_ERR_REASON_FLOGI_RJT, /*!< Login rejected by the switch */
+};
+
+struct bfa_bbcr_attr_s {
+       u8      state;
+       u8      peer_bb_scn;
+       u8      reason;
+       u8      rsvd;
 };
 
 /*
@@ -866,6 +904,22 @@ struct bfa_lunmask_cfg_s {
        struct bfa_lun_mask_s   lun_list[MAX_LUN_MASK_CFG];
 };
 
+struct bfa_throttle_cfg_s {
+       u16     is_valid;
+       u16     value;
+       u32     rsvd;
+};
+
+struct bfa_defs_fcpim_throttle_s {
+       u16     max_value;
+       u16     cur_value;
+       u16     cfg_value;
+       u16     rsvd;
+};
+
+#define BFA_BB_SCN_DEF 3
+#define BFA_BB_SCN_MAX 0x0F
+
 /*
  *      Physical port configuration
  */
@@ -881,13 +935,13 @@ struct bfa_port_cfg_s {
        u8       tx_bbcredit;   /*  transmit buffer credits     */
        u8       ratelimit;     /*  ratelimit enabled or not    */
        u8       trl_def_speed; /*  ratelimit default speed     */
-       u8       bb_scn;        /*  BB_SCN value from FLOGI Exchg */
-       u8       bb_scn_state;  /*  Config state of BB_SCN */
+       u8       bb_cr_enabled; /*!< Config state of BB_SCN     */
+       u8       bb_scn;        /*!< BB_SCN value for FLOGI Exchg */
        u8       faa_state;     /*  FAA enabled/disabled        */
        u8       rsvd1;
        u16      path_tov;      /*  device path timeout */
        u16      q_depth;       /*  SCSI Queue depth            */
-       u32      rsvd2;
+       struct bfa_qos_bw_s qos_bw;     /* QOS bandwidth        */
 };
 #pragma pack()
 
@@ -935,7 +989,7 @@ struct bfa_port_attr_s {
 
        /* FCoE specific  */
        u16                     fcoe_vlan;
-       u8                      rsvd1[2];
+       u8                      rsvd1[6];
 };
 
 /*
@@ -1026,6 +1080,7 @@ struct bfa_port_link_s {
        struct bfa_qos_attr_s  qos_attr;   /* QoS Attributes */
        union {
                struct bfa_fcport_loop_info_s loop_info;
+               struct bfa_bbcr_attr_s bbcr_attr;
                union {
                        struct bfa_qos_vc_attr_s qos_vc_attr;
                                        /*  VC info from ELP */
@@ -1189,9 +1244,11 @@ struct bfa_port_fc_stats_s {
        u64     bad_os_count;   /*  Invalid ordered sets        */
        u64     err_enc_out;    /*  Encoding err nonframe_8b10b */
        u64     err_enc;        /*  Encoding err frame_8b10b    */
-       u64     bbsc_frames_lost; /* Credit Recovery-Frames Lost  */
-       u64     bbsc_credits_lost; /* Credit Recovery-Credits Lost */
-       u64     bbsc_link_resets; /* Credit Recovery-Link Resets   */
+       u64     bbcr_frames_lost; /*!< BBCR Frames Lost */
+       u64     bbcr_rrdys_lost; /*!< BBCR RRDYs Lost */
+       u64     bbcr_link_resets; /*!< BBCR Link Resets */
+       u64     bbcr_frame_lost_intrs; /*!< BBCR Frame loss intrs */
+       u64     bbcr_rrdy_lost_intrs; /*!< BBCR Rrdy loss intrs */
        u64     loop_timeouts;  /*  Loop timeouts               */
 };