Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) 2021 Broadcom. All Rights Reserved. The term
0004  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
0005  */
0006 
0007 #ifndef __EFC_ELS_H__
0008 #define __EFC_ELS_H__
0009 
0010 #define EFC_STATUS_INVALID  INT_MAX
0011 #define EFC_ELS_IO_POOL_SZ  1024
0012 
0013 struct efc_els_io_req {
0014     struct list_head    list_entry;
0015     struct kref     ref;
0016     void            (*release)(struct kref *arg);
0017     struct efc_node     *node;
0018     void            *cb;
0019     u32         els_retries_remaining;
0020     bool            els_req_free;
0021     struct timer_list       delay_timer;
0022 
0023     const char      *display_name;
0024 
0025     struct efc_disc_io  io;
0026 };
0027 
0028 typedef int(*efc_hw_srrs_cb_t)(void *arg, u32 length, int status,
0029                    u32 ext_status);
0030 
0031 void _efc_els_io_free(struct kref *arg);
0032 struct efc_els_io_req *
0033 efc_els_io_alloc(struct efc_node *node, u32 reqlen);
0034 struct efc_els_io_req *
0035 efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen);
0036 void efc_els_io_free(struct efc_els_io_req *els);
0037 
0038 /* ELS command send */
0039 typedef void (*els_cb_t)(struct efc_node *node,
0040              struct efc_node_cb *cbdata, void *arg);
0041 int
0042 efc_send_plogi(struct efc_node *node);
0043 int
0044 efc_send_flogi(struct efc_node *node);
0045 int
0046 efc_send_fdisc(struct efc_node *node);
0047 int
0048 efc_send_prli(struct efc_node *node);
0049 int
0050 efc_send_prlo(struct efc_node *node);
0051 int
0052 efc_send_logo(struct efc_node *node);
0053 int
0054 efc_send_adisc(struct efc_node *node);
0055 int
0056 efc_send_pdisc(struct efc_node *node);
0057 int
0058 efc_send_scr(struct efc_node *node);
0059 int
0060 efc_ns_send_rftid(struct efc_node *node);
0061 int
0062 efc_ns_send_rffid(struct efc_node *node);
0063 int
0064 efc_ns_send_gidpt(struct efc_node *node);
0065 void
0066 efc_els_io_cleanup(struct efc_els_io_req *els, int evt, void *arg);
0067 
0068 /* ELS acc send */
0069 int
0070 efc_send_ls_acc(struct efc_node *node, u32 ox_id);
0071 int
0072 efc_send_ls_rjt(struct efc_node *node, u32 ox_id, u32 reason_cod,
0073         u32 reason_code_expl, u32 vendor_unique);
0074 int
0075 efc_send_flogi_p2p_acc(struct efc_node *node, u32 ox_id, u32 s_id);
0076 int
0077 efc_send_flogi_acc(struct efc_node *node, u32 ox_id, u32 is_fport);
0078 int
0079 efc_send_plogi_acc(struct efc_node *node, u32 ox_id);
0080 int
0081 efc_send_prli_acc(struct efc_node *node, u32 ox_id);
0082 int
0083 efc_send_logo_acc(struct efc_node *node, u32 ox_id);
0084 int
0085 efc_send_prlo_acc(struct efc_node *node, u32 ox_id);
0086 int
0087 efc_send_adisc_acc(struct efc_node *node, u32 ox_id);
0088 
0089 int
0090 efc_bls_send_acc_hdr(struct efc *efc, struct efc_node *node,
0091              struct fc_frame_header *hdr);
0092 int
0093 efc_bls_send_rjt_hdr(struct efc_els_io_req *io, struct fc_frame_header *hdr);
0094 
0095 int
0096 efc_els_io_list_empty(struct efc_node *node, struct list_head *list);
0097 
0098 /* CT */
0099 int
0100 efc_send_ct_rsp(struct efc *efc, struct efc_node *node, u16 ox_id,
0101         struct fc_ct_hdr *ct_hdr, u32 cmd_rsp_code, u32 reason_code,
0102         u32 reason_code_explanation);
0103 
0104 int
0105 efc_send_bls_acc(struct efc_node *node, struct fc_frame_header *hdr);
0106 
0107 #endif /* __EFC_ELS_H__ */