[patch ide-dev 2/9] add ide_tf_get_address() helper

2005-02-24 Thread Bartlomiej Zolnierkiewicz

* add ide_tf_get_address() helper
* use it in idedisk_read_native_max_address[_ext]()
  and idedisk_set_max_address[_ext]()

diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c2005-02-19 17:22:32 +01:00
+++ b/drivers/ide/ide-disk.c2005-02-19 17:22:32 +01:00
@@ -344,8 +344,7 @@

/* if OK, compute maximum address value */
if ((tf-command  1) == 0) {
-   addr = ((tf-device  0xf)  24) |
-  (tf-lbah  16) | (tf-lbam  8) | tf-lbal;
+   addr = (u32)ide_tf_get_address(tf);
addr++; /* since the return value is (maxlba - 1), we add 1 */
}
return addr;
@@ -373,9 +372,7 @@

/* if OK, compute maximum address value */
if ((tf-command  1) == 0) {
-   u32 high = (tf-hob_lbah  16) | (tf-hob_lbam  8) | 
tf-hob_lbal;
-   u32 low  = (tf-lbah  16) | (tf-lbam  8) | tf-lbal;
-   addr = ((__u64)high  24) | low;
+   addr = ide_tf_get_address(tf);
addr++; /* since the return value is (maxlba - 1), we add 1 */
}
return addr;
@@ -407,8 +404,7 @@
ide_raw_taskfile(drive, args, NULL);
/* if OK, read new maximum address value */
if ((tf-command  1) == 0) {
-   addr_set = ((tf-device  0xf)  24) |
-  (tf-lbah  16) | (tf-lbam  8) | tf-lbal;
+   addr_set = (u32)ide_tf_get_address(tf);
addr_set++;
}
return addr_set;
@@ -442,9 +438,7 @@
ide_raw_taskfile(drive, args, NULL);
/* if OK, compute maximum address value */
if ((tf-command  1) == 0) {
-   u32 high = (tf-hob_lbah  16) | (tf-hob_lbam  8) | 
tf-hob_lbal;
-   u32 low  = (tf-lbah  16) | (tf-lbam  8) | tf-lbal;
-   addr_set = ((__u64)high  24) | low;
+   addr_set = ide_tf_get_address(tf);
addr_set++;
}
return addr_set;
diff -Nru a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
--- a/drivers/ide/ide-io.c  2005-02-19 17:22:32 +01:00
+++ b/drivers/ide/ide-io.c  2005-02-19 17:22:32 +01:00
@@ -317,6 +317,22 @@
spin_unlock_irqrestore(ide_lock, flags);
 }

+u64 ide_tf_get_address(struct ata_taskfile *tf)
+{
+   u32 high, low;
+
+   if (tf-flags  ATA_TFLAG_LBA48)
+   high = (tf-hob_lbah  16) | (tf-hob_lbam  8) | 
tf-hob_lbal;
+   else
+   high = tf-device  0xf;
+
+   low = (tf-lbah  16) | (tf-lbam  8) | tf-lbal;
+
+   return ((u64)high  24) | low;
+}
+
+EXPORT_SYMBOL_GPL(ide_tf_get_address);
+
 /*
  * FIXME: probably move this somewhere else, name is bad too :)
  */
diff -Nru a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h   2005-02-19 17:22:32 +01:00
+++ b/include/linux/ide.h   2005-02-19 17:22:32 +01:00
@@ -1189,6 +1189,8 @@
  */
 extern void ide_init_drive_cmd (struct request *rq);

+u64 ide_tf_get_address(struct ata_taskfile *);
+
 /*
  * this function returns error location sector offset in case of a write error
  */
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH libata-dev-2.6] Issue INITIALIZE DEVICE PARAMETERS for CHS only devices

2005-02-24 Thread Albert Lee
Albert Lee wrote:
  Rediff'ed against 2.6.11-rc5 + C/H/S patches.
Attached please find the revised patch for your review.
I forgot to mention. The correct title, as indicated by Mark, should be:
Issue INITIALIZE DEVICE PARAMETERS for pre-ATA4 or CHS only devices
Albert
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH libata-dev-2.6] ata_scsi_verify_xlat() fix

2005-02-24 Thread Jeff Garzik
As far as I can tell, your patches are diff'd correctly.  Yet, they 
still do not apply:

drivers/scsi/libata-scsi.c 1.68: 1661 lines
2 out of 2 hunks FAILED -- saving rejects to file 
drivers/scsi/libata-scsi.c.rej

I do not understand the problem, so I simply applied them by hand.
Thanks for your patience,
Jeff

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html