Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112867
b: refs/heads/master
c: aaaade3
h: refs/heads/master
i:
  112865: 0e521bd
  112863: da76ba7
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 10, 2008
1 parent dcb78fe commit 15e7be7
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 94 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: a4f19040a3a6cd431efe0a10b9d2e8d5e3904865
refs/heads/master: aaaade3f059fa1b57283d4a7c8351a42ec747bf0
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_atapi_pc *pc,

/* Issue the packet command */
if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) {
ide_execute_command(drive, WIN_PACKETCMD, handler,
ide_execute_command(drive, ATA_CMD_PACKET, handler,
timeout, NULL);
return ide_started;
} else {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive,
drive->waiting_for_dma = 0;

/* packet command */
ide_execute_command(drive, WIN_PACKETCMD, handler,
ide_execute_command(drive, ATA_CMD_PACKET, handler,
ATAPI_WAIT_PC, cdrom_timer_expiry);
return ide_started;
} else {
Expand Down
68 changes: 34 additions & 34 deletions trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ static int lba_capacity_is_ok(u16 *id)
}

static const u8 ide_rw_cmds[] = {
WIN_MULTREAD,
WIN_MULTWRITE,
WIN_MULTREAD_EXT,
WIN_MULTWRITE_EXT,
WIN_READ,
WIN_WRITE,
WIN_READ_EXT,
WIN_WRITE_EXT,
WIN_READDMA,
WIN_WRITEDMA,
WIN_READDMA_EXT,
WIN_WRITEDMA_EXT,
ATA_CMD_READ_MULTI,
ATA_CMD_WRITE_MULTI,
ATA_CMD_READ_MULTI_EXT,
ATA_CMD_WRITE_MULTI_EXT,
ATA_CMD_PIO_READ,
ATA_CMD_PIO_WRITE,
ATA_CMD_PIO_READ_EXT,
ATA_CMD_PIO_WRITE_EXT,
ATA_CMD_READ,
ATA_CMD_WRITE,
ATA_CMD_READ_EXT,
ATA_CMD_WRITE_EXT,
};

static const u8 ide_data_phases[] = {
Expand Down Expand Up @@ -323,9 +323,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48)
/* Create IDE/ATA command request structure */
memset(&args, 0, sizeof(ide_task_t));
if (lba48)
tf->command = WIN_READ_NATIVE_MAX_EXT;
tf->command = ATA_CMD_READ_NATIVE_MAX_EXT;
else
tf->command = WIN_READ_NATIVE_MAX;
tf->command = ATA_CMD_READ_NATIVE_MAX;
tf->device = ATA_LBA;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
if (lba48)
Expand Down Expand Up @@ -360,10 +360,10 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48)
tf->hob_lbal = (addr_req >>= 8) & 0xff;
tf->hob_lbam = (addr_req >>= 8) & 0xff;
tf->hob_lbah = (addr_req >>= 8) & 0xff;
tf->command = WIN_SET_MAX_EXT;
tf->command = ATA_CMD_SET_MAX_EXT;
} else {
tf->device = (addr_req >>= 8) & 0x0f;
tf->command = WIN_SET_MAX;
tf->command = ATA_CMD_SET_MAX;
}
tf->device |= ATA_LBA;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
Expand Down Expand Up @@ -482,10 +482,10 @@ static int smart_enable(ide_drive_t *drive)
struct ide_taskfile *tf = &args.tf;

memset(&args, 0, sizeof(ide_task_t));
tf->feature = SMART_ENABLE;
tf->lbam = SMART_LCYL_PASS;
tf->lbah = SMART_HCYL_PASS;
tf->command = WIN_SMART;
tf->feature = ATA_SMART_ENABLE;
tf->lbam = ATA_SMART_LBAM_PASS;
tf->lbah = ATA_SMART_LBAH_PASS;
tf->command = ATA_CMD_SMART;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
return ide_no_data_taskfile(drive, &args);
}
Expand All @@ -498,9 +498,9 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
memset(&args, 0, sizeof(ide_task_t));
tf->feature = sub_cmd;
tf->nsect = 0x01;
tf->lbam = SMART_LCYL_PASS;
tf->lbah = SMART_HCYL_PASS;
tf->command = WIN_SMART;
tf->lbam = ATA_SMART_LBAM_PASS;
tf->lbah = ATA_SMART_LBAH_PASS;
tf->command = ATA_CMD_SMART;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
args.data_phase = TASKFILE_IN;
(void) smart_enable(drive);
Expand Down Expand Up @@ -558,14 +558,14 @@ static int proc_idedisk_read_sv
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
return proc_idedisk_read_smart(page, start, off, count, eof, data,
SMART_READ_VALUES);
ATA_SMART_READ_VALUES);
}

