[PATCH 5/7] modepage for write parameters

Ronnie Sahlberg ronniesahlberg
Fri May 2 14:38:54 CEST 2008


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

diff --git a/usr/mmc.c b/usr/mmc.c
index ce66c7c..d075b23 100644
--- a/usr/mmc.c
+++ b/usr/mmc.c
@@ -119,6 +119,7 @@ static int mmc_rw(int host_no, struct scsi_cmd *cmd)
 		set_cmd_mmapio(cmd);
 		return SAM_STAT_GOOD;
 	}
+
 	return 0;
 }

@@ -1454,6 +1455,11 @@ static int mmc_synchronize_cache(int host_no,
struct scsi_cmd *cmd)
 		return SAM_STAT_CHECK_CONDITION;
 	}

+	if (mmc->current_profile == PROFILE_DVD_PLUS_R) {
+		/* once we close the track it becomes a DVD_ROM */
+		mmc->current_profile = PROFILE_DVD_ROM;
+	}
+
 	return SAM_STAT_GOOD;
 }

@@ -2146,6 +2152,21 @@ static int mmc_read_dvd_structure(int host_no,
struct scsi_cmd *cmd)
 	return SAM_STAT_CHECK_CONDITION;
 }

+static int mmc_reserve_track(int host_no, struct scsi_cmd *cmd)
+{
+	return SAM_STAT_GOOD;
+}
+
+static int mmc_mode_select(int host_no, struct scsi_cmd *cmd)
+{
+	return SAM_STAT_GOOD;
+}
+
+static int mmc_set_cd_speed(int host_no, struct scsi_cmd *cmd)
+{
+	return SAM_STAT_GOOD;
+}
+
 static int mmc_mode_sense(int host_no, struct scsi_cmd *cmd)
 {
 	uint8_t *scb = cmd->scb;
@@ -2214,6 +2235,8 @@ static int mmc_lu_init(struct scsi_lu *lu)
 	add_mode_page(lu, "0x1d:0:10:0:0:7:0:0:2:0:2:0:20");
 	/* MM capabilities */
 	add_mode_page(lu,
"0x2a:0:0x3e:0x3f:0x37:0xf3:0xf3:0x29:0x23:0x10:0x8a:0x01:0x00:0x08:0x00:0x10:0x8a:0x00:0x00:0x10:0x8a:0x10:0x8a:0x00:0x01:0x00:0x00:0x00:0x00:0x10:0x8a:0x00:0x05:0x00:0x00:0x10:0x8a:0x00:0x00:0x0b:0x06:0x00:0x00:0x08:0x45:0x00:0x00:0x05:0x83:0x00:0x00:0x02:0xc2:0x00:0x00:0x00:0x00:0x00:0x00:0x00:0x00:0x00:0x00:0x00:0x00");
+	/* Write parameters */
+	add_mode_page(lu,
"0x05:0:0x32:0x62:5:8:0x10:0:0:0:0:0:0:0:0x10:0:0x96:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0");

 	return 0;
 }
@@ -2355,9 +2378,9 @@ static struct device_type_template mmc_template = {
 		{spc_illegal_op,},
 		{mmc_read_disc_information,},
 		{mmc_read_track_information,},
+		{mmc_reserve_track,},
 		{spc_illegal_op,},
-		{spc_illegal_op,},
-		{spc_illegal_op,},
+		{mmc_mode_select,},
 		{spc_illegal_op,},
 		{spc_illegal_op,},

@@ -2404,7 +2427,7 @@ static struct device_type_template mmc_template = {
 		{spc_illegal_op,},
 		{spc_illegal_op,},
 		{spc_illegal_op,},
-		{spc_illegal_op,},
+		{mmc_set_cd_speed,},
 		{spc_illegal_op,},
 		{spc_illegal_op,},
 		{spc_illegal_op,},
-- 
1.5.5



More information about the stgt mailing list