diff options
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/libsas.h | 14 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 30 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 8 | ||||
-rw-r--r-- | include/scsi/scsi_transport_sas.h | 2 |
4 files changed, 31 insertions, 23 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 9582e8401669..29f6e1af1bf9 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -338,6 +338,8 @@ struct sas_ha_struct { | |||
338 | void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); | 338 | void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); |
339 | 339 | ||
340 | void *lldd_ha; /* not touched by sas class code */ | 340 | void *lldd_ha; /* not touched by sas class code */ |
341 | |||
342 | struct list_head eh_done_q; | ||
341 | }; | 343 | }; |
342 | 344 | ||
343 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) | 345 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) |
@@ -526,13 +528,16 @@ struct sas_task { | |||
526 | 528 | ||
527 | void *lldd_task; /* for use by LLDDs */ | 529 | void *lldd_task; /* for use by LLDDs */ |
528 | void *uldd_task; | 530 | void *uldd_task; |
531 | |||
532 | struct work_struct abort_work; | ||
529 | }; | 533 | }; |
530 | 534 | ||
531 | 535 | ||
532 | 536 | ||
533 | #define SAS_TASK_STATE_PENDING 1 | 537 | #define SAS_TASK_STATE_PENDING 1 |
534 | #define SAS_TASK_STATE_DONE 2 | 538 | #define SAS_TASK_STATE_DONE 2 |
535 | #define SAS_TASK_STATE_ABORTED 4 | 539 | #define SAS_TASK_STATE_ABORTED 4 |
540 | #define SAS_TASK_INITIATOR_ABORTED 8 | ||
536 | 541 | ||
537 | static inline struct sas_task *sas_alloc_task(gfp_t flags) | 542 | static inline struct sas_task *sas_alloc_task(gfp_t flags) |
538 | { | 543 | { |
@@ -592,6 +597,7 @@ struct sas_domain_function_template { | |||
592 | extern int sas_register_ha(struct sas_ha_struct *); | 597 | extern int sas_register_ha(struct sas_ha_struct *); |
593 | extern int sas_unregister_ha(struct sas_ha_struct *); | 598 | extern int sas_unregister_ha(struct sas_ha_struct *); |
594 | 599 | ||
600 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); | ||
595 | extern int sas_queuecommand(struct scsi_cmnd *, | 601 | extern int sas_queuecommand(struct scsi_cmnd *, |
596 | void (*scsi_done)(struct scsi_cmnd *)); | 602 | void (*scsi_done)(struct scsi_cmnd *)); |
597 | extern int sas_target_alloc(struct scsi_target *); | 603 | extern int sas_target_alloc(struct scsi_target *); |
@@ -624,4 +630,6 @@ void sas_unregister_dev(struct domain_device *); | |||
624 | 630 | ||
625 | void sas_init_dev(struct domain_device *); | 631 | void sas_init_dev(struct domain_device *); |
626 | 632 | ||
633 | void sas_task_abort(struct sas_task *task); | ||
634 | |||
627 | #endif /* _SASLIB_H_ */ | 635 | #endif /* _SASLIB_H_ */ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index b401c82036be..ebf31b16dc49 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -223,13 +223,13 @@ extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *, | |||
223 | struct scsi_device *); | 223 | struct scsi_device *); |
224 | 224 | ||
225 | /** | 225 | /** |
226 | * shost_for_each_device - iterate over all devices of a host | 226 | * shost_for_each_device - iterate over all devices of a host |
227 | * @sdev: iterator | 227 | * @sdev: the &struct scsi_device to use as a cursor |
228 | * @host: host whiches devices we want to iterate over | 228 | * @shost: the &struct scsi_host to iterate over |
229 | * | 229 | * |
230 | * This traverses over each devices of @shost. The devices have | 230 | * Iterator that returns each device attached to @shost. This loop |
231 | * a reference that must be released by scsi_host_put when breaking | 231 | * takes a reference on each device and releases it at the end. If |
232 | * out of the loop. | 232 | * you break out of the loop, you must call scsi_device_put(sdev). |
233 | */ | 233 | */ |
234 | #define shost_for_each_device(sdev, shost) \ | 234 | #define shost_for_each_device(sdev, shost) \ |
235 | for ((sdev) = __scsi_iterate_devices((shost), NULL); \ | 235 | for ((sdev) = __scsi_iterate_devices((shost), NULL); \ |
@@ -237,17 +237,17 @@ extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *, | |||
237 | (sdev) = __scsi_iterate_devices((shost), (sdev))) | 237 | (sdev) = __scsi_iterate_devices((shost), (sdev))) |
238 | 238 | ||
239 | /** | 239 | /** |
240 | * __shost_for_each_device - iterate over all devices of a host (UNLOCKED) | 240 | * __shost_for_each_device - iterate over all devices of a host (UNLOCKED) |
241 | * @sdev: iterator | 241 | * @sdev: the &struct scsi_device to use as a cursor |
242 | * @host: host whiches devices we want to iterate over | 242 | * @shost: the &struct scsi_host to iterate over |
243 | * | 243 | * |
244 | * This traverses over each devices of @shost. It does _not_ take a | 244 | * Iterator that returns each device attached to @shost. It does _not_ |
245 | * reference on the scsi_device, thus it the whole loop must be protected | 245 | * take a reference on the scsi_device, so the whole loop must be |
246 | * by shost->host_lock. | 246 | * protected by shost->host_lock. |
247 | * | 247 | * |
248 | * Note: The only reason why drivers would want to use this is because | 248 | * Note: The only reason to use this is because you need to access the |
249 | * they're need to access the device list in irq context. Otherwise you | 249 | * device list in interrupt context. Otherwise you really want to use |
250 | * really want to use shost_for_each_device instead. | 250 | * shost_for_each_device instead. |
251 | */ | 251 | */ |
252 | #define __shost_for_each_device(sdev, shost) \ | 252 | #define __shost_for_each_device(sdev, shost) \ |
253 | list_for_each_entry((sdev), &((shost)->__devices), siblings) | 253 | list_for_each_entry((sdev), &((shost)->__devices), siblings) |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 39c6f8cc20c3..e618e711ea57 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -552,6 +552,9 @@ struct Scsi_Host { | |||
552 | /* task mgmt function in progress */ | 552 | /* task mgmt function in progress */ |
553 | unsigned tmf_in_progress:1; | 553 | unsigned tmf_in_progress:1; |
554 | 554 | ||
555 | /* Asynchronous scan in progress */ | ||
556 | unsigned async_scan:1; | ||
557 | |||
555 | /* | 558 | /* |
556 | * Optional work queue to be utilized by the transport | 559 | * Optional work queue to be utilized by the transport |
557 | */ | 560 | */ |
@@ -648,11 +651,6 @@ extern const char *scsi_host_state_name(enum scsi_host_state); | |||
648 | 651 | ||
649 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); | 652 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); |
650 | 653 | ||
651 | static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock) | ||
652 | { | ||
653 | shost->host_lock = lock; | ||
654 | } | ||
655 | |||
656 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) | 654 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) |
657 | { | 655 | { |
658 | return shost->shost_gendev.parent; | 656 | return shost->shost_gendev.parent; |
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index 53024377f3b8..59633a82de47 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -73,6 +73,8 @@ struct sas_phy { | |||
73 | 73 | ||
74 | /* for the list of phys belonging to a port */ | 74 | /* for the list of phys belonging to a port */ |
75 | struct list_head port_siblings; | 75 | struct list_head port_siblings; |
76 | |||
77 | struct work_struct reset_work; | ||
76 | }; | 78 | }; |
77 | 79 | ||
78 | #define dev_to_phy(d) \ | 80 | #define dev_to_phy(d) \ |