diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-04-08 08:13:01 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-04-08 08:13:01 -0400 |
commit | 60f85019c6c8c1aebf3485a313e0da094bc95d07 (patch) | |
tree | 5cbb0e1a733b59887308a50ce083613c4e7c0ede /drivers/ide/ide-atapi.c | |
parent | 674f0ea111bc9bff1b4e4841d7da38933c5e3b59 (diff) |
ide: replace IDE_TFLAG_* flags by IDE_VALID_*
Replace IDE_TFLAG_{IN|OUT}_* flags meaning to the taskfile register validity on
input/output by the IDE_VALID_* flags and introduce 4 symmetric 8-bit register
validity indicator subfields, 'valid.{input/output}.{tf|hob}', into the 'struct
ide_cmd' instead of using the 'tf_flags' field for that purpose (this field can
then be turned from 32-bit into 8-bit one).
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r-- | drivers/ide/ide-atapi.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 3e43b889dd64..a359323d8ffe 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -257,8 +257,7 @@ void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason) | |||
257 | struct ide_cmd cmd; | 257 | struct ide_cmd cmd; |
258 | 258 | ||
259 | memset(&cmd, 0, sizeof(cmd)); | 259 | memset(&cmd, 0, sizeof(cmd)); |
260 | cmd.tf_flags = IDE_TFLAG_IN_LBAH | IDE_TFLAG_IN_LBAM | | 260 | cmd.valid.in.tf = IDE_VALID_LBAH | IDE_VALID_LBAM | IDE_VALID_NSECT; |
261 | IDE_TFLAG_IN_NSECT; | ||
262 | 261 | ||
263 | drive->hwif->tp_ops->tf_read(drive, &cmd); | 262 | drive->hwif->tp_ops->tf_read(drive, &cmd); |
264 | 263 | ||
@@ -439,12 +438,12 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) | |||
439 | return ide_started; | 438 | return ide_started; |
440 | } | 439 | } |
441 | 440 | ||
442 | static void ide_init_packet_cmd(struct ide_cmd *cmd, u32 tf_flags, | 441 | static void ide_init_packet_cmd(struct ide_cmd *cmd, u8 valid_tf, |
443 | u16 bcount, u8 dma) | 442 | u16 bcount, u8 dma) |
444 | { | 443 | { |
445 | cmd->protocol = dma ? ATAPI_PROT_DMA : ATAPI_PROT_PIO; | 444 | cmd->protocol = dma ? ATAPI_PROT_DMA : ATAPI_PROT_PIO; |
446 | cmd->tf_flags |= IDE_TFLAG_OUT_LBAH | IDE_TFLAG_OUT_LBAM | | 445 | cmd->valid.out.tf = IDE_VALID_LBAH | IDE_VALID_LBAM | |
447 | IDE_TFLAG_OUT_FEATURE | tf_flags; | 446 | IDE_VALID_FEATURE | valid_tf; |
448 | cmd->tf.command = ATA_CMD_PACKET; | 447 | cmd->tf.command = ATA_CMD_PACKET; |
449 | cmd->tf.feature = dma; /* Use PIO/DMA */ | 448 | cmd->tf.feature = dma; /* Use PIO/DMA */ |
450 | cmd->tf.lbam = bcount & 0xff; | 449 | cmd->tf.lbam = bcount & 0xff; |
@@ -456,7 +455,7 @@ static u8 ide_read_ireason(ide_drive_t *drive) | |||
456 | struct ide_cmd cmd; | 455 | struct ide_cmd cmd; |
457 | 456 | ||
458 | memset(&cmd, 0, sizeof(cmd)); | 457 | memset(&cmd, 0, sizeof(cmd)); |
459 | cmd.tf_flags = IDE_TFLAG_IN_NSECT; | 458 | cmd.valid.in.tf = IDE_VALID_NSECT; |
460 | 459 | ||
461 | drive->hwif->tp_ops->tf_read(drive, &cmd); | 460 | drive->hwif->tp_ops->tf_read(drive, &cmd); |
462 | 461 | ||
@@ -588,12 +587,12 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd) | |||
588 | ide_expiry_t *expiry = NULL; | 587 | ide_expiry_t *expiry = NULL; |
589 | struct request *rq = hwif->rq; | 588 | struct request *rq = hwif->rq; |
590 | unsigned int timeout; | 589 | unsigned int timeout; |
591 | u32 tf_flags; | ||
592 | u16 bcount; | 590 | u16 bcount; |
591 | u8 valid_tf; | ||
593 | u8 drq_int = !!(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT); | 592 | u8 drq_int = !!(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT); |
594 | 593 | ||
595 | if (dev_is_idecd(drive)) { | 594 | if (dev_is_idecd(drive)) { |
596 | tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL; | 595 | valid_tf = IDE_VALID_NSECT | IDE_VALID_LBAL; |
597 | bcount = ide_cd_get_xferlen(rq); | 596 | bcount = ide_cd_get_xferlen(rq); |
598 | expiry = ide_cd_expiry; | 597 | expiry = ide_cd_expiry; |
599 | timeout = ATAPI_WAIT_PC; | 598 | timeout = ATAPI_WAIT_PC; |
@@ -607,7 +606,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd) | |||
607 | pc->xferred = 0; | 606 | pc->xferred = 0; |
608 | pc->cur_pos = pc->buf; | 607 | pc->cur_pos = pc->buf; |
609 | 608 | ||
610 | tf_flags = IDE_TFLAG_OUT_DEVICE; | 609 | valid_tf = IDE_VALID_DEVICE; |
611 | bcount = ((drive->media == ide_tape) ? | 610 | bcount = ((drive->media == ide_tape) ? |
612 | pc->req_xfer : | 611 | pc->req_xfer : |
613 | min(pc->req_xfer, 63 * 1024)); | 612 | min(pc->req_xfer, 63 * 1024)); |
@@ -627,7 +626,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd) | |||
627 | : WAIT_TAPE_CMD; | 626 | : WAIT_TAPE_CMD; |
628 | } | 627 | } |
629 | 628 | ||
630 | ide_init_packet_cmd(cmd, tf_flags, bcount, drive->dma); | 629 | ide_init_packet_cmd(cmd, valid_tf, bcount, drive->dma); |
631 | 630 | ||
632 | (void)do_rw_taskfile(drive, cmd); | 631 | (void)do_rw_taskfile(drive, cmd); |
633 | 632 | ||