aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_tpc.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2014-09-17 07:08:59 +0000
committerAlexander Motin <mav@FreeBSD.org>2014-09-17 07:08:59 +0000
commit4ab4d6879c91f3cd060078290cee253a942a6ed1 (patch)
tree2bd641de37c7780557fd7741c53fe085737c8e1c /sys/cam/ctl/ctl_tpc.c
parent13378399d6c8d14d5bc732740b947fda95c2cc18 (diff)
downloadsrc-4ab4d6879c91f3cd060078290cee253a942a6ed1.tar.gz
src-4ab4d6879c91f3cd060078290cee253a942a6ed1.zip
Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT
DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as Identification Descriptor. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=271702
Diffstat (limited to 'sys/cam/ctl/ctl_tpc.c')
-rw-r--r--sys/cam/ctl/ctl_tpc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index 4d41005d2e61..7a973cbbaec1 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -1811,6 +1811,7 @@ tpc_create_token(struct ctl_lun *lun, struct ctl_port *port, off_t len,
{
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, struct ctl_port *port, off_t len,
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) {