Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
0004  * Copyright (c) 2014- QLogic Corporation.
0005  * All rights reserved
0006  * www.qlogic.com
0007  *
0008  * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
0009  */
0010 
0011 #ifndef __BFA_FCS_H__
0012 #define __BFA_FCS_H__
0013 
0014 #include "bfa_cs.h"
0015 #include "bfa_defs.h"
0016 #include "bfa_defs_fcs.h"
0017 #include "bfa_modules.h"
0018 #include "bfa_fc.h"
0019 
0020 #define BFA_FCS_OS_STR_LEN      64
0021 
0022 /*
0023  *  lps_pvt BFA LPS private functions
0024  */
0025 
0026 enum bfa_lps_event {
0027     BFA_LPS_SM_LOGIN    = 1,    /* login request from user      */
0028     BFA_LPS_SM_LOGOUT   = 2,    /* logout request from user     */
0029     BFA_LPS_SM_FWRSP    = 3,    /* f/w response to login/logout */
0030     BFA_LPS_SM_RESUME   = 4,    /* space present in reqq queue  */
0031     BFA_LPS_SM_DELETE   = 5,    /* lps delete from user         */
0032     BFA_LPS_SM_OFFLINE  = 6,    /* Link is offline              */
0033     BFA_LPS_SM_RX_CVL   = 7,    /* Rx clear virtual link        */
0034     BFA_LPS_SM_SET_N2N_PID  = 8,    /* Set assigned PID for n2n */
0035 };
0036 
0037 
0038 /*
0039  * !!! Only append to the enums defined here to avoid any versioning
0040  * !!! needed between trace utility and driver version
0041  */
0042 enum {
0043     BFA_TRC_FCS_FCS     = 1,
0044     BFA_TRC_FCS_PORT    = 2,
0045     BFA_TRC_FCS_RPORT   = 3,
0046     BFA_TRC_FCS_FCPIM   = 4,
0047 };
0048 
0049 
0050 struct bfa_fcs_s;
0051 
0052 #define __fcs_min_cfg(__fcs)       ((__fcs)->min_cfg)
0053 
0054 #define BFA_FCS_BRCD_SWITCH_OUI  0x051e
0055 #define N2N_LOCAL_PID       0x010000
0056 #define N2N_REMOTE_PID      0x020000
0057 #define BFA_FCS_RETRY_TIMEOUT 2000
0058 #define BFA_FCS_MAX_NS_RETRIES 5
0059 #define BFA_FCS_PID_IS_WKA(pid)  ((bfa_ntoh3b(pid) > 0xFFF000) ?  1 : 0)
0060 #define BFA_FCS_MAX_RPORT_LOGINS 1024
0061 
0062 struct bfa_fcs_lport_ns_s {
0063     bfa_sm_t        sm;     /*  state machine */
0064     struct bfa_timer_s timer;
0065     struct bfa_fcs_lport_s *port;   /*  parent port */
0066     struct bfa_fcxp_s *fcxp;
0067     struct bfa_fcxp_wqe_s fcxp_wqe;
0068     u8  num_rnnid_retries;
0069     u8  num_rsnn_nn_retries;
0070 };
0071 
0072 
0073 struct bfa_fcs_lport_scn_s {
0074     bfa_sm_t        sm;     /*  state machine */
0075     struct bfa_timer_s timer;
0076     struct bfa_fcs_lport_s *port;   /*  parent port */
0077     struct bfa_fcxp_s *fcxp;
0078     struct bfa_fcxp_wqe_s fcxp_wqe;
0079 };
0080 
0081 
0082 struct bfa_fcs_lport_fdmi_s {
0083     bfa_sm_t        sm;     /*  state machine */
0084     struct bfa_timer_s timer;
0085     struct bfa_fcs_lport_ms_s *ms;  /*  parent ms */
0086     struct bfa_fcxp_s *fcxp;
0087     struct bfa_fcxp_wqe_s fcxp_wqe;
0088     u8  retry_cnt;  /*  retry count */
0089     u8  rsvd[3];
0090 };
0091 
0092 
0093 struct bfa_fcs_lport_ms_s {
0094     bfa_sm_t        sm;     /*  state machine */
0095     struct bfa_timer_s timer;
0096     struct bfa_fcs_lport_s *port;   /*  parent port */
0097     struct bfa_fcxp_s *fcxp;
0098     struct bfa_fcxp_wqe_s fcxp_wqe;
0099     struct bfa_fcs_lport_fdmi_s fdmi;   /*  FDMI component of MS */
0100     u8         retry_cnt;   /*  retry count */
0101     u8  rsvd[3];
0102 };
0103 
0104 
0105 struct bfa_fcs_lport_fab_s {
0106     struct bfa_fcs_lport_ns_s ns;   /*  NS component of port */
0107     struct bfa_fcs_lport_scn_s scn; /*  scn component of port */
0108     struct bfa_fcs_lport_ms_s ms;   /*  MS component of port */
0109 };
0110 
0111 #define MAX_ALPA_COUNT  127
0112 
0113 struct bfa_fcs_lport_loop_s {
0114     u8  num_alpa;   /*  Num of ALPA entries in the map */
0115     u8  alpabm_valid;   /* alpa bitmap valid or not (1 or 0) */
0116     u8  alpa_pos_map[MAX_ALPA_COUNT]; /*  ALPA Positional Map */
0117     struct bfa_fcs_lport_s *port;   /*  parent port */
0118 };
0119 
0120 struct bfa_fcs_lport_n2n_s {
0121     u32        rsvd;
0122     __be16     reply_oxid;  /*  ox_id from the req flogi to be
0123                      *used in flogi acc */
0124     wwn_t           rem_port_wwn;   /*  Attached port's wwn */
0125 };
0126 
0127 
0128 union bfa_fcs_lport_topo_u {
0129     struct bfa_fcs_lport_fab_s pfab;
0130     struct bfa_fcs_lport_loop_s ploop;
0131     struct bfa_fcs_lport_n2n_s pn2n;
0132 };
0133 
0134 
0135 struct bfa_fcs_lport_s {
0136     struct list_head         qe;    /*  used by port/vport */
0137     bfa_sm_t               sm;  /*  state machine */
0138     struct bfa_fcs_fabric_s *fabric;    /*  parent fabric */
0139     struct bfa_lport_cfg_s  port_cfg;   /*  port configuration */
0140     struct bfa_timer_s link_timer;  /*  timer for link offline */
0141     u32        pid:24;  /*  FC address */
0142     u8         lp_tag;      /*  lport tag */
0143     u16        num_rports;  /*  Num of r-ports */
0144     struct list_head         rport_q; /*  queue of discovered r-ports */
0145     struct bfa_fcs_s *fcs;  /*  FCS instance */
0146     union bfa_fcs_lport_topo_u port_topo;   /*  fabric/loop/n2n details */
0147     struct bfad_port_s *bfad_port;  /*  driver peer instance */
0148     struct bfa_fcs_vport_s *vport;  /*  NULL for base ports */
0149     struct bfa_fcxp_s *fcxp;
0150     struct bfa_fcxp_wqe_s fcxp_wqe;
0151     struct bfa_lport_stats_s stats;
0152     struct bfa_wc_s        wc;  /*  waiting counter for events */
0153 };
0154 #define BFA_FCS_GET_HAL_FROM_PORT(port)  (port->fcs->bfa)
0155 #define BFA_FCS_GET_NS_FROM_PORT(port)  (&port->port_topo.pfab.ns)
0156 #define BFA_FCS_GET_SCN_FROM_PORT(port)  (&port->port_topo.pfab.scn)
0157 #define BFA_FCS_GET_MS_FROM_PORT(port)  (&port->port_topo.pfab.ms)
0158 #define BFA_FCS_GET_FDMI_FROM_PORT(port)  (&port->port_topo.pfab.ms.fdmi)
0159 #define BFA_FCS_VPORT_IS_INITIATOR_MODE(port) \
0160         (port->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM)
0161 
0162 /*
0163  * forward declaration
0164  */
0165 struct bfad_vf_s;
0166 
0167 enum bfa_fcs_fabric_type {
0168     BFA_FCS_FABRIC_UNKNOWN = 0,
0169     BFA_FCS_FABRIC_SWITCHED = 1,
0170     BFA_FCS_FABRIC_N2N = 2,
0171     BFA_FCS_FABRIC_LOOP = 3,
0172 };
0173 
0174 
0175 struct bfa_fcs_fabric_s {
0176     struct list_head   qe;      /*  queue element */
0177     bfa_sm_t     sm;        /*  state machine */
0178     struct bfa_fcs_s *fcs;      /*  FCS instance */
0179     struct bfa_fcs_lport_s  bport;  /*  base logical port */
0180     enum bfa_fcs_fabric_type fab_type; /*  fabric type */
0181     enum bfa_port_type oper_type;   /*  current link topology */
0182     u8         is_vf;       /*  is virtual fabric? */
0183     u8         is_npiv; /*  is NPIV supported ? */
0184     u8         is_auth; /*  is Security/Auth supported ? */
0185     u16        bb_credit;   /*  BB credit from fabric */
0186     u16        vf_id;       /*  virtual fabric ID */
0187     u16        num_vports;  /*  num vports */
0188     u16        rsvd;
0189     struct list_head         vport_q;   /*  queue of virtual ports */
0190     struct list_head         vf_q;  /*  queue of virtual fabrics */
0191     struct bfad_vf_s      *vf_drv;  /*  driver vf structure */
0192     struct bfa_timer_s link_timer;  /*  Link Failure timer. Vport */
0193     wwn_t           fabric_name;    /*  attached fabric name */
0194     bfa_boolean_t   auth_reqd;  /*  authentication required */
0195     struct bfa_timer_s delay_timer; /*  delay timer     */
0196     union {
0197         u16        swp_vfid;/*  switch port VF id       */
0198     } event_arg;
0199     struct bfa_wc_s        wc;  /*  wait counter for delete */
0200     struct bfa_vf_stats_s   stats;  /*  fabric/vf stats     */
0201     struct bfa_lps_s    *lps;   /*  lport login services    */
0202     u8  fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ];
0203                     /*  attached fabric's ip addr  */
0204     struct bfa_wc_s stop_wc;    /*  wait counter for stop */
0205 };
0206 
0207 #define bfa_fcs_fabric_npiv_capable(__f)    ((__f)->is_npiv)
0208 #define bfa_fcs_fabric_is_switched(__f)         \
0209     ((__f)->fab_type == BFA_FCS_FABRIC_SWITCHED)
0210 
0211 /*
0212  *   The design calls for a single implementation of base fabric and vf.
0213  */
0214 #define bfa_fcs_vf_t struct bfa_fcs_fabric_s
0215 
0216 struct bfa_vf_event_s {
0217     u32        undefined;
0218 };
0219 
0220 /*
0221  * @todo : need to move to a global config file.
0222  * Maximum Rports supported per port (physical/logical).
0223  */
0224 #define BFA_FCS_MAX_RPORTS_SUPP  256    /* @todo : tentative value */
0225 
0226 #define bfa_fcs_lport_t struct bfa_fcs_lport_s
0227 
0228 /*
0229  * Symbolic Name related defines
0230  *  Total bytes 255.
0231  *  Physical Port's symbolic name 128 bytes.
0232  *  For Vports, Vport's symbolic name is appended to the Physical port's
0233  *  Symbolic Name.
0234  *
0235  *  Physical Port's symbolic name Format : (Total 128 bytes)
0236  *  Adapter Model number/name : 16 bytes
0237  *  Driver Version     : 10 bytes
0238  *  Host Machine Name  : 30 bytes
0239  *  Host OS Info       : 44 bytes
0240  *  Host OS PATCH Info : 16 bytes
0241  *  ( remaining 12 bytes reserved to be used for separator)
0242  */
0243 #define BFA_FCS_PORT_SYMBNAME_SEPARATOR         " | "
0244 
0245 #define BFA_FCS_PORT_SYMBNAME_MODEL_SZ          16
0246 #define BFA_FCS_PORT_SYMBNAME_VERSION_SZ        10
0247 #define BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ        30
0248 #define BFA_FCS_PORT_SYMBNAME_OSINFO_SZ         44
0249 #define BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ        16
0250 
0251 /*
0252  * Get FC port ID for a logical port.
0253  */
0254 #define bfa_fcs_lport_get_fcid(_lport)  ((_lport)->pid)
0255 #define bfa_fcs_lport_get_pwwn(_lport)  ((_lport)->port_cfg.pwwn)
0256 #define bfa_fcs_lport_get_nwwn(_lport)  ((_lport)->port_cfg.nwwn)
0257 #define bfa_fcs_lport_get_psym_name(_lport) ((_lport)->port_cfg.sym_name)
0258 #define bfa_fcs_lport_get_nsym_name(_lport) ((_lport)->port_cfg.node_sym_name)
0259 #define bfa_fcs_lport_is_initiator(_lport)          \
0260     ((_lport)->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM)
0261 #define bfa_fcs_lport_get_nrports(_lport)   \
0262     ((_lport) ? (_lport)->num_rports : 0)
0263 
0264 static inline struct bfad_port_s *
0265 bfa_fcs_lport_get_drvport(struct bfa_fcs_lport_s *port)
0266 {
0267     return port->bfad_port;
0268 }
0269 
0270 #define bfa_fcs_lport_get_opertype(_lport)  ((_lport)->fabric->oper_type)
0271 #define bfa_fcs_lport_get_fabric_name(_lport)   ((_lport)->fabric->fabric_name)
0272 #define bfa_fcs_lport_get_fabric_ipaddr(_lport)     \
0273         ((_lport)->fabric->fabric_ip_addr)
0274 
0275 /*
0276  * bfa fcs port public functions
0277  */
0278 
0279 bfa_boolean_t   bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port);
0280 struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs);
0281 void bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
0282             struct bfa_rport_qualifier_s rport[], int *nrports);
0283 wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn,
0284                   int index, int nrports, bfa_boolean_t bwwn);
0285 
0286 struct bfa_fcs_lport_s *bfa_fcs_lookup_port(struct bfa_fcs_s *fcs,
0287                         u16 vf_id, wwn_t lpwwn);
0288 
0289 void bfa_fcs_lport_set_symname(struct bfa_fcs_lport_s *port, char *symname);
0290 void bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port,
0291                 struct bfa_lport_info_s *port_info);
0292 void bfa_fcs_lport_get_attr(struct bfa_fcs_lport_s *port,
0293                 struct bfa_lport_attr_s *port_attr);
0294 void bfa_fcs_lport_get_stats(struct bfa_fcs_lport_s *fcs_port,
0295                  struct bfa_lport_stats_s *port_stats);
0296 void bfa_fcs_lport_clear_stats(struct bfa_fcs_lport_s *fcs_port);
0297 enum bfa_port_speed bfa_fcs_lport_get_rport_max_speed(
0298             struct bfa_fcs_lport_s *port);
0299 
0300 /* MS FCS routines */
0301 void bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port);
0302 void bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port);
0303 void bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port);
0304 void bfa_fcs_lport_ms_fabric_rscn(struct bfa_fcs_lport_s *port);
0305 
0306 /* FDMI FCS routines */
0307 void bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms);
0308 void bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms);
0309 void bfa_fcs_lport_fdmi_online(struct bfa_fcs_lport_ms_s *ms);
0310 void bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport, struct fchs_s *fchs,
0311                      u16 len);
0312 void bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs,
0313             u16 vf_id, struct bfa_fcs_vport_s *vport);
0314 void bfa_fcs_lport_init(struct bfa_fcs_lport_s *lport,
0315                 struct bfa_lport_cfg_s *port_cfg);
0316 void            bfa_fcs_lport_online(struct bfa_fcs_lport_s *port);
0317 void            bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port);
0318 void            bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port);
0319 void        bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port);
0320 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid(
0321         struct bfa_fcs_lport_s *port, u32 pid);
0322 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid(
0323         struct bfa_fcs_lport_s *port, u32 pid);
0324 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
0325         struct bfa_fcs_lport_s *port, wwn_t pwwn);
0326 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
0327         struct bfa_fcs_lport_s *port, wwn_t nwwn);
0328 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_qualifier(
0329         struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 pid);
0330 void            bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
0331                        struct bfa_fcs_rport_s *rport);
0332 void            bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port,
0333                        struct bfa_fcs_rport_s *rport);
0334 void            bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *vport);
0335 void            bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport);
0336 void            bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport);
0337 void            bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port);
0338 void        bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
0339                 struct bfa_fcxp_s *fcxp_alloced);
0340 void            bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport);
0341 void            bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport);
0342 void            bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *vport);
0343 void            bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
0344                           struct fchs_s *rx_frame, u32 len);
0345 void        bfa_fcs_lport_lip_scn_online(bfa_fcs_lport_t *port);
0346 
0347 struct bfa_fcs_vport_s {
0348     struct list_head        qe;     /*  queue elem  */
0349     bfa_sm_t        sm;     /*  state machine   */
0350     bfa_fcs_lport_t     lport;      /*  logical port    */
0351     struct bfa_timer_s  timer;
0352     struct bfad_vport_s *vport_drv; /*  Driver private  */
0353     struct bfa_vport_stats_s vport_stats;   /*  vport statistics    */
0354     struct bfa_lps_s    *lps;       /*  Lport login service*/
0355     int         fdisc_retries;
0356 };
0357 
0358 #define bfa_fcs_vport_get_port(vport)           \
0359     ((struct bfa_fcs_lport_s  *)(&vport->port))
0360 
0361 /*
0362  * bfa fcs vport public functions
0363  */
0364 bfa_status_t bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport,
0365                   struct bfa_fcs_s *fcs, u16 vf_id,
0366                   struct bfa_lport_cfg_s *port_cfg,
0367                   struct bfad_vport_s *vport_drv);
0368 bfa_status_t bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport,
0369                       struct bfa_fcs_s *fcs, u16 vf_id,
0370                       struct bfa_lport_cfg_s *port_cfg,
0371                       struct bfad_vport_s *vport_drv);
0372 bfa_boolean_t bfa_fcs_is_pbc_vport(struct bfa_fcs_vport_s *vport);
0373 bfa_status_t bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport);
0374 bfa_status_t bfa_fcs_vport_start(struct bfa_fcs_vport_s *vport);
0375 bfa_status_t bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport);
0376 void bfa_fcs_vport_get_attr(struct bfa_fcs_vport_s *vport,
0377                 struct bfa_vport_attr_s *vport_attr);
0378 struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
0379                          u16 vf_id, wwn_t vpwwn);
0380 void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
0381 void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
0382 void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
0383 void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
0384 void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
0385 void bfa_fcs_vport_fcs_stop(struct bfa_fcs_vport_s *vport);
0386 void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
0387 
0388 #define BFA_FCS_RPORT_DEF_DEL_TIMEOUT   90  /* in secs */
0389 #define BFA_FCS_RPORT_MAX_RETRIES   (5)
0390 
0391 /*
0392  * forward declarations
0393  */
0394 struct bfad_rport_s;
0395 
0396 struct bfa_fcs_itnim_s;
0397 struct bfa_fcs_tin_s;
0398 struct bfa_fcs_iprp_s;
0399 
0400 /* Rport Features (RPF) */
0401 struct bfa_fcs_rpf_s {
0402     bfa_sm_t    sm; /*  state machine */
0403     struct bfa_fcs_rport_s *rport;  /*  parent rport */
0404     struct bfa_timer_s  timer;  /*  general purpose timer */
0405     struct bfa_fcxp_s   *fcxp;  /*  FCXP needed for discarding */
0406     struct bfa_fcxp_wqe_s   fcxp_wqe; /*  fcxp wait queue element */
0407     int rpsc_retries;   /*  max RPSC retry attempts */
0408     enum bfa_port_speed rpsc_speed;
0409     /*  Current Speed from RPSC. O if RPSC fails */
0410     enum bfa_port_speed assigned_speed;
0411     /*
0412      * Speed assigned by the user.  will be used if RPSC is
0413      * not supported by the rport.
0414      */
0415 };
0416 
0417 struct bfa_fcs_rport_s {
0418     struct list_head    qe; /*  used by port/vport */
0419     struct bfa_fcs_lport_s *port;   /*  parent FCS port */
0420     struct bfa_fcs_s    *fcs;   /*  fcs instance */
0421     struct bfad_rport_s *rp_drv;    /*  driver peer instance */
0422     u32 pid;    /*  port ID of rport */
0423     u32 old_pid;    /* PID before rport goes offline */
0424     u16 maxfrsize;  /*  maximum frame size */
0425     __be16  reply_oxid; /*  OX_ID of inbound requests */
0426     enum fc_cos fc_cos; /*  FC classes of service supp */
0427     bfa_boolean_t   cisc;   /*  CISC capable device */
0428     bfa_boolean_t   prlo;   /*  processing prlo or LOGO */
0429     bfa_boolean_t   plogi_pending;  /* Rx Plogi Pending */
0430     wwn_t   pwwn;   /*  port wwn of rport */
0431     wwn_t   nwwn;   /*  node wwn of rport */
0432     struct bfa_rport_symname_s psym_name; /*  port symbolic name  */
0433     bfa_sm_t    sm;     /*  state machine */
0434     struct bfa_timer_s timer;   /*  general purpose timer */
0435     struct bfa_fcs_itnim_s *itnim;  /*  ITN initiator mode role */
0436     struct bfa_fcs_tin_s *tin;  /*  ITN initiator mode role */
0437     struct bfa_fcs_iprp_s *iprp;    /*  IP/FC role */
0438     struct bfa_rport_s *bfa_rport;  /*  BFA Rport */
0439     struct bfa_fcxp_s *fcxp;    /*  FCXP needed for discarding */
0440     int plogi_retries;  /*  max plogi retry attempts */
0441     int ns_retries; /*  max NS query retry attempts */
0442     struct bfa_fcxp_wqe_s   fcxp_wqe; /*  fcxp wait queue element */
0443     struct bfa_rport_stats_s stats; /*  rport stats */
0444     enum bfa_rport_function scsi_function;  /*  Initiator/Target */
0445     struct bfa_fcs_rpf_s rpf;   /* Rport features module */
0446     bfa_boolean_t   scn_online; /* SCN online flag */
0447 };
0448 
0449 static inline struct bfa_rport_s *
0450 bfa_fcs_rport_get_halrport(struct bfa_fcs_rport_s *rport)
0451 {
0452     return rport->bfa_rport;
0453 }
0454 
0455 /*
0456  * bfa fcs rport API functions
0457  */
0458 void bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
0459             struct bfa_rport_attr_s *attr);
0460 struct bfa_fcs_rport_s *bfa_fcs_rport_lookup(struct bfa_fcs_lport_s *port,
0461                          wwn_t rpwwn);
0462 struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn(
0463     struct bfa_fcs_lport_s *port, wwn_t rnwwn);
0464 void bfa_fcs_rport_set_del_timeout(u8 rport_tmo);
0465 void bfa_fcs_rport_set_max_logins(u32 max_logins);
0466 void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport,
0467      struct fchs_s *fchs, u16 len);
0468 void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport);
0469 
0470 struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port,
0471      u32 pid);
0472 void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs,
0473              struct fc_logi_s *plogi_rsp);
0474 void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port,
0475                 struct fchs_s *rx_fchs,
0476                 struct fc_logi_s *plogi);
0477 void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs,
0478              struct fc_logi_s *plogi);
0479 void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id);
0480 
0481 void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport);
0482 void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport);
0483 int  bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport);
0484 struct bfa_fcs_rport_s *bfa_fcs_rport_create_by_wwn(
0485             struct bfa_fcs_lport_s *port, wwn_t wwn);
0486 void  bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport);
0487 void  bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport);
0488 void  bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
0489 
0490 /*
0491  * forward declarations
0492  */
0493 struct bfad_itnim_s;
0494 
0495 struct bfa_fcs_itnim_s {
0496     bfa_sm_t        sm;     /*  state machine */
0497     struct bfa_fcs_rport_s  *rport;     /*  parent remote rport  */
0498     struct bfad_itnim_s *itnim_drv; /*  driver peer instance */
0499     struct bfa_fcs_s    *fcs;       /*  fcs instance    */
0500     struct bfa_timer_s  timer;      /*  timer functions */
0501     struct bfa_itnim_s  *bfa_itnim; /*  BFA itnim struct    */
0502     u32     prli_retries;   /*  max prli retry attempts */
0503     bfa_boolean_t       seq_rec;    /*  seq recovery support */
0504     bfa_boolean_t       rec_support;    /*  REC supported   */
0505     bfa_boolean_t       conf_comp;  /*  FCP_CONF    support */
0506     bfa_boolean_t       task_retry_id;  /*  task retry id supp  */
0507     struct bfa_fcxp_wqe_s   fcxp_wqe;   /*  wait qelem for fcxp  */
0508     struct bfa_fcxp_s   *fcxp;      /*  FCXP in use */
0509     struct bfa_itnim_stats_s    stats;  /*  itn statistics  */
0510 };
0511 #define bfa_fcs_fcxp_alloc(__fcs, __req)                \
0512     bfa_fcxp_req_rsp_alloc(NULL, (__fcs)->bfa, 0, 0,        \
0513                    NULL, NULL, NULL, NULL, __req)
0514 #define bfa_fcs_fcxp_alloc_wait(__bfa, __wqe, __alloc_cbfn,     \
0515                 __alloc_cbarg, __req)           \
0516     bfa_fcxp_req_rsp_alloc_wait(__bfa, __wqe, __alloc_cbfn,     \
0517         __alloc_cbarg, NULL, 0, 0, NULL, NULL, NULL, NULL, __req)
0518 
0519 static inline struct bfad_port_s *
0520 bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
0521 {
0522     return itnim->rport->port->bfad_port;
0523 }
0524 
0525 
0526 static inline struct bfa_fcs_lport_s *
0527 bfa_fcs_itnim_get_port(struct bfa_fcs_itnim_s *itnim)
0528 {
0529     return itnim->rport->port;
0530 }
0531 
0532 
0533 static inline wwn_t
0534 bfa_fcs_itnim_get_nwwn(struct bfa_fcs_itnim_s *itnim)
0535 {
0536     return itnim->rport->nwwn;
0537 }
0538 
0539 
0540 static inline wwn_t
0541 bfa_fcs_itnim_get_pwwn(struct bfa_fcs_itnim_s *itnim)
0542 {
0543     return itnim->rport->pwwn;
0544 }
0545 
0546 
0547 static inline u32
0548 bfa_fcs_itnim_get_fcid(struct bfa_fcs_itnim_s *itnim)
0549 {
0550     return itnim->rport->pid;
0551 }
0552 
0553 
0554 static inline   u32
0555 bfa_fcs_itnim_get_maxfrsize(struct bfa_fcs_itnim_s *itnim)
0556 {
0557     return itnim->rport->maxfrsize;
0558 }
0559 
0560 
0561 static inline   enum fc_cos
0562 bfa_fcs_itnim_get_cos(struct bfa_fcs_itnim_s *itnim)
0563 {
0564     return itnim->rport->fc_cos;
0565 }
0566 
0567 
0568 static inline struct bfad_itnim_s *
0569 bfa_fcs_itnim_get_drvitn(struct bfa_fcs_itnim_s *itnim)
0570 {
0571     return itnim->itnim_drv;
0572 }
0573 
0574 
0575 static inline struct bfa_itnim_s *
0576 bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
0577 {
0578     return itnim->bfa_itnim;
0579 }
0580 
0581 /*
0582  * bfa fcs FCP Initiator mode API functions
0583  */
0584 void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
0585                 struct bfa_itnim_attr_s *attr);
0586 void bfa_fcs_itnim_get_stats(struct bfa_fcs_itnim_s *itnim,
0587                  struct bfa_itnim_stats_s *stats);
0588 struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup(struct bfa_fcs_lport_s *port,
0589                          wwn_t rpwwn);
0590 bfa_status_t bfa_fcs_itnim_attr_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
0591                     struct bfa_itnim_attr_s *attr);
0592 bfa_status_t bfa_fcs_itnim_stats_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
0593                      struct bfa_itnim_stats_s *stats);
0594 bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port,
0595                        wwn_t rpwwn);
0596 struct bfa_fcs_itnim_s *bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport);
0597 void bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim);
0598 void bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim);
0599 void bfa_fcs_itnim_brp_online(struct bfa_fcs_itnim_s *itnim);
0600 bfa_status_t bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim);
0601 void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim);
0602 void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim,
0603             struct fchs_s *fchs, u16 len);
0604 
0605 #define BFA_FCS_FDMI_SUPP_SPEEDS_4G (FDMI_TRANS_SPEED_1G  | \
0606                 FDMI_TRANS_SPEED_2G |       \
0607                 FDMI_TRANS_SPEED_4G)
0608 
0609 #define BFA_FCS_FDMI_SUPP_SPEEDS_8G (FDMI_TRANS_SPEED_1G  | \
0610                 FDMI_TRANS_SPEED_2G |       \
0611                 FDMI_TRANS_SPEED_4G |       \
0612                 FDMI_TRANS_SPEED_8G)
0613 
0614 #define BFA_FCS_FDMI_SUPP_SPEEDS_16G    (FDMI_TRANS_SPEED_2G  | \
0615                 FDMI_TRANS_SPEED_4G |       \
0616                 FDMI_TRANS_SPEED_8G |       \
0617                 FDMI_TRANS_SPEED_16G)
0618 
0619 #define BFA_FCS_FDMI_SUPP_SPEEDS_10G    FDMI_TRANS_SPEED_10G
0620 
0621 #define BFA_FCS_FDMI_VENDOR_INFO_LEN    8
0622 #define BFA_FCS_FDMI_FC4_TYPE_LEN       32
0623 
0624 /*
0625  * HBA Attribute Block : BFA internal representation. Note : Some variable
0626  * sizes have been trimmed to suit BFA For Ex : Model will be "QLogic ". Based
0627  * on this the size has been reduced to 16 bytes from the standard's 64 bytes.
0628  */
0629 struct bfa_fcs_fdmi_hba_attr_s {
0630     wwn_t           node_name;
0631     u8         manufacturer[64];
0632     u8         serial_num[64];
0633     u8         model[16];
0634     u8         model_desc[128];
0635     u8         hw_version[8];
0636     u8         driver_version[BFA_VERSION_LEN];
0637     u8         option_rom_ver[BFA_VERSION_LEN];
0638     u8         fw_version[BFA_VERSION_LEN];
0639     u8         os_name[256];
0640     __be32        max_ct_pyld;
0641     struct      bfa_lport_symname_s node_sym_name;
0642     u8     vendor_info[BFA_FCS_FDMI_VENDOR_INFO_LEN];
0643     __be32    num_ports;
0644     wwn_t       fabric_name;
0645     u8     bios_ver[BFA_VERSION_LEN];
0646 };
0647 
0648 /*
0649  * Port Attribute Block
0650  */
0651 struct bfa_fcs_fdmi_port_attr_s {
0652     u8         supp_fc4_types[BFA_FCS_FDMI_FC4_TYPE_LEN];
0653     __be32        supp_speed;   /* supported speed */
0654     __be32        curr_speed;   /* current Speed */
0655     __be32        max_frm_size; /* max frame size */
0656     u8         os_device_name[256]; /* OS device Name */
0657     u8         host_name[256];  /* host name */
0658     wwn_t       port_name;
0659     wwn_t       node_name;
0660     struct      bfa_lport_symname_s port_sym_name;
0661     __be32    port_type;
0662     enum fc_cos    scos;
0663     wwn_t       port_fabric_name;
0664     u8     port_act_fc4_type[BFA_FCS_FDMI_FC4_TYPE_LEN];
0665     __be32    port_state;
0666     __be32    num_ports;
0667 };
0668 
0669 struct bfa_fcs_stats_s {
0670     struct {
0671         u32 untagged; /*  untagged receive frames */
0672         u32 tagged; /*  tagged receive frames */
0673         u32 vfid_unknown;   /*  VF id is unknown */
0674     } uf;
0675 };
0676 
0677 struct bfa_fcs_driver_info_s {
0678     u8   version[BFA_VERSION_LEN];      /* Driver Version */
0679     u8   host_machine_name[BFA_FCS_OS_STR_LEN];
0680     u8   host_os_name[BFA_FCS_OS_STR_LEN]; /* OS name and version */
0681     u8   host_os_patch[BFA_FCS_OS_STR_LEN]; /* patch or service pack */
0682     u8   os_device_name[BFA_FCS_OS_STR_LEN]; /* Driver Device Name */
0683 };
0684 
0685 struct bfa_fcs_s {
0686     struct bfa_s      *bfa; /*  corresponding BFA bfa instance */
0687     struct bfad_s         *bfad; /*  corresponding BDA driver instance */
0688     struct bfa_trc_mod_s  *trcmod;  /*  tracing module */
0689     bfa_boolean_t   vf_enabled; /*  VF mode is enabled */
0690     bfa_boolean_t   fdmi_enabled;   /*  FDMI is enabled */
0691     bfa_boolean_t min_cfg;      /* min cfg enabled/disabled */
0692     u16 port_vfid;  /*  port default VF ID */
0693     struct bfa_fcs_driver_info_s driver_info;
0694     struct bfa_fcs_fabric_s fabric; /*  base fabric state machine */
0695     struct bfa_fcs_stats_s  stats;  /*  FCS statistics */
0696     struct bfa_wc_s     wc; /*  waiting counter */
0697     int         fcs_aen_seq;
0698     u32     num_rport_logins;
0699 };
0700 
0701 /*
0702  *  fcs_fabric_sm fabric state machine functions
0703  */
0704 
0705 /*
0706  * Fabric state machine events
0707  */
0708 enum bfa_fcs_fabric_event {
0709     BFA_FCS_FABRIC_SM_CREATE        = 1,    /*  create from driver        */
0710     BFA_FCS_FABRIC_SM_DELETE        = 2,    /*  delete from driver        */
0711     BFA_FCS_FABRIC_SM_LINK_DOWN     = 3,    /*  link down from port      */
0712     BFA_FCS_FABRIC_SM_LINK_UP       = 4,    /*  link up from port         */
0713     BFA_FCS_FABRIC_SM_CONT_OP       = 5,    /*  flogi/auth continue op   */
0714     BFA_FCS_FABRIC_SM_RETRY_OP      = 6,    /*  flogi/auth retry op      */
0715     BFA_FCS_FABRIC_SM_NO_FABRIC     = 7,    /*  from flogi/auth           */
0716     BFA_FCS_FABRIC_SM_PERF_EVFP     = 8,    /*  from flogi/auth           */
0717     BFA_FCS_FABRIC_SM_ISOLATE       = 9,    /*  from EVFP processing     */
0718     BFA_FCS_FABRIC_SM_NO_TAGGING    = 10,   /*  no VFT tagging from EVFP */
0719     BFA_FCS_FABRIC_SM_DELAYED       = 11,   /*  timeout delay event      */
0720     BFA_FCS_FABRIC_SM_AUTH_FAILED   = 12,   /*  auth failed       */
0721     BFA_FCS_FABRIC_SM_AUTH_SUCCESS  = 13,   /*  auth successful           */
0722     BFA_FCS_FABRIC_SM_DELCOMP       = 14,   /*  all vports deleted event */
0723     BFA_FCS_FABRIC_SM_LOOPBACK      = 15,   /*  Received our own FLOGI   */
0724     BFA_FCS_FABRIC_SM_START         = 16,   /*  from driver       */
0725     BFA_FCS_FABRIC_SM_STOP      = 17,   /*  Stop from driver    */
0726     BFA_FCS_FABRIC_SM_STOPCOMP  = 18,   /*  Stop completion */
0727     BFA_FCS_FABRIC_SM_LOGOCOMP  = 19,   /*  FLOGO completion    */
0728 };
0729 
0730 /*
0731  *  fcs_rport_sm FCS rport state machine events
0732  */
0733 
0734 enum rport_event {
0735     RPSM_EVENT_PLOGI_SEND   = 1,    /*  new rport; start with PLOGI */
0736     RPSM_EVENT_PLOGI_RCVD   = 2,    /*  Inbound PLOGI from remote port */
0737     RPSM_EVENT_PLOGI_COMP   = 3,    /*  PLOGI completed to rport    */
0738     RPSM_EVENT_LOGO_RCVD    = 4,    /*  LOGO from remote device     */
0739     RPSM_EVENT_LOGO_IMP     = 5,    /*  implicit logo for SLER      */
0740     RPSM_EVENT_FCXP_SENT    = 6,    /*  Frame from has been sent    */
0741     RPSM_EVENT_DELETE       = 7,    /*  RPORT delete request        */
0742     RPSM_EVENT_FAB_SCN  = 8,    /*  state change notification   */
0743     RPSM_EVENT_ACCEPTED     = 9,    /*  Good response from remote device */
0744     RPSM_EVENT_FAILED       = 10,   /*  Request to rport failed.    */
0745     RPSM_EVENT_TIMEOUT      = 11,   /*  Rport SM timeout event      */
0746     RPSM_EVENT_HCB_ONLINE  = 12,    /*  BFA rport online callback   */
0747     RPSM_EVENT_HCB_OFFLINE = 13,    /*  BFA rport offline callback  */
0748     RPSM_EVENT_FC4_OFFLINE = 14,    /*  FC-4 offline complete       */
0749     RPSM_EVENT_ADDRESS_CHANGE = 15, /*  Rport's PID has changed     */
0750     RPSM_EVENT_ADDRESS_DISC = 16,   /*  Need to Discover rport's PID */
0751     RPSM_EVENT_PRLO_RCVD   = 17,    /*  PRLO from remote device     */
0752     RPSM_EVENT_PLOGI_RETRY = 18,    /*  Retry PLOGI continuously */
0753     RPSM_EVENT_SCN_OFFLINE = 19,    /* loop scn offline     */
0754     RPSM_EVENT_SCN_ONLINE   = 20,   /* loop scn online      */
0755     RPSM_EVENT_FC4_FCS_ONLINE = 21, /* FC-4 FCS online complete */
0756 };
0757 
0758 /*
0759  * fcs_itnim_sm FCS itnim state machine events
0760  */
0761 enum bfa_fcs_itnim_event {
0762     BFA_FCS_ITNIM_SM_FCS_ONLINE = 1,        /*  rport online event */
0763     BFA_FCS_ITNIM_SM_OFFLINE = 2,   /*  rport offline */
0764     BFA_FCS_ITNIM_SM_FRMSENT = 3,   /*  prli frame is sent */
0765     BFA_FCS_ITNIM_SM_RSP_OK = 4,    /*  good response */
0766     BFA_FCS_ITNIM_SM_RSP_ERROR = 5, /*  error response */
0767     BFA_FCS_ITNIM_SM_TIMEOUT = 6,   /*  delay timeout */
0768     BFA_FCS_ITNIM_SM_HCB_OFFLINE = 7, /*  BFA online callback */
0769     BFA_FCS_ITNIM_SM_HCB_ONLINE = 8, /*  BFA offline callback */
0770     BFA_FCS_ITNIM_SM_INITIATOR = 9, /*  rport is initiator */
0771     BFA_FCS_ITNIM_SM_DELETE = 10,   /*  delete event from rport */
0772     BFA_FCS_ITNIM_SM_PRLO = 11,     /*  delete event from rport */
0773     BFA_FCS_ITNIM_SM_RSP_NOT_SUPP = 12, /* cmd not supported rsp */
0774     BFA_FCS_ITNIM_SM_HAL_ONLINE = 13, /* bfa rport online event */
0775 };
0776 
0777 /*
0778  * bfa fcs API functions
0779  */
0780 void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa,
0781             struct bfad_s *bfad,
0782             bfa_boolean_t min_cfg);
0783 void bfa_fcs_init(struct bfa_fcs_s *fcs);
0784 void bfa_fcs_pbc_vport_init(struct bfa_fcs_s *fcs);
0785 void bfa_fcs_update_cfg(struct bfa_fcs_s *fcs);
0786 void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
0787                   struct bfa_fcs_driver_info_s *driver_info);
0788 void bfa_fcs_exit(struct bfa_fcs_s *fcs);
0789 void bfa_fcs_stop(struct bfa_fcs_s *fcs);
0790 
0791 /*
0792  * bfa fcs vf public functions
0793  */
0794 bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id);
0795 void bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t vpwwn[], int *nports);
0796 
0797 /*
0798  * fabric protected interface functions
0799  */
0800 void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
0801 void bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric);
0802 void bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric);
0803 void bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
0804     struct bfa_fcs_vport_s *vport);
0805 void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
0806     struct bfa_fcs_vport_s *vport);
0807 struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup(
0808         struct bfa_fcs_fabric_s *fabric, wwn_t pwwn);
0809 void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs);
0810 void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
0811         struct fchs_s *fchs, u16 len);
0812 void    bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
0813 void    bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
0814 void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
0815            wwn_t fabric_name);
0816 u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
0817 void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
0818 void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
0819             enum bfa_fcs_fabric_event event);
0820 void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
0821             enum bfa_fcs_fabric_event event);
0822 void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric,
0823             enum bfa_fcs_fabric_event event);
0824 
0825 /*
0826  * BFA FCS callback interfaces
0827  */
0828 
0829 /*
0830  * fcb Main fcs callbacks
0831  */
0832 
0833 struct bfad_port_s;
0834 struct bfad_vf_s;
0835 struct bfad_vport_s;
0836 struct bfad_rport_s;
0837 
0838 /*
0839  * lport callbacks
0840  */
0841 struct bfad_port_s *bfa_fcb_lport_new(struct bfad_s *bfad,
0842                       struct bfa_fcs_lport_s *port,
0843                       enum bfa_lport_role roles,
0844                       struct bfad_vf_s *vf_drv,
0845                       struct bfad_vport_s *vp_drv);
0846 
0847 /*
0848  * vport callbacks
0849  */
0850 void bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s);
0851 
0852 /*
0853  * rport callbacks
0854  */
0855 bfa_status_t bfa_fcb_rport_alloc(struct bfad_s *bfad,
0856                  struct bfa_fcs_rport_s **rport,
0857                  struct bfad_rport_s **rport_drv);
0858 
0859 /*
0860  * itnim callbacks
0861  */
0862 int bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim,
0863             struct bfad_itnim_s **itnim_drv);
0864 void bfa_fcb_itnim_free(struct bfad_s *bfad,
0865             struct bfad_itnim_s *itnim_drv);
0866 void bfa_fcb_itnim_online(struct bfad_itnim_s *itnim_drv);
0867 void bfa_fcb_itnim_offline(struct bfad_itnim_s *itnim_drv);
0868 
0869 #endif /* __BFA_FCS_H__ */