summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed/if_edvar.h
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2014-04-25 21:32:34 +0000
committermarius <marius@FreeBSD.org>2014-04-25 21:32:34 +0000
commit195efbca74b15ceebd51dd722cc82377feb749a1 (patch)
tree4e9b919ef9620388fac4c034c293f124f5e4f25c /sys/dev/ed/if_edvar.h
parent74997a8fe224a5a0425e567c2b8ecb4807089b3d (diff)
downloadFreeBSD-src-195efbca74b15ceebd51dd722cc82377feb749a1.zip
FreeBSD-src-195efbca74b15ceebd51dd722cc82377feb749a1.tar.gz
MFC: r260050, r261528
- Switch to using the common MII bitbang'ing code instead of duplicating it. - Based on lessons learnt with dc(4) (see r185750), add bus space barriers to the MII bitbang read and write functions as well as to instances of page switching. - Add missing locking to ed_ifmedia_{upd,sts}(). - Canonicalize some messages. - Based on actual functionality, ED_TC5299J_MII_DIROUT should be rather named ED_TC5299J_MII_DIRIN. - Remove unused headers. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers.
Diffstat (limited to 'sys/dev/ed/if_edvar.h')
-rw-r--r--sys/dev/ed/if_edvar.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/ed/if_edvar.h b/sys/dev/ed/if_edvar.h
index e344cd5..bd3be77 100644
--- a/sys/dev/ed/if_edvar.h
+++ b/sys/dev/ed/if_edvar.h
@@ -28,7 +28,10 @@
*/
#ifndef SYS_DEV_ED_IF_EDVAR_H
-#define SYS_DEV_ED_IF_EDVAR_H
+#define SYS_DEV_ED_IF_EDVAR_H
+
+#include <dev/mii/mii_bitbang.h>
+
/*
* ed_softc: per line info and status
*/
@@ -62,8 +65,7 @@ struct ed_softc {
u_long command);
void (*sc_mediachg)(struct ed_softc *);
device_t miibus; /* MII bus for cards with MII. */
- void (*mii_writebits)(struct ed_softc *, u_int, int);
- u_int (*mii_readbits)(struct ed_softc *, int);
+ mii_bitbang_ops_t mii_bitbang_ops;
struct callout tick_ch;
void (*sc_tick)(struct ed_softc *);
void (*readmem)(struct ed_softc *sc, bus_size_t src, uint8_t *dst,
@@ -109,6 +111,10 @@ struct ed_softc {
struct ifmib_iso_8802_3 mibdata; /* stuff for network mgmt */
};
+#define ed_nic_barrier(sc, port, length, flags) \
+ bus_space_barrier(sc->port_bst, sc->port_bsh, \
+ (sc)->nic_offset + (port), (length), (flags))
+
#define ed_nic_inb(sc, port) \
bus_space_read_1(sc->port_bst, sc->port_bsh, (sc)->nic_offset + (port))
@@ -147,6 +153,10 @@ struct ed_softc {
bus_space_write_multi_4(sc->port_bst, sc->port_bsh, \
(sc)->nic_offset + (port), (uint32_t *)(addr), (count))
+#define ed_asic_barrier(sc, port, length, flags) \
+ bus_space_barrier(sc->port_bst, sc->port_bsh, \
+ (sc)->asic_offset + (port), (length), (flags))
+
#define ed_asic_inb(sc, port) \
bus_space_read_1(sc->port_bst, sc->port_bsh, \
(sc)->asic_offset + (port))
OpenPOWER on IntegriCloud