aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/libsas.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/libsas.h')
-rw-r--r--include/scsi/libsas.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 1d77b63c5ea4..9233ed5de664 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -201,9 +201,14 @@ struct domain_device {
201 void *lldd_dev; 201 void *lldd_dev;
202}; 202};
203 203
204struct sas_discovery_event {
205 struct work_struct work;
206 struct asd_sas_port *port;
207};
208
204struct sas_discovery { 209struct sas_discovery {
205 spinlock_t disc_event_lock; 210 spinlock_t disc_event_lock;
206 struct work_struct disc_work[DISC_NUM_EVENTS]; 211 struct sas_discovery_event disc_work[DISC_NUM_EVENTS];
207 unsigned long pending; 212 unsigned long pending;
208 u8 fanout_sas_addr[8]; 213 u8 fanout_sas_addr[8];
209 u8 eeds_a[8]; 214 u8 eeds_a[8];
@@ -249,14 +254,19 @@ struct asd_sas_port {
249 void *lldd_port; /* not touched by the sas class code */ 254 void *lldd_port; /* not touched by the sas class code */
250}; 255};
251 256
257struct asd_sas_event {
258 struct work_struct work;
259 struct asd_sas_phy *phy;
260};
261
252/* The phy pretty much is controlled by the LLDD. 262/* The phy pretty much is controlled by the LLDD.
253 * The class only reads those fields. 263 * The class only reads those fields.
254 */ 264 */
255struct asd_sas_phy { 265struct asd_sas_phy {
256/* private: */ 266/* private: */
257 /* protected by ha->event_lock */ 267 /* protected by ha->event_lock */
258 struct work_struct port_events[PORT_NUM_EVENTS]; 268 struct asd_sas_event port_events[PORT_NUM_EVENTS];
259 struct work_struct phy_events[PHY_NUM_EVENTS]; 269 struct asd_sas_event phy_events[PHY_NUM_EVENTS];
260 270
261 unsigned long port_events_pending; 271 unsigned long port_events_pending;
262 unsigned long phy_events_pending; 272 unsigned long phy_events_pending;
@@ -308,10 +318,15 @@ struct scsi_core {
308 int queue_thread_kill; 318 int queue_thread_kill;
309}; 319};
310 320
321struct sas_ha_event {
322 struct work_struct work;
323 struct sas_ha_struct *ha;
324};
325
311struct sas_ha_struct { 326struct sas_ha_struct {
312/* private: */ 327/* private: */
313 spinlock_t event_lock; 328 spinlock_t event_lock;
314 struct work_struct ha_events[HA_NUM_EVENTS]; 329 struct sas_ha_event ha_events[HA_NUM_EVENTS];
315 unsigned long pending; 330 unsigned long pending;
316 331
317 struct scsi_core core; 332 struct scsi_core core;
@@ -339,6 +354,8 @@ struct sas_ha_struct {
339 void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); 354 void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event);
340 355
341 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;
342}; 359};
343 360
344#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)
@@ -527,13 +544,16 @@ struct sas_task {
527 544
528 void *lldd_task; /* for use by LLDDs */ 545 void *lldd_task; /* for use by LLDDs */
529 void *uldd_task; 546 void *uldd_task;
547
548 struct work_struct abort_work;
530}; 549};
531 550
532 551
533 552
534#define SAS_TASK_STATE_PENDING 1 553#define SAS_TASK_STATE_PENDING 1
535#define SAS_TASK_STATE_DONE 2 554#define SAS_TASK_STATE_DONE 2
536#define SAS_TASK_STATE_ABORTED 4 555#define SAS_TASK_STATE_ABORTED 4
556#define SAS_TASK_INITIATOR_ABORTED 8
537 557
538static inline struct sas_task *sas_alloc_task(gfp_t flags) 558static inline struct sas_task *sas_alloc_task(gfp_t flags)
539{ 559{
@@ -593,6 +613,7 @@ struct sas_domain_function_template {
593extern int sas_register_ha(struct sas_ha_struct *); 613extern int sas_register_ha(struct sas_ha_struct *);
594extern int sas_unregister_ha(struct sas_ha_struct *); 614extern int sas_unregister_ha(struct sas_ha_struct *);
595 615
616int sas_phy_reset(struct sas_phy *phy, int hard_reset);
596extern int sas_queuecommand(struct scsi_cmnd *, 617extern int sas_queuecommand(struct scsi_cmnd *,
597 void (*scsi_done)(struct scsi_cmnd *)); 618 void (*scsi_done)(struct scsi_cmnd *));
598extern int sas_target_alloc(struct scsi_target *); 619extern int sas_target_alloc(struct scsi_target *);
@@ -625,4 +646,6 @@ void sas_unregister_dev(struct domain_device *);
625 646
626void sas_init_dev(struct domain_device *); 647void sas_init_dev(struct domain_device *);
627 648
649void sas_task_abort(struct work_struct *);
650
628#endif /* _SASLIB_H_ */ 651#endif /* _SASLIB_H_ */