@@ -112,9 +112,9 @@ Those usages in group c) should be handled with care, especially in a
112
112
that are shared with the mid level and other layers.
113
113
114
114
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
116
116
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 */ } ``
118
118
119
119
.. [# ] the scsi_host_alloc() function is a replacement for the rather vaguely
120
120
named scsi_register() function in most situations.
@@ -149,21 +149,21 @@ scsi devices of which only the first 2 respond::
149
149
scsi_add_host() ---->
150
150
scsi_scan_host() -------+
151
151
|
152
- slave_alloc ()
153
- slave_configure () --> scsi_change_queue_depth()
152
+ sdev_init ()
153
+ sdev_configure () --> scsi_change_queue_depth()
154
154
|
155
- slave_alloc ()
156
- slave_configure ()
155
+ sdev_init ()
156
+ sdev_configure ()
157
157
|
158
- slave_alloc () ***
159
- slave_destroy () ***
158
+ sdev_init () ***
159
+ sdev_destroy () ***
160
160
161
161
162
162
*** 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.
164
164
165
165
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.
167
167
168
168
When an HBA is being removed it could be as part of an orderly shutdown
169
169
associated with the LLD module being unloaded (e.g. with the "rmmod"
@@ -176,8 +176,8 @@ same::
176
176
===----------------------=========-----------------===------
177
177
scsi_remove_host() ---------+
178
178
|
179
- slave_destroy ()
180
- slave_destroy ()
179
+ sdev_destroy ()
180
+ sdev_destroy ()
181
181
scsi_host_put()
182
182
183
183
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::
202
202
===-------------------=========--------------------===------
203
203
scsi_add_device() ------+
204
204
|
205
- slave_alloc ()
206
- slave_configure () [--> scsi_change_queue_depth()]
205
+ sdev_init ()
206
+ sdev_configure () [--> scsi_change_queue_depth()]
207
207
208
208
In a similar fashion, an LLD may become aware that a SCSI device has been
209
209
removed (unplugged) or the connection to it has been interrupted. Some
@@ -218,12 +218,12 @@ upper layers with this sequence::
218
218
===----------------------=========-----------------===------
219
219
scsi_remove_device() -------+
220
220
|
221
- slave_destroy ()
221
+ sdev_destroy ()
222
222
223
223
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 ().
227
227
228
228
229
229
Reference Counting
@@ -331,7 +331,7 @@ Details::
331
331
* bus scan when an HBA is added (i.e. scsi_scan_host()). So it
332
332
* should only be called if the HBA becomes aware of a new scsi
333
333
* 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
335
335
* into the LLD.
336
336
*
337
337
* Defined in: drivers/scsi/scsi_scan.c
@@ -374,8 +374,8 @@ Details::
374
374
* Might block: no
375
375
*
376
376
* 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.
379
379
*
380
380
* Defined in: drivers/scsi/scsi.c [see source code for more notes]
381
381
*
@@ -506,7 +506,7 @@ Details::
506
506
* Notes: If an LLD becomes aware that a scsi device (lu) has
507
507
* been removed but its host is still present then it can request
508
508
* 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
510
510
* invalid pointer after this call.
511
511
*
512
512
* Defined in: drivers/scsi/scsi_sysfs.c .
@@ -627,14 +627,14 @@ Interface functions are supplied (defined) by LLDs and their function
627
627
pointers are placed in an instance of struct scsi_host_template which
628
628
is passed to scsi_host_alloc() [or scsi_register() / init_this_scsi_driver()].
629
629
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 ()
631
631
function as::
632
632
633
- static int xyz_slave_configure (struct scsi_device * sdev);
633
+ static int xyz_sdev_configure (struct scsi_device * sdev);
634
634
635
635
and so forth for all interface functions listed below.
636
636
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
638
638
of a "struct scsi_host_template" instance. A pointer to such an instance
639
639
should be passed to the mid level's scsi_host_alloc() [or scsi_register() /
640
640
init_this_scsi_driver()].
@@ -657,9 +657,9 @@ Summary:
657
657
- ioctl - driver can respond to ioctls
658
658
- proc_info - supports /proc/scsi/{driver_name}/{host_no}
659
659
- 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
663
663
664
664
665
665
Details::
@@ -960,7 +960,7 @@ Details::
960
960
961
961
962
962
/**
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
964
964
* (i.e. just prior to scan) this call is made
965
965
* @sdp: pointer to new device (about to be scanned)
966
966
*
@@ -975,24 +975,24 @@ Details::
975
975
* prior to its initial scan. The corresponding scsi device may not
976
976
* exist but the mid level is just about to scan for it (i.e. send
977
977
* 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.
980
980
* For more details see the include/scsi/scsi_host.h file.
981
981
*
982
982
* Optionally defined in: LLD
983
983
**/
984
- int slave_alloc (struct scsi_device *sdp)
984
+ int sdev_init (struct scsi_device *sdp)
985
985
986
986
987
987
/**
988
- * slave_configure - driver fine tuning for given device just after it
988
+ * sdev_configure - driver fine tuning for given device just after it
989
989
* has been first scanned (i.e. it responded to an
990
990
* INQUIRY)
991
991
* @sdp: device that has just been attached
992
992
*
993
993
* Returns 0 if ok. Any other return is assumed to be an error and
994
994
* 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.]
996
996
*
997
997
* Locks: none
998
998
*
@@ -1004,11 +1004,11 @@ Details::
1004
1004
*
1005
1005
* Optionally defined in: LLD
1006
1006
**/
1007
- int slave_configure (struct scsi_device *sdp)
1007
+ int sdev_configure (struct scsi_device *sdp)
1008
1008
1009
1009
1010
1010
/**
1011
- * slave_destroy - given device is about to be shut down. All
1011
+ * sdev_destroy - given device is about to be shut down. All
1012
1012
* activity has ceased on this device.
1013
1013
* @sdp: device that is about to be shut down
1014
1014
*
@@ -1023,12 +1023,12 @@ Details::
1023
1023
* by this driver for given device should be freed now. No further
1024
1024
* commands will be sent for this sdp instance. [However the device
1025
1025
* 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.]
1028
1028
*
1029
1029
* Optionally defined in: LLD
1030
1030
**/
1031
- void slave_destroy (struct scsi_device *sdp)
1031
+ void sdev_destroy (struct scsi_device *sdp)
1032
1032
1033
1033
1034
1034
0 commit comments