1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NPI_TXC_H
#define _NPI_TXC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <npi.h>
#include <nxge_txc_hw.h>
/*
* Transmit Controller (TXC) NPI error codes
*/
#define TXC_ER_ST (TXC_BLK_ID << NPI_BLOCK_ID_SHIFT)
#define TXC_ID_SHIFT(n) (n << NPI_PORT_CHAN_SHIFT)
#define NPI_TXC_PORT_INVALID(n) (TXC_ID_SHIFT(n) | IS_PORT |\
TXC_ER_ST | PORT_INVALID)
#define NPI_TXC_CHANNEL_INVALID(n) (TXC_ID_SHIFT(n) | IS_PORT |\
TXC_ER_ST | CHANNEL_INVALID)
#define NPI_TXC_OPCODE_INVALID(n) (TXC_ID_SHIFT(n) | IS_PORT |\
TXC_ER_ST | OPCODE_INVALID)
/*
* Register offset (0x1000 bytes for each channel) for TXC registers.
*/
#define NXGE_TXC_FZC_OFFSET(x, cn) (x + TXC_FZC_CHANNEL_OFFSET(cn))
/*
* Register offset (0x100 bytes for each port) for TXC Function zero
* control registers.
*/
#define NXGE_TXC_FZC_CNTL_OFFSET(x, port) (x + \
TXC_FZC_CNTL_PORT_OFFSET(port))
/*
* PIO macros to read and write the transmit control registers.
*/
#define TXC_FZC_REG_READ64(handle, reg, cn, val_p) \
NXGE_REG_RD64(handle, \
(NXGE_TXC_FZC_OFFSET(reg, cn)), val_p)
#define TXC_FZC_REG_WRITE64(handle, reg, cn, data) \
NXGE_REG_WR64(handle, \
(NXGE_TXC_FZC_OFFSET(reg, cn)), data)
#define TXC_FZC_CNTL_REG_READ64(handle, reg, port, val_p) \
NXGE_REG_RD64(handle, \
(NXGE_TXC_FZC_CNTL_OFFSET(reg, port)), val_p)
#define TXC_FZC_CNTL_REG_WRITE64(handle, reg, port, data) \
NXGE_REG_WR64(handle, \
(NXGE_TXC_FZC_CNTL_OFFSET(reg, port)), data)
/*
* TXC (Transmit Controller) prototypes.
*/
npi_status_t npi_txc_dma_max_burst(npi_handle_t, io_op_t,
uint8_t, uint32_t *);
npi_status_t npi_txc_dma_max_burst_set(npi_handle_t, uint8_t,
uint32_t);
npi_status_t npi_txc_dma_bytes_transmitted(npi_handle_t,
uint8_t, uint32_t *);
npi_status_t npi_txc_control(npi_handle_t, io_op_t,
p_txc_control_t);
npi_status_t npi_txc_global_enable(npi_handle_t);
npi_status_t npi_txc_global_disable(npi_handle_t);
npi_status_t npi_txc_control_clear(npi_handle_t, uint8_t);
npi_status_t npi_txc_training_set(npi_handle_t, uint32_t);
npi_status_t npi_txc_training_get(npi_handle_t, uint32_t *);
npi_status_t npi_txc_port_control_get(npi_handle_t, uint8_t,
uint32_t *);
npi_status_t npi_txc_port_enable(npi_handle_t, uint8_t);
npi_status_t npi_txc_port_disable(npi_handle_t, uint8_t);
npi_status_t npi_txc_dma_max_burst(npi_handle_t, io_op_t,
uint8_t, uint32_t *);
npi_status_t npi_txc_port_dma_enable(npi_handle_t, uint8_t,
uint32_t);
npi_status_t npi_txc_port_dma_list_get(npi_handle_t, uint8_t,
uint32_t *);
npi_status_t npi_txc_port_dma_channel_enable(npi_handle_t, uint8_t,
uint8_t);
npi_status_t npi_txc_port_dma_channel_disable(npi_handle_t, uint8_t,
uint8_t);
npi_status_t npi_txc_pkt_stuffed_get(npi_handle_t, uint8_t,
uint32_t *, uint32_t *);
npi_status_t npi_txc_pkt_xmt_to_mac_get(npi_handle_t, uint8_t,
uint32_t *, uint32_t *);
npi_status_t npi_txc_reorder_get(npi_handle_t, uint8_t,
uint32_t *);
npi_status_t npi_txc_dump_tdc_fzc_regs(npi_handle_t, uint8_t);
npi_status_t npi_txc_dump_fzc_regs(npi_handle_t);
npi_status_t npi_txc_dump_port_fzc_regs(npi_handle_t, uint8_t);
npi_status_t npi_txc_ro_states_get(npi_handle_t, uint8_t,
txc_ro_states_t *);
npi_status_t npi_txc_ro_ecc_state_clr(npi_handle_t, uint8_t);
npi_status_t npi_txc_sf_states_get(npi_handle_t, uint8_t,
txc_sf_states_t *);
npi_status_t npi_txc_sf_ecc_state_clr(npi_handle_t, uint8_t);
void npi_txc_global_istatus_get(npi_handle_t, txc_int_stat_t *);
void npi_txc_global_istatus_clear(npi_handle_t, uint64_t);
void npi_txc_global_imask_set(npi_handle_t, uint8_t,
uint8_t);
#ifdef __cplusplus
}
#endif
#endif /* _NPI_TXC_H */
|