aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 09:47:16 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:21 -0400
commit9363c3825ea9ad76561eb48a395349dd29211ed6 (patch)
treeabe89a0f7c82b805d84b1a211c97b317f6628d5f /drivers/ata/libata-sff.c
parentb67a1064cb1c1d3b43e01e8b43a6a8dcdefed733 (diff)
libata: rename SFF functions
SFF functions have confusing names. Some have sff prefix, some have bmdma, some std, some pci and some none. Unify the naming by... * SFF functions which are common to both BMDMA and non-BMDMA are prefixed with ata_sff_. * SFF functions which are specific to BMDMA are prefixed with ata_bmdma_. * SFF functions which are specific to PCI but apply to both BMDMA and non-BMDMA are prefixed with ata_pci_sff_. * SFF functions which are specific to PCI and BMDMA are prefixed with ata_pci_bmdma_. * Drop generic prefixes from LLD specific routines. For example, bfin_std_dev_select -> bfin_dev_select. The following renames are noteworthy. ata_qc_issue_prot() -> ata_sff_qc_issue() ata_pci_default_filter() -> ata_bmdma_mode_filter() ata_dev_try_classify() -> ata_sff_dev_classify() This rename is in preparation of separating SFF support out of libata core layer. This patch strictly renames functions and doesn't introduce any behavior difference. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c344
1 files changed, 172 insertions, 172 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 5208ca21f634..8544321293d4 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -42,22 +42,22 @@
42const struct ata_port_operations ata_sff_port_ops = { 42const struct ata_port_operations ata_sff_port_ops = {
43 .inherits = &ata_base_port_ops, 43 .inherits = &ata_base_port_ops,
44 44
45 .qc_prep = ata_qc_prep, 45 .qc_prep = ata_sff_qc_prep,
46 .qc_issue = ata_qc_issue_prot, 46 .qc_issue = ata_sff_qc_issue,
47 47
48 .freeze = ata_bmdma_freeze, 48 .freeze = ata_sff_freeze,
49 .thaw = ata_bmdma_thaw, 49 .thaw = ata_sff_thaw,
50 .softreset = ata_std_softreset, 50 .softreset = ata_sff_softreset,
51 .error_handler = ata_bmdma_error_handler, 51 .error_handler = ata_sff_error_handler,
52 .post_internal_cmd = ata_bmdma_post_internal_cmd, 52 .post_internal_cmd = ata_sff_post_internal_cmd,
53 53
54 .dev_select = ata_std_dev_select, 54 .dev_select = ata_sff_dev_select,
55 .check_status = ata_check_status, 55 .check_status = ata_sff_check_status,
56 .tf_load = ata_tf_load, 56 .tf_load = ata_sff_tf_load,
57 .tf_read = ata_tf_read, 57 .tf_read = ata_sff_tf_read,
58 .exec_command = ata_exec_command, 58 .exec_command = ata_sff_exec_command,
59 .data_xfer = ata_data_xfer, 59 .data_xfer = ata_sff_data_xfer,
60 .irq_on = ata_irq_on, 60 .irq_on = ata_sff_irq_on,
61 61
62 .port_start = ata_sff_port_start, 62 .port_start = ata_sff_port_start,
63}; 63};
@@ -65,13 +65,13 @@ const struct ata_port_operations ata_sff_port_ops = {
65const struct ata_port_operations ata_bmdma_port_ops = { 65const struct ata_port_operations ata_bmdma_port_ops = {
66 .inherits = &ata_sff_port_ops, 66 .inherits = &ata_sff_port_ops,
67 67
68 .mode_filter = ata_pci_default_filter, 68 .mode_filter = ata_bmdma_mode_filter,
69 69
70 .bmdma_setup = ata_bmdma_setup, 70 .bmdma_setup = ata_bmdma_setup,
71 .bmdma_start = ata_bmdma_start, 71 .bmdma_start = ata_bmdma_start,
72 .bmdma_stop = ata_bmdma_stop, 72 .bmdma_stop = ata_bmdma_stop,
73 .bmdma_status = ata_bmdma_status, 73 .bmdma_status = ata_bmdma_status,
74 .irq_clear = ata_bmdma_irq_clear, 74 .irq_clear = ata_sff_irq_clear,
75}; 75};
76 76
77/** 77/**
@@ -181,7 +181,7 @@ static void ata_fill_sg_dumb(struct ata_queued_cmd *qc)
181} 181}
182 182
183/** 183/**
184 * ata_qc_prep - Prepare taskfile for submission 184 * ata_sff_qc_prep - Prepare taskfile for submission
185 * @qc: Metadata associated with taskfile to be prepared 185 * @qc: Metadata associated with taskfile to be prepared
186 * 186 *
187 * Prepare ATA taskfile for submission. 187 * Prepare ATA taskfile for submission.
@@ -189,7 +189,7 @@ static void ata_fill_sg_dumb(struct ata_queued_cmd *qc)
189 * LOCKING: 189 * LOCKING:
190 * spin_lock_irqsave(host lock) 190 * spin_lock_irqsave(host lock)
191 */ 191 */
192void ata_qc_prep(struct ata_queued_cmd *qc) 192void ata_sff_qc_prep(struct ata_queued_cmd *qc)
193{ 193{
194 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) 194 if (!(qc->flags & ATA_QCFLAG_DMAMAP))
195 return; 195 return;
@@ -198,7 +198,7 @@ void ata_qc_prep(struct ata_queued_cmd *qc)
198} 198}
199 199
200/** 200/**
201 * ata_dumb_qc_prep - Prepare taskfile for submission 201 * ata_sff_dumb_qc_prep - Prepare taskfile for submission
202 * @qc: Metadata associated with taskfile to be prepared 202 * @qc: Metadata associated with taskfile to be prepared
203 * 203 *
204 * Prepare ATA taskfile for submission. 204 * Prepare ATA taskfile for submission.
@@ -206,7 +206,7 @@ void ata_qc_prep(struct ata_queued_cmd *qc)
206 * LOCKING: 206 * LOCKING:
207 * spin_lock_irqsave(host lock) 207 * spin_lock_irqsave(host lock)
208 */ 208 */
209void ata_dumb_qc_prep(struct ata_queued_cmd *qc) 209void ata_sff_dumb_qc_prep(struct ata_queued_cmd *qc)
210{ 210{
211 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) 211 if (!(qc->flags & ATA_QCFLAG_DMAMAP))
212 return; 212 return;
@@ -215,7 +215,7 @@ void ata_dumb_qc_prep(struct ata_queued_cmd *qc)
215} 215}
216 216
217/** 217/**
218 * ata_check_status - Read device status reg & clear interrupt 218 * ata_sff_check_status - Read device status reg & clear interrupt
219 * @ap: port where the device is 219 * @ap: port where the device is
220 * 220 *
221 * Reads ATA taskfile status register for currently-selected device 221 * Reads ATA taskfile status register for currently-selected device
@@ -225,13 +225,13 @@ void ata_dumb_qc_prep(struct ata_queued_cmd *qc)
225 * LOCKING: 225 * LOCKING:
226 * Inherited from caller. 226 * Inherited from caller.
227 */ 227 */
228u8 ata_check_status(struct ata_port *ap) 228u8 ata_sff_check_status(struct ata_port *ap)
229{ 229{
230 return ioread8(ap->ioaddr.status_addr); 230 return ioread8(ap->ioaddr.status_addr);
231} 231}
232 232
233/** 233/**
234 * ata_altstatus - Read device alternate status reg 234 * ata_sff_altstatus - Read device alternate status reg
235 * @ap: port where the device is 235 * @ap: port where the device is
236 * 236 *
237 * Reads ATA taskfile alternate status register for 237 * Reads ATA taskfile alternate status register for
@@ -243,7 +243,7 @@ u8 ata_check_status(struct ata_port *ap)
243 * LOCKING: 243 * LOCKING:
244 * Inherited from caller. 244 * Inherited from caller.
245 */ 245 */
246u8 ata_altstatus(struct ata_port *ap) 246u8 ata_sff_altstatus(struct ata_port *ap)
247{ 247{
248 if (ap->ops->check_altstatus) 248 if (ap->ops->check_altstatus)
249 return ap->ops->check_altstatus(ap); 249 return ap->ops->check_altstatus(ap);
@@ -252,7 +252,7 @@ u8 ata_altstatus(struct ata_port *ap)
252} 252}
253 253
254/** 254/**
255 * ata_busy_sleep - sleep until BSY clears, or timeout 255 * ata_sff_busy_sleep - sleep until BSY clears, or timeout
256 * @ap: port containing status register to be polled 256 * @ap: port containing status register to be polled
257 * @tmout_pat: impatience timeout 257 * @tmout_pat: impatience timeout
258 * @tmout: overall timeout 258 * @tmout: overall timeout
@@ -266,19 +266,19 @@ u8 ata_altstatus(struct ata_port *ap)
266 * RETURNS: 266 * RETURNS:
267 * 0 on success, -errno otherwise. 267 * 0 on success, -errno otherwise.
268 */ 268 */
269int ata_busy_sleep(struct ata_port *ap, 269int ata_sff_busy_sleep(struct ata_port *ap,
270 unsigned long tmout_pat, unsigned long tmout) 270 unsigned long tmout_pat, unsigned long tmout)
271{ 271{
272 unsigned long timer_start, timeout; 272 unsigned long timer_start, timeout;
273 u8 status; 273 u8 status;
274 274
275 status = ata_busy_wait(ap, ATA_BUSY, 300); 275 status = ata_sff_busy_wait(ap, ATA_BUSY, 300);
276 timer_start = jiffies; 276 timer_start = jiffies;
277 timeout = timer_start + tmout_pat; 277 timeout = timer_start + tmout_pat;
278 while (status != 0xff && (status & ATA_BUSY) && 278 while (status != 0xff && (status & ATA_BUSY) &&
279 time_before(jiffies, timeout)) { 279 time_before(jiffies, timeout)) {
280 msleep(50); 280 msleep(50);
281 status = ata_busy_wait(ap, ATA_BUSY, 3); 281 status = ata_sff_busy_wait(ap, ATA_BUSY, 3);
282 } 282 }
283 283
284 if (status != 0xff && (status & ATA_BUSY)) 284 if (status != 0xff && (status & ATA_BUSY))
@@ -307,7 +307,7 @@ int ata_busy_sleep(struct ata_port *ap,
307} 307}
308 308
309/** 309/**
310 * ata_wait_ready - sleep until BSY clears, or timeout 310 * ata_sff_wait_ready - sleep until BSY clears, or timeout
311 * @ap: port containing status register to be polled 311 * @ap: port containing status register to be polled
312 * @deadline: deadline jiffies for the operation 312 * @deadline: deadline jiffies for the operation
313 * 313 *
@@ -320,7 +320,7 @@ int ata_busy_sleep(struct ata_port *ap,
320 * RETURNS: 320 * RETURNS:
321 * 0 on success, -errno otherwise. 321 * 0 on success, -errno otherwise.
322 */ 322 */
323int ata_wait_ready(struct ata_port *ap, unsigned long deadline) 323int ata_sff_wait_ready(struct ata_port *ap, unsigned long deadline)
324{ 324{
325 unsigned long start = jiffies; 325 unsigned long start = jiffies;
326 int warned = 0; 326 int warned = 0;
@@ -349,7 +349,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline)
349} 349}
350 350
351/** 351/**
352 * ata_std_dev_select - Select device 0/1 on ATA bus 352 * ata_sff_dev_select - Select device 0/1 on ATA bus
353 * @ap: ATA channel to manipulate 353 * @ap: ATA channel to manipulate
354 * @device: ATA device (numbered from zero) to select 354 * @device: ATA device (numbered from zero) to select
355 * 355 *
@@ -362,7 +362,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline)
362 * LOCKING: 362 * LOCKING:
363 * caller. 363 * caller.
364 */ 364 */
365void ata_std_dev_select(struct ata_port *ap, unsigned int device) 365void ata_sff_dev_select(struct ata_port *ap, unsigned int device)
366{ 366{
367 u8 tmp; 367 u8 tmp;
368 368
@@ -372,7 +372,7 @@ void ata_std_dev_select(struct ata_port *ap, unsigned int device)
372 tmp = ATA_DEVICE_OBS | ATA_DEV1; 372 tmp = ATA_DEVICE_OBS | ATA_DEV1;
373 373
374 iowrite8(tmp, ap->ioaddr.device_addr); 374 iowrite8(tmp, ap->ioaddr.device_addr);
375 ata_pause(ap); /* needed; also flushes, for mmio */ 375 ata_sff_pause(ap); /* needed; also flushes, for mmio */
376} 376}
377 377
378/** 378/**
@@ -386,9 +386,9 @@ void ata_std_dev_select(struct ata_port *ap, unsigned int device)
386 * make either device 0, or device 1, active on the 386 * make either device 0, or device 1, active on the
387 * ATA channel. 387 * ATA channel.
388 * 388 *
389 * This is a high-level version of ata_std_dev_select(), 389 * This is a high-level version of ata_sff_dev_select(), which
390 * which additionally provides the services of inserting 390 * additionally provides the services of inserting the proper
391 * the proper pauses and status polling, where needed. 391 * pauses and status polling, where needed.
392 * 392 *
393 * LOCKING: 393 * LOCKING:
394 * caller. 394 * caller.
@@ -413,7 +413,7 @@ void ata_dev_select(struct ata_port *ap, unsigned int device,
413} 413}
414 414
415/** 415/**
416 * ata_irq_on - Enable interrupts on a port. 416 * ata_sff_irq_on - Enable interrupts on a port.
417 * @ap: Port on which interrupts are enabled. 417 * @ap: Port on which interrupts are enabled.
418 * 418 *
419 * Enable interrupts on a legacy IDE device using MMIO or PIO, 419 * Enable interrupts on a legacy IDE device using MMIO or PIO,
@@ -422,7 +422,7 @@ void ata_dev_select(struct ata_port *ap, unsigned int device,
422 * LOCKING: 422 * LOCKING:
423 * Inherited from caller. 423 * Inherited from caller.
424 */ 424 */
425u8 ata_irq_on(struct ata_port *ap) 425u8 ata_sff_irq_on(struct ata_port *ap)
426{ 426{
427 struct ata_ioports *ioaddr = &ap->ioaddr; 427 struct ata_ioports *ioaddr = &ap->ioaddr;
428 u8 tmp; 428 u8 tmp;
@@ -440,7 +440,7 @@ u8 ata_irq_on(struct ata_port *ap)
440} 440}
441 441
442/** 442/**
443 * ata_bmdma_irq_clear - Clear PCI IDE BMDMA interrupt. 443 * ata_sff_irq_clear - Clear PCI IDE BMDMA interrupt.
444 * @ap: Port associated with this ATA transaction. 444 * @ap: Port associated with this ATA transaction.
445 * 445 *
446 * Clear interrupt and error flags in DMA status register. 446 * Clear interrupt and error flags in DMA status register.
@@ -450,7 +450,7 @@ u8 ata_irq_on(struct ata_port *ap)
450 * LOCKING: 450 * LOCKING:
451 * spin_lock_irqsave(host lock) 451 * spin_lock_irqsave(host lock)
452 */ 452 */
453void ata_bmdma_irq_clear(struct ata_port *ap) 453void ata_sff_irq_clear(struct ata_port *ap)
454{ 454{
455 void __iomem *mmio = ap->ioaddr.bmdma_addr; 455 void __iomem *mmio = ap->ioaddr.bmdma_addr;
456 456
@@ -461,7 +461,7 @@ void ata_bmdma_irq_clear(struct ata_port *ap)
461} 461}
462 462
463/** 463/**
464 * ata_tf_load - send taskfile registers to host controller 464 * ata_sff_tf_load - send taskfile registers to host controller
465 * @ap: Port to which output is sent 465 * @ap: Port to which output is sent
466 * @tf: ATA taskfile register set 466 * @tf: ATA taskfile register set
467 * 467 *
@@ -470,7 +470,7 @@ void ata_bmdma_irq_clear(struct ata_port *ap)
470 * LOCKING: 470 * LOCKING:
471 * Inherited from caller. 471 * Inherited from caller.
472 */ 472 */
473void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) 473void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
474{ 474{
475 struct ata_ioports *ioaddr = &ap->ioaddr; 475 struct ata_ioports *ioaddr = &ap->ioaddr;
476 unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; 476 unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
@@ -520,7 +520,7 @@ void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
520} 520}
521 521
522/** 522/**
523 * ata_tf_read - input device's ATA taskfile shadow registers 523 * ata_sff_tf_read - input device's ATA taskfile shadow registers
524 * @ap: Port from which input is read 524 * @ap: Port from which input is read
525 * @tf: ATA taskfile register set for storing input 525 * @tf: ATA taskfile register set for storing input
526 * 526 *
@@ -532,11 +532,11 @@ void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
532 * LOCKING: 532 * LOCKING:
533 * Inherited from caller. 533 * Inherited from caller.
534 */ 534 */
535void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) 535void ata_sff_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
536{ 536{
537 struct ata_ioports *ioaddr = &ap->ioaddr; 537 struct ata_ioports *ioaddr = &ap->ioaddr;
538 538
539 tf->command = ata_check_status(ap); 539 tf->command = ata_sff_check_status(ap);
540 tf->feature = ioread8(ioaddr->error_addr); 540 tf->feature = ioread8(ioaddr->error_addr);
541 tf->nsect = ioread8(ioaddr->nsect_addr); 541 tf->nsect = ioread8(ioaddr->nsect_addr);
542 tf->lbal = ioread8(ioaddr->lbal_addr); 542 tf->lbal = ioread8(ioaddr->lbal_addr);
@@ -560,7 +560,7 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
560} 560}
561 561
562/** 562/**
563 * ata_exec_command - issue ATA command to host controller 563 * ata_sff_exec_command - issue ATA command to host controller
564 * @ap: port to which command is being issued 564 * @ap: port to which command is being issued
565 * @tf: ATA taskfile register set 565 * @tf: ATA taskfile register set
566 * 566 *
@@ -570,12 +570,12 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
570 * LOCKING: 570 * LOCKING:
571 * spin_lock_irqsave(host lock) 571 * spin_lock_irqsave(host lock)
572 */ 572 */
573void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) 573void ata_sff_exec_command(struct ata_port *ap, const struct ata_taskfile *tf)
574{ 574{
575 DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); 575 DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
576 576
577 iowrite8(tf->command, ap->ioaddr.command_addr); 577 iowrite8(tf->command, ap->ioaddr.command_addr);
578 ata_pause(ap); 578 ata_sff_pause(ap);
579} 579}
580 580
581/** 581/**
@@ -598,7 +598,7 @@ static inline void ata_tf_to_host(struct ata_port *ap,
598} 598}
599 599
600/** 600/**
601 * ata_data_xfer - Transfer data by PIO 601 * ata_sff_data_xfer - Transfer data by PIO
602 * @dev: device to target 602 * @dev: device to target
603 * @buf: data buffer 603 * @buf: data buffer
604 * @buflen: buffer length 604 * @buflen: buffer length
@@ -612,8 +612,8 @@ static inline void ata_tf_to_host(struct ata_port *ap,
612 * RETURNS: 612 * RETURNS:
613 * Bytes consumed. 613 * Bytes consumed.
614 */ 614 */
615unsigned int ata_data_xfer(struct ata_device *dev, unsigned char *buf, 615unsigned int ata_sff_data_xfer(struct ata_device *dev, unsigned char *buf,
616 unsigned int buflen, int rw) 616 unsigned int buflen, int rw)
617{ 617{
618 struct ata_port *ap = dev->link->ap; 618 struct ata_port *ap = dev->link->ap;
619 void __iomem *data_addr = ap->ioaddr.data_addr; 619 void __iomem *data_addr = ap->ioaddr.data_addr;
@@ -644,7 +644,7 @@ unsigned int ata_data_xfer(struct ata_device *dev, unsigned char *buf,
644} 644}
645 645
646/** 646/**
647 * ata_data_xfer_noirq - Transfer data by PIO 647 * ata_sff_data_xfer_noirq - Transfer data by PIO
648 * @dev: device to target 648 * @dev: device to target
649 * @buf: data buffer 649 * @buf: data buffer
650 * @buflen: buffer length 650 * @buflen: buffer length
@@ -659,14 +659,14 @@ unsigned int ata_data_xfer(struct ata_device *dev, unsigned char *buf,
659 * RETURNS: 659 * RETURNS:
660 * Bytes consumed. 660 * Bytes consumed.
661 */ 661 */
662unsigned int ata_data_xfer_noirq(struct ata_device *dev, unsigned char *buf, 662unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, unsigned char *buf,
663 unsigned int buflen, int rw) 663 unsigned int buflen, int rw)
664{ 664{
665 unsigned long flags; 665 unsigned long flags;
666 unsigned int consumed; 666 unsigned int consumed;
667 667
668 local_irq_save(flags); 668 local_irq_save(flags);
669 consumed = ata_data_xfer(dev, buf, buflen, rw); 669 consumed = ata_sff_data_xfer(dev, buf, buflen, rw);
670 local_irq_restore(flags); 670 local_irq_restore(flags);
671 671
672 return consumed; 672 return consumed;
@@ -752,7 +752,7 @@ static void ata_pio_sectors(struct ata_queued_cmd *qc)
752 } else 752 } else
753 ata_pio_sector(qc); 753 ata_pio_sector(qc);
754 754
755 ata_altstatus(qc->ap); /* flush */ 755 ata_sff_altstatus(qc->ap); /* flush */
756} 756}
757 757
758/** 758/**
@@ -773,7 +773,7 @@ static void atapi_send_cdb(struct ata_port *ap, struct ata_queued_cmd *qc)
773 WARN_ON(qc->dev->cdb_len < 12); 773 WARN_ON(qc->dev->cdb_len < 12);
774 774
775 ap->ops->data_xfer(qc->dev, qc->cdb, qc->dev->cdb_len, 1); 775 ap->ops->data_xfer(qc->dev, qc->cdb, qc->dev->cdb_len, 1);
776 ata_altstatus(ap); /* flush */ 776 ata_sff_altstatus(ap); /* flush */
777 777
778 switch (qc->tf.protocol) { 778 switch (qc->tf.protocol) {
779 case ATAPI_PROT_PIO: 779 case ATAPI_PROT_PIO:
@@ -915,7 +915,7 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc)
915 915
916 if (unlikely(__atapi_pio_bytes(qc, bytes))) 916 if (unlikely(__atapi_pio_bytes(qc, bytes)))
917 goto err_out; 917 goto err_out;
918 ata_altstatus(ap); /* flush */ 918 ata_sff_altstatus(ap); /* flush */
919 919
920 return; 920 return;
921 921
@@ -1004,7 +1004,7 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq)
1004} 1004}
1005 1005
1006/** 1006/**
1007 * ata_hsm_move - move the HSM to the next state. 1007 * ata_sff_hsm_move - move the HSM to the next state.
1008 * @ap: the target ata_port 1008 * @ap: the target ata_port
1009 * @qc: qc on going 1009 * @qc: qc on going
1010 * @status: current device status 1010 * @status: current device status
@@ -1013,15 +1013,15 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq)
1013 * RETURNS: 1013 * RETURNS:
1014 * 1 when poll next status needed, 0 otherwise. 1014 * 1 when poll next status needed, 0 otherwise.
1015 */ 1015 */
1016int ata_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, 1016int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
1017 u8 status, int in_wq) 1017 u8 status, int in_wq)
1018{ 1018{
1019 unsigned long flags = 0; 1019 unsigned long flags = 0;
1020 int poll_next; 1020 int poll_next;
1021 1021
1022 WARN_ON((qc->flags & ATA_QCFLAG_ACTIVE) == 0); 1022 WARN_ON((qc->flags & ATA_QCFLAG_ACTIVE) == 0);
1023 1023
1024 /* Make sure ata_qc_issue_prot() does not throw things 1024 /* Make sure ata_sff_qc_issue() does not throw things
1025 * like DMA polling into the workqueue. Notice that 1025 * like DMA polling into the workqueue. Notice that
1026 * in_wq is not equivalent to (qc->tf.flags & ATA_TFLAG_POLLING). 1026 * in_wq is not equivalent to (qc->tf.flags & ATA_TFLAG_POLLING).
1027 */ 1027 */
@@ -1263,10 +1263,10 @@ fsm_start:
1263 * or something. Snooze for a couple msecs, then 1263 * or something. Snooze for a couple msecs, then
1264 * chk-status again. If still busy, queue delayed work. 1264 * chk-status again. If still busy, queue delayed work.
1265 */ 1265 */
1266 status = ata_busy_wait(ap, ATA_BUSY, 5); 1266 status = ata_sff_busy_wait(ap, ATA_BUSY, 5);
1267 if (status & ATA_BUSY) { 1267 if (status & ATA_BUSY) {
1268 msleep(2); 1268 msleep(2);
1269 status = ata_busy_wait(ap, ATA_BUSY, 10); 1269 status = ata_sff_busy_wait(ap, ATA_BUSY, 10);
1270 if (status & ATA_BUSY) { 1270 if (status & ATA_BUSY) {
1271 ata_pio_queue_task(ap, qc, ATA_SHORT_PAUSE); 1271 ata_pio_queue_task(ap, qc, ATA_SHORT_PAUSE);
1272 return; 1272 return;
@@ -1274,7 +1274,7 @@ fsm_start:
1274 } 1274 }
1275 1275
1276 /* move the HSM */ 1276 /* move the HSM */
1277 poll_next = ata_hsm_move(ap, qc, status, 1); 1277 poll_next = ata_sff_hsm_move(ap, qc, status, 1);
1278 1278
1279 /* another command or interrupt handler 1279 /* another command or interrupt handler
1280 * may be running at this point. 1280 * may be running at this point.
@@ -1284,7 +1284,7 @@ fsm_start:
1284} 1284}
1285 1285
1286/** 1286/**
1287 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner 1287 * ata_sff_qc_issue - issue taskfile to device in proto-dependent manner
1288 * @qc: command to issue to device 1288 * @qc: command to issue to device
1289 * 1289 *
1290 * Using various libata functions and hooks, this function 1290 * Using various libata functions and hooks, this function
@@ -1300,7 +1300,7 @@ fsm_start:
1300 * RETURNS: 1300 * RETURNS:
1301 * Zero on success, AC_ERR_* mask on failure 1301 * Zero on success, AC_ERR_* mask on failure
1302 */ 1302 */
1303unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc) 1303unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc)
1304{ 1304{
1305 struct ata_port *ap = qc->ap; 1305 struct ata_port *ap = qc->ap;
1306 1306
@@ -1415,7 +1415,7 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
1415} 1415}
1416 1416
1417/** 1417/**
1418 * ata_host_intr - Handle host interrupt for given (port, task) 1418 * ata_sff_host_intr - Handle host interrupt for given (port, task)
1419 * @ap: Port on which interrupt arrived (possibly...) 1419 * @ap: Port on which interrupt arrived (possibly...)
1420 * @qc: Taskfile currently active in engine 1420 * @qc: Taskfile currently active in engine
1421 * 1421 *
@@ -1429,8 +1429,8 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
1429 * RETURNS: 1429 * RETURNS:
1430 * One if interrupt was handled, zero if not (shared irq). 1430 * One if interrupt was handled, zero if not (shared irq).
1431 */ 1431 */
1432inline unsigned int ata_host_intr(struct ata_port *ap, 1432inline unsigned int ata_sff_host_intr(struct ata_port *ap,
1433 struct ata_queued_cmd *qc) 1433 struct ata_queued_cmd *qc)
1434{ 1434{
1435 struct ata_eh_info *ehi = &ap->link.eh_info; 1435 struct ata_eh_info *ehi = &ap->link.eh_info;
1436 u8 status, host_stat = 0; 1436 u8 status, host_stat = 0;
@@ -1481,7 +1481,7 @@ inline unsigned int ata_host_intr(struct ata_port *ap,
1481 } 1481 }
1482 1482
1483 /* check altstatus */ 1483 /* check altstatus */
1484 status = ata_altstatus(ap); 1484 status = ata_sff_altstatus(ap);
1485 if (status & ATA_BUSY) 1485 if (status & ATA_BUSY)
1486 goto idle_irq; 1486 goto idle_irq;
1487 1487
@@ -1493,7 +1493,7 @@ inline unsigned int ata_host_intr(struct ata_port *ap,
1493 /* ack bmdma irq events */ 1493 /* ack bmdma irq events */
1494 ap->ops->irq_clear(ap); 1494 ap->ops->irq_clear(ap);
1495 1495
1496 ata_hsm_move(ap, qc, status, 0); 1496 ata_sff_hsm_move(ap, qc, status, 0);
1497 1497
1498 if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA || 1498 if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA ||
1499 qc->tf.protocol == ATAPI_PROT_DMA)) 1499 qc->tf.protocol == ATAPI_PROT_DMA))
@@ -1516,12 +1516,12 @@ idle_irq:
1516} 1516}
1517 1517
1518/** 1518/**
1519 * ata_interrupt - Default ATA host interrupt handler 1519 * ata_sff_interrupt - Default ATA host interrupt handler
1520 * @irq: irq line (unused) 1520 * @irq: irq line (unused)
1521 * @dev_instance: pointer to our ata_host information structure 1521 * @dev_instance: pointer to our ata_host information structure
1522 * 1522 *
1523 * Default interrupt handler for PCI IDE devices. Calls 1523 * Default interrupt handler for PCI IDE devices. Calls
1524 * ata_host_intr() for each port that is not disabled. 1524 * ata_sff_host_intr() for each port that is not disabled.
1525 * 1525 *
1526 * LOCKING: 1526 * LOCKING:
1527 * Obtains host lock during operation. 1527 * Obtains host lock during operation.
@@ -1529,7 +1529,7 @@ idle_irq:
1529 * RETURNS: 1529 * RETURNS:
1530 * IRQ_NONE or IRQ_HANDLED. 1530 * IRQ_NONE or IRQ_HANDLED.
1531 */ 1531 */
1532irqreturn_t ata_interrupt(int irq, void *dev_instance) 1532irqreturn_t ata_sff_interrupt(int irq, void *dev_instance)
1533{ 1533{
1534 struct ata_host *host = dev_instance; 1534 struct ata_host *host = dev_instance;
1535 unsigned int i; 1535 unsigned int i;
@@ -1550,7 +1550,7 @@ irqreturn_t ata_interrupt(int irq, void *dev_instance)
1550 qc = ata_qc_from_tag(ap, ap->link.active_tag); 1550 qc = ata_qc_from_tag(ap, ap->link.active_tag);
1551 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) && 1551 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) &&
1552 (qc->flags & ATA_QCFLAG_ACTIVE)) 1552 (qc->flags & ATA_QCFLAG_ACTIVE))
1553 handled |= ata_host_intr(ap, qc); 1553 handled |= ata_sff_host_intr(ap, qc);
1554 } 1554 }
1555 } 1555 }
1556 1556
@@ -1560,7 +1560,7 @@ irqreturn_t ata_interrupt(int irq, void *dev_instance)
1560} 1560}
1561 1561
1562/** 1562/**
1563 * ata_bmdma_freeze - Freeze BMDMA controller port 1563 * ata_sff_freeze - Freeze SFF controller port
1564 * @ap: port to freeze 1564 * @ap: port to freeze
1565 * 1565 *
1566 * Freeze BMDMA controller port. 1566 * Freeze BMDMA controller port.
@@ -1568,7 +1568,7 @@ irqreturn_t ata_interrupt(int irq, void *dev_instance)
1568 * LOCKING: 1568 * LOCKING:
1569 * Inherited from caller. 1569 * Inherited from caller.
1570 */ 1570 */
1571void ata_bmdma_freeze(struct ata_port *ap) 1571void ata_sff_freeze(struct ata_port *ap)
1572{ 1572{
1573 struct ata_ioports *ioaddr = &ap->ioaddr; 1573 struct ata_ioports *ioaddr = &ap->ioaddr;
1574 1574
@@ -1588,15 +1588,15 @@ void ata_bmdma_freeze(struct ata_port *ap)
1588} 1588}
1589 1589
1590/** 1590/**
1591 * ata_bmdma_thaw - Thaw BMDMA controller port 1591 * ata_sff_thaw - Thaw SFF controller port
1592 * @ap: port to thaw 1592 * @ap: port to thaw
1593 * 1593 *
1594 * Thaw BMDMA controller port. 1594 * Thaw SFF controller port.
1595 * 1595 *
1596 * LOCKING: 1596 * LOCKING:
1597 * Inherited from caller. 1597 * Inherited from caller.
1598 */ 1598 */
1599void ata_bmdma_thaw(struct ata_port *ap) 1599void ata_sff_thaw(struct ata_port *ap)
1600{ 1600{
1601 /* clear & re-enable interrupts */ 1601 /* clear & re-enable interrupts */
1602 ap->ops->check_status(ap); 1602 ap->ops->check_status(ap);
@@ -1647,7 +1647,7 @@ static unsigned int ata_devchk(struct ata_port *ap, unsigned int device)
1647} 1647}
1648 1648
1649/** 1649/**
1650 * ata_dev_try_classify - Parse returned ATA device signature 1650 * ata_sff_dev_classify - Parse returned ATA device signature
1651 * @dev: ATA device to classify (starting at zero) 1651 * @dev: ATA device to classify (starting at zero)
1652 * @present: device seems present 1652 * @present: device seems present
1653 * @r_err: Value of error register on completion 1653 * @r_err: Value of error register on completion
@@ -1667,7 +1667,7 @@ static unsigned int ata_devchk(struct ata_port *ap, unsigned int device)
1667 * RETURNS: 1667 * RETURNS:
1668 * Device type - %ATA_DEV_ATA, %ATA_DEV_ATAPI or %ATA_DEV_NONE. 1668 * Device type - %ATA_DEV_ATA, %ATA_DEV_ATAPI or %ATA_DEV_NONE.
1669 */ 1669 */
1670unsigned int ata_dev_try_classify(struct ata_device *dev, int present, 1670unsigned int ata_sff_dev_classify(struct ata_device *dev, int present,
1671 u8 *r_err) 1671 u8 *r_err)
1672{ 1672{
1673 struct ata_port *ap = dev->link->ap; 1673 struct ata_port *ap = dev->link->ap;
@@ -1727,7 +1727,7 @@ static int ata_bus_post_reset(struct ata_port *ap, unsigned int devmask,
1727 * BSY bit to clear 1727 * BSY bit to clear
1728 */ 1728 */
1729 if (dev0) { 1729 if (dev0) {
1730 rc = ata_wait_ready(ap, deadline); 1730 rc = ata_sff_wait_ready(ap, deadline);
1731 if (rc) { 1731 if (rc) {
1732 if (rc != -ENODEV) 1732 if (rc != -ENODEV)
1733 return rc; 1733 return rc;
@@ -1757,7 +1757,7 @@ static int ata_bus_post_reset(struct ata_port *ap, unsigned int devmask,
1757 msleep(50); /* give drive a breather */ 1757 msleep(50); /* give drive a breather */
1758 } 1758 }
1759 1759
1760 rc = ata_wait_ready(ap, deadline); 1760 rc = ata_sff_wait_ready(ap, deadline);
1761 if (rc) { 1761 if (rc) {
1762 if (rc != -ENODEV) 1762 if (rc != -ENODEV)
1763 return rc; 1763 return rc;
@@ -1776,7 +1776,7 @@ static int ata_bus_post_reset(struct ata_port *ap, unsigned int devmask,
1776} 1776}
1777 1777
1778/** 1778/**
1779 * ata_wait_after_reset - wait before checking status after reset 1779 * ata_sff_wait_after_reset - wait before checking status after reset
1780 * @ap: port containing status register to be polled 1780 * @ap: port containing status register to be polled
1781 * @deadline: deadline jiffies for the operation 1781 * @deadline: deadline jiffies for the operation
1782 * 1782 *
@@ -1790,7 +1790,7 @@ static int ata_bus_post_reset(struct ata_port *ap, unsigned int devmask,
1790 * LOCKING: 1790 * LOCKING:
1791 * Kernel thread context (may sleep). 1791 * Kernel thread context (may sleep).
1792 */ 1792 */
1793void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline) 1793void ata_sff_wait_after_reset(struct ata_port *ap, unsigned long deadline)
1794{ 1794{
1795 unsigned long until = jiffies + ATA_TMOUT_FF_WAIT; 1795 unsigned long until = jiffies + ATA_TMOUT_FF_WAIT;
1796 1796
@@ -1845,7 +1845,7 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
1845 iowrite8(ap->ctl, ioaddr->ctl_addr); 1845 iowrite8(ap->ctl, ioaddr->ctl_addr);
1846 1846
1847 /* wait a while before checking status */ 1847 /* wait a while before checking status */
1848 ata_wait_after_reset(ap, deadline); 1848 ata_sff_wait_after_reset(ap, deadline);
1849 1849
1850 /* Before we perform post reset processing we want to see if 1850 /* Before we perform post reset processing we want to see if
1851 * the bus shows 0xFF because the odd clown forgets the D7 1851 * the bus shows 0xFF because the odd clown forgets the D7
@@ -1858,7 +1858,7 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
1858} 1858}
1859 1859
1860/** 1860/**
1861 * ata_std_softreset - reset host port via ATA SRST 1861 * ata_sff_softreset - reset host port via ATA SRST
1862 * @link: ATA link to reset 1862 * @link: ATA link to reset
1863 * @classes: resulting classes of attached devices 1863 * @classes: resulting classes of attached devices
1864 * @deadline: deadline jiffies for the operation 1864 * @deadline: deadline jiffies for the operation
@@ -1871,7 +1871,7 @@ static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
1871 * RETURNS: 1871 * RETURNS:
1872 * 0 on success, -errno otherwise. 1872 * 0 on success, -errno otherwise.
1873 */ 1873 */
1874int ata_std_softreset(struct ata_link *link, unsigned int *classes, 1874int ata_sff_softreset(struct ata_link *link, unsigned int *classes,
1875 unsigned long deadline) 1875 unsigned long deadline)
1876{ 1876{
1877 struct ata_port *ap = link->ap; 1877 struct ata_port *ap = link->ap;
@@ -1906,10 +1906,10 @@ int ata_std_softreset(struct ata_link *link, unsigned int *classes,
1906 } 1906 }
1907 1907
1908 /* determine by signature whether we have ATA or ATAPI devices */ 1908 /* determine by signature whether we have ATA or ATAPI devices */
1909 classes[0] = ata_dev_try_classify(&link->device[0], 1909 classes[0] = ata_sff_dev_classify(&link->device[0],
1910 devmask & (1 << 0), &err); 1910 devmask & (1 << 0), &err);
1911 if (slave_possible && err != 0x81) 1911 if (slave_possible && err != 0x81)
1912 classes[1] = ata_dev_try_classify(&link->device[1], 1912 classes[1] = ata_sff_dev_classify(&link->device[1],
1913 devmask & (1 << 1), &err); 1913 devmask & (1 << 1), &err);
1914 1914
1915 out: 1915 out:
@@ -1918,7 +1918,7 @@ int ata_std_softreset(struct ata_link *link, unsigned int *classes,
1918} 1918}
1919 1919
1920/** 1920/**
1921 * sata_std_hardreset - reset host port via SATA phy reset 1921 * sata_sff_hardreset - reset host port via SATA phy reset
1922 * @link: link to reset 1922 * @link: link to reset
1923 * @class: resulting class of attached device 1923 * @class: resulting class of attached device
1924 * @deadline: deadline jiffies for the operation 1924 * @deadline: deadline jiffies for the operation
@@ -1932,7 +1932,7 @@ int ata_std_softreset(struct ata_link *link, unsigned int *classes,
1932 * RETURNS: 1932 * RETURNS:
1933 * 0 on success, -errno otherwise. 1933 * 0 on success, -errno otherwise.
1934 */ 1934 */
1935int sata_std_hardreset(struct ata_link *link, unsigned int *class, 1935int sata_sff_hardreset(struct ata_link *link, unsigned int *class,
1936 unsigned long deadline) 1936 unsigned long deadline)
1937{ 1937{
1938 struct ata_port *ap = link->ap; 1938 struct ata_port *ap = link->ap;
@@ -1957,7 +1957,7 @@ int sata_std_hardreset(struct ata_link *link, unsigned int *class,
1957 } 1957 }
1958 1958
1959 /* wait a while before checking status */ 1959 /* wait a while before checking status */
1960 ata_wait_after_reset(ap, deadline); 1960 ata_sff_wait_after_reset(ap, deadline);
1961 1961
1962 /* If PMP is supported, we have to do follow-up SRST. Note 1962 /* If PMP is supported, we have to do follow-up SRST. Note
1963 * that some PMPs don't send D2H Reg FIS after hardreset at 1963 * that some PMPs don't send D2H Reg FIS after hardreset at
@@ -1965,11 +1965,11 @@ int sata_std_hardreset(struct ata_link *link, unsigned int *class,
1965 * second and request follow-up SRST. 1965 * second and request follow-up SRST.
1966 */ 1966 */
1967 if (ap->flags & ATA_FLAG_PMP) { 1967 if (ap->flags & ATA_FLAG_PMP) {
1968 ata_wait_ready(ap, jiffies + HZ); 1968 ata_sff_wait_ready(ap, jiffies + HZ);
1969 return -EAGAIN; 1969 return -EAGAIN;
1970 } 1970 }
1971 1971
1972 rc = ata_wait_ready(ap, deadline); 1972 rc = ata_sff_wait_ready(ap, deadline);
1973 /* link occupied, -ENODEV too is an error */ 1973 /* link occupied, -ENODEV too is an error */
1974 if (rc) { 1974 if (rc) {
1975 ata_link_printk(link, KERN_ERR, 1975 ata_link_printk(link, KERN_ERR,
@@ -1979,17 +1979,17 @@ int sata_std_hardreset(struct ata_link *link, unsigned int *class,
1979 1979
1980 ap->ops->dev_select(ap, 0); /* probably unnecessary */ 1980 ap->ops->dev_select(ap, 0); /* probably unnecessary */
1981 1981
1982 *class = ata_dev_try_classify(link->device, 1, NULL); 1982 *class = ata_sff_dev_classify(link->device, 1, NULL);
1983 1983
1984 DPRINTK("EXIT, class=%u\n", *class); 1984 DPRINTK("EXIT, class=%u\n", *class);
1985 return 0; 1985 return 0;
1986} 1986}
1987 1987
1988/** 1988/**
1989 * ata_bmdma_error_handler - Stock error handler for BMDMA controller 1989 * ata_sff_error_handler - Stock error handler for BMDMA controller
1990 * @ap: port to handle error for 1990 * @ap: port to handle error for
1991 * 1991 *
1992 * Stock error handler for BMDMA controller. It can handle both 1992 * Stock error handler for SFF controller. It can handle both
1993 * PATA and SATA controllers. Many controllers should be able to 1993 * PATA and SATA controllers. Many controllers should be able to
1994 * use this EH as-is or with some added handling before and 1994 * use this EH as-is or with some added handling before and
1995 * after. 1995 * after.
@@ -1997,7 +1997,7 @@ int sata_std_hardreset(struct ata_link *link, unsigned int *class,
1997 * LOCKING: 1997 * LOCKING:
1998 * Kernel thread context (may sleep) 1998 * Kernel thread context (may sleep)
1999 */ 1999 */
2000void ata_bmdma_error_handler(struct ata_port *ap) 2000void ata_sff_error_handler(struct ata_port *ap)
2001{ 2001{
2002 ata_reset_fn_t softreset = ap->ops->softreset; 2002 ata_reset_fn_t softreset = ap->ops->softreset;
2003 ata_reset_fn_t hardreset = ap->ops->hardreset; 2003 ata_reset_fn_t hardreset = ap->ops->hardreset;
@@ -2034,7 +2034,7 @@ void ata_bmdma_error_handler(struct ata_port *ap)
2034 ap->ops->bmdma_stop(qc); 2034 ap->ops->bmdma_stop(qc);
2035 } 2035 }
2036 2036
2037 ata_altstatus(ap); 2037 ata_sff_altstatus(ap);
2038 ap->ops->check_status(ap); 2038 ap->ops->check_status(ap);
2039 ap->ops->irq_clear(ap); 2039 ap->ops->irq_clear(ap);
2040 2040
@@ -2045,14 +2045,14 @@ void ata_bmdma_error_handler(struct ata_port *ap)
2045 2045
2046 /* PIO and DMA engines have been stopped, perform recovery */ 2046 /* PIO and DMA engines have been stopped, perform recovery */
2047 2047
2048 /* ata_std_softreset and sata_std_hardreset are inherited to 2048 /* ata_sff_softreset and sata_sff_hardreset are inherited to
2049 * all SFF drivers from ata_sff_port_ops. Ignore softreset if 2049 * all SFF drivers from ata_sff_port_ops. Ignore softreset if
2050 * ctl isn't accessible. Ignore hardreset if SCR access isn't 2050 * ctl isn't accessible. Ignore hardreset if SCR access isn't
2051 * available. 2051 * available.
2052 */ 2052 */
2053 if (softreset == ata_std_softreset && !ap->ioaddr.ctl_addr) 2053 if (softreset == ata_sff_softreset && !ap->ioaddr.ctl_addr)
2054 softreset = NULL; 2054 softreset = NULL;
2055 if (hardreset == sata_std_hardreset && !sata_scr_valid(&ap->link)) 2055 if (hardreset == sata_sff_hardreset && !sata_scr_valid(&ap->link))
2056 hardreset = NULL; 2056 hardreset = NULL;
2057 2057
2058 ata_do_eh(ap, ap->ops->prereset, softreset, hardreset, 2058 ata_do_eh(ap, ap->ops->prereset, softreset, hardreset,
@@ -2060,14 +2060,13 @@ void ata_bmdma_error_handler(struct ata_port *ap)
2060} 2060}
2061 2061
2062/** 2062/**
2063 * ata_bmdma_post_internal_cmd - Stock post_internal_cmd for 2063 * ata_sff_post_internal_cmd - Stock post_internal_cmd for SFF controller
2064 * BMDMA controller
2065 * @qc: internal command to clean up 2064 * @qc: internal command to clean up
2066 * 2065 *
2067 * LOCKING: 2066 * LOCKING:
2068 * Kernel thread context (may sleep) 2067 * Kernel thread context (may sleep)
2069 */ 2068 */
2070void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) 2069void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc)
2071{ 2070{
2072 if (qc->ap->ioaddr.bmdma_addr) 2071 if (qc->ap->ioaddr.bmdma_addr)
2073 ata_bmdma_stop(qc); 2072 ata_bmdma_stop(qc);
@@ -2094,7 +2093,7 @@ int ata_sff_port_start(struct ata_port *ap)
2094} 2093}
2095 2094
2096/** 2095/**
2097 * ata_std_ports - initialize ioaddr with standard port offsets. 2096 * ata_sff_std_ports - initialize ioaddr with standard port offsets.
2098 * @ioaddr: IO address structure to be initialized 2097 * @ioaddr: IO address structure to be initialized
2099 * 2098 *
2100 * Utility function which initializes data_addr, error_addr, 2099 * Utility function which initializes data_addr, error_addr,
@@ -2104,7 +2103,7 @@ int ata_sff_port_start(struct ata_port *ap)
2104 * 2103 *
2105 * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr. 2104 * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr.
2106 */ 2105 */
2107void ata_std_ports(struct ata_ioports *ioaddr) 2106void ata_sff_std_ports(struct ata_ioports *ioaddr)
2108{ 2107{
2109 ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA; 2108 ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA;
2110 ioaddr->error_addr = ioaddr->cmd_addr + ATA_REG_ERR; 2109 ioaddr->error_addr = ioaddr->cmd_addr + ATA_REG_ERR;
@@ -2118,7 +2117,8 @@ void ata_std_ports(struct ata_ioports *ioaddr)
2118 ioaddr->command_addr = ioaddr->cmd_addr + ATA_REG_CMD; 2117 ioaddr->command_addr = ioaddr->cmd_addr + ATA_REG_CMD;
2119} 2118}
2120 2119
2121unsigned long ata_pci_default_filter(struct ata_device *adev, unsigned long xfer_mask) 2120unsigned long ata_bmdma_mode_filter(struct ata_device *adev,
2121 unsigned long xfer_mask)
2122{ 2122{
2123 /* Filter out DMA modes if the device has been configured by 2123 /* Filter out DMA modes if the device has been configured by
2124 the BIOS as PIO only */ 2124 the BIOS as PIO only */
@@ -2209,7 +2209,7 @@ void ata_bmdma_stop(struct ata_queued_cmd *qc)
2209 mmio + ATA_DMA_CMD); 2209 mmio + ATA_DMA_CMD);
2210 2210
2211 /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */ 2211 /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
2212 ata_altstatus(ap); /* dummy read */ 2212 ata_sff_altstatus(ap); /* dummy read */
2213} 2213}
2214 2214
2215/** 2215/**
@@ -2289,9 +2289,9 @@ void ata_bus_reset(struct ata_port *ap)
2289 /* 2289 /*
2290 * determine by signature whether we have ATA or ATAPI devices 2290 * determine by signature whether we have ATA or ATAPI devices
2291 */ 2291 */
2292 device[0].class = ata_dev_try_classify(&device[0], dev0, &err); 2292 device[0].class = ata_sff_dev_classify(&device[0], dev0, &err);
2293 if ((slave_possible) && (err != 0x81)) 2293 if ((slave_possible) && (err != 0x81))
2294 device[1].class = ata_dev_try_classify(&device[1], dev1, &err); 2294 device[1].class = ata_sff_dev_classify(&device[1], dev1, &err);
2295 2295
2296 /* is double-select really necessary? */ 2296 /* is double-select really necessary? */
2297 if (device[1].class != ATA_DEV_NONE) 2297 if (device[1].class != ATA_DEV_NONE)
@@ -2322,7 +2322,7 @@ err_out:
2322#ifdef CONFIG_PCI 2322#ifdef CONFIG_PCI
2323 2323
2324/** 2324/**
2325 * ata_pci_clear_simplex - attempt to kick device out of simplex 2325 * ata_pci_bmdma_clear_simplex - attempt to kick device out of simplex
2326 * @pdev: PCI device 2326 * @pdev: PCI device
2327 * 2327 *
2328 * Some PCI ATA devices report simplex mode but in fact can be told to 2328 * Some PCI ATA devices report simplex mode but in fact can be told to
@@ -2330,7 +2330,7 @@ err_out:
2330 * perform the task on such devices. Calling it on other devices will 2330 * perform the task on such devices. Calling it on other devices will
2331 * have -undefined- behaviour. 2331 * have -undefined- behaviour.
2332 */ 2332 */
2333int ata_pci_clear_simplex(struct pci_dev *pdev) 2333int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
2334{ 2334{
2335 unsigned long bmdma = pci_resource_start(pdev, 4); 2335 unsigned long bmdma = pci_resource_start(pdev, 4);
2336 u8 simplex; 2336 u8 simplex;
@@ -2347,7 +2347,7 @@ int ata_pci_clear_simplex(struct pci_dev *pdev)
2347} 2347}
2348 2348
2349/** 2349/**
2350 * ata_pci_init_bmdma - acquire PCI BMDMA resources and init ATA host 2350 * ata_pci_bmdma_init - acquire PCI BMDMA resources and init ATA host
2351 * @host: target ATA host 2351 * @host: target ATA host
2352 * 2352 *
2353 * Acquire PCI BMDMA resources and initialize @host accordingly. 2353 * Acquire PCI BMDMA resources and initialize @host accordingly.
@@ -2358,7 +2358,7 @@ int ata_pci_clear_simplex(struct pci_dev *pdev)
2358 * RETURNS: 2358 * RETURNS:
2359 * 0 on success, -errno otherwise. 2359 * 0 on success, -errno otherwise.
2360 */ 2360 */
2361int ata_pci_init_bmdma(struct ata_host *host) 2361int ata_pci_bmdma_init(struct ata_host *host)
2362{ 2362{
2363 struct device *gdev = host->dev; 2363 struct device *gdev = host->dev;
2364 struct pci_dev *pdev = to_pci_dev(gdev); 2364 struct pci_dev *pdev = to_pci_dev(gdev);
@@ -2418,7 +2418,7 @@ static int ata_resources_present(struct pci_dev *pdev, int port)
2418} 2418}
2419 2419
2420/** 2420/**
2421 * ata_pci_init_sff_host - acquire native PCI ATA resources and init host 2421 * ata_pci_sff_init_host - acquire native PCI ATA resources and init host
2422 * @host: target ATA host 2422 * @host: target ATA host
2423 * 2423 *
2424 * Acquire native PCI ATA resources for @host and initialize the 2424 * Acquire native PCI ATA resources for @host and initialize the
@@ -2436,7 +2436,7 @@ static int ata_resources_present(struct pci_dev *pdev, int port)
2436 * 0 if at least one port is initialized, -ENODEV if no port is 2436 * 0 if at least one port is initialized, -ENODEV if no port is
2437 * available. 2437 * available.
2438 */ 2438 */
2439int ata_pci_init_sff_host(struct ata_host *host) 2439int ata_pci_sff_init_host(struct ata_host *host)
2440{ 2440{
2441 struct device *gdev = host->dev; 2441 struct device *gdev = host->dev;
2442 struct pci_dev *pdev = to_pci_dev(gdev); 2442 struct pci_dev *pdev = to_pci_dev(gdev);
@@ -2478,7 +2478,7 @@ int ata_pci_init_sff_host(struct ata_host *host)
2478 ap->ioaddr.altstatus_addr = 2478 ap->ioaddr.altstatus_addr =
2479 ap->ioaddr.ctl_addr = (void __iomem *) 2479 ap->ioaddr.ctl_addr = (void __iomem *)
2480 ((unsigned long)iomap[base + 1] | ATA_PCI_CTL_OFS); 2480 ((unsigned long)iomap[base + 1] | ATA_PCI_CTL_OFS);
2481 ata_std_ports(&ap->ioaddr); 2481 ata_sff_std_ports(&ap->ioaddr);
2482 2482
2483 ata_port_desc(ap, "cmd 0x%llx ctl 0x%llx", 2483 ata_port_desc(ap, "cmd 0x%llx ctl 0x%llx",
2484 (unsigned long long)pci_resource_start(pdev, base), 2484 (unsigned long long)pci_resource_start(pdev, base),
@@ -2496,7 +2496,7 @@ int ata_pci_init_sff_host(struct ata_host *host)
2496} 2496}
2497 2497
2498/** 2498/**
2499 * ata_pci_prepare_sff_host - helper to prepare native PCI ATA host 2499 * ata_pci_sff_prepare_host - helper to prepare native PCI ATA host
2500 * @pdev: target PCI device 2500 * @pdev: target PCI device
2501 * @ppi: array of port_info, must be enough for two ports 2501 * @ppi: array of port_info, must be enough for two ports
2502 * @r_host: out argument for the initialized ATA host 2502 * @r_host: out argument for the initialized ATA host
@@ -2510,7 +2510,7 @@ int ata_pci_init_sff_host(struct ata_host *host)
2510 * RETURNS: 2510 * RETURNS:
2511 * 0 on success, -errno otherwise. 2511 * 0 on success, -errno otherwise.
2512 */ 2512 */
2513int ata_pci_prepare_sff_host(struct pci_dev *pdev, 2513int ata_pci_sff_prepare_host(struct pci_dev *pdev,
2514 const struct ata_port_info * const * ppi, 2514 const struct ata_port_info * const * ppi,
2515 struct ata_host **r_host) 2515 struct ata_host **r_host)
2516{ 2516{
@@ -2528,12 +2528,12 @@ int ata_pci_prepare_sff_host(struct pci_dev *pdev,
2528 goto err_out; 2528 goto err_out;
2529 } 2529 }
2530 2530
2531 rc = ata_pci_init_sff_host(host); 2531 rc = ata_pci_sff_init_host(host);
2532 if (rc) 2532 if (rc)
2533 goto err_out; 2533 goto err_out;
2534 2534
2535 /* init DMA related stuff */ 2535 /* init DMA related stuff */
2536 rc = ata_pci_init_bmdma(host); 2536 rc = ata_pci_bmdma_init(host);
2537 if (rc) 2537 if (rc)
2538 goto err_bmdma; 2538 goto err_bmdma;
2539 2539
@@ -2554,7 +2554,7 @@ int ata_pci_prepare_sff_host(struct pci_dev *pdev,
2554} 2554}
2555 2555
2556/** 2556/**
2557 * ata_pci_activate_sff_host - start SFF host, request IRQ and register it 2557 * ata_pci_sff_activate_host - start SFF host, request IRQ and register it
2558 * @host: target SFF ATA host 2558 * @host: target SFF ATA host
2559 * @irq_handler: irq_handler used when requesting IRQ(s) 2559 * @irq_handler: irq_handler used when requesting IRQ(s)
2560 * @sht: scsi_host_template to use when registering the host 2560 * @sht: scsi_host_template to use when registering the host
@@ -2569,7 +2569,7 @@ int ata_pci_prepare_sff_host(struct pci_dev *pdev,
2569 * RETURNS: 2569 * RETURNS:
2570 * 0 on success, -errno otherwise. 2570 * 0 on success, -errno otherwise.
2571 */ 2571 */
2572int ata_pci_activate_sff_host(struct ata_host *host, 2572int ata_pci_sff_activate_host(struct ata_host *host,
2573 irq_handler_t irq_handler, 2573 irq_handler_t irq_handler,
2574 struct scsi_host_template *sht) 2574 struct scsi_host_template *sht)
2575{ 2575{
@@ -2647,7 +2647,7 @@ int ata_pci_activate_sff_host(struct ata_host *host,
2647} 2647}
2648 2648
2649/** 2649/**
2650 * ata_pci_init_one - Initialize/register PCI IDE host controller 2650 * ata_pci_sff_init_one - Initialize/register PCI IDE host controller
2651 * @pdev: Controller to be initialized 2651 * @pdev: Controller to be initialized
2652 * @ppi: array of port_info, must be enough for two ports 2652 * @ppi: array of port_info, must be enough for two ports
2653 * @sht: scsi_host_template to use when registering the host 2653 * @sht: scsi_host_template to use when registering the host
@@ -2671,9 +2671,9 @@ int ata_pci_activate_sff_host(struct ata_host *host,
2671 * RETURNS: 2671 * RETURNS:
2672 * Zero on success, negative on errno-based value on error. 2672 * Zero on success, negative on errno-based value on error.
2673 */ 2673 */
2674int ata_pci_init_one(struct pci_dev *pdev, 2674int ata_pci_sff_init_one(struct pci_dev *pdev,
2675 const struct ata_port_info * const * ppi, 2675 const struct ata_port_info * const * ppi,
2676 struct scsi_host_template *sht, void *host_priv) 2676 struct scsi_host_template *sht, void *host_priv)
2677{ 2677{
2678 struct device *dev = &pdev->dev; 2678 struct device *dev = &pdev->dev;
2679 const struct ata_port_info *pi = NULL; 2679 const struct ata_port_info *pi = NULL;
@@ -2704,13 +2704,13 @@ int ata_pci_init_one(struct pci_dev *pdev,
2704 goto out; 2704 goto out;
2705 2705
2706 /* prepare and activate SFF host */ 2706 /* prepare and activate SFF host */
2707 rc = ata_pci_prepare_sff_host(pdev, ppi, &host); 2707 rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
2708 if (rc) 2708 if (rc)
2709 goto out; 2709 goto out;
2710 host->private_data = host_priv; 2710 host->private_data = host_priv;
2711 2711
2712 pci_set_master(pdev); 2712 pci_set_master(pdev);
2713 rc = ata_pci_activate_sff_host(host, ata_interrupt, sht); 2713 rc = ata_pci_sff_activate_host(host, ata_sff_interrupt, sht);
2714 out: 2714 out:
2715 if (rc == 0) 2715 if (rc == 0)
2716 devres_remove_group(&pdev->dev, NULL); 2716 devres_remove_group(&pdev->dev, NULL);
@@ -2724,47 +2724,47 @@ int ata_pci_init_one(struct pci_dev *pdev,
2724 2724
2725EXPORT_SYMBOL_GPL(ata_sff_port_ops); 2725EXPORT_SYMBOL_GPL(ata_sff_port_ops);
2726EXPORT_SYMBOL_GPL(ata_bmdma_port_ops); 2726EXPORT_SYMBOL_GPL(ata_bmdma_port_ops);
2727EXPORT_SYMBOL_GPL(ata_qc_prep); 2727EXPORT_SYMBOL_GPL(ata_sff_qc_prep);
2728EXPORT_SYMBOL_GPL(ata_dumb_qc_prep); 2728EXPORT_SYMBOL_GPL(ata_sff_dumb_qc_prep);
2729EXPORT_SYMBOL_GPL(ata_std_dev_select); 2729EXPORT_SYMBOL_GPL(ata_sff_dev_select);
2730EXPORT_SYMBOL_GPL(ata_check_status); 2730EXPORT_SYMBOL_GPL(ata_sff_check_status);
2731EXPORT_SYMBOL_GPL(ata_altstatus); 2731EXPORT_SYMBOL_GPL(ata_sff_altstatus);
2732EXPORT_SYMBOL_GPL(ata_busy_sleep); 2732EXPORT_SYMBOL_GPL(ata_sff_busy_sleep);
2733EXPORT_SYMBOL_GPL(ata_wait_ready); 2733EXPORT_SYMBOL_GPL(ata_sff_wait_ready);
2734EXPORT_SYMBOL_GPL(ata_tf_load); 2734EXPORT_SYMBOL_GPL(ata_sff_tf_load);
2735EXPORT_SYMBOL_GPL(ata_tf_read); 2735EXPORT_SYMBOL_GPL(ata_sff_tf_read);
2736EXPORT_SYMBOL_GPL(ata_exec_command); 2736EXPORT_SYMBOL_GPL(ata_sff_exec_command);
2737EXPORT_SYMBOL_GPL(ata_data_xfer); 2737EXPORT_SYMBOL_GPL(ata_sff_data_xfer);
2738EXPORT_SYMBOL_GPL(ata_data_xfer_noirq); 2738EXPORT_SYMBOL_GPL(ata_sff_data_xfer_noirq);
2739EXPORT_SYMBOL_GPL(ata_irq_on); 2739EXPORT_SYMBOL_GPL(ata_sff_irq_on);
2740EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear); 2740EXPORT_SYMBOL_GPL(ata_sff_irq_clear);
2741EXPORT_SYMBOL_GPL(ata_hsm_move); 2741EXPORT_SYMBOL_GPL(ata_sff_hsm_move);
2742EXPORT_SYMBOL_GPL(ata_qc_issue_prot); 2742EXPORT_SYMBOL_GPL(ata_sff_qc_issue);
2743EXPORT_SYMBOL_GPL(ata_host_intr); 2743EXPORT_SYMBOL_GPL(ata_sff_host_intr);
2744EXPORT_SYMBOL_GPL(ata_interrupt); 2744EXPORT_SYMBOL_GPL(ata_sff_interrupt);
2745EXPORT_SYMBOL_GPL(ata_bmdma_freeze); 2745EXPORT_SYMBOL_GPL(ata_sff_freeze);
2746EXPORT_SYMBOL_GPL(ata_bmdma_thaw); 2746EXPORT_SYMBOL_GPL(ata_sff_thaw);
2747EXPORT_SYMBOL_GPL(ata_std_prereset); 2747EXPORT_SYMBOL_GPL(ata_sff_prereset);
2748EXPORT_SYMBOL_GPL(ata_dev_try_classify); 2748EXPORT_SYMBOL_GPL(ata_sff_dev_classify);
2749EXPORT_SYMBOL_GPL(ata_wait_after_reset); 2749EXPORT_SYMBOL_GPL(ata_sff_wait_after_reset);
2750EXPORT_SYMBOL_GPL(ata_std_softreset); 2750EXPORT_SYMBOL_GPL(ata_sff_softreset);
2751EXPORT_SYMBOL_GPL(sata_std_hardreset); 2751EXPORT_SYMBOL_GPL(sata_sff_hardreset);
2752EXPORT_SYMBOL_GPL(ata_std_postreset); 2752EXPORT_SYMBOL_GPL(ata_sff_postreset);
2753EXPORT_SYMBOL_GPL(ata_bmdma_error_handler); 2753EXPORT_SYMBOL_GPL(ata_sff_error_handler);
2754EXPORT_SYMBOL_GPL(ata_bmdma_post_internal_cmd); 2754EXPORT_SYMBOL_GPL(ata_sff_post_internal_cmd);
2755EXPORT_SYMBOL_GPL(ata_sff_port_start); 2755EXPORT_SYMBOL_GPL(ata_sff_port_start);
2756EXPORT_SYMBOL_GPL(ata_std_ports); 2756EXPORT_SYMBOL_GPL(ata_sff_std_ports);
2757EXPORT_SYMBOL_GPL(ata_pci_default_filter); 2757EXPORT_SYMBOL_GPL(ata_bmdma_mode_filter);
2758EXPORT_SYMBOL_GPL(ata_bmdma_setup); 2758EXPORT_SYMBOL_GPL(ata_bmdma_setup);
2759EXPORT_SYMBOL_GPL(ata_bmdma_start); 2759EXPORT_SYMBOL_GPL(ata_bmdma_start);
2760EXPORT_SYMBOL_GPL(ata_bmdma_stop); 2760EXPORT_SYMBOL_GPL(ata_bmdma_stop);
2761EXPORT_SYMBOL_GPL(ata_bmdma_status); 2761EXPORT_SYMBOL_GPL(ata_bmdma_status);
2762EXPORT_SYMBOL_GPL(ata_bus_reset); 2762EXPORT_SYMBOL_GPL(ata_bus_reset);
2763#ifdef CONFIG_PCI 2763#ifdef CONFIG_PCI
2764EXPORT_SYMBOL_GPL(ata_pci_clear_simplex); 2764EXPORT_SYMBOL_GPL(ata_pci_bmdma_clear_simplex);
2765EXPORT_SYMBOL_GPL(ata_pci_init_bmdma); 2765EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
2766EXPORT_SYMBOL_GPL(ata_pci_init_sff_host); 2766EXPORT_SYMBOL_GPL(ata_pci_sff_init_host);
2767EXPORT_SYMBOL_GPL(ata_pci_prepare_sff_host); 2767EXPORT_SYMBOL_GPL(ata_pci_sff_prepare_host);
2768EXPORT_SYMBOL_GPL(ata_pci_activate_sff_host); 2768EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host);
2769EXPORT_SYMBOL_GPL(ata_pci_init_one); 2769EXPORT_SYMBOL_GPL(ata_pci_sff_init_one);
2770#endif /* CONFIG_PCI */ 2770#endif /* CONFIG_PCI */