diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-27 21:09:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-29 05:13:15 -0400 |
commit | 738f2b7b813913e651f39387d007dd961755dee2 (patch) | |
tree | 022ca4d144cba51495e6f26a8f55d3046d16c2e3 /drivers/scsi/qlogicpti.c | |
parent | 944c67dff7a88f0a775e5b604937f9e30d2de555 (diff) |
sparc: Convert all SBUS drivers to dma_*() interfaces.
And all the SBUS dma interfaces are deleted.
A private implementation remains inside of the 32-bit sparc port which
exists only for the sake of the implementation of dma_*().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/qlogicpti.c')
-rw-r--r-- | drivers/scsi/qlogicpti.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index f010506af884..1559d455b2b7 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/dma-mapping.h> | ||
28 | 29 | ||
29 | #include <asm/byteorder.h> | 30 | #include <asm/byteorder.h> |
30 | 31 | ||
@@ -788,22 +789,22 @@ static int __devinit qpti_map_queues(struct qlogicpti *qpti) | |||
788 | struct sbus_dev *sdev = qpti->sdev; | 789 | struct sbus_dev *sdev = qpti->sdev; |
789 | 790 | ||
790 | #define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) | 791 | #define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) |
791 | qpti->res_cpu = sbus_alloc_consistent(&sdev->ofdev.dev, | 792 | qpti->res_cpu = dma_alloc_coherent(&sdev->ofdev.dev, |
792 | QSIZE(RES_QUEUE_LEN), | 793 | QSIZE(RES_QUEUE_LEN), |
793 | &qpti->res_dvma); | 794 | &qpti->res_dvma, GFP_ATOMIC); |
794 | if (qpti->res_cpu == NULL || | 795 | if (qpti->res_cpu == NULL || |
795 | qpti->res_dvma == 0) { | 796 | qpti->res_dvma == 0) { |
796 | printk("QPTI: Cannot map response queue.\n"); | 797 | printk("QPTI: Cannot map response queue.\n"); |
797 | return -1; | 798 | return -1; |
798 | } | 799 | } |
799 | 800 | ||
800 | qpti->req_cpu = sbus_alloc_consistent(&sdev->ofdev.dev, | 801 | qpti->req_cpu = dma_alloc_coherent(&sdev->ofdev.dev, |
801 | QSIZE(QLOGICPTI_REQ_QUEUE_LEN), | 802 | QSIZE(QLOGICPTI_REQ_QUEUE_LEN), |
802 | &qpti->req_dvma); | 803 | &qpti->req_dvma, GFP_ATOMIC); |
803 | if (qpti->req_cpu == NULL || | 804 | if (qpti->req_cpu == NULL || |
804 | qpti->req_dvma == 0) { | 805 | qpti->req_dvma == 0) { |
805 | sbus_free_consistent(&sdev->ofdev.dev, QSIZE(RES_QUEUE_LEN), | 806 | dma_free_coherent(&sdev->ofdev.dev, QSIZE(RES_QUEUE_LEN), |
806 | qpti->res_cpu, qpti->res_dvma); | 807 | qpti->res_cpu, qpti->res_dvma); |
807 | printk("QPTI: Cannot map request queue.\n"); | 808 | printk("QPTI: Cannot map request queue.\n"); |
808 | return -1; | 809 | return -1; |
809 | } | 810 | } |
@@ -875,9 +876,9 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, | |||
875 | int sg_count; | 876 | int sg_count; |
876 | 877 | ||
877 | sg = scsi_sglist(Cmnd); | 878 | sg = scsi_sglist(Cmnd); |
878 | sg_count = sbus_map_sg(&qpti->sdev->ofdev.dev, sg, | 879 | sg_count = dma_map_sg(&qpti->sdev->ofdev.dev, sg, |
879 | scsi_sg_count(Cmnd), | 880 | scsi_sg_count(Cmnd), |
880 | Cmnd->sc_data_direction); | 881 | Cmnd->sc_data_direction); |
881 | 882 | ||
882 | ds = cmd->dataseg; | 883 | ds = cmd->dataseg; |
883 | cmd->segment_cnt = sg_count; | 884 | cmd->segment_cnt = sg_count; |
@@ -1152,9 +1153,9 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti) | |||
1152 | Cmnd->result = DID_ERROR << 16; | 1153 | Cmnd->result = DID_ERROR << 16; |
1153 | 1154 | ||
1154 | if (scsi_bufflen(Cmnd)) | 1155 | if (scsi_bufflen(Cmnd)) |
1155 | sbus_unmap_sg(&qpti->sdev->ofdev.dev, | 1156 | dma_unmap_sg(&qpti->sdev->ofdev.dev, |
1156 | scsi_sglist(Cmnd), scsi_sg_count(Cmnd), | 1157 | scsi_sglist(Cmnd), scsi_sg_count(Cmnd), |
1157 | Cmnd->sc_data_direction); | 1158 | Cmnd->sc_data_direction); |
1158 | 1159 | ||
1159 | qpti->cmd_count[Cmnd->device->id]--; | 1160 | qpti->cmd_count[Cmnd->device->id]--; |
1160 | sbus_writew(out_ptr, qpti->qregs + MBOX5); | 1161 | sbus_writew(out_ptr, qpti->qregs + MBOX5); |
@@ -1357,12 +1358,12 @@ static int __devinit qpti_sbus_probe(struct of_device *dev, const struct of_devi | |||
1357 | 1358 | ||
1358 | fail_unmap_queues: | 1359 | fail_unmap_queues: |
1359 | #define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) | 1360 | #define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) |
1360 | sbus_free_consistent(&qpti->sdev->ofdev.dev, | 1361 | dma_free_coherent(&qpti->sdev->ofdev.dev, |
1361 | QSIZE(RES_QUEUE_LEN), | 1362 | QSIZE(RES_QUEUE_LEN), |
1362 | qpti->res_cpu, qpti->res_dvma); | 1363 | qpti->res_cpu, qpti->res_dvma); |
1363 | sbus_free_consistent(&qpti->sdev->ofdev.dev, | 1364 | dma_free_coherent(&qpti->sdev->ofdev.dev, |
1364 | QSIZE(QLOGICPTI_REQ_QUEUE_LEN), | 1365 | QSIZE(QLOGICPTI_REQ_QUEUE_LEN), |
1365 | qpti->req_cpu, qpti->req_dvma); | 1366 | qpti->req_cpu, qpti->req_dvma); |
1366 | #undef QSIZE | 1367 | #undef QSIZE |
1367 | 1368 | ||
1368 | fail_unmap_regs: | 1369 | fail_unmap_regs: |
@@ -1395,12 +1396,12 @@ static int __devexit qpti_sbus_remove(struct of_device *dev) | |||
1395 | free_irq(qpti->irq, qpti); | 1396 | free_irq(qpti->irq, qpti); |
1396 | 1397 | ||
1397 | #define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) | 1398 | #define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) |
1398 | sbus_free_consistent(&qpti->sdev->ofdev.dev, | 1399 | dma_free_coherent(&qpti->sdev->ofdev.dev, |
1399 | QSIZE(RES_QUEUE_LEN), | 1400 | QSIZE(RES_QUEUE_LEN), |
1400 | qpti->res_cpu, qpti->res_dvma); | 1401 | qpti->res_cpu, qpti->res_dvma); |
1401 | sbus_free_consistent(&qpti->sdev->ofdev.dev, | 1402 | dma_free_coherent(&qpti->sdev->ofdev.dev, |
1402 | QSIZE(QLOGICPTI_REQ_QUEUE_LEN), | 1403 | QSIZE(QLOGICPTI_REQ_QUEUE_LEN), |
1403 | qpti->req_cpu, qpti->req_dvma); | 1404 | qpti->req_cpu, qpti->req_dvma); |
1404 | #undef QSIZE | 1405 | #undef QSIZE |
1405 | 1406 | ||
1406 | sbus_iounmap(qpti->qregs, qpti->sdev->reg_addrs[0].reg_size); | 1407 | sbus_iounmap(qpti->qregs, qpti->sdev->reg_addrs[0].reg_size); |