scsi_transport_fc.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. * FiberChannel transport specific attributes exported to sysfs.
  3. *
  4. * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. * ========
  21. *
  22. * Copyright (C) 2004-2005 James Smart, Emulex Corporation
  23. * Rewrite for host, target, device, and remote port attributes,
  24. * statistics, and service functions...
  25. *
  26. */
  27. #ifndef SCSI_TRANSPORT_FC_H
  28. #define SCSI_TRANSPORT_FC_H
  29. #include <linux/sched.h>
  30. #include <scsi/scsi.h>
  31. #include <scsi/scsi_netlink.h>
  32. struct scsi_transport_template;
  33. /*
  34. * FC Port definitions - Following FC HBAAPI guidelines
  35. *
  36. * Note: Not all binary values for the different fields match HBAAPI.
  37. * Instead, we use densely packed ordinal values or enums.
  38. * We get away with this as we never present the actual binary values
  39. * externally. For sysfs, we always present the string that describes
  40. * the value. Thus, an admin doesn't need a magic HBAAPI decoder ring
  41. * to understand the values. The HBAAPI user-space library is free to
  42. * convert the strings into the HBAAPI-specified binary values.
  43. *
  44. * Note: Not all HBAAPI-defined values are contained in the definitions
  45. * below. Those not appropriate to an fc_host (e.g. FCP initiator) have
  46. * been removed.
  47. */
  48. /*
  49. * fc_port_type: If you alter this, you also need to alter scsi_transport_fc.c
  50. * (for the ascii descriptions).
  51. */
  52. enum fc_port_type {
  53. FC_PORTTYPE_UNKNOWN,
  54. FC_PORTTYPE_OTHER,
  55. FC_PORTTYPE_NOTPRESENT,
  56. FC_PORTTYPE_NPORT, /* Attached to FPort */
  57. FC_PORTTYPE_NLPORT, /* (Public) Loop w/ FLPort */
  58. FC_PORTTYPE_LPORT, /* (Private) Loop w/o FLPort */
  59. FC_PORTTYPE_PTP, /* Point to Point w/ another NPort */
  60. };
  61. /*
  62. * fc_port_state: If you alter this, you also need to alter scsi_transport_fc.c
  63. * (for the ascii descriptions).
  64. */
  65. enum fc_port_state {
  66. FC_PORTSTATE_UNKNOWN,
  67. FC_PORTSTATE_NOTPRESENT,
  68. FC_PORTSTATE_ONLINE,
  69. FC_PORTSTATE_OFFLINE, /* User has taken Port Offline */
  70. FC_PORTSTATE_BLOCKED,
  71. FC_PORTSTATE_BYPASSED,
  72. FC_PORTSTATE_DIAGNOSTICS,
  73. FC_PORTSTATE_LINKDOWN,
  74. FC_PORTSTATE_ERROR,
  75. FC_PORTSTATE_LOOPBACK,
  76. FC_PORTSTATE_DELETED,
  77. };
  78. /*
  79. * FC Classes of Service
  80. * Note: values are not enumerated, as they can be "or'd" together
  81. * for reporting (e.g. report supported_classes). If you alter this list,
  82. * you also need to alter scsi_transport_fc.c (for the ascii descriptions).
  83. */
  84. #define FC_COS_UNSPECIFIED 0
  85. #define FC_COS_CLASS1 2
  86. #define FC_COS_CLASS2 4
  87. #define FC_COS_CLASS3 8
  88. #define FC_COS_CLASS4 0x10
  89. #define FC_COS_CLASS6 0x40
  90. /*
  91. * FC Port Speeds
  92. * Note: values are not enumerated, as they can be "or'd" together
  93. * for reporting (e.g. report supported_speeds). If you alter this list,
  94. * you also need to alter scsi_transport_fc.c (for the ascii descriptions).
  95. */
  96. #define FC_PORTSPEED_UNKNOWN 0 /* Unknown - transceiver
  97. incapable of reporting */
  98. #define FC_PORTSPEED_1GBIT 1
  99. #define FC_PORTSPEED_2GBIT 2
  100. #define FC_PORTSPEED_4GBIT 4
  101. #define FC_PORTSPEED_10GBIT 8
  102. #define FC_PORTSPEED_8GBIT 0x10
  103. #define FC_PORTSPEED_16GBIT 0x20
  104. #define FC_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */
  105. /*
  106. * fc_tgtid_binding_type: If you alter this, you also need to alter
  107. * scsi_transport_fc.c (for the ascii descriptions).
  108. */
  109. enum fc_tgtid_binding_type {
  110. FC_TGTID_BIND_NONE,
  111. FC_TGTID_BIND_BY_WWPN,
  112. FC_TGTID_BIND_BY_WWNN,
  113. FC_TGTID_BIND_BY_ID,
  114. };
  115. /*
  116. * FC Remote Port Roles
  117. * Note: values are not enumerated, as they can be "or'd" together
  118. * for reporting (e.g. report roles). If you alter this list,
  119. * you also need to alter scsi_transport_fc.c (for the ascii descriptions).
  120. */
  121. #define FC_RPORT_ROLE_UNKNOWN 0x00
  122. #define FC_RPORT_ROLE_FCP_TARGET 0x01
  123. #define FC_RPORT_ROLE_FCP_INITIATOR 0x02
  124. #define FC_RPORT_ROLE_IP_PORT 0x04
  125. /*
  126. * fc_rport_identifiers: This set of data contains all elements
  127. * to uniquely identify a remote FC port. The driver uses this data
  128. * to report the existence of a remote FC port in the topology. Internally,
  129. * the transport uses this data for attributes and to manage consistent
  130. * target id bindings.
  131. */
  132. struct fc_rport_identifiers {
  133. u64 node_name;
  134. u64 port_name;
  135. u32 port_id;
  136. u32 roles;
  137. };
  138. /* Macro for use in defining Remote Port attributes */
  139. #define FC_RPORT_ATTR(_name,_mode,_show,_store) \
  140. struct class_device_attribute class_device_attr_rport_##_name = \
  141. __ATTR(_name,_mode,_show,_store)
  142. /*
  143. * FC Remote Port Attributes
  144. *
  145. * This structure exists for each remote FC port that a LLDD notifies
  146. * the subsystem of. A remote FC port may or may not be a SCSI Target,
  147. * also be a SCSI initiator, IP endpoint, etc. As such, the remote
  148. * port is considered a separate entity, independent of "role" (such
  149. * as scsi target).
  150. *
  151. * --
  152. *
  153. * Attributes are based on HBAAPI V2.0 definitions. Only those
  154. * attributes that are determinable by the local port (aka Host)
  155. * are contained.
  156. *
  157. * Fixed attributes are not expected to change. The driver is
  158. * expected to set these values after successfully calling
  159. * fc_remote_port_add(). The transport fully manages all get functions
  160. * w/o driver interaction.
  161. *
  162. * Dynamic attributes are expected to change. The driver participates
  163. * in all get/set operations via functions provided by the driver.
  164. *
  165. * Private attributes are transport-managed values. They are fully
  166. * managed by the transport w/o driver interaction.
  167. */
  168. struct fc_rport { /* aka fc_starget_attrs */
  169. /* Fixed Attributes */
  170. u32 maxframe_size;
  171. u32 supported_classes;
  172. /* Dynamic Attributes */
  173. u32 dev_loss_tmo; /* Remote Port loss timeout in seconds. */
  174. /* Private (Transport-managed) Attributes */
  175. u64 node_name;
  176. u64 port_name;
  177. u32 port_id;
  178. u32 roles;
  179. enum fc_port_state port_state; /* Will only be ONLINE or UNKNOWN */
  180. u32 scsi_target_id;
  181. u32 fast_io_fail_tmo;
  182. /* exported data */
  183. void *dd_data; /* Used for driver-specific storage */
  184. /* internal data */
  185. unsigned int channel;
  186. u32 number;
  187. u8 flags;
  188. struct list_head peers;
  189. struct device dev;
  190. struct delayed_work dev_loss_work;
  191. struct work_struct scan_work;
  192. struct delayed_work fail_io_work;
  193. struct work_struct stgt_delete_work;
  194. struct work_struct rport_delete_work;
  195. } __attribute__((aligned(sizeof(unsigned long))));
  196. /* bit field values for struct fc_rport "flags" field: */
  197. #define FC_RPORT_DEVLOSS_PENDING 0x01
  198. #define FC_RPORT_SCAN_PENDING 0x02
  199. #define dev_to_rport(d) \
  200. container_of(d, struct fc_rport, dev)
  201. #define transport_class_to_rport(classdev) \
  202. dev_to_rport(classdev->dev)
  203. #define rport_to_shost(r) \
  204. dev_to_shost(r->dev.parent)
  205. /*
  206. * FC SCSI Target Attributes
  207. *
  208. * The SCSI Target is considered an extention of a remote port (as
  209. * a remote port can be more than a SCSI Target). Within the scsi
  210. * subsystem, we leave the Target as a separate entity. Doing so
  211. * provides backward compatibility with prior FC transport api's,
  212. * and lets remote ports be handled entirely within the FC transport
  213. * and independently from the scsi subsystem. The drawback is that
  214. * some data will be duplicated.
  215. */
  216. struct fc_starget_attrs { /* aka fc_target_attrs */
  217. /* Dynamic Attributes */
  218. u64 node_name;
  219. u64 port_name;
  220. u32 port_id;
  221. };
  222. #define fc_starget_node_name(x) \
  223. (((struct fc_starget_attrs *)&(x)->starget_data)->node_name)
  224. #define fc_starget_port_name(x) \
  225. (((struct fc_starget_attrs *)&(x)->starget_data)->port_name)
  226. #define fc_starget_port_id(x) \
  227. (((struct fc_starget_attrs *)&(x)->starget_data)->port_id)
  228. #define starget_to_rport(s) \
  229. scsi_is_fc_rport(s->dev.parent) ? dev_to_rport(s->dev.parent) : NULL
  230. /*
  231. * FC Local Port (Host) Statistics
  232. */
  233. /* FC Statistics - Following FC HBAAPI v2.0 guidelines */
  234. struct fc_host_statistics {
  235. /* port statistics */
  236. u64 seconds_since_last_reset;
  237. u64 tx_frames;
  238. u64 tx_words;
  239. u64 rx_frames;
  240. u64 rx_words;
  241. u64 lip_count;
  242. u64 nos_count;
  243. u64 error_frames;
  244. u64 dumped_frames;
  245. u64 link_failure_count;
  246. u64 loss_of_sync_count;
  247. u64 loss_of_signal_count;
  248. u64 prim_seq_protocol_err_count;
  249. u64 invalid_tx_word_count;
  250. u64 invalid_crc_count;
  251. /* fc4 statistics (only FCP supported currently) */
  252. u64 fcp_input_requests;
  253. u64 fcp_output_requests;
  254. u64 fcp_control_requests;
  255. u64 fcp_input_megabytes;
  256. u64 fcp_output_megabytes;
  257. };
  258. /*
  259. * FC Event Codes - Polled and Async, following FC HBAAPI v2.0 guidelines
  260. */
  261. /*
  262. * fc_host_event_code: If you alter this, you also need to alter
  263. * scsi_transport_fc.c (for the ascii descriptions).
  264. */
  265. enum fc_host_event_code {
  266. FCH_EVT_LIP = 0x1,
  267. FCH_EVT_LINKUP = 0x2,
  268. FCH_EVT_LINKDOWN = 0x3,
  269. FCH_EVT_LIPRESET = 0x4,
  270. FCH_EVT_RSCN = 0x5,
  271. FCH_EVT_ADAPTER_CHANGE = 0x103,
  272. FCH_EVT_PORT_UNKNOWN = 0x200,
  273. FCH_EVT_PORT_OFFLINE = 0x201,
  274. FCH_EVT_PORT_ONLINE = 0x202,
  275. FCH_EVT_PORT_FABRIC = 0x204,
  276. FCH_EVT_LINK_UNKNOWN = 0x500,
  277. FCH_EVT_VENDOR_UNIQUE = 0xffff,
  278. };
  279. /*
  280. * FC Local Port (Host) Attributes
  281. *
  282. * Attributes are based on HBAAPI V2.0 definitions.
  283. * Note: OSDeviceName is determined by user-space library
  284. *
  285. * Fixed attributes are not expected to change. The driver is
  286. * expected to set these values after successfully calling scsi_add_host().
  287. * The transport fully manages all get functions w/o driver interaction.
  288. *
  289. * Dynamic attributes are expected to change. The driver participates
  290. * in all get/set operations via functions provided by the driver.
  291. *
  292. * Private attributes are transport-managed values. They are fully
  293. * managed by the transport w/o driver interaction.
  294. */
  295. #define FC_FC4_LIST_SIZE 32
  296. #define FC_SYMBOLIC_NAME_SIZE 256
  297. #define FC_VERSION_STRING_SIZE 64
  298. #define FC_SERIAL_NUMBER_SIZE 80
  299. struct fc_host_attrs {
  300. /* Fixed Attributes */
  301. u64 node_name;
  302. u64 port_name;
  303. u64 permanent_port_name;
  304. u32 supported_classes;
  305. u8 supported_fc4s[FC_FC4_LIST_SIZE];
  306. u32 supported_speeds;
  307. u32 maxframe_size;
  308. char serial_number[FC_SERIAL_NUMBER_SIZE];
  309. /* Dynamic Attributes */
  310. u32 port_id;
  311. enum fc_port_type port_type;
  312. enum fc_port_state port_state;
  313. u8 active_fc4s[FC_FC4_LIST_SIZE];
  314. u32 speed;
  315. u64 fabric_name;
  316. char symbolic_name[FC_SYMBOLIC_NAME_SIZE];
  317. char system_hostname[FC_SYMBOLIC_NAME_SIZE];
  318. /* Private (Transport-managed) Attributes */
  319. enum fc_tgtid_binding_type tgtid_bind_type;
  320. /* internal data */
  321. struct list_head rports;
  322. struct list_head rport_bindings;
  323. u32 next_rport_number;
  324. u32 next_target_id;
  325. /* work queues for rport state manipulation */
  326. char work_q_name[KOBJ_NAME_LEN];
  327. struct workqueue_struct *work_q;
  328. char devloss_work_q_name[KOBJ_NAME_LEN];
  329. struct workqueue_struct *devloss_work_q;
  330. };
  331. #define shost_to_fc_host(x) \
  332. ((struct fc_host_attrs *)(x)->shost_data)
  333. #define fc_host_node_name(x) \
  334. (((struct fc_host_attrs *)(x)->shost_data)->node_name)
  335. #define fc_host_port_name(x) \
  336. (((struct fc_host_attrs *)(x)->shost_data)->port_name)
  337. #define fc_host_permanent_port_name(x) \
  338. (((struct fc_host_attrs *)(x)->shost_data)->permanent_port_name)
  339. #define fc_host_supported_classes(x) \
  340. (((struct fc_host_attrs *)(x)->shost_data)->supported_classes)
  341. #define fc_host_supported_fc4s(x) \
  342. (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s)
  343. #define fc_host_supported_speeds(x) \
  344. (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds)
  345. #define fc_host_maxframe_size(x) \
  346. (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size)
  347. #define fc_host_serial_number(x) \
  348. (((struct fc_host_attrs *)(x)->shost_data)->serial_number)
  349. #define fc_host_port_id(x) \
  350. (((struct fc_host_attrs *)(x)->shost_data)->port_id)
  351. #define fc_host_port_type(x) \
  352. (((struct fc_host_attrs *)(x)->shost_data)->port_type)
  353. #define fc_host_port_state(x) \
  354. (((struct fc_host_attrs *)(x)->shost_data)->port_state)
  355. #define fc_host_active_fc4s(x) \
  356. (((struct fc_host_attrs *)(x)->shost_data)->active_fc4s)
  357. #define fc_host_speed(x) \
  358. (((struct fc_host_attrs *)(x)->shost_data)->speed)
  359. #define fc_host_fabric_name(x) \
  360. (((struct fc_host_attrs *)(x)->shost_data)->fabric_name)
  361. #define fc_host_symbolic_name(x) \
  362. (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name)
  363. #define fc_host_system_hostname(x) \
  364. (((struct fc_host_attrs *)(x)->shost_data)->system_hostname)
  365. #define fc_host_tgtid_bind_type(x) \
  366. (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type)
  367. #define fc_host_rports(x) \
  368. (((struct fc_host_attrs *)(x)->shost_data)->rports)
  369. #define fc_host_rport_bindings(x) \
  370. (((struct fc_host_attrs *)(x)->shost_data)->rport_bindings)
  371. #define fc_host_next_rport_number(x) \
  372. (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)
  373. #define fc_host_next_target_id(x) \
  374. (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)
  375. #define fc_host_work_q_name(x) \
  376. (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)
  377. #define fc_host_work_q(x) \
  378. (((struct fc_host_attrs *)(x)->shost_data)->work_q)
  379. #define fc_host_devloss_work_q_name(x) \
  380. (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
  381. #define fc_host_devloss_work_q(x) \
  382. (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
  383. /* The functions by which the transport class and the driver communicate */
  384. struct fc_function_template {
  385. void (*get_rport_dev_loss_tmo)(struct fc_rport *);
  386. void (*set_rport_dev_loss_tmo)(struct fc_rport *, u32);
  387. void (*get_starget_node_name)(struct scsi_target *);
  388. void (*get_starget_port_name)(struct scsi_target *);
  389. void (*get_starget_port_id)(struct scsi_target *);
  390. void (*get_host_port_id)(struct Scsi_Host *);
  391. void (*get_host_port_type)(struct Scsi_Host *);
  392. void (*get_host_port_state)(struct Scsi_Host *);
  393. void (*get_host_active_fc4s)(struct Scsi_Host *);
  394. void (*get_host_speed)(struct Scsi_Host *);
  395. void (*get_host_fabric_name)(struct Scsi_Host *);
  396. void (*get_host_symbolic_name)(struct Scsi_Host *);
  397. void (*set_host_system_hostname)(struct Scsi_Host *);
  398. struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *);
  399. void (*reset_fc_host_stats)(struct Scsi_Host *);
  400. int (*issue_fc_host_lip)(struct Scsi_Host *);
  401. void (*dev_loss_tmo_callbk)(struct fc_rport *);
  402. void (*terminate_rport_io)(struct fc_rport *);
  403. /* allocation lengths for host-specific data */
  404. u32 dd_fcrport_size;
  405. /*
  406. * The driver sets these to tell the transport class it
  407. * wants the attributes displayed in sysfs. If the show_ flag
  408. * is not set, the attribute will be private to the transport
  409. * class
  410. */
  411. /* remote port fixed attributes */
  412. unsigned long show_rport_maxframe_size:1;
  413. unsigned long show_rport_supported_classes:1;
  414. unsigned long show_rport_dev_loss_tmo:1;
  415. /*
  416. * target dynamic attributes
  417. * These should all be "1" if the driver uses the remote port
  418. * add/delete functions (so attributes reflect rport values).
  419. */
  420. unsigned long show_starget_node_name:1;
  421. unsigned long show_starget_port_name:1;
  422. unsigned long show_starget_port_id:1;
  423. /* host fixed attributes */
  424. unsigned long show_host_node_name:1;
  425. unsigned long show_host_port_name:1;
  426. unsigned long show_host_permanent_port_name:1;
  427. unsigned long show_host_supported_classes:1;
  428. unsigned long show_host_supported_fc4s:1;
  429. unsigned long show_host_supported_speeds:1;
  430. unsigned long show_host_maxframe_size:1;
  431. unsigned long show_host_serial_number:1;
  432. /* host dynamic attributes */
  433. unsigned long show_host_port_id:1;
  434. unsigned long show_host_port_type:1;
  435. unsigned long show_host_port_state:1;
  436. unsigned long show_host_active_fc4s:1;
  437. unsigned long show_host_speed:1;
  438. unsigned long show_host_fabric_name:1;
  439. unsigned long show_host_symbolic_name:1;
  440. unsigned long show_host_system_hostname:1;
  441. };
  442. /**
  443. * fc_remote_port_chkready - called to validate the remote port state
  444. * prior to initiating io to the port.
  445. *
  446. * Returns a scsi result code that can be returned by the LLDD.
  447. *
  448. * @rport: remote port to be checked
  449. **/
  450. static inline int
  451. fc_remote_port_chkready(struct fc_rport *rport)
  452. {
  453. int result;
  454. switch (rport->port_state) {
  455. case FC_PORTSTATE_ONLINE:
  456. if (rport->roles & FC_RPORT_ROLE_FCP_TARGET)
  457. result = 0;
  458. else if (rport->flags & FC_RPORT_DEVLOSS_PENDING)
  459. result = DID_IMM_RETRY << 16;
  460. else
  461. result = DID_NO_CONNECT << 16;
  462. break;
  463. case FC_PORTSTATE_BLOCKED:
  464. result = DID_IMM_RETRY << 16;
  465. break;
  466. default:
  467. result = DID_NO_CONNECT << 16;
  468. break;
  469. }
  470. return result;
  471. }
  472. static inline u64 wwn_to_u64(u8 *wwn)
  473. {
  474. return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 |
  475. (u64)wwn[2] << 40 | (u64)wwn[3] << 32 |
  476. (u64)wwn[4] << 24 | (u64)wwn[5] << 16 |
  477. (u64)wwn[6] << 8 | (u64)wwn[7];
  478. }
  479. static inline void u64_to_wwn(u64 inm, u8 *wwn)
  480. {
  481. wwn[0] = (inm >> 56) & 0xff;
  482. wwn[1] = (inm >> 48) & 0xff;
  483. wwn[2] = (inm >> 40) & 0xff;
  484. wwn[3] = (inm >> 32) & 0xff;
  485. wwn[4] = (inm >> 24) & 0xff;
  486. wwn[5] = (inm >> 16) & 0xff;
  487. wwn[6] = (inm >> 8) & 0xff;
  488. wwn[7] = inm & 0xff;
  489. }
  490. struct scsi_transport_template *fc_attach_transport(
  491. struct fc_function_template *);
  492. void fc_release_transport(struct scsi_transport_template *);
  493. void fc_remove_host(struct Scsi_Host *);
  494. struct fc_rport *fc_remote_port_add(struct Scsi_Host *shost,
  495. int channel, struct fc_rport_identifiers *ids);
  496. void fc_remote_port_delete(struct fc_rport *rport);
  497. void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles);
  498. int scsi_is_fc_rport(const struct device *);
  499. u32 fc_get_event_number(void);
  500. void fc_host_post_event(struct Scsi_Host *shost, u32 event_number,
  501. enum fc_host_event_code event_code, u32 event_data);
  502. void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
  503. u32 data_len, char * data_buf, u64 vendor_id);
  504. /* Note: when specifying vendor_id to fc_host_post_vendor_event()
  505. * be sure to read the Vendor Type and ID formatting requirements
  506. * specified in scsi_netlink.h
  507. */
  508. #endif /* SCSI_TRANSPORT_FC_H */