Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Sep 2014 13:48:52 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r271904 - stable/10/sys/cam/ctl
Message-ID:  <201409201348.s8KDmqBs009529@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Sep 20 13:48:52 2014
New Revision: 271904
URL: http://svnweb.freebsd.org/changeset/base/271904

Log:
  MFC r271702:
  Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL
  UNIT DESCRIPTOR field as Identification Descriptor CSCD descriptor, not
  just as Identification Descriptor.
  
  Approved by:	re (gjb)

Modified:
  stable/10/sys/cam/ctl/ctl_tpc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl_tpc.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_tpc.c	Sat Sep 20 13:46:16 2014	(r271903)
+++ stable/10/sys/cam/ctl/ctl_tpc.c	Sat Sep 20 13:48:52 2014	(r271904)
@@ -1811,6 +1811,7 @@ tpc_create_token(struct ctl_lun *lun, st
 {
 	static int id = 0;
 	struct scsi_vpd_id_descriptor *idd = NULL;
+	struct scsi_ec_cscd_id *cscd;
 	int targid_len;
 
 	scsi_ulto4b(ROD_TYPE_AUR, token->type);
@@ -1824,8 +1825,12 @@ tpc_create_token(struct ctl_lun *lun, st
 		idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *)
 		    lun->lun_devid->data, lun->lun_devid->len,
 		    scsi_devid_is_lun_eui64);
-	if (idd != NULL)
-		memcpy(&token->body[8], idd, 4 + idd->length);
+	if (idd != NULL) {
+		cscd = (struct scsi_ec_cscd_id *)&token->body[8];
+		cscd->type_code = EC_CSCD_ID;
+		cscd->luidt_pdt = T_DIRECT;
+		memcpy(&cscd->codeset, idd, 4 + idd->length);
+	}
 	scsi_u64to8b(0, &token->body[40]);
 	scsi_u64to8b(len, &token->body[48]);
 	if (port->target_devid) {



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