Merge libata upstream (which includes C/H/S support) include irq-pio branch.
authorJeff Garzik <jgarzik@pobox.com>
Mon, 3 Oct 2005 23:48:49 +0000 (19:48 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Mon, 3 Oct 2005 23:48:49 +0000 (19:48 -0400)
Merge branch 'upstream'

1  2 
drivers/scsi/libata-core.c
include/linux/ata.h
include/linux/libata.h

Simple merge
index 6fec2f6f2d5912ec76b7fa987497eea0a570aa3e,ecb7346d0c166cb9185664886925d9bf4150e239..65cd7e5b2f189d97b1eed4fcc99121862d424522
@@@ -181,7 -182,7 +182,8 @@@ enum 
        ATA_TFLAG_ISADDR        = (1 << 1), /* enable r/w to nsect/lba regs */
        ATA_TFLAG_DEVICE        = (1 << 2), /* enable r/w to device reg */
        ATA_TFLAG_WRITE         = (1 << 3), /* data dir: host->dev==1 (write) */
-       ATA_TFLAG_POLLING       = (1 << 4), /* set nIEN to 1 and use polling */
+       ATA_TFLAG_LBA           = (1 << 4), /* enable LBA */
++      ATA_TFLAG_POLLING       = (1 << 5), /* set nIEN to 1 and use polling */
  };
  
  enum ata_tf_protocols {
@@@ -251,8 -252,18 +253,20 @@@ struct ata_taskfile 
          ((u64) (id)[(n) + 1] << 16) | \
          ((u64) (id)[(n) + 0]) )
  
 +#define ata_id_cdb_intr(id)   (((id)[0] & 0x60) == 0x20)
 +
+ static inline int ata_id_current_chs_valid(u16 *id)
+ {
+       /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 
+          has not been issued to the device then the values of 
+          id[54] to id[56] are vendor specific. */
+       return (id[53] & 0x01) && /* Current translation valid */
+               id[54] &&  /* cylinders in current translation */
+               id[55] &&  /* heads in current translation */
+               id[55] <= 16 &&
+               id[56];    /* sectors in current translation */
+ }
  static inline int atapi_cdb_len(u16 *dev_id)
  {
        u16 tmp = dev_id[0] & 0x3;
index 7e6feb97406e9e58c79168b7d4848d81f9495a97,4739a75b983d04ae9ad434efa642f0f4561c4125..dbf5f08fb3ed6bee85feb0f3eb303aa17acdb8b0
@@@ -97,7 -97,7 +97,8 @@@ enum 
        ATA_DFLAG_LBA48         = (1 << 0), /* device supports LBA48 */
        ATA_DFLAG_PIO           = (1 << 1), /* device currently in PIO mode */
        ATA_DFLAG_LOCK_SECTORS  = (1 << 2), /* don't adjust max_sectors */
-       ATA_DFLAG_CDB_INTR      = (1 << 3), /* device asserts INTRQ when ready for CDB */
+       ATA_DFLAG_LBA           = (1 << 3), /* device supports LBA */
++      ATA_DFLAG_CDB_INTR      = (1 << 4), /* device asserts INTRQ when ready for CDB */
  
        ATA_DEV_UNKNOWN         = 0,    /* unknown device */
        ATA_DEV_ATA             = 1,    /* ATA device */