1
2
3
4
5
6
7
8
9#ifndef _QED_CXT_H
10#define _QED_CXT_H
11
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"
17
18struct qed_cxt_info {
19 void *p_cxt;
20 u32 iid;
21 enum protocol_type type;
22};
23
24#define MAX_TID_BLOCKS 512
25struct qed_tid_mem {
26 u32 tid_size;
27 u32 num_tids_per_block;
28 u32 waste;
29 u8 *blocks[MAX_TID_BLOCKS];
30};
31
32
33
34
35
36
37
38
39
40
41int qed_cxt_acquire_cid(struct qed_hwfn *p_hwfn,
42 enum protocol_type type,
43 u32 *p_cid);
44
45
46
47
48
49
50
51
52
53
54int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn,
55 struct qed_cxt_info *p_info);
56
57
58
59
60
61
62
63
64
65int qed_cxt_get_tid_mem_info(struct qed_hwfn *p_hwfn,
66 struct qed_tid_mem *p_info);
67
68#define QED_CXT_ISCSI_TID_SEG PROTOCOLID_ISCSI
69#define QED_CXT_ROCE_TID_SEG PROTOCOLID_ROCE
70enum qed_cxt_elem_type {
71 QED_ELEM_CXT,
72 QED_ELEM_SRQ,
73 QED_ELEM_TASK
74};
75
76u32 qed_cxt_get_proto_cid_count(struct qed_hwfn *p_hwfn,
77 enum protocol_type type, u32 *vf_cid);
78
79
80
81
82
83
84
85
86int qed_cxt_set_pf_params(struct qed_hwfn *p_hwfn);
87
88
89
90
91
92
93
94
95int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn);
96
97
98
99
100
101
102
103
104int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn);
105
106
107
108
109
110
111void qed_cxt_mngr_free(struct qed_hwfn *p_hwfn);
112
113
114
115
116
117
118
119
120int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn);
121
122
123
124
125
126
127void qed_cxt_mngr_setup(struct qed_hwfn *p_hwfn);
128
129
130
131
132
133
134
135
136void qed_cxt_hw_init_common(struct qed_hwfn *p_hwfn);
137
138
139
140
141
142
143
144
145void qed_cxt_hw_init_pf(struct qed_hwfn *p_hwfn);
146
147
148
149
150
151
152
153void qed_qm_init_pf(struct qed_hwfn *p_hwfn);
154
155
156
157
158
159
160
161
162
163int qed_qm_reconf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
164
165
166
167
168
169
170
171void qed_cxt_release_cid(struct qed_hwfn *p_hwfn,
172 u32 cid);
173int qed_cxt_dynamic_ilt_alloc(struct qed_hwfn *p_hwfn,
174 enum qed_cxt_elem_type elem_type, u32 iid);
175u32 qed_cxt_get_proto_tid_count(struct qed_hwfn *p_hwfn,
176 enum protocol_type type);
177u32 qed_cxt_get_proto_cid_start(struct qed_hwfn *p_hwfn,
178 enum protocol_type type);
179int qed_cxt_free_proto_ilt(struct qed_hwfn *p_hwfn, enum protocol_type proto);
180
181#define QED_CTX_WORKING_MEM 0
182#define QED_CTX_FL_MEM 1
183#endif
184