public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Vijaya Mohan Guvva <vmohan@brocade.com>
To: linux-scsi@vger.kernel.org
Cc: JBottomley@parallels.com,
	adapter_linux_open_src_team@Brocade.COM,
	Vijaya Mohan Guvva <vmohan@Brocade.COM>
Subject: [PATCH V1 02/17] bfa: Forward Error Correction status query
Date: Mon, 13 May 2013 02:33:20 -0700	[thread overview]
Message-ID: <1368437615-9867-3-git-send-email-vmohan@brocade.com> (raw)
In-Reply-To: <1368437615-9867-1-git-send-email-vmohan@brocade.com>

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>
---
 drivers/scsi/bfa/bfa_defs_svc.h | 15 +++++++++++++--
 drivers/scsi/bfa/bfa_svc.c      |  8 ++++++++
 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 efbf0a9..8522475 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 {
 	BFA_LUNMASK_UNINITIALIZED = 0xff,
 };
 
+/**
+ * FEC states
+ */
+enum bfa_fec_state_s {
+	BFA_FEC_ONLINE = 1,		/*!< FEC is online */
+	BFA_FEC_OFFLINE = 2,		/*!< FEC is offline */
+	BFA_FEC_OFFLINE_NOT_16G = 3,	/*!< FEC is offline (speed not 16Gig) */
+};
+
 #pragma pack(1)
 /*
  * LUN mask configuration
@@ -978,6 +987,7 @@ struct bfa_port_attr_s {
 	bfa_boolean_t		link_e2e_beacon; /* link beacon is on */
 	bfa_boolean_t		bbsc_op_status;	/* fc credit recovery oper
 						 * state */
+	enum bfa_fec_state_s	fec_state;	/*!< current FEC state */
 
 	/*
 	 * Dynamic field - info from FCS
@@ -989,7 +999,7 @@ struct bfa_port_attr_s {
 
 	/* FCoE specific  */
 	u16			fcoe_vlan;
-	u8			rsvd1[6];
+	u8			rsvd1[2];
 };
 
 /*
@@ -1076,7 +1086,8 @@ struct bfa_port_link_s {
 	u8	 speed;		/*  Link speed (1/2/4/8 G) */
 	u32	 linkstate_opt; /*  Linkstate optional data (debug) */
 	u8	 trunked;	/*  Trunked or not (1 or 0) */
-	u8	 resvd[7];
+	u8	 fec_state;	/*!< State of FEC */
+	u8	 resvd[6];
 	struct bfa_qos_attr_s  qos_attr;   /* QoS Attributes */
 	union {
 		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 0fff5ec..60ebcc9 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,
 	port_cfg->qos_bw.med = BFA_QOS_BW_MED;
 	port_cfg->qos_bw.low = BFA_QOS_BW_LOW;
 
+	fcport->fec_state = BFA_FEC_OFFLINE;
+
 	INIT_LIST_HEAD(&fcport->stats_pending_q);
 	INIT_LIST_HEAD(&fcport->statsclr_pending_q);
 
@@ -3157,6 +3159,9 @@ bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport)
 
 	if (fcport->cfg.bb_cr_enabled)
 		fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr;
+
+	fcport->fec_state = pevent->link_state.fec_state;
+
 	/*
 	 * update trunk state if applicable
 	 */
@@ -3176,6 +3181,7 @@ bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport)
 {
 	fcport->speed = BFA_PORT_SPEED_UNKNOWN;
 	fcport->topology = BFA_PORT_TOPOLOGY_NONE;
+	fcport->fec_state = BFA_FEC_OFFLINE;
 }
 
 /*
@@ -4027,6 +4033,8 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
 	attr->pport_cfg.q_depth  = bfa_fcpim_qdepth_get(bfa);
 	attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm);
 
+	attr->fec_state = fcport->fec_state;
+
 	/* PBC Disabled State */
 	if (bfa_fcport_is_pbcdisabled(bfa))
 		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 c2fb834..810bd9c 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -513,6 +513,7 @@ struct bfa_fcport_s {
 	struct bfa_mem_dma_s	fcport_dma;
 	bfa_boolean_t		stats_dma_ready;
 	struct bfa_bbcr_attr_s	bbcr_attr;
+	enum bfa_fec_state_s	fec_state;
 };
 
 #define BFA_FCPORT_MOD(__bfa)	(&(__bfa)->modules.fcport)
-- 
1.7.12


  parent reply	other threads:[~2013-05-13  9:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13  9:33 [PATCH V1 00/17] Update the driver version to 3.2.21.1 Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 01/17] bfa: Support for FC BB credit recovery Vijaya Mohan Guvva
2013-05-13  9:33 ` Vijaya Mohan Guvva [this message]
2013-05-13  9:33 ` [PATCH V1 03/17] bfa: Add dynamic diagnostic port support Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 04/17] bfa: Fix WARN_ON condition check Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 05/17] bfa: FDMI enhancements Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 06/17] bfa: Fix 1860 port initialize when ATC is enabled Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 07/17] bfa: Fix FDISC timeout handling Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 08/17] bfa: kdump fix on 815 and 825 adapters Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 09/17] bfa: driver compatibility with 32bit libs Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 10/17] bfa: fru vpd date update changes Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 11/17] bfa: firmware statistics update Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 12/17] bfa: Allow rsp queue process during ioc disable Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 13/17] bfa: Fix bug_on condition in RPSC rsp handling Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 14/17] bfa: fix endianess issue for firmware stats Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 15/17] bfa: Support for chinook-quad port card Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 16/17] bfa: dis-associate bfa path_tov with dev_loss_tmo Vijaya Mohan Guvva
2013-05-13  9:33 ` [PATCH V1 17/17] bfa: Update the driver version to 3.2.21.1 Vijaya Mohan Guvva
2013-05-23 10:55 ` [PATCH V1 00/17] " Vijay Mohan Guvva
2013-06-04 15:26 ` Vijaya Mohan Guvva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368437615-9867-3-git-send-email-vmohan@brocade.com \
    --to=vmohan@brocade.com \
    --cc=JBottomley@parallels.com \
    --cc=adapter_linux_open_src_team@Brocade.COM \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox