diff options
Diffstat (limited to 'drivers/ata/sata_sx4.c')
-rw-r--r-- | drivers/ata/sata_sx4.c | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c index e3d56bc6726d..ec04b8d3c791 100644 --- a/drivers/ata/sata_sx4.c +++ b/drivers/ata/sata_sx4.c | |||
@@ -232,40 +232,30 @@ static void pdc20621_get_from_dimm(struct ata_host *host, | |||
232 | static void pdc20621_put_to_dimm(struct ata_host *host, | 232 | static void pdc20621_put_to_dimm(struct ata_host *host, |
233 | void *psource, u32 offset, u32 size); | 233 | void *psource, u32 offset, u32 size); |
234 | static void pdc20621_irq_clear(struct ata_port *ap); | 234 | static void pdc20621_irq_clear(struct ata_port *ap); |
235 | static unsigned int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc); | 235 | static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc); |
236 | 236 | ||
237 | 237 | ||
238 | static struct scsi_host_template pdc_sata_sht = { | 238 | static struct scsi_host_template pdc_sata_sht = { |
239 | .module = THIS_MODULE, | 239 | ATA_BASE_SHT(DRV_NAME), |
240 | .name = DRV_NAME, | ||
241 | .ioctl = ata_scsi_ioctl, | ||
242 | .queuecommand = ata_scsi_queuecmd, | ||
243 | .can_queue = ATA_DEF_QUEUE, | ||
244 | .this_id = ATA_SHT_THIS_ID, | ||
245 | .sg_tablesize = LIBATA_MAX_PRD, | 240 | .sg_tablesize = LIBATA_MAX_PRD, |
246 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | ||
247 | .emulated = ATA_SHT_EMULATED, | ||
248 | .use_clustering = ATA_SHT_USE_CLUSTERING, | ||
249 | .proc_name = DRV_NAME, | ||
250 | .dma_boundary = ATA_DMA_BOUNDARY, | 241 | .dma_boundary = ATA_DMA_BOUNDARY, |
251 | .slave_configure = ata_scsi_slave_config, | ||
252 | .slave_destroy = ata_scsi_slave_destroy, | ||
253 | .bios_param = ata_std_bios_param, | ||
254 | }; | 242 | }; |
255 | 243 | ||
256 | static const struct ata_port_operations pdc_20621_ops = { | 244 | /* TODO: inherit from base port_ops after converting to new EH */ |
257 | .tf_load = pdc_tf_load_mmio, | 245 | static struct ata_port_operations pdc_20621_ops = { |
258 | .tf_read = ata_tf_read, | 246 | .sff_tf_load = pdc_tf_load_mmio, |
259 | .check_status = ata_check_status, | 247 | .sff_tf_read = ata_sff_tf_read, |
260 | .exec_command = pdc_exec_command_mmio, | 248 | .sff_check_status = ata_sff_check_status, |
261 | .dev_select = ata_std_dev_select, | 249 | .sff_exec_command = pdc_exec_command_mmio, |
250 | .sff_dev_select = ata_sff_dev_select, | ||
262 | .phy_reset = pdc_20621_phy_reset, | 251 | .phy_reset = pdc_20621_phy_reset, |
263 | .qc_prep = pdc20621_qc_prep, | 252 | .qc_prep = pdc20621_qc_prep, |
264 | .qc_issue = pdc20621_qc_issue_prot, | 253 | .qc_issue = pdc20621_qc_issue, |
265 | .data_xfer = ata_data_xfer, | 254 | .qc_fill_rtf = ata_sff_qc_fill_rtf, |
255 | .sff_data_xfer = ata_sff_data_xfer, | ||
266 | .eng_timeout = pdc_eng_timeout, | 256 | .eng_timeout = pdc_eng_timeout, |
267 | .irq_clear = pdc20621_irq_clear, | 257 | .sff_irq_clear = pdc20621_irq_clear, |
268 | .irq_on = ata_irq_on, | 258 | .sff_irq_on = ata_sff_irq_on, |
269 | .port_start = pdc_port_start, | 259 | .port_start = pdc_port_start, |
270 | }; | 260 | }; |
271 | 261 | ||
@@ -475,7 +465,7 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
475 | void __iomem *dimm_mmio = ap->host->iomap[PDC_DIMM_BAR]; | 465 | void __iomem *dimm_mmio = ap->host->iomap[PDC_DIMM_BAR]; |
476 | unsigned int portno = ap->port_no; | 466 | unsigned int portno = ap->port_no; |
477 | unsigned int i, si, idx, total_len = 0, sgt_len; | 467 | unsigned int i, si, idx, total_len = 0, sgt_len; |
478 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; | 468 | __le32 *buf = (__le32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; |
479 | 469 | ||
480 | WARN_ON(!(qc->flags & ATA_QCFLAG_DMAMAP)); | 470 | WARN_ON(!(qc->flags & ATA_QCFLAG_DMAMAP)); |
481 | 471 | ||
@@ -693,7 +683,7 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc) | |||
693 | } | 683 | } |
694 | } | 684 | } |
695 | 685 | ||
696 | static unsigned int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc) | 686 | static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc) |
697 | { | 687 | { |
698 | switch (qc->tf.protocol) { | 688 | switch (qc->tf.protocol) { |
699 | case ATA_PROT_DMA: | 689 | case ATA_PROT_DMA: |
@@ -709,7 +699,7 @@ static unsigned int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc) | |||
709 | break; | 699 | break; |
710 | } | 700 | } |
711 | 701 | ||
712 | return ata_qc_issue_prot(qc); | 702 | return ata_sff_qc_issue(qc); |
713 | } | 703 | } |
714 | 704 | ||
715 | static inline unsigned int pdc20621_host_intr(struct ata_port *ap, | 705 | static inline unsigned int pdc20621_host_intr(struct ata_port *ap, |
@@ -781,7 +771,7 @@ static inline unsigned int pdc20621_host_intr(struct ata_port *ap, | |||
781 | /* command completion, but no data xfer */ | 771 | /* command completion, but no data xfer */ |
782 | } else if (qc->tf.protocol == ATA_PROT_NODATA) { | 772 | } else if (qc->tf.protocol == ATA_PROT_NODATA) { |
783 | 773 | ||
784 | status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 774 | status = ata_sff_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
785 | DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status); | 775 | DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status); |
786 | qc->err_mask |= ac_err_mask(status); | 776 | qc->err_mask |= ac_err_mask(status); |
787 | ata_qc_complete(qc); | 777 | ata_qc_complete(qc); |
@@ -890,7 +880,7 @@ static void pdc_eng_timeout(struct ata_port *ap) | |||
890 | break; | 880 | break; |
891 | 881 | ||
892 | default: | 882 | default: |
893 | drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 883 | drv_stat = ata_sff_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
894 | 884 | ||
895 | ata_port_printk(ap, KERN_ERR, | 885 | ata_port_printk(ap, KERN_ERR, |
896 | "unknown timeout, cmd 0x%x stat 0x%x\n", | 886 | "unknown timeout, cmd 0x%x stat 0x%x\n", |
@@ -909,7 +899,7 @@ static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf) | |||
909 | { | 899 | { |
910 | WARN_ON(tf->protocol == ATA_PROT_DMA || | 900 | WARN_ON(tf->protocol == ATA_PROT_DMA || |
911 | tf->protocol == ATA_PROT_NODATA); | 901 | tf->protocol == ATA_PROT_NODATA); |
912 | ata_tf_load(ap, tf); | 902 | ata_sff_tf_load(ap, tf); |
913 | } | 903 | } |
914 | 904 | ||
915 | 905 | ||
@@ -917,7 +907,7 @@ static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile | |||
917 | { | 907 | { |
918 | WARN_ON(tf->protocol == ATA_PROT_DMA || | 908 | WARN_ON(tf->protocol == ATA_PROT_DMA || |
919 | tf->protocol == ATA_PROT_NODATA); | 909 | tf->protocol == ATA_PROT_NODATA); |
920 | ata_exec_command(ap, tf); | 910 | ata_sff_exec_command(ap, tf); |
921 | } | 911 | } |
922 | 912 | ||
923 | 913 | ||