static int proc_idedisk_read_st
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
return proc_idedisk_read_smart(page, start, off, count, eof, data,
SMART_READ_THRESHOLDS);
ATA_SMART_READ_THRESHOLDS);
}

static ide_proc_entry_t idedisk_proc[] = {
Expand All @@ -589,9 +589,9 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
memset(task, 0, sizeof(*task));
if (ide_id_has_flush_cache_ext(drive->id) &&
(drive->capacity64 >= (1UL << 28)))
task->tf.command = WIN_FLUSH_CACHE_EXT;
task->tf.command = ATA_CMD_FLUSH_EXT;
else
task->tf.command = WIN_FLUSH_CACHE;
task->tf.command = ATA_CMD_FLUSH;
task->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
IDE_TFLAG_DYN;
task->data_phase = TASKFILE_NO_DATA;
Expand Down Expand Up @@ -686,8 +686,8 @@ static int write_cache(ide_drive_t *drive, int arg)
if (ide_id_has_flush_cache(drive->id)) {
memset(&args, 0, sizeof(ide_task_t));
args.tf.feature = arg ?
SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE;
args.tf.command = WIN_SETFEATURES;
SETFEATURES_WC_ON : SETFEATURES_WC_OFF;
args.tf.command = ATA_CMD_SET_FEATURES;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
err = ide_no_data_taskfile(drive, &args);
if (err == 0)
Expand All @@ -705,9 +705,9 @@ static int do_idedisk_flushcache(ide_drive_t *drive)

memset(&args, 0, sizeof(ide_task_t));
if (ide_id_has_flush_cache_ext(drive->id))
args.tf.command = WIN_FLUSH_CACHE_EXT;
args.tf.command = ATA_CMD_FLUSH_EXT;
else
args.tf.command = WIN_FLUSH_CACHE;
args.tf.command = ATA_CMD_FLUSH;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
return ide_no_data_taskfile(drive, &args);
}
Expand All @@ -720,9 +720,9 @@ static int set_acoustic(ide_drive_t *drive, int arg)
return -EINVAL;

memset(&args, 0, sizeof(ide_task_t));
args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM;
args.tf.feature = arg ? SETFEATURES_AAM_ON : SETFEATURES_AAM_OFF;
args.tf.nsect = arg;
args.tf.command = WIN_SETFEATURES;
args.tf.command = ATA_CMD_SET_FEATURES;
args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
ide_no_data_taskfile(drive, &args);
drive->acoustic = arg;
Expand Down Expand Up @@ -985,7 +985,7 @@ static int idedisk_set_doorlock(ide_drive_t *drive, int on)
ide_task_t task;

memset(&task, 0, sizeof(task));
task.tf.command = on ? WIN_DOORLOCK : WIN_DOORUNLOCK;
task.tf.command = on ? ATA_CMD_MEDIA_LOCK : ATA_CMD_MEDIA_UNLOCK;
task.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;

return ide_no_data_taskfile(drive, &task);
Expand Down
27 changes: 14 additions & 13 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
return ide_stopped;
}
if (ide_id_has_flush_cache_ext(drive->id))
args->tf.command = WIN_FLUSH_CACHE_EXT;
args->tf.command = ATA_CMD_FLUSH_EXT;
else
args->tf.command = WIN_FLUSH_CACHE;
args->tf.command = ATA_CMD_FLUSH;
goto out_do_tf;

case idedisk_pm_standby: /* Suspend step 2 (standby) */
args->tf.command = WIN_STANDBYNOW1;
args->tf.command = ATA_CMD_STANDBYNOW1;
goto out_do_tf;

case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */
Expand All @@ -209,7 +209,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
return ide_stopped;

case idedisk_pm_idle: /* Resume step 2 (idle) */
args->tf.command = WIN_IDLEIMMEDIATE;
args->tf.command = ATA_CMD_IDLEIMMEDIATE;
goto out_do_tf;

