[PATCH] Use the same serial number in mmc GetConfiguration as

Ronnie Sahlberg ronniesahlberg
Sun May 4 07:59:07 CEST 2008


Inquiry 0x80 uses

When sending back the Logical Unit Serial Number of the device as part of
GetConfiguration: feature 0x0108    use the same data/string as is used
when reporting the serial number through inquiry 0x80

Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>
---
 usr/mmc.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/usr/mmc.c b/usr/mmc.c
index 9e52845..6f3be08 100644
--- a/usr/mmc.c
+++ b/usr/mmc.c
@@ -835,6 +835,9 @@ static char *feature_dvd_plus_r(struct scsi_cmd
*cmd, char *data,
 static char *feature_lun_serial_no(struct scsi_cmd *cmd, char *data,
 				   int only_current)
 {
+	struct lu_phy_attr *attrs;
+	struct vpd *vpd_pg;
+
 	/* feature code */
 	*data++ = 0x01;
 	*data++ = 0x08;
@@ -845,15 +848,13 @@ static char *feature_lun_serial_no(struct
scsi_cmd *cmd, char *data,
 	/* additional length */
 	*data++ = 8;

-	/* XXX */
-	*data++ = 'D';
-	*data++ = 'V';
-	*data++ = 'D';
-	*data++ = '#';
-	*data++ = '1';
-	*data++ = '2';
-	*data++ = '3';
-	*data++ = '4';
+	/* serial number */
+	attrs = &cmd->dev->attrs;
+	vpd_pg = attrs->lu_vpd[PCODE_OFFSET(0x80)];
+	if (vpd_pg->size == 8) {
+		memcpy(data, vpd_pg->data, 8);
+	}
+	data += 8;

 	return data;
 }
-- 
1.5.5



More information about the stgt mailing list