aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-01-05 09:16:13 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-01-08 16:40:25 -0500
commit0fe40ff891faa940e539bd5a92c4a5dd9ae49b0b (patch)
tree1741ce3f2f9ef275d129776eebdf04ecd6bccb4a /drivers/ata/libata-sff.c
parent871af1210f13966ab911ed2166e4ab2ce775b99d (diff)
libata: clean up the SFF code for coding style
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c132
1 files changed, 67 insertions, 65 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index b58549fac460..c59ad76c84b1 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -66,6 +66,7 @@ const struct ata_port_operations ata_sff_port_ops = {
66 66
67 .port_start = ata_sff_port_start, 67 .port_start = ata_sff_port_start,
68}; 68};
69EXPORT_SYMBOL_GPL(ata_sff_port_ops);
69 70
70const struct ata_port_operations ata_bmdma_port_ops = { 71const struct ata_port_operations ata_bmdma_port_ops = {
71 .inherits = &ata_sff_port_ops, 72 .inherits = &ata_sff_port_ops,
@@ -77,6 +78,7 @@ const struct ata_port_operations ata_bmdma_port_ops = {
77 .bmdma_stop = ata_bmdma_stop, 78 .bmdma_stop = ata_bmdma_stop,
78 .bmdma_status = ata_bmdma_status, 79 .bmdma_status = ata_bmdma_status,
79}; 80};
81EXPORT_SYMBOL_GPL(ata_bmdma_port_ops);
80 82
81const struct ata_port_operations ata_bmdma32_port_ops = { 83const struct ata_port_operations ata_bmdma32_port_ops = {
82 .inherits = &ata_bmdma_port_ops, 84 .inherits = &ata_bmdma_port_ops,
@@ -173,8 +175,9 @@ static void ata_fill_sg_dumb(struct ata_queued_cmd *qc)
173 blen = len & 0xffff; 175 blen = len & 0xffff;
174 ap->prd[pi].addr = cpu_to_le32(addr); 176 ap->prd[pi].addr = cpu_to_le32(addr);
175 if (blen == 0) { 177 if (blen == 0) {
176 /* Some PATA chipsets like the CS5530 can't 178 /* Some PATA chipsets like the CS5530 can't
177 cope with 0x0000 meaning 64K as the spec says */ 179 cope with 0x0000 meaning 64K as the spec
180 says */
178 ap->prd[pi].flags_len = cpu_to_le32(0x8000); 181 ap->prd[pi].flags_len = cpu_to_le32(0x8000);
179 blen = 0x8000; 182 blen = 0x8000;
180 ap->prd[++pi].addr = cpu_to_le32(addr + 0x8000); 183 ap->prd[++pi].addr = cpu_to_le32(addr + 0x8000);
@@ -207,6 +210,7 @@ void ata_sff_qc_prep(struct ata_queued_cmd *qc)
207 210
208 ata_fill_sg(qc); 211 ata_fill_sg(qc);
209} 212}
213EXPORT_SYMBOL_GPL(ata_sff_qc_prep);
210 214
211/** 215/**
212 * ata_sff_dumb_qc_prep - Prepare taskfile for submission 216 * ata_sff_dumb_qc_prep - Prepare taskfile for submission
@@ -224,6 +228,7 @@ void ata_sff_dumb_qc_prep(struct ata_queued_cmd *qc)
224 228
225 ata_fill_sg_dumb(qc); 229 ata_fill_sg_dumb(qc);
226} 230}
231EXPORT_SYMBOL_GPL(ata_sff_dumb_qc_prep);
227 232
228/** 233/**
229 * ata_sff_check_status - Read device status reg & clear interrupt 234 * ata_sff_check_status - Read device status reg & clear interrupt
@@ -240,6 +245,7 @@ u8 ata_sff_check_status(struct ata_port *ap)
240{ 245{
241 return ioread8(ap->ioaddr.status_addr); 246 return ioread8(ap->ioaddr.status_addr);
242} 247}
248EXPORT_SYMBOL_GPL(ata_sff_check_status);
243 249
244/** 250/**
245 * ata_sff_altstatus - Read device alternate status reg 251 * ata_sff_altstatus - Read device alternate status reg
@@ -282,7 +288,7 @@ static u8 ata_sff_irq_status(struct ata_port *ap)
282 status = ata_sff_altstatus(ap); 288 status = ata_sff_altstatus(ap);
283 /* Not us: We are busy */ 289 /* Not us: We are busy */
284 if (status & ATA_BUSY) 290 if (status & ATA_BUSY)
285 return status; 291 return status;
286 } 292 }
287 /* Clear INTRQ latch */ 293 /* Clear INTRQ latch */
288 status = ap->ops->sff_check_status(ap); 294 status = ap->ops->sff_check_status(ap);
@@ -326,6 +332,7 @@ void ata_sff_pause(struct ata_port *ap)
326 ata_sff_sync(ap); 332 ata_sff_sync(ap);
327 ndelay(400); 333 ndelay(400);
328} 334}
335EXPORT_SYMBOL_GPL(ata_sff_pause);
329 336
330/** 337/**
331 * ata_sff_dma_pause - Pause before commencing DMA 338 * ata_sff_dma_pause - Pause before commencing DMA
@@ -334,7 +341,7 @@ void ata_sff_pause(struct ata_port *ap)
334 * Perform I/O fencing and ensure sufficient cycle delays occur 341 * Perform I/O fencing and ensure sufficient cycle delays occur
335 * for the HDMA1:0 transition 342 * for the HDMA1:0 transition
336 */ 343 */
337 344
338void ata_sff_dma_pause(struct ata_port *ap) 345void ata_sff_dma_pause(struct ata_port *ap)
339{ 346{
340 if (ap->ops->sff_check_altstatus || ap->ioaddr.altstatus_addr) { 347 if (ap->ops->sff_check_altstatus || ap->ioaddr.altstatus_addr) {
@@ -348,6 +355,7 @@ void ata_sff_dma_pause(struct ata_port *ap)
348 corruption. */ 355 corruption. */
349 BUG(); 356 BUG();
350} 357}
358EXPORT_SYMBOL_GPL(ata_sff_dma_pause);
351 359
352/** 360/**
353 * ata_sff_busy_sleep - sleep until BSY clears, or timeout 361 * ata_sff_busy_sleep - sleep until BSY clears, or timeout
@@ -403,6 +411,7 @@ int ata_sff_busy_sleep(struct ata_port *ap,
403 411
404 return 0; 412 return 0;
405} 413}
414EXPORT_SYMBOL_GPL(ata_sff_busy_sleep);
406 415
407static int ata_sff_check_ready(struct ata_link *link) 416static int ata_sff_check_ready(struct ata_link *link)
408{ 417{
@@ -429,6 +438,7 @@ int ata_sff_wait_ready(struct ata_link *link, unsigned long deadline)
429{ 438{
430 return ata_wait_ready(link, deadline, ata_sff_check_ready); 439 return ata_wait_ready(link, deadline, ata_sff_check_ready);
431} 440}
441EXPORT_SYMBOL_GPL(ata_sff_wait_ready);
432 442
433/** 443/**
434 * ata_sff_dev_select - Select device 0/1 on ATA bus 444 * ata_sff_dev_select - Select device 0/1 on ATA bus
@@ -456,6 +466,7 @@ void ata_sff_dev_select(struct ata_port *ap, unsigned int device)
456 iowrite8(tmp, ap->ioaddr.device_addr); 466 iowrite8(tmp, ap->ioaddr.device_addr);
457 ata_sff_pause(ap); /* needed; also flushes, for mmio */ 467 ata_sff_pause(ap); /* needed; also flushes, for mmio */
458} 468}
469EXPORT_SYMBOL_GPL(ata_sff_dev_select);
459 470
460/** 471/**
461 * ata_dev_select - Select device 0/1 on ATA bus 472 * ata_dev_select - Select device 0/1 on ATA bus
@@ -520,6 +531,7 @@ u8 ata_sff_irq_on(struct ata_port *ap)
520 531
521 return tmp; 532 return tmp;
522} 533}
534EXPORT_SYMBOL_GPL(ata_sff_irq_on);
523 535
524/** 536/**
525 * ata_sff_irq_clear - Clear PCI IDE BMDMA interrupt. 537 * ata_sff_irq_clear - Clear PCI IDE BMDMA interrupt.
@@ -541,6 +553,7 @@ void ata_sff_irq_clear(struct ata_port *ap)
541 553
542 iowrite8(ioread8(mmio + ATA_DMA_STATUS), mmio + ATA_DMA_STATUS); 554 iowrite8(ioread8(mmio + ATA_DMA_STATUS), mmio + ATA_DMA_STATUS);
543} 555}
556EXPORT_SYMBOL_GPL(ata_sff_irq_clear);
544 557
545/** 558/**
546 * ata_sff_tf_load - send taskfile registers to host controller 559 * ata_sff_tf_load - send taskfile registers to host controller
@@ -600,6 +613,7 @@ void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
600 613
601 ata_wait_idle(ap); 614 ata_wait_idle(ap);
602} 615}
616EXPORT_SYMBOL_GPL(ata_sff_tf_load);
603 617
604/** 618/**
605 * ata_sff_tf_read - input device's ATA taskfile shadow registers 619 * ata_sff_tf_read - input device's ATA taskfile shadow registers
@@ -640,6 +654,7 @@ void ata_sff_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
640 WARN_ON(1); 654 WARN_ON(1);
641 } 655 }
642} 656}
657EXPORT_SYMBOL_GPL(ata_sff_tf_read);
643 658
644/** 659/**
645 * ata_sff_exec_command - issue ATA command to host controller 660 * ata_sff_exec_command - issue ATA command to host controller
@@ -659,6 +674,7 @@ void ata_sff_exec_command(struct ata_port *ap, const struct ata_taskfile *tf)
659 iowrite8(tf->command, ap->ioaddr.command_addr); 674 iowrite8(tf->command, ap->ioaddr.command_addr);
660 ata_sff_pause(ap); 675 ata_sff_pause(ap);
661} 676}
677EXPORT_SYMBOL_GPL(ata_sff_exec_command);
662 678
663/** 679/**
664 * ata_tf_to_host - issue ATA taskfile to host controller 680 * ata_tf_to_host - issue ATA taskfile to host controller
@@ -724,6 +740,7 @@ unsigned int ata_sff_data_xfer(struct ata_device *dev, unsigned char *buf,
724 740
725 return words << 1; 741 return words << 1;
726} 742}
743EXPORT_SYMBOL_GPL(ata_sff_data_xfer);
727 744
728/** 745/**
729 * ata_sff_data_xfer32 - Transfer data by PIO 746 * ata_sff_data_xfer32 - Transfer data by PIO
@@ -799,6 +816,7 @@ unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, unsigned char *buf,
799 816
800 return consumed; 817 return consumed;
801} 818}
819EXPORT_SYMBOL_GPL(ata_sff_data_xfer_noirq);
802 820
803/** 821/**
804 * ata_pio_sector - Transfer a sector of data. 822 * ata_pio_sector - Transfer a sector of data.
@@ -975,13 +993,15 @@ next_sg:
975 buf = kmap_atomic(page, KM_IRQ0); 993 buf = kmap_atomic(page, KM_IRQ0);
976 994
977 /* do the actual data transfer */ 995 /* do the actual data transfer */
978 consumed = ap->ops->sff_data_xfer(dev, buf + offset, count, rw); 996 consumed = ap->ops->sff_data_xfer(dev, buf + offset,
997 count, rw);
979 998
980 kunmap_atomic(buf, KM_IRQ0); 999 kunmap_atomic(buf, KM_IRQ0);
981 local_irq_restore(flags); 1000 local_irq_restore(flags);
982 } else { 1001 } else {
983 buf = page_address(page); 1002 buf = page_address(page);
984 consumed = ap->ops->sff_data_xfer(dev, buf + offset, count, rw); 1003 consumed = ap->ops->sff_data_xfer(dev, buf + offset,
1004 count, rw);
985 } 1005 }
986 1006
987 bytes -= min(bytes, consumed); 1007 bytes -= min(bytes, consumed);
@@ -1066,18 +1086,19 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc)
1066 * RETURNS: 1086 * RETURNS:
1067 * 1 if ok in workqueue, 0 otherwise. 1087 * 1 if ok in workqueue, 0 otherwise.
1068 */ 1088 */
1069static inline int ata_hsm_ok_in_wq(struct ata_port *ap, struct ata_queued_cmd *qc) 1089static inline int ata_hsm_ok_in_wq(struct ata_port *ap,
1090 struct ata_queued_cmd *qc)
1070{ 1091{
1071 if (qc->tf.flags & ATA_TFLAG_POLLING) 1092 if (qc->tf.flags & ATA_TFLAG_POLLING)
1072 return 1; 1093 return 1;
1073 1094
1074 if (ap->hsm_task_state == HSM_ST_FIRST) { 1095 if (ap->hsm_task_state == HSM_ST_FIRST) {
1075 if (qc->tf.protocol == ATA_PROT_PIO && 1096 if (qc->tf.protocol == ATA_PROT_PIO &&
1076 (qc->tf.flags & ATA_TFLAG_WRITE)) 1097 (qc->tf.flags & ATA_TFLAG_WRITE))
1077 return 1; 1098 return 1;
1078 1099
1079 if (ata_is_atapi(qc->tf.protocol) && 1100 if (ata_is_atapi(qc->tf.protocol) &&
1080 !(qc->dev->flags & ATA_DFLAG_CDB_INTR)) 1101 !(qc->dev->flags & ATA_DFLAG_CDB_INTR))
1081 return 1; 1102 return 1;
1082 } 1103 }
1083 1104
@@ -1391,6 +1412,7 @@ fsm_start:
1391 1412
1392 return poll_next; 1413 return poll_next;
1393} 1414}
1415EXPORT_SYMBOL_GPL(ata_sff_hsm_move);
1394 1416
1395void ata_pio_task(struct work_struct *work) 1417void ata_pio_task(struct work_struct *work)
1396{ 1418{
@@ -1560,6 +1582,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc)
1560 1582
1561 return 0; 1583 return 0;
1562} 1584}
1585EXPORT_SYMBOL_GPL(ata_sff_qc_issue);
1563 1586
1564/** 1587/**
1565 * ata_sff_qc_fill_rtf - fill result TF using ->sff_tf_read 1588 * ata_sff_qc_fill_rtf - fill result TF using ->sff_tf_read
@@ -1579,6 +1602,7 @@ bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc)
1579 qc->ap->ops->sff_tf_read(qc->ap, &qc->result_tf); 1602 qc->ap->ops->sff_tf_read(qc->ap, &qc->result_tf);
1580 return true; 1603 return true;
1581} 1604}
1605EXPORT_SYMBOL_GPL(ata_sff_qc_fill_rtf);
1582 1606
1583/** 1607/**
1584 * ata_sff_host_intr - Handle host interrupt for given (port, task) 1608 * ata_sff_host_intr - Handle host interrupt for given (port, task)
@@ -1676,6 +1700,7 @@ idle_irq:
1676#endif 1700#endif
1677 return 0; /* irq not handled */ 1701 return 0; /* irq not handled */
1678} 1702}
1703EXPORT_SYMBOL_GPL(ata_sff_host_intr);
1679 1704
1680/** 1705/**
1681 * ata_sff_interrupt - Default ATA host interrupt handler 1706 * ata_sff_interrupt - Default ATA host interrupt handler
@@ -1720,6 +1745,7 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance)
1720 1745
1721 return IRQ_RETVAL(handled); 1746 return IRQ_RETVAL(handled);
1722} 1747}
1748EXPORT_SYMBOL_GPL(ata_sff_interrupt);
1723 1749
1724/** 1750/**
1725 * ata_sff_freeze - Freeze SFF controller port 1751 * ata_sff_freeze - Freeze SFF controller port
@@ -1748,6 +1774,7 @@ void ata_sff_freeze(struct ata_port *ap)
1748 1774
1749 ap->ops->sff_irq_clear(ap); 1775 ap->ops->sff_irq_clear(ap);
1750} 1776}
1777EXPORT_SYMBOL_GPL(ata_sff_freeze);
1751 1778
1752/** 1779/**
1753 * ata_sff_thaw - Thaw SFF controller port 1780 * ata_sff_thaw - Thaw SFF controller port
@@ -1765,6 +1792,7 @@ void ata_sff_thaw(struct ata_port *ap)
1765 ap->ops->sff_irq_clear(ap); 1792 ap->ops->sff_irq_clear(ap);
1766 ap->ops->sff_irq_on(ap); 1793 ap->ops->sff_irq_on(ap);
1767} 1794}
1795EXPORT_SYMBOL_GPL(ata_sff_thaw);
1768 1796
1769/** 1797/**
1770 * ata_sff_prereset - prepare SFF link for reset 1798 * ata_sff_prereset - prepare SFF link for reset
@@ -1806,6 +1834,7 @@ int ata_sff_prereset(struct ata_link *link, unsigned long deadline)
1806 1834
1807 return 0; 1835 return 0;
1808} 1836}
1837EXPORT_SYMBOL_GPL(ata_sff_prereset);
1809 1838
1810/** 1839/**
1811 * ata_devchk - PATA device presence detection 1840 * ata_devchk - PATA device presence detection
@@ -1918,6 +1947,7 @@ unsigned int ata_sff_dev_classify(struct ata_device *dev, int present,
1918 1947
1919 return class; 1948 return class;
1920} 1949}
1950EXPORT_SYMBOL_GPL(ata_sff_dev_classify);
1921 1951
1922/** 1952/**
1923 * ata_sff_wait_after_reset - wait for devices to become ready after reset 1953 * ata_sff_wait_after_reset - wait for devices to become ready after reset
@@ -1994,6 +2024,7 @@ int ata_sff_wait_after_reset(struct ata_link *link, unsigned int devmask,
1994 2024
1995 return ret; 2025 return ret;
1996} 2026}
2027EXPORT_SYMBOL_GPL(ata_sff_wait_after_reset);
1997 2028
1998static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask, 2029static int ata_bus_softreset(struct ata_port *ap, unsigned int devmask,
1999 unsigned long deadline) 2030 unsigned long deadline)
@@ -2066,6 +2097,7 @@ int ata_sff_softreset(struct ata_link *link, unsigned int *classes,
2066 DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]); 2097 DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]);
2067 return 0; 2098 return 0;
2068} 2099}
2100EXPORT_SYMBOL_GPL(ata_sff_softreset);
2069 2101
2070/** 2102/**
2071 * sata_sff_hardreset - reset host port via SATA phy reset 2103 * sata_sff_hardreset - reset host port via SATA phy reset
@@ -2098,6 +2130,7 @@ int sata_sff_hardreset(struct ata_link *link, unsigned int *class,
2098 DPRINTK("EXIT, class=%u\n", *class); 2130 DPRINTK("EXIT, class=%u\n", *class);
2099 return rc; 2131 return rc;
2100} 2132}
2133EXPORT_SYMBOL_GPL(sata_sff_hardreset);
2101 2134
2102/** 2135/**
2103 * ata_sff_postreset - SFF postreset callback 2136 * ata_sff_postreset - SFF postreset callback
@@ -2133,6 +2166,7 @@ void ata_sff_postreset(struct ata_link *link, unsigned int *classes)
2133 if (ap->ioaddr.ctl_addr) 2166 if (ap->ioaddr.ctl_addr)
2134 iowrite8(ap->ctl, ap->ioaddr.ctl_addr); 2167 iowrite8(ap->ctl, ap->ioaddr.ctl_addr);
2135} 2168}
2169EXPORT_SYMBOL_GPL(ata_sff_postreset);
2136 2170
2137/** 2171/**
2138 * ata_sff_error_handler - Stock error handler for BMDMA controller 2172 * ata_sff_error_handler - Stock error handler for BMDMA controller
@@ -2205,6 +2239,7 @@ void ata_sff_error_handler(struct ata_port *ap)
2205 ata_do_eh(ap, ap->ops->prereset, softreset, hardreset, 2239 ata_do_eh(ap, ap->ops->prereset, softreset, hardreset,
2206 ap->ops->postreset); 2240 ap->ops->postreset);
2207} 2241}
2242EXPORT_SYMBOL_GPL(ata_sff_error_handler);
2208 2243
2209/** 2244/**
2210 * ata_sff_post_internal_cmd - Stock post_internal_cmd for SFF controller 2245 * ata_sff_post_internal_cmd - Stock post_internal_cmd for SFF controller
@@ -2227,6 +2262,7 @@ void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc)
2227 2262
2228 spin_unlock_irqrestore(ap->lock, flags); 2263 spin_unlock_irqrestore(ap->lock, flags);
2229} 2264}
2265EXPORT_SYMBOL_GPL(ata_sff_post_internal_cmd);
2230 2266
2231/** 2267/**
2232 * ata_sff_port_start - Set port up for dma. 2268 * ata_sff_port_start - Set port up for dma.
@@ -2247,6 +2283,7 @@ int ata_sff_port_start(struct ata_port *ap)
2247 return ata_port_start(ap); 2283 return ata_port_start(ap);
2248 return 0; 2284 return 0;
2249} 2285}
2286EXPORT_SYMBOL_GPL(ata_sff_port_start);
2250 2287
2251/** 2288/**
2252 * ata_sff_std_ports - initialize ioaddr with standard port offsets. 2289 * ata_sff_std_ports - initialize ioaddr with standard port offsets.
@@ -2272,6 +2309,7 @@ void ata_sff_std_ports(struct ata_ioports *ioaddr)
2272 ioaddr->status_addr = ioaddr->cmd_addr + ATA_REG_STATUS; 2309 ioaddr->status_addr = ioaddr->cmd_addr + ATA_REG_STATUS;
2273 ioaddr->command_addr = ioaddr->cmd_addr + ATA_REG_CMD; 2310 ioaddr->command_addr = ioaddr->cmd_addr + ATA_REG_CMD;
2274} 2311}
2312EXPORT_SYMBOL_GPL(ata_sff_std_ports);
2275 2313
2276unsigned long ata_bmdma_mode_filter(struct ata_device *adev, 2314unsigned long ata_bmdma_mode_filter(struct ata_device *adev,
2277 unsigned long xfer_mask) 2315 unsigned long xfer_mask)
@@ -2283,6 +2321,7 @@ unsigned long ata_bmdma_mode_filter(struct ata_device *adev,
2283 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 2321 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
2284 return xfer_mask; 2322 return xfer_mask;
2285} 2323}
2324EXPORT_SYMBOL_GPL(ata_bmdma_mode_filter);
2286 2325
2287/** 2326/**
2288 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction 2327 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction
@@ -2311,6 +2350,7 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc)
2311 /* issue r/w command */ 2350 /* issue r/w command */
2312 ap->ops->sff_exec_command(ap, &qc->tf); 2351 ap->ops->sff_exec_command(ap, &qc->tf);
2313} 2352}
2353EXPORT_SYMBOL_GPL(ata_bmdma_setup);
2314 2354
2315/** 2355/**
2316 * ata_bmdma_start - Start a PCI IDE BMDMA transaction 2356 * ata_bmdma_start - Start a PCI IDE BMDMA transaction
@@ -2343,6 +2383,7 @@ void ata_bmdma_start(struct ata_queued_cmd *qc)
2343 * unneccessarily delayed for MMIO 2383 * unneccessarily delayed for MMIO
2344 */ 2384 */
2345} 2385}
2386EXPORT_SYMBOL_GPL(ata_bmdma_start);
2346 2387
2347/** 2388/**
2348 * ata_bmdma_stop - Stop PCI IDE BMDMA transfer 2389 * ata_bmdma_stop - Stop PCI IDE BMDMA transfer
@@ -2367,6 +2408,7 @@ void ata_bmdma_stop(struct ata_queued_cmd *qc)
2367 /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */ 2408 /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
2368 ata_sff_dma_pause(ap); 2409 ata_sff_dma_pause(ap);
2369} 2410}
2411EXPORT_SYMBOL_GPL(ata_bmdma_stop);
2370 2412
2371/** 2413/**
2372 * ata_bmdma_status - Read PCI IDE BMDMA status 2414 * ata_bmdma_status - Read PCI IDE BMDMA status
@@ -2383,6 +2425,7 @@ u8 ata_bmdma_status(struct ata_port *ap)
2383{ 2425{
2384 return ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); 2426 return ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
2385} 2427}
2428EXPORT_SYMBOL_GPL(ata_bmdma_status);
2386 2429
2387/** 2430/**
2388 * ata_bus_reset - reset host port and associated ATA channel 2431 * ata_bus_reset - reset host port and associated ATA channel
@@ -2475,6 +2518,7 @@ err_out:
2475 2518
2476 DPRINTK("EXIT\n"); 2519 DPRINTK("EXIT\n");
2477} 2520}
2521EXPORT_SYMBOL_GPL(ata_bus_reset);
2478 2522
2479#ifdef CONFIG_PCI 2523#ifdef CONFIG_PCI
2480 2524
@@ -2502,6 +2546,7 @@ int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
2502 return -EOPNOTSUPP; 2546 return -EOPNOTSUPP;
2503 return 0; 2547 return 0;
2504} 2548}
2549EXPORT_SYMBOL_GPL(ata_pci_bmdma_clear_simplex);
2505 2550
2506/** 2551/**
2507 * ata_pci_bmdma_init - acquire PCI BMDMA resources and init ATA host 2552 * ata_pci_bmdma_init - acquire PCI BMDMA resources and init ATA host
@@ -2554,11 +2599,12 @@ int ata_pci_bmdma_init(struct ata_host *host)
2554 host->flags |= ATA_HOST_SIMPLEX; 2599 host->flags |= ATA_HOST_SIMPLEX;
2555 2600
2556 ata_port_desc(ap, "bmdma 0x%llx", 2601 ata_port_desc(ap, "bmdma 0x%llx",
2557 (unsigned long long)pci_resource_start(pdev, 4) + 8 * i); 2602 (unsigned long long)pci_resource_start(pdev, 4) + 8 * i);
2558 } 2603 }
2559 2604
2560 return 0; 2605 return 0;
2561} 2606}
2607EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
2562 2608
2563static int ata_resources_present(struct pci_dev *pdev, int port) 2609static int ata_resources_present(struct pci_dev *pdev, int port)
2564{ 2610{
@@ -2566,7 +2612,7 @@ static int ata_resources_present(struct pci_dev *pdev, int port)
2566 2612
2567 /* Check the PCI resources for this channel are enabled */ 2613 /* Check the PCI resources for this channel are enabled */
2568 port = port * 2; 2614 port = port * 2;
2569 for (i = 0; i < 2; i ++) { 2615 for (i = 0; i < 2; i++) {
2570 if (pci_resource_start(pdev, port + i) == 0 || 2616 if (pci_resource_start(pdev, port + i) == 0 ||
2571 pci_resource_len(pdev, port + i) == 0) 2617 pci_resource_len(pdev, port + i) == 0)
2572 return 0; 2618 return 0;
@@ -2651,6 +2697,7 @@ int ata_pci_sff_init_host(struct ata_host *host)
2651 2697
2652 return 0; 2698 return 0;
2653} 2699}
2700EXPORT_SYMBOL_GPL(ata_pci_sff_init_host);
2654 2701
2655/** 2702/**
2656 * ata_pci_sff_prepare_host - helper to prepare native PCI ATA host 2703 * ata_pci_sff_prepare_host - helper to prepare native PCI ATA host
@@ -2668,7 +2715,7 @@ int ata_pci_sff_init_host(struct ata_host *host)
2668 * 0 on success, -errno otherwise. 2715 * 0 on success, -errno otherwise.
2669 */ 2716 */
2670int ata_pci_sff_prepare_host(struct pci_dev *pdev, 2717int ata_pci_sff_prepare_host(struct pci_dev *pdev,
2671 const struct ata_port_info * const * ppi, 2718 const struct ata_port_info * const *ppi,
2672 struct ata_host **r_host) 2719 struct ata_host **r_host)
2673{ 2720{
2674 struct ata_host *host; 2721 struct ata_host *host;
@@ -2698,17 +2745,18 @@ int ata_pci_sff_prepare_host(struct pci_dev *pdev,
2698 *r_host = host; 2745 *r_host = host;
2699 return 0; 2746 return 0;
2700 2747
2701 err_bmdma: 2748err_bmdma:
2702 /* This is necessary because PCI and iomap resources are 2749 /* This is necessary because PCI and iomap resources are
2703 * merged and releasing the top group won't release the 2750 * merged and releasing the top group won't release the
2704 * acquired resources if some of those have been acquired 2751 * acquired resources if some of those have been acquired
2705 * before entering this function. 2752 * before entering this function.
2706 */ 2753 */
2707 pcim_iounmap_regions(pdev, 0xf); 2754 pcim_iounmap_regions(pdev, 0xf);
2708 err_out: 2755err_out:
2709 devres_release_group(&pdev->dev, NULL); 2756 devres_release_group(&pdev->dev, NULL);
2710 return rc; 2757 return rc;
2711} 2758}
2759EXPORT_SYMBOL_GPL(ata_pci_sff_prepare_host);
2712 2760
2713/** 2761/**
2714 * ata_pci_sff_activate_host - start SFF host, request IRQ and register it 2762 * ata_pci_sff_activate_host - start SFF host, request IRQ and register it
@@ -2794,7 +2842,7 @@ int ata_pci_sff_activate_host(struct ata_host *host,
2794 } 2842 }
2795 2843
2796 rc = ata_host_register(host, sht); 2844 rc = ata_host_register(host, sht);
2797 out: 2845out:
2798 if (rc == 0) 2846 if (rc == 0)
2799 devres_remove_group(dev, NULL); 2847 devres_remove_group(dev, NULL);
2800 else 2848 else
@@ -2802,6 +2850,7 @@ int ata_pci_sff_activate_host(struct ata_host *host,
2802 2850
2803 return rc; 2851 return rc;
2804} 2852}
2853EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host);
2805 2854
2806/** 2855/**
2807 * ata_pci_sff_init_one - Initialize/register PCI IDE host controller 2856 * ata_pci_sff_init_one - Initialize/register PCI IDE host controller
@@ -2829,7 +2878,7 @@ int ata_pci_sff_activate_host(struct ata_host *host,
2829 * Zero on success, negative on errno-based value on error. 2878 * Zero on success, negative on errno-based value on error.
2830 */ 2879 */
2831int ata_pci_sff_init_one(struct pci_dev *pdev, 2880int ata_pci_sff_init_one(struct pci_dev *pdev,
2832 const struct ata_port_info * const * ppi, 2881 const struct ata_port_info * const *ppi,
2833 struct scsi_host_template *sht, void *host_priv) 2882 struct scsi_host_template *sht, void *host_priv)
2834{ 2883{
2835 struct device *dev = &pdev->dev; 2884 struct device *dev = &pdev->dev;
@@ -2868,7 +2917,7 @@ int ata_pci_sff_init_one(struct pci_dev *pdev,
2868 2917
2869 pci_set_master(pdev); 2918 pci_set_master(pdev);
2870 rc = ata_pci_sff_activate_host(host, ata_sff_interrupt, sht); 2919 rc = ata_pci_sff_activate_host(host, ata_sff_interrupt, sht);
2871 out: 2920out:
2872 if (rc == 0) 2921 if (rc == 0)
2873 devres_remove_group(&pdev->dev, NULL); 2922 devres_remove_group(&pdev->dev, NULL);
2874 else 2923 else
@@ -2876,54 +2925,7 @@ int ata_pci_sff_init_one(struct pci_dev *pdev,
2876 2925
2877 return rc; 2926 return rc;
2878} 2927}
2928EXPORT_SYMBOL_GPL(ata_pci_sff_init_one);
2879 2929
2880#endif /* CONFIG_PCI */ 2930#endif /* CONFIG_PCI */
2881 2931
2882EXPORT_SYMBOL_GPL(ata_sff_port_ops);
2883EXPORT_SYMBOL_GPL(ata_bmdma_port_ops);
2884EXPORT_SYMBOL_GPL(ata_sff_qc_prep);
2885EXPORT_SYMBOL_GPL(ata_sff_dumb_qc_prep);
2886EXPORT_SYMBOL_GPL(ata_sff_dev_select);
2887EXPORT_SYMBOL_GPL(ata_sff_check_status);
2888EXPORT_SYMBOL_GPL(ata_sff_dma_pause);
2889EXPORT_SYMBOL_GPL(ata_sff_pause);
2890EXPORT_SYMBOL_GPL(ata_sff_busy_sleep);
2891EXPORT_SYMBOL_GPL(ata_sff_wait_ready);
2892EXPORT_SYMBOL_GPL(ata_sff_tf_load);
2893EXPORT_SYMBOL_GPL(ata_sff_tf_read);
2894EXPORT_SYMBOL_GPL(ata_sff_exec_command);
2895EXPORT_SYMBOL_GPL(ata_sff_data_xfer);
2896EXPORT_SYMBOL_GPL(ata_sff_data_xfer_noirq);
2897EXPORT_SYMBOL_GPL(ata_sff_irq_on);
2898EXPORT_SYMBOL_GPL(ata_sff_irq_clear);
2899EXPORT_SYMBOL_GPL(ata_sff_hsm_move);
2900EXPORT_SYMBOL_GPL(ata_sff_qc_issue);
2901EXPORT_SYMBOL_GPL(ata_sff_qc_fill_rtf);
2902EXPORT_SYMBOL_GPL(ata_sff_host_intr);
2903EXPORT_SYMBOL_GPL(ata_sff_interrupt);
2904EXPORT_SYMBOL_GPL(ata_sff_freeze);
2905EXPORT_SYMBOL_GPL(ata_sff_thaw);
2906EXPORT_SYMBOL_GPL(ata_sff_prereset);
2907EXPORT_SYMBOL_GPL(ata_sff_dev_classify);
2908EXPORT_SYMBOL_GPL(ata_sff_wait_after_reset);
2909EXPORT_SYMBOL_GPL(ata_sff_softreset);
2910EXPORT_SYMBOL_GPL(sata_sff_hardreset);
2911EXPORT_SYMBOL_GPL(ata_sff_postreset);
2912EXPORT_SYMBOL_GPL(ata_sff_error_handler);
2913EXPORT_SYMBOL_GPL(ata_sff_post_internal_cmd);
2914EXPORT_SYMBOL_GPL(ata_sff_port_start);
2915EXPORT_SYMBOL_GPL(ata_sff_std_ports);
2916EXPORT_SYMBOL_GPL(ata_bmdma_mode_filter);
2917EXPORT_SYMBOL_GPL(ata_bmdma_setup);
2918EXPORT_SYMBOL_GPL(ata_bmdma_start);
2919EXPORT_SYMBOL_GPL(ata_bmdma_stop);
2920EXPORT_SYMBOL_GPL(ata_bmdma_status);
2921EXPORT_SYMBOL_GPL(ata_bus_reset);
2922#ifdef CONFIG_PCI
2923EXPORT_SYMBOL_GPL(ata_pci_bmdma_clear_simplex);
2924EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
2925EXPORT_SYMBOL_GPL(ata_pci_sff_init_host);
2926EXPORT_SYMBOL_GPL(ata_pci_sff_prepare_host);
2927EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host);
2928EXPORT_SYMBOL_GPL(ata_pci_sff_init_one);
2929#endif /* CONFIG_PCI */