bfa_fcs.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  1. /*
  2. * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
  3. * Copyright (c) 2014- QLogic Corporation.
  4. * All rights reserved
  5. * www.qlogic.com
  6. *
  7. * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License (GPL) Version 2 as
  11. * published by the Free Software Foundation
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #ifndef __BFA_FCS_H__
  19. #define __BFA_FCS_H__
  20. #include "bfa_cs.h"
  21. #include "bfa_defs.h"
  22. #include "bfa_defs_fcs.h"
  23. #include "bfa_modules.h"
  24. #include "bfa_fc.h"
  25. #define BFA_FCS_OS_STR_LEN 64
  26. /*
  27. * lps_pvt BFA LPS private functions
  28. */
  29. enum bfa_lps_event {
  30. BFA_LPS_SM_LOGIN = 1, /* login request from user */
  31. BFA_LPS_SM_LOGOUT = 2, /* logout request from user */
  32. BFA_LPS_SM_FWRSP = 3, /* f/w response to login/logout */
  33. BFA_LPS_SM_RESUME = 4, /* space present in reqq queue */
  34. BFA_LPS_SM_DELETE = 5, /* lps delete from user */
  35. BFA_LPS_SM_OFFLINE = 6, /* Link is offline */
  36. BFA_LPS_SM_RX_CVL = 7, /* Rx clear virtual link */
  37. BFA_LPS_SM_SET_N2N_PID = 8, /* Set assigned PID for n2n */
  38. };
  39. /*
  40. * !!! Only append to the enums defined here to avoid any versioning
  41. * !!! needed between trace utility and driver version
  42. */
  43. enum {
  44. BFA_TRC_FCS_FCS = 1,
  45. BFA_TRC_FCS_PORT = 2,
  46. BFA_TRC_FCS_RPORT = 3,
  47. BFA_TRC_FCS_FCPIM = 4,
  48. };
  49. struct bfa_fcs_s;
  50. #define __fcs_min_cfg(__fcs) ((__fcs)->min_cfg)
  51. #define BFA_FCS_BRCD_SWITCH_OUI 0x051e
  52. #define N2N_LOCAL_PID 0x010000
  53. #define N2N_REMOTE_PID 0x020000
  54. #define BFA_FCS_RETRY_TIMEOUT 2000
  55. #define BFA_FCS_MAX_NS_RETRIES 5
  56. #define BFA_FCS_PID_IS_WKA(pid) ((bfa_ntoh3b(pid) > 0xFFF000) ? 1 : 0)
  57. #define BFA_FCS_MAX_RPORT_LOGINS 1024
  58. struct bfa_fcs_lport_ns_s {
  59. bfa_sm_t sm; /* state machine */
  60. struct bfa_timer_s timer;
  61. struct bfa_fcs_lport_s *port; /* parent port */
  62. struct bfa_fcxp_s *fcxp;
  63. struct bfa_fcxp_wqe_s fcxp_wqe;
  64. u8 num_rnnid_retries;
  65. u8 num_rsnn_nn_retries;
  66. };
  67. struct bfa_fcs_lport_scn_s {
  68. bfa_sm_t sm; /* state machine */
  69. struct bfa_timer_s timer;
  70. struct bfa_fcs_lport_s *port; /* parent port */
  71. struct bfa_fcxp_s *fcxp;
  72. struct bfa_fcxp_wqe_s fcxp_wqe;
  73. };
  74. struct bfa_fcs_lport_fdmi_s {
  75. bfa_sm_t sm; /* state machine */
  76. struct bfa_timer_s timer;
  77. struct bfa_fcs_lport_ms_s *ms; /* parent ms */
  78. struct bfa_fcxp_s *fcxp;
  79. struct bfa_fcxp_wqe_s fcxp_wqe;
  80. u8 retry_cnt; /* retry count */
  81. u8 rsvd[3];
  82. };
  83. struct bfa_fcs_lport_ms_s {
  84. bfa_sm_t sm; /* state machine */
  85. struct bfa_timer_s timer;
  86. struct bfa_fcs_lport_s *port; /* parent port */
  87. struct bfa_fcxp_s *fcxp;
  88. struct bfa_fcxp_wqe_s fcxp_wqe;
  89. struct bfa_fcs_lport_fdmi_s fdmi; /* FDMI component of MS */
  90. u8 retry_cnt; /* retry count */
  91. u8 rsvd[3];
  92. };
  93. struct bfa_fcs_lport_fab_s {
  94. struct bfa_fcs_lport_ns_s ns; /* NS component of port */
  95. struct bfa_fcs_lport_scn_s scn; /* scn component of port */
  96. struct bfa_fcs_lport_ms_s ms; /* MS component of port */
  97. };
  98. #define MAX_ALPA_COUNT 127
  99. struct bfa_fcs_lport_loop_s {
  100. u8 num_alpa; /* Num of ALPA entries in the map */
  101. u8 alpabm_valid; /* alpa bitmap valid or not (1 or 0) */
  102. u8 alpa_pos_map[MAX_ALPA_COUNT]; /* ALPA Positional Map */
  103. struct bfa_fcs_lport_s *port; /* parent port */
  104. };
  105. struct bfa_fcs_lport_n2n_s {
  106. u32 rsvd;
  107. __be16 reply_oxid; /* ox_id from the req flogi to be
  108. *used in flogi acc */
  109. wwn_t rem_port_wwn; /* Attached port's wwn */
  110. };
  111. union bfa_fcs_lport_topo_u {
  112. struct bfa_fcs_lport_fab_s pfab;
  113. struct bfa_fcs_lport_loop_s ploop;
  114. struct bfa_fcs_lport_n2n_s pn2n;
  115. };
  116. struct bfa_fcs_lport_s {
  117. struct list_head qe; /* used by port/vport */
  118. bfa_sm_t sm; /* state machine */
  119. struct bfa_fcs_fabric_s *fabric; /* parent fabric */
  120. struct bfa_lport_cfg_s port_cfg; /* port configuration */
  121. struct bfa_timer_s link_timer; /* timer for link offline */
  122. u32 pid:24; /* FC address */
  123. u8 lp_tag; /* lport tag */
  124. u16 num_rports; /* Num of r-ports */
  125. struct list_head rport_q; /* queue of discovered r-ports */
  126. struct bfa_fcs_s *fcs; /* FCS instance */
  127. union bfa_fcs_lport_topo_u port_topo; /* fabric/loop/n2n details */
  128. struct bfad_port_s *bfad_port; /* driver peer instance */
  129. struct bfa_fcs_vport_s *vport; /* NULL for base ports */
  130. struct bfa_fcxp_s *fcxp;
  131. struct bfa_fcxp_wqe_s fcxp_wqe;
  132. struct bfa_lport_stats_s stats;
  133. struct bfa_wc_s wc; /* waiting counter for events */
  134. };
  135. #define BFA_FCS_GET_HAL_FROM_PORT(port) (port->fcs->bfa)
  136. #define BFA_FCS_GET_NS_FROM_PORT(port) (&port->port_topo.pfab.ns)
  137. #define BFA_FCS_GET_SCN_FROM_PORT(port) (&port->port_topo.pfab.scn)
  138. #define BFA_FCS_GET_MS_FROM_PORT(port) (&port->port_topo.pfab.ms)
  139. #define BFA_FCS_GET_FDMI_FROM_PORT(port) (&port->port_topo.pfab.ms.fdmi)
  140. #define BFA_FCS_VPORT_IS_INITIATOR_MODE(port) \
  141. (port->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM)
  142. /*
  143. * forward declaration
  144. */
  145. struct bfad_vf_s;
  146. enum bfa_fcs_fabric_type {
  147. BFA_FCS_FABRIC_UNKNOWN = 0,
  148. BFA_FCS_FABRIC_SWITCHED = 1,
  149. BFA_FCS_FABRIC_N2N = 2,
  150. BFA_FCS_FABRIC_LOOP = 3,
  151. };
  152. struct bfa_fcs_fabric_s {
  153. struct list_head qe; /* queue element */
  154. bfa_sm_t sm; /* state machine */
  155. struct bfa_fcs_s *fcs; /* FCS instance */
  156. struct bfa_fcs_lport_s bport; /* base logical port */
  157. enum bfa_fcs_fabric_type fab_type; /* fabric type */
  158. enum bfa_port_type oper_type; /* current link topology */
  159. u8 is_vf; /* is virtual fabric? */
  160. u8 is_npiv; /* is NPIV supported ? */
  161. u8 is_auth; /* is Security/Auth supported ? */
  162. u16 bb_credit; /* BB credit from fabric */
  163. u16 vf_id; /* virtual fabric ID */
  164. u16 num_vports; /* num vports */
  165. u16 rsvd;
  166. struct list_head vport_q; /* queue of virtual ports */
  167. struct list_head vf_q; /* queue of virtual fabrics */
  168. struct bfad_vf_s *vf_drv; /* driver vf structure */
  169. struct bfa_timer_s link_timer; /* Link Failure timer. Vport */
  170. wwn_t fabric_name; /* attached fabric name */
  171. bfa_boolean_t auth_reqd; /* authentication required */
  172. struct bfa_timer_s delay_timer; /* delay timer */
  173. union {
  174. u16 swp_vfid;/* switch port VF id */
  175. } event_arg;
  176. struct bfa_wc_s wc; /* wait counter for delete */
  177. struct bfa_vf_stats_s stats; /* fabric/vf stats */
  178. struct bfa_lps_s *lps; /* lport login services */
  179. u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ];
  180. /* attached fabric's ip addr */
  181. struct bfa_wc_s stop_wc; /* wait counter for stop */
  182. };
  183. #define bfa_fcs_fabric_npiv_capable(__f) ((__f)->is_npiv)
  184. #define bfa_fcs_fabric_is_switched(__f) \
  185. ((__f)->fab_type == BFA_FCS_FABRIC_SWITCHED)
  186. /*
  187. * The design calls for a single implementation of base fabric and vf.
  188. */
  189. #define bfa_fcs_vf_t struct bfa_fcs_fabric_s
  190. struct bfa_vf_event_s {
  191. u32 undefined;
  192. };
  193. struct bfa_fcs_s;
  194. struct bfa_fcs_fabric_s;
  195. /*
  196. * @todo : need to move to a global config file.
  197. * Maximum Rports supported per port (physical/logical).
  198. */
  199. #define BFA_FCS_MAX_RPORTS_SUPP 256 /* @todo : tentative value */
  200. #define bfa_fcs_lport_t struct bfa_fcs_lport_s
  201. /*
  202. * Symbolic Name related defines
  203. * Total bytes 255.
  204. * Physical Port's symbolic name 128 bytes.
  205. * For Vports, Vport's symbolic name is appended to the Physical port's
  206. * Symbolic Name.
  207. *
  208. * Physical Port's symbolic name Format : (Total 128 bytes)
  209. * Adapter Model number/name : 16 bytes
  210. * Driver Version : 10 bytes
  211. * Host Machine Name : 30 bytes
  212. * Host OS Info : 44 bytes
  213. * Host OS PATCH Info : 16 bytes
  214. * ( remaining 12 bytes reserved to be used for separator)
  215. */
  216. #define BFA_FCS_PORT_SYMBNAME_SEPARATOR " | "
  217. #define BFA_FCS_PORT_SYMBNAME_MODEL_SZ 16
  218. #define BFA_FCS_PORT_SYMBNAME_VERSION_SZ 10
  219. #define BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ 30
  220. #define BFA_FCS_PORT_SYMBNAME_OSINFO_SZ 44
  221. #define BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ 16
  222. /*
  223. * Get FC port ID for a logical port.
  224. */
  225. #define bfa_fcs_lport_get_fcid(_lport) ((_lport)->pid)
  226. #define bfa_fcs_lport_get_pwwn(_lport) ((_lport)->port_cfg.pwwn)
  227. #define bfa_fcs_lport_get_nwwn(_lport) ((_lport)->port_cfg.nwwn)
  228. #define bfa_fcs_lport_get_psym_name(_lport) ((_lport)->port_cfg.sym_name)
  229. #define bfa_fcs_lport_get_nsym_name(_lport) ((_lport)->port_cfg.node_sym_name)
  230. #define bfa_fcs_lport_is_initiator(_lport) \
  231. ((_lport)->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM)
  232. #define bfa_fcs_lport_get_nrports(_lport) \
  233. ((_lport) ? (_lport)->num_rports : 0)
  234. static inline struct bfad_port_s *
  235. bfa_fcs_lport_get_drvport(struct bfa_fcs_lport_s *port)
  236. {
  237. return port->bfad_port;
  238. }
  239. #define bfa_fcs_lport_get_opertype(_lport) ((_lport)->fabric->oper_type)
  240. #define bfa_fcs_lport_get_fabric_name(_lport) ((_lport)->fabric->fabric_name)
  241. #define bfa_fcs_lport_get_fabric_ipaddr(_lport) \
  242. ((_lport)->fabric->fabric_ip_addr)
  243. /*
  244. * bfa fcs port public functions
  245. */
  246. bfa_boolean_t bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port);
  247. struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs);
  248. void bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
  249. struct bfa_rport_qualifier_s rport[], int *nrports);
  250. wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn,
  251. int index, int nrports, bfa_boolean_t bwwn);
  252. struct bfa_fcs_lport_s *bfa_fcs_lookup_port(struct bfa_fcs_s *fcs,
  253. u16 vf_id, wwn_t lpwwn);
  254. void bfa_fcs_lport_set_symname(struct bfa_fcs_lport_s *port, char *symname);
  255. void bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port,
  256. struct bfa_lport_info_s *port_info);
  257. void bfa_fcs_lport_get_attr(struct bfa_fcs_lport_s *port,
  258. struct bfa_lport_attr_s *port_attr);
  259. void bfa_fcs_lport_get_stats(struct bfa_fcs_lport_s *fcs_port,
  260. struct bfa_lport_stats_s *port_stats);
  261. void bfa_fcs_lport_clear_stats(struct bfa_fcs_lport_s *fcs_port);
  262. enum bfa_port_speed bfa_fcs_lport_get_rport_max_speed(
  263. struct bfa_fcs_lport_s *port);
  264. /* MS FCS routines */
  265. void bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port);
  266. void bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port);
  267. void bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port);
  268. void bfa_fcs_lport_ms_fabric_rscn(struct bfa_fcs_lport_s *port);
  269. /* FDMI FCS routines */
  270. void bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms);
  271. void bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms);
  272. void bfa_fcs_lport_fdmi_online(struct bfa_fcs_lport_ms_s *ms);
  273. void bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport, struct fchs_s *fchs,
  274. u16 len);
  275. void bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs,
  276. u16 vf_id, struct bfa_fcs_vport_s *vport);
  277. void bfa_fcs_lport_init(struct bfa_fcs_lport_s *lport,
  278. struct bfa_lport_cfg_s *port_cfg);
  279. void bfa_fcs_lport_online(struct bfa_fcs_lport_s *port);
  280. void bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port);
  281. void bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port);
  282. void bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port);
  283. struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid(
  284. struct bfa_fcs_lport_s *port, u32 pid);
  285. struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid(
  286. struct bfa_fcs_lport_s *port, u32 pid);
  287. struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
  288. struct bfa_fcs_lport_s *port, wwn_t pwwn);
  289. struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
  290. struct bfa_fcs_lport_s *port, wwn_t nwwn);
  291. struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_qualifier(
  292. struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 pid);
  293. void bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
  294. struct bfa_fcs_rport_s *rport);
  295. void bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port,
  296. struct bfa_fcs_rport_s *rport);
  297. void bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *vport);
  298. void bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport);
  299. void bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport);
  300. void bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port);
  301. void bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
  302. struct bfa_fcxp_s *fcxp_alloced);
  303. void bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport);
  304. void bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport);
  305. void bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *vport);
  306. void bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
  307. struct fchs_s *rx_frame, u32 len);
  308. void bfa_fcs_lport_lip_scn_online(bfa_fcs_lport_t *port);
  309. struct bfa_fcs_vport_s {
  310. struct list_head qe; /* queue elem */
  311. bfa_sm_t sm; /* state machine */
  312. bfa_fcs_lport_t lport; /* logical port */
  313. struct bfa_timer_s timer;
  314. struct bfad_vport_s *vport_drv; /* Driver private */
  315. struct bfa_vport_stats_s vport_stats; /* vport statistics */
  316. struct bfa_lps_s *lps; /* Lport login service*/
  317. int fdisc_retries;
  318. };
  319. #define bfa_fcs_vport_get_port(vport) \
  320. ((struct bfa_fcs_lport_s *)(&vport->port))
  321. /*
  322. * bfa fcs vport public functions
  323. */
  324. bfa_status_t bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport,
  325. struct bfa_fcs_s *fcs, u16 vf_id,
  326. struct bfa_lport_cfg_s *port_cfg,
  327. struct bfad_vport_s *vport_drv);
  328. bfa_status_t bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport,
  329. struct bfa_fcs_s *fcs, u16 vf_id,
  330. struct bfa_lport_cfg_s *port_cfg,
  331. struct bfad_vport_s *vport_drv);
  332. bfa_boolean_t bfa_fcs_is_pbc_vport(struct bfa_fcs_vport_s *vport);
  333. bfa_status_t bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport);
  334. bfa_status_t bfa_fcs_vport_start(struct bfa_fcs_vport_s *vport);
  335. bfa_status_t bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport);
  336. void bfa_fcs_vport_get_attr(struct bfa_fcs_vport_s *vport,
  337. struct bfa_vport_attr_s *vport_attr);
  338. struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
  339. u16 vf_id, wwn_t vpwwn);
  340. void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
  341. void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
  342. void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
  343. void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
  344. void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
  345. void bfa_fcs_vport_fcs_stop(struct bfa_fcs_vport_s *vport);
  346. void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
  347. #define BFA_FCS_RPORT_DEF_DEL_TIMEOUT 90 /* in secs */
  348. #define BFA_FCS_RPORT_MAX_RETRIES (5)
  349. /*
  350. * forward declarations
  351. */
  352. struct bfad_rport_s;
  353. struct bfa_fcs_itnim_s;
  354. struct bfa_fcs_tin_s;
  355. struct bfa_fcs_iprp_s;
  356. /* Rport Features (RPF) */
  357. struct bfa_fcs_rpf_s {
  358. bfa_sm_t sm; /* state machine */
  359. struct bfa_fcs_rport_s *rport; /* parent rport */
  360. struct bfa_timer_s timer; /* general purpose timer */
  361. struct bfa_fcxp_s *fcxp; /* FCXP needed for discarding */
  362. struct bfa_fcxp_wqe_s fcxp_wqe; /* fcxp wait queue element */
  363. int rpsc_retries; /* max RPSC retry attempts */
  364. enum bfa_port_speed rpsc_speed;
  365. /* Current Speed from RPSC. O if RPSC fails */
  366. enum bfa_port_speed assigned_speed;
  367. /*
  368. * Speed assigned by the user. will be used if RPSC is
  369. * not supported by the rport.
  370. */
  371. };
  372. struct bfa_fcs_rport_s {
  373. struct list_head qe; /* used by port/vport */
  374. struct bfa_fcs_lport_s *port; /* parent FCS port */
  375. struct bfa_fcs_s *fcs; /* fcs instance */
  376. struct bfad_rport_s *rp_drv; /* driver peer instance */
  377. u32 pid; /* port ID of rport */
  378. u32 old_pid; /* PID before rport goes offline */
  379. u16 maxfrsize; /* maximum frame size */
  380. __be16 reply_oxid; /* OX_ID of inbound requests */
  381. enum fc_cos fc_cos; /* FC classes of service supp */
  382. bfa_boolean_t cisc; /* CISC capable device */
  383. bfa_boolean_t prlo; /* processing prlo or LOGO */
  384. bfa_boolean_t plogi_pending; /* Rx Plogi Pending */
  385. wwn_t pwwn; /* port wwn of rport */
  386. wwn_t nwwn; /* node wwn of rport */
  387. struct bfa_rport_symname_s psym_name; /* port symbolic name */
  388. bfa_sm_t sm; /* state machine */
  389. struct bfa_timer_s timer; /* general purpose timer */
  390. struct bfa_fcs_itnim_s *itnim; /* ITN initiator mode role */
  391. struct bfa_fcs_tin_s *tin; /* ITN initiator mode role */
  392. struct bfa_fcs_iprp_s *iprp; /* IP/FC role */
  393. struct bfa_rport_s *bfa_rport; /* BFA Rport */
  394. struct bfa_fcxp_s *fcxp; /* FCXP needed for discarding */
  395. int plogi_retries; /* max plogi retry attempts */
  396. int ns_retries; /* max NS query retry attempts */
  397. struct bfa_fcxp_wqe_s fcxp_wqe; /* fcxp wait queue element */
  398. struct bfa_rport_stats_s stats; /* rport stats */
  399. enum bfa_rport_function scsi_function; /* Initiator/Target */
  400. struct bfa_fcs_rpf_s rpf; /* Rport features module */
  401. bfa_boolean_t scn_online; /* SCN online flag */
  402. };
  403. static inline struct bfa_rport_s *
  404. bfa_fcs_rport_get_halrport(struct bfa_fcs_rport_s *rport)
  405. {
  406. return rport->bfa_rport;
  407. }
  408. /*
  409. * bfa fcs rport API functions
  410. */
  411. void bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
  412. struct bfa_rport_attr_s *attr);
  413. struct bfa_fcs_rport_s *bfa_fcs_rport_lookup(struct bfa_fcs_lport_s *port,
  414. wwn_t rpwwn);
  415. struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn(
  416. struct bfa_fcs_lport_s *port, wwn_t rnwwn);
  417. void bfa_fcs_rport_set_del_timeout(u8 rport_tmo);
  418. void bfa_fcs_rport_set_max_logins(u32 max_logins);
  419. void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport,
  420. struct fchs_s *fchs, u16 len);
  421. void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport);
  422. struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port,
  423. u32 pid);
  424. void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs,
  425. struct fc_logi_s *plogi_rsp);
  426. void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port,
  427. struct fchs_s *rx_fchs,
  428. struct fc_logi_s *plogi);
  429. void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs,
  430. struct fc_logi_s *plogi);
  431. void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id);
  432. void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport);
  433. void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport);
  434. int bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport);
  435. struct bfa_fcs_rport_s *bfa_fcs_rport_create_by_wwn(
  436. struct bfa_fcs_lport_s *port, wwn_t wwn);
  437. void bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport);
  438. void bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport);
  439. void bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
  440. /*
  441. * forward declarations
  442. */
  443. struct bfad_itnim_s;
  444. struct bfa_fcs_itnim_s {
  445. bfa_sm_t sm; /* state machine */
  446. struct bfa_fcs_rport_s *rport; /* parent remote rport */
  447. struct bfad_itnim_s *itnim_drv; /* driver peer instance */
  448. struct bfa_fcs_s *fcs; /* fcs instance */
  449. struct bfa_timer_s timer; /* timer functions */
  450. struct bfa_itnim_s *bfa_itnim; /* BFA itnim struct */
  451. u32 prli_retries; /* max prli retry attempts */
  452. bfa_boolean_t seq_rec; /* seq recovery support */
  453. bfa_boolean_t rec_support; /* REC supported */
  454. bfa_boolean_t conf_comp; /* FCP_CONF support */
  455. bfa_boolean_t task_retry_id; /* task retry id supp */
  456. struct bfa_fcxp_wqe_s fcxp_wqe; /* wait qelem for fcxp */
  457. struct bfa_fcxp_s *fcxp; /* FCXP in use */
  458. struct bfa_itnim_stats_s stats; /* itn statistics */
  459. };
  460. #define bfa_fcs_fcxp_alloc(__fcs, __req) \
  461. bfa_fcxp_req_rsp_alloc(NULL, (__fcs)->bfa, 0, 0, \
  462. NULL, NULL, NULL, NULL, __req)
  463. #define bfa_fcs_fcxp_alloc_wait(__bfa, __wqe, __alloc_cbfn, \
  464. __alloc_cbarg, __req) \
  465. bfa_fcxp_req_rsp_alloc_wait(__bfa, __wqe, __alloc_cbfn, \
  466. __alloc_cbarg, NULL, 0, 0, NULL, NULL, NULL, NULL, __req)
  467. static inline struct bfad_port_s *
  468. bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
  469. {
  470. return itnim->rport->port->bfad_port;
  471. }
  472. static inline struct bfa_fcs_lport_s *
  473. bfa_fcs_itnim_get_port(struct bfa_fcs_itnim_s *itnim)
  474. {
  475. return itnim->rport->port;
  476. }
  477. static inline wwn_t
  478. bfa_fcs_itnim_get_nwwn(struct bfa_fcs_itnim_s *itnim)
  479. {
  480. return itnim->rport->nwwn;
  481. }
  482. static inline wwn_t
  483. bfa_fcs_itnim_get_pwwn(struct bfa_fcs_itnim_s *itnim)
  484. {
  485. return itnim->rport->pwwn;
  486. }
  487. static inline u32
  488. bfa_fcs_itnim_get_fcid(struct bfa_fcs_itnim_s *itnim)
  489. {
  490. return itnim->rport->pid;
  491. }
  492. static inline u32
  493. bfa_fcs_itnim_get_maxfrsize(struct bfa_fcs_itnim_s *itnim)
  494. {
  495. return itnim->rport->maxfrsize;
  496. }
  497. static inline enum fc_cos
  498. bfa_fcs_itnim_get_cos(struct bfa_fcs_itnim_s *itnim)
  499. {
  500. return itnim->rport->fc_cos;
  501. }
  502. static inline struct bfad_itnim_s *
  503. bfa_fcs_itnim_get_drvitn(struct bfa_fcs_itnim_s *itnim)
  504. {
  505. return itnim->itnim_drv;
  506. }
  507. static inline struct bfa_itnim_s *
  508. bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
  509. {
  510. return itnim->bfa_itnim;
  511. }
  512. /*
  513. * bfa fcs FCP Initiator mode API functions
  514. */
  515. void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
  516. struct bfa_itnim_attr_s *attr);
  517. void bfa_fcs_itnim_get_stats(struct bfa_fcs_itnim_s *itnim,
  518. struct bfa_itnim_stats_s *stats);
  519. struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup(struct bfa_fcs_lport_s *port,
  520. wwn_t rpwwn);
  521. bfa_status_t bfa_fcs_itnim_attr_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
  522. struct bfa_itnim_attr_s *attr);
  523. bfa_status_t bfa_fcs_itnim_stats_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
  524. struct bfa_itnim_stats_s *stats);
  525. bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port,
  526. wwn_t rpwwn);
  527. struct bfa_fcs_itnim_s *bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport);
  528. void bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim);
  529. void bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim);
  530. void bfa_fcs_itnim_brp_online(struct bfa_fcs_itnim_s *itnim);
  531. bfa_status_t bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim);
  532. void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim);
  533. void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim,
  534. struct fchs_s *fchs, u16 len);
  535. #define BFA_FCS_FDMI_SUPP_SPEEDS_4G (FDMI_TRANS_SPEED_1G | \
  536. FDMI_TRANS_SPEED_2G | \
  537. FDMI_TRANS_SPEED_4G)
  538. #define BFA_FCS_FDMI_SUPP_SPEEDS_8G (FDMI_TRANS_SPEED_1G | \
  539. FDMI_TRANS_SPEED_2G | \
  540. FDMI_TRANS_SPEED_4G | \
  541. FDMI_TRANS_SPEED_8G)
  542. #define BFA_FCS_FDMI_SUPP_SPEEDS_16G (FDMI_TRANS_SPEED_2G | \
  543. FDMI_TRANS_SPEED_4G | \
  544. FDMI_TRANS_SPEED_8G | \
  545. FDMI_TRANS_SPEED_16G)
  546. #define BFA_FCS_FDMI_SUPP_SPEEDS_10G FDMI_TRANS_SPEED_10G
  547. #define BFA_FCS_FDMI_VENDOR_INFO_LEN 8
  548. #define BFA_FCS_FDMI_FC4_TYPE_LEN 32
  549. /*
  550. * HBA Attribute Block : BFA internal representation. Note : Some variable
  551. * sizes have been trimmed to suit BFA For Ex : Model will be "QLogic ". Based
  552. * on this the size has been reduced to 16 bytes from the standard's 64 bytes.
  553. */
  554. struct bfa_fcs_fdmi_hba_attr_s {
  555. wwn_t node_name;
  556. u8 manufacturer[64];
  557. u8 serial_num[64];
  558. u8 model[16];
  559. u8 model_desc[128];
  560. u8 hw_version[8];
  561. u8 driver_version[BFA_VERSION_LEN];
  562. u8 option_rom_ver[BFA_VERSION_LEN];
  563. u8 fw_version[BFA_VERSION_LEN];
  564. u8 os_name[256];
  565. __be32 max_ct_pyld;
  566. struct bfa_lport_symname_s node_sym_name;
  567. u8 vendor_info[BFA_FCS_FDMI_VENDOR_INFO_LEN];
  568. __be32 num_ports;
  569. wwn_t fabric_name;
  570. u8 bios_ver[BFA_VERSION_LEN];
  571. };
  572. /*
  573. * Port Attribute Block
  574. */
  575. struct bfa_fcs_fdmi_port_attr_s {
  576. u8 supp_fc4_types[BFA_FCS_FDMI_FC4_TYPE_LEN];
  577. __be32 supp_speed; /* supported speed */
  578. __be32 curr_speed; /* current Speed */
  579. __be32 max_frm_size; /* max frame size */
  580. u8 os_device_name[256]; /* OS device Name */
  581. u8 host_name[256]; /* host name */
  582. wwn_t port_name;
  583. wwn_t node_name;
  584. struct bfa_lport_symname_s port_sym_name;
  585. __be32 port_type;
  586. enum fc_cos scos;
  587. wwn_t port_fabric_name;
  588. u8 port_act_fc4_type[BFA_FCS_FDMI_FC4_TYPE_LEN];
  589. __be32 port_state;
  590. __be32 num_ports;
  591. };
  592. struct bfa_fcs_stats_s {
  593. struct {
  594. u32 untagged; /* untagged receive frames */
  595. u32 tagged; /* tagged receive frames */
  596. u32 vfid_unknown; /* VF id is unknown */
  597. } uf;
  598. };
  599. struct bfa_fcs_driver_info_s {
  600. u8 version[BFA_VERSION_LEN]; /* Driver Version */
  601. u8 host_machine_name[BFA_FCS_OS_STR_LEN];
  602. u8 host_os_name[BFA_FCS_OS_STR_LEN]; /* OS name and version */
  603. u8 host_os_patch[BFA_FCS_OS_STR_LEN]; /* patch or service pack */
  604. u8 os_device_name[BFA_FCS_OS_STR_LEN]; /* Driver Device Name */
  605. };
  606. struct bfa_fcs_s {
  607. struct bfa_s *bfa; /* corresponding BFA bfa instance */
  608. struct bfad_s *bfad; /* corresponding BDA driver instance */
  609. struct bfa_trc_mod_s *trcmod; /* tracing module */
  610. bfa_boolean_t vf_enabled; /* VF mode is enabled */
  611. bfa_boolean_t fdmi_enabled; /* FDMI is enabled */
  612. bfa_boolean_t min_cfg; /* min cfg enabled/disabled */
  613. u16 port_vfid; /* port default VF ID */
  614. struct bfa_fcs_driver_info_s driver_info;
  615. struct bfa_fcs_fabric_s fabric; /* base fabric state machine */
  616. struct bfa_fcs_stats_s stats; /* FCS statistics */
  617. struct bfa_wc_s wc; /* waiting counter */
  618. int fcs_aen_seq;
  619. u32 num_rport_logins;
  620. };
  621. /*
  622. * fcs_fabric_sm fabric state machine functions
  623. */
  624. /*
  625. * Fabric state machine events
  626. */
  627. enum bfa_fcs_fabric_event {
  628. BFA_FCS_FABRIC_SM_CREATE = 1, /* create from driver */
  629. BFA_FCS_FABRIC_SM_DELETE = 2, /* delete from driver */
  630. BFA_FCS_FABRIC_SM_LINK_DOWN = 3, /* link down from port */
  631. BFA_FCS_FABRIC_SM_LINK_UP = 4, /* link up from port */
  632. BFA_FCS_FABRIC_SM_CONT_OP = 5, /* flogi/auth continue op */
  633. BFA_FCS_FABRIC_SM_RETRY_OP = 6, /* flogi/auth retry op */
  634. BFA_FCS_FABRIC_SM_NO_FABRIC = 7, /* from flogi/auth */
  635. BFA_FCS_FABRIC_SM_PERF_EVFP = 8, /* from flogi/auth */
  636. BFA_FCS_FABRIC_SM_ISOLATE = 9, /* from EVFP processing */
  637. BFA_FCS_FABRIC_SM_NO_TAGGING = 10, /* no VFT tagging from EVFP */
  638. BFA_FCS_FABRIC_SM_DELAYED = 11, /* timeout delay event */
  639. BFA_FCS_FABRIC_SM_AUTH_FAILED = 12, /* auth failed */
  640. BFA_FCS_FABRIC_SM_AUTH_SUCCESS = 13, /* auth successful */
  641. BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */
  642. BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */
  643. BFA_FCS_FABRIC_SM_START = 16, /* from driver */
  644. BFA_FCS_FABRIC_SM_STOP = 17, /* Stop from driver */
  645. BFA_FCS_FABRIC_SM_STOPCOMP = 18, /* Stop completion */
  646. BFA_FCS_FABRIC_SM_LOGOCOMP = 19, /* FLOGO completion */
  647. };
  648. /*
  649. * fcs_rport_sm FCS rport state machine events
  650. */
  651. enum rport_event {
  652. RPSM_EVENT_PLOGI_SEND = 1, /* new rport; start with PLOGI */
  653. RPSM_EVENT_PLOGI_RCVD = 2, /* Inbound PLOGI from remote port */
  654. RPSM_EVENT_PLOGI_COMP = 3, /* PLOGI completed to rport */
  655. RPSM_EVENT_LOGO_RCVD = 4, /* LOGO from remote device */
  656. RPSM_EVENT_LOGO_IMP = 5, /* implicit logo for SLER */
  657. RPSM_EVENT_FCXP_SENT = 6, /* Frame from has been sent */
  658. RPSM_EVENT_DELETE = 7, /* RPORT delete request */
  659. RPSM_EVENT_FAB_SCN = 8, /* state change notification */
  660. RPSM_EVENT_ACCEPTED = 9, /* Good response from remote device */
  661. RPSM_EVENT_FAILED = 10, /* Request to rport failed. */
  662. RPSM_EVENT_TIMEOUT = 11, /* Rport SM timeout event */
  663. RPSM_EVENT_HCB_ONLINE = 12, /* BFA rport online callback */
  664. RPSM_EVENT_HCB_OFFLINE = 13, /* BFA rport offline callback */
  665. RPSM_EVENT_FC4_OFFLINE = 14, /* FC-4 offline complete */
  666. RPSM_EVENT_ADDRESS_CHANGE = 15, /* Rport's PID has changed */
  667. RPSM_EVENT_ADDRESS_DISC = 16, /* Need to Discover rport's PID */
  668. RPSM_EVENT_PRLO_RCVD = 17, /* PRLO from remote device */
  669. RPSM_EVENT_PLOGI_RETRY = 18, /* Retry PLOGI continuously */
  670. RPSM_EVENT_SCN_OFFLINE = 19, /* loop scn offline */
  671. RPSM_EVENT_SCN_ONLINE = 20, /* loop scn online */
  672. RPSM_EVENT_FC4_FCS_ONLINE = 21, /* FC-4 FCS online complete */
  673. };
  674. /*
  675. * fcs_itnim_sm FCS itnim state machine events
  676. */
  677. enum bfa_fcs_itnim_event {
  678. BFA_FCS_ITNIM_SM_FCS_ONLINE = 1, /* rport online event */
  679. BFA_FCS_ITNIM_SM_OFFLINE = 2, /* rport offline */
  680. BFA_FCS_ITNIM_SM_FRMSENT = 3, /* prli frame is sent */
  681. BFA_FCS_ITNIM_SM_RSP_OK = 4, /* good response */
  682. BFA_FCS_ITNIM_SM_RSP_ERROR = 5, /* error response */
  683. BFA_FCS_ITNIM_SM_TIMEOUT = 6, /* delay timeout */
  684. BFA_FCS_ITNIM_SM_HCB_OFFLINE = 7, /* BFA online callback */
  685. BFA_FCS_ITNIM_SM_HCB_ONLINE = 8, /* BFA offline callback */
  686. BFA_FCS_ITNIM_SM_INITIATOR = 9, /* rport is initiator */
  687. BFA_FCS_ITNIM_SM_DELETE = 10, /* delete event from rport */
  688. BFA_FCS_ITNIM_SM_PRLO = 11, /* delete event from rport */
  689. BFA_FCS_ITNIM_SM_RSP_NOT_SUPP = 12, /* cmd not supported rsp */
  690. BFA_FCS_ITNIM_SM_HAL_ONLINE = 13, /* bfa rport online event */
  691. };
  692. /*
  693. * bfa fcs API functions
  694. */
  695. void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa,
  696. struct bfad_s *bfad,
  697. bfa_boolean_t min_cfg);
  698. void bfa_fcs_init(struct bfa_fcs_s *fcs);
  699. void bfa_fcs_pbc_vport_init(struct bfa_fcs_s *fcs);
  700. void bfa_fcs_update_cfg(struct bfa_fcs_s *fcs);
  701. void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
  702. struct bfa_fcs_driver_info_s *driver_info);
  703. void bfa_fcs_exit(struct bfa_fcs_s *fcs);
  704. void bfa_fcs_stop(struct bfa_fcs_s *fcs);
  705. /*
  706. * bfa fcs vf public functions
  707. */
  708. bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id);
  709. void bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t vpwwn[], int *nports);
  710. /*
  711. * fabric protected interface functions
  712. */
  713. void bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs);
  714. void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
  715. void bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs);
  716. void bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric);
  717. void bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric);
  718. void bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
  719. struct bfa_fcs_vport_s *vport);
  720. void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
  721. struct bfa_fcs_vport_s *vport);
  722. struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup(
  723. struct bfa_fcs_fabric_s *fabric, wwn_t pwwn);
  724. void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs);
  725. void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
  726. struct fchs_s *fchs, u16 len);
  727. void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
  728. void bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
  729. void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
  730. wwn_t fabric_name);
  731. u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
  732. void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
  733. void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
  734. void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
  735. void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
  736. enum bfa_fcs_fabric_event event);
  737. void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
  738. enum bfa_fcs_fabric_event event);
  739. void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric,
  740. enum bfa_fcs_fabric_event event);
  741. /*
  742. * BFA FCS callback interfaces
  743. */
  744. /*
  745. * fcb Main fcs callbacks
  746. */
  747. struct bfad_port_s;
  748. struct bfad_vf_s;
  749. struct bfad_vport_s;
  750. struct bfad_rport_s;
  751. /*
  752. * lport callbacks
  753. */
  754. struct bfad_port_s *bfa_fcb_lport_new(struct bfad_s *bfad,
  755. struct bfa_fcs_lport_s *port,
  756. enum bfa_lport_role roles,
  757. struct bfad_vf_s *vf_drv,
  758. struct bfad_vport_s *vp_drv);
  759. /*
  760. * vport callbacks
  761. */
  762. void bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s);
  763. /*
  764. * rport callbacks
  765. */
  766. bfa_status_t bfa_fcb_rport_alloc(struct bfad_s *bfad,
  767. struct bfa_fcs_rport_s **rport,
  768. struct bfad_rport_s **rport_drv);
  769. /*
  770. * itnim callbacks
  771. */
  772. int bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim,
  773. struct bfad_itnim_s **itnim_drv);
  774. void bfa_fcb_itnim_free(struct bfad_s *bfad,
  775. struct bfad_itnim_s *itnim_drv);
  776. void bfa_fcb_itnim_online(struct bfad_itnim_s *itnim_drv);
  777. void bfa_fcb_itnim_offline(struct bfad_itnim_s *itnim_drv);
  778. #endif /* __BFA_FCS_H__ */