diff options
Diffstat (limited to 'drivers/ata/pata_qdi.c')
-rw-r--r-- | drivers/ata/pata_qdi.c | 77 |
1 files changed, 12 insertions, 65 deletions
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c index 9f308ed76cc8..bf45cf017753 100644 --- a/drivers/ata/pata_qdi.c +++ b/drivers/ata/pata_qdi.c | |||
@@ -102,14 +102,14 @@ static void qdi6580_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | /** | 104 | /** |
105 | * qdi_qc_issue_prot - command issue | 105 | * qdi_qc_issue - command issue |
106 | * @qc: command pending | 106 | * @qc: command pending |
107 | * | 107 | * |
108 | * Called when the libata layer is about to issue a command. We wrap | 108 | * Called when the libata layer is about to issue a command. We wrap |
109 | * this interface so that we can load the correct ATA timings. | 109 | * this interface so that we can load the correct ATA timings. |
110 | */ | 110 | */ |
111 | 111 | ||
112 | static unsigned int qdi_qc_issue_prot(struct ata_queued_cmd *qc) | 112 | static unsigned int qdi_qc_issue(struct ata_queued_cmd *qc) |
113 | { | 113 | { |
114 | struct ata_port *ap = qc->ap; | 114 | struct ata_port *ap = qc->ap; |
115 | struct ata_device *adev = qc->dev; | 115 | struct ata_device *adev = qc->dev; |
@@ -121,7 +121,7 @@ static unsigned int qdi_qc_issue_prot(struct ata_queued_cmd *qc) | |||
121 | outb(qdi->clock[adev->devno], qdi->timing); | 121 | outb(qdi->clock[adev->devno], qdi->timing); |
122 | } | 122 | } |
123 | } | 123 | } |
124 | return ata_qc_issue_prot(qc); | 124 | return ata_sff_qc_issue(qc); |
125 | } | 125 | } |
126 | 126 | ||
127 | static unsigned int qdi_data_xfer(struct ata_device *dev, unsigned char *buf, | 127 | static unsigned int qdi_data_xfer(struct ata_device *dev, unsigned char *buf, |
@@ -148,79 +148,26 @@ static unsigned int qdi_data_xfer(struct ata_device *dev, unsigned char *buf, | |||
148 | buflen += 4 - slop; | 148 | buflen += 4 - slop; |
149 | } | 149 | } |
150 | } else | 150 | } else |
151 | buflen = ata_data_xfer(dev, buf, buflen, rw); | 151 | buflen = ata_sff_data_xfer(dev, buf, buflen, rw); |
152 | 152 | ||
153 | return buflen; | 153 | return buflen; |
154 | } | 154 | } |
155 | 155 | ||
156 | static struct scsi_host_template qdi_sht = { | 156 | static struct scsi_host_template qdi_sht = { |
157 | .module = THIS_MODULE, | 157 | ATA_PIO_SHT(DRV_NAME), |
158 | .name = DRV_NAME, | ||
159 | .ioctl = ata_scsi_ioctl, | ||
160 | .queuecommand = ata_scsi_queuecmd, | ||
161 | .can_queue = ATA_DEF_QUEUE, | ||
162 | .this_id = ATA_SHT_THIS_ID, | ||
163 | .sg_tablesize = LIBATA_MAX_PRD, | ||
164 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | ||
165 | .emulated = ATA_SHT_EMULATED, | ||
166 | .use_clustering = ATA_SHT_USE_CLUSTERING, | ||
167 | .proc_name = DRV_NAME, | ||
168 | .dma_boundary = ATA_DMA_BOUNDARY, | ||
169 | .slave_configure = ata_scsi_slave_config, | ||
170 | .slave_destroy = ata_scsi_slave_destroy, | ||
171 | .bios_param = ata_std_bios_param, | ||
172 | }; | 158 | }; |
173 | 159 | ||
174 | static struct ata_port_operations qdi6500_port_ops = { | 160 | static struct ata_port_operations qdi6500_port_ops = { |
175 | .set_piomode = qdi6500_set_piomode, | 161 | .inherits = &ata_sff_port_ops, |
176 | 162 | .qc_issue = qdi_qc_issue, | |
177 | .tf_load = ata_tf_load, | 163 | .sff_data_xfer = qdi_data_xfer, |
178 | .tf_read = ata_tf_read, | ||
179 | .check_status = ata_check_status, | ||
180 | .exec_command = ata_exec_command, | ||
181 | .dev_select = ata_std_dev_select, | ||
182 | |||
183 | .freeze = ata_bmdma_freeze, | ||
184 | .thaw = ata_bmdma_thaw, | ||
185 | .error_handler = ata_bmdma_error_handler, | ||
186 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | ||
187 | .cable_detect = ata_cable_40wire, | 164 | .cable_detect = ata_cable_40wire, |
188 | 165 | .set_piomode = qdi6500_set_piomode, | |
189 | .qc_prep = ata_qc_prep, | ||
190 | .qc_issue = qdi_qc_issue_prot, | ||
191 | |||
192 | .data_xfer = qdi_data_xfer, | ||
193 | |||
194 | .irq_clear = ata_bmdma_irq_clear, | ||
195 | .irq_on = ata_irq_on, | ||
196 | |||
197 | .port_start = ata_sff_port_start, | ||
198 | }; | 166 | }; |
199 | 167 | ||
200 | static struct ata_port_operations qdi6580_port_ops = { | 168 | static struct ata_port_operations qdi6580_port_ops = { |
169 | .inherits = &qdi6500_port_ops, | ||
201 | .set_piomode = qdi6580_set_piomode, | 170 | .set_piomode = qdi6580_set_piomode, |
202 | |||
203 | .tf_load = ata_tf_load, | ||
204 | .tf_read = ata_tf_read, | ||
205 | .check_status = ata_check_status, | ||
206 | .exec_command = ata_exec_command, | ||
207 | .dev_select = ata_std_dev_select, | ||
208 | |||
209 | .freeze = ata_bmdma_freeze, | ||
210 | .thaw = ata_bmdma_thaw, | ||
211 | .error_handler = ata_bmdma_error_handler, | ||
212 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | ||
213 | .cable_detect = ata_cable_40wire, | ||
214 | |||
215 | .qc_prep = ata_qc_prep, | ||
216 | .qc_issue = qdi_qc_issue_prot, | ||
217 | |||
218 | .data_xfer = qdi_data_xfer, | ||
219 | |||
220 | .irq_clear = ata_bmdma_irq_clear, | ||
221 | .irq_on = ata_irq_on, | ||
222 | |||
223 | .port_start = ata_sff_port_start, | ||
224 | }; | 171 | }; |
225 | 172 | ||
226 | /** | 173 | /** |
@@ -276,7 +223,7 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i | |||
276 | ap->ioaddr.cmd_addr = io_addr; | 223 | ap->ioaddr.cmd_addr = io_addr; |
277 | ap->ioaddr.altstatus_addr = ctl_addr; | 224 | ap->ioaddr.altstatus_addr = ctl_addr; |
278 | ap->ioaddr.ctl_addr = ctl_addr; | 225 | ap->ioaddr.ctl_addr = ctl_addr; |
279 | ata_std_ports(&ap->ioaddr); | 226 | ata_sff_std_ports(&ap->ioaddr); |
280 | 227 | ||
281 | ata_port_desc(ap, "cmd %lx ctl %lx", io, ctl); | 228 | ata_port_desc(ap, "cmd %lx ctl %lx", io, ctl); |
282 | 229 | ||
@@ -292,7 +239,7 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i | |||
292 | printk(KERN_INFO DRV_NAME": qd%d at 0x%lx.\n", type, io); | 239 | printk(KERN_INFO DRV_NAME": qd%d at 0x%lx.\n", type, io); |
293 | 240 | ||
294 | /* activate */ | 241 | /* activate */ |
295 | ret = ata_host_activate(host, irq, ata_interrupt, 0, &qdi_sht); | 242 | ret = ata_host_activate(host, irq, ata_sff_interrupt, 0, &qdi_sht); |
296 | if (ret) | 243 | if (ret) |
297 | goto fail; | 244 | goto fail; |
298 | 245 | ||