1*950a6087SEmmanuel Vadot#- 2*950a6087SEmmanuel Vadot# Copyright 2016 Michal Meloun <mmel@FreeBSD.org> 3*950a6087SEmmanuel Vadot# 4*950a6087SEmmanuel Vadot# Redistribution and use in source and binary forms, with or without 5*950a6087SEmmanuel Vadot# modification, are permitted provided that the following conditions 6*950a6087SEmmanuel Vadot# are met: 7*950a6087SEmmanuel Vadot# 1. Redistributions of source code must retain the above copyright 8*950a6087SEmmanuel Vadot# notice, this list of conditions and the following disclaimer. 9*950a6087SEmmanuel Vadot# 2. Redistributions in binary form must reproduce the above copyright 10*950a6087SEmmanuel Vadot# notice, this list of conditions and the following disclaimer in the 11*950a6087SEmmanuel Vadot# documentation and/or other materials provided with the distribution. 12*950a6087SEmmanuel Vadot# 13*950a6087SEmmanuel Vadot# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14*950a6087SEmmanuel Vadot# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15*950a6087SEmmanuel Vadot# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16*950a6087SEmmanuel Vadot# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17*950a6087SEmmanuel Vadot# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18*950a6087SEmmanuel Vadot# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19*950a6087SEmmanuel Vadot# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20*950a6087SEmmanuel Vadot# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21*950a6087SEmmanuel Vadot# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22*950a6087SEmmanuel Vadot# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23*950a6087SEmmanuel Vadot# SUCH DAMAGE. 24*950a6087SEmmanuel Vadot# 25*950a6087SEmmanuel Vadot 26*950a6087SEmmanuel VadotINTERFACE phynode; 27*950a6087SEmmanuel Vadot 28*950a6087SEmmanuel VadotHEADER { 29*950a6087SEmmanuel Vadot #include <dev/phy/phy.h> 30*950a6087SEmmanuel Vadot 31*950a6087SEmmanuel Vadot struct phynode; 32*950a6087SEmmanuel Vadot} 33*950a6087SEmmanuel Vadot 34*950a6087SEmmanuel Vadot# 35*950a6087SEmmanuel Vadot# Init/deinit phy 36*950a6087SEmmanuel Vadot# Returns 0 on success or a standard errno value. 37*950a6087SEmmanuel Vadot# 38*950a6087SEmmanuel VadotMETHOD int init { 39*950a6087SEmmanuel Vadot struct phynode *phynode; 40*950a6087SEmmanuel Vadot}; 41*950a6087SEmmanuel Vadot 42*950a6087SEmmanuel Vadot# 43*950a6087SEmmanuel Vadot# Enable/disable phy 44*950a6087SEmmanuel Vadot# Returns 0 on success or a standard errno value. 45*950a6087SEmmanuel Vadot# 46*950a6087SEmmanuel VadotMETHOD int enable { 47*950a6087SEmmanuel Vadot struct phynode *phynode; 48*950a6087SEmmanuel Vadot bool enable; 49*950a6087SEmmanuel Vadot}; 50*950a6087SEmmanuel Vadot 51*950a6087SEmmanuel Vadot# 52*950a6087SEmmanuel Vadot# Get phy status 53*950a6087SEmmanuel Vadot# Returns 0 on success or a standard errno value. 54*950a6087SEmmanuel Vadot# 55*950a6087SEmmanuel VadotMETHOD int status { 56*950a6087SEmmanuel Vadot struct phynode *phynode; 57*950a6087SEmmanuel Vadot int *status; /* PHY_STATUS_* */ 58*950a6087SEmmanuel Vadot}; 59*950a6087SEmmanuel Vadot 60*950a6087SEmmanuel Vadot 61*950a6087SEmmanuel Vadot# 62*950a6087SEmmanuel Vadot# Set mode/submode for multiprotocol phy 63*950a6087SEmmanuel Vadot# Returns 0 on success or a standard errno value. 64*950a6087SEmmanuel Vadot# 65*950a6087SEmmanuel VadotMETHOD int set_mode { 66*950a6087SEmmanuel Vadot struct phynode *phynode; 67*950a6087SEmmanuel Vadot phy_mode_t mode; 68*950a6087SEmmanuel Vadot phy_submode_t submode; 69*950a6087SEmmanuel Vadot}; 70