Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] bfa: Forward Error Correction status query

This patch includes changes to get FC HBA feature Forward Error
Correction (FEC) (enabled at 16Gig speed) status from firmware and to
return to brocade HBA management utility.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Vijaya Mohan Guvva and committed by
James Bottomley
4e1e0d8d bbe37a67

+22 -2
+13 -2
drivers/scsi/bfa/bfa_defs_svc.h
··· 882 882 BFA_LUNMASK_UNINITIALIZED = 0xff, 883 883 }; 884 884 885 + /** 886 + * FEC states 887 + */ 888 + enum bfa_fec_state_s { 889 + BFA_FEC_ONLINE = 1, /*!< FEC is online */ 890 + BFA_FEC_OFFLINE = 2, /*!< FEC is offline */ 891 + BFA_FEC_OFFLINE_NOT_16G = 3, /*!< FEC is offline (speed not 16Gig) */ 892 + }; 893 + 885 894 #pragma pack(1) 886 895 /* 887 896 * LUN mask configuration ··· 987 978 bfa_boolean_t link_e2e_beacon; /* link beacon is on */ 988 979 bfa_boolean_t bbsc_op_status; /* fc credit recovery oper 989 980 * state */ 981 + enum bfa_fec_state_s fec_state; /*!< current FEC state */ 990 982 991 983 /* 992 984 * Dynamic field - info from FCS ··· 999 989 1000 990 /* FCoE specific */ 1001 991 u16 fcoe_vlan; 1002 - u8 rsvd1[6]; 992 + u8 rsvd1[2]; 1003 993 }; 1004 994 1005 995 /* ··· 1086 1076 u8 speed; /* Link speed (1/2/4/8 G) */ 1087 1077 u32 linkstate_opt; /* Linkstate optional data (debug) */ 1088 1078 u8 trunked; /* Trunked or not (1 or 0) */ 1089 - u8 resvd[7]; 1079 + u8 fec_state; /*!< State of FEC */ 1080 + u8 resvd[6]; 1090 1081 struct bfa_qos_attr_s qos_attr; /* QoS Attributes */ 1091 1082 union { 1092 1083 struct bfa_fcport_loop_info_s loop_info;
+8
drivers/scsi/bfa/bfa_svc.c
··· 3079 3079 port_cfg->qos_bw.med = BFA_QOS_BW_MED; 3080 3080 port_cfg->qos_bw.low = BFA_QOS_BW_LOW; 3081 3081 3082 + fcport->fec_state = BFA_FEC_OFFLINE; 3083 + 3082 3084 INIT_LIST_HEAD(&fcport->stats_pending_q); 3083 3085 INIT_LIST_HEAD(&fcport->statsclr_pending_q); 3084 3086 ··· 3159 3157 3160 3158 if (fcport->cfg.bb_cr_enabled) 3161 3159 fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; 3160 + 3161 + fcport->fec_state = pevent->link_state.fec_state; 3162 + 3162 3163 /* 3163 3164 * update trunk state if applicable 3164 3165 */ ··· 3181 3176 { 3182 3177 fcport->speed = BFA_PORT_SPEED_UNKNOWN; 3183 3178 fcport->topology = BFA_PORT_TOPOLOGY_NONE; 3179 + fcport->fec_state = BFA_FEC_OFFLINE; 3184 3180 } 3185 3181 3186 3182 /* ··· 4032 4026 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); 4033 4027 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); 4034 4028 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); 4029 + 4030 + attr->fec_state = fcport->fec_state; 4035 4031 4036 4032 /* PBC Disabled State */ 4037 4033 if (bfa_fcport_is_pbcdisabled(bfa))
+1
drivers/scsi/bfa/bfa_svc.h
··· 513 513 struct bfa_mem_dma_s fcport_dma; 514 514 bfa_boolean_t stats_dma_ready; 515 515 struct bfa_bbcr_attr_s bbcr_attr; 516 + enum bfa_fec_state_s fec_state; 516 517 }; 517 518 518 519 #define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport)