>From 631d4448a6673b2bda173b6865fe06f81ecca3c2 Mon Sep 17 00:00:00 2001
From: Ronnie Sahlberg <[EMAIL PROTECTED]>
Date: Sun, 4 May 2008 15:59:07 +1000
Subject: [PATCH] Use the same serial number in mmc GetConfiguration as
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 <[EMAIL PROTECTED]>
---
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
_______________________________________________
Stgt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/stgt-devel