xref: /netbsd-src/sys/arch/playstation2/dev/emac3var.h (revision 1e2880f2bdb7ffe2c90e48598c1930b6fc86ace4)
1*1e2880f2Sriastradh /*	$NetBSD: emac3var.h,v 1.8 2022/02/11 23:49:19 riastradh Exp $	*/
2aad6ef8bSmartin 
3aad6ef8bSmartin /*-
4aad6ef8bSmartin  * Copyright (c) 2001 The NetBSD Foundation, Inc.
5aad6ef8bSmartin  * All rights reserved.
6aad6ef8bSmartin  *
7aad6ef8bSmartin  * This code is derived from software contributed to The NetBSD Foundation
8aad6ef8bSmartin  * by UCHIYAMA Yasushi.
9aad6ef8bSmartin  *
10aad6ef8bSmartin  * Redistribution and use in source and binary forms, with or without
11aad6ef8bSmartin  * modification, are permitted provided that the following conditions
12aad6ef8bSmartin  * are met:
13aad6ef8bSmartin  * 1. Redistributions of source code must retain the above copyright
14aad6ef8bSmartin  *    notice, this list of conditions and the following disclaimer.
15aad6ef8bSmartin  * 2. Redistributions in binary form must reproduce the above copyright
16aad6ef8bSmartin  *    notice, this list of conditions and the following disclaimer in the
17aad6ef8bSmartin  *    documentation and/or other materials provided with the distribution.
18aad6ef8bSmartin  *
19aad6ef8bSmartin  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20aad6ef8bSmartin  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21aad6ef8bSmartin  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22aad6ef8bSmartin  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23aad6ef8bSmartin  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24aad6ef8bSmartin  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25aad6ef8bSmartin  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26aad6ef8bSmartin  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27aad6ef8bSmartin  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28aad6ef8bSmartin  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29aad6ef8bSmartin  * POSSIBILITY OF SUCH DAMAGE.
30aad6ef8bSmartin  */
31aad6ef8bSmartin 
32aad6ef8bSmartin struct emac3_softc {
33*1e2880f2Sriastradh 	device_t dev;
34aad6ef8bSmartin 	struct mii_data mii;
35aad6ef8bSmartin 	u_int8_t eaddr[ETHER_ADDR_LEN];
36aad6ef8bSmartin 	u_int32_t mode1_reg;
37aad6ef8bSmartin };
38aad6ef8bSmartin 
39aad6ef8bSmartin int emac3_init(struct emac3_softc *);
40aad6ef8bSmartin int emac3_reset(struct emac3_softc *);
41aad6ef8bSmartin void emac3_exit(struct emac3_softc *);
42aad6ef8bSmartin 
43aad6ef8bSmartin void emac3_enable(void);
44aad6ef8bSmartin void emac3_disable(void);
45aad6ef8bSmartin 
46aad6ef8bSmartin void emac3_intr_enable(void);
47aad6ef8bSmartin void emac3_intr_disable(void);
48aad6ef8bSmartin void emac3_intr_clear(void);
49aad6ef8bSmartin int emac3_intr(void *);
50aad6ef8bSmartin 
51aad6ef8bSmartin void emac3_tx_kick(void);
52aad6ef8bSmartin int emac3_tx_done(void);
53aad6ef8bSmartin 
54aad6ef8bSmartin void emac3_setmulti(struct emac3_softc *, struct ethercom *);
55aad6ef8bSmartin 
56a5cdd4b4Smsaitoh int emac3_phy_readreg(device_t, int, int, uint16_t *);
57a5cdd4b4Smsaitoh int emac3_phy_writereg(device_t, int, int, uint16_t);
5890273003Smartin void emac3_phy_statchg(struct ifnet *);
59