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