1/*
2 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
3 * Permission to use, copy, modify, and/or distribute this software for
4 * any purpose with or without fee is hereby granted, provided that the
5 * above copyright notice and this permission notice appear in all copies.
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 */
14
15
16#ifndef _ISISC_PORT_CTRL_H_
17#define _ISISC_PORT_CTRL_H_
18
19#ifdef __cplusplus
20extern "C" {
21#endif                          /* __cplusplus */
22
23#include "fal/fal_port_ctrl.h"
24
25    sw_error_t isisc_port_ctrl_init(a_uint32_t dev_id);
26
27#ifdef IN_PORTCONTROL
28#define ISISC_PORT_CTRL_INIT(rv, dev_id) \
29    { \
30        rv = isisc_port_ctrl_init(dev_id); \
31        SW_RTN_ON_ERROR(rv); \
32    }
33#else
34#define ISISC_PORT_CTRL_INIT(rv, dev_id)
35#endif
36
37#ifdef HSL_STANDALONG
38
39
40    HSL_LOCAL sw_error_t
41    isisc_port_duplex_set(a_uint32_t dev_id, fal_port_t port_id,
42                         fal_port_duplex_t duplex);
43
44
45    HSL_LOCAL sw_error_t
46    isisc_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id,
47                         fal_port_duplex_t * pduplex);
48
49
50    HSL_LOCAL sw_error_t
51    isisc_port_speed_set(a_uint32_t dev_id, fal_port_t port_id,
52                        fal_port_speed_t speed);
53
54
55    HSL_LOCAL sw_error_t
56    isisc_port_speed_get(a_uint32_t dev_id, fal_port_t port_id,
57                        fal_port_speed_t * pspeed);
58
59
60    HSL_LOCAL sw_error_t
61    isisc_port_autoneg_status_get(a_uint32_t dev_id, fal_port_t port_id,
62                                 a_bool_t * status);
63
64
65    HSL_LOCAL sw_error_t
66    isisc_port_autoneg_enable(a_uint32_t dev_id, fal_port_t port_id);
67
68
69    HSL_LOCAL sw_error_t
70    isisc_port_autoneg_restart(a_uint32_t dev_id, fal_port_t port_id);
71
72
73    HSL_LOCAL sw_error_t
74    isisc_port_autoneg_adv_set(a_uint32_t dev_id, fal_port_t port_id,
75                              a_uint32_t autoadv);
76
77
78    HSL_LOCAL sw_error_t
79    isisc_port_autoneg_adv_get(a_uint32_t dev_id, fal_port_t port_id,
80                              a_uint32_t * autoadv);
81
82
83    HSL_LOCAL sw_error_t
84    isisc_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id,
85                           a_bool_t enable);
86
87
88    HSL_LOCAL sw_error_t
89    isisc_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id,
90                           a_bool_t * enable);
91
92
93    HSL_LOCAL sw_error_t
94    isisc_port_flowctrl_forcemode_set(a_uint32_t dev_id,
95                                     fal_port_t port_id, a_bool_t enable);
96
97
98    HSL_LOCAL sw_error_t
99    isisc_port_flowctrl_forcemode_get(a_uint32_t dev_id,
100                                     fal_port_t port_id,
101                                     a_bool_t * enable);
102
103
104    HSL_LOCAL sw_error_t
105    isisc_port_powersave_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
106
107
108    HSL_LOCAL sw_error_t
109    isisc_port_powersave_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable);
110
111
112    HSL_LOCAL sw_error_t
113    isisc_port_hibernate_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
114
115
116    HSL_LOCAL sw_error_t
117    isisc_port_hibernate_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable);
118
119
120    HSL_LOCAL sw_error_t
121    isisc_port_cdt(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t mdi_pair,
122                  fal_cable_status_t *cable_status, a_uint32_t *cable_len);
123
124
125    HSL_LOCAL sw_error_t
126    isisc_port_rxhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id,
127                             fal_port_header_mode_t mode);
128
129
130    HSL_LOCAL sw_error_t
131    isisc_port_rxhdr_mode_get(a_uint32_t dev_id, fal_port_t port_id,
132                             fal_port_header_mode_t * mode);
133
134
135    HSL_LOCAL sw_error_t
136    isisc_port_txhdr_mode_set(a_uint32_t dev_id, fal_port_t port_id,
137                             fal_port_header_mode_t mode);
138
139
140    HSL_LOCAL sw_error_t
141    isisc_port_txhdr_mode_get(a_uint32_t dev_id, fal_port_t port_id,
142                             fal_port_header_mode_t * mode);
143
144
145    HSL_LOCAL sw_error_t
146    isisc_header_type_set(a_uint32_t dev_id, a_bool_t enable, a_uint32_t type);
147
148
149    HSL_LOCAL sw_error_t
150    isisc_header_type_get(a_uint32_t dev_id, a_bool_t * enable, a_uint32_t * type);
151
152
153    HSL_LOCAL sw_error_t
154    isisc_port_txmac_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
155
156
157    HSL_LOCAL sw_error_t
158    isisc_port_txmac_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
159
160
161    HSL_LOCAL sw_error_t
162    isisc_port_rxmac_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
163
164
165    HSL_LOCAL sw_error_t
166    isisc_port_rxmac_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
167
168
169    HSL_LOCAL sw_error_t
170    isisc_port_txfc_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
171
172
173    HSL_LOCAL sw_error_t
174    isisc_port_txfc_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
175
176
177    HSL_LOCAL sw_error_t
178    isisc_port_rxfc_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
179
180
181    HSL_LOCAL sw_error_t
182    isisc_port_rxfc_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
183
184
185    HSL_LOCAL sw_error_t
186    isisc_port_bp_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
187
188
189    HSL_LOCAL sw_error_t
190    isisc_port_bp_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
191
192
193    HSL_LOCAL sw_error_t
194    isisc_port_link_forcemode_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
195
196
197    HSL_LOCAL sw_error_t
198    isisc_port_link_forcemode_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
199
200
201    HSL_LOCAL sw_error_t
202    isisc_port_link_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status);
203
204    HSL_LOCAL sw_error_t
205    isisc_ports_link_status_get(a_uint32_t dev_id, a_uint32_t * status);
206
207    HSL_LOCAL sw_error_t
208    isisc_port_mac_loopback_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
209
210
211    HSL_LOCAL sw_error_t
212    isisc_port_mac_loopback_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable);
213#endif
214
215#ifdef __cplusplus
216}
217#endif                          /* __cplusplus */
218#endif                          /* _ISISC_PORT_CTRL_H_ */
219
220