n_tty: Reduce branching in canon_copy_from_read_buf()
[linux/fpc-iii.git] / drivers / net / ethernet / qlogic / qed / qed_cxt.h
blobc8e1f5e5c42b9f3e67168bf73ab549905c3443e1
1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
9 #ifndef _QED_CXT_H
10 #define _QED_CXT_H
12 #include <linux/types.h>
13 #include <linux/slab.h>
14 #include <linux/qed/qed_if.h>
15 #include "qed_hsi.h"
16 #include "qed.h"
18 struct qed_cxt_info {
19 void *p_cxt;
20 u32 iid;
21 enum protocol_type type;
24 /**
25 * @brief qed_cxt_acquire - Acquire a new cid of a specific protocol type
27 * @param p_hwfn
28 * @param type
29 * @param p_cid
31 * @return int
33 int qed_cxt_acquire_cid(struct qed_hwfn *p_hwfn,
34 enum protocol_type type,
35 u32 *p_cid);
37 /**
38 * @brief qedo_cid_get_cxt_info - Returns the context info for a specific cid
41 * @param p_hwfn
42 * @param p_info in/out
44 * @return int
46 int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn,
47 struct qed_cxt_info *p_info);
49 enum qed_cxt_elem_type {
50 QED_ELEM_CXT,
51 QED_ELEM_TASK
54 /**
55 * @brief qed_cxt_set_pf_params - Set the PF params for cxt init
57 * @param p_hwfn
59 * @return int
61 int qed_cxt_set_pf_params(struct qed_hwfn *p_hwfn);
63 /**
64 * @brief qed_cxt_cfg_ilt_compute - compute ILT init parameters
66 * @param p_hwfn
68 * @return int
70 int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn);
72 /**
73 * @brief qed_cxt_mngr_alloc - Allocate and init the context manager struct
75 * @param p_hwfn
77 * @return int
79 int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn);
81 /**
82 * @brief qed_cxt_mngr_free
84 * @param p_hwfn
86 void qed_cxt_mngr_free(struct qed_hwfn *p_hwfn);
88 /**
89 * @brief qed_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired map
91 * @param p_hwfn
93 * @return int
95 int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn);
97 /**
98 * @brief qed_cxt_mngr_setup - Reset the acquired CIDs
100 * @param p_hwfn
102 void qed_cxt_mngr_setup(struct qed_hwfn *p_hwfn);
105 * @brief qed_cxt_hw_init_common - Initailze ILT and DQ, common phase, per path.
109 * @param p_hwfn
111 void qed_cxt_hw_init_common(struct qed_hwfn *p_hwfn);
114 * @brief qed_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
118 * @param p_hwfn
120 void qed_cxt_hw_init_pf(struct qed_hwfn *p_hwfn);
123 * @brief qed_qm_init_pf - Initailze the QM PF phase, per path
125 * @param p_hwfn
128 void qed_qm_init_pf(struct qed_hwfn *p_hwfn);
131 * @brief qed_cxt_release - Release a cid
133 * @param p_hwfn
134 * @param cid
136 void qed_cxt_release_cid(struct qed_hwfn *p_hwfn,
137 u32 cid);
139 #endif