1 /* 2 * Copyright (c) 2025 Adrian Chadd <adrian@FreeBSD.org> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 #ifndef __IF_RGE_HW_H__ 17 #define __IF_RGE_HW_H__ 18 19 struct rge_softc; 20 21 extern int rge_chipinit(struct rge_softc *); 22 extern void rge_mac_config_mcu(struct rge_softc *, enum rge_mac_type); 23 extern void rge_write_mac_ocp(struct rge_softc *, uint16_t, uint16_t); 24 extern uint16_t rge_read_mac_ocp(struct rge_softc *, uint16_t); 25 extern void rge_ephy_config(struct rge_softc *); 26 extern int rge_phy_config(struct rge_softc *); 27 extern void rge_set_macaddr(struct rge_softc *, const uint8_t *); 28 extern void rge_get_macaddr(struct rge_softc *, uint8_t *); 29 extern void rge_hw_reset(struct rge_softc *); 30 extern void rge_config_imtype(struct rge_softc *, int); 31 extern void rge_disable_aspm_clkreq(struct rge_softc *); 32 extern void rge_setup_intr(struct rge_softc *, int); 33 extern void rge_write_csi(struct rge_softc *, uint32_t, uint32_t); 34 extern uint32_t rge_read_csi(struct rge_softc *, uint32_t); 35 extern void rge_write_phy(struct rge_softc *, uint16_t, uint16_t, uint16_t); 36 extern uint16_t rge_read_phy(struct rge_softc *, uint16_t, uint16_t); 37 extern void rge_write_phy_ocp(struct rge_softc *, uint16_t, uint16_t); 38 extern uint16_t rge_read_phy_ocp(struct rge_softc *sc, uint16_t reg); 39 extern int rge_get_link_status(struct rge_softc *); 40 41 #endif /* __IF_RGE_HW_H__ */ 42