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