libata: doc updates

+138 -70
+20 -20
Documentation/DocBook/libata.tmpl
··· 58 </para> 59 </chapter> 60 61 - <chapter id="libataThanks"> 62 - <title>Thanks</title> 63 - <para> 64 - The bulk of the ATA knowledge comes thanks to long conversations with 65 - Andre Hedrick (www.linux-ide.org), and long hours pondering the ATA 66 - and SCSI specifications. 67 - </para> 68 - <para> 69 - Thanks to Alan Cox for pointing out similarities 70 - between SATA and SCSI, and in general for motivation to hack on 71 - libata. 72 - </para> 73 - <para> 74 - libata's device detection 75 - method, ata_pio_devchk, and in general all the early probing was 76 - based on extensive study of Hale Landis's probe/reset code in his 77 - ATADRVR driver (www.ata-atapi.com). 78 - </para> 79 - </chapter> 80 - 81 <chapter id="libataDriverApi"> 82 <title>libata Driver API</title> 83 <sect1> ··· 292 <chapter id="SILInt"> 293 <title>sata_sil Internals</title> 294 !Idrivers/scsi/sata_sil.c 295 </chapter> 296 297 </book>
··· 58 </para> 59 </chapter> 60 61 <chapter id="libataDriverApi"> 62 <title>libata Driver API</title> 63 <sect1> ··· 312 <chapter id="SILInt"> 313 <title>sata_sil Internals</title> 314 !Idrivers/scsi/sata_sil.c 315 + </chapter> 316 + 317 + <chapter id="libataThanks"> 318 + <title>Thanks</title> 319 + <para> 320 + The bulk of the ATA knowledge comes thanks to long conversations with 321 + Andre Hedrick (www.linux-ide.org), and long hours pondering the ATA 322 + and SCSI specifications. 323 + </para> 324 + <para> 325 + Thanks to Alan Cox for pointing out similarities 326 + between SATA and SCSI, and in general for motivation to hack on 327 + libata. 328 + </para> 329 + <para> 330 + libata's device detection 331 + method, ata_pio_devchk, and in general all the early probing was 332 + based on extensive study of Hale Landis's probe/reset code in his 333 + ATADRVR driver (www.ata-atapi.com). 334 + </para> 335 </chapter> 336 337 </book>
-16
drivers/scsi/ata_piix.c
··· 663 return ata_pci_init_one(pdev, port_info, n_ports); 664 } 665 666 - /** 667 - * piix_init - 668 - * 669 - * LOCKING: 670 - * 671 - * RETURNS: 672 - * 673 - */ 674 - 675 static int __init piix_init(void) 676 { 677 int rc; ··· 677 DPRINTK("done\n"); 678 return 0; 679 } 680 - 681 - /** 682 - * piix_exit - 683 - * 684 - * LOCKING: 685 - * 686 - */ 687 688 static void __exit piix_exit(void) 689 {
··· 663 return ata_pci_init_one(pdev, port_info, n_ports); 664 } 665 666 static int __init piix_init(void) 667 { 668 int rc; ··· 686 DPRINTK("done\n"); 687 return 0; 688 } 689 690 static void __exit piix_exit(void) 691 {
+117 -33
drivers/scsi/libata-core.c
··· 1190 * ata_bus_probe - Reset and probe ATA bus 1191 * @ap: Bus to probe 1192 * 1193 * LOCKING: 1194 * 1195 * RETURNS: 1196 * Zero on success, non-zero on error. ··· 1234 } 1235 1236 /** 1237 - * ata_port_probe - 1238 - * @ap: 1239 * 1240 - * LOCKING: 1241 */ 1242 1243 void ata_port_probe(struct ata_port *ap) ··· 1257 * PHY registers, to wake up the phy (and device), and 1258 * clear any reset condition. 1259 * 1260 - * LOCKING: None. Serialized during ata_bus_probe(). 1261 * 1262 */ 1263 void __sata_phy_reset(struct ata_port *ap) ··· 1309 * This function resets the SATA bus, and then probes 1310 * the bus for devices. 1311 * 1312 - * LOCKING: None. Serialized during ata_bus_probe(). 1313 * 1314 */ 1315 void sata_phy_reset(struct ata_port *ap) ··· 1442 * 1443 * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). 1444 * 1445 - * LOCKING: None. Serialized during ata_bus_probe(). 1446 * 1447 */ 1448 static void ata_set_mode(struct ata_port *ap) ··· 1583 } 1584 1585 /** 1586 - * ata_bus_edd - 1587 - * @ap: 1588 * 1589 - * LOCKING: None. Serialized during ata_bus_probe(). 1590 * 1591 */ 1592 ··· 1667 * the device is ATA or ATAPI. 1668 * 1669 * LOCKING: 1670 - * Inherited from caller. Some functions called by this function 1671 - * obtain the host_set lock. 1672 * 1673 * SIDE EFFECTS: 1674 * Sets ATA_FLAG_PORT_DISABLED if bus reset fails. ··· 1910 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code 1911 * @xfer_shift_out: (output) bit shift that selects this mode 1912 * 1913 * LOCKING: 1914 * 1915 * RETURNS: 1916 * Zero on success, negative on error. ··· 1950 * Issue SET FEATURES - XFER MODE command to device @dev 1951 * on port @ap. 1952 * 1953 - * LOCKING: None. Serialized during ata_bus_probe(). 1954 */ 1955 1956 static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) ··· 1989 } 1990 1991 /** 1992 - * ata_sg_clean - 1993 - * @qc: 1994 * 1995 * LOCKING: 1996 */ 1997 1998 static void ata_sg_clean(struct ata_queued_cmd *qc) ··· 2082 * supplied PACKET command. 2083 * 2084 * LOCKING: 2085 * RETURNS: 0 when ATAPI DMA can be used 2086 * nonzero otherwise 2087 */ ··· 2114 ata_fill_sg(qc); 2115 } 2116 2117 void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) 2118 { 2119 struct scatterlist *sg; ··· 2144 sg->length = buflen; 2145 } 2146 2147 void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 2148 unsigned int n_elem) 2149 { ··· 2167 } 2168 2169 /** 2170 - * ata_sg_setup_one - 2171 - * @qc: 2172 * 2173 * LOCKING: 2174 * spin_lock_irqsave(host_set lock) 2175 * 2176 * RETURNS: 2177 - * 2178 */ 2179 2180 static int ata_sg_setup_one(struct ata_queued_cmd *qc) ··· 2201 } 2202 2203 /** 2204 - * ata_sg_setup - 2205 - * @qc: 2206 * 2207 * LOCKING: 2208 * spin_lock_irqsave(host_set lock) 2209 * 2210 * RETURNS: 2211 * 2212 */ 2213 ··· 2240 * @ap: 2241 * 2242 * LOCKING: 2243 * 2244 * RETURNS: 2245 * ··· 2288 * @ap: 2289 * 2290 * LOCKING: 2291 */ 2292 2293 static void ata_pio_complete (struct ata_port *ap) ··· 2506 * @ap: 2507 * 2508 * LOCKING: 2509 */ 2510 2511 static void ata_pio_block(struct ata_port *ap) ··· 2675 * transaction completed successfully. 2676 * 2677 * LOCKING: 2678 */ 2679 2680 static void ata_qc_timeout(struct ata_queued_cmd *qc) ··· 2785 * @dev: Device from whom we request an available command structure 2786 * 2787 * LOCKING: 2788 */ 2789 2790 static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) ··· 2811 * @dev: Device from whom we request an available command structure 2812 * 2813 * LOCKING: 2814 */ 2815 2816 struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, ··· 2876 * in case something prevents using it. 2877 * 2878 * LOCKING: 2879 * 2880 */ 2881 void ata_qc_free(struct ata_queued_cmd *qc) ··· 2890 /** 2891 * ata_qc_complete - Complete an active ATA command 2892 * @qc: Command to complete 2893 - * @drv_stat: ATA status register contents 2894 * 2895 * LOCKING: 2896 * 2897 */ 2898 ··· 3303 3304 /** 3305 * ata_interrupt - Default ATA host interrupt handler 3306 - * @irq: irq line 3307 - * @dev_instance: pointer to our host information structure 3308 * @regs: unused 3309 * 3310 * LOCKING: 3311 * 3312 * RETURNS: 3313 * 3314 */ 3315 ··· 3455 * @ent: Probe information provided by low-level driver 3456 * @port_no: Port number associated with this ata_port 3457 * 3458 * LOCKING: 3459 * 3460 */ 3461 ··· 3514 * @host_set: Collections of ports to which we add 3515 * @port_no: Port number associated with this host 3516 * 3517 * LOCKING: 3518 * 3519 * RETURNS: 3520 * 3521 */ 3522 ··· 3553 } 3554 3555 /** 3556 - * ata_device_add - 3557 - * @ent: 3558 * 3559 * LOCKING: 3560 * 3561 * RETURNS: 3562 * 3563 */ 3564 ··· 3847 * Inherited from PCI layer (may sleep). 3848 * 3849 * RETURNS: 3850 * 3851 */ 3852 ··· 4066 } 4067 #endif /* CONFIG_PCI */ 4068 4069 - 4070 - /** 4071 - * ata_init - 4072 - * 4073 - * LOCKING: 4074 - * 4075 - * RETURNS: 4076 - * 4077 - */ 4078 4079 static int __init ata_init(void) 4080 {
··· 1190 * ata_bus_probe - Reset and probe ATA bus 1191 * @ap: Bus to probe 1192 * 1193 + * Master ATA bus probing function. Initiates a hardware-dependent 1194 + * bus reset, then attempts to identify any devices found on 1195 + * the bus. 1196 + * 1197 * LOCKING: 1198 + * PCI/etc. bus probe sem. 1199 * 1200 * RETURNS: 1201 * Zero on success, non-zero on error. ··· 1229 } 1230 1231 /** 1232 + * ata_port_probe - Mark port as enabled 1233 + * @ap: Port for which we indicate enablement 1234 * 1235 + * Modify @ap data structure such that the system 1236 + * thinks that the entire port is enabled. 1237 + * 1238 + * LOCKING: host_set lock, or some other form of 1239 + * serialization. 1240 */ 1241 1242 void ata_port_probe(struct ata_port *ap) ··· 1248 * PHY registers, to wake up the phy (and device), and 1249 * clear any reset condition. 1250 * 1251 + * LOCKING: 1252 + * PCI/etc. bus probe sem. 1253 * 1254 */ 1255 void __sata_phy_reset(struct ata_port *ap) ··· 1299 * This function resets the SATA bus, and then probes 1300 * the bus for devices. 1301 * 1302 + * LOCKING: 1303 + * PCI/etc. bus probe sem. 1304 * 1305 */ 1306 void sata_phy_reset(struct ata_port *ap) ··· 1431 * 1432 * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). 1433 * 1434 + * LOCKING: 1435 + * PCI/etc. bus probe sem. 1436 * 1437 */ 1438 static void ata_set_mode(struct ata_port *ap) ··· 1571 } 1572 1573 /** 1574 + * ata_bus_edd - Issue EXECUTE DEVICE DIAGNOSTIC command. 1575 + * @ap: Port to reset and probe 1576 * 1577 + * Use the EXECUTE DEVICE DIAGNOSTIC command to reset and 1578 + * probe the bus. Not often used these days. 1579 + * 1580 + * LOCKING: 1581 + * PCI/etc. bus probe sem. 1582 * 1583 */ 1584 ··· 1651 * the device is ATA or ATAPI. 1652 * 1653 * LOCKING: 1654 + * PCI/etc. bus probe sem. 1655 + * Obtains host_set lock. 1656 * 1657 * SIDE EFFECTS: 1658 * Sets ATA_FLAG_PORT_DISABLED if bus reset fails. ··· 1894 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code 1895 * @xfer_shift_out: (output) bit shift that selects this mode 1896 * 1897 + * Based on host and device capabilities, determine the 1898 + * maximum transfer mode that is amenable to all. 1899 + * 1900 * LOCKING: 1901 + * PCI/etc. bus probe sem. 1902 * 1903 * RETURNS: 1904 * Zero on success, negative on error. ··· 1930 * Issue SET FEATURES - XFER MODE command to device @dev 1931 * on port @ap. 1932 * 1933 + * LOCKING: 1934 + * PCI/etc. bus probe sem. 1935 */ 1936 1937 static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) ··· 1968 } 1969 1970 /** 1971 + * ata_sg_clean - Unmap DMA memory associated with command 1972 + * @qc: Command containing DMA memory to be released 1973 + * 1974 + * Unmap all mapped DMA memory associated with this command. 1975 * 1976 * LOCKING: 1977 + * spin_lock_irqsave(host_set lock) 1978 */ 1979 1980 static void ata_sg_clean(struct ata_queued_cmd *qc) ··· 2058 * supplied PACKET command. 2059 * 2060 * LOCKING: 2061 + * spin_lock_irqsave(host_set lock) 2062 + * 2063 * RETURNS: 0 when ATAPI DMA can be used 2064 * nonzero otherwise 2065 */ ··· 2088 ata_fill_sg(qc); 2089 } 2090 2091 + /** 2092 + * ata_sg_init_one - Associate command with memory buffer 2093 + * @qc: Command to be associated 2094 + * @buf: Memory buffer 2095 + * @buflen: Length of memory buffer, in bytes. 2096 + * 2097 + * Initialize the data-related elements of queued_cmd @qc 2098 + * to point to a single memory buffer, @buf of byte length @buflen. 2099 + * 2100 + * LOCKING: 2101 + * spin_lock_irqsave(host_set lock) 2102 + */ 2103 + 2104 void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) 2105 { 2106 struct scatterlist *sg; ··· 2105 sg->length = buflen; 2106 } 2107 2108 + /** 2109 + * ata_sg_init - Associate command with scatter-gather table. 2110 + * @qc: Command to be associated 2111 + * @sg: Scatter-gather table. 2112 + * @n_elem: Number of elements in s/g table. 2113 + * 2114 + * Initialize the data-related elements of queued_cmd @qc 2115 + * to point to a scatter-gather table @sg, containing @n_elem 2116 + * elements. 2117 + * 2118 + * LOCKING: 2119 + * spin_lock_irqsave(host_set lock) 2120 + */ 2121 + 2122 void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 2123 unsigned int n_elem) 2124 { ··· 2114 } 2115 2116 /** 2117 + * ata_sg_setup_one - DMA-map the memory buffer associated with a command. 2118 + * @qc: Command with memory buffer to be mapped. 2119 + * 2120 + * DMA-map the memory buffer associated with queued_cmd @qc. 2121 * 2122 * LOCKING: 2123 * spin_lock_irqsave(host_set lock) 2124 * 2125 * RETURNS: 2126 + * Zero on success, negative on error. 2127 */ 2128 2129 static int ata_sg_setup_one(struct ata_queued_cmd *qc) ··· 2146 } 2147 2148 /** 2149 + * ata_sg_setup - DMA-map the scatter-gather table associated with a command. 2150 + * @qc: Command with scatter-gather table to be mapped. 2151 + * 2152 + * DMA-map the scatter-gather table associated with queued_cmd @qc. 2153 * 2154 * LOCKING: 2155 * spin_lock_irqsave(host_set lock) 2156 * 2157 * RETURNS: 2158 + * Zero on success, negative on error. 2159 * 2160 */ 2161 ··· 2182 * @ap: 2183 * 2184 * LOCKING: 2185 + * None. (executing in kernel thread context) 2186 * 2187 * RETURNS: 2188 * ··· 2229 * @ap: 2230 * 2231 * LOCKING: 2232 + * None. (executing in kernel thread context) 2233 */ 2234 2235 static void ata_pio_complete (struct ata_port *ap) ··· 2446 * @ap: 2447 * 2448 * LOCKING: 2449 + * None. (executing in kernel thread context) 2450 */ 2451 2452 static void ata_pio_block(struct ata_port *ap) ··· 2614 * transaction completed successfully. 2615 * 2616 * LOCKING: 2617 + * Inherited from SCSI layer (none, can sleep) 2618 */ 2619 2620 static void ata_qc_timeout(struct ata_queued_cmd *qc) ··· 2723 * @dev: Device from whom we request an available command structure 2724 * 2725 * LOCKING: 2726 + * None. 2727 */ 2728 2729 static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) ··· 2748 * @dev: Device from whom we request an available command structure 2749 * 2750 * LOCKING: 2751 + * None. 2752 */ 2753 2754 struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, ··· 2812 * in case something prevents using it. 2813 * 2814 * LOCKING: 2815 + * spin_lock_irqsave(host_set lock) 2816 * 2817 */ 2818 void ata_qc_free(struct ata_queued_cmd *qc) ··· 2825 /** 2826 * ata_qc_complete - Complete an active ATA command 2827 * @qc: Command to complete 2828 + * @drv_stat: ATA Status register contents 2829 + * 2830 + * Indicate to the mid and upper layers that an ATA 2831 + * command has completed, with either an ok or not-ok status. 2832 * 2833 * LOCKING: 2834 + * spin_lock_irqsave(host_set lock) 2835 * 2836 */ 2837 ··· 3234 3235 /** 3236 * ata_interrupt - Default ATA host interrupt handler 3237 + * @irq: irq line (unused) 3238 + * @dev_instance: pointer to our ata_host_set information structure 3239 * @regs: unused 3240 * 3241 + * Default interrupt handler for PCI IDE devices. Calls 3242 + * ata_host_intr() for each port that is not disabled. 3243 + * 3244 * LOCKING: 3245 + * Obtains host_set lock during operation. 3246 * 3247 * RETURNS: 3248 + * IRQ_NONE or IRQ_HANDLED. 3249 * 3250 */ 3251 ··· 3381 * @ent: Probe information provided by low-level driver 3382 * @port_no: Port number associated with this ata_port 3383 * 3384 + * Initialize a new ata_port structure, and its associated 3385 + * scsi_host. 3386 + * 3387 * LOCKING: 3388 + * Inherited from caller. 3389 * 3390 */ 3391 ··· 3436 * @host_set: Collections of ports to which we add 3437 * @port_no: Port number associated with this host 3438 * 3439 + * Attach low-level ATA driver to system. 3440 + * 3441 * LOCKING: 3442 + * PCI/etc. bus probe sem. 3443 * 3444 * RETURNS: 3445 + * New ata_port on success, for NULL on error. 3446 * 3447 */ 3448 ··· 3471 } 3472 3473 /** 3474 + * ata_device_add - Register hardware device with ATA and SCSI layers 3475 + * @ent: Probe information describing hardware device to be registered 3476 + * 3477 + * This function processes the information provided in the probe 3478 + * information struct @ent, allocates the necessary ATA and SCSI 3479 + * host information structures, initializes them, and registers 3480 + * everything with requisite kernel subsystems. 3481 + * 3482 + * This function requests irqs, probes the ATA bus, and probes 3483 + * the SCSI bus. 3484 * 3485 * LOCKING: 3486 + * PCI/etc. bus probe sem. 3487 * 3488 * RETURNS: 3489 + * Number of ports registered. Zero on error (no ports registered). 3490 * 3491 */ 3492 ··· 3755 * Inherited from PCI layer (may sleep). 3756 * 3757 * RETURNS: 3758 + * Zero on success, negative on errno-based value on error. 3759 * 3760 */ 3761 ··· 3973 } 3974 #endif /* CONFIG_PCI */ 3975 3976 3977 static int __init ata_init(void) 3978 {
+1 -1
drivers/scsi/libata-scsi.c
··· 947 } 948 949 /** 950 - * ata_scsiop_noop - 951 * @args: device IDENTIFY data / SCSI command of interest. 952 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent. 953 * @buflen: Response buffer length.
··· 947 } 948 949 /** 950 + * ata_scsiop_noop - Command handler that simply returns success. 951 * @args: device IDENTIFY data / SCSI command of interest. 952 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent. 953 * @buflen: Response buffer length.