Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76263
b: refs/heads/master
c: a501633
h: refs/heads/master
i:
  76261: 2aee49a
  76259: 5a5a3dd
  76255: 1948a05
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 25, 2008
1 parent 826c6c6 commit 60a4a7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c904fcfbb0d8eef92ef42b1da378b4714143e46
refs/heads/master: a501633c7d44087e806597d3a213d735346edd51
26 changes: 4 additions & 22 deletions trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,18 +326,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
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;
}

Expand Down Expand Up @@ -373,18 +364,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
/* 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;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/ide/ide-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ static void ide_dump_opcode(ide_drive_t *drive)
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;

Expand All @@ -492,6 +492,7 @@ static u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48)

return ((u64)high << 24) | low;
}
EXPORT_SYMBOL_GPL(ide_get_lba_addr);

static void ide_dump_sector(ide_drive_t *drive)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ static inline int ide_dev_is_sata(struct hd_driveid *id)
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 {
Expand Down

0 comments on commit 60a4a7a

Please sign in to comment.