Skip to contentSkip to conversation

ATAPI pass through v2: adds few comments

PATCH In review Bique Alexandre 3 participants 4 messages Jul 1, 2009 – Jul 5, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 ATAPI pass through v2: adds few comments

This patch adds few comments to some CD-ROM emulated commands.

Signature · 1 line
Alexandre Bique
hw/ide.c +6 -6
index 1e56786..063f08d 100644
@@ -1664,9 +1664,9 @@ static void ide_atapi_cmd(IDEState *s)
             switch(action) {
             case 0: /* current values */
                 switch(code) {
-                case 0x01: /* error recovery */
+                case 0x01: /* read write error recovery parameters */
                     cpu_to_ube16(&buf[0], 16 + 6);
-                    buf[2] = 0x70;
+                    buf[2] = 0x70; /* Obselete: medium type code */
                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
@@ -1683,17 +1683,17 @@ static void ide_atapi_cmd(IDEState *s)
                     buf[15] = 0x00;
                     ide_atapi_cmd_reply(s, 16, max_len);
                     break;
-                case 0x2a:
+                case 0x2a: /* CD/DVD capabilities & mechanical status */
                     cpu_to_ube16(&buf[0], 28 + 6);
-                    buf[2] = 0x70;
+                    buf[2] = 0x70; /* Obselete: medium type code */
                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
                     buf[6] = 0;
                     buf[7] = 0;
 
-                    buf[8] = 0x2a;
-                    buf[9] = 0x12;
+                    buf[8] = 0x2a; /* page code */
+                    buf[9] = 0x12; /* page lenght */
                     buf[10] = 0x00;
                     buf[11] = 0x00;
 

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 37 lines · On Wednesday 01 July 2009 19:46:56 Juan Quintela wrote:
Quoted 1 line · Bique Alexandre

This patch adds few comments to some CD-ROM emulated commands.

hw/ide.c +2 -2
index 1e56786..063f08d 100644
@@ -1664,9 +1664,9 @@ static void ide_atapi_cmd(IDEState *s)
             switch(action) {
             case 0: /* current values */
                 switch(code) {
-                case 0x01: /* error recovery */
+                case 0x01: /* read write error recovery parameters */
                     cpu_to_ube16(&buf[0], 16 + 6);
-                    buf[2] = 0x70;
+                    buf[2] = 0x70; /* Obselete: medium type code */
                                       ^^^^^^^^

Obsolete I guess

                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
hw/ide.c +2 -2
@@ -1683,17 +1683,17 @@ static void ide_atapi_cmd(IDEState *s)
                     buf[15] = 0x00;
                     ide_atapi_cmd_reply(s, 16, max_len);
                     break;
-                case 0x2a:
+                case 0x2a: /* CD/DVD capabilities & mechanical status */
                     cpu_to_ube16(&buf[0], 28 + 6);
-                    buf[2] = 0x70;
+                    buf[2] = 0x70; /* Obselete: medium type code */

Obsolete I guess also

                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
                     buf[6] = 0;
                     buf[7] = 0;

hw/ide.c

Quoted 6 lines
hw/ide.c +2 -2
-                    buf[8] = 0x2a;
-                    buf[9] = 0x12;
+                    buf[8] = 0x2a; /* page code */
+                    buf[9] = 0x12; /* page lenght */
                     buf[10] = 0x00;
                     buf[11] = 0x00;

You're right. Thanks again.
I join the updated patch.

Signature · 1 line
Alexandre Bique
hw/ide.c +6 -6
index 1e56786..063f08d 100644
@@ -1664,9 +1664,9 @@ static void ide_atapi_cmd(IDEState *s)
             switch(action) {
             case 0: /* current values */
                 switch(code) {
-                case 0x01: /* error recovery */
+                case 0x01: /* read write error recovery parameters */
                     cpu_to_ube16(&buf[0], 16 + 6);
-                    buf[2] = 0x70;
+                    buf[2] = 0x70; /* Obsolete: medium type code */
                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
@@ -1683,17 +1683,17 @@ static void ide_atapi_cmd(IDEState *s)
                     buf[15] = 0x00;
                     ide_atapi_cmd_reply(s, 16, max_len);
                     break;
-                case 0x2a:
+                case 0x2a: /* CD/DVD capabilities & mechanical status */
                     cpu_to_ube16(&buf[0], 28 + 6);
-                    buf[2] = 0x70;
+                    buf[2] = 0x70; /* Obsolete: medium type code */
                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
                     buf[6] = 0;
                     buf[7] = 0;
 
-                    buf[8] = 0x2a;
-                    buf[9] = 0x12;
+                    buf[8] = 0x2a; /* page code */
+                    buf[9] = 0x12; /* page lenght */
                     buf[10] = 0x00;
                     buf[11] = 0x00;
 
#3 lore raw

hw/ide.c static void ide_atapi_cmd(IDEState *s) · line 1696

Quoted 4 lines · Bique Alexandre
hw/ide.c +2 -2
-                    buf[8] = 0x2a;
-                    buf[9] = 0x12;
+                    buf[8] = 0x2a; /* page code */
+                    buf[9] = 0x12; /* page lenght */
                                              ^^^^^^

length, too. :-)

Signature · 1 line
Stuart Brady
#4 lore raw
In reply to Bique Alexandre
Quoted 1 line · Bique Alexandre

This patch adds few comments to some CD-ROM emulated commands.

Looks good to be, but long term we'd be better off having headers with symbolic names for all the constants from the standards..