vxgehal-mgmtaux.h revision 330897
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright(c) 2002-2011 Exar Corp.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification are permitted provided the following conditions are met:
9 *
10 *    1. Redistributions of source code must retain the above copyright notice,
11 *       this list of conditions and the following disclaimer.
12 *
13 *    2. Redistributions in binary form must reproduce the above copyright
14 *       notice, this list of conditions and the following disclaimer in the
15 *       documentation and/or other materials provided with the distribution.
16 *
17 *    3. Neither the name of the Exar Corporation nor the names of its
18 *       contributors may be used to endorse or promote products derived from
19 *       this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33/*$FreeBSD: stable/11/sys/dev/vxge/include/vxgehal-mgmtaux.h 330897 2018-03-14 03:19:51Z eadler $*/
34
35#ifndef	VXGE_HAL_MGMTAUX_H
36#define	VXGE_HAL_MGMTAUX_H
37
38__EXTERN_BEGIN_DECLS
39
40/*
41 * vxge_hal_aux_about_read - Retrieve and format about info.
42 * @devh: HAL device handle.
43 * @bufsize: Buffer size.
44 * @retbuf: Buffer pointer.
45 * @retsize: Size of the result. Cannot be greater than @bufsize.
46 *
47 * Retrieve about info (using vxge_hal_mgmt_about()) and sprintf it
48 * into the provided @retbuf.
49 *
50 * Returns: VXGE_HAL_OK - success.
51 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
52 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not matching.
53 * VXGE_HAL_FAIL - Failed to retrieve the information.
54 *
55 * See also: vxge_hal_mgmt_about(), vxge_hal_aux_device_dump().
56 */
57vxge_hal_status_e vxge_hal_aux_about_read(vxge_hal_device_h devh, int bufsize,
58    char *retbuf, int *retsize);
59
60/*
61 * vxge_hal_aux_driver_config_read - Read Driver configuration.
62 * @bufsize: Buffer size.
63 * @retbuf: Buffer pointer.
64 * @retsize: Size of the result. Cannot be greater than @bufsize.
65 *
66 * Read driver configuration,
67 *
68 * Returns: VXGE_HAL_OK - success.
69 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not matching.
70 *
71 * See also: vxge_hal_aux_device_config_read().
72 */
73vxge_hal_status_e
74vxge_hal_aux_driver_config_read(int bufsize, char *retbuf, int *retsize);
75
76/*
77 * vxge_hal_aux_pci_config_read - Retrieve and format PCI Configuration
78 * info.
79 * @devh: HAL device handle.
80 * @bufsize: Buffer size.
81 * @retbuf: Buffer pointer.
82 * @retsize: Size of the result. Cannot be greater than @bufsize.
83 *
84 * Retrieve about info (using vxge_hal_mgmt_pci_config()) and sprintf it
85 * into the provided @retbuf.
86 *
87 * Returns: VXGE_HAL_OK - success.
88 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
89 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not matching.
90 *
91 * See also: vxge_hal_mgmt_pci_config(), vxge_hal_aux_device_dump().
92 */
93vxge_hal_status_e
94vxge_hal_aux_pci_config_read(vxge_hal_device_h devh,
95    int bufsize,
96    char *retbuf,
97    int *retsize);
98
99/*
100 * vxge_hal_aux_device_config_read - Read device configuration.
101 * @devh: HAL device handle.
102 * @bufsize: Buffer size.
103 * @retbuf: Buffer pointer.
104 * @retsize: Size of the result. Cannot be greater than @bufsize.
105 *
106 * Read device configuration,
107 *
108 * Returns: VXGE_HAL_OK - success.
109 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
110 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not matching.
111 *
112 * See also: vxge_hal_aux_driver_config_read().
113 */
114vxge_hal_status_e
115vxge_hal_aux_device_config_read(vxge_hal_device_h devh,
116    int bufsize, char *retbuf, int *retsize);
117
118/*
119 * vxge_hal_aux_bar0_read - Read and format X3100 BAR0 register.
120 * @devh: HAL device handle.
121 * @offset: Register offset in the BAR0 space.
122 * @bufsize: Buffer size.
123 * @retbuf: Buffer pointer.
124 * @retsize: Size of the result. Cannot be greater than @bufsize.
125 *
126 * Read X3100 register from BAR0 space. The result is formatted as an
127 * ascii string.
128 *
129 * Returns: VXGE_HAL_OK - success.
130 * VXGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small.
131 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
132 * VXGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not
133 * valid.
134 *
135 * See also: vxge_hal_mgmt_reg_read().
136 */
137vxge_hal_status_e
138vxge_hal_aux_bar0_read(vxge_hal_device_h devh,
139    unsigned int offset, int bufsize, char *retbuf,
140    int *retsize);
141
142/*
143 * vxge_hal_aux_bar1_read - Read and format X3100 BAR1 register.
144 * @devh: HAL device handle.
145 * @offset: Register offset in the BAR1 space.
146 * @bufsize: Buffer size.
147 * @retbuf: Buffer pointer.
148 * @retsize: Size of the result. Cannot be greater than @bufsize.
149 *
150 * Read X3100 register from BAR1 space. The result is formatted as ascii string
151 * Returns: VXGE_HAL_OK - success.
152 * VXGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small.
153 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
154 * VXGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not
155 * valid.
156 *
157 */
158vxge_hal_status_e
159vxge_hal_aux_bar1_read(vxge_hal_device_h devh,
160    unsigned int offset, int bufsize, char *retbuf,
161    int *retsize);
162
163/*
164 * vxge_hal_aux_bar0_write - Write BAR0 register.
165 * @devh: HAL device handle.
166 * @offset: Register offset in the BAR0 space.
167 * @value: Regsister value (to write).
168 *
169 * Write BAR0 register.
170 *
171 * Returns: VXGE_HAL_OK - success.
172 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
173 * VXGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not
174 * valid.
175 *
176 * See also: vxge_hal_mgmt_reg_write().
177 */
178vxge_hal_status_e
179vxge_hal_aux_bar0_write(vxge_hal_device_h devh,
180    unsigned int offset, u64 value);
181
182/*
183 * vxge_hal_aux_stats_vpath_hw_read - Read vpath hardware statistics.
184 * @vpath_handle: HAL Vpath handle.
185 * @bufsize: Buffer size.
186 * @retbuf: Buffer pointer.
187 * @retsize: Size of the result. Cannot be greater than @bufsize.
188 *
189 * Read vpath hardware statistics. This is a subset of stats counters
190 * from vxge_hal_vpath_stats_hw_info_t {}.
191 *
192 */
193vxge_hal_status_e
194vxge_hal_aux_stats_vpath_hw_read(
195    vxge_hal_vpath_h vpath_handle,
196    int bufsize,
197    char *retbuf,
198    int *retsize);
199
200/*
201 * vxge_hal_aux_stats_device_hw_read - Read device hardware statistics.
202 * @devh: HAL device handle.
203 * @bufsize: Buffer size.
204 * @retbuf: Buffer pointer.
205 * @retsize: Size of the result. Cannot be greater than @bufsize.
206 *
207 * Read device hardware statistics. This is a subset of stats counters
208 * from vxge_hal_device_stats_hw_info_t {}.
209 *
210 */
211vxge_hal_status_e
212vxge_hal_aux_stats_device_hw_read(vxge_hal_device_h devh,
213    int bufsize, char *retbuf, int *retsize);
214
215/*
216 * vxge_hal_aux_stats_vpath_sw_fifo_read - Read vpath fifo software statistics.
217 * @vpath_handle: HAL Vpath handle.
218 * @bufsize: Buffer size.
219 * @retbuf: Buffer pointer.
220 * @retsize: Size of the result. Cannot be greater than @bufsize.
221 *
222 * Read vpath fifo software statistics. This is a subset of stats counters
223 * from vxge_hal_vpath_stats_sw_fifo_info_t {}.
224 *
225 */
226vxge_hal_status_e
227vxge_hal_aux_stats_vpath_sw_fifo_read(
228    vxge_hal_vpath_h vpath_handle,
229    int bufsize,
230    char *retbuf,
231    int *retsize);
232
233/*
234 * vxge_hal_aux_stats_vpath_sw_ring_read - Read vpath ring software statistics.
235 * @vpath_handle: HAL Vpath handle.
236 * @bufsize: Buffer size.
237 * @retbuf: Buffer pointer.
238 * @retsize: Size of the result. Cannot be greater than @bufsize.
239 *
240 * Read vpath ring software statistics. This is a subset of stats counters
241 * from vxge_hal_vpath_stats_sw_ring_info_t {}.
242 *
243 */
244vxge_hal_status_e
245vxge_hal_aux_stats_vpath_sw_ring_read(
246    vxge_hal_vpath_h vpath_handle,
247    int bufsize,
248    char *retbuf,
249    int *retsize);
250
251
252/*
253 * vxge_hal_aux_stats_vpath_sw_err_read - Read vpath err software statistics.
254 * @vpath_handle: HAL Vpath handle.
255 * @bufsize: Buffer size.
256 * @retbuf: Buffer pointer.
257 * @retsize: Size of the result. Cannot be greater than @bufsize.
258 *
259 * Read vpath err software statistics. This is a subset of stats counters
260 * from vxge_hal_vpath_stats_sw_err_info_t {}.
261 *
262 */
263vxge_hal_status_e
264vxge_hal_aux_stats_vpath_sw_err_read(
265    vxge_hal_vpath_h vpath_handle,
266    int bufsize,
267    char *retbuf,
268    int *retsize);
269
270/*
271 * vxge_hal_aux_stats_vpath_sw_read - Read vpath soft statistics.
272 * @vpath_handle: HAL Vpath handle.
273 * @bufsize: Buffer size.
274 * @retbuf: Buffer pointer.
275 * @retsize: Size of the result. Cannot be greater than @bufsize.
276 *
277 * Read device hardware statistics. This is a subset of stats counters
278 * from vxge_hal_vpath_stats_sw_info_t {}.
279 *
280 */
281vxge_hal_status_e
282vxge_hal_aux_stats_vpath_sw_read(
283    vxge_hal_vpath_h vpath_handle,
284    int bufsize,
285    char *retbuf,
286    int *retsize);
287
288/*
289 * vxge_hal_aux_stats_device_sw_read - Read device software statistics.
290 * @devh: HAL device handle.
291 * @bufsize: Buffer size.
292 * @retbuf: Buffer pointer.
293 * @retsize: Size of the result. Cannot be greater than @bufsize.
294 *
295 * Read device software statistics. This is a subset of stats counters
296 * from vxge_hal_device_stats_sw_info_t {}.
297 *
298 */
299vxge_hal_status_e
300vxge_hal_aux_stats_device_sw_read(vxge_hal_device_h devh,
301    int bufsize, char *retbuf, int *retsize);
302
303/*
304 * vxge_hal_aux_stats_device_sw_err_read - Read device software error statistics
305 * @devh: HAL device handle.
306 * @bufsize: Buffer size.
307 * @retbuf: Buffer pointer.
308 * @retsize: Size of the result. Cannot be greater than @bufsize.
309 *
310 * Read device software error statistics. This is a subset of stats counters
311 * from vxge_hal_device_stats_sw_info_t {}.
312 *
313 */
314vxge_hal_status_e
315vxge_hal_aux_stats_device_sw_err_read(vxge_hal_device_h devh,
316    int bufsize, char *retbuf, int *retsize);
317
318/*
319 * vxge_hal_aux_stats_device_read - Read device statistics.
320 * @devh: HAL device handle.
321 * @bufsize: Buffer size.
322 * @retbuf: Buffer pointer.
323 * @retsize: Size of the result. Cannot be greater than @bufsize.
324 *
325 * Read device statistics. This is a subset of stats counters
326 * from vxge_hal_device_stats_t {}.
327 *
328 */
329vxge_hal_status_e
330vxge_hal_aux_stats_device_read(vxge_hal_device_h devh,
331    int bufsize, char *retbuf, int *retsize);
332
333/*
334 * vxge_hal_aux_stats_xpak_read - Read device xpak statistics.
335 * @devh: HAL device handle.
336 * @bufsize: Buffer size.
337 * @retbuf: Buffer pointer.
338 * @retsize: Size of the result. Cannot be greater than @bufsize.
339 *
340 * Read device xpak statistics. This is valid for function 0 device only
341 *
342 */
343vxge_hal_status_e
344vxge_hal_aux_stats_xpak_read(vxge_hal_device_h devh,
345    int bufsize, char *retbuf, int *retsize);
346
347/*
348 * vxge_hal_aux_stats_mrpcim_read - Read device mrpcim statistics.
349 * @devh: HAL device handle.
350 * @bufsize: Buffer size.
351 * @retbuf: Buffer pointer.
352 * @retsize: Size of the result. Cannot be greater than @bufsize.
353 *
354 * Read mrpcim statistics. This is valid for function 0 device only
355 *
356 */
357vxge_hal_status_e
358vxge_hal_aux_stats_mrpcim_read(vxge_hal_device_h devh,
359    int bufsize, char *retbuf, int *retsize);
360
361/*
362 * vxge_hal_aux_vpath_ring_dump - Dump vpath ring.
363 * @vpath_handle: Vpath handle.
364 *
365 * Dump vpath ring.
366 */
367vxge_hal_status_e
368vxge_hal_aux_vpath_ring_dump(vxge_hal_vpath_h vpath_handle);
369
370/*
371 * vxge_hal_aux_vpath_fifo_dump - Dump vpath fifo.
372 * @vpath_handle: Vpath handle.
373 *
374 * Dump vpath fifo.
375 */
376vxge_hal_status_e
377vxge_hal_aux_vpath_fifo_dump(vxge_hal_vpath_h vpath_handle);
378
379/*
380 * vxge_hal_aux_device_dump - Dump driver "about" info and device state.
381 * @devh: HAL device handle.
382 *
383 * Dump driver & device "about" info and device state,
384 * including all BAR0 registers, hardware and software statistics, PCI
385 * configuration space.
386 */
387vxge_hal_status_e vxge_hal_aux_device_dump(vxge_hal_device_h devh);
388
389__EXTERN_END_DECLS
390
391#endif	/* VXGE_HAL_MGMTAUX_H */
392