linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: SCSI to ATA translation fix
@ 2005-01-27 10:30 Albert Lee
  2005-02-02  3:26 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Albert Lee @ 2005-01-27 10:30 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Bartlomiej Zolnierkiewicz, Doug Maxey, IDE Linux

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

Hi Jeff,

Attached please find the patch against libata-2.6 for your review.

Changes:
  #1. ata_scsi_rw_xlat():  
    Fix  incorrect SCSI to ATA translation for 16 bytes SCSI Read/Write commands. 
   (Already submitted in the previous patch. Merged with change #2 and resubmitted again.)

  #2. Fix ata_scsi_verify_xlat():
    Fix incorrect tf->hob_lbax translation.

Albert

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
----------------------------------------------------------------------------------------------
--- libata-2.6/drivers/scsi/libata-scsi.c 2005-01-27 10:41:46.000000000 +0800
+++ libata-2.6-mod/drivers/scsi/libata-scsi.c 2005-01-27 18:10:20.261707752 +0800
@@ -497,9 +497,9 @@
 
  tf->nsect = n_sect & 0xff;
 
- tf->hob_lbah = (sect >> 16) & 0xff;
- tf->hob_lbam = (sect >> 8) & 0xff;
- tf->hob_lbal = sect & 0xff;
+ tf->lbah = (sect >> 16) & 0xff;
+ tf->lbam = (sect >> 8) & 0xff;
+ tf->lbal = sect & 0xff;
 
  return 0;
 }
@@ -599,7 +599,7 @@
     return 1;
 
    /* stores LBA27:24 in lower 4 bits of device reg */
-   tf->device |= scsicmd[2];
+   tf->device |= scsicmd[6];
 
    qc->nsect = scsicmd[13];
   }

[-- Attachment #2: ata_xlat.patch --]
[-- Type: application/octet-stream, Size: 641 bytes --]

--- libata-2.6/drivers/scsi/libata-scsi.c	2005-01-27 10:41:46.000000000 +0800
+++ libata-2.6-mod/drivers/scsi/libata-scsi.c	2005-01-27 18:10:20.261707752 +0800
@@ -497,9 +497,9 @@
 
 	tf->nsect = n_sect & 0xff;
 
-	tf->hob_lbah = (sect >> 16) & 0xff;
-	tf->hob_lbam = (sect >> 8) & 0xff;
-	tf->hob_lbal = sect & 0xff;
+	tf->lbah = (sect >> 16) & 0xff;
+	tf->lbam = (sect >> 8) & 0xff;
+	tf->lbal = sect & 0xff;
 
 	return 0;
 }
@@ -599,7 +599,7 @@
 				return 1;
 
 			/* stores LBA27:24 in lower 4 bits of device reg */
-			tf->device |= scsicmd[2];
+			tf->device |= scsicmd[6];
 
 			qc->nsect = scsicmd[13];
 		}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-02  3:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-27 10:30 [PATCH] libata: SCSI to ATA translation fix Albert Lee
2005-02-02  3:26 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).