1# $FreeBSD$ 2 3#include <sys/bus.h> 4 5# Needed for ifreq/ifmediareq 6#include <sys/socket.h> 7#include <net/if.h> 8 9#include <dev/etherswitch/etherswitch.h> 10 11INTERFACE etherswitch; 12 13# 14# Default implementation 15# 16CODE { 17 static void 18 null_etherswitch_lock(device_t dev) 19 { 20 } 21 22 static void 23 null_etherswitch_unlock(device_t dev) 24 { 25 } 26}; 27 28# 29# Return device info 30# 31METHOD etherswitch_info_t* getinfo { 32 device_t dev; 33} 34 35# 36# Lock access to switch registers 37# 38METHOD void lock { 39 device_t dev; 40} DEFAULT null_etherswitch_lock; 41 42# 43# Unlock access to switch registers 44# 45METHOD void unlock { 46 device_t dev; 47} DEFAULT null_etherswitch_unlock; 48 49# 50# Read switch register 51# 52METHOD int readreg { 53 device_t dev; 54 int reg; 55}; 56 57# 58# Write switch register 59# 60METHOD int writereg { 61 device_t dev; 62 int reg; 63 int value; 64}; 65 66# 67# Read PHY register 68# 69METHOD int readphyreg { 70 device_t dev; 71 int phy; 72 int reg; 73}; 74 75# 76# Write PHY register 77# 78METHOD int writephyreg { 79 device_t dev; 80 int phy; 81 int reg; 82 int value; 83}; 84 85# 86# Get port configuration 87# 88METHOD int getport { 89 device_t dev; 90 etherswitch_port_t *vg; 91} 92 93# 94# Set port configuration 95# 96METHOD int setport { 97 device_t dev; 98 etherswitch_port_t *vg; 99} 100 101# 102# Get VLAN group configuration 103# 104METHOD int getvgroup { 105 device_t dev; 106 etherswitch_vlangroup_t *vg; 107} 108 109# 110# Set VLAN group configuration 111# 112METHOD int setvgroup { 113 device_t dev; 114 etherswitch_vlangroup_t *vg; 115} 116