diff options
Diffstat (limited to 'include/scsi/libsas.h')
-rw-r--r-- | include/scsi/libsas.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 9582e8401669..0c775fceb675 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <scsi/scsi_device.h> | 35 | #include <scsi/scsi_device.h> |
36 | #include <scsi/scsi_cmnd.h> | 36 | #include <scsi/scsi_cmnd.h> |
37 | #include <scsi/scsi_transport_sas.h> | 37 | #include <scsi/scsi_transport_sas.h> |
38 | #include <asm/scatterlist.h> | ||
38 | 39 | ||
39 | struct block_device; | 40 | struct block_device; |
40 | 41 | ||
@@ -200,9 +201,14 @@ struct domain_device { | |||
200 | void *lldd_dev; | 201 | void *lldd_dev; |
201 | }; | 202 | }; |
202 | 203 | ||
204 | struct sas_discovery_event { | ||
205 | struct work_struct work; | ||
206 | struct asd_sas_port *port; | ||
207 | }; | ||
208 | |||
203 | struct sas_discovery { | 209 | struct sas_discovery { |
204 | spinlock_t disc_event_lock; | 210 | spinlock_t disc_event_lock; |
205 | struct work_struct disc_work[DISC_NUM_EVENTS]; | 211 | struct sas_discovery_event disc_work[DISC_NUM_EVENTS]; |
206 | unsigned long pending; | 212 | unsigned long pending; |
207 | u8 fanout_sas_addr[8]; | 213 | u8 fanout_sas_addr[8]; |
208 | u8 eeds_a[8]; | 214 | u8 eeds_a[8]; |
@@ -248,14 +254,19 @@ struct asd_sas_port { | |||
248 | void *lldd_port; /* not touched by the sas class code */ | 254 | void *lldd_port; /* not touched by the sas class code */ |
249 | }; | 255 | }; |
250 | 256 | ||
257 | struct asd_sas_event { | ||
258 | struct work_struct work; | ||
259 | struct asd_sas_phy *phy; | ||
260 | }; | ||
261 | |||
251 | /* The phy pretty much is controlled by the LLDD. | 262 | /* The phy pretty much is controlled by the LLDD. |
252 | * The class only reads those fields. | 263 | * The class only reads those fields. |
253 | */ | 264 | */ |
254 | struct asd_sas_phy { | 265 | struct asd_sas_phy { |
255 | /* private: */ | 266 | /* private: */ |
256 | /* protected by ha->event_lock */ | 267 | /* protected by ha->event_lock */ |
257 | struct work_struct port_events[PORT_NUM_EVENTS]; | 268 | struct asd_sas_event port_events[PORT_NUM_EVENTS]; |
258 | struct work_struct phy_events[PHY_NUM_EVENTS]; | 269 | struct asd_sas_event phy_events[PHY_NUM_EVENTS]; |
259 | 270 | ||
260 | unsigned long port_events_pending; | 271 | unsigned long port_events_pending; |
261 | unsigned long phy_events_pending; | 272 | unsigned long phy_events_pending; |
@@ -307,10 +318,15 @@ struct scsi_core { | |||
307 | int queue_thread_kill; | 318 | int queue_thread_kill; |
308 | }; | 319 | }; |
309 | 320 | ||
321 | struct sas_ha_event { | ||
322 | struct work_struct work; | ||
323 | struct sas_ha_struct *ha; | ||
324 | }; | ||
325 | |||
310 | struct sas_ha_struct { | 326 | struct sas_ha_struct { |
311 | /* private: */ | 327 | /* private: */ |
312 | spinlock_t event_lock; | 328 | spinlock_t event_lock; |
313 | struct work_struct ha_events[HA_NUM_EVENTS]; | 329 | struct sas_ha_event ha_events[HA_NUM_EVENTS]; |
314 | unsigned long pending; | 330 | unsigned long pending; |
315 | 331 | ||
316 | struct scsi_core core; | 332 | struct scsi_core core; |
@@ -338,6 +354,8 @@ struct sas_ha_struct { | |||
338 | void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); | 354 | void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); |
339 | 355 | ||
340 | void *lldd_ha; /* not touched by sas class code */ | 356 | void *lldd_ha; /* not touched by sas class code */ |
357 | |||
358 | struct list_head eh_done_q; | ||
341 | }; | 359 | }; |
342 | 360 | ||
343 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) | 361 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) |
@@ -526,17 +544,20 @@ struct sas_task { | |||
526 | 544 | ||
527 | void *lldd_task; /* for use by LLDDs */ | 545 | void *lldd_task; /* for use by LLDDs */ |
528 | void *uldd_task; | 546 | void *uldd_task; |
547 | |||
548 | struct work_struct abort_work; | ||
529 | }; | 549 | }; |
530 | 550 | ||
531 | 551 | ||
532 | 552 | ||
533 | #define SAS_TASK_STATE_PENDING 1 | 553 | #define SAS_TASK_STATE_PENDING 1 |
534 | #define SAS_TASK_STATE_DONE 2 | 554 | #define SAS_TASK_STATE_DONE 2 |
535 | #define SAS_TASK_STATE_ABORTED 4 | 555 | #define SAS_TASK_STATE_ABORTED 4 |
556 | #define SAS_TASK_INITIATOR_ABORTED 8 | ||
536 | 557 | ||
537 | static inline struct sas_task *sas_alloc_task(gfp_t flags) | 558 | static inline struct sas_task *sas_alloc_task(gfp_t flags) |
538 | { | 559 | { |
539 | extern kmem_cache_t *sas_task_cache; | 560 | extern struct kmem_cache *sas_task_cache; |
540 | struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); | 561 | struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); |
541 | 562 | ||
542 | if (task) { | 563 | if (task) { |
@@ -554,7 +575,7 @@ static inline struct sas_task *sas_alloc_task(gfp_t flags) | |||
554 | static inline void sas_free_task(struct sas_task *task) | 575 | static inline void sas_free_task(struct sas_task *task) |
555 | { | 576 | { |
556 | if (task) { | 577 | if (task) { |
557 | extern kmem_cache_t *sas_task_cache; | 578 | extern struct kmem_cache *sas_task_cache; |
558 | BUG_ON(!list_empty(&task->list)); | 579 | BUG_ON(!list_empty(&task->list)); |
559 | kmem_cache_free(sas_task_cache, task); | 580 | kmem_cache_free(sas_task_cache, task); |
560 | } | 581 | } |
@@ -592,6 +613,7 @@ struct sas_domain_function_template { | |||
592 | extern int sas_register_ha(struct sas_ha_struct *); | 613 | extern int sas_register_ha(struct sas_ha_struct *); |
593 | extern int sas_unregister_ha(struct sas_ha_struct *); | 614 | extern int sas_unregister_ha(struct sas_ha_struct *); |
594 | 615 | ||
616 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); | ||
595 | extern int sas_queuecommand(struct scsi_cmnd *, | 617 | extern int sas_queuecommand(struct scsi_cmnd *, |
596 | void (*scsi_done)(struct scsi_cmnd *)); | 618 | void (*scsi_done)(struct scsi_cmnd *)); |
597 | extern int sas_target_alloc(struct scsi_target *); | 619 | extern int sas_target_alloc(struct scsi_target *); |
@@ -624,4 +646,6 @@ void sas_unregister_dev(struct domain_device *); | |||
624 | 646 | ||
625 | void sas_init_dev(struct domain_device *); | 647 | void sas_init_dev(struct domain_device *); |
626 | 648 | ||
649 | void sas_task_abort(struct work_struct *); | ||
650 | |||
627 | #endif /* _SASLIB_H_ */ | 651 | #endif /* _SASLIB_H_ */ |