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