libata: doc updates

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