diff options
Diffstat (limited to 'include/scsi/libsas.h')
-rw-r--r-- | include/scsi/libsas.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 0c775fceb675..ad0182ef7809 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -323,12 +323,20 @@ struct sas_ha_event { | |||
323 | struct sas_ha_struct *ha; | 323 | struct sas_ha_struct *ha; |
324 | }; | 324 | }; |
325 | 325 | ||
326 | enum sas_ha_state { | ||
327 | SAS_HA_REGISTERED, | ||
328 | SAS_HA_UNREGISTERED | ||
329 | }; | ||
330 | |||
326 | struct sas_ha_struct { | 331 | struct sas_ha_struct { |
327 | /* private: */ | 332 | /* private: */ |
328 | spinlock_t event_lock; | 333 | spinlock_t event_lock; |
329 | struct sas_ha_event ha_events[HA_NUM_EVENTS]; | 334 | struct sas_ha_event ha_events[HA_NUM_EVENTS]; |
330 | unsigned long pending; | 335 | unsigned long pending; |
331 | 336 | ||
337 | enum sas_ha_state state; | ||
338 | spinlock_t state_lock; | ||
339 | |||
332 | struct scsi_core core; | 340 | struct scsi_core core; |
333 | 341 | ||
334 | /* public: */ | 342 | /* public: */ |
@@ -553,15 +561,15 @@ struct sas_task { | |||
553 | #define SAS_TASK_STATE_PENDING 1 | 561 | #define SAS_TASK_STATE_PENDING 1 |
554 | #define SAS_TASK_STATE_DONE 2 | 562 | #define SAS_TASK_STATE_DONE 2 |
555 | #define SAS_TASK_STATE_ABORTED 4 | 563 | #define SAS_TASK_STATE_ABORTED 4 |
556 | #define SAS_TASK_INITIATOR_ABORTED 8 | 564 | #define SAS_TASK_NEED_DEV_RESET 8 |
565 | #define SAS_TASK_AT_INITIATOR 16 | ||
557 | 566 | ||
558 | static inline struct sas_task *sas_alloc_task(gfp_t flags) | 567 | static inline struct sas_task *sas_alloc_task(gfp_t flags) |
559 | { | 568 | { |
560 | extern struct kmem_cache *sas_task_cache; | 569 | extern struct kmem_cache *sas_task_cache; |
561 | struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); | 570 | struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); |
562 | 571 | ||
563 | if (task) { | 572 | if (task) { |
564 | memset(task, 0, sizeof(*task)); | ||
565 | INIT_LIST_HEAD(&task->list); | 573 | INIT_LIST_HEAD(&task->list); |
566 | spin_lock_init(&task->task_state_lock); | 574 | spin_lock_init(&task->task_state_lock); |
567 | task->task_state_flags = SAS_TASK_STATE_PENDING; | 575 | task->task_state_flags = SAS_TASK_STATE_PENDING; |
@@ -613,6 +621,9 @@ struct sas_domain_function_template { | |||
613 | extern int sas_register_ha(struct sas_ha_struct *); | 621 | extern int sas_register_ha(struct sas_ha_struct *); |
614 | extern int sas_unregister_ha(struct sas_ha_struct *); | 622 | extern int sas_unregister_ha(struct sas_ha_struct *); |
615 | 623 | ||
624 | int sas_set_phy_speed(struct sas_phy *phy, | ||
625 | struct sas_phy_linkrates *rates); | ||
626 | int sas_phy_enable(struct sas_phy *phy, int enabled); | ||
616 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); | 627 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); |
617 | extern int sas_queuecommand(struct scsi_cmnd *, | 628 | extern int sas_queuecommand(struct scsi_cmnd *, |
618 | void (*scsi_done)(struct scsi_cmnd *)); | 629 | void (*scsi_done)(struct scsi_cmnd *)); |
@@ -646,6 +657,9 @@ void sas_unregister_dev(struct domain_device *); | |||
646 | 657 | ||
647 | void sas_init_dev(struct domain_device *); | 658 | void sas_init_dev(struct domain_device *); |
648 | 659 | ||
649 | void sas_task_abort(struct work_struct *); | 660 | void sas_task_abort(struct sas_task *); |
661 | int __sas_task_abort(struct sas_task *); | ||
662 | int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); | ||
663 | int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd); | ||
650 | 664 | ||
651 | #endif /* _SASLIB_H_ */ | 665 | #endif /* _SASLIB_H_ */ |