diff options
author | Rob Landley <rob@landley.net> | 2007-11-03 14:30:39 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:40 -0500 |
commit | eb44820c28bc9a042e1157b41c677018a8fdfc74 (patch) | |
tree | de027b3cd40533488805ef7ee8156f077cd2b7e5 /drivers/scsi/scsi_lib.c | |
parent | 3f48985823001c89c9bd5c5e57cc07530578dfcc (diff) |
[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>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a9ac5b1b1667..199b02452259 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -175,7 +175,7 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) | |||
175 | * | 175 | * |
176 | * returns the req->errors value which is the scsi_cmnd result | 176 | * returns the req->errors value which is the scsi_cmnd result |
177 | * field. | 177 | * field. |
178 | **/ | 178 | */ |
179 | int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, | 179 | int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, |
180 | int data_direction, void *buffer, unsigned bufflen, | 180 | int data_direction, void *buffer, unsigned bufflen, |
181 | unsigned char *sense, int timeout, int retries, int flags) | 181 | unsigned char *sense, int timeout, int retries, int flags) |
@@ -274,7 +274,7 @@ static void scsi_bi_endio(struct bio *bio, int error) | |||
274 | /** | 274 | /** |
275 | * scsi_req_map_sg - map a scatterlist into a request | 275 | * scsi_req_map_sg - map a scatterlist into a request |
276 | * @rq: request to fill | 276 | * @rq: request to fill |
277 | * @sg: scatterlist | 277 | * @sgl: scatterlist |
278 | * @nsegs: number of elements | 278 | * @nsegs: number of elements |
279 | * @bufflen: len of buffer | 279 | * @bufflen: len of buffer |
280 | * @gfp: memory allocation flags | 280 | * @gfp: memory allocation flags |
@@ -365,14 +365,16 @@ free_bios: | |||
365 | * @sdev: scsi device | 365 | * @sdev: scsi device |
366 | * @cmd: scsi command | 366 | * @cmd: scsi command |
367 | * @cmd_len: length of scsi cdb | 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 | * @buffer: data buffer (this can be a kernel buffer or scatterlist) | 369 | * @buffer: data buffer (this can be a kernel buffer or scatterlist) |
370 | * @bufflen: len of buffer | 370 | * @bufflen: len of buffer |
371 | * @use_sg: if buffer is a scatterlist this is the number of elements | 371 | * @use_sg: if buffer is a scatterlist this is the number of elements |
372 | * @timeout: request timeout in seconds | 372 | * @timeout: request timeout in seconds |
373 | * @retries: number of times to retry request | 373 | * @retries: number of times to retry request |
374 | * @flags: or into request flags | 374 | * @privdata: data passed to done() |
375 | **/ | 375 | * @done: callback function when done |
376 | * @gfp: memory allocation flags | ||
377 | */ | ||
376 | int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, | 378 | int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, |
377 | int cmd_len, int data_direction, void *buffer, unsigned bufflen, | 379 | int cmd_len, int data_direction, void *buffer, unsigned bufflen, |
378 | int use_sg, int timeout, int retries, void *privdata, | 380 | int use_sg, int timeout, int retries, void *privdata, |
@@ -1804,7 +1806,7 @@ void scsi_exit_queue(void) | |||
1804 | * @timeout: command timeout | 1806 | * @timeout: command timeout |
1805 | * @retries: number of retries before failing | 1807 | * @retries: number of retries before failing |
1806 | * @data: returns a structure abstracting the mode header data | 1808 | * @data: returns a structure abstracting the mode header data |
1807 | * @sense: place to put sense data (or NULL if no sense to be collected). | 1809 | * @sshdr: place to put sense data (or NULL if no sense to be collected). |
1808 | * must be SCSI_SENSE_BUFFERSIZE big. | 1810 | * must be SCSI_SENSE_BUFFERSIZE big. |
1809 | * | 1811 | * |
1810 | * Returns zero if successful; negative error number or scsi | 1812 | * Returns zero if successful; negative error number or scsi |
@@ -1871,8 +1873,7 @@ scsi_mode_select(struct scsi_device *sdev, int pf, int sp, int modepage, | |||
1871 | EXPORT_SYMBOL_GPL(scsi_mode_select); | 1873 | EXPORT_SYMBOL_GPL(scsi_mode_select); |
1872 | 1874 | ||
1873 | /** | 1875 | /** |
1874 | * scsi_mode_sense - issue a mode sense, falling back from 10 to | 1876 | * scsi_mode_sense - issue a mode sense, falling back from 10 to six bytes if necessary. |
1875 | * six bytes if necessary. | ||
1876 | * @sdev: SCSI device to be queried | 1877 | * @sdev: SCSI device to be queried |
1877 | * @dbd: set if mode sense will allow block descriptors to be returned | 1878 | * @dbd: set if mode sense will allow block descriptors to be returned |
1878 | * @modepage: mode page being requested | 1879 | * @modepage: mode page being requested |
@@ -1881,13 +1882,13 @@ EXPORT_SYMBOL_GPL(scsi_mode_select); | |||
1881 | * @timeout: command timeout | 1882 | * @timeout: command timeout |
1882 | * @retries: number of retries before failing | 1883 | * @retries: number of retries before failing |
1883 | * @data: returns a structure abstracting the mode header data | 1884 | * @data: returns a structure abstracting the mode header data |
1884 | * @sense: place to put sense data (or NULL if no sense to be collected). | 1885 | * @sshdr: place to put sense data (or NULL if no sense to be collected). |
1885 | * must be SCSI_SENSE_BUFFERSIZE big. | 1886 | * must be SCSI_SENSE_BUFFERSIZE big. |
1886 | * | 1887 | * |
1887 | * Returns zero if unsuccessful, or the header offset (either 4 | 1888 | * Returns zero if unsuccessful, or the header offset (either 4 |
1888 | * or 8 depending on whether a six or ten byte command was | 1889 | * or 8 depending on whether a six or ten byte command was |
1889 | * issued) if successful. | 1890 | * issued) if successful. |
1890 | **/ | 1891 | */ |
1891 | int | 1892 | int |
1892 | scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, | 1893 | scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, |
1893 | unsigned char *buffer, int len, int timeout, int retries, | 1894 | unsigned char *buffer, int len, int timeout, int retries, |
@@ -2007,14 +2008,13 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries) | |||
2007 | EXPORT_SYMBOL(scsi_test_unit_ready); | 2008 | EXPORT_SYMBOL(scsi_test_unit_ready); |
2008 | 2009 | ||
2009 | /** | 2010 | /** |
2010 | * scsi_device_set_state - Take the given device through the device | 2011 | * scsi_device_set_state - Take the given device through the device state model. |
2011 | * state model. | ||
2012 | * @sdev: scsi device to change the state of. | 2012 | * @sdev: scsi device to change the state of. |
2013 | * @state: state to change to. | 2013 | * @state: state to change to. |
2014 | * | 2014 | * |
2015 | * Returns zero if unsuccessful or an error if the requested | 2015 | * Returns zero if unsuccessful or an error if the requested |
2016 | * transition is illegal. | 2016 | * transition is illegal. |
2017 | **/ | 2017 | */ |
2018 | int | 2018 | int |
2019 | scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | 2019 | scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) |
2020 | { | 2020 | { |
@@ -2264,7 +2264,7 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple); | |||
2264 | * Must be called with user context, may sleep. | 2264 | * Must be called with user context, may sleep. |
2265 | * | 2265 | * |
2266 | * Returns zero if unsuccessful or an error if not. | 2266 | * Returns zero if unsuccessful or an error if not. |
2267 | **/ | 2267 | */ |
2268 | int | 2268 | int |
2269 | scsi_device_quiesce(struct scsi_device *sdev) | 2269 | scsi_device_quiesce(struct scsi_device *sdev) |
2270 | { | 2270 | { |
@@ -2289,7 +2289,7 @@ EXPORT_SYMBOL(scsi_device_quiesce); | |||
2289 | * queues. | 2289 | * queues. |
2290 | * | 2290 | * |
2291 | * Must be called with user context, may sleep. | 2291 | * Must be called with user context, may sleep. |
2292 | **/ | 2292 | */ |
2293 | void | 2293 | void |
2294 | scsi_device_resume(struct scsi_device *sdev) | 2294 | scsi_device_resume(struct scsi_device *sdev) |
2295 | { | 2295 | { |
@@ -2326,8 +2326,7 @@ scsi_target_resume(struct scsi_target *starget) | |||
2326 | EXPORT_SYMBOL(scsi_target_resume); | 2326 | EXPORT_SYMBOL(scsi_target_resume); |
2327 | 2327 | ||
2328 | /** | 2328 | /** |
2329 | * scsi_internal_device_block - internal function to put a device | 2329 | * scsi_internal_device_block - internal function to put a device temporarily into the SDEV_BLOCK state |
2330 | * temporarily into the SDEV_BLOCK state | ||
2331 | * @sdev: device to block | 2330 | * @sdev: device to block |
2332 | * | 2331 | * |
2333 | * Block request made by scsi lld's to temporarily stop all | 2332 | * Block request made by scsi lld's to temporarily stop all |
@@ -2342,7 +2341,7 @@ EXPORT_SYMBOL(scsi_target_resume); | |||
2342 | * state, all commands are deferred until the scsi lld reenables | 2341 | * state, all commands are deferred until the scsi lld reenables |
2343 | * the device with scsi_device_unblock or device_block_tmo fires. | 2342 | * the device with scsi_device_unblock or device_block_tmo fires. |
2344 | * This routine assumes the host_lock is held on entry. | 2343 | * This routine assumes the host_lock is held on entry. |
2345 | **/ | 2344 | */ |
2346 | int | 2345 | int |
2347 | scsi_internal_device_block(struct scsi_device *sdev) | 2346 | scsi_internal_device_block(struct scsi_device *sdev) |
2348 | { | 2347 | { |
@@ -2382,7 +2381,7 @@ EXPORT_SYMBOL_GPL(scsi_internal_device_block); | |||
2382 | * (which must be a legal transition) allowing the midlayer to | 2381 | * (which must be a legal transition) allowing the midlayer to |
2383 | * goose the queue for this device. This routine assumes the | 2382 | * goose the queue for this device. This routine assumes the |
2384 | * host_lock is held upon entry. | 2383 | * host_lock is held upon entry. |
2385 | **/ | 2384 | */ |
2386 | int | 2385 | int |
2387 | scsi_internal_device_unblock(struct scsi_device *sdev) | 2386 | scsi_internal_device_unblock(struct scsi_device *sdev) |
2388 | { | 2387 | { |
@@ -2460,7 +2459,7 @@ EXPORT_SYMBOL_GPL(scsi_target_unblock); | |||
2460 | 2459 | ||
2461 | /** | 2460 | /** |
2462 | * scsi_kmap_atomic_sg - find and atomically map an sg-elemnt | 2461 | * scsi_kmap_atomic_sg - find and atomically map an sg-elemnt |
2463 | * @sg: scatter-gather list | 2462 | * @sgl: scatter-gather list |
2464 | * @sg_count: number of segments in sg | 2463 | * @sg_count: number of segments in sg |
2465 | * @offset: offset in bytes into sg, on return offset into the mapped area | 2464 | * @offset: offset in bytes into sg, on return offset into the mapped area |
2466 | * @len: bytes to map, on return number of bytes mapped | 2465 | * @len: bytes to map, on return number of bytes mapped |
@@ -2509,8 +2508,7 @@ void *scsi_kmap_atomic_sg(struct scatterlist *sgl, int sg_count, | |||
2509 | EXPORT_SYMBOL(scsi_kmap_atomic_sg); | 2508 | EXPORT_SYMBOL(scsi_kmap_atomic_sg); |
2510 | 2509 | ||
2511 | /** | 2510 | /** |
2512 | * scsi_kunmap_atomic_sg - atomically unmap a virtual address, previously | 2511 | * scsi_kunmap_atomic_sg - atomically unmap a virtual address, previously mapped with scsi_kmap_atomic_sg |
2513 | * mapped with scsi_kmap_atomic_sg | ||
2514 | * @virt: virtual address to be unmapped | 2512 | * @virt: virtual address to be unmapped |
2515 | */ | 2513 | */ |
2516 | void scsi_kunmap_atomic_sg(void *virt) | 2514 | void scsi_kunmap_atomic_sg(void *virt) |