aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/arm/queue.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 21:57:35 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 21:57:35 -0400
commit97d41e90fe61399b99d74820cb7f2d6e0fbac91d (patch)
treef759371424a26963b04badbb4433e360be4e8750 /drivers/scsi/arm/queue.c
parent3bdc9d0b408e01c4e556daba0035ba37f603e920 (diff)
parentafaf5a2d341d33b66b47c2716a263ce593460a08 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (54 commits) [SCSI] Initial Commit of qla4xxx [SCSI] raid class: handle component-add errors [SCSI] SCSI megaraid_sas: handle thrown errors [SCSI] SCSI aic94xx: handle sysfs errors [SCSI] SCSI st: fix error handling in module init, sysfs [SCSI] SCSI sd: fix module init/exit error handling [SCSI] SCSI osst: add error handling to module init, sysfs [SCSI] scsi: remove hosts.h [SCSI] scsi: Scsi_Cmnd convertion in aic7xxx_old.c [SCSI] megaraid_sas: sets ioctl timeout and updates version,changelog [SCSI] megaraid_sas: adds tasklet for cmd completion [SCSI] megaraid_sas: prints pending cmds before setting hw_crit_error [SCSI] megaraid_sas: function pointer for disable interrupt [SCSI] megaraid_sas: frame count optimization [SCSI] megaraid_sas: FW transition and q size changes [SCSI] qla2xxx: Update version number to 8.01.07-k2. [SCSI] qla2xxx: Stall mid-layer error handlers while rport is blocked. [SCSI] qla2xxx: Add MODULE_FIRMWARE tags. [SCSI] qla2xxx: Add support for host port state FC transport attribute. [SCSI] qla2xxx: Add support for fabric name FC transport attribute. ...
Diffstat (limited to 'drivers/scsi/arm/queue.c')
-rw-r--r--drivers/scsi/arm/queue.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/scsi/arm/queue.c b/drivers/scsi/arm/queue.c
index 8caa5903ce38..cb11ccef54e5 100644
--- a/drivers/scsi/arm/queue.c
+++ b/drivers/scsi/arm/queue.c
@@ -29,7 +29,7 @@
29 29
30typedef struct queue_entry { 30typedef struct queue_entry {
31 struct list_head list; 31 struct list_head list;
32 Scsi_Cmnd *SCpnt; 32 struct scsi_cmnd *SCpnt;
33#ifdef DEBUG 33#ifdef DEBUG
34 unsigned long magic; 34 unsigned long magic;
35#endif 35#endif
@@ -96,14 +96,14 @@ void queue_free (Queue_t *queue)
96 96
97 97
98/* 98/*
99 * Function: int queue_add_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 99 * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
100 * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head. 100 * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head.
101 * Params : queue - destination queue 101 * Params : queue - destination queue
102 * SCpnt - command to add 102 * SCpnt - command to add
103 * head - add command to head of queue 103 * head - add command to head of queue
104 * Returns : 0 on error, !0 on success 104 * Returns : 0 on error, !0 on success
105 */ 105 */
106int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 106int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
107{ 107{
108 unsigned long flags; 108 unsigned long flags;
109 struct list_head *l; 109 struct list_head *l;
@@ -134,7 +134,7 @@ empty:
134 return ret; 134 return ret;
135} 135}
136 136
137static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent) 137static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
138{ 138{
139 QE_t *q; 139 QE_t *q;
140 140
@@ -152,17 +152,17 @@ static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
152} 152}
153 153
154/* 154/*
155 * Function: Scsi_Cmnd *queue_remove_exclude (queue, exclude) 155 * Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude)
156 * Purpose : remove a SCSI command from a queue 156 * Purpose : remove a SCSI command from a queue
157 * Params : queue - queue to remove command from 157 * Params : queue - queue to remove command from
158 * exclude - bit array of target&lun which is busy 158 * exclude - bit array of target&lun which is busy
159 * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 159 * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
160 */ 160 */
161Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude) 161struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
162{ 162{
163 unsigned long flags; 163 unsigned long flags;
164 struct list_head *l; 164 struct list_head *l;
165 Scsi_Cmnd *SCpnt = NULL; 165 struct scsi_cmnd *SCpnt = NULL;
166 166
167 spin_lock_irqsave(&queue->queue_lock, flags); 167 spin_lock_irqsave(&queue->queue_lock, flags);
168 list_for_each(l, &queue->head) { 168 list_for_each(l, &queue->head) {
@@ -178,15 +178,15 @@ Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
178} 178}
179 179
180/* 180/*
181 * Function: Scsi_Cmnd *queue_remove (queue) 181 * Function: struct scsi_cmnd *queue_remove (queue)
182 * Purpose : removes first SCSI command from a queue 182 * Purpose : removes first SCSI command from a queue
183 * Params : queue - queue to remove command from 183 * Params : queue - queue to remove command from
184 * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 184 * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
185 */ 185 */
186Scsi_Cmnd *queue_remove(Queue_t *queue) 186struct scsi_cmnd *queue_remove(Queue_t *queue)
187{ 187{
188 unsigned long flags; 188 unsigned long flags;
189 Scsi_Cmnd *SCpnt = NULL; 189 struct scsi_cmnd *SCpnt = NULL;
190 190
191 spin_lock_irqsave(&queue->queue_lock, flags); 191 spin_lock_irqsave(&queue->queue_lock, flags);
192 if (!list_empty(&queue->head)) 192 if (!list_empty(&queue->head))
@@ -197,19 +197,20 @@ Scsi_Cmnd *queue_remove(Queue_t *queue)
197} 197}
198 198
199/* 199/*
200 * Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 200 * Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
201 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 201 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag
202 * Params : queue - queue to remove command from 202 * Params : queue - queue to remove command from
203 * target - target that we want 203 * target - target that we want
204 * lun - lun on device 204 * lun - lun on device
205 * tag - tag on device 205 * tag - tag on device
206 * Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements 206 * Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements
207 */ 207 */
208Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag) 208struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
209 int tag)
209{ 210{
210 unsigned long flags; 211 unsigned long flags;
211 struct list_head *l; 212 struct list_head *l;
212 Scsi_Cmnd *SCpnt = NULL; 213 struct scsi_cmnd *SCpnt = NULL;
213 214
214 spin_lock_irqsave(&queue->queue_lock, flags); 215 spin_lock_irqsave(&queue->queue_lock, flags);
215 list_for_each(l, &queue->head) { 216 list_for_each(l, &queue->head) {
@@ -275,13 +276,13 @@ int queue_probetgtlun (Queue_t *queue, int target, int lun)
275} 276}
276 277
277/* 278/*
278 * Function: int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) 279 * Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
279 * Purpose : remove a specific command from the queues 280 * Purpose : remove a specific command from the queues
280 * Params : queue - queue to look in 281 * Params : queue - queue to look in
281 * SCpnt - command to find 282 * SCpnt - command to find
282 * Returns : 0 if not found 283 * Returns : 0 if not found
283 */ 284 */
284int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) 285int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
285{ 286{
286 unsigned long flags; 287 unsigned long flags;
287 struct list_head *l; 288 struct list_head *l;