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/**
17 * @defgroup shiva_port_ctrl SHIVA_PORT_CONTROL
18 * @{
19 */
20#ifndef _SHIVA_PORT_CTRL_H_
21#define _SHIVA_PORT_CTRL_H_
22
23#ifdef __cplusplus
24extern "C" {
25#endif                          /* __cplusplus */
26
27#include "fal/fal_port_ctrl.h"
28
29    sw_error_t shiva_port_ctrl_init(a_uint32_t dev_id);
30
31#ifdef IN_PORTCONTROL
32#define SHIVA_PORT_CTRL_INIT(rv, dev_id) \
33    { \
34        rv = shiva_port_ctrl_init(dev_id); \
35        SW_RTN_ON_ERROR(rv); \
36    }
37#else
38#define SHIVA_PORT_CTRL_INIT(rv, dev_id)
39#endif
40
41#ifdef HSL_STANDALONG
42
43
44    HSL_LOCAL sw_error_t
45    shiva_port_duplex_set(a_uint32_t dev_id, fal_port_t port_id,
46                          fal_port_duplex_t duplex);
47
48
49    HSL_LOCAL sw_error_t
50    shiva_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id,
51                          fal_port_duplex_t * pduplex);
52
53
54    HSL_LOCAL sw_error_t
55    shiva_port_speed_set(a_uint32_t dev_id, fal_port_t port_id,
56                         fal_port_speed_t speed);
57
58
59    HSL_LOCAL sw_error_t
60    shiva_port_speed_get(a_uint32_t dev_id, fal_port_t port_id,
61                         fal_port_speed_t * pspeed);
62
63
64    HSL_LOCAL sw_error_t
65    shiva_port_autoneg_status_get(a_uint32_t dev_id, fal_port_t port_id,
66                                  a_bool_t * status);
67
68
69    HSL_LOCAL sw_error_t
70    shiva_port_autoneg_enable(a_uint32_t dev_id, fal_port_t port_id);
71
72
73    HSL_LOCAL sw_error_t
74    shiva_port_autoneg_restart(a_uint32_t dev_id, fal_port_t port_id);
75
76
77    HSL_LOCAL sw_error_t
78    shiva_port_autoneg_adv_set(a_uint32_t dev_id, fal_port_t port_id,
79                               a_uint32_t autoadv);
80
81
82    HSL_LOCAL sw_error_t
83    shiva_port_autoneg_adv_get(a_uint32_t dev_id, fal_port_t port_id,
84                               a_uint32_t * autoadv);
85
86
87    HSL_LOCAL sw_error_t
88    shiva_port_hdr_status_set(a_uint32_t dev_id, fal_port_t port_id,
89                              a_bool_t enable);
90
91
92    HSL_LOCAL sw_error_t
93    shiva_port_hdr_status_get(a_uint32_t dev_id, fal_port_t port_id,
94                              a_bool_t * enable);
95
96
97    HSL_LOCAL sw_error_t
98    shiva_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id,
99                            a_bool_t enable);
100
101
102    HSL_LOCAL sw_error_t
103    shiva_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id,
104                            a_bool_t * enable);
105
106
107    HSL_LOCAL sw_error_t
108    shiva_port_flowctrl_forcemode_set(a_uint32_t dev_id,
109                                      fal_port_t port_id, a_bool_t enable);
110
111
112    HSL_LOCAL sw_error_t
113    shiva_port_flowctrl_forcemode_get(a_uint32_t dev_id,
114                                      fal_port_t port_id,
115                                      a_bool_t * enable);
116
117
118    HSL_LOCAL sw_error_t
119    shiva_port_powersave_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
120
121
122    HSL_LOCAL sw_error_t
123    shiva_port_powersave_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable);
124
125
126    HSL_LOCAL sw_error_t
127    shiva_port_hibernate_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable);
128
129
130    HSL_LOCAL sw_error_t
131    shiva_port_hibernate_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable);
132
133
134    HSL_LOCAL sw_error_t
135    shiva_port_cdt(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t mdi_pair,
136                   fal_cable_status_t *cable_status, a_uint32_t *cable_len);
137
138
139#endif
140
141#ifdef __cplusplus
142}
143#endif                          /* __cplusplus */
144#endif                          /* _SHIVA_PORT_CTRL_H_ */
145/**
146 * @}
147 */
148