^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (c) 2014- QLogic Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * All rights reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * www.qlogic.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * fcbuild.h - FC link service frame building and parsing routines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #ifndef __FCBUILD_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define __FCBUILD_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "bfad_drv.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "bfa_fc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include "bfa_defs_fcs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Utility Macros/functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define wwn_is_equal(_wwn1, _wwn2) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) (memcmp(&(_wwn1), &(_wwn2), sizeof(wwn_t)) == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define fc_roundup(_l, _s) (((_l) + ((_s) - 1)) & ~((_s) - 1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * Given the fc response length, this routine will return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * the length of the actual payload bytes following the CT header.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * Assumes the input response length does not include the crc, eof, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) static inline u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) fc_get_ctresp_pyld_len(u32 resp_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) return resp_len - sizeof(struct ct_hdr_s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * Convert bfa speed to rpsc speed value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) static inline enum bfa_port_speed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) fc_rpsc_operspeed_to_bfa_speed(enum fc_rpsc_op_speed speed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) switch (speed) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) case RPSC_OP_SPEED_1G:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) return BFA_PORT_SPEED_1GBPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) case RPSC_OP_SPEED_2G:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) return BFA_PORT_SPEED_2GBPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) case RPSC_OP_SPEED_4G:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) return BFA_PORT_SPEED_4GBPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) case RPSC_OP_SPEED_8G:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) return BFA_PORT_SPEED_8GBPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) case RPSC_OP_SPEED_16G:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) return BFA_PORT_SPEED_16GBPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) case RPSC_OP_SPEED_10G:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) return BFA_PORT_SPEED_10GBPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) return BFA_PORT_SPEED_UNKNOWN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * Convert RPSC speed to bfa speed value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) static inline enum fc_rpsc_op_speed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) fc_bfa_speed_to_rpsc_operspeed(enum bfa_port_speed op_speed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) switch (op_speed) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) case BFA_PORT_SPEED_1GBPS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) return RPSC_OP_SPEED_1G;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) case BFA_PORT_SPEED_2GBPS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) return RPSC_OP_SPEED_2G;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) case BFA_PORT_SPEED_4GBPS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) return RPSC_OP_SPEED_4G;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) case BFA_PORT_SPEED_8GBPS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) return RPSC_OP_SPEED_8G;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) case BFA_PORT_SPEED_16GBPS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) return RPSC_OP_SPEED_16G;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) case BFA_PORT_SPEED_10GBPS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) return RPSC_OP_SPEED_10G;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) return RPSC_OP_SPEED_NOT_EST;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) enum fc_parse_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) FC_PARSE_OK = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) FC_PARSE_FAILURE = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) FC_PARSE_BUSY = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) FC_PARSE_LEN_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) FC_PARSE_ACC_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) FC_PARSE_PWWN_NOT_EQUAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) FC_PARSE_NWWN_NOT_EQUAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) FC_PARSE_RXSZ_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) FC_PARSE_NOT_FCP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) FC_PARSE_OPAFLAG_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) FC_PARSE_RPAFLAG_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) FC_PARSE_OPA_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) FC_PARSE_RPA_INVAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) struct fc_templates_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) struct fchs_s fc_els_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) struct fchs_s fc_bls_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) struct fc_logi_s plogi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) struct fc_rrq_s rrq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) void fcbuild_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) u16 fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) u32 s_id, u16 ox_id, wwn_t port_name, wwn_t node_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) u16 pdu_size, u8 set_npiv, u8 set_auth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) u16 local_bb_credits);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) u16 fc_fdisc_build(struct fchs_s *buf, struct fc_logi_s *flogi, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) u16 ox_id, wwn_t port_name, wwn_t node_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) u16 pdu_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) u16 fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) u32 s_id, __be16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) wwn_t port_name, wwn_t node_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) u16 pdu_size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) u16 local_bb_credits, u8 bb_scn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) u16 fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) u32 s_id, u16 ox_id, wwn_t port_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) wwn_t node_name, u16 pdu_size, u16 bb_cr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) enum fc_parse_status fc_plogi_parse(struct fchs_s *fchs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) u16 fc_abts_build(struct fchs_s *buf, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) u16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) enum fc_parse_status fc_abts_rsp_parse(struct fchs_s *buf, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) u16 fc_rrq_build(struct fchs_s *buf, struct fc_rrq_s *rrq, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) u32 s_id, u16 ox_id, u16 rrq_oxid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) u16 fc_rspnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) u16 ox_id, u8 *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) u16 fc_rsnn_nn_build(struct fchs_s *fchs, void *pld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) wwn_t node_name, u8 *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) u16 fc_rftid_build(struct fchs_s *fchs, void *pld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) u16 ox_id, enum bfa_lport_role role);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) u16 fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) u16 ox_id, u8 *fc4_bitmap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) u32 bitmap_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) u16 fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) u16 ox_id, u8 fc4_type, u8 fc4_ftrs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) u16 fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) u16 ox_id, wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) u16 fc_gpnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) u16 ox_id, u32 port_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) u16 fc_gs_rjt_build(struct fchs_s *fchs, struct ct_hdr_s *cthdr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) u32 d_id, u32 s_id, u16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) u8 reason_code, u8 reason_code_expl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) u16 fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) u8 set_br_reg, u32 s_id, u16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) u16 fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) u32 s_id, u16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) wwn_t port_name, wwn_t node_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) u16 pdu_size, u16 bb_cr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) wwn_t node_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) u32 host_dap, wwn_t node_name, wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) enum fc_parse_status fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) wwn_t port_name, wwn_t node_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) u16 fc_adisc_acc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) u32 d_id, u32 s_id, __be16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) wwn_t port_name, wwn_t node_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) u16 fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) u32 d_id, u32 s_id, __be16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) u8 reason_code, u8 reason_code_expl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) u16 fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) u32 d_id, u32 s_id, __be16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) u16 fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) u32 s_id, u16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) enum fc_parse_status fc_prli_rsp_parse(struct fc_prli_s *prli, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) u16 fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) u32 s_id, __be16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) enum bfa_lport_role role);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) u16 fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) u32 d_id, u32 s_id, u16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) u32 data_format);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) u16 fc_rnid_acc_build(struct fchs_s *fchs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) struct fc_rnid_acc_s *rnid_acc, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) __be16 ox_id, u32 data_format,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) struct fc_rnid_common_id_data_s *common_id_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) struct fc_rnid_general_topology_data_s *gen_topo_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) u16 fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rps2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) u32 d_id, u32 s_id, u32 *pid_list, u16 npids);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) u16 fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) u32 d_id, u32 s_id, u16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) u16 fc_rpsc_acc_build(struct fchs_s *fchs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) struct fc_rpsc_acc_s *rpsc_acc, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) __be16 ox_id, struct fc_rpsc_speed_info_s *oper_speed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) u16 fc_gid_ft_build(struct fchs_s *fchs, void *pld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) u8 fc4_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) u16 fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) u32 port_id, wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) u16 fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) u32 port_id, wwn_t node_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) u16 fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) u32 port_id, u32 cos);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) u16 fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) u32 port_id, u8 port_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) u16 fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) u32 port_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) u16 fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) u32 s_id, u16 ox_id, wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) u16 fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) u32 s_id, __be16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) u16 fc_fdmi_reqhdr_build(struct fchs_s *fchs, void *pyld, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) u16 cmd_code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) u16 fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) u16 fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) void fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) void fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) __be16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) enum fc_parse_status fc_plogi_rsp_parse(struct fchs_s *fchs, int len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) enum fc_parse_status fc_prli_parse(struct fc_prli_s *prli);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) enum fc_parse_status fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) u32 s_id, __be16 ox_id, u16 rx_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) int fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) u16 fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) u16 fc_pdisc_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) u16 ox_id, wwn_t port_name, wwn_t node_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) u16 pdu_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) u16 fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) u16 fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) u16 ox_id, int num_pages);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) u16 ox_id, int num_pages, enum fc_tprlo_type tprlo_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) u32 tpr_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) u16 fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) __be16 ox_id, u32 reason_code, u32 reason_expl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) u16 fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) u32 port_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) u16 fc_ct_rsp_parse(struct ct_hdr_s *cthdr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) u16 fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, u32 s_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) u16 ox_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) #endif