xref: /qemu/include/hw/net/lan9118_phy.h (revision 2a1823456c3ab500a90c3fe0cfcc5fc6f560282b)
1*c0cf6b41SBernhard Beschow /*
2*c0cf6b41SBernhard Beschow  * SMSC LAN9118 PHY emulation
3*c0cf6b41SBernhard Beschow  *
4*c0cf6b41SBernhard Beschow  * Copyright (c) 2009 CodeSourcery, LLC.
5*c0cf6b41SBernhard Beschow  * Written by Paul Brook
6*c0cf6b41SBernhard Beschow  *
7*c0cf6b41SBernhard Beschow  * This work is licensed under the terms of the GNU GPL, version 2 or later.
8*c0cf6b41SBernhard Beschow  * See the COPYING file in the top-level directory.
9*c0cf6b41SBernhard Beschow  */
10*c0cf6b41SBernhard Beschow 
11*c0cf6b41SBernhard Beschow #ifndef HW_NET_LAN9118_PHY_H
12*c0cf6b41SBernhard Beschow #define HW_NET_LAN9118_PHY_H
13*c0cf6b41SBernhard Beschow 
14*c0cf6b41SBernhard Beschow #include "qom/object.h"
15*c0cf6b41SBernhard Beschow #include "hw/sysbus.h"
16*c0cf6b41SBernhard Beschow 
17*c0cf6b41SBernhard Beschow #define TYPE_LAN9118_PHY "lan9118-phy"
18*c0cf6b41SBernhard Beschow OBJECT_DECLARE_SIMPLE_TYPE(Lan9118PhyState, LAN9118_PHY)
19*c0cf6b41SBernhard Beschow 
20*c0cf6b41SBernhard Beschow typedef struct Lan9118PhyState {
21*c0cf6b41SBernhard Beschow     SysBusDevice parent_obj;
22*c0cf6b41SBernhard Beschow 
23*c0cf6b41SBernhard Beschow     uint16_t status;
24*c0cf6b41SBernhard Beschow     uint16_t control;
25*c0cf6b41SBernhard Beschow     uint16_t advertise;
26*c0cf6b41SBernhard Beschow     uint16_t ints;
27*c0cf6b41SBernhard Beschow     uint16_t int_mask;
28*c0cf6b41SBernhard Beschow     qemu_irq irq;
29*c0cf6b41SBernhard Beschow     bool link_down;
30*c0cf6b41SBernhard Beschow } Lan9118PhyState;
31*c0cf6b41SBernhard Beschow 
32*c0cf6b41SBernhard Beschow void lan9118_phy_update_link(Lan9118PhyState *s, bool link_down);
33*c0cf6b41SBernhard Beschow void lan9118_phy_reset(Lan9118PhyState *s);
34*c0cf6b41SBernhard Beschow uint16_t lan9118_phy_read(Lan9118PhyState *s, int reg);
35*c0cf6b41SBernhard Beschow void lan9118_phy_write(Lan9118PhyState *s, int reg, uint16_t val);
36*c0cf6b41SBernhard Beschow 
37*c0cf6b41SBernhard Beschow #endif
38