Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76249
b: refs/heads/master
c: 866e2ec
h: refs/heads/master
i:
  76247: 7023f88
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 25, 2008
1 parent 646a2a1 commit a219d92
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 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: ac026ff254b32915bb14ba97a23b4019d137f181
refs/heads/master: 866e2ec9ce525de0e7c10d02ead8d85af27adffd
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
if (args) {
struct ide_taskfile *tf = &args->tf;

if (args->tf_in_flags.b.data) {
if (args->tf_flags & IDE_TFLAG_IN_DATA) {
u16 data = hwif->INW(IDE_DATA_REG);

tf->data = data & 0xff;
Expand Down
29 changes: 13 additions & 16 deletions trunk/drivers/ide/ide-taskfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)

memcpy(&args.tf_array[0], req_task->hob_ports, HDIO_DRIVE_HOB_HDR_SIZE - 2);
memcpy(&args.tf_array[6], req_task->io_ports, HDIO_DRIVE_TASK_HDR_SIZE);
args.tf_in_flags = req_task->in_flags;
args.data_phase = req_task->data_phase;

args.data_phase = req_task->data_phase;

args.tf_flags = IDE_TFLAG_OUT_DEVICE;
if (drive->addressing == 1)
Expand Down Expand Up @@ -637,6 +637,9 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
args.tf_flags |= IDE_TFLAG_OUT_HOB;
}

if (req_task->in_flags.b.data)
args.tf_flags |= IDE_TFLAG_IN_DATA;

drive->io_32bit = 0;
switch(req_task->data_phase) {
case TASKFILE_MULTI_OUT:
Expand Down Expand Up @@ -704,7 +707,13 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)

memcpy(req_task->hob_ports, &args.tf_array[0], HDIO_DRIVE_HOB_HDR_SIZE - 2);
memcpy(req_task->io_ports, &args.tf_array[6], HDIO_DRIVE_TASK_HDR_SIZE);
req_task->in_flags = args.tf_in_flags;

if ((args.tf_flags & IDE_TFLAG_FLAGGED_SET_IN_FLAGS) &&
req_task->in_flags.all == 0) {
req_task->in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;
if (drive->addressing == 1)
req_task->in_flags.all |= (IDE_HOB_STD_IN_FLAGS << 8);
}

if (copy_to_user(buf, req_task, tasksize)) {
err = -EFAULT;
Expand Down Expand Up @@ -846,19 +855,7 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
}
}

/*
* (ks) Check taskfile in flags.
* If set, then execute as it is defined.
* If not set, then define default settings.
* The default values are:
* read all taskfile registers (except data)
* read the hob registers (sector, nsector, lcyl, hcyl)
*/
if (task->tf_in_flags.all == 0) {
task->tf_in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;
if (drive->addressing == 1)
task->tf_in_flags.all |= (IDE_HOB_STD_IN_FLAGS << 8);
}
task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS;

return do_rw_taskfile(drive, task);
}
5 changes: 3 additions & 2 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@ enum {
IDE_TFLAG_OUT_LBAH,
IDE_TFLAG_OUT_DEVICE = (1 << 14),
IDE_TFLAG_WRITE = (1 << 15),
IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16),
IDE_TFLAG_IN_DATA = (1 << 17),
};

struct ide_taskfile {
Expand Down Expand Up @@ -946,8 +948,7 @@ typedef struct ide_task_s {
struct ide_taskfile tf;
u8 tf_array[14];
};
u16 tf_flags;
ide_reg_valid_t tf_in_flags;
u32 tf_flags;
int data_phase;
ide_pre_handler_t *prehandler;
ide_handler_t *handler;
Expand Down

0 comments on commit a219d92

Please sign in to comment.