diff options
author | Vijaya Mohan Guvva <vmohan@brocade.com> | 2013-05-13 05:33:20 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-06-26 14:42:21 -0400 |
commit | 4e1e0d8d71810fb5e4c294299ab35c30a746353d (patch) | |
tree | 4f8ed877ff9b7e4c12c959639a6c7db4fe5ea21d | |
parent | bbe37a67d9da18e40dfd9232586612424b1466f7 (diff) |
[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>
-rw-r--r-- | drivers/scsi/bfa/bfa_defs_svc.h | 15 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 8 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.h | 1 |
3 files changed, 22 insertions, 2 deletions
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index c06359b76c4d..0880d86c3542 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h | |||
@@ -882,6 +882,15 @@ enum bfa_lunmask_state_s { | |||
882 | BFA_LUNMASK_UNINITIALIZED = 0xff, | 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 | #pragma pack(1) | 894 | #pragma pack(1) |
886 | /* | 895 | /* |
887 | * LUN mask configuration | 896 | * LUN mask configuration |
@@ -978,6 +987,7 @@ struct bfa_port_attr_s { | |||
978 | bfa_boolean_t link_e2e_beacon; /* link beacon is on */ | 987 | bfa_boolean_t link_e2e_beacon; /* link beacon is on */ |
979 | bfa_boolean_t bbsc_op_status; /* fc credit recovery oper | 988 | bfa_boolean_t bbsc_op_status; /* fc credit recovery oper |
980 | * state */ | 989 | * state */ |
990 | enum bfa_fec_state_s fec_state; /*!< current FEC state */ | ||
981 | 991 | ||
982 | /* | 992 | /* |
983 | * Dynamic field - info from FCS | 993 | * Dynamic field - info from FCS |
@@ -989,7 +999,7 @@ struct bfa_port_attr_s { | |||
989 | 999 | ||
990 | /* FCoE specific */ | 1000 | /* FCoE specific */ |
991 | u16 fcoe_vlan; | 1001 | u16 fcoe_vlan; |
992 | u8 rsvd1[6]; | 1002 | u8 rsvd1[2]; |
993 | }; | 1003 | }; |
994 | 1004 | ||
995 | /* | 1005 | /* |
@@ -1076,7 +1086,8 @@ struct bfa_port_link_s { | |||
1076 | u8 speed; /* Link speed (1/2/4/8 G) */ | 1086 | u8 speed; /* Link speed (1/2/4/8 G) */ |
1077 | u32 linkstate_opt; /* Linkstate optional data (debug) */ | 1087 | u32 linkstate_opt; /* Linkstate optional data (debug) */ |
1078 | u8 trunked; /* Trunked or not (1 or 0) */ | 1088 | u8 trunked; /* Trunked or not (1 or 0) */ |
1079 | u8 resvd[7]; | 1089 | u8 fec_state; /*!< State of FEC */ |
1090 | u8 resvd[6]; | ||
1080 | struct bfa_qos_attr_s qos_attr; /* QoS Attributes */ | 1091 | struct bfa_qos_attr_s qos_attr; /* QoS Attributes */ |
1081 | union { | 1092 | union { |
1082 | struct bfa_fcport_loop_info_s loop_info; | 1093 | struct bfa_fcport_loop_info_s loop_info; |
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index 6ed60425dd34..1baa9b348c59 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c | |||
@@ -3079,6 +3079,8 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
3079 | port_cfg->qos_bw.med = BFA_QOS_BW_MED; | 3079 | port_cfg->qos_bw.med = BFA_QOS_BW_MED; |
3080 | port_cfg->qos_bw.low = BFA_QOS_BW_LOW; | 3080 | port_cfg->qos_bw.low = BFA_QOS_BW_LOW; |
3081 | 3081 | ||
3082 | fcport->fec_state = BFA_FEC_OFFLINE; | ||
3083 | |||
3082 | INIT_LIST_HEAD(&fcport->stats_pending_q); | 3084 | INIT_LIST_HEAD(&fcport->stats_pending_q); |
3083 | INIT_LIST_HEAD(&fcport->statsclr_pending_q); | 3085 | INIT_LIST_HEAD(&fcport->statsclr_pending_q); |
3084 | 3086 | ||
@@ -3157,6 +3159,9 @@ bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) | |||
3157 | 3159 | ||
3158 | if (fcport->cfg.bb_cr_enabled) | 3160 | if (fcport->cfg.bb_cr_enabled) |
3159 | fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; | 3161 | fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; |
3162 | |||
3163 | fcport->fec_state = pevent->link_state.fec_state; | ||
3164 | |||
3160 | /* | 3165 | /* |
3161 | * update trunk state if applicable | 3166 | * update trunk state if applicable |
3162 | */ | 3167 | */ |
@@ -3176,6 +3181,7 @@ bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport) | |||
3176 | { | 3181 | { |
3177 | fcport->speed = BFA_PORT_SPEED_UNKNOWN; | 3182 | fcport->speed = BFA_PORT_SPEED_UNKNOWN; |
3178 | fcport->topology = BFA_PORT_TOPOLOGY_NONE; | 3183 | fcport->topology = BFA_PORT_TOPOLOGY_NONE; |
3184 | fcport->fec_state = BFA_FEC_OFFLINE; | ||
3179 | } | 3185 | } |
3180 | 3186 | ||
3181 | /* | 3187 | /* |
@@ -4027,6 +4033,8 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr) | |||
4027 | attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); | 4033 | attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); |
4028 | attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); | 4034 | attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); |
4029 | 4035 | ||
4036 | attr->fec_state = fcport->fec_state; | ||
4037 | |||
4030 | /* PBC Disabled State */ | 4038 | /* PBC Disabled State */ |
4031 | if (bfa_fcport_is_pbcdisabled(bfa)) | 4039 | if (bfa_fcport_is_pbcdisabled(bfa)) |
4032 | attr->port_state = BFA_PORT_ST_PREBOOT_DISABLED; | 4040 | attr->port_state = BFA_PORT_ST_PREBOOT_DISABLED; |
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h index 768ed6ac18fd..5af64de152b6 100644 --- a/drivers/scsi/bfa/bfa_svc.h +++ b/drivers/scsi/bfa/bfa_svc.h | |||
@@ -513,6 +513,7 @@ struct bfa_fcport_s { | |||
513 | struct bfa_mem_dma_s fcport_dma; | 513 | struct bfa_mem_dma_s fcport_dma; |
514 | bfa_boolean_t stats_dma_ready; | 514 | bfa_boolean_t stats_dma_ready; |
515 | struct bfa_bbcr_attr_s bbcr_attr; | 515 | struct bfa_bbcr_attr_s bbcr_attr; |
516 | enum bfa_fec_state_s fec_state; | ||
516 | }; | 517 | }; |
517 | 518 | ||
518 | #define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport) | 519 | #define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport) |