summaryrefslogtreecommitdiff
path: root/usr/src/cmd/cdrw
diff options
context:
space:
mode:
authorec158148 <none@none>2005-10-17 20:58:30 -0700
committerec158148 <none@none>2005-10-17 20:58:30 -0700
commitdc36087fa16452a8712ccd300aca994d51793978 (patch)
treef560a80ec4b26a77e10263a08a20c7a03ddbb413 /usr/src/cmd/cdrw
parent49df45665521d358380d3324f56fbc1ef143e72f (diff)
downloadillumos-joyent-dc36087fa16452a8712ccd300aca994d51793978.tar.gz
6227720 Incorrect cdb initialization in cdrw code.
Diffstat (limited to 'usr/src/cmd/cdrw')
-rw-r--r--usr/src/cmd/cdrw/mmc.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr/src/cmd/cdrw/mmc.c b/usr/src/cmd/cdrw/mmc.c
index 6a342f50d7..9c051ee619 100644
--- a/usr/src/cmd/cdrw/mmc.c
+++ b/usr/src/cmd/cdrw/mmc.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -242,6 +242,7 @@ read_disc_info(int fd, uchar_t *di)
return (1);
}
+/* Get information about the Logical Unit's capabilities */
int
get_configuration(int fd, uint16_t feature, int bufsize, uchar_t *buf)
{
@@ -250,16 +251,24 @@ get_configuration(int fd, uint16_t feature, int bufsize, uchar_t *buf)
scmd = get_uscsi_cmd();
scmd->uscsi_flags = USCSI_READ|USCSI_SILENT;
scmd->uscsi_timeout = DEFAULT_SCSI_TIMEOUT;
+
+ /* Set OPERATION CODE in CDB */
scmd->uscsi_cdb[0] = GET_CONFIG_CMD;
- if (feature == 0)
- scmd->uscsi_cdb[1] = 0x2;
- else
- scmd->uscsi_cdb[1] = 0x1;
+
+ /*
+ * Set RT field in CDB, currently need at most one
+ * Feature Descriptor
+ */
scmd->uscsi_cdb[1] = 0x2;
+
+ /* Set Starting Feature Number in CDB */
scmd->uscsi_cdb[2] = (feature >> 8) & 0xff;
scmd->uscsi_cdb[3] = feature & 0xff;
+
+ /* Set Allocation Length in CDB */
scmd->uscsi_cdb[7] = (bufsize >> 8) & 0xff;
scmd->uscsi_cdb[8] = bufsize & 0xff;
+
scmd->uscsi_cdblen = 10;
scmd->uscsi_bufaddr = (char *)buf;
scmd->uscsi_buflen = bufsize;