1 /* 2 * Copyright 2007, Hugo Santos. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Hugo Santos, hugosantos@gmail.com 7 */ 8 9 #include "device.h" 10 11 #include <compat/sys/bus.h> 12 13 #include <compat/net/if_media.h> 14 #include <compat/dev/mii/miivar.h> 15 16 17 int 18 __haiku_miibus_readreg(device_t dev, int phy, int reg) 19 { 20 if (dev->methods.miibus_readreg == NULL) 21 panic("miibus_readreg, no support"); 22 23 return dev->methods.miibus_readreg(dev, phy, reg); 24 } 25 26 27 int 28 __haiku_miibus_writereg(device_t dev, int phy, int reg, int data) 29 { 30 if (dev->methods.miibus_writereg == NULL) 31 panic("miibus_writereg, no support"); 32 33 return dev->methods.miibus_writereg(dev, phy, reg, data); 34 } 35 36 37 void 38 __haiku_miibus_statchg(device_t dev) 39 { 40 if (dev->methods.miibus_statchg) 41 dev->methods.miibus_statchg(dev); 42 } 43 44 45 void 46 __haiku_miibus_linkchg(device_t dev) 47 { 48 if (dev->methods.miibus_linkchg) 49 dev->methods.miibus_linkchg(dev); 50 } 51 52 53 void 54 __haiku_miibus_mediainit(device_t dev) 55 { 56 if (dev->methods.miibus_mediainit) 57 dev->methods.miibus_mediainit(dev); 58 } 59