case ide_pm_restore_dma: /* Resume step 3 (restore DMA) */
Expand Down Expand Up @@ -380,8 +380,8 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
/* err has different meaning on cdrom and tape */
if (err == ABRT_ERR) {
if (drive->select.b.lba &&
/* some newer drives don't support WIN_SPECIFY */
hwif->tp_ops->read_status(hwif) == WIN_SPECIFY)
/* some newer drives don't support ATA_CMD_INIT_DEV_PARAMS */
hwif->tp_ops->read_status(hwif) == ATA_CMD_INIT_DEV_PARAMS)
return ide_stopped;
} else if ((err & BAD_CRC) == BAD_CRC) {
/* UDMA crc error, just retry the operation */
Expand Down Expand Up @@ -436,7 +436,7 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, u

if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT))
/* force an abort */
hwif->tp_ops->exec_command(hwif, WIN_IDLEIMMEDIATE);
hwif->tp_ops->exec_command(hwif, ATA_CMD_IDLEIMMEDIATE);

if (rq->errors >= ERROR_MAX) {
ide_kill_rq(drive, rq);
Expand Down Expand Up @@ -509,19 +509,19 @@ static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
tf->lbam = drive->cyl;
tf->lbah = drive->cyl >> 8;
tf->device = ((drive->head - 1) | drive->select.all) & ~ATA_LBA;
tf->command = WIN_SPECIFY;
tf->command = ATA_CMD_INIT_DEV_PARAMS;
}

static void ide_tf_set_restore_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
{
tf->nsect = drive->sect;
tf->command = WIN_RESTORE;
tf->command = ATA_CMD_RESTORE;
}

static void ide_tf_set_setmult_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
{
tf->nsect = drive->mult_req;
tf->command = WIN_SETMULT;
tf->command = ATA_CMD_SET_MULTI;
}

static ide_startstop_t ide_disk_special(ide_drive_t *drive)
Expand Down Expand Up @@ -584,9 +584,10 @@ static int set_pio_mode_abuse(ide_hwif_t *hwif, u8 req_pio)
* do_special - issue some special commands
* @drive: drive the command is for
*
* do_special() is used to issue WIN_SPECIFY, WIN_RESTORE, and WIN_SETMULT
* commands to a drive. It used to do much more, but has been scaled
* back.
* do_special() is used to issue ATA_CMD_INIT_DEV_PARAMS,
* ATA_CMD_RESTORE and ATA_CMD_SET_MULTI commands to a drive.
*
* It used to do much more, but has been scaled back.
*/

static ide_startstop_t do_special (ide_drive_t *drive)
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void ide_fix_driveid(u16 *id)
* ide_fixstring() cleans up and (optionally) byte-swaps a text string,
* removing leading/trailing blanks and compressing internal blanks.
* It is primarily used to tidy up the model name/number fields as
* returned by the WIN_[P]IDENTIFY commands.
* returned by the ATA_CMD_ID_ATA[PI] commands.
*/

void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
Expand Down Expand Up @@ -675,7 +675,7 @@ int ide_driveid_update(ide_drive_t *drive)
SELECT_MASK(drive, 1);
tp_ops->set_irq(hwif, 0);
msleep(50);
tp_ops->exec_command(hwif, WIN_IDENTIFY);
tp_ops->exec_command(hwif, ATA_CMD_ID_ATA);
timeout = jiffies + WAIT_WORSTCASE;
do {
if (time_after(jiffies, timeout)) {
Expand Down Expand Up @@ -770,7 +770,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)

tp_ops->tf_load(drive, &task);

tp_ops->exec_command(hwif, WIN_SETFEATURES);
tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES);

if (drive->quirk_list == 2)
tp_ops->set_irq(hwif, 1);
Expand Down Expand Up @@ -890,7 +890,7 @@ void ide_execute_pkt_cmd(ide_drive_t *drive)
unsigned long flags;

spin_lock_irqsave(&ide_lock, flags);
hwif->tp_ops->exec_command(hwif, WIN_PACKETCMD);
hwif->tp_ops->exec_command(hwif, ATA_CMD_PACKET);
ndelay(400);
spin_unlock_irqrestore(&ide_lock, flags);
}
Expand Down Expand Up @@ -1100,7 +1100,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
pre_reset(drive);
SELECT_DRIVE(drive);
udelay (20);
tp_ops->exec_command(hwif, WIN_SRST);
tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET);
ndelay(400);
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
hwgroup->polling = 1;
Expand Down
Loading

0 comments on commit 15e7be7

Please sign in to comment.