From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t1a-0004pS-Le for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:22:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3t1O-0002ly-MY for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:22:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53478 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3t1O-0002lt-CA for qemu-devel@nongnu.org; Mon, 29 Jul 2013 15:22:18 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 29 Jul 2013 21:19:37 +0200 Message-Id: <1375125630-24869-121-git-send-email-afaerber@suse.de> In-Reply-To: <1375125630-24869-1-git-send-email-afaerber@suse.de> References: <1375125630-24869-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 120/173] etraxfs_eth: Rename fs_eth to ETRAXFSEthState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , =?UTF-8?q?Andreas=20F=C3=A4rber?= Also add a typedef. Signed-off-by: Andreas F=C3=A4rber --- hw/net/etraxfs_eth.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index dda1fc3..78ebbbc 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -324,9 +324,9 @@ static void mdio_cycle(struct qemu_mdio *bus) =20 #define TYPE_ETRAX_FS_ETH "etraxfs-eth" #define ETRAX_FS_ETH(obj) \ - OBJECT_CHECK(struct fs_eth, (obj), TYPE_ETRAX_FS_ETH) + OBJECT_CHECK(ETRAXFSEthState, (obj), TYPE_ETRAX_FS_ETH) =20 -struct fs_eth +typedef struct ETRAXFSEthState { SysBusDevice parent_obj; =20 @@ -354,9 +354,9 @@ struct fs_eth =20 /* PHY. */ struct qemu_phy phy; -}; +} ETRAXFSEthState; =20 -static void eth_validate_duplex(struct fs_eth *eth) +static void eth_validate_duplex(ETRAXFSEthState *eth) { struct qemu_phy *phy; unsigned int phy_duplex; @@ -387,7 +387,7 @@ static void eth_validate_duplex(struct fs_eth *eth) static uint64_t eth_read(void *opaque, hwaddr addr, unsigned int size) { - struct fs_eth *eth =3D opaque; + ETRAXFSEthState *eth =3D opaque; uint32_t r =3D 0; =20 addr >>=3D 2; @@ -404,7 +404,7 @@ eth_read(void *opaque, hwaddr addr, unsigned int size= ) return r; } =20 -static void eth_update_ma(struct fs_eth *eth, int ma) +static void eth_update_ma(ETRAXFSEthState *eth, int ma) { int reg; int i =3D 0; @@ -433,7 +433,7 @@ static void eth_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { - struct fs_eth *eth =3D opaque; + ETRAXFSEthState *eth =3D opaque; uint32_t value =3D val64; =20 addr >>=3D 2; @@ -477,7 +477,7 @@ eth_write(void *opaque, hwaddr addr, /* The ETRAX FS has a groupt address table (GAT) which works like a k=3D= 1 bloom filter dropping group addresses we have not joined. The filter has= 64 bits (m). The has function is a simple nible xor of the group addr. = */ -static int eth_match_groupaddr(struct fs_eth *eth, const unsigned char *= sa) +static int eth_match_groupaddr(ETRAXFSEthState *eth, const unsigned char= *sa) { unsigned int hsh; int m_individual =3D eth->regs[RW_REC_CTRL] & 4; @@ -528,7 +528,7 @@ static int eth_can_receive(NetClientState *nc) static ssize_t eth_receive(NetClientState *nc, const uint8_t *buf, size_= t size) { unsigned char sa_bcast[6] =3D {0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - struct fs_eth *eth =3D qemu_get_nic_opaque(nc); + ETRAXFSEthState *eth =3D qemu_get_nic_opaque(nc); int use_ma0 =3D eth->regs[RW_REC_CTRL] & 1; int use_ma1 =3D eth->regs[RW_REC_CTRL] & 2; int r_bcast =3D eth->regs[RW_REC_CTRL] & 8; @@ -552,12 +552,12 @@ static ssize_t eth_receive(NetClientState *nc, cons= t uint8_t *buf, size_t size) /* FIXME: Find another way to pass on the fake csum. */ etraxfs_dmac_input(eth->dma_in, (void *)buf, size + 4, 1); =20 - return size; + return size; } =20 static int eth_tx_push(void *opaque, unsigned char *buf, int len, bool e= op) { - struct fs_eth *eth =3D opaque; + ETRAXFSEthState *eth =3D opaque; =20 D(printf("%s buf=3D%p len=3D%d\n", __func__, buf, len)); qemu_send_packet(qemu_get_queue(eth->nic), buf, len); @@ -566,7 +566,7 @@ static int eth_tx_push(void *opaque, unsigned char *b= uf, int len, bool eop) =20 static void eth_set_link(NetClientState *nc) { - struct fs_eth *eth =3D qemu_get_nic_opaque(nc); + ETRAXFSEthState *eth =3D qemu_get_nic_opaque(nc); D(printf("%s %d\n", __func__, nc->link_down)); eth->phy.link =3D !nc->link_down; } @@ -583,7 +583,7 @@ static const MemoryRegionOps eth_ops =3D { =20 static void eth_cleanup(NetClientState *nc) { - struct fs_eth *eth =3D qemu_get_nic_opaque(nc); + ETRAXFSEthState *eth =3D qemu_get_nic_opaque(nc); =20 /* Disconnect the client. */ eth->dma_out->client.push =3D NULL; @@ -605,7 +605,7 @@ static NetClientInfo net_etraxfs_info =3D { static int fs_eth_init(SysBusDevice *sbd) { DeviceState *dev =3D DEVICE(sbd); - struct fs_eth *s =3D ETRAX_FS_ETH(dev); + ETRAXFSEthState *s =3D ETRAX_FS_ETH(dev); =20 if (!s->dma_out || !s->dma_in) { hw_error("Unconnected ETRAX-FS Ethernet MAC.\n"); @@ -632,10 +632,10 @@ static int fs_eth_init(SysBusDevice *sbd) } =20 static Property etraxfs_eth_properties[] =3D { - DEFINE_PROP_UINT32("phyaddr", struct fs_eth, phyaddr, 1), - DEFINE_PROP_PTR("dma_out", struct fs_eth, vdma_out), - DEFINE_PROP_PTR("dma_in", struct fs_eth, vdma_in), - DEFINE_NIC_PROPERTIES(struct fs_eth, conf), + DEFINE_PROP_UINT32("phyaddr", ETRAXFSEthState, phyaddr, 1), + DEFINE_PROP_PTR("dma_out", ETRAXFSEthState, vdma_out), + DEFINE_PROP_PTR("dma_in", ETRAXFSEthState, vdma_in), + DEFINE_NIC_PROPERTIES(ETRAXFSEthState, conf), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -651,7 +651,7 @@ static void etraxfs_eth_class_init(ObjectClass *klass= , void *data) static const TypeInfo etraxfs_eth_info =3D { .name =3D TYPE_ETRAX_FS_ETH, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(struct fs_eth), + .instance_size =3D sizeof(ETRAXFSEthState), .class_init =3D etraxfs_eth_class_init, }; =20 --=20 1.8.1.4