scsi_transport_fc.h 18 KB

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