diff options
author | andreast <andreast@FreeBSD.org> | 2013-12-11 22:36:20 +0000 |
---|---|---|
committer | andreast <andreast@FreeBSD.org> | 2013-12-11 22:36:20 +0000 |
commit | 66bcaa96d680466f9c02406d1c9c6f6fa8147efe (patch) | |
tree | 451f1ba31330be9c8b1f330dff4460957da82a74 /sys/dev/tsec/if_tsec.h | |
parent | 50221324bd40404e88dea60c7f368087bdd21a77 (diff) | |
download | FreeBSD-src-66bcaa96d680466f9c02406d1c9c6f6fa8147efe.zip FreeBSD-src-66bcaa96d680466f9c02406d1c9c6f6fa8147efe.tar.gz |
MFC r257991, r257992, 257993, 258504
r257991:
Consolidate Apple firmware hacks and improve them by switching on the
presence of mac-io devices in the tree, which uniquely identifies Apple
hardware.
r257992:
Allow OF_decode_addr() to also be able to map resources on big-endian
devices. To this end, make PCI device detection rely on the device_type
field rather than name, as per the standard.
r257993:
Make tsec work with the device tree present on the RB800. The previous code
assumed that the MDIO bus was a direct child of the Ethernet interface. It
may not be and indeed on many device trees is not. While here, add proper
locking for MII transactions, which may be on a bus shared by several MACs.
r258504:
Save and restore the trap vectors when doing OF calls on pSeries machines.
It turned out that on pSeries machines the call into OF modified the trap
vectors and this made further behaviour unpredictable.
With this commit I'm now able to boot multi user on a network booted
environment on my IntelliStation 285. This is a POWER5+ machine.
Diffstat (limited to 'sys/dev/tsec/if_tsec.h')
-rw-r--r-- | sys/dev/tsec/if_tsec.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/tsec/if_tsec.h b/sys/dev/tsec/if_tsec.h index cfba3f6..7c6bc30 100644 --- a/sys/dev/tsec/if_tsec.h +++ b/sys/dev/tsec/if_tsec.h @@ -133,7 +133,8 @@ struct tsec_softc { struct mbuf *frame; int phyaddr; - struct tsec_softc *phy_sc; + bus_space_tag_t phy_bst; + bus_space_handle_t phy_bsh; }; /* interface to get/put generic objects */ @@ -253,6 +254,14 @@ struct tsec_softc { #define TSEC_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bas.bst, (sc)->sc_bas.bsh, (reg), (val)) +extern struct mtx tsec_phy_mtx; +#define TSEC_PHY_LOCK(sc) mtx_lock(&tsec_phy_mtx) +#define TSEC_PHY_UNLOCK(sc) mtx_unlock(&tsec_phy_mtx) +#define TSEC_PHY_READ(sc, reg) \ + bus_space_read_4((sc)->phy_bst, (sc)->phy_bsh, (reg)) +#define TSEC_PHY_WRITE(sc, reg, val) \ + bus_space_write_4((sc)->phy_bst, (sc)->phy_bsh, (reg), (val)) + /* Lock for transmitter */ #define TSEC_TRANSMIT_LOCK(sc) do { \ mtx_assert(&(sc)->receive_lock, MA_NOTOWNED); \ |