scsi_transport_fc.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  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_NOT_NEGOTIATED (1 << 15) /* Speed not established */
  103. /*
  104. * fc_tgtid_binding_type: If you alter this, you also need to alter
  105. * scsi_transport_fc.c (for the ascii descriptions).
  106. */
  107. enum fc_tgtid_binding_type {
  108. FC_TGTID_BIND_NONE,
  109. FC_TGTID_BIND_BY_WWPN,
  110. FC_TGTID_BIND_BY_WWNN,
  111. FC_TGTID_BIND_BY_ID,
  112. };
  113. /*
  114. * FC Remote Port Roles
  115. * Note: values are not enumerated, as they can be "or'd" together
  116. * for reporting (e.g. report roles). If you alter this list,
  117. * you also need to alter scsi_transport_fc.c (for the ascii descriptions).
  118. */
  119. #define FC_RPORT_ROLE_UNKNOWN 0x00
  120. #define FC_RPORT_ROLE_FCP_TARGET 0x01
  121. #define FC_RPORT_ROLE_FCP_INITIATOR 0x02
  122. #define FC_RPORT_ROLE_IP_PORT 0x04
  123. /*
  124. * fc_rport_identifiers: This set of data contains all elements
  125. * to uniquely identify a remote FC port. The driver uses this data
  126. * to report the existence of a remote FC port in the topology. Internally,
  127. * the transport uses this data for attributes and to manage consistent
  128. * target id bindings.
  129. */
  130. struct fc_rport_identifiers {
  131. u64 node_name;
  132. u64 port_name;
  133. u32 port_id;
  134. u32 roles;
  135. };
  136. /* Macro for use in defining Remote Port attributes */
  137. #define FC_RPORT_ATTR(_name,_mode,_show,_store) \
  138. struct class_device_attribute class_device_attr_rport_##_name = \
  139. __ATTR(_name,_mode,_show,_store)
  140. /*
  141. * FC Remote Port Attributes
  142. *
  143. * This structure exists for each remote FC port that a LLDD notifies
  144. * the subsystem of. A remote FC port may or may not be a SCSI Target,
  145. * also be a SCSI initiator, IP endpoint, etc. As such, the remote
  146. * port is considered a separate entity, independent of "role" (such
  147. * as scsi target).
  148. *
  149. * --
  150. *
  151. * Attributes are based on HBAAPI V2.0 definitions. Only those
  152. * attributes that are determinable by the local port (aka Host)
  153. * are contained.
  154. *
  155. * Fixed attributes are not expected to change. The driver is
  156. * expected to set these values after successfully calling
  157. * fc_remote_port_add(). The transport fully manages all get functions
  158. * w/o driver interaction.
  159. *
  160. * Dynamic attributes are expected to change. The driver participates
  161. * in all get/set operations via functions provided by the driver.
  162. *
  163. * Private attributes are transport-managed values. They are fully
  164. * managed by the transport w/o driver interaction.
  165. */
  166. struct fc_rport { /* aka fc_starget_attrs */
  167. /* Fixed Attributes */
  168. u32 maxframe_size;
  169. u32 supported_classes;
  170. /* Dynamic Attributes */
  171. u32 dev_loss_tmo; /* Remote Port loss timeout in seconds. */
  172. /* Private (Transport-managed) Attributes */
  173. u64 node_name;
  174. u64 port_name;
  175. u32 port_id;
  176. u32 roles;
  177. enum fc_port_state port_state; /* Will only be ONLINE or UNKNOWN */
  178. u32 scsi_target_id;
  179. u32 fast_io_fail_tmo;
  180. /* exported data */
  181. void *dd_data; /* Used for driver-specific storage */
  182. /* internal data */
  183. unsigned int channel;
  184. u32 number;
  185. u8 flags;
  186. struct list_head peers;
  187. struct device dev;
  188. struct work_struct dev_loss_work;
  189. struct work_struct scan_work;
  190. struct work_struct fail_io_work;
  191. struct work_struct stgt_delete_work;
  192. struct work_struct rport_delete_work;
  193. } __attribute__((aligned(sizeof(unsigned long))));
  194. /* bit field values for struct fc_rport "flags" field: */
  195. #define FC_RPORT_DEVLOSS_PENDING 0x01
  196. #define FC_RPORT_SCAN_PENDING 0x02
  197. #define dev_to_rport(d) \
  198. container_of(d, struct fc_rport, dev)
  199. #define transport_class_to_rport(classdev) \
  200. dev_to_rport(classdev->dev)
  201. #define rport_to_shost(r) \
  202. dev_to_shost(r->dev.parent)
  203. /*
  204. * FC SCSI Target Attributes
  205. *
  206. * The SCSI Target is considered an extention of a remote port (as
  207. * a remote port can be more than a SCSI Target). Within the scsi
  208. * subsystem, we leave the Target as a separate entity. Doing so
  209. * provides backward compatibility with prior FC transport api's,
  210. * and lets remote ports be handled entirely within the FC transport
  211. * and independently from the scsi subsystem. The drawback is that
  212. * some data will be duplicated.
  213. */
  214. struct fc_starget_attrs { /* aka fc_target_attrs */
  215. /* Dynamic Attributes */
  216. u64 node_name;
  217. u64 port_name;
  218. u32 port_id;
  219. };
  220. #define fc_starget_node_name(x) \
  221. (((struct fc_starget_attrs *)&(x)->starget_data)->node_name)
  222. #define fc_starget_port_name(x) \
  223. (((struct fc_starget_attrs *)&(x)->starget_data)->port_name)
  224. #define fc_starget_port_id(x) \
  225. (((struct fc_starget_attrs *)&(x)->starget_data)->port_id)
  226. #define starget_to_rport(s) \
  227. scsi_is_fc_rport(s->dev.parent) ? dev_to_rport(s->dev.parent) : NULL
  228. /*
  229. * FC Local Port (Host) Statistics
  230. */
  231. /* FC Statistics - Following FC HBAAPI v2.0 guidelines */
  232. struct fc_host_statistics {
  233. /* port statistics */
  234. u64 seconds_since_last_reset;
  235. u64 tx_frames;
  236. u64 tx_words;
  237. u64 rx_frames;
  238. u64 rx_words;
  239. u64 lip_count;
  240. u64 nos_count;
  241. u64 error_frames;
  242. u64 dumped_frames;
  243. u64 link_failure_count;
  244. u64 loss_of_sync_count;
  245. u64 loss_of_signal_count;
  246. u64 prim_seq_protocol_err_count;
  247. u64 invalid_tx_word_count;
  248. u64 invalid_crc_count;
  249. /* fc4 statistics (only FCP supported currently) */
  250. u64 fcp_input_requests;
  251. u64 fcp_output_requests;
  252. u64 fcp_control_requests;
  253. u64 fcp_input_megabytes;
  254. u64 fcp_output_megabytes;
  255. };
  256. /*
  257. * FC Event Codes - Polled and Async, following FC HBAAPI v2.0 guidelines
  258. */
  259. /*
  260. * fc_host_event_code: If you alter this, you also need to alter
  261. * scsi_transport_fc.c (for the ascii descriptions).
  262. */
  263. enum fc_host_event_code {
  264. FCH_EVT_LIP = 0x1,
  265. FCH_EVT_LINKUP = 0x2,
  266. FCH_EVT_LINKDOWN = 0x3,
  267. FCH_EVT_LIPRESET = 0x4,
  268. FCH_EVT_RSCN = 0x5,
  269. FCH_EVT_ADAPTER_CHANGE = 0x103,
  270. FCH_EVT_PORT_UNKNOWN = 0x200,
  271. FCH_EVT_PORT_OFFLINE = 0x201,
  272. FCH_EVT_PORT_ONLINE = 0x202,
  273. FCH_EVT_PORT_FABRIC = 0x204,
  274. FCH_EVT_LINK_UNKNOWN = 0x500,
  275. FCH_EVT_VENDOR_UNIQUE = 0xffff,
  276. };
  277. /*
  278. * FC Local Port (Host) Attributes
  279. *
  280. * Attributes are based on HBAAPI V2.0 definitions.
  281. * Note: OSDeviceName is determined by user-space library
  282. *
  283. * Fixed attributes are not expected to change. The driver is
  284. * expected to set these values after successfully calling scsi_add_host().
  285. * The transport fully manages all get functions w/o driver interaction.
  286. *
  287. * Dynamic attributes are expected to change. The driver participates
  288. * in all get/set operations via functions provided by the driver.
  289. *
  290. * Private attributes are transport-managed values. They are fully
  291. * managed by the transport w/o driver interaction.
  292. */
  293. #define FC_FC4_LIST_SIZE 32
  294. #define FC_SYMBOLIC_NAME_SIZE 256
  295. #define FC_VERSION_STRING_SIZE 64
  296. #define FC_SERIAL_NUMBER_SIZE 80
  297. struct fc_host_attrs {
  298. /* Fixed Attributes */
  299. u64 node_name;
  300. u64 port_name;
  301. u64 permanent_port_name;
  302. u32 supported_classes;
  303. u8 supported_fc4s[FC_FC4_LIST_SIZE];
  304. u32 supported_speeds;
  305. u32 maxframe_size;
  306. char serial_number[FC_SERIAL_NUMBER_SIZE];
  307. /* Dynamic Attributes */
  308. u32 port_id;
  309. enum fc_port_type port_type;
  310. enum fc_port_state port_state;
  311. u8 active_fc4s[FC_FC4_LIST_SIZE];
  312. u32 speed;
  313. u64 fabric_name;
  314. char symbolic_name[FC_SYMBOLIC_NAME_SIZE];
  315. char system_hostname[FC_SYMBOLIC_NAME_SIZE];
  316. /* Private (Transport-managed) Attributes */
  317. enum fc_tgtid_binding_type tgtid_bind_type;
  318. /* internal data */
  319. struct list_head rports;
  320. struct list_head rport_bindings;
  321. u32 next_rport_number;
  322. u32 next_target_id;
  323. /* work queues for rport state manipulation */
  324. char work_q_name[KOBJ_NAME_LEN];
  325. struct workqueue_struct *work_q;
  326. char devloss_work_q_name[KOBJ_NAME_LEN];
  327. struct workqueue_struct *devloss_work_q;
  328. };
  329. #define shost_to_fc_host(x) \
  330. ((struct fc_host_attrs *)(x)->shost_data)
  331. #define fc_host_node_name(x) \
  332. (((struct fc_host_attrs *)(x)->shost_data)->node_name)
  333. #define fc_host_port_name(x) \
  334. (((struct fc_host_attrs *)(x)->shost_data)->port_name)
  335. #define fc_host_permanent_port_name(x) \
  336. (((struct fc_host_attrs *)(x)->shost_data)->permanent_port_name)
  337. #define fc_host_supported_classes(x) \
  338. (((struct fc_host_attrs *)(x)->shost_data)->supported_classes)
  339. #define fc_host_supported_fc4s(x) \
  340. (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s)
  341. #define fc_host_supported_speeds(x) \
  342. (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds)
  343. #define fc_host_maxframe_size(x) \
  344. (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size)
  345. #define fc_host_serial_number(x) \
  346. (((struct fc_host_attrs *)(x)->shost_data)->serial_number)
  347. #define fc_host_port_id(x) \
  348. (((struct fc_host_attrs *)(x)->shost_data)->port_id)
  349. #define fc_host_port_type(x) \
  350. (((struct fc_host_attrs *)(x)->shost_data)->port_type)
  351. #define fc_host_port_state(x) \
  352. (((struct fc_host_attrs *)(x)->shost_data)->port_state)
  353. #define fc_host_active_fc4s(x) \
  354. (((struct fc_host_attrs *)(x)->shost_data)->active_fc4s)
  355. #define fc_host_speed(x) \
  356. (((struct fc_host_attrs *)(x)->shost_data)->speed)
  357. #define fc_host_fabric_name(x) \
  358. (((struct fc_host_attrs *)(x)->shost_data)->fabric_name)
  359. #define fc_host_symbolic_name(x) \
  360. (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name)
  361. #define fc_host_system_hostname(x) \
  362. (((struct fc_host_attrs *)(x)->shost_data)->system_hostname)
  363. #define fc_host_tgtid_bind_type(x) \
  364. (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type)
  365. #define fc_host_rports(x) \
  366. (((struct fc_host_attrs *)(x)->shost_data)->rports)
  367. #define fc_host_rport_bindings(x) \
  368. (((struct fc_host_attrs *)(x)->shost_data)->rport_bindings)
  369. #define fc_host_next_rport_number(x) \
  370. (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)
  371. #define fc_host_next_target_id(x) \
  372. (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)
  373. #define fc_host_work_q_name(x) \
  374. (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)
  375. #define fc_host_work_q(x) \
  376. (((struct fc_host_attrs *)(x)->shost_data)->work_q)
  377. #define fc_host_devloss_work_q_name(x) \
  378. (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
  379. #define fc_host_devloss_work_q(x) \
  380. (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
  381. /* The functions by which the transport class and the driver communicate */
  382. struct fc_function_template {
  383. void (*get_rport_dev_loss_tmo)(struct fc_rport *);
  384. void (*set_rport_dev_loss_tmo)(struct fc_rport *, u32);
  385. void (*get_starget_node_name)(struct scsi_target *);
  386. void (*get_starget_port_name)(struct scsi_target *);
  387. void (*get_starget_port_id)(struct scsi_target *);
  388. void (*get_host_port_id)(struct Scsi_Host *);
  389. void (*get_host_port_type)(struct Scsi_Host *);
  390. void (*get_host_port_state)(struct Scsi_Host *);
  391. void (*get_host_active_fc4s)(struct Scsi_Host *);
  392. void (*get_host_speed)(struct Scsi_Host *);
  393. void (*get_host_fabric_name)(struct Scsi_Host *);
  394. void (*get_host_symbolic_name)(struct Scsi_Host *);
  395. void (*set_host_system_hostname)(struct Scsi_Host *);
  396. struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *);
  397. void (*reset_fc_host_stats)(struct Scsi_Host *);
  398. int (*issue_fc_host_lip)(struct Scsi_Host *);
  399. void (*dev_loss_tmo_callbk)(struct fc_rport *);
  400. void (*terminate_rport_io)(struct fc_rport *);
  401. /* allocation lengths for host-specific data */
  402. u32 dd_fcrport_size;
  403. /*
  404. * The driver sets these to tell the transport class it
  405. * wants the attributes displayed in sysfs. If the show_ flag
  406. * is not set, the attribute will be private to the transport
  407. * class
  408. */
  409. /* remote port fixed attributes */
  410. unsigned long show_rport_maxframe_size:1;
  411. unsigned long show_rport_supported_classes:1;
  412. unsigned long show_rport_dev_loss_tmo:1;
  413. /*
  414. * target dynamic attributes
  415. * These should all be "1" if the driver uses the remote port
  416. * add/delete functions (so attributes reflect rport values).
  417. */
  418. unsigned long show_starget_node_name:1;
  419. unsigned long show_starget_port_name:1;
  420. unsigned long show_starget_port_id:1;
  421. /* host fixed attributes */
  422. unsigned long show_host_node_name:1;
  423. unsigned long show_host_port_name:1;
  424. unsigned long show_host_permanent_port_name:1;
  425. unsigned long show_host_supported_classes:1;
  426. unsigned long show_host_supported_fc4s:1;
  427. unsigned long show_host_supported_speeds:1;
  428. unsigned long show_host_maxframe_size:1;
  429. unsigned long show_host_serial_number:1;
  430. /* host dynamic attributes */
  431. unsigned long show_host_port_id:1;
  432. unsigned long show_host_port_type:1;
  433. unsigned long show_host_port_state:1;
  434. unsigned long show_host_active_fc4s:1;
  435. unsigned long show_host_speed:1;
  436. unsigned long show_host_fabric_name:1;
  437. unsigned long show_host_symbolic_name:1;
  438. unsigned long show_host_system_hostname:1;
  439. };
  440. /**
  441. * fc_remote_port_chkready - called to validate the remote port state
  442. * prior to initiating io to the port.
  443. *
  444. * Returns a scsi result code that can be returned by the LLDD.
  445. *
  446. * @rport: remote port to be checked
  447. **/
  448. static inline int
  449. fc_remote_port_chkready(struct fc_rport *rport)
  450. {
  451. int result;
  452. switch (rport->port_state) {
  453. case FC_PORTSTATE_ONLINE:
  454. if (rport->roles & FC_RPORT_ROLE_FCP_TARGET)
  455. result = 0;
  456. else if (rport->flags & FC_RPORT_DEVLOSS_PENDING)
  457. result = DID_IMM_RETRY << 16;
  458. else
  459. result = DID_NO_CONNECT << 16;
  460. break;
  461. case FC_PORTSTATE_BLOCKED:
  462. result = DID_IMM_RETRY << 16;
  463. break;
  464. default:
  465. result = DID_NO_CONNECT << 16;
  466. break;
  467. }
  468. return result;
  469. }
  470. static inline u64 wwn_to_u64(u8 *wwn)
  471. {
  472. return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 |
  473. (u64)wwn[2] << 40 | (u64)wwn[3] << 32 |
  474. (u64)wwn[4] << 24 | (u64)wwn[5] << 16 |
  475. (u64)wwn[6] << 8 | (u64)wwn[7];
  476. }
  477. static inline void u64_to_wwn(u64 inm, u8 *wwn)
  478. {
  479. wwn[0] = (inm >> 56) & 0xff;
  480. wwn[1] = (inm >> 48) & 0xff;
  481. wwn[2] = (inm >> 40) & 0xff;
  482. wwn[3] = (inm >> 32) & 0xff;
  483. wwn[4] = (inm >> 24) & 0xff;
  484. wwn[5] = (inm >> 16) & 0xff;
  485. wwn[6] = (inm >> 8) & 0xff;
  486. wwn[7] = inm & 0xff;
  487. }
  488. struct scsi_transport_template *fc_attach_transport(
  489. struct fc_function_template *);
  490. void fc_release_transport(struct scsi_transport_template *);
  491. void fc_remove_host(struct Scsi_Host *);
  492. struct fc_rport *fc_remote_port_add(struct Scsi_Host *shost,
  493. int channel, struct fc_rport_identifiers *ids);
  494. void fc_remote_port_delete(struct fc_rport *rport);
  495. void fc_remote_port_rolechg(struct fc_rport *rport, u32 roles);
  496. int scsi_is_fc_rport(const struct device *);
  497. u32 fc_get_event_number(void);
  498. void fc_host_post_event(struct Scsi_Host *shost, u32 event_number,
  499. enum fc_host_event_code event_code, u32 event_data);
  500. void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
  501. u32 data_len, char * data_buf, u64 vendor_id);
  502. /* Note: when specifying vendor_id to fc_host_post_vendor_event()
  503. * be sure to read the Vendor Type and ID formatting requirements
  504. * specified in scsi_netlink.h
  505. */
  506. #endif /* SCSI_TRANSPORT_FC_H */