Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Mar 2017 17:06:34 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314966 - head/sys/dev/mpt
Message-ID:  <201703091706.v29H6Y1f055304@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar  9 17:06:34 2017
New Revision: 314966
URL: https://svnweb.freebsd.org/changeset/base/314966

Log:
  Report FC link speed.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/mpt/mpt_cam.c

Modified: head/sys/dev/mpt/mpt_cam.c
==============================================================================
--- head/sys/dev/mpt/mpt_cam.c	Thu Mar  9 17:01:00 2017	(r314965)
+++ head/sys/dev/mpt/mpt_cam.c	Thu Mar  9 17:06:34 2017	(r314966)
@@ -433,7 +433,23 @@ mpt_read_config_info_fc(struct mpt_softc
 	}
 	mpt2host_config_page_fc_port_0(&mpt->mpt_fcport_page0);
 
-	mpt->mpt_fcport_speed = mpt->mpt_fcport_page0.CurrentSpeed;
+	switch (mpt->mpt_fcport_page0.CurrentSpeed) {
+	case MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT:
+		mpt->mpt_fcport_speed = 1;
+		break;
+	case MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT:
+		mpt->mpt_fcport_speed = 2;
+		break;
+	case MPI_FCPORTPAGE0_CURRENT_SPEED_10GBIT:
+		mpt->mpt_fcport_speed = 10;
+		break;
+	case MPI_FCPORTPAGE0_CURRENT_SPEED_4GBIT:
+		mpt->mpt_fcport_speed = 4;
+		break;
+	default:
+		mpt->mpt_fcport_speed = 0;
+		break;
+	}
 
 	switch (mpt->mpt_fcport_page0.Flags &
 	    MPI_FCPORTPAGE0_FLAGS_ATTACH_TYPE_MASK) {
@@ -3465,8 +3481,10 @@ mpt_action(struct cam_sim *sim, union cc
 			cts->protocol_version = SCSI_REV_SPC;
 			cts->transport = XPORT_FC;
 			cts->transport_version = 0;
-			fc->valid = CTS_FC_VALID_SPEED;
-			fc->bitrate = 100000;
+			if (mpt->mpt_fcport_speed != 0) {
+				fc->valid = CTS_FC_VALID_SPEED;
+				fc->bitrate = 100000 * mpt->mpt_fcport_speed;
+			}
 		} else if (mpt->is_sas) {
 			struct ccb_trans_settings_sas *sas =
 			    &cts->xport_specific.sas;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703091706.v29H6Y1f055304>