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 garuda_port_ctrl GARUDA_PORT_CONTROL 18 * @{ 19 */ 20#ifndef _GARUDA_PORT_CTRL_H_ 21#define _GARUDA_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 garuda_port_ctrl_init(a_uint32_t dev_id); 30 31#ifdef IN_PORTCONTROL 32#define GARUDA_PORT_CTRL_INIT(rv, dev_id) \ 33 { \ 34 rv = garuda_port_ctrl_init(dev_id); \ 35 SW_RTN_ON_ERROR(rv); \ 36 } 37#else 38#define GARUDA_PORT_CTRL_INIT(rv, dev_id) 39#endif 40 41#ifdef HSL_STANDALONG 42 43 44 HSL_LOCAL sw_error_t 45 garuda_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 garuda_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 garuda_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 garuda_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 garuda_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 garuda_port_autoneg_enable(a_uint32_t dev_id, fal_port_t port_id); 71 72 73 HSL_LOCAL sw_error_t 74 garuda_port_autoneg_restart(a_uint32_t dev_id, fal_port_t port_id); 75 76 HSL_LOCAL sw_error_t 77 garuda_port_autoneg_adv_set(a_uint32_t dev_id, fal_port_t port_id, 78 a_uint32_t autoadv); 79 80 81 HSL_LOCAL sw_error_t 82 garuda_port_autoneg_adv_get(a_uint32_t dev_id, fal_port_t port_id, 83 a_uint32_t * autoadv); 84 85 86 HSL_LOCAL sw_error_t 87 garuda_port_hdr_status_set(a_uint32_t dev_id, fal_port_t port_id, 88 a_bool_t enable); 89 90 91 HSL_LOCAL sw_error_t 92 garuda_port_hdr_status_get(a_uint32_t dev_id, fal_port_t port_id, 93 a_bool_t * enable); 94 95 96 HSL_LOCAL sw_error_t 97 garuda_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, 98 a_bool_t enable); 99 100 101 HSL_LOCAL sw_error_t 102 garuda_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id, 103 a_bool_t * enable); 104 105 106 HSL_LOCAL sw_error_t 107 garuda_port_flowctrl_forcemode_set(a_uint32_t dev_id, 108 fal_port_t port_id, a_bool_t enable); 109 110 111 HSL_LOCAL sw_error_t 112 garuda_port_flowctrl_forcemode_get(a_uint32_t dev_id, 113 fal_port_t port_id, 114 a_bool_t * enable); 115 116 HSL_LOCAL sw_error_t 117 garuda_port_powersave_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); 118 119 120 HSL_LOCAL sw_error_t 121 garuda_port_powersave_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); 122 123 124 HSL_LOCAL sw_error_t 125 garuda_port_hibernate_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); 126 127 128 HSL_LOCAL sw_error_t 129 garuda_port_hibernate_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); 130 131 132 HSL_LOCAL sw_error_t 133 garuda_port_cdt(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t mdi_pair, 134 fal_cable_status_t *cable_status, a_uint32_t *cable_len); 135 136 137#endif 138 139#ifdef __cplusplus 140} 141#endif /* __cplusplus */ 142#endif /* _GARUDA_PORT_CTRL_H_ */ 143/** 144 * @} 145 */ 146