diff options
Diffstat (limited to 'drivers/ata/pata_hpt37x.c')
-rw-r--r-- | drivers/ata/pata_hpt37x.c | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index dfb306057cf4..4ffc392052c0 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -349,24 +349,13 @@ static u32 hpt37x_find_mode(struct ata_port *ap, int speed) | |||
349 | 349 | ||
350 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) | 350 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) |
351 | { | 351 | { |
352 | unsigned char model_num[40]; | 352 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; |
353 | char *s; | ||
354 | unsigned int len; | ||
355 | int i = 0; | 353 | int i = 0; |
356 | 354 | ||
357 | ata_id_string(dev->id, model_num, ATA_ID_PROD_OFS, | 355 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
358 | sizeof(model_num)); | ||
359 | s = &model_num[0]; | ||
360 | len = strnlen(s, sizeof(model_num)); | ||
361 | 356 | ||
362 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | 357 | while (list[i] != NULL) { |
363 | while ((len > 0) && (s[len - 1] == ' ')) { | 358 | if (!strcmp(list[i], model_num)) { |
364 | len--; | ||
365 | s[len] = 0; | ||
366 | } | ||
367 | |||
368 | while(list[i] != NULL) { | ||
369 | if (!strncmp(list[i], s, len)) { | ||
370 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", | 359 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", |
371 | modestr, list[i]); | 360 | modestr, list[i]); |
372 | return 1; | 361 | return 1; |
@@ -459,7 +448,7 @@ static int hpt37x_pre_reset(struct ata_port *ap) | |||
459 | }; | 448 | }; |
460 | if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) | 449 | if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) |
461 | return -ENOENT; | 450 | return -ENOENT; |
462 | 451 | ||
463 | pci_read_config_byte(pdev, 0x5B, &scr2); | 452 | pci_read_config_byte(pdev, 0x5B, &scr2); |
464 | pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); | 453 | pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); |
465 | /* Cable register now active */ | 454 | /* Cable register now active */ |
@@ -504,7 +493,7 @@ static int hpt374_pre_reset(struct ata_port *ap) | |||
504 | 493 | ||
505 | if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) | 494 | if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) |
506 | return -ENOENT; | 495 | return -ENOENT; |
507 | 496 | ||
508 | /* Do the extra channel work */ | 497 | /* Do the extra channel work */ |
509 | pci_read_config_word(pdev, 0x52, &mcr3); | 498 | pci_read_config_word(pdev, 0x52, &mcr3); |
510 | pci_read_config_word(pdev, 0x56, &mcr6); | 499 | pci_read_config_word(pdev, 0x56, &mcr6); |
@@ -645,24 +634,24 @@ static void hpt370_bmdma_stop(struct ata_queued_cmd *qc) | |||
645 | { | 634 | { |
646 | struct ata_port *ap = qc->ap; | 635 | struct ata_port *ap = qc->ap; |
647 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 636 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
648 | u8 dma_stat = inb(ap->ioaddr.bmdma_addr + 2); | 637 | u8 dma_stat = ioread8(ap->ioaddr.bmdma_addr + 2); |
649 | u8 dma_cmd; | 638 | u8 dma_cmd; |
650 | unsigned long bmdma = ap->ioaddr.bmdma_addr; | 639 | void __iomem *bmdma = ap->ioaddr.bmdma_addr; |
651 | 640 | ||
652 | if (dma_stat & 0x01) { | 641 | if (dma_stat & 0x01) { |
653 | udelay(20); | 642 | udelay(20); |
654 | dma_stat = inb(bmdma + 2); | 643 | dma_stat = ioread8(bmdma + 2); |
655 | } | 644 | } |
656 | if (dma_stat & 0x01) { | 645 | if (dma_stat & 0x01) { |
657 | /* Clear the engine */ | 646 | /* Clear the engine */ |
658 | pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); | 647 | pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); |
659 | udelay(10); | 648 | udelay(10); |
660 | /* Stop DMA */ | 649 | /* Stop DMA */ |
661 | dma_cmd = inb(bmdma ); | 650 | dma_cmd = ioread8(bmdma ); |
662 | outb(dma_cmd & 0xFE, bmdma); | 651 | iowrite8(dma_cmd & 0xFE, bmdma); |
663 | /* Clear Error */ | 652 | /* Clear Error */ |
664 | dma_stat = inb(bmdma + 2); | 653 | dma_stat = ioread8(bmdma + 2); |
665 | outb(dma_stat | 0x06 , bmdma + 2); | 654 | iowrite8(dma_stat | 0x06 , bmdma + 2); |
666 | /* Clear the engine */ | 655 | /* Clear the engine */ |
667 | pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); | 656 | pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); |
668 | udelay(10); | 657 | udelay(10); |
@@ -807,14 +796,14 @@ static struct ata_port_operations hpt370_port_ops = { | |||
807 | .qc_prep = ata_qc_prep, | 796 | .qc_prep = ata_qc_prep, |
808 | .qc_issue = ata_qc_issue_prot, | 797 | .qc_issue = ata_qc_issue_prot, |
809 | 798 | ||
810 | .data_xfer = ata_pio_data_xfer, | 799 | .data_xfer = ata_data_xfer, |
811 | 800 | ||
812 | .irq_handler = ata_interrupt, | 801 | .irq_handler = ata_interrupt, |
813 | .irq_clear = ata_bmdma_irq_clear, | 802 | .irq_clear = ata_bmdma_irq_clear, |
803 | .irq_on = ata_irq_on, | ||
804 | .irq_ack = ata_irq_ack, | ||
814 | 805 | ||
815 | .port_start = ata_port_start, | 806 | .port_start = ata_port_start, |
816 | .port_stop = ata_port_stop, | ||
817 | .host_stop = ata_host_stop | ||
818 | }; | 807 | }; |
819 | 808 | ||
820 | /* | 809 | /* |
@@ -846,14 +835,14 @@ static struct ata_port_operations hpt370a_port_ops = { | |||
846 | .qc_prep = ata_qc_prep, | 835 | .qc_prep = ata_qc_prep, |
847 | .qc_issue = ata_qc_issue_prot, | 836 | .qc_issue = ata_qc_issue_prot, |
848 | 837 | ||
849 | .data_xfer = ata_pio_data_xfer, | 838 | .data_xfer = ata_data_xfer, |
850 | 839 | ||
851 | .irq_handler = ata_interrupt, | 840 | .irq_handler = ata_interrupt, |
852 | .irq_clear = ata_bmdma_irq_clear, | 841 | .irq_clear = ata_bmdma_irq_clear, |
842 | .irq_on = ata_irq_on, | ||
843 | .irq_ack = ata_irq_ack, | ||
853 | 844 | ||
854 | .port_start = ata_port_start, | 845 | .port_start = ata_port_start, |
855 | .port_stop = ata_port_stop, | ||
856 | .host_stop = ata_host_stop | ||
857 | }; | 846 | }; |
858 | 847 | ||
859 | /* | 848 | /* |
@@ -886,14 +875,14 @@ static struct ata_port_operations hpt372_port_ops = { | |||
886 | .qc_prep = ata_qc_prep, | 875 | .qc_prep = ata_qc_prep, |
887 | .qc_issue = ata_qc_issue_prot, | 876 | .qc_issue = ata_qc_issue_prot, |
888 | 877 | ||
889 | .data_xfer = ata_pio_data_xfer, | 878 | .data_xfer = ata_data_xfer, |
890 | 879 | ||
891 | .irq_handler = ata_interrupt, | 880 | .irq_handler = ata_interrupt, |
892 | .irq_clear = ata_bmdma_irq_clear, | 881 | .irq_clear = ata_bmdma_irq_clear, |
882 | .irq_on = ata_irq_on, | ||
883 | .irq_ack = ata_irq_ack, | ||
893 | 884 | ||
894 | .port_start = ata_port_start, | 885 | .port_start = ata_port_start, |
895 | .port_stop = ata_port_stop, | ||
896 | .host_stop = ata_host_stop | ||
897 | }; | 886 | }; |
898 | 887 | ||
899 | /* | 888 | /* |
@@ -926,14 +915,14 @@ static struct ata_port_operations hpt374_port_ops = { | |||
926 | .qc_prep = ata_qc_prep, | 915 | .qc_prep = ata_qc_prep, |
927 | .qc_issue = ata_qc_issue_prot, | 916 | .qc_issue = ata_qc_issue_prot, |
928 | 917 | ||
929 | .data_xfer = ata_pio_data_xfer, | 918 | .data_xfer = ata_data_xfer, |
930 | 919 | ||
931 | .irq_handler = ata_interrupt, | 920 | .irq_handler = ata_interrupt, |
932 | .irq_clear = ata_bmdma_irq_clear, | 921 | .irq_clear = ata_bmdma_irq_clear, |
922 | .irq_on = ata_irq_on, | ||
923 | .irq_ack = ata_irq_ack, | ||
933 | 924 | ||
934 | .port_start = ata_port_start, | 925 | .port_start = ata_port_start, |
935 | .port_stop = ata_port_stop, | ||
936 | .host_stop = ata_host_stop | ||
937 | }; | 926 | }; |
938 | 927 | ||
939 | /** | 928 | /** |