diff options
author | Tejun Heo <tj@kernel.org> | 2009-09-15 15:17:28 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-10-06 00:26:27 -0400 |
commit | 110f66d25c33c2259b1125255fa7063ab07b8340 (patch) | |
tree | 2d524b3f27aa168eb01cbb007c2bfa195bea42f4 /drivers/ata/libata-acpi.c | |
parent | fa5b561c4ea170caf9759109acc2e961a7e83bea (diff) |
libata: make gtf_filter per-dev
Add ->gtf_filter to ata_device and set it to ata_acpi_gtf_filter when
initializing ata_link. This is to allow quirks which apply different
gtf filters.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-acpi.c')
-rw-r--r-- | drivers/ata/libata-acpi.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 960c6a7caa83..b0882cddfd4c 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #include <acpi/acpi_bus.h> | 21 | #include <acpi/acpi_bus.h> |
22 | 22 | ||
23 | static unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT; | 23 | unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT; |
24 | module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644); | 24 | module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644); |
25 | MODULE_PARM_DESC(acpi_gtf_filter, "filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM, 0x8=FPDMA non-zero offset, 0x10=FPDMA DMA Setup FIS auto-activate)"); | 25 | MODULE_PARM_DESC(acpi_gtf_filter, "filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM, 0x8=FPDMA non-zero offset, 0x10=FPDMA DMA Setup FIS auto-activate)"); |
26 | 26 | ||
@@ -603,10 +603,11 @@ static void ata_acpi_gtf_to_tf(struct ata_device *dev, | |||
603 | tf->command = gtf->tf[6]; /* 0x1f7 */ | 603 | tf->command = gtf->tf[6]; /* 0x1f7 */ |
604 | } | 604 | } |
605 | 605 | ||
606 | static int ata_acpi_filter_tf(const struct ata_taskfile *tf, | 606 | static int ata_acpi_filter_tf(struct ata_device *dev, |
607 | const struct ata_taskfile *tf, | ||
607 | const struct ata_taskfile *ptf) | 608 | const struct ata_taskfile *ptf) |
608 | { | 609 | { |
609 | if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_SETXFER) { | 610 | if (dev->gtf_filter & ATA_ACPI_FILTER_SETXFER) { |
610 | /* libata doesn't use ACPI to configure transfer mode. | 611 | /* libata doesn't use ACPI to configure transfer mode. |
611 | * It will only confuse device configuration. Skip. | 612 | * It will only confuse device configuration. Skip. |
612 | */ | 613 | */ |
@@ -615,7 +616,7 @@ static int ata_acpi_filter_tf(const struct ata_taskfile *tf, | |||
615 | return 1; | 616 | return 1; |
616 | } | 617 | } |
617 | 618 | ||
618 | if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_LOCK) { | 619 | if (dev->gtf_filter & ATA_ACPI_FILTER_LOCK) { |
619 | /* BIOS writers, sorry but we don't wanna lock | 620 | /* BIOS writers, sorry but we don't wanna lock |
620 | * features unless the user explicitly said so. | 621 | * features unless the user explicitly said so. |
621 | */ | 622 | */ |
@@ -640,18 +641,18 @@ static int ata_acpi_filter_tf(const struct ata_taskfile *tf, | |||
640 | if (tf->command == ATA_CMD_SET_FEATURES && | 641 | if (tf->command == ATA_CMD_SET_FEATURES && |
641 | tf->feature == SETFEATURES_SATA_ENABLE) { | 642 | tf->feature == SETFEATURES_SATA_ENABLE) { |
642 | /* inhibit enabling DIPM */ | 643 | /* inhibit enabling DIPM */ |
643 | if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_DIPM && | 644 | if (dev->gtf_filter & ATA_ACPI_FILTER_DIPM && |
644 | tf->nsect == SATA_DIPM) | 645 | tf->nsect == SATA_DIPM) |
645 | return 1; | 646 | return 1; |
646 | 647 | ||
647 | /* inhibit FPDMA non-zero offset */ | 648 | /* inhibit FPDMA non-zero offset */ |
648 | if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_FPDMA_OFFSET && | 649 | if (dev->gtf_filter & ATA_ACPI_FILTER_FPDMA_OFFSET && |
649 | (tf->nsect == SATA_FPDMA_OFFSET || | 650 | (tf->nsect == SATA_FPDMA_OFFSET || |
650 | tf->nsect == SATA_FPDMA_IN_ORDER)) | 651 | tf->nsect == SATA_FPDMA_IN_ORDER)) |
651 | return 1; | 652 | return 1; |
652 | 653 | ||
653 | /* inhibit FPDMA auto activation */ | 654 | /* inhibit FPDMA auto activation */ |
654 | if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_FPDMA_AA && | 655 | if (dev->gtf_filter & ATA_ACPI_FILTER_FPDMA_AA && |
655 | tf->nsect == SATA_FPDMA_AA) | 656 | tf->nsect == SATA_FPDMA_AA) |
656 | return 1; | 657 | return 1; |
657 | } | 658 | } |
@@ -705,7 +706,7 @@ static int ata_acpi_run_tf(struct ata_device *dev, | |||
705 | pptf = &ptf; | 706 | pptf = &ptf; |
706 | } | 707 | } |
707 | 708 | ||
708 | if (!ata_acpi_filter_tf(&tf, pptf)) { | 709 | if (!ata_acpi_filter_tf(dev, &tf, pptf)) { |
709 | rtf = tf; | 710 | rtf = tf; |
710 | err_mask = ata_exec_internal(dev, &rtf, NULL, | 711 | err_mask = ata_exec_internal(dev, &rtf, NULL, |
711 | DMA_NONE, NULL, 0, 0); | 712 | DMA_NONE, NULL, 0, 0); |