libsas.h (a9344e68ac0a656475006737dbc258d69fe4f7b0) | libsas.h (c376222960ae91d5ffb9197ee36771aaed1d9f90) |
---|---|
1/* 2 * SAS host prototypes and structures header file 3 * 4 * Copyright (C) 2005 Adaptec, Inc. All rights reserved. 5 * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com> 6 * 7 * This file is licensed under GPLv2. 8 * --- 309 unchanged lines hidden (view full) --- 318 int queue_thread_kill; 319}; 320 321struct sas_ha_event { 322 struct work_struct work; 323 struct sas_ha_struct *ha; 324}; 325 | 1/* 2 * SAS host prototypes and structures header file 3 * 4 * Copyright (C) 2005 Adaptec, Inc. All rights reserved. 5 * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com> 6 * 7 * This file is licensed under GPLv2. 8 * --- 309 unchanged lines hidden (view full) --- 318 int queue_thread_kill; 319}; 320 321struct sas_ha_event { 322 struct work_struct work; 323 struct sas_ha_struct *ha; 324}; 325 |
326enum sas_ha_state { 327 SAS_HA_REGISTERED, 328 SAS_HA_UNREGISTERED 329}; 330 | |
331struct sas_ha_struct { 332/* private: */ 333 spinlock_t event_lock; 334 struct sas_ha_event ha_events[HA_NUM_EVENTS]; 335 unsigned long pending; 336 | 326struct sas_ha_struct { 327/* private: */ 328 spinlock_t event_lock; 329 struct sas_ha_event ha_events[HA_NUM_EVENTS]; 330 unsigned long pending; 331 |
337 enum sas_ha_state state; 338 spinlock_t state_lock; 339 | |
340 struct scsi_core core; 341 342/* public: */ 343 char *sas_ha_name; 344 struct pci_dev *pcidev; /* should be set */ 345 struct module *lldd_module; /* should be set */ 346 347 u8 *sas_addr; /* must be set */ --- 208 unchanged lines hidden (view full) --- 556 struct work_struct abort_work; 557}; 558 559 560 561#define SAS_TASK_STATE_PENDING 1 562#define SAS_TASK_STATE_DONE 2 563#define SAS_TASK_STATE_ABORTED 4 | 332 struct scsi_core core; 333 334/* public: */ 335 char *sas_ha_name; 336 struct pci_dev *pcidev; /* should be set */ 337 struct module *lldd_module; /* should be set */ 338 339 u8 *sas_addr; /* must be set */ --- 208 unchanged lines hidden (view full) --- 548 struct work_struct abort_work; 549}; 550 551 552 553#define SAS_TASK_STATE_PENDING 1 554#define SAS_TASK_STATE_DONE 2 555#define SAS_TASK_STATE_ABORTED 4 |
564#define SAS_TASK_NEED_DEV_RESET 8 565#define SAS_TASK_AT_INITIATOR 16 | 556#define SAS_TASK_INITIATOR_ABORTED 8 |
566 567static inline struct sas_task *sas_alloc_task(gfp_t flags) 568{ 569 extern struct kmem_cache *sas_task_cache; | 557 558static inline struct sas_task *sas_alloc_task(gfp_t flags) 559{ 560 extern struct kmem_cache *sas_task_cache; |
570 struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); | 561 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); |
571 572 if (task) { | 562 563 if (task) { |
573 memset(task, 0, sizeof(*task)); | |
574 INIT_LIST_HEAD(&task->list); 575 spin_lock_init(&task->task_state_lock); 576 task->task_state_flags = SAS_TASK_STATE_PENDING; 577 init_timer(&task->timer); 578 init_completion(&task->completion); 579 } 580 581 return task; --- 35 unchanged lines hidden (view full) --- 617 618 /* Phy management */ 619 int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); 620}; 621 622extern int sas_register_ha(struct sas_ha_struct *); 623extern int sas_unregister_ha(struct sas_ha_struct *); 624 | 564 INIT_LIST_HEAD(&task->list); 565 spin_lock_init(&task->task_state_lock); 566 task->task_state_flags = SAS_TASK_STATE_PENDING; 567 init_timer(&task->timer); 568 init_completion(&task->completion); 569 } 570 571 return task; --- 35 unchanged lines hidden (view full) --- 607 608 /* Phy management */ 609 int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); 610}; 611 612extern int sas_register_ha(struct sas_ha_struct *); 613extern int sas_unregister_ha(struct sas_ha_struct *); 614 |
625int sas_set_phy_speed(struct sas_phy *phy, 626 struct sas_phy_linkrates *rates); 627int sas_phy_enable(struct sas_phy *phy, int enabled); | |
628int sas_phy_reset(struct sas_phy *phy, int hard_reset); 629extern int sas_queuecommand(struct scsi_cmnd *, 630 void (*scsi_done)(struct scsi_cmnd *)); 631extern int sas_target_alloc(struct scsi_target *); 632extern int sas_slave_alloc(struct scsi_device *); 633extern int sas_slave_configure(struct scsi_device *); 634extern void sas_slave_destroy(struct scsi_device *); 635extern int sas_change_queue_depth(struct scsi_device *, int new_depth); --- 17 unchanged lines hidden (view full) --- 653 654int sas_discover_sata(struct domain_device *); 655int sas_discover_end_dev(struct domain_device *); 656 657void sas_unregister_dev(struct domain_device *); 658 659void sas_init_dev(struct domain_device *); 660 | 615int sas_phy_reset(struct sas_phy *phy, int hard_reset); 616extern int sas_queuecommand(struct scsi_cmnd *, 617 void (*scsi_done)(struct scsi_cmnd *)); 618extern int sas_target_alloc(struct scsi_target *); 619extern int sas_slave_alloc(struct scsi_device *); 620extern int sas_slave_configure(struct scsi_device *); 621extern void sas_slave_destroy(struct scsi_device *); 622extern int sas_change_queue_depth(struct scsi_device *, int new_depth); --- 17 unchanged lines hidden (view full) --- 640 641int sas_discover_sata(struct domain_device *); 642int sas_discover_end_dev(struct domain_device *); 643 644void sas_unregister_dev(struct domain_device *); 645 646void sas_init_dev(struct domain_device *); 647 |
661void sas_task_abort(struct sas_task *); 662int __sas_task_abort(struct sas_task *); 663int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); 664int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd); | 648void sas_task_abort(struct work_struct *); |
665 666#endif /* _SASLIB_H_ */ | 649 650#endif /* _SASLIB_H_ */ |