.. | .. |
---|
287 | 287 | } /* End twl_post_command_packet() */ |
---|
288 | 288 | |
---|
289 | 289 | /* This function hands scsi cdb's to the firmware */ |
---|
290 | | -static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry_ISO *sglistarg) |
---|
| 290 | +static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, |
---|
| 291 | + unsigned char *cdb, int use_sg, |
---|
| 292 | + TW_SG_Entry_ISO *sglistarg) |
---|
291 | 293 | { |
---|
292 | 294 | TW_Command_Full *full_command_packet; |
---|
293 | 295 | TW_Command_Apache *command_packet; |
---|
.. | .. |
---|
372 | 374 | /* This function will read the aen queue from the isr */ |
---|
373 | 375 | static int twl_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) |
---|
374 | 376 | { |
---|
375 | | - char cdb[TW_MAX_CDB_LEN]; |
---|
| 377 | + unsigned char cdb[TW_MAX_CDB_LEN]; |
---|
376 | 378 | TW_SG_Entry_ISO sglist[1]; |
---|
377 | 379 | TW_Command_Full *full_command_packet; |
---|
378 | 380 | int retval = 1; |
---|
.. | .. |
---|
554 | 556 | static int twl_aen_drain_queue(TW_Device_Extension *tw_dev, int no_check_reset) |
---|
555 | 557 | { |
---|
556 | 558 | int request_id = 0; |
---|
557 | | - char cdb[TW_MAX_CDB_LEN]; |
---|
| 559 | + unsigned char cdb[TW_MAX_CDB_LEN]; |
---|
558 | 560 | TW_SG_Entry_ISO sglist[1]; |
---|
559 | 561 | int finished = 0, count = 0; |
---|
560 | 562 | TW_Command_Full *full_command_packet; |
---|
.. | .. |
---|
644 | 646 | unsigned long *cpu_addr; |
---|
645 | 647 | int retval = 1; |
---|
646 | 648 | |
---|
647 | | - cpu_addr = pci_zalloc_consistent(tw_dev->tw_pci_dev, size * TW_Q_LENGTH, |
---|
648 | | - &dma_handle); |
---|
| 649 | + cpu_addr = dma_alloc_coherent(&tw_dev->tw_pci_dev->dev, |
---|
| 650 | + size * TW_Q_LENGTH, &dma_handle, |
---|
| 651 | + GFP_KERNEL); |
---|
649 | 652 | if (!cpu_addr) { |
---|
650 | 653 | TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed"); |
---|
651 | 654 | goto out; |
---|
.. | .. |
---|
899 | 902 | static void twl_free_device_extension(TW_Device_Extension *tw_dev) |
---|
900 | 903 | { |
---|
901 | 904 | if (tw_dev->command_packet_virt[0]) |
---|
902 | | - pci_free_consistent(tw_dev->tw_pci_dev, |
---|
| 905 | + dma_free_coherent(&tw_dev->tw_pci_dev->dev, |
---|
903 | 906 | sizeof(TW_Command_Full)*TW_Q_LENGTH, |
---|
904 | 907 | tw_dev->command_packet_virt[0], |
---|
905 | 908 | tw_dev->command_packet_phys[0]); |
---|
906 | 909 | |
---|
907 | 910 | if (tw_dev->generic_buffer_virt[0]) |
---|
908 | | - pci_free_consistent(tw_dev->tw_pci_dev, |
---|
| 911 | + dma_free_coherent(&tw_dev->tw_pci_dev->dev, |
---|
909 | 912 | TW_SECTOR_SIZE*TW_Q_LENGTH, |
---|
910 | 913 | tw_dev->generic_buffer_virt[0], |
---|
911 | 914 | tw_dev->generic_buffer_phys[0]); |
---|
912 | 915 | |
---|
913 | 916 | if (tw_dev->sense_buffer_virt[0]) |
---|
914 | | - pci_free_consistent(tw_dev->tw_pci_dev, |
---|
| 917 | + dma_free_coherent(&tw_dev->tw_pci_dev->dev, |
---|
915 | 918 | sizeof(TW_Command_Apache_Header)* |
---|
916 | 919 | TW_Q_LENGTH, |
---|
917 | 920 | tw_dev->sense_buffer_virt[0], |
---|
.. | .. |
---|
1548 | 1551 | .sg_tablesize = TW_LIBERATOR_MAX_SGL_LENGTH, |
---|
1549 | 1552 | .max_sectors = TW_MAX_SECTORS, |
---|
1550 | 1553 | .cmd_per_lun = TW_MAX_CMDS_PER_LUN, |
---|
1551 | | - .use_clustering = ENABLE_CLUSTERING, |
---|
1552 | 1554 | .shost_attrs = twl_host_attrs, |
---|
1553 | 1555 | .emulated = 1, |
---|
1554 | 1556 | .no_write_same = 1, |
---|
.. | .. |
---|
1571 | 1573 | pci_set_master(pdev); |
---|
1572 | 1574 | pci_try_set_mwi(pdev); |
---|
1573 | 1575 | |
---|
1574 | | - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) |
---|
1575 | | - || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) |
---|
1576 | | - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) |
---|
1577 | | - || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) { |
---|
1578 | | - TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask"); |
---|
1579 | | - retval = -ENODEV; |
---|
1580 | | - goto out_disable_device; |
---|
1581 | | - } |
---|
| 1576 | + retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); |
---|
| 1577 | + if (retval) |
---|
| 1578 | + retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
---|
| 1579 | + if (retval) { |
---|
| 1580 | + TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask"); |
---|
| 1581 | + retval = -ENODEV; |
---|
| 1582 | + goto out_disable_device; |
---|
| 1583 | + } |
---|
1582 | 1584 | |
---|
1583 | 1585 | host = scsi_host_alloc(&driver_template, sizeof(TW_Device_Extension)); |
---|
1584 | 1586 | if (!host) { |
---|
.. | .. |
---|
1805 | 1807 | pci_set_master(pdev); |
---|
1806 | 1808 | pci_try_set_mwi(pdev); |
---|
1807 | 1809 | |
---|
1808 | | - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) |
---|
1809 | | - || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) |
---|
1810 | | - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) |
---|
1811 | | - || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) { |
---|
1812 | | - TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume"); |
---|
1813 | | - retval = -ENODEV; |
---|
1814 | | - goto out_disable_device; |
---|
1815 | | - } |
---|
| 1810 | + retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); |
---|
| 1811 | + if (retval) |
---|
| 1812 | + retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
---|
| 1813 | + if (retval) { |
---|
| 1814 | + TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume"); |
---|
| 1815 | + retval = -ENODEV; |
---|
| 1816 | + goto out_disable_device; |
---|
| 1817 | + } |
---|
1816 | 1818 | |
---|
1817 | 1819 | /* Initialize the card */ |
---|
1818 | 1820 | if (twl_reset_sequence(tw_dev, 0)) { |
---|