Commit Graph

9 Commits

Author SHA1 Message Date
Jan Kiszka
ef45c9147f pcnet: Properly handle TX requests during Link Fail
As long as we have no link and we aren't in internal loopback mode, no
packet must be sent. Instead, LCAR needs to be set in any active TX
descriptor and also CERR in CSR0.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-04-16 15:41:28 +02:00
Jan Kiszka
e1c2008af6 pcnet: Add link state support
Update lnkst on link state changes so that guests can obtain this
information via reading back the LED output pin. Works for Linux but
not for guests that depend on the missing PHY.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01 16:52:09 -05:00
Jan Kiszka
488a1a5dfe pcnet: Move BCR defines to header
This moves BCR defines to the common header and immediately makes use of
them to add BCR_APROMWE, replacing the open-coded write check in
pcnet_aprom_writeb.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01 16:52:09 -05:00
Blue Swirl
fe87aa83c6 pcnet: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct PCNetState_st {
...
	uint16_t                   bcr[32];              /*   340    64 */

	/* XXX 4 bytes hole, try to pack */
...
	int                        tx_busy;              /*  4520     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   irq;                  /*  4528     8 */
	void                       (*phys_mem_read)(void *, target_phys_addr_t, uint8_t *, int, int); /*  4536     8 */
	/* --- cacheline 71 boundary (4544 bytes) --- */
	void                       (*phys_mem_write)(void *, target_phys_addr_t, uint8_t *, int, int); /*  4544     8 */
	void *                     dma_opaque;           /*  4552     8 */
	int                        looptest;             /*  4560     4 */

	/* size: 4568, cachelines: 72 */
	/* sum members: 4556, holes: 2, sum holes: 8 */
	/* padding: 4 */
	/* last cacheline: 24 bytes */
};	/* definitions: 2 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:38 +00:00
Avi Kivity
bd8d6f7cad pcnet: convert to memory API
Also related chips.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08 10:22:29 -05:00
Paul Brook
a4c75a21f3 Split out common pcnet code
The core pcnet emulation code is used by both the PCI "pcnet" device
and the SPARC "lance" device.  Split the common code frm the PCI code so
that that can be configures independantly.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-11-27 11:23:34 +00:00
Mark McLoughlin
1fa5148223 net: convert pcnet to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:31 -06:00
Juan Quintela
3d8650597d pcnet: port to vmstate
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27 12:28:52 -05:00
Gerd Hoffmann
94e1a912b2 pcnet: split away lance.c (sparc32 code).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27 12:28:40 -05:00