ide_no_data_taskfile(drive, &args);
/* if OK, compute maximum address value */
- if ((tf->status & 0x01) == 0) {
- u32 high, low;
+ if ((tf->status & 0x01) == 0)
+ addr = ide_get_lba_addr(tf, lba48) + 1;
- if (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;
- addr = ((__u64)high << 24) | low;
- addr++; /* since the return value is (maxlba - 1), we add 1 */
- }
return addr;
}
/* submit command request */
ide_no_data_taskfile(drive, &args);
/* if OK, compute maximum address value */
- if ((tf->status & 0x01) == 0) {
- u32 high, low;
+ if ((tf->status & 0x01) == 0)
+ addr_set = ide_get_lba_addr(tf, lba48) + 1;
- if (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;
- addr_set = ((__u64)high << 24) | low;
- addr_set++;
- }
return addr_set;
}
printk("0x%02x\n", opcode);
}
-static u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48)
+u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48)
{
u32 high, low;
return ((u64)high << 24) | low;
}
+EXPORT_SYMBOL_GPL(ide_get_lba_addr);
static void ide_dump_sector(ide_drive_t *drive)
{
return 0;
}
+u64 ide_get_lba_addr(struct ide_taskfile *, int);
u8 ide_dump_status(ide_drive_t *, const char *, u8);
typedef struct ide_pio_timings_s {