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_MRPCIM_H
34 #define VXGE_HAL_MRPCIM_H
41 * HAL mrpcim object. Represents privileged mode device.
43 typedef struct __hal_mrpcim_t {
48 vxge_hal_vpd_data_t vpd_data;
49 __hal_blockpool_entry_t *mrpcim_stats_block;
50 vxge_hal_mrpcim_stats_hw_info_t *mrpcim_stats;
51 vxge_hal_mrpcim_stats_hw_info_t mrpcim_stats_sav;
52 vxge_hal_mrpcim_xpak_stats_t xpak_stats[VXGE_HAL_MAC_MAX_WIRE_PORTS];
55 #define VXGE_HAL_MRPCIM_STATS_PIO_READ(loc, offset) { \
56 status = vxge_hal_mrpcim_stats_access(devh, \
57 VXGE_HAL_STATS_OP_READ, \
62 if (status != VXGE_HAL_OK) { \
63 vxge_hal_trace_log_stats("<== %s:%s:%d Result = %d", \
64 __FILE__, __func__, __LINE__, status); \
69 #define VXGE_HAL_MRPCIM_ERROR_REG_CLEAR(reg) \
70 vxge_os_pio_mem_write64( \
72 hldev->header.regh0, \
73 VXGE_HAL_INTR_MASK_ALL, \
76 #define VXGE_HAL_MRPCIM_ERROR_REG_MASK(reg) \
77 vxge_os_pio_mem_write64( \
79 hldev->header.regh0, \
80 VXGE_HAL_INTR_MASK_ALL, \
83 #define VXGE_HAL_MRPCIM_ERROR_REG_UNMASK(mask, reg) \
84 vxge_os_pio_mem_write64( \
86 hldev->header.regh0, \
91 __hal_mrpcim_mdio_access(
92 vxge_hal_device_h devh,
100 __hal_mrpcim_rts_table_access(
101 vxge_hal_device_h devh,
110 __hal_mrpcim_initialize(__hal_device_t *hldev);
113 __hal_mrpcim_terminate(__hal_device_t *hldev);
116 __hal_mrpcim_get_vpd_data(__hal_device_t *hldev);
119 __hal_mrpcim_xpak_counter_check(__hal_device_t *hldev,
120 u32 port, u32 type, u32 value);
123 __hal_mrpcim_stats_get(
124 __hal_device_t *hldev,
125 vxge_hal_mrpcim_stats_hw_info_t *mrpcim_stats);
128 __hal_mrpcim_mac_configure(__hal_device_t *hldev);
131 __hal_mrpcim_lag_configure(__hal_device_t *hldev);
135 #endif /* VXGE_HAL_MRPCIM_H */