void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)

{

	struct etraxfs_dma_client *dma = NULL;	

	struct fs_eth *eth = NULL;



	qemu_check_nic_model(nd, "fseth");



	dma = qemu_mallocz(sizeof *dma * 2);

	eth = qemu_mallocz(sizeof *eth);



	dma[0].client.push = eth_tx_push;

	dma[0].client.opaque = eth;

	dma[1].client.opaque = eth;

	dma[1].client.pull = NULL;



	eth->dma_out = dma;

	eth->dma_in = dma + 1;



	/* Connect the phy.  */

	eth->phyaddr = phyaddr & 0x1f;

	tdk_init(&eth->phy);

	mdio_attach(&eth->mdio_bus, &eth->phy, eth->phyaddr);



	eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth);

	cpu_register_physical_memory (base, 0x5c, eth->ethregs);



	eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,

				       eth_can_receive, eth_receive, NULL,

				       eth_cleanup, eth);

	eth->vc->opaque = eth;

	eth->vc->link_status_changed = eth_set_link;



	return dma;

}

void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)

{

	struct etraxfs_dma_client *dma = NULL;	

	struct fs_eth *eth = NULL;



	qemu_check_nic_model(nd, "fseth");



	dma = qemu_mallocz(sizeof *dma * 2);

	eth = qemu_mallocz(sizeof *eth);



	dma[0].client.push = eth_tx_push;

	dma[0].client.opaque = eth;

	dma[1].client.opaque = eth;

	dma[1].client.pull = NULL;



	eth->dma_out = dma;

	eth->dma_in = dma + 1;



	

	eth->phyaddr = phyaddr & 0x1f;

	tdk_init(&eth->phy);

	mdio_attach(&eth->mdio_bus, &eth->phy, eth->phyaddr);



	eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth);

	cpu_register_physical_memory (base, 0x5c, eth->ethregs);



	eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,

				       eth_can_receive, eth_receive, NULL,

				       eth_cleanup, eth);

	eth->vc->opaque = eth;

	eth->vc->link_status_changed = eth_set_link;



	return dma;

}

	eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, 				       eth_can_receive, eth_receive, NULL, 				       eth_cleanup, eth);
void *FUNC_0(NICInfo *VAR_0, target_phys_addr_t VAR_1, int VAR_2)

{

	struct etraxfs_dma_client *VAR_3 = NULL;	

	struct fs_eth *VAR_4 = NULL;



	qemu_check_nic_model(VAR_0, "fseth");



	VAR_3 = qemu_mallocz(sizeof *VAR_3 * 2);

	VAR_4 = qemu_mallocz(sizeof *VAR_4);



	VAR_3[0].client.push = eth_tx_push;

	VAR_3[0].client.opaque = VAR_4;

	VAR_3[1].client.opaque = VAR_4;

	VAR_3[1].client.pull = NULL;



	VAR_4->dma_out = VAR_3;

	VAR_4->dma_in = VAR_3 + 1;



	

	VAR_4->VAR_2 = VAR_2 & 0x1f;

	tdk_init(&VAR_4->phy);

	mdio_attach(&VAR_4->mdio_bus, &VAR_4->phy, VAR_4->VAR_2);



	VAR_4->ethregs = cpu_register_io_memory(eth_read, eth_write, VAR_4);

	cpu_register_physical_memory (VAR_1, 0x5c, VAR_4->ethregs);



	VAR_4->vc = qemu_new_vlan_client(VAR_0->vlan, VAR_0->model, VAR_0->name,

				       eth_can_receive, eth_receive, NULL,

				       eth_cleanup, VAR_4);

	VAR_4->vc->opaque = VAR_4;

	VAR_4->vc->link_status_changed = eth_set_link;



	return VAR_3;

}

void *FUNC_0(NICInfo *VAR_0, target_phys_addr_t VAR_1, int VAR_2)
{ struct etraxfs_dma_client *VAR_3 = NULL; struct fs_eth *VAR_4 = NULL; qemu_check_nic_model(VAR_0, "fseth"); VAR_3 = qemu_mallocz(sizeof *VAR_3 * 2); VAR_4 = qemu_mallocz(sizeof *VAR_4); VAR_3[0].client.push = eth_tx_push; VAR_3[0].client.opaque = VAR_4; VAR_3[1].client.opaque = VAR_4; VAR_3[1].client.pull = NULL; VAR_4->dma_out = VAR_3; VAR_4->dma_in = VAR_3 + 1; VAR_4->VAR_2 = VAR_2 & 0x1f; tdk_init(&VAR_4->phy); mdio_attach(&VAR_4->mdio_bus, &VAR_4->phy, VAR_4->VAR_2); VAR_4->ethregs = cpu_register_io_memory(eth_read, eth_write, VAR_4); cpu_register_physical_memory (VAR_1, 0x5c, VAR_4->ethregs); VAR_4->vc = qemu_new_vlan_client(VAR_0->vlan, VAR_0->model, VAR_0->name,
eth_can_receive, eth_receive, NULL,
eth_cleanup, VAR_4); VAR_4->vc->opaque = VAR_4; VAR_4->vc->link_status_changed = eth_set_link; return VAR_3; }