Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] Add Documentation and integrate into docbook build

Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update
lots of kerneldoc comments in drivers/scsi/*.

Updated with comments from Stefan Richter, Stephen M. Cameron,
James Bottomley and Randy Dunlap.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

Rob Landley and committed by
James Bottomley
eb44820c 3f489858

+821 -289
+1 -1
Documentation/DocBook/Makefile
··· 11 11 procfs-guide.xml writing_usb_driver.xml \ 12 12 kernel-api.xml filesystems.xml lsm.xml usb.xml \ 13 13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ 14 - genericirq.xml s390-drivers.xml uio-howto.xml 14 + genericirq.xml s390-drivers.xml uio-howto.xml scsi_midlayer.xml 15 15 16 16 ### 17 17 # The build process is as follows (targets):
+409
Documentation/DocBook/scsi_midlayer.tmpl
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 3 + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> 4 + 5 + <book id="scsimid"> 6 + <bookinfo> 7 + <title>SCSI Mid Layer Guide</title> 8 + 9 + <authorgroup> 10 + <author> 11 + <firstname>James</firstname> 12 + <surname>Bottomley</surname> 13 + <affiliation> 14 + <address> 15 + <email>James.Bottomley@steeleye.com</email> 16 + </address> 17 + </affiliation> 18 + </author> 19 + 20 + <author> 21 + <firstname>Rob</firstname> 22 + <surname>Landley</surname> 23 + <affiliation> 24 + <address> 25 + <email>rob@landley.net</email> 26 + </address> 27 + </affiliation> 28 + </author> 29 + 30 + </authorgroup> 31 + 32 + <copyright> 33 + <year>2007</year> 34 + <holder>Linux Foundation</holder> 35 + </copyright> 36 + 37 + <legalnotice> 38 + <para> 39 + This documentation is free software; you can redistribute 40 + it and/or modify it under the terms of the GNU General Public 41 + License version 2. 42 + </para> 43 + 44 + <para> 45 + This program is distributed in the hope that it will be 46 + useful, but WITHOUT ANY WARRANTY; without even the implied 47 + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 48 + For more details see the file COPYING in the source 49 + distribution of Linux. 50 + </para> 51 + </legalnotice> 52 + </bookinfo> 53 + 54 + <toc></toc> 55 + 56 + <chapter id="intro"> 57 + <title>Introduction</title> 58 + <sect1 id="protocol_vs_bus"> 59 + <title>Protocol vs bus</title> 60 + <para> 61 + Once upon a time, the Small Computer Systems Interface defined both 62 + a parallel I/O bus and a data protocol to connect a wide variety of 63 + peripherals (disk drives, tape drives, modems, printers, scanners, 64 + optical drives, test equipment, and medical devices) to a host 65 + computer. 66 + </para> 67 + <para> 68 + Although the old parallel (fast/wide/ultra) SCSI bus has largely 69 + fallen out of use, the SCSI command set is more widely used than ever 70 + to communicate with devices over a number of different busses. 71 + </para> 72 + <para> 73 + The <ulink url='http://www.t10.org/scsi-3.htm'>SCSI protocol</ulink> 74 + is a big-endian peer-to-peer packet based protocol. SCSI commands 75 + are 6, 10, 12, or 16 bytes long, often followed by an associated data 76 + payload. 77 + </para> 78 + <para> 79 + SCSI commands can be transported over just about any kind of bus, and 80 + are the default protocol for storage devices attached to USB, SATA, 81 + SAS, Fibre Channel, FireWire, and ATAPI devices. SCSI packets are 82 + also commonly exchanged over Infiniband, 83 + <ulink url='http://i2o.shadowconnect.com/faq.php'>I20</ulink>, TCP/IP 84 + (<ulink url='http://en.wikipedia.org/wiki/ISCSI'>iSCSI</ulink>), even 85 + <ulink url='http://cyberelk.net/tim/parport/parscsi.html'>Parallel 86 + ports</ulink>. 87 + </para> 88 + </sect1> 89 + <sect1 id="subsystem_design"> 90 + <title>Design of the Linux SCSI subsystem</title> 91 + <para> 92 + The SCSI subsystem uses a three layer design, with upper, mid, and low 93 + layers. Every operation involving the SCSI subsystem (such as reading 94 + a sector from a disk) uses one driver at each of the 3 levels: one 95 + upper layer driver, one lower layer driver, and the scsi midlayer. 96 + </para> 97 + <para> 98 + The SCSI upper layer provides the interface between userspace and the 99 + kernel, in the form of block and char device nodes for I/O and 100 + ioctl(). The SCSI lower layer contains drivers for specific hardware 101 + devices. 102 + </para> 103 + <para> 104 + In between is the SCSI mid-layer, analogous to a network routing 105 + layer such as the IPv4 stack. The SCSI mid-layer routes a packet 106 + based data protocol between the upper layer's /dev nodes and the 107 + corresponding devices in the lower layer. It manages command queues, 108 + provides error handling and power management functions, and responds 109 + to ioctl() requests. 110 + </para> 111 + </sect1> 112 + </chapter> 113 + 114 + <chapter id="upper_layer"> 115 + <title>SCSI upper layer</title> 116 + <para> 117 + The upper layer supports the user-kernel interface by providing 118 + device nodes. 119 + </para> 120 + <sect1 id="sd"> 121 + <title>sd (SCSI Disk)</title> 122 + <para>sd (sd_mod.o)</para> 123 + <!-- !Idrivers/scsi/sd.c --> 124 + </sect1> 125 + <sect1 id="sr"> 126 + <title>sr (SCSI CD-ROM)</title> 127 + <para>sr (sr_mod.o)</para> 128 + </sect1> 129 + <sect1 id="st"> 130 + <title>st (SCSI Tape)</title> 131 + <para>st (st.o)</para> 132 + </sect1> 133 + <sect1 id="sg"> 134 + <title>sg (SCSI Generic)</title> 135 + <para>sg (sg.o)</para> 136 + </sect1> 137 + <sect1 id="ch"> 138 + <title>ch (SCSI Media Changer)</title> 139 + <para>ch (ch.c)</para> 140 + </sect1> 141 + </chapter> 142 + 143 + <chapter id="mid_layer"> 144 + <title>SCSI mid layer</title> 145 + 146 + <sect1 id="midlayer_implementation"> 147 + <title>SCSI midlayer implementation</title> 148 + <sect2 id="scsi_device.h"> 149 + <title>include/scsi/scsi_device.h</title> 150 + <para> 151 + </para> 152 + !Iinclude/scsi/scsi_device.h 153 + </sect2> 154 + 155 + <sect2 id="scsi.c"> 156 + <title>drivers/scsi/scsi.c</title> 157 + <para>Main file for the scsi midlayer.</para> 158 + !Edrivers/scsi/scsi.c 159 + </sect2> 160 + <sect2 id="scsicam.c"> 161 + <title>drivers/scsi/scsicam.c</title> 162 + <para> 163 + <ulink url='http://www.t10.org/ftp/t10/drafts/cam/cam-r12b.pdf'>SCSI 164 + Common Access Method</ulink> support functions, for use with 165 + HDIO_GETGEO, etc. 166 + </para> 167 + !Edrivers/scsi/scsicam.c 168 + </sect2> 169 + <sect2 id="scsi_error.c"> 170 + <title>drivers/scsi/scsi_error.c</title> 171 + <para>Common SCSI error/timeout handling routines.</para> 172 + !Edrivers/scsi/scsi_error.c 173 + </sect2> 174 + <sect2 id="scsi_devinfo.c"> 175 + <title>drivers/scsi/scsi_devinfo.c</title> 176 + <para> 177 + Manage scsi_dev_info_list, which tracks blacklisted and whitelisted 178 + devices. 179 + </para> 180 + !Idrivers/scsi/scsi_devinfo.c 181 + </sect2> 182 + <sect2 id="scsi_ioctl.c"> 183 + <title>drivers/scsi/scsi_ioctl.c</title> 184 + <para> 185 + Handle ioctl() calls for scsi devices. 186 + </para> 187 + !Edrivers/scsi/scsi_ioctl.c 188 + </sect2> 189 + <sect2 id="scsi_lib.c"> 190 + <title>drivers/scsi/scsi_lib.c</title> 191 + <para> 192 + SCSI queuing library. 193 + </para> 194 + !Edrivers/scsi/scsi_lib.c 195 + </sect2> 196 + <sect2 id="scsi_lib_dma.c"> 197 + <title>drivers/scsi/scsi_lib_dma.c</title> 198 + <para> 199 + SCSI library functions depending on DMA 200 + (map and unmap scatter-gather lists). 201 + </para> 202 + !Edrivers/scsi/scsi_lib_dma.c 203 + </sect2> 204 + <sect2 id="scsi_module.c"> 205 + <title>drivers/scsi/scsi_module.c</title> 206 + <para> 207 + The file drivers/scsi/scsi_module.c contains legacy support for 208 + old-style host templates. It should never be used by any new driver. 209 + </para> 210 + </sect2> 211 + <sect2 id="scsi_proc.c"> 212 + <title>drivers/scsi/scsi_proc.c</title> 213 + <para> 214 + The functions in this file provide an interface between 215 + the PROC file system and the SCSI device drivers 216 + It is mainly used for debugging, statistics and to pass 217 + information directly to the lowlevel driver. 218 + 219 + I.E. plumbing to manage /proc/scsi/* 220 + </para> 221 + !Idrivers/scsi/scsi_proc.c 222 + </sect2> 223 + <sect2 id="scsi_netlink.c"> 224 + <title>drivers/scsi/scsi_netlink.c</title> 225 + <para> 226 + Infrastructure to provide async events from transports to userspace 227 + via netlink, using a single NETLINK_SCSITRANSPORT protocol for all 228 + transports. 229 + 230 + See <ulink url='http://marc.info/?l=linux-scsi&amp;m=115507374832500&amp;w=2'>the 231 + original patch submission</ulink> for more details. 232 + </para> 233 + !Idrivers/scsi/scsi_netlink.c 234 + </sect2> 235 + <sect2 id="scsi_scan.c"> 236 + <title>drivers/scsi/scsi_scan.c</title> 237 + <para> 238 + Scan a host to determine which (if any) devices are attached. 239 + 240 + The general scanning/probing algorithm is as follows, exceptions are 241 + made to it depending on device specific flags, compilation options, 242 + and global variable (boot or module load time) settings. 243 + 244 + A specific LUN is scanned via an INQUIRY command; if the LUN has a 245 + device attached, a scsi_device is allocated and setup for it. 246 + 247 + For every id of every channel on the given host, start by scanning 248 + LUN 0. Skip hosts that don't respond at all to a scan of LUN 0. 249 + Otherwise, if LUN 0 has a device attached, allocate and setup a 250 + scsi_device for it. If target is SCSI-3 or up, issue a REPORT LUN, 251 + and scan all of the LUNs returned by the REPORT LUN; else, 252 + sequentially scan LUNs up until some maximum is reached, or a LUN is 253 + seen that cannot have a device attached to it. 254 + </para> 255 + !Idrivers/scsi/scsi_scan.c 256 + </sect2> 257 + <sect2 id="scsi_sysctl.c"> 258 + <title>drivers/scsi/scsi_sysctl.c</title> 259 + <para> 260 + Set up the sysctl entry: "/dev/scsi/logging_level" 261 + (DEV_SCSI_LOGGING_LEVEL) which sets/returns scsi_logging_level. 262 + </para> 263 + </sect2> 264 + <sect2 id="scsi_sysfs.c"> 265 + <title>drivers/scsi/scsi_sysfs.c</title> 266 + <para> 267 + SCSI sysfs interface routines. 268 + </para> 269 + !Edrivers/scsi/scsi_sysfs.c 270 + </sect2> 271 + <sect2 id="hosts.c"> 272 + <title>drivers/scsi/hosts.c</title> 273 + <para> 274 + mid to lowlevel SCSI driver interface 275 + </para> 276 + !Edrivers/scsi/hosts.c 277 + </sect2> 278 + <sect2 id="constants.c"> 279 + <title>drivers/scsi/constants.c</title> 280 + <para> 281 + mid to lowlevel SCSI driver interface 282 + </para> 283 + !Edrivers/scsi/constants.c 284 + </sect2> 285 + </sect1> 286 + 287 + <sect1 id="Transport_classes"> 288 + <title>Transport classes</title> 289 + <para> 290 + Transport classes are service libraries for drivers in the scsi 291 + lower layer, which expose transport attributes in sysfs. 292 + </para> 293 + <sect2 id="Fibre_Channel_transport"> 294 + <title>Fibre Channel transport</title> 295 + <para> 296 + The file drivers/scsi/scsi_transport_fc.c defines transport attributes 297 + for Fibre Channel. 298 + </para> 299 + !Edrivers/scsi/scsi_transport_fc.c 300 + </sect2> 301 + <sect2 id="iSCSI_transport"> 302 + <title>iSCSI transport class</title> 303 + <para> 304 + The file drivers/scsi/scsi_transport_iscsi.c defines transport 305 + attributes for the iSCSI class, which sends SCSI packets over TCP/IP 306 + connections. 307 + </para> 308 + !Edrivers/scsi/scsi_transport_iscsi.c 309 + </sect2> 310 + <sect2 id="SAS_transport"> 311 + <title>Serial Attached SCSI (SAS) transport class</title> 312 + <para> 313 + The file drivers/scsi/scsi_transport_sas.c defines transport 314 + attributes for Serial Attached SCSI, a variant of SATA aimed at 315 + large high-end systems. 316 + </para> 317 + <para> 318 + The SAS transport class contains common code to deal with SAS HBAs, 319 + an aproximated representation of SAS topologies in the driver model, 320 + and various sysfs attributes to expose these topologies and managment 321 + interfaces to userspace. 322 + </para> 323 + <para> 324 + In addition to the basic SCSI core objects this transport class 325 + introduces two additional intermediate objects: The SAS PHY 326 + as represented by struct sas_phy defines an "outgoing" PHY on 327 + a SAS HBA or Expander, and the SAS remote PHY represented by 328 + struct sas_rphy defines an "incoming" PHY on a SAS Expander or 329 + end device. Note that this is purely a software concept, the 330 + underlying hardware for a PHY and a remote PHY is the exactly 331 + the same. 332 + </para> 333 + <para> 334 + There is no concept of a SAS port in this code, users can see 335 + what PHYs form a wide port based on the port_identifier attribute, 336 + which is the same for all PHYs in a port. 337 + </para> 338 + !Edrivers/scsi/scsi_transport_sas.c 339 + </sect2> 340 + <sect2 id="SATA_transport"> 341 + <title>SATA transport class</title> 342 + <para> 343 + The SATA transport is handled by libata, which has its own book of 344 + documentation in this directory. 345 + </para> 346 + </sect2> 347 + <sect2 id="SPI_transport"> 348 + <title>Parallel SCSI (SPI) transport class</title> 349 + <para> 350 + The file drivers/scsi/scsi_transport_spi.c defines transport 351 + attributes for traditional (fast/wide/ultra) SCSI busses. 352 + </para> 353 + !Edrivers/scsi/scsi_transport_spi.c 354 + </sect2> 355 + <sect2 id="SRP_transport"> 356 + <title>SCSI RDMA (SRP) transport class</title> 357 + <para> 358 + The file drivers/scsi/scsi_transport_srp.c defines transport 359 + attributes for SCSI over Remote Direct Memory Access. 360 + </para> 361 + !Edrivers/scsi/scsi_transport_srp.c 362 + </sect2> 363 + </sect1> 364 + 365 + </chapter> 366 + 367 + <chapter id="lower_layer"> 368 + <title>SCSI lower layer</title> 369 + <sect1 id="hba_drivers"> 370 + <title>Host Bus Adapter transport types</title> 371 + <para> 372 + Many modern device controllers use the SCSI command set as a protocol to 373 + communicate with their devices through many different types of physical 374 + connections. 375 + </para> 376 + <para> 377 + In SCSI language a bus capable of carrying SCSI commands is 378 + called a "transport", and a controller connecting to such a bus is 379 + called a "host bus adapter" (HBA). 380 + </para> 381 + <sect2 id="scsi_debug.c"> 382 + <title>Debug transport</title> 383 + <para> 384 + The file drivers/scsi/scsi_debug.c simulates a host adapter with a 385 + variable number of disks (or disk like devices) attached, sharing a 386 + common amount of RAM. Does a lot of checking to make sure that we are 387 + not getting blocks mixed up, and panics the kernel if anything out of 388 + the ordinary is seen. 389 + </para> 390 + <para> 391 + To be more realistic, the simulated devices have the transport 392 + attributes of SAS disks. 393 + </para> 394 + <para> 395 + For documentation see 396 + <ulink url='http://www.torque.net/sg/sdebug26.html'>http://www.torque.net/sg/sdebug26.html</ulink> 397 + </para> 398 + <!-- !Edrivers/scsi/scsi_debug.c --> 399 + </sect2> 400 + <sect2 id="todo"> 401 + <title>todo</title> 402 + <para>Parallel (fast/wide/ultra) SCSI, USB, SATA, 403 + SAS, Fibre Channel, FireWire, ATAPI devices, Infiniband, 404 + I20, iSCSI, Parallel ports, netlink... 405 + </para> 406 + </sect2> 407 + </sect1> 408 + </chapter> 409 + </book>
-1
drivers/scsi/constants.c
··· 362 362 EXPORT_SYMBOL(scsi_print_command); 363 363 364 364 /** 365 - * 366 365 * scsi_print_status - print scsi status description 367 366 * @scsi_status: scsi status value 368 367 *
+1 -3
drivers/scsi/hosts.c
··· 54 54 }; 55 55 56 56 /** 57 - * scsi_host_set_state - Take the given host through the host 58 - * state model. 57 + * scsi_host_set_state - Take the given host through the host state model. 59 58 * @shost: scsi host to change the state of. 60 59 * @state: state to change to. 61 60 * ··· 430 431 431 432 /** 432 433 * scsi_host_lookup - get a reference to a Scsi_Host by host no 433 - * 434 434 * @hostnum: host number to locate 435 435 * 436 436 * Return value:
+96 -87
drivers/scsi/scsi.c
··· 122 122 "Automation/Drive ", 123 123 }; 124 124 125 + /** 126 + * scsi_device_type - Return 17 char string indicating device type. 127 + * @type: type number to look up 128 + */ 129 + 125 130 const char * scsi_device_type(unsigned type) 126 131 { 127 132 if (type == 0x1e) ··· 161 156 162 157 static DEFINE_MUTEX(host_cmd_pool_mutex); 163 158 159 + /** 160 + * __scsi_get_command - Allocate a struct scsi_cmnd 161 + * @shost: host to transmit command 162 + * @gfp_mask: allocation mask 163 + * 164 + * Description: allocate a struct scsi_cmd from host's slab, recycling from the 165 + * host's free_list if necessary. 166 + */ 164 167 struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask) 165 168 { 166 169 struct scsi_cmnd *cmd; ··· 192 179 } 193 180 EXPORT_SYMBOL_GPL(__scsi_get_command); 194 181 195 - /* 196 - * Function: scsi_get_command() 197 - * 198 - * Purpose: Allocate and setup a scsi command block 199 - * 200 - * Arguments: dev - parent scsi device 201 - * gfp_mask- allocator flags 182 + /** 183 + * scsi_get_command - Allocate and setup a scsi command block 184 + * @dev: parent scsi device 185 + * @gfp_mask: allocator flags 202 186 * 203 187 * Returns: The allocated scsi command structure. 204 188 */ ··· 227 217 } 228 218 EXPORT_SYMBOL(scsi_get_command); 229 219 220 + /** 221 + * __scsi_put_command - Free a struct scsi_cmnd 222 + * @shost: dev->host 223 + * @cmd: Command to free 224 + * @dev: parent scsi device 225 + */ 230 226 void __scsi_put_command(struct Scsi_Host *shost, struct scsi_cmnd *cmd, 231 227 struct device *dev) 232 228 { ··· 253 237 } 254 238 EXPORT_SYMBOL(__scsi_put_command); 255 239 256 - /* 257 - * Function: scsi_put_command() 258 - * 259 - * Purpose: Free a scsi command block 260 - * 261 - * Arguments: cmd - command block to free 240 + /** 241 + * scsi_put_command - Free a scsi command block 242 + * @cmd: command block to free 262 243 * 263 244 * Returns: Nothing. 264 245 * ··· 276 263 } 277 264 EXPORT_SYMBOL(scsi_put_command); 278 265 279 - /* 280 - * Function: scsi_setup_command_freelist() 266 + /** 267 + * scsi_setup_command_freelist - Setup the command freelist for a scsi host. 268 + * @shost: host to allocate the freelist for. 281 269 * 282 - * Purpose: Setup the command freelist for a scsi host. 283 - * 284 - * Arguments: shost - host to allocate the freelist for. 270 + * Description: The command freelist protects against system-wide out of memory 271 + * deadlock by preallocating one SCSI command structure for each host, so the 272 + * system can always write to a swap file on a device associated with that host. 285 273 * 286 274 * Returns: Nothing. 287 275 */ ··· 296 282 297 283 /* 298 284 * Select a command slab for this host and create it if not 299 - * yet existant. 285 + * yet existent. 300 286 */ 301 287 mutex_lock(&host_cmd_pool_mutex); 302 288 pool = (shost->unchecked_isa_dma ? &scsi_cmd_dma_pool : &scsi_cmd_pool); ··· 332 318 333 319 } 334 320 335 - /* 336 - * Function: scsi_destroy_command_freelist() 337 - * 338 - * Purpose: Release the command freelist for a scsi host. 339 - * 340 - * Arguments: shost - host that's freelist is going to be destroyed 321 + /** 322 + * scsi_destroy_command_freelist - Release the command freelist for a scsi host. 323 + * @shost: host whose freelist is going to be destroyed 341 324 */ 342 325 void scsi_destroy_command_freelist(struct Scsi_Host *shost) 343 326 { ··· 452 441 } 453 442 #endif 454 443 455 - /* 456 - * Assign a serial number to the request for error recovery 444 + /** 445 + * scsi_cmd_get_serial - Assign a serial number to a command 446 + * @host: the scsi host 447 + * @cmd: command to assign serial number to 448 + * 449 + * Description: a serial number identifies a request for error recovery 457 450 * and debugging purposes. Protected by the Host_Lock of host. 458 451 */ 459 452 static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) ··· 467 452 cmd->serial_number = host->cmd_serial_number++; 468 453 } 469 454 470 - /* 471 - * Function: scsi_dispatch_command 455 + /** 456 + * scsi_dispatch_command - Dispatch a command to the low-level driver. 457 + * @cmd: command block we are dispatching. 472 458 * 473 - * Purpose: Dispatch a command to the low-level driver. 474 - * 475 - * Arguments: cmd - command block we are dispatching. 476 - * 477 - * Notes: 459 + * Return: nonzero return request was rejected and device's queue needs to be 460 + * plugged. 478 461 */ 479 462 int scsi_dispatch_cmd(struct scsi_cmnd *cmd) 480 463 { ··· 598 585 599 586 /** 600 587 * scsi_req_abort_cmd -- Request command recovery for the specified command 601 - * cmd: pointer to the SCSI command of interest 588 + * @cmd: pointer to the SCSI command of interest 602 589 * 603 590 * This function requests that SCSI Core start recovery for the 604 591 * command by deleting the timer and adding the command to the eh ··· 619 606 * @cmd: The SCSI Command for which a low-level device driver (LLDD) gives 620 607 * ownership back to SCSI Core -- i.e. the LLDD has finished with it. 621 608 * 622 - * This function is the mid-level's (SCSI Core) interrupt routine, which 623 - * regains ownership of the SCSI command (de facto) from a LLDD, and enqueues 624 - * the command to the done queue for further processing. 609 + * Description: This function is the mid-level's (SCSI Core) interrupt routine, 610 + * which regains ownership of the SCSI command (de facto) from a LLDD, and 611 + * enqueues the command to the done queue for further processing. 625 612 * 626 613 * This is the producer of the done queue who enqueues at the tail. 627 614 * ··· 630 617 static void scsi_done(struct scsi_cmnd *cmd) 631 618 { 632 619 /* 633 - * We don't have to worry about this one timing out any more. 620 + * We don't have to worry about this one timing out anymore. 634 621 * If we are unable to remove the timer, then the command 635 622 * has already timed out. In which case, we have no choice but to 636 623 * let the timeout function run, as we have no idea where in fact ··· 673 660 return *(struct scsi_driver **)cmd->request->rq_disk->private_data; 674 661 } 675 662 676 - /* 677 - * Function: scsi_finish_command 663 + /** 664 + * scsi_finish_command - cleanup and pass command back to upper layer 665 + * @cmd: the command 678 666 * 679 - * Purpose: Pass command off to upper layer for finishing of I/O 667 + * Description: Pass command off to upper layer for finishing of I/O 680 668 * request, waking processes that are waiting on results, 681 669 * etc. 682 670 */ ··· 722 708 } 723 709 EXPORT_SYMBOL(scsi_finish_command); 724 710 725 - /* 726 - * Function: scsi_adjust_queue_depth() 727 - * 728 - * Purpose: Allow low level drivers to tell us to change the queue depth 729 - * on a specific SCSI device 730 - * 731 - * Arguments: sdev - SCSI Device in question 732 - * tagged - Do we use tagged queueing (non-0) or do we treat 733 - * this device as an untagged device (0) 734 - * tags - Number of tags allowed if tagged queueing enabled, 735 - * or number of commands the low level driver can 736 - * queue up in non-tagged mode (as per cmd_per_lun). 711 + /** 712 + * scsi_adjust_queue_depth - Let low level drivers change a device's queue depth 713 + * @sdev: SCSI Device in question 714 + * @tagged: Do we use tagged queueing (non-0) or do we treat 715 + * this device as an untagged device (0) 716 + * @tags: Number of tags allowed if tagged queueing enabled, 717 + * or number of commands the low level driver can 718 + * queue up in non-tagged mode (as per cmd_per_lun). 737 719 * 738 720 * Returns: Nothing 739 721 * ··· 752 742 753 743 spin_lock_irqsave(sdev->request_queue->queue_lock, flags); 754 744 755 - /* Check to see if the queue is managed by the block layer 756 - * if it is, and we fail to adjust the depth, exit */ 745 + /* Check to see if the queue is managed by the block layer. 746 + * If it is, and we fail to adjust the depth, exit. */ 757 747 if (blk_queue_tagged(sdev->request_queue) && 758 748 blk_queue_resize_tags(sdev->request_queue, tags) != 0) 759 749 goto out; ··· 782 772 } 783 773 EXPORT_SYMBOL(scsi_adjust_queue_depth); 784 774 785 - /* 786 - * Function: scsi_track_queue_full() 775 + /** 776 + * scsi_track_queue_full - track QUEUE_FULL events to adjust queue depth 777 + * @sdev: SCSI Device in question 778 + * @depth: Current number of outstanding SCSI commands on this device, 779 + * not counting the one returned as QUEUE_FULL. 787 780 * 788 - * Purpose: This function will track successive QUEUE_FULL events on a 781 + * Description: This function will track successive QUEUE_FULL events on a 789 782 * specific SCSI device to determine if and when there is a 790 783 * need to adjust the queue depth on the device. 791 784 * 792 - * Arguments: sdev - SCSI Device in question 793 - * depth - Current number of outstanding SCSI commands on 794 - * this device, not counting the one returned as 795 - * QUEUE_FULL. 796 - * 797 - * Returns: 0 - No change needed 798 - * >0 - Adjust queue depth to this new depth 785 + * Returns: 0 - No change needed, >0 - Adjust queue depth to this new depth, 799 786 * -1 - Drop back to untagged operation using host->cmd_per_lun 800 787 * as the untagged command depth 801 788 * ··· 831 824 EXPORT_SYMBOL(scsi_track_queue_full); 832 825 833 826 /** 834 - * scsi_device_get - get an addition reference to a scsi_device 827 + * scsi_device_get - get an additional reference to a scsi_device 835 828 * @sdev: device to get a reference to 836 829 * 837 - * Gets a reference to the scsi_device and increments the use count 830 + * Description: Gets a reference to the scsi_device and increments the use count 838 831 * of the underlying LLDD module. You must hold host_lock of the 839 832 * parent Scsi_Host or already have a reference when calling this. 840 833 */ ··· 856 849 * scsi_device_put - release a reference to a scsi_device 857 850 * @sdev: device to release a reference on. 858 851 * 859 - * Release a reference to the scsi_device and decrements the use count 860 - * of the underlying LLDD module. The device is freed once the last 852 + * Description: Release a reference to the scsi_device and decrements the use 853 + * count of the underlying LLDD module. The device is freed once the last 861 854 * user vanishes. 862 855 */ 863 856 void scsi_device_put(struct scsi_device *sdev) ··· 874 867 } 875 868 EXPORT_SYMBOL(scsi_device_put); 876 869 877 - /* helper for shost_for_each_device, thus not documented */ 870 + /* helper for shost_for_each_device, see that for documentation */ 878 871 struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *shost, 879 872 struct scsi_device *prev) 880 873 { ··· 902 895 /** 903 896 * starget_for_each_device - helper to walk all devices of a target 904 897 * @starget: target whose devices we want to iterate over. 898 + * @data: Opaque passed to each function call. 899 + * @fn: Function to call on each device 905 900 * 906 901 * This traverses over each device of @starget. The devices have 907 902 * a reference that must be released by scsi_host_put when breaking ··· 955 946 * @starget: SCSI target pointer 956 947 * @lun: SCSI Logical Unit Number 957 948 * 958 - * Looks up the scsi_device with the specified @lun for a give 959 - * @starget. The returned scsi_device does not have an additional 949 + * Description: Looks up the scsi_device with the specified @lun for a given 950 + * @starget. The returned scsi_device does not have an additional 960 951 * reference. You must hold the host's host_lock over this call and 961 952 * any access to the returned scsi_device. 962 953 * 963 954 * Note: The only reason why drivers would want to use this is because 964 - * they're need to access the device list in irq context. Otherwise you 955 + * they need to access the device list in irq context. Otherwise you 965 956 * really want to use scsi_device_lookup_by_target instead. 966 957 **/ 967 958 struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget, ··· 983 974 * @starget: SCSI target pointer 984 975 * @lun: SCSI Logical Unit Number 985 976 * 986 - * Looks up the scsi_device with the specified @channel, @id, @lun for a 987 - * give host. The returned scsi_device has an additional reference that 988 - * needs to be release with scsi_host_put once you're done with it. 977 + * Description: Looks up the scsi_device with the specified @channel, @id, @lun 978 + * for a given host. The returned scsi_device has an additional reference that 979 + * needs to be released with scsi_device_put once you're done with it. 989 980 **/ 990 981 struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *starget, 991 982 uint lun) ··· 1005 996 EXPORT_SYMBOL(scsi_device_lookup_by_target); 1006 997 1007 998 /** 1008 - * scsi_device_lookup - find a device given the host (UNLOCKED) 999 + * __scsi_device_lookup - find a device given the host (UNLOCKED) 1009 1000 * @shost: SCSI host pointer 1010 1001 * @channel: SCSI channel (zero if only one channel) 1011 - * @pun: SCSI target number (physical unit number) 1002 + * @id: SCSI target number (physical unit number) 1012 1003 * @lun: SCSI Logical Unit Number 1013 1004 * 1014 - * Looks up the scsi_device with the specified @channel, @id, @lun for a 1015 - * give host. The returned scsi_device does not have an additional reference. 1016 - * You must hold the host's host_lock over this call and any access to the 1017 - * returned scsi_device. 1005 + * Description: Looks up the scsi_device with the specified @channel, @id, @lun 1006 + * for a given host. The returned scsi_device does not have an additional 1007 + * reference. You must hold the host's host_lock over this call and any access 1008 + * to the returned scsi_device. 1018 1009 * 1019 1010 * Note: The only reason why drivers would want to use this is because 1020 - * they're need to access the device list in irq context. Otherwise you 1011 + * they need to access the device list in irq context. Otherwise you 1021 1012 * really want to use scsi_device_lookup instead. 1022 1013 **/ 1023 1014 struct scsi_device *__scsi_device_lookup(struct Scsi_Host *shost, ··· 1042 1033 * @id: SCSI target number (physical unit number) 1043 1034 * @lun: SCSI Logical Unit Number 1044 1035 * 1045 - * Looks up the scsi_device with the specified @channel, @id, @lun for a 1046 - * give host. The returned scsi_device has an additional reference that 1047 - * needs to be release with scsi_host_put once you're done with it. 1036 + * Description: Looks up the scsi_device with the specified @channel, @id, @lun 1037 + * for a given host. The returned scsi_device has an additional reference that 1038 + * needs to be released with scsi_device_put once you're done with it. 1048 1039 **/ 1049 1040 struct scsi_device *scsi_device_lookup(struct Scsi_Host *shost, 1050 1041 uint channel, uint id, uint lun)
+15 -19
drivers/scsi/scsi_devinfo.c
··· 276 276 } 277 277 278 278 /** 279 - * scsi_dev_info_list_add: add one dev_info list entry. 279 + * scsi_dev_info_list_add - add one dev_info list entry. 280 + * @compatible: if true, null terminate short strings. Otherwise space pad. 280 281 * @vendor: vendor string 281 282 * @model: model (product) string 282 283 * @strflags: integer string 283 - * @flag: if strflags NULL, use this flag value 284 + * @flags: if strflags NULL, use this flag value 284 285 * 285 286 * Description: 286 287 * Create and add one dev_info entry for @vendor, @model, @strflags or ··· 323 322 } 324 323 325 324 /** 326 - * scsi_dev_info_list_add_str: parse dev_list and add to the 327 - * scsi_dev_info_list. 325 + * scsi_dev_info_list_add_str - parse dev_list and add to the scsi_dev_info_list. 328 326 * @dev_list: string of device flags to add 329 327 * 330 328 * Description: ··· 374 374 } 375 375 376 376 /** 377 - * get_device_flags - get device specific flags from the dynamic device 378 - * list. Called during scan time. 377 + * get_device_flags - get device specific flags from the dynamic device list. 378 + * @sdev: &scsi_device to get flags for 379 379 * @vendor: vendor name 380 380 * @model: model name 381 381 * 382 382 * Description: 383 383 * Search the scsi_dev_info_list for an entry matching @vendor and 384 384 * @model, if found, return the matching flags value, else return 385 - * the host or global default settings. 385 + * the host or global default settings. Called during scan time. 386 386 **/ 387 387 int scsi_get_device_flags(struct scsi_device *sdev, 388 388 const unsigned char *vendor, ··· 483 483 } 484 484 485 485 /* 486 - * proc_scsi_dev_info_write: allow additions to the scsi_dev_info_list via 487 - * /proc. 486 + * proc_scsi_dev_info_write - allow additions to scsi_dev_info_list via /proc. 488 487 * 489 - * Use: echo "vendor:model:flag" > /proc/scsi/device_info 490 - * 491 - * To add a black/white list entry for vendor and model with an integer 492 - * value of flag to the scsi device info list. 488 + * Description: Adds a black/white list entry for vendor and model with an 489 + * integer value of flag to the scsi device info list. 490 + * To use, echo "vendor:model:flag" > /proc/scsi/device_info 493 491 */ 494 492 static int proc_scsi_devinfo_write(struct file *file, const char __user *buf, 495 493 unsigned long length, void *data) ··· 530 532 "scsi default device flag integer value"); 531 533 532 534 /** 533 - * scsi_dev_info_list_delete: called from scsi.c:exit_scsi to remove 534 - * the scsi_dev_info_list. 535 + * scsi_dev_info_list_delete - called from scsi.c:exit_scsi to remove the scsi_dev_info_list. 535 536 **/ 536 537 void scsi_exit_devinfo(void) 537 538 { ··· 549 552 } 550 553 551 554 /** 552 - * scsi_dev_list_init: set up the dynamic device list. 553 - * @dev_list: string of device flags to add 555 + * scsi_dev_list_init - set up the dynamic device list. 554 556 * 555 557 * Description: 556 - * Add command line @dev_list entries, then add 558 + * Add command line entries from scsi_dev_flags, then add 557 559 * scsi_static_device_list entries to the scsi device info list. 558 - **/ 560 + */ 559 561 int __init scsi_init_devinfo(void) 560 562 { 561 563 #ifdef CONFIG_SCSI_PROC_FS
+23 -23
drivers/scsi/scsi_error.c
··· 779 779 * Notes: 780 780 * We don't want to use the normal command completion while we are are 781 781 * still handling errors - it may cause other commands to be queued, 782 - * and that would disturb what we are doing. thus we really want to 782 + * and that would disturb what we are doing. Thus we really want to 783 783 * keep a list of pending commands for final completion, and once we 784 784 * are ready to leave error handling we handle completion for real. 785 785 **/ ··· 794 794 /** 795 795 * scsi_eh_get_sense - Get device sense data. 796 796 * @work_q: Queue of commands to process. 797 - * @done_q: Queue of proccessed commands.. 797 + * @done_q: Queue of processed commands. 798 798 * 799 799 * Description: 800 800 * See if we need to request sense information. if so, then get it ··· 802 802 * 803 803 * Notes: 804 804 * This has the unfortunate side effect that if a shost adapter does 805 - * not automatically request sense information, that we end up shutting 805 + * not automatically request sense information, we end up shutting 806 806 * it down before we request it. 807 807 * 808 808 * All drivers should request sense information internally these days, ··· 858 858 859 859 /** 860 860 * scsi_eh_tur - Send TUR to device. 861 - * @scmd: Scsi cmd to send TUR 861 + * @scmd: &scsi_cmnd to send TUR 862 862 * 863 863 * Return value: 864 864 * 0 - Device is ready. 1 - Device NOT ready. ··· 887 887 } 888 888 889 889 /** 890 - * scsi_eh_abort_cmds - abort canceled commands. 891 - * @shost: scsi host being recovered. 892 - * @eh_done_q: list_head for processed commands. 890 + * scsi_eh_abort_cmds - abort pending commands. 891 + * @work_q: &list_head for pending commands. 892 + * @done_q: &list_head for processed commands. 893 893 * 894 894 * Decription: 895 895 * Try and see whether or not it makes sense to try and abort the 896 - * running command. this only works out to be the case if we have one 897 - * command that has timed out. if the command simply failed, it makes 896 + * running command. This only works out to be the case if we have one 897 + * command that has timed out. If the command simply failed, it makes 898 898 * no sense to try and abort the command, since as far as the shost 899 899 * adapter is concerned, it isn't running. 900 900 **/ ··· 931 931 932 932 /** 933 933 * scsi_eh_try_stu - Send START_UNIT to device. 934 - * @scmd: Scsi cmd to send START_UNIT 934 + * @scmd: &scsi_cmnd to send START_UNIT 935 935 * 936 936 * Return value: 937 937 * 0 - Device is ready. 1 - Device NOT ready. ··· 956 956 957 957 /** 958 958 * scsi_eh_stu - send START_UNIT if needed 959 - * @shost: scsi host being recovered. 960 - * @eh_done_q: list_head for processed commands. 959 + * @shost: &scsi host being recovered. 960 + * @work_q: &list_head for pending commands. 961 + * @done_q: &list_head for processed commands. 961 962 * 962 963 * Notes: 963 964 * If commands are failing due to not ready, initializing command required, ··· 1009 1008 /** 1010 1009 * scsi_eh_bus_device_reset - send bdr if needed 1011 1010 * @shost: scsi host being recovered. 1012 - * @eh_done_q: list_head for processed commands. 1011 + * @work_q: &list_head for pending commands. 1012 + * @done_q: &list_head for processed commands. 1013 1013 * 1014 1014 * Notes: 1015 - * Try a bus device reset. still, look to see whether we have multiple 1015 + * Try a bus device reset. Still, look to see whether we have multiple 1016 1016 * devices that are jammed or not - if we have multiple devices, it 1017 1017 * makes no sense to try bus_device_reset - we really would need to try 1018 1018 * a bus_reset instead. ··· 1065 1063 1066 1064 /** 1067 1065 * scsi_eh_bus_reset - send a bus reset 1068 - * @shost: scsi host being recovered. 1069 - * @eh_done_q: list_head for processed commands. 1066 + * @shost: &scsi host being recovered. 1067 + * @work_q: &list_head for pending commands. 1068 + * @done_q: &list_head for processed commands. 1070 1069 **/ 1071 1070 static int scsi_eh_bus_reset(struct Scsi_Host *shost, 1072 1071 struct list_head *work_q, ··· 1443 1440 /** 1444 1441 * scsi_eh_ready_devs - check device ready state and recover if not. 1445 1442 * @shost: host to be recovered. 1446 - * @eh_done_q: list_head for processed commands. 1443 + * @work_q: &list_head for pending commands. 1444 + * @done_q: &list_head for processed commands. 1447 1445 * 1448 1446 **/ 1449 1447 void scsi_eh_ready_devs(struct Scsi_Host *shost, ··· 1828 1824 EXPORT_SYMBOL(scsi_command_normalize_sense); 1829 1825 1830 1826 /** 1831 - * scsi_sense_desc_find - search for a given descriptor type in 1832 - * descriptor sense data format. 1833 - * 1827 + * scsi_sense_desc_find - search for a given descriptor type in descriptor sense data format. 1834 1828 * @sense_buffer: byte array of descriptor format sense data 1835 1829 * @sb_len: number of valid bytes in sense_buffer 1836 1830 * @desc_type: value of descriptor type to find ··· 1867 1865 EXPORT_SYMBOL(scsi_sense_desc_find); 1868 1866 1869 1867 /** 1870 - * scsi_get_sense_info_fld - attempts to get information field from 1871 - * sense data (either fixed or descriptor format) 1872 - * 1868 + * scsi_get_sense_info_fld - get information field from sense data (either fixed or descriptor format) 1873 1869 * @sense_buffer: byte array of sense data 1874 1870 * @sb_len: number of valid bytes in sense_buffer 1875 1871 * @info_out: pointer to 64 integer where 8 or 4 byte information
+16 -8
drivers/scsi/scsi_ioctl.c
··· 174 174 } 175 175 176 176 177 - /* 178 - * the scsi_ioctl() function differs from most ioctls in that it does 179 - * not take a major/minor number as the dev field. Rather, it takes 180 - * a pointer to a scsi_devices[] element, a structure. 177 + /** 178 + * scsi_ioctl - Dispatch ioctl to scsi device 179 + * @sdev: scsi device receiving ioctl 180 + * @cmd: which ioctl is it 181 + * @arg: data associated with ioctl 182 + * 183 + * Description: The scsi_ioctl() function differs from most ioctls in that it 184 + * does not take a major/minor number as the dev field. Rather, it takes 185 + * a pointer to a &struct scsi_device. 181 186 */ 182 187 int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) 183 188 { ··· 269 264 } 270 265 EXPORT_SYMBOL(scsi_ioctl); 271 266 272 - /* 273 - * the scsi_nonblock_ioctl() function is designed for ioctls which may 274 - * be executed even if the device is in recovery. 267 + /** 268 + * scsi_nonblock_ioctl() - Handle SG_SCSI_RESET 269 + * @sdev: scsi device receiving ioctl 270 + * @cmd: Must be SC_SCSI_RESET 271 + * @arg: pointer to int containing SG_SCSI_RESET_{DEVICE,BUS,HOST} 272 + * @filp: either NULL or a &struct file which must have the O_NONBLOCK flag. 275 273 */ 276 274 int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, 277 275 void __user *arg, struct file *filp) ··· 284 276 /* The first set of iocts may be executed even if we're doing 285 277 * error processing, as long as the device was opened 286 278 * non-blocking */ 287 - if (filp && filp->f_flags & O_NONBLOCK) { 279 + if (filp && (filp->f_flags & O_NONBLOCK)) { 288 280 if (scsi_host_in_recovery(sdev->host)) 289 281 return -ENODEV; 290 282 } else if (!scsi_block_when_processing_errors(sdev))
+20 -22
drivers/scsi/scsi_lib.c
··· 175 175 * 176 176 * returns the req->errors value which is the scsi_cmnd result 177 177 * field. 178 - **/ 178 + */ 179 179 int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, 180 180 int data_direction, void *buffer, unsigned bufflen, 181 181 unsigned char *sense, int timeout, int retries, int flags) ··· 274 274 /** 275 275 * scsi_req_map_sg - map a scatterlist into a request 276 276 * @rq: request to fill 277 - * @sg: scatterlist 277 + * @sgl: scatterlist 278 278 * @nsegs: number of elements 279 279 * @bufflen: len of buffer 280 280 * @gfp: memory allocation flags ··· 365 365 * @sdev: scsi device 366 366 * @cmd: scsi command 367 367 * @cmd_len: length of scsi cdb 368 - * @data_direction: data direction 368 + * @data_direction: DMA_TO_DEVICE, DMA_FROM_DEVICE, or DMA_NONE 369 369 * @buffer: data buffer (this can be a kernel buffer or scatterlist) 370 370 * @bufflen: len of buffer 371 371 * @use_sg: if buffer is a scatterlist this is the number of elements 372 372 * @timeout: request timeout in seconds 373 373 * @retries: number of times to retry request 374 - * @flags: or into request flags 375 - **/ 374 + * @privdata: data passed to done() 375 + * @done: callback function when done 376 + * @gfp: memory allocation flags 377 + */ 376 378 int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, 377 379 int cmd_len, int data_direction, void *buffer, unsigned bufflen, 378 380 int use_sg, int timeout, int retries, void *privdata, ··· 1806 1804 * @timeout: command timeout 1807 1805 * @retries: number of retries before failing 1808 1806 * @data: returns a structure abstracting the mode header data 1809 - * @sense: place to put sense data (or NULL if no sense to be collected). 1807 + * @sshdr: place to put sense data (or NULL if no sense to be collected). 1810 1808 * must be SCSI_SENSE_BUFFERSIZE big. 1811 1809 * 1812 1810 * Returns zero if successful; negative error number or scsi ··· 1873 1871 EXPORT_SYMBOL_GPL(scsi_mode_select); 1874 1872 1875 1873 /** 1876 - * scsi_mode_sense - issue a mode sense, falling back from 10 to 1877 - * six bytes if necessary. 1874 + * scsi_mode_sense - issue a mode sense, falling back from 10 to six bytes if necessary. 1878 1875 * @sdev: SCSI device to be queried 1879 1876 * @dbd: set if mode sense will allow block descriptors to be returned 1880 1877 * @modepage: mode page being requested ··· 1882 1881 * @timeout: command timeout 1883 1882 * @retries: number of retries before failing 1884 1883 * @data: returns a structure abstracting the mode header data 1885 - * @sense: place to put sense data (or NULL if no sense to be collected). 1884 + * @sshdr: place to put sense data (or NULL if no sense to be collected). 1886 1885 * must be SCSI_SENSE_BUFFERSIZE big. 1887 1886 * 1888 1887 * Returns zero if unsuccessful, or the header offset (either 4 1889 1888 * or 8 depending on whether a six or ten byte command was 1890 1889 * issued) if successful. 1891 - **/ 1890 + */ 1892 1891 int 1893 1892 scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, 1894 1893 unsigned char *buffer, int len, int timeout, int retries, ··· 2008 2007 EXPORT_SYMBOL(scsi_test_unit_ready); 2009 2008 2010 2009 /** 2011 - * scsi_device_set_state - Take the given device through the device 2012 - * state model. 2010 + * scsi_device_set_state - Take the given device through the device state model. 2013 2011 * @sdev: scsi device to change the state of. 2014 2012 * @state: state to change to. 2015 2013 * 2016 2014 * Returns zero if unsuccessful or an error if the requested 2017 2015 * transition is illegal. 2018 - **/ 2016 + */ 2019 2017 int 2020 2018 scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) 2021 2019 { ··· 2264 2264 * Must be called with user context, may sleep. 2265 2265 * 2266 2266 * Returns zero if unsuccessful or an error if not. 2267 - **/ 2267 + */ 2268 2268 int 2269 2269 scsi_device_quiesce(struct scsi_device *sdev) 2270 2270 { ··· 2289 2289 * queues. 2290 2290 * 2291 2291 * Must be called with user context, may sleep. 2292 - **/ 2292 + */ 2293 2293 void 2294 2294 scsi_device_resume(struct scsi_device *sdev) 2295 2295 { ··· 2326 2326 EXPORT_SYMBOL(scsi_target_resume); 2327 2327 2328 2328 /** 2329 - * scsi_internal_device_block - internal function to put a device 2330 - * temporarily into the SDEV_BLOCK state 2329 + * scsi_internal_device_block - internal function to put a device temporarily into the SDEV_BLOCK state 2331 2330 * @sdev: device to block 2332 2331 * 2333 2332 * Block request made by scsi lld's to temporarily stop all ··· 2341 2342 * state, all commands are deferred until the scsi lld reenables 2342 2343 * the device with scsi_device_unblock or device_block_tmo fires. 2343 2344 * This routine assumes the host_lock is held on entry. 2344 - **/ 2345 + */ 2345 2346 int 2346 2347 scsi_internal_device_block(struct scsi_device *sdev) 2347 2348 { ··· 2381 2382 * (which must be a legal transition) allowing the midlayer to 2382 2383 * goose the queue for this device. This routine assumes the 2383 2384 * host_lock is held upon entry. 2384 - **/ 2385 + */ 2385 2386 int 2386 2387 scsi_internal_device_unblock(struct scsi_device *sdev) 2387 2388 { ··· 2459 2460 2460 2461 /** 2461 2462 * scsi_kmap_atomic_sg - find and atomically map an sg-elemnt 2462 - * @sg: scatter-gather list 2463 + * @sgl: scatter-gather list 2463 2464 * @sg_count: number of segments in sg 2464 2465 * @offset: offset in bytes into sg, on return offset into the mapped area 2465 2466 * @len: bytes to map, on return number of bytes mapped ··· 2508 2509 EXPORT_SYMBOL(scsi_kmap_atomic_sg); 2509 2510 2510 2511 /** 2511 - * scsi_kunmap_atomic_sg - atomically unmap a virtual address, previously 2512 - * mapped with scsi_kmap_atomic_sg 2512 + * scsi_kunmap_atomic_sg - atomically unmap a virtual address, previously mapped with scsi_kmap_atomic_sg 2513 2513 * @virt: virtual address to be unmapped 2514 2514 */ 2515 2515 void scsi_kunmap_atomic_sg(void *virt)
+7 -12
drivers/scsi/scsi_netlink.c
··· 32 32 33 33 34 34 /** 35 - * scsi_nl_rcv_msg - 36 - * Receive message handler. Extracts message from a receive buffer. 35 + * scsi_nl_rcv_msg - Receive message handler. 36 + * @skb: socket receive buffer 37 + * 38 + * Description: Extracts message from a receive buffer. 37 39 * Validates message header and calls appropriate transport message handler 38 40 * 39 - * @skb: socket receive buffer 40 41 * 41 42 **/ 42 43 static void ··· 100 99 101 100 102 101 /** 103 - * scsi_nl_rcv_event - 104 - * Event handler for a netlink socket. 105 - * 102 + * scsi_nl_rcv_event - Event handler for a netlink socket. 106 103 * @this: event notifier block 107 104 * @event: event type 108 105 * @ptr: event payload ··· 128 129 129 130 130 131 /** 131 - * scsi_netlink_init - 132 - * Called by SCSI subsystem to intialize the SCSI transport netlink 133 - * interface 132 + * scsi_netlink_init - Called by SCSI subsystem to intialize the SCSI transport netlink interface 134 133 * 135 134 **/ 136 135 void ··· 157 160 158 161 159 162 /** 160 - * scsi_netlink_exit - 161 - * Called by SCSI subsystem to disable the SCSI transport netlink 162 - * interface 163 + * scsi_netlink_exit - Called by SCSI subsystem to disable the SCSI transport netlink interface 163 164 * 164 165 **/ 165 166 void
+108 -2
drivers/scsi/scsi_proc.c
··· 45 45 /* Protect sht->present and sht->proc_dir */ 46 46 static DEFINE_MUTEX(global_host_template_mutex); 47 47 48 + /** 49 + * proc_scsi_read - handle read from /proc by calling host's proc_info() command 50 + * @buffer: passed to proc_info 51 + * @start: passed to proc_info 52 + * @offset: passed to proc_info 53 + * @length: passed to proc_info 54 + * @eof: returns whether length read was less than requested 55 + * @data: pointer to a &struct Scsi_Host 56 + */ 57 + 48 58 static int proc_scsi_read(char *buffer, char **start, off_t offset, 49 59 int length, int *eof, void *data) 50 60 { ··· 67 57 return n; 68 58 } 69 59 60 + /** 61 + * proc_scsi_write_proc - Handle write to /proc by calling host's proc_info() 62 + * @file: not used 63 + * @buf: source of data to write. 64 + * @count: number of bytes (at most PROC_BLOCK_SIZE) to write. 65 + * @data: pointer to &struct Scsi_Host 66 + */ 70 67 static int proc_scsi_write_proc(struct file *file, const char __user *buf, 71 68 unsigned long count, void *data) 72 69 { ··· 97 80 return ret; 98 81 } 99 82 83 + /** 84 + * scsi_proc_hostdir_add - Create directory in /proc for a scsi host 85 + * @sht: owner of this directory 86 + * 87 + * Sets sht->proc_dir to the new directory. 88 + */ 89 + 100 90 void scsi_proc_hostdir_add(struct scsi_host_template *sht) 101 91 { 102 92 if (!sht->proc_info) ··· 121 97 mutex_unlock(&global_host_template_mutex); 122 98 } 123 99 100 + /** 101 + * scsi_proc_hostdir_rm - remove directory in /proc for a scsi host 102 + * @sht: owner of directory 103 + */ 124 104 void scsi_proc_hostdir_rm(struct scsi_host_template *sht) 125 105 { 126 106 if (!sht->proc_info) ··· 138 110 mutex_unlock(&global_host_template_mutex); 139 111 } 140 112 113 + 114 + /** 115 + * scsi_proc_host_add - Add entry for this host to appropriate /proc dir 116 + * @shost: host to add 117 + */ 141 118 void scsi_proc_host_add(struct Scsi_Host *shost) 142 119 { 143 120 struct scsi_host_template *sht = shost->hostt; ··· 166 133 p->owner = sht->module; 167 134 } 168 135 136 + /** 137 + * scsi_proc_host_rm - remove this host's entry from /proc 138 + * @shost: which host 139 + */ 169 140 void scsi_proc_host_rm(struct Scsi_Host *shost) 170 141 { 171 142 char name[10]; ··· 180 143 sprintf(name,"%d", shost->host_no); 181 144 remove_proc_entry(name, shost->hostt->proc_dir); 182 145 } 183 - 146 + /** 147 + * proc_print_scsidevice - return data about this host 148 + * @dev: A scsi device 149 + * @data: &struct seq_file to output to. 150 + * 151 + * Description: prints Host, Channel, Id, Lun, Vendor, Model, Rev, Type, 152 + * and revision. 153 + */ 184 154 static int proc_print_scsidevice(struct device *dev, void *data) 185 155 { 186 156 struct scsi_device *sdev = to_scsi_device(dev); ··· 233 189 return 0; 234 190 } 235 191 192 + /** 193 + * scsi_add_single_device - Respond to user request to probe for/add device 194 + * @host: user-supplied decimal integer 195 + * @channel: user-supplied decimal integer 196 + * @id: user-supplied decimal integer 197 + * @lun: user-supplied decimal integer 198 + * 199 + * Description: called by writing "scsi add-single-device" to /proc/scsi/scsi. 200 + * 201 + * does scsi_host_lookup() and either user_scan() if that transport 202 + * type supports it, or else scsi_scan_host_selected() 203 + * 204 + * Note: this seems to be aimed exclusively at SCSI parallel busses. 205 + */ 206 + 236 207 static int scsi_add_single_device(uint host, uint channel, uint id, uint lun) 237 208 { 238 209 struct Scsi_Host *shost; ··· 265 206 return error; 266 207 } 267 208 209 + /** 210 + * scsi_remove_single_device - Respond to user request to remove a device 211 + * @host: user-supplied decimal integer 212 + * @channel: user-supplied decimal integer 213 + * @id: user-supplied decimal integer 214 + * @lun: user-supplied decimal integer 215 + * 216 + * Description: called by writing "scsi remove-single-device" to 217 + * /proc/scsi/scsi. Does a scsi_device_lookup() and scsi_remove_device() 218 + */ 268 219 static int scsi_remove_single_device(uint host, uint channel, uint id, uint lun) 269 220 { 270 221 struct scsi_device *sdev; ··· 294 225 scsi_host_put(shost); 295 226 return error; 296 227 } 228 + 229 + /** 230 + * proc_scsi_write - handle writes to /proc/scsi/scsi 231 + * @file: not used 232 + * @buf: buffer to write 233 + * @length: length of buf, at most PAGE_SIZE 234 + * @ppos: not used 235 + * 236 + * Description: this provides a legacy mechanism to add or remove devices by 237 + * Host, Channel, ID, and Lun. To use, 238 + * "echo 'scsi add-single-device 0 1 2 3' > /proc/scsi/scsi" or 239 + * "echo 'scsi remove-single-device 0 1 2 3' > /proc/scsi/scsi" with 240 + * "0 1 2 3" replaced by the Host, Channel, Id, and Lun. 241 + * 242 + * Note: this seems to be aimed at parallel SCSI. Most modern busses (USB, 243 + * SATA, Firewire, Fibre Channel, etc) dynamically assign these values to 244 + * provide a unique identifier and nothing more. 245 + */ 246 + 297 247 298 248 static ssize_t proc_scsi_write(struct file *file, const char __user *buf, 299 249 size_t length, loff_t *ppos) ··· 379 291 return err; 380 292 } 381 293 294 + /** 295 + * proc_scsi_show - show contents of /proc/scsi/scsi (attached devices) 296 + * @s: output goes here 297 + * @p: not used 298 + */ 382 299 static int proc_scsi_show(struct seq_file *s, void *p) 383 300 { 384 301 seq_printf(s, "Attached devices:\n"); ··· 391 298 return 0; 392 299 } 393 300 301 + /** 302 + * proc_scsi_open - glue function 303 + * @inode: not used 304 + * @file: passed to single_open() 305 + * 306 + * Associates proc_scsi_show with this file 307 + */ 394 308 static int proc_scsi_open(struct inode *inode, struct file *file) 395 309 { 396 310 /* 397 - * We don't really needs this for the write case but it doesn't 311 + * We don't really need this for the write case but it doesn't 398 312 * harm either. 399 313 */ 400 314 return single_open(file, proc_scsi_show, NULL); ··· 415 315 .release = single_release, 416 316 }; 417 317 318 + /** 319 + * scsi_init_procfs - create scsi and scsi/scsi in procfs 320 + */ 418 321 int __init scsi_init_procfs(void) 419 322 { 420 323 struct proc_dir_entry *pde; ··· 439 336 return -ENOMEM; 440 337 } 441 338 339 + /** 340 + * scsi_exit_procfs - Remove scsi/scsi and scsi from procfs 341 + */ 442 342 void scsi_exit_procfs(void) 443 343 { 444 344 remove_proc_entry("scsi/scsi", NULL);
+20 -12
drivers/scsi/scsi_scan.c
··· 221 221 222 222 /** 223 223 * scsi_alloc_sdev - allocate and setup a scsi_Device 224 + * @starget: which target to allocate a &scsi_device for 225 + * @lun: which lun 226 + * @hostdata: usually NULL and set by ->slave_alloc instead 224 227 * 225 228 * Description: 226 229 * Allocate, initialize for io, and return a pointer to a scsi_Device. ··· 475 472 476 473 /** 477 474 * scsi_target_reap - check to see if target is in use and destroy if not 478 - * 479 475 * @starget: target to be checked 480 476 * 481 477 * This is used after removing a LUN or doing a last put of the target ··· 930 928 931 929 #ifdef CONFIG_SCSI_LOGGING 932 930 /** 933 - * scsi_inq_str - print INQUIRY data from min to max index, 934 - * strip trailing whitespace 931 + * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace 935 932 * @buf: Output buffer with at least end-first+1 bytes of space 936 933 * @inq: Inquiry buffer (input) 937 934 * @first: Offset of string into inq ··· 958 957 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it 959 958 * @starget: pointer to target device structure 960 959 * @lun: LUN of target device 961 - * @sdevscan: probe the LUN corresponding to this scsi_device 962 - * @sdevnew: store the value of any new scsi_device allocated 963 960 * @bflagsp: store bflags here if not NULL 961 + * @sdevp: probe the LUN corresponding to this scsi_device 962 + * @rescan: if nonzero skip some code only needed on first scan 963 + * @hostdata: passed to scsi_alloc_sdev() 964 964 * 965 965 * Description: 966 966 * Call scsi_probe_lun, if a LUN with an attached device is found, ··· 1112 1110 * scsi_sequential_lun_scan - sequentially scan a SCSI target 1113 1111 * @starget: pointer to target structure to scan 1114 1112 * @bflags: black/white list flag for LUN 0 1113 + * @scsi_level: Which version of the standard does this device adhere to 1114 + * @rescan: passed to scsi_probe_add_lun() 1115 1115 * 1116 1116 * Description: 1117 1117 * Generally, scan from LUN 1 (LUN 0 is assumed to already have been ··· 1224 1220 1225 1221 /** 1226 1222 * int_to_scsilun: reverts an int into a scsi_lun 1227 - * @int: integer to be reverted 1223 + * @lun: integer to be reverted 1228 1224 * @scsilun: struct scsi_lun to be set. 1229 1225 * 1230 1226 * Description: ··· 1256 1252 1257 1253 /** 1258 1254 * scsi_report_lun_scan - Scan using SCSI REPORT LUN results 1259 - * @sdevscan: scan the host, channel, and id of this scsi_device 1255 + * @starget: which target 1256 + * @bflags: Zero or a mix of BLIST_NOLUN, BLIST_REPORTLUN2, or BLIST_NOREPORTLUN 1257 + * @rescan: nonzero if we can skip code only needed on first scan 1260 1258 * 1261 1259 * Description: 1262 - * If @sdevscan is for a SCSI-3 or up device, send a REPORT LUN 1263 - * command, and scan the resulting list of LUNs by calling 1264 - * scsi_probe_and_add_lun. 1260 + * Fast scanning for modern (SCSI-3) devices by sending a REPORT LUN command. 1261 + * Scan the resulting list of LUNs by calling scsi_probe_and_add_lun. 1265 1262 * 1266 - * Modifies sdevscan->lun. 1263 + * If BLINK_REPORTLUN2 is set, scan a target that supports more than 8 1264 + * LUNs even if it's older than SCSI-3. 1265 + * If BLIST_NOREPORTLUN is set, return 1 always. 1266 + * If BLIST_NOLUN is set, return 0 always. 1267 1267 * 1268 1268 * Return: 1269 1269 * 0: scan completed (or no memory, so further scanning is futile) 1270 - * 1: no report lun scan, or not configured 1270 + * 1: could not scan with REPORT LUN 1271 1271 **/ 1272 1272 static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, 1273 1273 int rescan)
+46 -56
drivers/scsi/scsi_transport_fc.c
··· 481 481 " exceeded, the scsi target is removed. Value should be" 482 482 " between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT."); 483 483 484 - /** 484 + /* 485 485 * Netlink Infrastructure 486 - **/ 486 + */ 487 487 488 488 static atomic_t fc_event_seq; 489 489 ··· 491 491 * fc_get_event_number - Obtain the next sequential FC event number 492 492 * 493 493 * Notes: 494 - * We could have inline'd this, but it would have required fc_event_seq to 494 + * We could have inlined this, but it would have required fc_event_seq to 495 495 * be exposed. For now, live with the subroutine call. 496 496 * Atomic used to avoid lock/unlock... 497 - **/ 497 + */ 498 498 u32 499 499 fc_get_event_number(void) 500 500 { ··· 505 505 506 506 /** 507 507 * fc_host_post_event - called to post an even on an fc_host. 508 - * 509 508 * @shost: host the event occurred on 510 509 * @event_number: fc event number obtained from get_fc_event_number() 511 510 * @event_code: fc_host event being posted ··· 512 513 * 513 514 * Notes: 514 515 * This routine assumes no locks are held on entry. 515 - **/ 516 + */ 516 517 void 517 518 fc_host_post_event(struct Scsi_Host *shost, u32 event_number, 518 519 enum fc_host_event_code event_code, u32 event_data) ··· 578 579 579 580 580 581 /** 581 - * fc_host_post_vendor_event - called to post a vendor unique event on 582 - * a fc_host 583 - * 582 + * fc_host_post_vendor_event - called to post a vendor unique event on an fc_host 584 583 * @shost: host the event occurred on 585 584 * @event_number: fc event number obtained from get_fc_event_number() 586 585 * @data_len: amount, in bytes, of vendor unique data 587 586 * @data_buf: pointer to vendor unique data 587 + * @vendor_id: Vendor id 588 588 * 589 589 * Notes: 590 590 * This routine assumes no locks are held on entry. 591 - **/ 591 + */ 592 592 void 593 593 fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, 594 594 u32 data_len, char * data_buf, u64 vendor_id) ··· 1898 1900 1899 1901 /** 1900 1902 * fc_timed_out - FC Transport I/O timeout intercept handler 1901 - * 1902 1903 * @scmd: The SCSI command which timed out 1903 1904 * 1904 1905 * This routine protects against error handlers getting invoked while a ··· 1917 1920 * 1918 1921 * Notes: 1919 1922 * This routine assumes no locks are held on entry. 1920 - **/ 1923 + */ 1921 1924 static enum scsi_eh_timer_return 1922 1925 fc_timed_out(struct scsi_cmnd *scmd) 1923 1926 { ··· 2130 2133 * 1 - work queued for execution 2131 2134 * 0 - work is already queued 2132 2135 * -EINVAL - work queue doesn't exist 2133 - **/ 2136 + */ 2134 2137 static int 2135 2138 fc_queue_work(struct Scsi_Host *shost, struct work_struct *work) 2136 2139 { ··· 2149 2152 /** 2150 2153 * fc_flush_work - Flush a fc_host's workqueue. 2151 2154 * @shost: Pointer to Scsi_Host bound to fc_host. 2152 - **/ 2155 + */ 2153 2156 static void 2154 2157 fc_flush_work(struct Scsi_Host *shost) 2155 2158 { ··· 2172 2175 * 2173 2176 * Return value: 2174 2177 * 1 on success / 0 already queued / < 0 for error 2175 - **/ 2178 + */ 2176 2179 static int 2177 2180 fc_queue_devloss_work(struct Scsi_Host *shost, struct delayed_work *work, 2178 2181 unsigned long delay) ··· 2192 2195 /** 2193 2196 * fc_flush_devloss - Flush a fc_host's devloss workqueue. 2194 2197 * @shost: Pointer to Scsi_Host bound to fc_host. 2195 - **/ 2198 + */ 2196 2199 static void 2197 2200 fc_flush_devloss(struct Scsi_Host *shost) 2198 2201 { ··· 2209 2212 2210 2213 2211 2214 /** 2212 - * fc_remove_host - called to terminate any fc_transport-related elements 2213 - * for a scsi host. 2214 - * @rport: remote port to be unblocked. 2215 + * fc_remove_host - called to terminate any fc_transport-related elements for a scsi host. 2216 + * @shost: Which &Scsi_Host 2215 2217 * 2216 2218 * This routine is expected to be called immediately preceeding the 2217 2219 * a driver's call to scsi_remove_host(). 2218 2220 * 2219 2221 * WARNING: A driver utilizing the fc_transport, which fails to call 2220 - * this routine prior to scsi_remote_host(), will leave dangling 2222 + * this routine prior to scsi_remove_host(), will leave dangling 2221 2223 * objects in /sys/class/fc_remote_ports. Access to any of these 2222 2224 * objects can result in a system crash !!! 2223 2225 * 2224 2226 * Notes: 2225 2227 * This routine assumes no locks are held on entry. 2226 - **/ 2228 + */ 2227 2229 void 2228 2230 fc_remove_host(struct Scsi_Host *shost) 2229 2231 { ··· 2277 2281 2278 2282 /** 2279 2283 * fc_starget_delete - called to delete the scsi decendents of an rport 2280 - * (target and all sdevs) 2281 - * 2282 2284 * @work: remote port to be operated on. 2283 - **/ 2285 + * 2286 + * Deletes target and all sdevs. 2287 + */ 2284 2288 static void 2285 2289 fc_starget_delete(struct work_struct *work) 2286 2290 { ··· 2299 2303 2300 2304 /** 2301 2305 * fc_rport_final_delete - finish rport termination and delete it. 2302 - * 2303 2306 * @work: remote port to be deleted. 2304 - **/ 2307 + */ 2305 2308 static void 2306 2309 fc_rport_final_delete(struct work_struct *work) 2307 2310 { ··· 2370 2375 * 2371 2376 * Notes: 2372 2377 * This routine assumes no locks are held on entry. 2373 - **/ 2378 + */ 2374 2379 static struct fc_rport * 2375 2380 fc_rport_create(struct Scsi_Host *shost, int channel, 2376 2381 struct fc_rport_identifiers *ids) ··· 2457 2462 } 2458 2463 2459 2464 /** 2460 - * fc_remote_port_add - notifies the fc transport of the existence 2461 - * of a remote FC port. 2465 + * fc_remote_port_add - notify fc transport of the existence of a remote FC port. 2462 2466 * @shost: scsi host the remote port is connected to. 2463 2467 * @channel: Channel on shost port connected to. 2464 2468 * @ids: The world wide names, fc address, and FC4 port ··· 2493 2499 * 2494 2500 * Notes: 2495 2501 * This routine assumes no locks are held on entry. 2496 - **/ 2502 + */ 2497 2503 struct fc_rport * 2498 2504 fc_remote_port_add(struct Scsi_Host *shost, int channel, 2499 2505 struct fc_rport_identifiers *ids) ··· 2677 2683 2678 2684 2679 2685 /** 2680 - * fc_remote_port_delete - notifies the fc transport that a remote 2681 - * port is no longer in existence. 2686 + * fc_remote_port_delete - notifies the fc transport that a remote port is no longer in existence. 2682 2687 * @rport: The remote port that no longer exists 2683 2688 * 2684 2689 * The LLDD calls this routine to notify the transport that a remote 2685 2690 * port is no longer part of the topology. Note: Although a port 2686 2691 * may no longer be part of the topology, it may persist in the remote 2687 2692 * ports displayed by the fc_host. We do this under 2 conditions: 2688 - * - If the port was a scsi target, we delay its deletion by "blocking" it. 2693 + * 1) If the port was a scsi target, we delay its deletion by "blocking" it. 2689 2694 * This allows the port to temporarily disappear, then reappear without 2690 2695 * disrupting the SCSI device tree attached to it. During the "blocked" 2691 2696 * period the port will still exist. 2692 - * - If the port was a scsi target and disappears for longer than we 2697 + * 2) If the port was a scsi target and disappears for longer than we 2693 2698 * expect, we'll delete the port and the tear down the SCSI device tree 2694 2699 * attached to it. However, we want to semi-persist the target id assigned 2695 2700 * to that port if it eventually does exist. The port structure will ··· 2702 2709 * temporary blocked state. From the LLDD's perspective, the rport no 2703 2710 * longer exists. From the SCSI midlayer's perspective, the SCSI target 2704 2711 * exists, but all sdevs on it are blocked from further I/O. The following 2705 - * is then expected: 2712 + * is then expected. 2713 + * 2706 2714 * If the remote port does not return (signaled by a LLDD call to 2707 2715 * fc_remote_port_add()) within the dev_loss_tmo timeout, then the 2708 2716 * scsi target is removed - killing all outstanding i/o and removing the ··· 2725 2731 * 2726 2732 * Notes: 2727 2733 * This routine assumes no locks are held on entry. 2728 - **/ 2734 + */ 2729 2735 void 2730 2736 fc_remote_port_delete(struct fc_rport *rport) 2731 2737 { ··· 2786 2792 EXPORT_SYMBOL(fc_remote_port_delete); 2787 2793 2788 2794 /** 2789 - * fc_remote_port_rolechg - notifies the fc transport that the roles 2790 - * on a remote may have changed. 2795 + * fc_remote_port_rolechg - notifies the fc transport that the roles on a remote may have changed. 2791 2796 * @rport: The remote port that changed. 2797 + * @roles: New roles for this port. 2792 2798 * 2793 - * The LLDD calls this routine to notify the transport that the roles 2794 - * on a remote port may have changed. The largest effect of this is 2799 + * Description: The LLDD calls this routine to notify the transport that the 2800 + * roles on a remote port may have changed. The largest effect of this is 2795 2801 * if a port now becomes a FCP Target, it must be allocated a 2796 2802 * scsi target id. If the port is no longer a FCP target, any 2797 2803 * scsi target id value assigned to it will persist in case the ··· 2804 2810 * 2805 2811 * Notes: 2806 2812 * This routine assumes no locks are held on entry. 2807 - **/ 2813 + */ 2808 2814 void 2809 2815 fc_remote_port_rolechg(struct fc_rport *rport, u32 roles) 2810 2816 { ··· 2869 2875 EXPORT_SYMBOL(fc_remote_port_rolechg); 2870 2876 2871 2877 /** 2872 - * fc_timeout_deleted_rport - Timeout handler for a deleted remote port, 2873 - * which we blocked, and has now failed to return 2874 - * in the allotted time. 2875 - * 2878 + * fc_timeout_deleted_rport - Timeout handler for a deleted remote port. 2876 2879 * @work: rport target that failed to reappear in the allotted time. 2877 - **/ 2880 + * 2881 + * Description: An attempt to delete a remote port blocks, and if it fails 2882 + * to return in the allotted time this gets called. 2883 + */ 2878 2884 static void 2879 2885 fc_timeout_deleted_rport(struct work_struct *work) 2880 2886 { ··· 2978 2984 } 2979 2985 2980 2986 /** 2981 - * fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a 2982 - * disconnected SCSI target. 2983 - * 2987 + * fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a disconnected SCSI target. 2984 2988 * @work: rport to terminate io on. 2985 2989 * 2986 2990 * Notes: Only requests the failure of the io, not that all are flushed 2987 2991 * prior to returning. 2988 - **/ 2992 + */ 2989 2993 static void 2990 2994 fc_timeout_fail_rport_io(struct work_struct *work) 2991 2995 { ··· 3000 3008 3001 3009 /** 3002 3010 * fc_scsi_scan_rport - called to perform a scsi scan on a remote port. 3003 - * 3004 3011 * @work: remote port to be scanned. 3005 - **/ 3012 + */ 3006 3013 static void 3007 3014 fc_scsi_scan_rport(struct work_struct *work) 3008 3015 { ··· 3038 3047 * 3039 3048 * Notes: 3040 3049 * This routine assumes no locks are held on entry. 3041 - **/ 3050 + */ 3042 3051 static int 3043 3052 fc_vport_create(struct Scsi_Host *shost, int channel, struct device *pdev, 3044 3053 struct fc_vport_identifiers *ids, struct fc_vport **ret_vport) ··· 3163 3172 * 3164 3173 * Notes: 3165 3174 * This routine assumes no locks are held on entry. 3166 - **/ 3175 + */ 3167 3176 int 3168 3177 fc_vport_terminate(struct fc_vport *vport) 3169 3178 { ··· 3223 3232 3224 3233 /** 3225 3234 * fc_vport_sched_delete - workq-based delete request for a vport 3226 - * 3227 3235 * @work: vport to be deleted. 3228 - **/ 3236 + */ 3229 3237 static void 3230 3238 fc_vport_sched_delete(struct work_struct *work) 3231 3239 {
+9 -8
drivers/scsi/scsi_transport_iscsi.c
··· 328 328 * iscsi_create_session - create iscsi class session 329 329 * @shost: scsi host 330 330 * @transport: iscsi transport 331 + * @target_id: which target 331 332 * 332 333 * This can be called from a LLD or iscsi_transport. 333 - **/ 334 + */ 334 335 struct iscsi_cls_session * 335 336 iscsi_create_session(struct Scsi_Host *shost, 336 337 struct iscsi_transport *transport, ··· 383 382 * 384 383 * Can be called by a LLD or iscsi_transport. There must not be 385 384 * any running connections. 386 - **/ 385 + */ 387 386 int iscsi_destroy_session(struct iscsi_cls_session *session) 388 387 { 389 388 iscsi_remove_session(session); ··· 419 418 * for software iscsi we could be trying to preallocate a connection struct 420 419 * in which case there could be two connection structs and cid would be 421 420 * non-zero. 422 - **/ 421 + */ 423 422 struct iscsi_cls_conn * 424 423 iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid) 425 424 { ··· 466 465 467 466 /** 468 467 * iscsi_destroy_conn - destroy iscsi class connection 469 - * @session: iscsi cls session 468 + * @conn: iscsi cls session 470 469 * 471 - * This can be called from a LLD or iscsi_transport. 472 - **/ 470 + * This can be called from an LLD or iscsi_transport. 471 + */ 473 472 int iscsi_destroy_conn(struct iscsi_cls_conn *conn) 474 473 { 475 474 transport_unregister_device(&conn->dev); ··· 691 690 * 692 691 * This is called by HW iscsi LLDs to notify userpsace that its HW has 693 692 * removed a session. 694 - **/ 693 + */ 695 694 int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn) 696 695 { 697 696 struct iscsi_internal *priv; ··· 752 751 * 753 752 * This is called by HW iscsi LLDs to notify userpsace that its HW has 754 753 * created a session or a existing session is back in the logged in state. 755 - **/ 754 + */ 756 755 int iscsi_if_create_session_done(struct iscsi_cls_conn *conn) 757 756 { 758 757 struct iscsi_internal *priv;
+21 -19
drivers/scsi/scsi_transport_sas.c
··· 323 323 } 324 324 325 325 /** 326 - * sas_remove_children -- tear down a devices SAS data structures 326 + * sas_remove_children - tear down a devices SAS data structures 327 327 * @dev: device belonging to the sas object 328 328 * 329 329 * Removes all SAS PHYs and remote PHYs for a given object ··· 336 336 EXPORT_SYMBOL(sas_remove_children); 337 337 338 338 /** 339 - * sas_remove_host -- tear down a Scsi_Host's SAS data structures 339 + * sas_remove_host - tear down a Scsi_Host's SAS data structures 340 340 * @shost: Scsi Host that is torn down 341 341 * 342 342 * Removes all SAS PHYs and remote PHYs for a given Scsi_Host. ··· 577 577 } 578 578 579 579 /** 580 - * sas_phy_alloc -- allocates and initialize a SAS PHY structure 580 + * sas_phy_alloc - allocates and initialize a SAS PHY structure 581 581 * @parent: Parent device 582 582 * @number: Phy index 583 583 * ··· 618 618 EXPORT_SYMBOL(sas_phy_alloc); 619 619 620 620 /** 621 - * sas_phy_add -- add a SAS PHY to the device hierarchy 621 + * sas_phy_add - add a SAS PHY to the device hierarchy 622 622 * @phy: The PHY to be added 623 623 * 624 624 * Publishes a SAS PHY to the rest of the system. ··· 638 638 EXPORT_SYMBOL(sas_phy_add); 639 639 640 640 /** 641 - * sas_phy_free -- free a SAS PHY 641 + * sas_phy_free - free a SAS PHY 642 642 * @phy: SAS PHY to free 643 643 * 644 644 * Frees the specified SAS PHY. ··· 655 655 EXPORT_SYMBOL(sas_phy_free); 656 656 657 657 /** 658 - * sas_phy_delete -- remove SAS PHY 658 + * sas_phy_delete - remove SAS PHY 659 659 * @phy: SAS PHY to remove 660 660 * 661 661 * Removes the specified SAS PHY. If the SAS PHY has an ··· 677 677 EXPORT_SYMBOL(sas_phy_delete); 678 678 679 679 /** 680 - * scsi_is_sas_phy -- check if a struct device represents a SAS PHY 680 + * scsi_is_sas_phy - check if a struct device represents a SAS PHY 681 681 * @dev: device to check 682 682 * 683 683 * Returns: ··· 843 843 844 844 /** 845 845 * sas_port_add - add a SAS port to the device hierarchy 846 - * 847 846 * @port: port to be added 848 847 * 849 848 * publishes a port to the rest of the system ··· 867 868 EXPORT_SYMBOL(sas_port_add); 868 869 869 870 /** 870 - * sas_port_free -- free a SAS PORT 871 + * sas_port_free - free a SAS PORT 871 872 * @port: SAS PORT to free 872 873 * 873 874 * Frees the specified SAS PORT. ··· 884 885 EXPORT_SYMBOL(sas_port_free); 885 886 886 887 /** 887 - * sas_port_delete -- remove SAS PORT 888 + * sas_port_delete - remove SAS PORT 888 889 * @port: SAS PORT to remove 889 890 * 890 891 * Removes the specified SAS PORT. If the SAS PORT has an ··· 923 924 EXPORT_SYMBOL(sas_port_delete); 924 925 925 926 /** 926 - * scsi_is_sas_port -- check if a struct device represents a SAS port 927 + * scsi_is_sas_port - check if a struct device represents a SAS port 927 928 * @dev: device to check 928 929 * 929 930 * Returns: ··· 1308 1309 1309 1310 /** 1310 1311 * sas_end_device_alloc - allocate an rphy for an end device 1312 + * @parent: which port 1311 1313 * 1312 1314 * Allocates an SAS remote PHY structure, connected to @parent. 1313 1315 * ··· 1345 1345 1346 1346 /** 1347 1347 * sas_expander_alloc - allocate an rphy for an end device 1348 + * @parent: which port 1349 + * @type: SAS_EDGE_EXPANDER_DEVICE or SAS_FANOUT_EXPANDER_DEVICE 1348 1350 * 1349 1351 * Allocates an SAS remote PHY structure, connected to @parent. 1350 1352 * ··· 1385 1383 EXPORT_SYMBOL(sas_expander_alloc); 1386 1384 1387 1385 /** 1388 - * sas_rphy_add -- add a SAS remote PHY to the device hierarchy 1386 + * sas_rphy_add - add a SAS remote PHY to the device hierarchy 1389 1387 * @rphy: The remote PHY to be added 1390 1388 * 1391 1389 * Publishes a SAS remote PHY to the rest of the system. ··· 1432 1430 EXPORT_SYMBOL(sas_rphy_add); 1433 1431 1434 1432 /** 1435 - * sas_rphy_free -- free a SAS remote PHY 1436 - * @rphy SAS remote PHY to free 1433 + * sas_rphy_free - free a SAS remote PHY 1434 + * @rphy: SAS remote PHY to free 1437 1435 * 1438 1436 * Frees the specified SAS remote PHY. 1439 1437 * ··· 1461 1459 EXPORT_SYMBOL(sas_rphy_free); 1462 1460 1463 1461 /** 1464 - * sas_rphy_delete -- remove and free SAS remote PHY 1462 + * sas_rphy_delete - remove and free SAS remote PHY 1465 1463 * @rphy: SAS remote PHY to remove and free 1466 1464 * 1467 1465 * Removes the specified SAS remote PHY and frees it. ··· 1475 1473 EXPORT_SYMBOL(sas_rphy_delete); 1476 1474 1477 1475 /** 1478 - * sas_rphy_remove -- remove SAS remote PHY 1476 + * sas_rphy_remove - remove SAS remote PHY 1479 1477 * @rphy: SAS remote phy to remove 1480 1478 * 1481 1479 * Removes the specified SAS remote PHY. ··· 1506 1504 EXPORT_SYMBOL(sas_rphy_remove); 1507 1505 1508 1506 /** 1509 - * scsi_is_sas_rphy -- check if a struct device represents a SAS remote PHY 1507 + * scsi_is_sas_rphy - check if a struct device represents a SAS remote PHY 1510 1508 * @dev: device to check 1511 1509 * 1512 1510 * Returns: ··· 1606 1604 SETUP_TEMPLATE(expander_attrs, expander_##field, S_IRUGO, 1) 1607 1605 1608 1606 /** 1609 - * sas_attach_transport -- instantiate SAS transport template 1607 + * sas_attach_transport - instantiate SAS transport template 1610 1608 * @ft: SAS transport class function template 1611 1609 */ 1612 1610 struct scsi_transport_template * ··· 1717 1715 EXPORT_SYMBOL(sas_attach_transport); 1718 1716 1719 1717 /** 1720 - * sas_release_transport -- release SAS transport template instance 1718 + * sas_release_transport - release SAS transport template instance 1721 1719 * @t: transport template instance 1722 1720 */ 1723 1721 void sas_release_transport(struct scsi_transport_template *t)
+5 -5
drivers/scsi/scsi_transport_srp.c
··· 242 242 EXPORT_SYMBOL_GPL(srp_rport_add); 243 243 244 244 /** 245 - * srp_rport_del -- remove a SRP remote port 246 - * @port: SRP remote port to remove 245 + * srp_rport_del - remove a SRP remote port 246 + * @rport: SRP remote port to remove 247 247 * 248 248 * Removes the specified SRP remote port. 249 249 */ ··· 271 271 } 272 272 273 273 /** 274 - * srp_remove_host -- tear down a Scsi_Host's SRP data structures 274 + * srp_remove_host - tear down a Scsi_Host's SRP data structures 275 275 * @shost: Scsi Host that is torn down 276 276 * 277 277 * Removes all SRP remote ports for a given Scsi_Host. ··· 297 297 } 298 298 299 299 /** 300 - * srp_attach_transport -- instantiate SRP transport template 300 + * srp_attach_transport - instantiate SRP transport template 301 301 * @ft: SRP transport class function template 302 302 */ 303 303 struct scsi_transport_template * ··· 337 337 EXPORT_SYMBOL_GPL(srp_attach_transport); 338 338 339 339 /** 340 - * srp_release_transport -- release SRP transport template instance 340 + * srp_release_transport - release SRP transport template instance 341 341 * @t: transport template instance 342 342 */ 343 343 void srp_release_transport(struct scsi_transport_template *t)
+24 -11
drivers/scsi/scsicam.c
··· 24 24 static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds, 25 25 unsigned int *secs); 26 26 27 + /** 28 + * scsi_bios_ptable - Read PC partition table out of first sector of device. 29 + * @dev: from this device 30 + * 31 + * Description: Reads the first sector from the device and returns %0x42 bytes 32 + * starting at offset %0x1be. 33 + * Returns: partition table in kmalloc(GFP_KERNEL) memory, or NULL on error. 34 + */ 27 35 unsigned char *scsi_bios_ptable(struct block_device *dev) 28 36 { 29 37 unsigned char *res = kmalloc(66, GFP_KERNEL); ··· 51 43 } 52 44 EXPORT_SYMBOL(scsi_bios_ptable); 53 45 54 - /* 55 - * Function : int scsicam_bios_param (struct block_device *bdev, ector_t capacity, int *ip) 46 + /** 47 + * scsicam_bios_param - Determine geometry of a disk in cylinders/heads/sectors. 48 + * @bdev: which device 49 + * @capacity: size of the disk in sectors 50 + * @ip: return value: ip[0]=heads, ip[1]=sectors, ip[2]=cylinders 56 51 * 57 - * Purpose : to determine the BIOS mapping used for a drive in a 52 + * Description : determine the BIOS mapping/geometry used for a drive in a 58 53 * SCSI-CAM system, storing the results in ip as required 59 54 * by the HDIO_GETGEO ioctl(). 60 55 * 61 56 * Returns : -1 on failure, 0 on success. 62 - * 63 57 */ 64 58 65 59 int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) ··· 108 98 } 109 99 EXPORT_SYMBOL(scsicam_bios_param); 110 100 111 - /* 112 - * Function : static int scsi_partsize(unsigned char *buf, unsigned long 113 - * capacity,unsigned int *cyls, unsigned int *hds, unsigned int *secs); 101 + /** 102 + * scsi_partsize - Parse cylinders/heads/sectors from PC partition table 103 + * @buf: partition table, see scsi_bios_ptable() 104 + * @capacity: size of the disk in sectors 105 + * @cyls: put cylinders here 106 + * @hds: put heads here 107 + * @secs: put sectors here 114 108 * 115 - * Purpose : to determine the BIOS mapping used to create the partition 109 + * Description: determine the BIOS mapping/geometry used to create the partition 116 110 * table, storing the results in *cyls, *hds, and *secs 117 111 * 118 - * Returns : -1 on failure, 0 on success. 119 - * 112 + * Returns: -1 on failure, 0 on success. 120 113 */ 121 114 122 115 int scsi_partsize(unsigned char *buf, unsigned long capacity, ··· 207 194 * 208 195 * WORKING X3T9.2 209 196 * DRAFT 792D 210 - * 197 + * see http://www.t10.org/ftp/t10/drafts/cam/cam-r12b.pdf 211 198 * 212 199 * Revision 6 213 200 * 10-MAR-94