2 * Serial Attached SCSI (SAS) class SCSI Host glue.
4 * Copyright (C) 2005 Adaptec, Inc. All rights reserved.
5 * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
7 * This file is licensed under GPLv2.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include "sas_internal.h"
28 #include <scsi/scsi_host.h>
29 #include <scsi/scsi_device.h>
30 #include <scsi/scsi_tcq.h>
31 #include <scsi/scsi.h>
32 #include <scsi/scsi_transport.h>
33 #include <scsi/scsi_transport_sas.h>
34 #include "../scsi_sas_internal.h"
36 #include <linux/err.h>
37 #include <linux/blkdev.h>
38 #include <linux/scatterlist.h>
40 /* ---------- SCSI Host glue ---------- */
42 #define TO_SAS_TASK(_scsi_cmd) ((void *)(_scsi_cmd)->host_scribble)
43 #define ASSIGN_SAS_TASK(_sc, _t) do { (_sc)->host_scribble = (void *) _t; } while (0)
45 static void sas_scsi_task_done(struct sas_task
*task
)
47 struct task_status_struct
*ts
= &task
->task_status
;
48 struct scsi_cmnd
*sc
= task
->uldd_task
;
49 unsigned ts_flags
= task
->task_state_flags
;
53 SAS_DPRINTK("task_done called with non existing SCSI cmnd!\n");
54 list_del_init(&task
->list
);
59 if (ts
->resp
== SAS_TASK_UNDELIVERED
) {
62 } else { /* ts->resp == SAS_TASK_COMPLETE */
63 /* task delivered, what happened afterwards? */
65 case SAS_DEV_NO_RESPONSE
:
72 case SAS_DATA_UNDERRUN
:
73 sc
->resid
= ts
->residual
;
74 if (sc
->request_bufflen
- sc
->resid
< sc
->underflow
)
77 case SAS_DATA_OVERRUN
:
81 hs
= DID_SOFT_ERROR
; /* retry */
83 case SAS_DEVICE_UNKNOWN
:
90 if (ts
->open_rej_reason
== SAS_OREJ_RSVD_RETRY
)
91 hs
= DID_SOFT_ERROR
; /* retry */
95 case SAS_PROTO_RESPONSE
:
96 SAS_DPRINTK("LLDD:%s sent SAS_PROTO_RESP for an SSP "
97 "task; please report this\n",
98 task
->dev
->port
->ha
->sas_ha_name
);
100 case SAS_ABORTED_TASK
:
104 memcpy(sc
->sense_buffer
, ts
->buf
,
105 max(SCSI_SENSE_BUFFERSIZE
, ts
->buf_valid_size
));
106 stat
= SAM_CHECK_COND
;
113 ASSIGN_SAS_TASK(sc
, NULL
);
114 sc
->result
= (hs
<< 16) | stat
;
115 list_del_init(&task
->list
);
117 /* This is very ugly but this is how SCSI Core works. */
118 if (ts_flags
& SAS_TASK_STATE_ABORTED
)
119 scsi_finish_command(sc
);
124 static enum task_attribute
sas_scsi_get_task_attr(struct scsi_cmnd
*cmd
)
126 enum task_attribute ta
= TASK_ATTR_SIMPLE
;
127 if (cmd
->request
&& blk_rq_tagged(cmd
->request
)) {
128 if (cmd
->device
->ordered_tags
&&
129 (cmd
->request
->flags
& REQ_HARDBARRIER
))
135 static struct sas_task
*sas_create_task(struct scsi_cmnd
*cmd
,
136 struct domain_device
*dev
,
139 struct sas_task
*task
= sas_alloc_task(gfp_flags
);
145 *(u32
*)cmd
->sense_buffer
= 0;
146 task
->uldd_task
= cmd
;
147 ASSIGN_SAS_TASK(cmd
, task
);
150 task
->task_proto
= task
->dev
->tproto
; /* BUG_ON(!SSP) */
152 task
->ssp_task
.retry_count
= 1;
153 int_to_scsilun(cmd
->device
->lun
, &lun
);
154 memcpy(task
->ssp_task
.LUN
, &lun
.scsi_lun
, 8);
155 task
->ssp_task
.task_attr
= sas_scsi_get_task_attr(cmd
);
156 memcpy(task
->ssp_task
.cdb
, cmd
->cmnd
, 16);
158 task
->scatter
= cmd
->request_buffer
;
159 task
->num_scatter
= cmd
->use_sg
;
160 task
->total_xfer_len
= cmd
->request_bufflen
;
161 task
->data_dir
= cmd
->sc_data_direction
;
163 task
->task_done
= sas_scsi_task_done
;
168 static int sas_queue_up(struct sas_task
*task
)
170 struct sas_ha_struct
*sas_ha
= task
->dev
->port
->ha
;
171 struct scsi_core
*core
= &sas_ha
->core
;
175 spin_lock_irqsave(&core
->task_queue_lock
, flags
);
176 if (sas_ha
->lldd_queue_size
< core
->task_queue_size
+ 1) {
177 spin_unlock_irqrestore(&core
->task_queue_lock
, flags
);
178 return -SAS_QUEUE_FULL
;
180 list_add_tail(&task
->list
, &core
->task_queue
);
181 core
->task_queue_size
+= 1;
182 spin_unlock_irqrestore(&core
->task_queue_lock
, flags
);
183 up(&core
->queue_thread_sema
);
189 * sas_queuecommand -- Enqueue a command for processing
190 * @parameters: See SCSI Core documentation
192 * Note: XXX: Remove the host unlock/lock pair when SCSI Core can
193 * call us without holding an IRQ spinlock...
195 int sas_queuecommand(struct scsi_cmnd
*cmd
,
196 void (*scsi_done
)(struct scsi_cmnd
*))
199 struct domain_device
*dev
= cmd_to_domain_dev(cmd
);
200 struct Scsi_Host
*host
= cmd
->device
->host
;
201 struct sas_internal
*i
= to_sas_internal(host
->transportt
);
203 spin_unlock_irq(host
->host_lock
);
206 struct sas_ha_struct
*sas_ha
= dev
->port
->ha
;
207 struct sas_task
*task
;
210 task
= sas_create_task(cmd
, dev
, GFP_ATOMIC
);
214 cmd
->scsi_done
= scsi_done
;
215 /* Queue up, Direct Mode or Task Collector Mode. */
216 if (sas_ha
->lldd_max_execute_num
< 2)
217 res
= i
->dft
->lldd_execute_task(task
, 1, GFP_ATOMIC
);
219 res
= sas_queue_up(task
);
223 SAS_DPRINTK("lldd_execute_task returned: %d\n", res
);
224 ASSIGN_SAS_TASK(cmd
, NULL
);
226 if (res
== -SAS_QUEUE_FULL
) {
227 cmd
->result
= DID_SOFT_ERROR
<< 16; /* retry */
235 spin_lock_irq(host
->host_lock
);
239 static void sas_scsi_clear_queue_lu(struct list_head
*error_q
, struct scsi_cmnd
*my_cmd
)
241 struct scsi_cmnd
*cmd
, *n
;
243 list_for_each_entry_safe(cmd
, n
, error_q
, eh_entry
) {
245 list_del_init(&cmd
->eh_entry
);
249 static void sas_scsi_clear_queue_I_T(struct list_head
*error_q
,
250 struct domain_device
*dev
)
252 struct scsi_cmnd
*cmd
, *n
;
254 list_for_each_entry_safe(cmd
, n
, error_q
, eh_entry
) {
255 struct domain_device
*x
= cmd_to_domain_dev(cmd
);
258 list_del_init(&cmd
->eh_entry
);
262 static void sas_scsi_clear_queue_port(struct list_head
*error_q
,
263 struct asd_sas_port
*port
)
265 struct scsi_cmnd
*cmd
, *n
;
267 list_for_each_entry_safe(cmd
, n
, error_q
, eh_entry
) {
268 struct domain_device
*dev
= cmd_to_domain_dev(cmd
);
269 struct asd_sas_port
*x
= dev
->port
;
272 list_del_init(&cmd
->eh_entry
);
276 enum task_disposition
{
283 static enum task_disposition
sas_scsi_find_task(struct sas_task
*task
)
285 struct sas_ha_struct
*ha
= task
->dev
->port
->ha
;
288 struct sas_internal
*si
=
289 to_sas_internal(task
->dev
->port
->ha
->core
.shost
->transportt
);
291 if (ha
->lldd_max_execute_num
> 1) {
292 struct scsi_core
*core
= &ha
->core
;
293 struct sas_task
*t
, *n
;
295 spin_lock_irqsave(&core
->task_queue_lock
, flags
);
296 list_for_each_entry_safe(t
, n
, &core
->task_queue
, list
) {
298 list_del_init(&t
->list
);
299 spin_unlock_irqrestore(&core
->task_queue_lock
,
301 SAS_DPRINTK("%s: task 0x%p aborted from "
304 return TASK_IS_ABORTED
;
307 spin_unlock_irqrestore(&core
->task_queue_lock
, flags
);
310 for (i
= 0; i
< 5; i
++) {
311 SAS_DPRINTK("%s: aborting task 0x%p\n", __FUNCTION__
, task
);
312 res
= si
->dft
->lldd_abort_task(task
);
314 spin_lock_irqsave(&task
->task_state_lock
, flags
);
315 if (task
->task_state_flags
& SAS_TASK_STATE_DONE
) {
316 spin_unlock_irqrestore(&task
->task_state_lock
, flags
);
317 SAS_DPRINTK("%s: task 0x%p is done\n", __FUNCTION__
,
321 spin_unlock_irqrestore(&task
->task_state_lock
, flags
);
323 if (res
== TMF_RESP_FUNC_COMPLETE
) {
324 SAS_DPRINTK("%s: task 0x%p is aborted\n",
326 return TASK_IS_ABORTED
;
327 } else if (si
->dft
->lldd_query_task
) {
328 SAS_DPRINTK("%s: querying task 0x%p\n",
330 res
= si
->dft
->lldd_query_task(task
);
331 if (res
== TMF_RESP_FUNC_SUCC
) {
332 SAS_DPRINTK("%s: task 0x%p at LU\n",
334 return TASK_IS_AT_LU
;
335 } else if (res
== TMF_RESP_FUNC_COMPLETE
) {
336 SAS_DPRINTK("%s: task 0x%p not at LU\n",
338 return TASK_IS_NOT_AT_LU
;
345 static int sas_recover_lu(struct domain_device
*dev
, struct scsi_cmnd
*cmd
)
347 int res
= TMF_RESP_FUNC_FAILED
;
349 struct sas_internal
*i
=
350 to_sas_internal(dev
->port
->ha
->core
.shost
->transportt
);
352 int_to_scsilun(cmd
->device
->lun
, &lun
);
354 SAS_DPRINTK("eh: device %llx LUN %x has the task\n",
355 SAS_ADDR(dev
->sas_addr
),
358 if (i
->dft
->lldd_abort_task_set
)
359 res
= i
->dft
->lldd_abort_task_set(dev
, lun
.scsi_lun
);
361 if (res
== TMF_RESP_FUNC_FAILED
) {
362 if (i
->dft
->lldd_clear_task_set
)
363 res
= i
->dft
->lldd_clear_task_set(dev
, lun
.scsi_lun
);
366 if (res
== TMF_RESP_FUNC_FAILED
) {
367 if (i
->dft
->lldd_lu_reset
)
368 res
= i
->dft
->lldd_lu_reset(dev
, lun
.scsi_lun
);
374 static int sas_recover_I_T(struct domain_device
*dev
)
376 int res
= TMF_RESP_FUNC_FAILED
;
377 struct sas_internal
*i
=
378 to_sas_internal(dev
->port
->ha
->core
.shost
->transportt
);
380 SAS_DPRINTK("I_T nexus reset for dev %016llx\n",
381 SAS_ADDR(dev
->sas_addr
));
383 if (i
->dft
->lldd_I_T_nexus_reset
)
384 res
= i
->dft
->lldd_I_T_nexus_reset(dev
);
389 void sas_scsi_recover_host(struct Scsi_Host
*shost
)
391 struct sas_ha_struct
*ha
= SHOST_TO_SAS_HA(shost
);
394 struct scsi_cmnd
*cmd
, *n
;
395 enum task_disposition res
= TASK_IS_DONE
;
397 struct sas_internal
*i
= to_sas_internal(shost
->transportt
);
399 spin_lock_irqsave(shost
->host_lock
, flags
);
400 list_splice_init(&shost
->eh_cmd_q
, &error_q
);
401 spin_unlock_irqrestore(shost
->host_lock
, flags
);
403 SAS_DPRINTK("Enter %s\n", __FUNCTION__
);
405 /* All tasks on this list were marked SAS_TASK_STATE_ABORTED
406 * by sas_scsi_timed_out() callback.
409 SAS_DPRINTK("going over list...\n");
410 list_for_each_entry_safe(cmd
, n
, &error_q
, eh_entry
) {
411 struct sas_task
*task
= TO_SAS_TASK(cmd
);
413 SAS_DPRINTK("trying to find task 0x%p\n", task
);
414 list_del_init(&cmd
->eh_entry
);
415 res
= sas_scsi_find_task(task
);
418 shost
->host_failed
--;
422 SAS_DPRINTK("%s: task 0x%p is done\n", __FUNCTION__
,
424 task
->task_done(task
);
426 case TASK_IS_ABORTED
:
427 SAS_DPRINTK("%s: task 0x%p is aborted\n",
429 task
->task_done(task
);
432 SAS_DPRINTK("task 0x%p is at LU: lu recover\n", task
);
433 tmf_resp
= sas_recover_lu(task
->dev
, cmd
);
434 if (tmf_resp
== TMF_RESP_FUNC_COMPLETE
) {
435 SAS_DPRINTK("dev %016llx LU %x is "
439 task
->task_done(task
);
440 sas_scsi_clear_queue_lu(&error_q
, cmd
);
444 case TASK_IS_NOT_AT_LU
:
445 SAS_DPRINTK("task 0x%p is not at LU: I_T recover\n",
447 tmf_resp
= sas_recover_I_T(task
->dev
);
448 if (tmf_resp
== TMF_RESP_FUNC_COMPLETE
) {
449 SAS_DPRINTK("I_T %016llx recovered\n",
450 SAS_ADDR(task
->dev
->sas_addr
));
451 task
->task_done(task
);
452 sas_scsi_clear_queue_I_T(&error_q
, task
->dev
);
455 /* Hammer time :-) */
456 if (i
->dft
->lldd_clear_nexus_port
) {
457 struct asd_sas_port
*port
= task
->dev
->port
;
458 SAS_DPRINTK("clearing nexus for port:%d\n",
460 res
= i
->dft
->lldd_clear_nexus_port(port
);
461 if (res
== TMF_RESP_FUNC_COMPLETE
) {
462 SAS_DPRINTK("clear nexus port:%d "
463 "succeeded\n", port
->id
);
464 task
->task_done(task
);
465 sas_scsi_clear_queue_port(&error_q
,
470 if (i
->dft
->lldd_clear_nexus_ha
) {
471 SAS_DPRINTK("clear nexus ha\n");
472 res
= i
->dft
->lldd_clear_nexus_ha(ha
);
473 if (res
== TMF_RESP_FUNC_COMPLETE
) {
474 SAS_DPRINTK("clear nexus ha "
476 task
->task_done(task
);
480 /* If we are here -- this means that no amount
481 * of effort could recover from errors. Quite
482 * possibly the HA just disappeared.
484 SAS_DPRINTK("error from device %llx, LUN %x "
485 "couldn't be recovered in any way\n",
486 SAS_ADDR(task
->dev
->sas_addr
),
489 task
->task_done(task
);
494 SAS_DPRINTK("--- Exit %s\n", __FUNCTION__
);
497 SAS_DPRINTK("--- Exit %s -- clear_q\n", __FUNCTION__
);
498 list_for_each_entry_safe(cmd
, n
, &error_q
, eh_entry
) {
499 struct sas_task
*task
= TO_SAS_TASK(cmd
);
500 list_del_init(&cmd
->eh_entry
);
501 task
->task_done(task
);
505 enum scsi_eh_timer_return
sas_scsi_timed_out(struct scsi_cmnd
*cmd
)
507 struct sas_task
*task
= TO_SAS_TASK(cmd
);
511 SAS_DPRINTK("command 0x%p, task 0x%p, timed out: EH_HANDLED\n",
516 spin_lock_irqsave(&task
->task_state_lock
, flags
);
517 if (task
->task_state_flags
& SAS_TASK_STATE_DONE
) {
518 spin_unlock_irqrestore(&task
->task_state_lock
, flags
);
519 SAS_DPRINTK("command 0x%p, task 0x%p, timed out: EH_HANDLED\n",
523 task
->task_state_flags
|= SAS_TASK_STATE_ABORTED
;
524 spin_unlock_irqrestore(&task
->task_state_lock
, flags
);
526 SAS_DPRINTK("command 0x%p, task 0x%p, timed out: EH_NOT_HANDLED\n",
529 return EH_NOT_HANDLED
;
532 struct domain_device
*sas_find_dev_by_rphy(struct sas_rphy
*rphy
)
534 struct Scsi_Host
*shost
= dev_to_shost(rphy
->dev
.parent
);
535 struct sas_ha_struct
*ha
= SHOST_TO_SAS_HA(shost
);
536 struct domain_device
*found_dev
= NULL
;
539 spin_lock(&ha
->phy_port_lock
);
540 for (i
= 0; i
< ha
->num_phys
; i
++) {
541 struct asd_sas_port
*port
= ha
->sas_port
[i
];
542 struct domain_device
*dev
;
544 spin_lock(&port
->dev_list_lock
);
545 list_for_each_entry(dev
, &port
->dev_list
, dev_list_node
) {
546 if (rphy
== dev
->rphy
) {
548 spin_unlock(&port
->dev_list_lock
);
552 spin_unlock(&port
->dev_list_lock
);
555 spin_unlock(&ha
->phy_port_lock
);
560 static inline struct domain_device
*sas_find_target(struct scsi_target
*starget
)
562 struct sas_rphy
*rphy
= dev_to_rphy(starget
->dev
.parent
);
564 return sas_find_dev_by_rphy(rphy
);
567 int sas_target_alloc(struct scsi_target
*starget
)
569 struct domain_device
*found_dev
= sas_find_target(starget
);
574 starget
->hostdata
= found_dev
;
578 #define SAS_DEF_QD 32
579 #define SAS_MAX_QD 64
581 int sas_slave_configure(struct scsi_device
*scsi_dev
)
583 struct domain_device
*dev
= sdev_to_domain_dev(scsi_dev
);
584 struct sas_ha_struct
*sas_ha
;
586 BUG_ON(dev
->rphy
->identify
.device_type
!= SAS_END_DEVICE
);
588 sas_ha
= dev
->port
->ha
;
590 sas_read_port_mode_page(scsi_dev
);
592 if (scsi_dev
->tagged_supported
) {
593 scsi_set_tag_type(scsi_dev
, MSG_SIMPLE_TAG
);
594 scsi_activate_tcq(scsi_dev
, SAS_DEF_QD
);
596 SAS_DPRINTK("device %llx, LUN %x doesn't support "
597 "TCQ\n", SAS_ADDR(dev
->sas_addr
),
599 scsi_dev
->tagged_supported
= 0;
600 scsi_set_tag_type(scsi_dev
, 0);
601 scsi_deactivate_tcq(scsi_dev
, 1);
607 void sas_slave_destroy(struct scsi_device
*scsi_dev
)
611 int sas_change_queue_depth(struct scsi_device
*scsi_dev
, int new_depth
)
613 int res
= min(new_depth
, SAS_MAX_QD
);
615 if (scsi_dev
->tagged_supported
)
616 scsi_adjust_queue_depth(scsi_dev
, scsi_get_tag_type(scsi_dev
),
619 struct domain_device
*dev
= sdev_to_domain_dev(scsi_dev
);
620 sas_printk("device %llx LUN %x queue depth changed to 1\n",
621 SAS_ADDR(dev
->sas_addr
),
623 scsi_adjust_queue_depth(scsi_dev
, 0, 1);
630 int sas_change_queue_type(struct scsi_device
*scsi_dev
, int qt
)
632 if (!scsi_dev
->tagged_supported
)
635 scsi_deactivate_tcq(scsi_dev
, 1);
637 scsi_set_tag_type(scsi_dev
, qt
);
638 scsi_activate_tcq(scsi_dev
, scsi_dev
->queue_depth
);
643 int sas_bios_param(struct scsi_device
*scsi_dev
,
644 struct block_device
*bdev
,
645 sector_t capacity
, int *hsc
)
649 sector_div(capacity
, 255*63);
655 /* ---------- Task Collector Thread implementation ---------- */
657 static void sas_queue(struct sas_ha_struct
*sas_ha
)
659 struct scsi_core
*core
= &sas_ha
->core
;
664 struct sas_internal
*i
= to_sas_internal(core
->shost
->transportt
);
666 spin_lock_irqsave(&core
->task_queue_lock
, flags
);
667 while (!core
->queue_thread_kill
&&
668 !list_empty(&core
->task_queue
)) {
670 can_queue
= sas_ha
->lldd_queue_size
- core
->task_queue_size
;
671 if (can_queue
>= 0) {
672 can_queue
= core
->task_queue_size
;
673 list_splice_init(&core
->task_queue
, &q
);
675 struct list_head
*a
, *n
;
677 can_queue
= sas_ha
->lldd_queue_size
;
678 list_for_each_safe(a
, n
, &core
->task_queue
) {
679 list_move_tail(a
, &q
);
680 if (--can_queue
== 0)
683 can_queue
= sas_ha
->lldd_queue_size
;
685 core
->task_queue_size
-= can_queue
;
686 spin_unlock_irqrestore(&core
->task_queue_lock
, flags
);
688 struct sas_task
*task
= list_entry(q
.next
,
692 res
= i
->dft
->lldd_execute_task(task
, can_queue
,
695 __list_add(&q
, task
->list
.prev
, &task
->list
);
697 spin_lock_irqsave(&core
->task_queue_lock
, flags
);
699 list_splice_init(&q
, &core
->task_queue
); /*at head*/
700 core
->task_queue_size
+= can_queue
;
703 spin_unlock_irqrestore(&core
->task_queue_lock
, flags
);
706 static DECLARE_COMPLETION(queue_th_comp
);
709 * sas_queue_thread -- The Task Collector thread
710 * @_sas_ha: pointer to struct sas_ha
712 static int sas_queue_thread(void *_sas_ha
)
714 struct sas_ha_struct
*sas_ha
= _sas_ha
;
715 struct scsi_core
*core
= &sas_ha
->core
;
717 daemonize("sas_queue_%d", core
->shost
->host_no
);
718 current
->flags
|= PF_NOFREEZE
;
720 complete(&queue_th_comp
);
723 down_interruptible(&core
->queue_thread_sema
);
725 if (core
->queue_thread_kill
)
729 complete(&queue_th_comp
);
734 int sas_init_queue(struct sas_ha_struct
*sas_ha
)
737 struct scsi_core
*core
= &sas_ha
->core
;
739 spin_lock_init(&core
->task_queue_lock
);
740 core
->task_queue_size
= 0;
741 INIT_LIST_HEAD(&core
->task_queue
);
742 init_MUTEX_LOCKED(&core
->queue_thread_sema
);
744 res
= kernel_thread(sas_queue_thread
, sas_ha
, 0);
746 wait_for_completion(&queue_th_comp
);
748 return res
< 0 ? res
: 0;
751 void sas_shutdown_queue(struct sas_ha_struct
*sas_ha
)
754 struct scsi_core
*core
= &sas_ha
->core
;
755 struct sas_task
*task
, *n
;
757 init_completion(&queue_th_comp
);
758 core
->queue_thread_kill
= 1;
759 up(&core
->queue_thread_sema
);
760 wait_for_completion(&queue_th_comp
);
762 if (!list_empty(&core
->task_queue
))
763 SAS_DPRINTK("HA: %llx: scsi core task queue is NOT empty!?\n",
764 SAS_ADDR(sas_ha
->sas_addr
));
766 spin_lock_irqsave(&core
->task_queue_lock
, flags
);
767 list_for_each_entry_safe(task
, n
, &core
->task_queue
, list
) {
768 struct scsi_cmnd
*cmd
= task
->uldd_task
;
770 list_del_init(&task
->list
);
772 ASSIGN_SAS_TASK(cmd
, NULL
);
774 cmd
->result
= DID_ABORT
<< 16;
777 spin_unlock_irqrestore(&core
->task_queue_lock
, flags
);
780 EXPORT_SYMBOL_GPL(sas_queuecommand
);
781 EXPORT_SYMBOL_GPL(sas_target_alloc
);
782 EXPORT_SYMBOL_GPL(sas_slave_configure
);
783 EXPORT_SYMBOL_GPL(sas_slave_destroy
);
784 EXPORT_SYMBOL_GPL(sas_change_queue_depth
);
785 EXPORT_SYMBOL_GPL(sas_change_queue_type
);
786 EXPORT_SYMBOL_GPL(sas_bios_param
);