aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
commite5f9f5a89a01abc2b9c09747452aeb9218d6bffd (patch)
tree6a09f9be2ccbc27ef0baf0001719a70240c02537
parent0e38a66a1e69821ab57a06d5a7b11f0df9275bf4 (diff)
ide: remove atapi_feature_t
Remove atapi_feature_t. While at it: * replace 'HWIF(drive)' by 'hwif' Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-floppy.c10
-rw-r--r--drivers/scsi/ide-scsi.c11
-rw-r--r--include/linux/ide.h27
3 files changed, 9 insertions, 39 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 2a37a08ddd57..95e302790001 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1019,9 +1019,9 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
1019{ 1019{
1020 idefloppy_floppy_t *floppy = drive->driver_data; 1020 idefloppy_floppy_t *floppy = drive->driver_data;
1021 ide_hwif_t *hwif = drive->hwif; 1021 ide_hwif_t *hwif = drive->hwif;
1022 atapi_feature_t feature;
1023 atapi_bcount_t bcount; 1022 atapi_bcount_t bcount;
1024 ide_handler_t *pkt_xfer_routine; 1023 ide_handler_t *pkt_xfer_routine;
1024 u8 dma;
1025 1025
1026 if (floppy->failed_pc == NULL && 1026 if (floppy->failed_pc == NULL &&
1027 pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD) 1027 pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD)
@@ -1064,20 +1064,20 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
1064 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) 1064 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags))
1065 ide_dma_off(drive); 1065 ide_dma_off(drive);
1066 1066
1067 feature.all = 0; 1067 dma = 0;
1068 1068
1069 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) 1069 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma)
1070 feature.b.dma = !hwif->dma_setup(drive); 1070 dma = !hwif->dma_setup(drive);
1071 1071
1072 if (IDE_CONTROL_REG) 1072 if (IDE_CONTROL_REG)
1073 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); 1073 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
1074 /* Use PIO/DMA */ 1074 /* Use PIO/DMA */
1075 HWIF(drive)->OUTB(feature.all, IDE_FEATURE_REG); 1075 hwif->OUTB(dma, IDE_FEATURE_REG);
1076 HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG); 1076 HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG);
1077 HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG); 1077 HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG);
1078 HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG); 1078 HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG);
1079 1079
1080 if (feature.b.dma) { /* Begin DMA, if necessary */ 1080 if (dma) { /* Begin DMA, if necessary */
1081 set_bit(PC_DMA_IN_PROGRESS, &pc->flags); 1081 set_bit(PC_DMA_IN_PROGRESS, &pc->flags);
1082 hwif->dma_start(drive); 1082 hwif->dma_start(drive);
1083 } 1083 }
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index bd2b56912472..c009f2351346 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -399,7 +399,6 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
399 struct request *rq = pc->rq; 399 struct request *rq = pc->rq;
400 atapi_bcount_t bcount; 400 atapi_bcount_t bcount;
401 atapi_ireason_t ireason; 401 atapi_ireason_t ireason;
402 atapi_feature_t feature;
403 unsigned int temp; 402 unsigned int temp;
404 u8 stat; 403 u8 stat;
405 404
@@ -424,7 +423,6 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
424 (void) HWIF(drive)->ide_dma_end(drive); 423 (void) HWIF(drive)->ide_dma_end(drive);
425 } 424 }
426 425
427 feature.all = 0;
428 /* Clear the interrupt */ 426 /* Clear the interrupt */
429 stat = drive->hwif->INB(IDE_STATUS_REG); 427 stat = drive->hwif->INB(IDE_STATUS_REG);
430 428
@@ -572,18 +570,17 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
572{ 570{
573 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 571 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
574 ide_hwif_t *hwif = drive->hwif; 572 ide_hwif_t *hwif = drive->hwif;
575 atapi_feature_t feature;
576 atapi_bcount_t bcount; 573 atapi_bcount_t bcount;
574 u8 dma = 0;
577 575
578 scsi->pc=pc; /* Set the current packet command */ 576 scsi->pc=pc; /* Set the current packet command */
579 pc->actually_transferred=0; /* We haven't transferred any data yet */ 577 pc->actually_transferred=0; /* We haven't transferred any data yet */
580 pc->current_position=pc->buffer; 578 pc->current_position=pc->buffer;
581 bcount.all = min(pc->request_transfer, 63 * 1024); /* Request to transfer the entire buffer at once */ 579 bcount.all = min(pc->request_transfer, 63 * 1024); /* Request to transfer the entire buffer at once */
582 580
583 feature.all = 0;
584 if (drive->using_dma && !idescsi_map_sg(drive, pc)) { 581 if (drive->using_dma && !idescsi_map_sg(drive, pc)) {
585 hwif->sg_mapped = 1; 582 hwif->sg_mapped = 1;
586 feature.b.dma = !hwif->dma_setup(drive); 583 dma = !hwif->dma_setup(drive);
587 hwif->sg_mapped = 0; 584 hwif->sg_mapped = 0;
588 } 585 }
589 586
@@ -591,11 +588,11 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
591 if (IDE_CONTROL_REG) 588 if (IDE_CONTROL_REG)
592 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); 589 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
593 590
594 HWIF(drive)->OUTB(feature.all, IDE_FEATURE_REG); 591 hwif->OUTB(dma, IDE_FEATURE_REG);
595 HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG); 592 HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG);
596 HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG); 593 HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG);
597 594
598 if (feature.b.dma) 595 if (dma)
599 set_bit(PC_DMA_OK, &pc->flags); 596 set_bit(PC_DMA_OK, &pc->flags);
600 597
601 if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) { 598 if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 0c1b0aaa2865..a638dde17e77 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -366,33 +366,6 @@ typedef union {
366} select_t, ata_select_t; 366} select_t, ata_select_t;
367 367
368/* 368/*
369 * ATAPI Feature Register
370 *
371 * dma : Using DMA or PIO
372 * reserved321 : Reserved
373 * reserved654 : Reserved (Tag Type)
374 * reserved7 : Reserved
375 */
376typedef union {
377 unsigned all :8;
378 struct {
379#if defined(__LITTLE_ENDIAN_BITFIELD)
380 unsigned dma :1;
381 unsigned reserved321 :3;
382 unsigned reserved654 :3;
383 unsigned reserved7 :1;
384#elif defined(__BIG_ENDIAN_BITFIELD)
385 unsigned reserved7 :1;
386 unsigned reserved654 :3;
387 unsigned reserved321 :3;
388 unsigned dma :1;
389#else
390#error "Please fix <asm/byteorder.h>"
391#endif
392 } b;
393} atapi_feature_t;
394
395/*
396 * ATAPI Interrupt Reason Register. 369 * ATAPI Interrupt Reason Register.
397 * 370 *
398 * cod : Information transferred is command (1) or data (0) 371 * cod : Information transferred is command (1) or data (0)