Skip to content

Commit 0481990

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6
2 parents db400b3 + 17fa53d commit 0481990

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+6833
-9050
lines changed

Documentation/scsi/aic7xxx.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
====================================================================
2-
= Adaptec Aic7xxx Fast -> Ultra160 Family Manager Set v6.2.28 =
2+
= Adaptec Aic7xxx Fast -> Ultra160 Family Manager Set v7.0 =
33
= README for =
44
= The Linux Operating System =
55
====================================================================
@@ -131,6 +131,10 @@ The following information is available in this file:
131131
SCSI "stub" effects.
132132

133133
2. Version History
134+
7.0 (4th August, 2005)
135+
- Updated driver to use SCSI transport class infrastructure
136+
- Upported sequencer and core fixes from last adaptec released
137+
version of the driver.
134138
6.2.36 (June 3rd, 2003)
135139
- Correct code that disables PCI parity error checking.
136140
- Correct and simplify handling of the ignore wide residue

Documentation/scsi/scsi_mid_low_api.txt

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,11 @@ Summary:
373373
scsi_activate_tcq - turn on tag command queueing
374374
scsi_add_device - creates new scsi device (lu) instance
375375
scsi_add_host - perform sysfs registration and SCSI bus scan.
376-
scsi_add_timer - (re-)start timer on a SCSI command.
377376
scsi_adjust_queue_depth - change the queue depth on a SCSI device
378377
scsi_assign_lock - replace default host_lock with given lock
379378
scsi_bios_ptable - return copy of block device's partition table
380379
scsi_block_requests - prevent further commands being queued to given host
381380
scsi_deactivate_tcq - turn off tag command queueing
382-
scsi_delete_timer - cancel timer on a SCSI command.
383381
scsi_host_alloc - return a new scsi_host instance whose refcount==1
384382
scsi_host_get - increments Scsi_Host instance's refcount
385383
scsi_host_put - decrements Scsi_Host instance's refcount (free if 0)
@@ -457,27 +455,6 @@ struct scsi_device * scsi_add_device(struct Scsi_Host *shost,
457455
int scsi_add_host(struct Scsi_Host *shost, struct device * dev)
458456

459457

460-
/**
461-
* scsi_add_timer - (re-)start timer on a SCSI command.
462-
* @scmd: pointer to scsi command instance
463-
* @timeout: duration of timeout in "jiffies"
464-
* @complete: pointer to function to call if timeout expires
465-
*
466-
* Returns nothing
467-
*
468-
* Might block: no
469-
*
470-
* Notes: Each scsi command has its own timer, and as it is added
471-
* to the queue, we set up the timer. When the command completes,
472-
* we cancel the timer. An LLD can use this function to change
473-
* the existing timeout value.
474-
*
475-
* Defined in: drivers/scsi/scsi_error.c
476-
**/
477-
void scsi_add_timer(struct scsi_cmnd *scmd, int timeout,
478-
void (*complete)(struct scsi_cmnd *))
479-
480-
481458
/**
482459
* scsi_adjust_queue_depth - allow LLD to change queue depth on a SCSI device
483460
* @sdev: pointer to SCSI device to change queue depth on
@@ -565,24 +542,6 @@ void scsi_block_requests(struct Scsi_Host * shost)
565542
void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
566543

567544

568-
/**
569-
* scsi_delete_timer - cancel timer on a SCSI command.
570-
* @scmd: pointer to scsi command instance
571-
*
572-
* Returns 1 if able to cancel timer else 0 (i.e. too late or already
573-
* cancelled).
574-
*
575-
* Might block: no [may in the future if it invokes del_timer_sync()]
576-
*
577-
* Notes: All commands issued by upper levels already have a timeout
578-
* associated with them. An LLD can use this function to cancel the
579-
* timer.
580-
*
581-
* Defined in: drivers/scsi/scsi_error.c
582-
**/
583-
int scsi_delete_timer(struct scsi_cmnd *scmd)
584-
585-
586545
/**
587546
* scsi_host_alloc - create a scsi host adapter instance and perform basic
588547
* initialization.

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,13 @@ L: emu10k1-devel@lists.sourceforge.net
822822
W: http://sourceforge.net/projects/emu10k1/
823823
S: Maintained
824824

825+
EMULEX LPFC FC SCSI DRIVER
826+
P: James Smart
827+
M: james.smart@emulex.com
828+
L: linux-scsi@vger.kernel.org
829+
W: http://sourceforge.net/projects/lpfcxxxx
830+
S: Supported
831+
825832
EPSON 1355 FRAMEBUFFER DRIVER
826833
P: Christopher Hoover
827834
M: ch@murgatroid.com, ch@hpl.hp.com

drivers/base/attribute_container.c

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,26 @@
2222
/* This is a private structure used to tie the classdev and the
2323
* container .. it should never be visible outside this file */
2424
struct internal_container {
25-
struct list_head node;
25+
struct klist_node node;
2626
struct attribute_container *cont;
2727
struct class_device classdev;
2828
};
2929

30+
static void internal_container_klist_get(struct klist_node *n)
31+
{
32+
struct internal_container *ic =
33+
container_of(n, struct internal_container, node);
34+
class_device_get(&ic->classdev);
35+
}
36+
37+
static void internal_container_klist_put(struct klist_node *n)
38+
{
39+
struct internal_container *ic =
40+
container_of(n, struct internal_container, node);
41+
class_device_put(&ic->classdev);
42+
}
43+
44+
3045
/**
3146
* attribute_container_classdev_to_container - given a classdev, return the container
3247
*
@@ -57,7 +72,8 @@ int
5772
attribute_container_register(struct attribute_container *cont)
5873
{
5974
INIT_LIST_HEAD(&cont->node);
60-
INIT_LIST_HEAD(&cont->containers);
75+
klist_init(&cont->containers,internal_container_klist_get,
76+
internal_container_klist_put);
6177

6278
down(&attribute_container_mutex);
6379
list_add_tail(&cont->node, &attribute_container_list);
@@ -77,11 +93,13 @@ attribute_container_unregister(struct attribute_container *cont)
7793
{
7894
int retval = -EBUSY;
7995
down(&attribute_container_mutex);
80-
if (!list_empty(&cont->containers))
96+
spin_lock(&cont->containers.k_lock);
97+
if (!list_empty(&cont->containers.k_list))
8198
goto out;
8299
retval = 0;
83100
list_del(&cont->node);
84101
out:
102+
spin_unlock(&cont->containers.k_lock);
85103
up(&attribute_container_mutex);
86104
return retval;
87105

@@ -140,7 +158,6 @@ attribute_container_add_device(struct device *dev,
140158
continue;
141159
}
142160
memset(ic, 0, sizeof(struct internal_container));
143-
INIT_LIST_HEAD(&ic->node);
144161
ic->cont = cont;
145162
class_device_initialize(&ic->classdev);
146163
ic->classdev.dev = get_device(dev);
@@ -151,11 +168,22 @@ attribute_container_add_device(struct device *dev,
151168
fn(cont, dev, &ic->classdev);
152169
else
153170
attribute_container_add_class_device(&ic->classdev);
154-
list_add_tail(&ic->node, &cont->containers);
171+
klist_add_tail(&ic->node, &cont->containers);
155172
}
156173
up(&attribute_container_mutex);
157174
}
158175

176+
/* FIXME: can't break out of this unless klist_iter_exit is also
177+
* called before doing the break
178+
*/
179+
#define klist_for_each_entry(pos, head, member, iter) \
180+
for (klist_iter_init(head, iter); (pos = ({ \
181+
struct klist_node *n = klist_next(iter); \
182+
n ? container_of(n, typeof(*pos), member) : \
183+
({ klist_iter_exit(iter) ; NULL; }); \
184+
}) ) != NULL; )
185+
186+
159187
/**
160188
* attribute_container_remove_device - make device eligible for removal.
161189
*
@@ -182,17 +210,19 @@ attribute_container_remove_device(struct device *dev,
182210

183211
down(&attribute_container_mutex);
184212
list_for_each_entry(cont, &attribute_container_list, node) {
185-
struct internal_container *ic, *tmp;
213+
struct internal_container *ic;
214+
struct klist_iter iter;
186215

187216
if (attribute_container_no_classdevs(cont))
188217
continue;
189218

190219
if (!cont->match(cont, dev))
191220
continue;
192-
list_for_each_entry_safe(ic, tmp, &cont->containers, node) {
221+
222+
klist_for_each_entry(ic, &cont->containers, node, &iter) {
193223
if (dev != ic->classdev.dev)
194224
continue;
195-
list_del(&ic->node);
225+
klist_del(&ic->node);
196226
if (fn)
197227
fn(cont, dev, &ic->classdev);
198228
else {
@@ -225,12 +255,18 @@ attribute_container_device_trigger(struct device *dev,
225255

226256
down(&attribute_container_mutex);
227257
list_for_each_entry(cont, &attribute_container_list, node) {
228-
struct internal_container *ic, *tmp;
258+
struct internal_container *ic;
259+
struct klist_iter iter;
229260

230261
if (!cont->match(cont, dev))
231262
continue;
232263

233-
list_for_each_entry_safe(ic, tmp, &cont->containers, node) {
264+
if (attribute_container_no_classdevs(cont)) {
265+
fn(cont, dev, NULL);
266+
continue;
267+
}
268+
269+
klist_for_each_entry(ic, &cont->containers, node, &iter) {
234270
if (dev == ic->classdev.dev)
235271
fn(cont, dev, &ic->classdev);
236272
}
@@ -368,6 +404,36 @@ attribute_container_class_device_del(struct class_device *classdev)
368404
}
369405
EXPORT_SYMBOL_GPL(attribute_container_class_device_del);
370406

407+
/**
408+
* attribute_container_find_class_device - find the corresponding class_device
409+
*
410+
* @cont: the container
411+
* @dev: the generic device
412+
*
413+
* Looks up the device in the container's list of class devices and returns
414+
* the corresponding class_device.
415+
*/
416+
struct class_device *
417+
attribute_container_find_class_device(struct attribute_container *cont,
418+
struct device *dev)
419+
{
420+
struct class_device *cdev = NULL;
421+
struct internal_container *ic;
422+
struct klist_iter iter;
423+
424+
klist_for_each_entry(ic, &cont->containers, node, &iter) {
425+
if (ic->classdev.dev == dev) {
426+
cdev = &ic->classdev;
427+
/* FIXME: must exit iterator then break */
428+
klist_iter_exit(&iter);
429+
break;
430+
}
431+
}
432+
433+
return cdev;
434+
}
435+
EXPORT_SYMBOL_GPL(attribute_container_find_class_device);
436+
371437
int __init
372438
attribute_container_init(void)
373439
{

drivers/base/transport_class.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* This file is licensed under GPLv2
88
*
99
* The basic idea here is to allow any "device controller" (which
10-
* would most often be a Host Bus Adapter" to use the services of one
10+
* would most often be a Host Bus Adapter to use the services of one
1111
* or more tranport classes for performing transport specific
1212
* services. Transport specific services are things that the generic
1313
* command layer doesn't want to know about (speed settings, line
@@ -64,7 +64,9 @@ void transport_class_unregister(struct transport_class *tclass)
6464
}
6565
EXPORT_SYMBOL_GPL(transport_class_unregister);
6666

67-
static int anon_transport_dummy_function(struct device *dev)
67+
static int anon_transport_dummy_function(struct transport_container *tc,
68+
struct device *dev,
69+
struct class_device *cdev)
6870
{
6971
/* do nothing */
7072
return 0;
@@ -115,9 +117,10 @@ static int transport_setup_classdev(struct attribute_container *cont,
115117
struct class_device *classdev)
116118
{
117119
struct transport_class *tclass = class_to_transport_class(cont->class);
120+
struct transport_container *tcont = attribute_container_to_transport_container(cont);
118121

119122
if (tclass->setup)
120-
tclass->setup(dev);
123+
tclass->setup(tcont, dev, classdev);
121124

122125
return 0;
123126
}
@@ -178,12 +181,14 @@ void transport_add_device(struct device *dev)
178181
EXPORT_SYMBOL_GPL(transport_add_device);
179182

180183
static int transport_configure(struct attribute_container *cont,
181-
struct device *dev)
184+
struct device *dev,
185+
struct class_device *cdev)
182186
{
183187
struct transport_class *tclass = class_to_transport_class(cont->class);
188+
struct transport_container *tcont = attribute_container_to_transport_container(cont);
184189

185190
if (tclass->configure)
186-
tclass->configure(dev);
191+
tclass->configure(tcont, dev, cdev);
187192

188193
return 0;
189194
}
@@ -202,7 +207,7 @@ static int transport_configure(struct attribute_container *cont,
202207
*/
203208
void transport_configure_device(struct device *dev)
204209
{
205-
attribute_container_trigger(dev, transport_configure);
210+
attribute_container_device_trigger(dev, transport_configure);
206211
}
207212
EXPORT_SYMBOL_GPL(transport_configure_device);
208213

@@ -215,7 +220,7 @@ static int transport_remove_classdev(struct attribute_container *cont,
215220
struct transport_class *tclass = class_to_transport_class(cont->class);
216221

217222
if (tclass->remove)
218-
tclass->remove(dev);
223+
tclass->remove(tcont, dev, classdev);
219224

220225
if (tclass->remove != anon_transport_dummy_function) {
221226
if (tcont->statistics)

0 commit comments

Comments
 (0)