xref: /haiku/src/libs/compat/freebsd_network/mii.c (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
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 
10 #include "device.h"
11 
12 #include <compat/sys/bus.h>
13 
14 #include <compat/net/if_media.h>
15 #include <compat/dev/mii/miivar.h>
16 
17 
18 int
19 __haiku_miibus_readreg(device_t device, int phy, int reg)
20 {
21 	if (device->methods.miibus_readreg == NULL)
22 		panic("miibus_readreg, no support");
23 
24 	return device->methods.miibus_readreg(device, phy, reg);
25 }
26 
27 
28 int
29 __haiku_miibus_writereg(device_t device, int phy, int reg, int data)
30 {
31 	if (device->methods.miibus_writereg == NULL)
32 		panic("miibus_writereg, no support");
33 
34 	return device->methods.miibus_writereg(device, phy, reg, data);
35 }
36 
37 
38 void
39 __haiku_miibus_statchg(device_t device)
40 {
41 	if (device->methods.miibus_statchg)
42 		device->methods.miibus_statchg(device);
43 }
44 
45 
46 void
47 __haiku_miibus_linkchg(device_t device)
48 {
49 	if (device->methods.miibus_linkchg)
50 		device->methods.miibus_linkchg(device);
51 }
52 
53 
54 void
55 __haiku_miibus_mediainit(device_t device)
56 {
57 	if (device->methods.miibus_mediainit)
58 		device->methods.miibus_mediainit(device);
59 }
60