libsas.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  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. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  22. * USA
  23. *
  24. */
  25. #ifndef _LIBSAS_H_
  26. #define _LIBSAS_H_
  27. #include <linux/timer.h>
  28. #include <linux/pci.h>
  29. #include <scsi/sas.h>
  30. #include <linux/libata.h>
  31. #include <linux/list.h>
  32. #include <scsi/scsi_device.h>
  33. #include <scsi/scsi_cmnd.h>
  34. #include <scsi/scsi_transport_sas.h>
  35. #include <linux/scatterlist.h>
  36. struct block_device;
  37. enum sas_class {
  38. SAS,
  39. EXPANDER
  40. };
  41. enum sas_phy_role {
  42. PHY_ROLE_NONE = 0,
  43. PHY_ROLE_TARGET = 0x40,
  44. PHY_ROLE_INITIATOR = 0x80,
  45. };
  46. enum sas_phy_type {
  47. PHY_TYPE_PHYSICAL,
  48. PHY_TYPE_VIRTUAL
  49. };
  50. /* The events are mnemonically described in sas_dump.c
  51. * so when updating/adding events here, please also
  52. * update the other file too.
  53. */
  54. enum ha_event {
  55. HAE_RESET = 0U,
  56. HA_NUM_EVENTS = 1,
  57. };
  58. enum port_event {
  59. PORTE_BYTES_DMAED = 0U,
  60. PORTE_BROADCAST_RCVD = 1,
  61. PORTE_LINK_RESET_ERR = 2,
  62. PORTE_TIMER_EVENT = 3,
  63. PORTE_HARD_RESET = 4,
  64. PORT_NUM_EVENTS = 5,
  65. };
  66. enum phy_event {
  67. PHYE_LOSS_OF_SIGNAL = 0U,
  68. PHYE_OOB_DONE = 1,
  69. PHYE_OOB_ERROR = 2,
  70. PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */
  71. PHY_NUM_EVENTS = 4,
  72. };
  73. enum discover_event {
  74. DISCE_DISCOVER_DOMAIN = 0U,
  75. DISCE_REVALIDATE_DOMAIN = 1,
  76. DISCE_PORT_GONE = 2,
  77. DISC_NUM_EVENTS = 3,
  78. };
  79. /* ---------- Expander Devices ---------- */
  80. #define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj)
  81. #define to_dev_attr(_attr) container_of(_attr, struct domain_dev_attribute,\
  82. attr)
  83. enum routing_attribute {
  84. DIRECT_ROUTING,
  85. SUBTRACTIVE_ROUTING,
  86. TABLE_ROUTING,
  87. };
  88. enum ex_phy_state {
  89. PHY_EMPTY,
  90. PHY_VACANT,
  91. PHY_NOT_PRESENT,
  92. PHY_DEVICE_DISCOVERED
  93. };
  94. struct ex_phy {
  95. int phy_id;
  96. enum ex_phy_state phy_state;
  97. enum sas_dev_type attached_dev_type;
  98. enum sas_linkrate linkrate;
  99. u8 attached_sata_host:1;
  100. u8 attached_sata_dev:1;
  101. u8 attached_sata_ps:1;
  102. enum sas_protocol attached_tproto;
  103. enum sas_protocol attached_iproto;
  104. u8 attached_sas_addr[SAS_ADDR_SIZE];
  105. u8 attached_phy_id;
  106. u8 phy_change_count;
  107. enum routing_attribute routing_attr;
  108. u8 virtual:1;
  109. int last_da_index;
  110. struct sas_phy *phy;
  111. struct sas_port *port;
  112. };
  113. struct expander_device {
  114. struct list_head children;
  115. u16 ex_change_count;
  116. u16 max_route_indexes;
  117. u8 num_phys;
  118. u8 configuring:1;
  119. u8 conf_route_table:1;
  120. u8 enclosure_logical_id[8];
  121. struct ex_phy *ex_phy;
  122. struct sas_port *parent_port;
  123. };
  124. /* ---------- SATA device ---------- */
  125. enum ata_command_set {
  126. ATA_COMMAND_SET = 0,
  127. ATAPI_COMMAND_SET = 1,
  128. };
  129. struct sata_device {
  130. enum ata_command_set command_set;
  131. struct smp_resp rps_resp; /* report_phy_sata_resp */
  132. __le16 *identify_device;
  133. __le16 *identify_packet_device;
  134. u8 port_no; /* port number, if this is a PM (Port) */
  135. struct list_head children; /* PM Ports if this is a PM */
  136. struct ata_port *ap;
  137. struct ata_host ata_host;
  138. struct ata_taskfile tf;
  139. u32 sstatus;
  140. u32 serror;
  141. u32 scontrol;
  142. };
  143. /* ---------- Domain device ---------- */
  144. struct domain_device {
  145. enum sas_dev_type dev_type;
  146. enum sas_linkrate linkrate;
  147. enum sas_linkrate min_linkrate;
  148. enum sas_linkrate max_linkrate;
  149. int pathways;
  150. struct domain_device *parent;
  151. struct list_head siblings; /* devices on the same level */
  152. struct asd_sas_port *port; /* shortcut to root of the tree */
  153. struct list_head dev_list_node;
  154. enum sas_protocol iproto;
  155. enum sas_protocol tproto;
  156. struct sas_rphy *rphy;
  157. u8 sas_addr[SAS_ADDR_SIZE];
  158. u8 hashed_sas_addr[HASHED_SAS_ADDR_SIZE];
  159. u8 frame_rcvd[32];
  160. union {
  161. struct expander_device ex_dev;
  162. struct sata_device sata_dev; /* STP & directly attached */
  163. };
  164. void *lldd_dev;
  165. };
  166. struct sas_discovery_event {
  167. struct work_struct work;
  168. struct asd_sas_port *port;
  169. };
  170. struct sas_discovery {
  171. spinlock_t disc_event_lock;
  172. struct sas_discovery_event disc_work[DISC_NUM_EVENTS];
  173. unsigned long pending;
  174. u8 fanout_sas_addr[8];
  175. u8 eeds_a[8];
  176. u8 eeds_b[8];
  177. int max_level;
  178. };
  179. /* The port struct is Class:RW, driver:RO */
  180. struct asd_sas_port {
  181. /* private: */
  182. struct completion port_gone_completion;
  183. struct sas_discovery disc;
  184. struct domain_device *port_dev;
  185. spinlock_t dev_list_lock;
  186. struct list_head dev_list;
  187. enum sas_linkrate linkrate;
  188. struct sas_phy *phy;
  189. struct work_struct work;
  190. /* public: */
  191. int id;
  192. enum sas_class class;
  193. u8 sas_addr[SAS_ADDR_SIZE];
  194. u8 attached_sas_addr[SAS_ADDR_SIZE];
  195. enum sas_protocol iproto;
  196. enum sas_protocol tproto;
  197. enum sas_oob_mode oob_mode;
  198. spinlock_t phy_list_lock;
  199. struct list_head phy_list;
  200. int num_phys;
  201. u32 phy_mask;
  202. struct sas_ha_struct *ha;
  203. struct sas_port *port;
  204. void *lldd_port; /* not touched by the sas class code */
  205. };
  206. struct asd_sas_event {
  207. struct work_struct work;
  208. struct asd_sas_phy *phy;
  209. };
  210. /* The phy pretty much is controlled by the LLDD.
  211. * The class only reads those fields.
  212. */
  213. struct asd_sas_phy {
  214. /* private: */
  215. /* protected by ha->event_lock */
  216. struct asd_sas_event port_events[PORT_NUM_EVENTS];
  217. struct asd_sas_event phy_events[PHY_NUM_EVENTS];
  218. unsigned long port_events_pending;
  219. unsigned long phy_events_pending;
  220. int error;
  221. struct sas_phy *phy;
  222. /* public: */
  223. /* The following are class:RO, driver:R/W */
  224. int enabled; /* must be set */
  225. int id; /* must be set */
  226. enum sas_class class;
  227. enum sas_protocol iproto;
  228. enum sas_protocol tproto;
  229. enum sas_phy_type type;
  230. enum sas_phy_role role;
  231. enum sas_oob_mode oob_mode;
  232. enum sas_linkrate linkrate;
  233. u8 *sas_addr; /* must be set */
  234. u8 attached_sas_addr[SAS_ADDR_SIZE]; /* class:RO, driver: R/W */
  235. spinlock_t frame_rcvd_lock;
  236. u8 *frame_rcvd; /* must be set */
  237. int frame_rcvd_size;
  238. spinlock_t sas_prim_lock;
  239. u32 sas_prim;
  240. struct list_head port_phy_el; /* driver:RO */
  241. struct asd_sas_port *port; /* Class:RW, driver: RO */
  242. struct sas_ha_struct *ha; /* may be set; the class sets it anyway */
  243. void *lldd_phy; /* not touched by the sas_class_code */
  244. };
  245. struct scsi_core {
  246. struct Scsi_Host *shost;
  247. spinlock_t task_queue_lock;
  248. struct list_head task_queue;
  249. int task_queue_size;
  250. struct task_struct *queue_thread;
  251. };
  252. struct sas_ha_event {
  253. struct work_struct work;
  254. struct sas_ha_struct *ha;
  255. };
  256. enum sas_ha_state {
  257. SAS_HA_REGISTERED,
  258. SAS_HA_UNREGISTERED
  259. };
  260. struct sas_ha_struct {
  261. /* private: */
  262. spinlock_t event_lock;
  263. struct sas_ha_event ha_events[HA_NUM_EVENTS];
  264. unsigned long pending;
  265. enum sas_ha_state state;
  266. spinlock_t state_lock;
  267. struct scsi_core core;
  268. /* public: */
  269. char *sas_ha_name;
  270. struct device *dev; /* should be set */
  271. struct module *lldd_module; /* should be set */
  272. u8 *sas_addr; /* must be set */
  273. u8 hashed_sas_addr[HASHED_SAS_ADDR_SIZE];
  274. spinlock_t phy_port_lock;
  275. struct asd_sas_phy **sas_phy; /* array of valid pointers, must be set */
  276. struct asd_sas_port **sas_port; /* array of valid pointers, must be set */
  277. int num_phys; /* must be set, gt 0, static */
  278. /* The class calls this to send a task for execution. */
  279. int lldd_max_execute_num;
  280. int lldd_queue_size;
  281. /* LLDD calls these to notify the class of an event. */
  282. void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event);
  283. void (*notify_port_event)(struct asd_sas_phy *, enum port_event);
  284. void (*notify_phy_event)(struct asd_sas_phy *, enum phy_event);
  285. void *lldd_ha; /* not touched by sas class code */
  286. struct list_head eh_done_q;
  287. };
  288. #define SHOST_TO_SAS_HA(_shost) (*(struct sas_ha_struct **)(_shost)->hostdata)
  289. static inline struct domain_device *
  290. starget_to_domain_dev(struct scsi_target *starget) {
  291. return starget->hostdata;
  292. }
  293. static inline struct domain_device *
  294. sdev_to_domain_dev(struct scsi_device *sdev) {
  295. return starget_to_domain_dev(sdev->sdev_target);
  296. }
  297. static inline struct domain_device *
  298. cmd_to_domain_dev(struct scsi_cmnd *cmd)
  299. {
  300. return sdev_to_domain_dev(cmd->device);
  301. }
  302. void sas_hash_addr(u8 *hashed, const u8 *sas_addr);
  303. /* Before calling a notify event, LLDD should use this function
  304. * when the link is severed (possibly from its tasklet).
  305. * The idea is that the Class only reads those, while the LLDD,
  306. * can R/W these (thus avoiding a race).
  307. */
  308. static inline void sas_phy_disconnected(struct asd_sas_phy *phy)
  309. {
  310. phy->oob_mode = OOB_NOT_CONNECTED;
  311. phy->linkrate = SAS_LINK_RATE_UNKNOWN;
  312. }
  313. /* ---------- Tasks ---------- */
  314. /*
  315. service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED |
  316. exec_status | | |
  317. ---------------------+---------------------+-----------------------+
  318. SAM_... | X | |
  319. DEV_NO_RESPONSE | X | X |
  320. INTERRUPTED | X | |
  321. QUEUE_FULL | | X |
  322. DEVICE_UNKNOWN | | X |
  323. SG_ERR | | X |
  324. ---------------------+---------------------+-----------------------+
  325. */
  326. enum service_response {
  327. SAS_TASK_COMPLETE,
  328. SAS_TASK_UNDELIVERED = -1,
  329. };
  330. enum exec_status {
  331. SAM_GOOD = 0,
  332. SAM_CHECK_COND = 2,
  333. SAM_COND_MET = 4,
  334. SAM_BUSY = 8,
  335. SAM_INTERMEDIATE = 0x10,
  336. SAM_IM_COND_MET = 0x12,
  337. SAM_RESV_CONFLICT= 0x14,
  338. SAM_TASK_SET_FULL= 0x28,
  339. SAM_ACA_ACTIVE = 0x30,
  340. SAM_TASK_ABORTED = 0x40,
  341. SAS_DEV_NO_RESPONSE = 0x80,
  342. SAS_DATA_UNDERRUN,
  343. SAS_DATA_OVERRUN,
  344. SAS_INTERRUPTED,
  345. SAS_QUEUE_FULL,
  346. SAS_DEVICE_UNKNOWN,
  347. SAS_SG_ERR,
  348. SAS_OPEN_REJECT,
  349. SAS_OPEN_TO,
  350. SAS_PROTO_RESPONSE,
  351. SAS_PHY_DOWN,
  352. SAS_NAK_R_ERR,
  353. SAS_PENDING,
  354. SAS_ABORTED_TASK,
  355. };
  356. /* When a task finishes with a response, the LLDD examines the
  357. * response:
  358. * - For an ATA task task_status_struct::stat is set to
  359. * SAS_PROTO_RESPONSE, and the task_status_struct::buf is set to the
  360. * contents of struct ata_task_resp.
  361. * - For SSP tasks, if no data is present or status/TMF response
  362. * is valid, task_status_struct::stat is set. If data is present
  363. * (SENSE data), the LLDD copies up to SAS_STATUS_BUF_SIZE, sets
  364. * task_status_struct::buf_valid_size, and task_status_struct::stat is
  365. * set to SAM_CHECK_COND.
  366. *
  367. * "buf" has format SCSI Sense for SSP task, or struct ata_task_resp
  368. * for ATA task.
  369. *
  370. * "frame_len" is the total frame length, which could be more or less
  371. * than actually copied.
  372. *
  373. * Tasks ending with response, always set the residual field.
  374. */
  375. struct ata_task_resp {
  376. u16 frame_len;
  377. u8 ending_fis[24]; /* dev to host or data-in */
  378. u32 sstatus;
  379. u32 serror;
  380. u32 scontrol;
  381. u32 sactive;
  382. };
  383. #define SAS_STATUS_BUF_SIZE 96
  384. struct task_status_struct {
  385. enum service_response resp;
  386. enum exec_status stat;
  387. int buf_valid_size;
  388. u8 buf[SAS_STATUS_BUF_SIZE];
  389. u32 residual;
  390. enum sas_open_rej_reason open_rej_reason;
  391. };
  392. /* ATA and ATAPI task queuable to a SAS LLDD.
  393. */
  394. struct sas_ata_task {
  395. struct host_to_dev_fis fis;
  396. u8 atapi_packet[16]; /* 0 if not ATAPI task */
  397. u8 retry_count; /* hardware retry, should be > 0 */
  398. u8 dma_xfer:1; /* PIO:0 or DMA:1 */
  399. u8 use_ncq:1;
  400. u8 set_affil_pol:1;
  401. u8 stp_affil_pol:1;
  402. u8 device_control_reg_update:1;
  403. };
  404. struct sas_smp_task {
  405. struct scatterlist smp_req;
  406. struct scatterlist smp_resp;
  407. };
  408. enum task_attribute {
  409. TASK_ATTR_SIMPLE = 0,
  410. TASK_ATTR_HOQ = 1,
  411. TASK_ATTR_ORDERED= 2,
  412. TASK_ATTR_ACA = 4,
  413. };
  414. struct sas_ssp_task {
  415. u8 retry_count; /* hardware retry, should be > 0 */
  416. u8 LUN[8];
  417. u8 enable_first_burst:1;
  418. enum task_attribute task_attr;
  419. u8 task_prio;
  420. u8 cdb[16];
  421. };
  422. struct sas_task {
  423. struct domain_device *dev;
  424. struct list_head list;
  425. spinlock_t task_state_lock;
  426. unsigned task_state_flags;
  427. enum sas_protocol task_proto;
  428. /* Used by the discovery code. */
  429. struct timer_list timer;
  430. struct completion completion;
  431. union {
  432. struct sas_ata_task ata_task;
  433. struct sas_smp_task smp_task;
  434. struct sas_ssp_task ssp_task;
  435. };
  436. struct scatterlist *scatter;
  437. int num_scatter;
  438. u32 total_xfer_len;
  439. u8 data_dir:2; /* Use PCI_DMA_... */
  440. struct task_status_struct task_status;
  441. void (*task_done)(struct sas_task *);
  442. void *lldd_task; /* for use by LLDDs */
  443. void *uldd_task;
  444. struct work_struct abort_work;
  445. };
  446. extern struct kmem_cache *sas_task_cache;
  447. #define SAS_TASK_STATE_PENDING 1
  448. #define SAS_TASK_STATE_DONE 2
  449. #define SAS_TASK_STATE_ABORTED 4
  450. #define SAS_TASK_NEED_DEV_RESET 8
  451. #define SAS_TASK_AT_INITIATOR 16
  452. static inline struct sas_task *sas_alloc_task(gfp_t flags)
  453. {
  454. struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags);
  455. if (task) {
  456. INIT_LIST_HEAD(&task->list);
  457. spin_lock_init(&task->task_state_lock);
  458. task->task_state_flags = SAS_TASK_STATE_PENDING;
  459. init_timer(&task->timer);
  460. init_completion(&task->completion);
  461. }
  462. return task;
  463. }
  464. static inline void sas_free_task(struct sas_task *task)
  465. {
  466. if (task) {
  467. BUG_ON(!list_empty(&task->list));
  468. kmem_cache_free(sas_task_cache, task);
  469. }
  470. }
  471. struct sas_domain_function_template {
  472. /* The class calls these to notify the LLDD of an event. */
  473. void (*lldd_port_formed)(struct asd_sas_phy *);
  474. void (*lldd_port_deformed)(struct asd_sas_phy *);
  475. /* The class calls these when a device is found or gone. */
  476. int (*lldd_dev_found)(struct domain_device *);
  477. void (*lldd_dev_gone)(struct domain_device *);
  478. int (*lldd_execute_task)(struct sas_task *, int num,
  479. gfp_t gfp_flags);
  480. /* Task Management Functions. Must be called from process context. */
  481. int (*lldd_abort_task)(struct sas_task *);
  482. int (*lldd_abort_task_set)(struct domain_device *, u8 *lun);
  483. int (*lldd_clear_aca)(struct domain_device *, u8 *lun);
  484. int (*lldd_clear_task_set)(struct domain_device *, u8 *lun);
  485. int (*lldd_I_T_nexus_reset)(struct domain_device *);
  486. int (*lldd_lu_reset)(struct domain_device *, u8 *lun);
  487. int (*lldd_query_task)(struct sas_task *);
  488. /* Port and Adapter management */
  489. int (*lldd_clear_nexus_port)(struct asd_sas_port *);
  490. int (*lldd_clear_nexus_ha)(struct sas_ha_struct *);
  491. /* Phy management */
  492. int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *);
  493. };
  494. extern int sas_register_ha(struct sas_ha_struct *);
  495. extern int sas_unregister_ha(struct sas_ha_struct *);
  496. int sas_set_phy_speed(struct sas_phy *phy,
  497. struct sas_phy_linkrates *rates);
  498. int sas_phy_enable(struct sas_phy *phy, int enabled);
  499. int sas_phy_reset(struct sas_phy *phy, int hard_reset);
  500. int sas_queue_up(struct sas_task *task);
  501. extern int sas_queuecommand(struct scsi_cmnd *,
  502. void (*scsi_done)(struct scsi_cmnd *));
  503. extern int sas_target_alloc(struct scsi_target *);
  504. extern int sas_slave_alloc(struct scsi_device *);
  505. extern int sas_slave_configure(struct scsi_device *);
  506. extern void sas_slave_destroy(struct scsi_device *);
  507. extern int sas_change_queue_depth(struct scsi_device *, int new_depth);
  508. extern int sas_change_queue_type(struct scsi_device *, int qt);
  509. extern int sas_bios_param(struct scsi_device *,
  510. struct block_device *,
  511. sector_t capacity, int *hsc);
  512. extern struct scsi_transport_template *
  513. sas_domain_attach_transport(struct sas_domain_function_template *);
  514. extern void sas_domain_release_transport(struct scsi_transport_template *);
  515. int sas_discover_root_expander(struct domain_device *);
  516. void sas_init_ex_attr(void);
  517. int sas_ex_revalidate_domain(struct domain_device *);
  518. void sas_unregister_domain_devices(struct asd_sas_port *port);
  519. void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *);
  520. int sas_discover_event(struct asd_sas_port *, enum discover_event ev);
  521. int sas_discover_sata(struct domain_device *);
  522. int sas_discover_end_dev(struct domain_device *);
  523. void sas_unregister_dev(struct domain_device *);
  524. void sas_init_dev(struct domain_device *);
  525. void sas_task_abort(struct sas_task *);
  526. int __sas_task_abort(struct sas_task *);
  527. int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
  528. int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
  529. extern void sas_target_destroy(struct scsi_target *);
  530. extern int sas_slave_alloc(struct scsi_device *);
  531. extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);
  532. extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
  533. struct request *req);
  534. extern void sas_ssp_task_response(struct device *dev, struct sas_task *task,
  535. struct ssp_response_iu *iu);
  536. struct sas_phy *sas_find_local_phy(struct domain_device *dev);
  537. int sas_request_addr(struct Scsi_Host *shost, u8 *addr);
  538. #endif /* _SASLIB_H_ */