2 * Copyright(c) 2002-2011 Exar Corp.
5 * Redistribution and use in source and binary forms, with or without
6 * modification are permitted provided the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the Exar Corporation nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 #ifndef VXGE_HAL_MGMTAUX_H
34 #define VXGE_HAL_MGMTAUX_H
39 * vxge_hal_aux_about_read - Retrieve and format about info.
40 * @devh: HAL device handle.
41 * @bufsize: Buffer size.
42 * @retbuf: Buffer pointer.
43 * @retsize: Size of the result. Cannot be greater than @bufsize.
45 * Retrieve about info (using vxge_hal_mgmt_about()) and sprintf it
46 * into the provided @retbuf.
48 * Returns: VXGE_HAL_OK - success.
49 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
50 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not maching.
51 * VXGE_HAL_FAIL - Failed to retrieve the information.
53 * See also: vxge_hal_mgmt_about(), vxge_hal_aux_device_dump().
55 vxge_hal_status_e vxge_hal_aux_about_read(vxge_hal_device_h devh, int bufsize,
56 char *retbuf, int *retsize);
59 * vxge_hal_aux_driver_config_read - Read Driver configuration.
60 * @bufsize: Buffer size.
61 * @retbuf: Buffer pointer.
62 * @retsize: Size of the result. Cannot be greater than @bufsize.
64 * Read driver configuration,
66 * Returns: VXGE_HAL_OK - success.
67 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not maching.
69 * See also: vxge_hal_aux_device_config_read().
72 vxge_hal_aux_driver_config_read(int bufsize, char *retbuf, int *retsize);
75 * vxge_hal_aux_pci_config_read - Retrieve and format PCI Configuration
77 * @devh: HAL device handle.
78 * @bufsize: Buffer size.
79 * @retbuf: Buffer pointer.
80 * @retsize: Size of the result. Cannot be greater than @bufsize.
82 * Retrieve about info (using vxge_hal_mgmt_pci_config()) and sprintf it
83 * into the provided @retbuf.
85 * Returns: VXGE_HAL_OK - success.
86 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
87 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not maching.
89 * See also: vxge_hal_mgmt_pci_config(), vxge_hal_aux_device_dump().
92 vxge_hal_aux_pci_config_read(vxge_hal_device_h devh,
98 * vxge_hal_aux_device_config_read - Read device configuration.
99 * @devh: HAL device handle.
100 * @bufsize: Buffer size.
101 * @retbuf: Buffer pointer.
102 * @retsize: Size of the result. Cannot be greater than @bufsize.
104 * Read device configuration,
106 * Returns: VXGE_HAL_OK - success.
107 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
108 * VXGE_HAL_ERR_VERSION_CONFLICT - Version it not maching.
110 * See also: vxge_hal_aux_driver_config_read().
113 vxge_hal_aux_device_config_read(vxge_hal_device_h devh,
114 int bufsize, char *retbuf, int *retsize);
117 * vxge_hal_aux_bar0_read - Read and format X3100 BAR0 register.
118 * @devh: HAL device handle.
119 * @offset: Register offset in the BAR0 space.
120 * @bufsize: Buffer size.
121 * @retbuf: Buffer pointer.
122 * @retsize: Size of the result. Cannot be greater than @bufsize.
124 * Read X3100 register from BAR0 space. The result is formatted as an
127 * Returns: VXGE_HAL_OK - success.
128 * VXGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small.
129 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
130 * VXGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not
133 * See also: vxge_hal_mgmt_reg_read().
136 vxge_hal_aux_bar0_read(vxge_hal_device_h devh,
137 unsigned int offset, int bufsize, char *retbuf,
141 * vxge_hal_aux_bar1_read - Read and format X3100 BAR1 register.
142 * @devh: HAL device handle.
143 * @offset: Register offset in the BAR1 space.
144 * @bufsize: Buffer size.
145 * @retbuf: Buffer pointer.
146 * @retsize: Size of the result. Cannot be greater than @bufsize.
148 * Read X3100 register from BAR1 space. The result is formatted as ascii string
149 * Returns: VXGE_HAL_OK - success.
150 * VXGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small.
151 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
152 * VXGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not
157 vxge_hal_aux_bar1_read(vxge_hal_device_h devh,
158 unsigned int offset, int bufsize, char *retbuf,
162 * vxge_hal_aux_bar0_write - Write BAR0 register.
163 * @devh: HAL device handle.
164 * @offset: Register offset in the BAR0 space.
165 * @value: Regsister value (to write).
167 * Write BAR0 register.
169 * Returns: VXGE_HAL_OK - success.
170 * VXGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
171 * VXGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not
174 * See also: vxge_hal_mgmt_reg_write().
177 vxge_hal_aux_bar0_write(vxge_hal_device_h devh,
178 unsigned int offset, u64 value);
181 * vxge_hal_aux_stats_vpath_hw_read - Read vpath hardware statistics.
182 * @vpath_handle: HAL Vpath handle.
183 * @bufsize: Buffer size.
184 * @retbuf: Buffer pointer.
185 * @retsize: Size of the result. Cannot be greater than @bufsize.
187 * Read vpath hardware statistics. This is a subset of stats counters
188 * from vxge_hal_vpath_stats_hw_info_t {}.
192 vxge_hal_aux_stats_vpath_hw_read(
193 vxge_hal_vpath_h vpath_handle,
199 * vxge_hal_aux_stats_device_hw_read - Read device hardware statistics.
200 * @devh: HAL device handle.
201 * @bufsize: Buffer size.
202 * @retbuf: Buffer pointer.
203 * @retsize: Size of the result. Cannot be greater than @bufsize.
205 * Read device hardware statistics. This is a subset of stats counters
206 * from vxge_hal_device_stats_hw_info_t {}.
210 vxge_hal_aux_stats_device_hw_read(vxge_hal_device_h devh,
211 int bufsize, char *retbuf, int *retsize);
214 * vxge_hal_aux_stats_vpath_sw_fifo_read - Read vpath fifo software statistics.
215 * @vpath_handle: HAL Vpath handle.
216 * @bufsize: Buffer size.
217 * @retbuf: Buffer pointer.
218 * @retsize: Size of the result. Cannot be greater than @bufsize.
220 * Read vpath fifo software statistics. This is a subset of stats counters
221 * from vxge_hal_vpath_stats_sw_fifo_info_t {}.
225 vxge_hal_aux_stats_vpath_sw_fifo_read(
226 vxge_hal_vpath_h vpath_handle,
232 * vxge_hal_aux_stats_vpath_sw_ring_read - Read vpath ring software statistics.
233 * @vpath_handle: HAL Vpath handle.
234 * @bufsize: Buffer size.
235 * @retbuf: Buffer pointer.
236 * @retsize: Size of the result. Cannot be greater than @bufsize.
238 * Read vpath ring software statistics. This is a subset of stats counters
239 * from vxge_hal_vpath_stats_sw_ring_info_t {}.
243 vxge_hal_aux_stats_vpath_sw_ring_read(
244 vxge_hal_vpath_h vpath_handle,
251 * vxge_hal_aux_stats_vpath_sw_err_read - Read vpath err software statistics.
252 * @vpath_handle: HAL Vpath handle.
253 * @bufsize: Buffer size.
254 * @retbuf: Buffer pointer.
255 * @retsize: Size of the result. Cannot be greater than @bufsize.
257 * Read vpath err software statistics. This is a subset of stats counters
258 * from vxge_hal_vpath_stats_sw_err_info_t {}.
262 vxge_hal_aux_stats_vpath_sw_err_read(
263 vxge_hal_vpath_h vpath_handle,
269 * vxge_hal_aux_stats_vpath_sw_read - Read vpath soft statistics.
270 * @vpath_handle: HAL Vpath handle.
271 * @bufsize: Buffer size.
272 * @retbuf: Buffer pointer.
273 * @retsize: Size of the result. Cannot be greater than @bufsize.
275 * Read device hardware statistics. This is a subset of stats counters
276 * from vxge_hal_vpath_stats_sw_info_t {}.
280 vxge_hal_aux_stats_vpath_sw_read(
281 vxge_hal_vpath_h vpath_handle,
287 * vxge_hal_aux_stats_device_sw_read - Read device software statistics.
288 * @devh: HAL device handle.
289 * @bufsize: Buffer size.
290 * @retbuf: Buffer pointer.
291 * @retsize: Size of the result. Cannot be greater than @bufsize.
293 * Read device software statistics. This is a subset of stats counters
294 * from vxge_hal_device_stats_sw_info_t {}.
298 vxge_hal_aux_stats_device_sw_read(vxge_hal_device_h devh,
299 int bufsize, char *retbuf, int *retsize);
302 * vxge_hal_aux_stats_device_sw_err_read - Read device software error statistics
303 * @devh: HAL device handle.
304 * @bufsize: Buffer size.
305 * @retbuf: Buffer pointer.
306 * @retsize: Size of the result. Cannot be greater than @bufsize.
308 * Read device software error statistics. This is a subset of stats counters
309 * from vxge_hal_device_stats_sw_info_t {}.
313 vxge_hal_aux_stats_device_sw_err_read(vxge_hal_device_h devh,
314 int bufsize, char *retbuf, int *retsize);
317 * vxge_hal_aux_stats_device_read - Read device statistics.
318 * @devh: HAL device handle.
319 * @bufsize: Buffer size.
320 * @retbuf: Buffer pointer.
321 * @retsize: Size of the result. Cannot be greater than @bufsize.
323 * Read device statistics. This is a subset of stats counters
324 * from vxge_hal_device_stats_t {}.
328 vxge_hal_aux_stats_device_read(vxge_hal_device_h devh,
329 int bufsize, char *retbuf, int *retsize);
332 * vxge_hal_aux_stats_xpak_read - Read device xpak statistics.
333 * @devh: HAL device handle.
334 * @bufsize: Buffer size.
335 * @retbuf: Buffer pointer.
336 * @retsize: Size of the result. Cannot be greater than @bufsize.
338 * Read device xpak statistics. This is valid for function 0 device only
342 vxge_hal_aux_stats_xpak_read(vxge_hal_device_h devh,
343 int bufsize, char *retbuf, int *retsize);
346 * vxge_hal_aux_stats_mrpcim_read - Read device mrpcim statistics.
347 * @devh: HAL device handle.
348 * @bufsize: Buffer size.
349 * @retbuf: Buffer pointer.
350 * @retsize: Size of the result. Cannot be greater than @bufsize.
352 * Read mrpcim statistics. This is valid for function 0 device only
356 vxge_hal_aux_stats_mrpcim_read(vxge_hal_device_h devh,
357 int bufsize, char *retbuf, int *retsize);
360 * vxge_hal_aux_vpath_ring_dump - Dump vpath ring.
361 * @vpath_handle: Vpath handle.
366 vxge_hal_aux_vpath_ring_dump(vxge_hal_vpath_h vpath_handle);
369 * vxge_hal_aux_vpath_fifo_dump - Dump vpath fifo.
370 * @vpath_handle: Vpath handle.
375 vxge_hal_aux_vpath_fifo_dump(vxge_hal_vpath_h vpath_handle);
378 * vxge_hal_aux_device_dump - Dump driver "about" info and device state.
379 * @devh: HAL device handle.
381 * Dump driver & device "about" info and device state,
382 * including all BAR0 registers, hardware and software statistics, PCI
383 * configuration space.
385 vxge_hal_status_e vxge_hal_aux_device_dump(vxge_hal_device_h devh);
389 #endif /* VXGE_HAL_MGMTAUX_H */