diff options
Diffstat (limited to 'include/scsi/libsas.h')
-rw-r--r-- | include/scsi/libsas.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 6df6fe0c2198..225ab7783dfd 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -75,16 +75,15 @@ enum phy_event { | |||
75 | PHYE_OOB_ERROR, | 75 | PHYE_OOB_ERROR, |
76 | PHYE_SPINUP_HOLD, /* hot plug SATA, no COMWAKE sent */ | 76 | PHYE_SPINUP_HOLD, /* hot plug SATA, no COMWAKE sent */ |
77 | PHYE_RESUME_TIMEOUT, | 77 | PHYE_RESUME_TIMEOUT, |
78 | PHYE_SHUTDOWN, | ||
78 | PHY_NUM_EVENTS, | 79 | PHY_NUM_EVENTS, |
79 | }; | 80 | }; |
80 | 81 | ||
81 | enum discover_event { | 82 | enum discover_event { |
82 | DISCE_DISCOVER_DOMAIN = 0U, | 83 | DISCE_DISCOVER_DOMAIN = 0U, |
83 | DISCE_REVALIDATE_DOMAIN, | 84 | DISCE_REVALIDATE_DOMAIN, |
84 | DISCE_PROBE, | ||
85 | DISCE_SUSPEND, | 85 | DISCE_SUSPEND, |
86 | DISCE_RESUME, | 86 | DISCE_RESUME, |
87 | DISCE_DESTRUCT, | ||
88 | DISC_NUM_EVENTS, | 87 | DISC_NUM_EVENTS, |
89 | }; | 88 | }; |
90 | 89 | ||
@@ -261,6 +260,7 @@ struct asd_sas_port { | |||
261 | struct list_head dev_list; | 260 | struct list_head dev_list; |
262 | struct list_head disco_list; | 261 | struct list_head disco_list; |
263 | struct list_head destroy_list; | 262 | struct list_head destroy_list; |
263 | struct list_head sas_port_del_list; | ||
264 | enum sas_linkrate linkrate; | 264 | enum sas_linkrate linkrate; |
265 | 265 | ||
266 | struct sas_work work; | 266 | struct sas_work work; |
@@ -292,6 +292,7 @@ struct asd_sas_port { | |||
292 | struct asd_sas_event { | 292 | struct asd_sas_event { |
293 | struct sas_work work; | 293 | struct sas_work work; |
294 | struct asd_sas_phy *phy; | 294 | struct asd_sas_phy *phy; |
295 | int event; | ||
295 | }; | 296 | }; |
296 | 297 | ||
297 | static inline struct asd_sas_event *to_asd_sas_event(struct work_struct *work) | 298 | static inline struct asd_sas_event *to_asd_sas_event(struct work_struct *work) |
@@ -301,17 +302,24 @@ static inline struct asd_sas_event *to_asd_sas_event(struct work_struct *work) | |||
301 | return ev; | 302 | return ev; |
302 | } | 303 | } |
303 | 304 | ||
305 | static inline void INIT_SAS_EVENT(struct asd_sas_event *ev, | ||
306 | void (*fn)(struct work_struct *), | ||
307 | struct asd_sas_phy *phy, int event) | ||
308 | { | ||
309 | INIT_SAS_WORK(&ev->work, fn); | ||
310 | ev->phy = phy; | ||
311 | ev->event = event; | ||
312 | } | ||
313 | |||
314 | #define SAS_PHY_SHUTDOWN_THRES 1024 | ||
315 | |||
304 | /* The phy pretty much is controlled by the LLDD. | 316 | /* The phy pretty much is controlled by the LLDD. |
305 | * The class only reads those fields. | 317 | * The class only reads those fields. |
306 | */ | 318 | */ |
307 | struct asd_sas_phy { | 319 | struct asd_sas_phy { |
308 | /* private: */ | 320 | /* private: */ |
309 | struct asd_sas_event port_events[PORT_NUM_EVENTS]; | 321 | atomic_t event_nr; |
310 | struct asd_sas_event phy_events[PHY_NUM_EVENTS]; | 322 | int in_shutdown; |
311 | |||
312 | unsigned long port_events_pending; | ||
313 | unsigned long phy_events_pending; | ||
314 | |||
315 | int error; | 323 | int error; |
316 | int suspended; | 324 | int suspended; |
317 | 325 | ||
@@ -380,6 +388,9 @@ struct sas_ha_struct { | |||
380 | struct device *dev; /* should be set */ | 388 | struct device *dev; /* should be set */ |
381 | struct module *lldd_module; /* should be set */ | 389 | struct module *lldd_module; /* should be set */ |
382 | 390 | ||
391 | struct workqueue_struct *event_q; | ||
392 | struct workqueue_struct *disco_q; | ||
393 | |||
383 | u8 *sas_addr; /* must be set */ | 394 | u8 *sas_addr; /* must be set */ |
384 | u8 hashed_sas_addr[HASHED_SAS_ADDR_SIZE]; | 395 | u8 hashed_sas_addr[HASHED_SAS_ADDR_SIZE]; |
385 | 396 | ||
@@ -399,6 +410,8 @@ struct sas_ha_struct { | |||
399 | 410 | ||
400 | struct list_head eh_done_q; /* complete via scsi_eh_flush_done_q */ | 411 | struct list_head eh_done_q; /* complete via scsi_eh_flush_done_q */ |
401 | struct list_head eh_ata_q; /* scmds to promote from sas to ata eh */ | 412 | struct list_head eh_ata_q; /* scmds to promote from sas to ata eh */ |
413 | |||
414 | int event_thres; | ||
402 | }; | 415 | }; |
403 | 416 | ||
404 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) | 417 | #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata) |
@@ -670,6 +683,7 @@ extern int sas_bios_param(struct scsi_device *, | |||
670 | sector_t capacity, int *hsc); | 683 | sector_t capacity, int *hsc); |
671 | extern struct scsi_transport_template * | 684 | extern struct scsi_transport_template * |
672 | sas_domain_attach_transport(struct sas_domain_function_template *); | 685 | sas_domain_attach_transport(struct sas_domain_function_template *); |
686 | extern struct device_attribute dev_attr_phy_event_threshold; | ||
673 | 687 | ||
674 | int sas_discover_root_expander(struct domain_device *); | 688 | int sas_discover_root_expander(struct domain_device *); |
675 | 689 | ||