Skip to content

Commit b0d3b85

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: core: Update API documentation
Since the .slave_alloc(), .slave_destroy() and .slave_configure() methods have been renamed in struct scsi_host_template, also rename these in the API documentation. Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Damien Le Maol <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0f98212 commit b0d3b85

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

Documentation/scsi/scsi_mid_low_api.rst

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ Those usages in group c) should be handled with care, especially in a
112112
that are shared with the mid level and other layers.
113113

114114
All functions defined within an LLD and all data defined at file scope
115-
should be static. For example the slave_alloc() function in an LLD
115+
should be static. For example the sdev_init() function in an LLD
116116
called "xxx" could be defined as
117-
``static int xxx_slave_alloc(struct scsi_device * sdev) { /* code */ }``
117+
``static int xxx_sdev_init(struct scsi_device * sdev) { /* code */ }``
118118

119119
.. [#] the scsi_host_alloc() function is a replacement for the rather vaguely
120120
named scsi_register() function in most situations.
@@ -149,21 +149,21 @@ scsi devices of which only the first 2 respond::
149149
scsi_add_host() ---->
150150
scsi_scan_host() -------+
151151
|
152-
slave_alloc()
153-
slave_configure() --> scsi_change_queue_depth()
152+
sdev_init()
153+
sdev_configure() --> scsi_change_queue_depth()
154154
|
155-
slave_alloc()
156-
slave_configure()
155+
sdev_init()
156+
sdev_configure()
157157
|
158-
slave_alloc() ***
159-
slave_destroy() ***
158+
sdev_init() ***
159+
sdev_destroy() ***
160160

161161

162162
*** For scsi devices that the mid level tries to scan but do not
163-
respond, a slave_alloc(), slave_destroy() pair is called.
163+
respond, a sdev_init(), sdev_destroy() pair is called.
164164

165165
If the LLD wants to adjust the default queue settings, it can invoke
166-
scsi_change_queue_depth() in its slave_configure() routine.
166+
scsi_change_queue_depth() in its sdev_configure() routine.
167167

168168
When an HBA is being removed it could be as part of an orderly shutdown
169169
associated with the LLD module being unloaded (e.g. with the "rmmod"
@@ -176,8 +176,8 @@ same::
176176
===----------------------=========-----------------===------
177177
scsi_remove_host() ---------+
178178
|
179-
slave_destroy()
180-
slave_destroy()
179+
sdev_destroy()
180+
sdev_destroy()
181181
scsi_host_put()
182182

183183
It may be useful for a LLD to keep track of struct Scsi_Host instances
@@ -202,8 +202,8 @@ An LLD can use this sequence to make the mid level aware of a SCSI device::
202202
===-------------------=========--------------------===------
203203
scsi_add_device() ------+
204204
|
205-
slave_alloc()
206-
slave_configure() [--> scsi_change_queue_depth()]
205+
sdev_init()
206+
sdev_configure() [--> scsi_change_queue_depth()]
207207

208208
In a similar fashion, an LLD may become aware that a SCSI device has been
209209
removed (unplugged) or the connection to it has been interrupted. Some
@@ -218,12 +218,12 @@ upper layers with this sequence::
218218
===----------------------=========-----------------===------
219219
scsi_remove_device() -------+
220220
|
221-
slave_destroy()
221+
sdev_destroy()
222222

223223
It may be useful for an LLD to keep track of struct scsi_device instances
224-
(a pointer is passed as the parameter to slave_alloc() and
225-
slave_configure() callbacks). Such instances are "owned" by the mid-level.
226-
struct scsi_device instances are freed after slave_destroy().
224+
(a pointer is passed as the parameter to sdev_init() and
225+
sdev_configure() callbacks). Such instances are "owned" by the mid-level.
226+
struct scsi_device instances are freed after sdev_destroy().
227227

228228

229229
Reference Counting
@@ -331,7 +331,7 @@ Details::
331331
* bus scan when an HBA is added (i.e. scsi_scan_host()). So it
332332
* should only be called if the HBA becomes aware of a new scsi
333333
* device (lu) after scsi_scan_host() has completed. If successful
334-
* this call can lead to slave_alloc() and slave_configure() callbacks
334+
* this call can lead to sdev_init() and sdev_configure() callbacks
335335
* into the LLD.
336336
*
337337
* Defined in: drivers/scsi/scsi_scan.c
@@ -374,8 +374,8 @@ Details::
374374
* Might block: no
375375
*
376376
* Notes: Can be invoked any time on a SCSI device controlled by this
377-
* LLD. [Specifically during and after slave_configure() and prior to
378-
* slave_destroy().] Can safely be invoked from interrupt code.
377+
* LLD. [Specifically during and after sdev_configure() and prior to
378+
* sdev_destroy().] Can safely be invoked from interrupt code.
379379
*
380380
* Defined in: drivers/scsi/scsi.c [see source code for more notes]
381381
*
@@ -506,7 +506,7 @@ Details::
506506
* Notes: If an LLD becomes aware that a scsi device (lu) has
507507
* been removed but its host is still present then it can request
508508
* the removal of that scsi device. If successful this call will
509-
* lead to the slave_destroy() callback being invoked. sdev is an
509+
* lead to the sdev_destroy() callback being invoked. sdev is an
510510
* invalid pointer after this call.
511511
*
512512
* Defined in: drivers/scsi/scsi_sysfs.c .
@@ -627,14 +627,14 @@ Interface functions are supplied (defined) by LLDs and their function
627627
pointers are placed in an instance of struct scsi_host_template which
628628
is passed to scsi_host_alloc() [or scsi_register() / init_this_scsi_driver()].
629629
Some are mandatory. Interface functions should be declared static. The
630-
accepted convention is that driver "xyz" will declare its slave_configure()
630+
accepted convention is that driver "xyz" will declare its sdev_configure()
631631
function as::
632632

633-
static int xyz_slave_configure(struct scsi_device * sdev);
633+
static int xyz_sdev_configure(struct scsi_device * sdev);
634634

635635
and so forth for all interface functions listed below.
636636

637-
A pointer to this function should be placed in the 'slave_configure' member
637+
A pointer to this function should be placed in the 'sdev_configure' member
638638
of a "struct scsi_host_template" instance. A pointer to such an instance
639639
should be passed to the mid level's scsi_host_alloc() [or scsi_register() /
640640
init_this_scsi_driver()].
@@ -657,9 +657,9 @@ Summary:
657657
- ioctl - driver can respond to ioctls
658658
- proc_info - supports /proc/scsi/{driver_name}/{host_no}
659659
- queuecommand - queue scsi command, invoke 'done' on completion
660-
- slave_alloc - prior to any commands being sent to a new device
661-
- slave_configure - driver fine tuning for given device after attach
662-
- slave_destroy - given device is about to be shut down
660+
- sdev_init - prior to any commands being sent to a new device
661+
- sdev_configure - driver fine tuning for given device after attach
662+
- sdev_destroy - given device is about to be shut down
663663

664664

665665
Details::
@@ -960,7 +960,7 @@ Details::
960960

961961

962962
/**
963-
* slave_alloc - prior to any commands being sent to a new device
963+
* sdev_init - prior to any commands being sent to a new device
964964
* (i.e. just prior to scan) this call is made
965965
* @sdp: pointer to new device (about to be scanned)
966966
*
@@ -975,24 +975,24 @@ Details::
975975
* prior to its initial scan. The corresponding scsi device may not
976976
* exist but the mid level is just about to scan for it (i.e. send
977977
* and INQUIRY command plus ...). If a device is found then
978-
* slave_configure() will be called while if a device is not found
979-
* slave_destroy() is called.
978+
* sdev_configure() will be called while if a device is not found
979+
* sdev_destroy() is called.
980980
* For more details see the include/scsi/scsi_host.h file.
981981
*
982982
* Optionally defined in: LLD
983983
**/
984-
int slave_alloc(struct scsi_device *sdp)
984+
int sdev_init(struct scsi_device *sdp)
985985

986986

987987
/**
988-
* slave_configure - driver fine tuning for given device just after it
988+
* sdev_configure - driver fine tuning for given device just after it
989989
* has been first scanned (i.e. it responded to an
990990
* INQUIRY)
991991
* @sdp: device that has just been attached
992992
*
993993
* Returns 0 if ok. Any other return is assumed to be an error and
994994
* the device is taken offline. [offline devices will _not_ have
995-
* slave_destroy() called on them so clean up resources.]
995+
* sdev_destroy() called on them so clean up resources.]
996996
*
997997
* Locks: none
998998
*
@@ -1004,11 +1004,11 @@ Details::
10041004
*
10051005
* Optionally defined in: LLD
10061006
**/
1007-
int slave_configure(struct scsi_device *sdp)
1007+
int sdev_configure(struct scsi_device *sdp)
10081008

10091009

10101010
/**
1011-
* slave_destroy - given device is about to be shut down. All
1011+
* sdev_destroy - given device is about to be shut down. All
10121012
* activity has ceased on this device.
10131013
* @sdp: device that is about to be shut down
10141014
*
@@ -1023,12 +1023,12 @@ Details::
10231023
* by this driver for given device should be freed now. No further
10241024
* commands will be sent for this sdp instance. [However the device
10251025
* could be re-attached in the future in which case a new instance
1026-
* of struct scsi_device would be supplied by future slave_alloc()
1027-
* and slave_configure() calls.]
1026+
* of struct scsi_device would be supplied by future sdev_init()
1027+
* and sdev_configure() calls.]
10281028
*
10291029
* Optionally defined in: LLD
10301030
**/
1031-
void slave_destroy(struct scsi_device *sdp)
1031+
void sdev_destroy(struct scsi_device *sdp)
10321032

10331033

10341034

0 commit comments

Comments
 (0)