Statistics
| Branch: | Revision:

root / hw / pcnet.c @ 2d6c1ef4

History | View | Annotate | Download (54.4 kB)

# Date Author Comment
7165448a 03/13/2011 03:24 pm William Dauchy

moving eeprom initialization

The initialization should not be only on reset but also when initializing
the device.
It resolves a bug when hot plugging a pci network device: the mac address
was always null.

Signed-off-by: William Dauchy <>...

219982ef 03/05/2011 03:07 pm Gerhard Wiesinger

hw/pcnet.c: Fix EPROM contents to suit AMD netware drivers

bugfix under DOS for AMD netware driver:
AMD PCNTNW Ethernet MLID v3.10 (960115), network card not found

bugfix works well under DOS with:
1.) AMD NDIS driver v2.0.1
2.) AMD PCNTNW Ethernet MLID v3.10 (960115)...

1ca4d09a 12/11/2010 11:32 pm Gleb Natapov

Add bootindex parameter to net/block/fd device

If bootindex is specified on command line a string that describes device
in firmware readable way is added into sorted list. Later this list will
be passed into firmware to control boot order.

Signed-off-by: Gleb Natapov <>...

a4c75a21 11/27/2010 01:23 pm Paul Brook

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 <>

c1ded3dc 11/21/2010 05:16 pm Jan Kiszka

pcnet: Do not receive external frames in loopback mode

While not explicitly stated in the spec, it was observed on real systems
that enabling loopback testing on the pcnet controller disables
reception of external frames. And some legacy software relies on it, so...

9dd749aa 07/11/2010 11:14 pm Michael S. Tsirkin

pcnet: address TODOs

pcnet enables memory/io on init, which
does not make sense as BAR values are wrong.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jan Kiszka <>

b80d4a98 07/11/2010 08:00 pm Isaku Yamahata

pci: don't overwrite multi functio bit in pci header type.

Don't overwrite pci header type.
Otherwise, multi function bit which pci_init_header_type() sets
appropriately is lost.
Anyway PCI_HEADER_TYPE_NORMAL is zero, so it is unnecessary to zero
which is already zero cleared....

7a7e5db9 03/15/2010 01:52 pm Michael S. Tsirkin

pcnet: make subsystem vendor id match hardware

Real pcnet device (AT2450) apparently has subsystem
device and vendor id set to 0, this is out of spec
(which requires that vendor id is obtained from PCI SIG)
but windows xp driver seems to need this in order...

1a8e2aaa 03/08/2010 07:30 pm Chris Kilgour

pcnet APROMWE bit location (retry)

According to AMD document 21485D pp.141, APROMWE is bit 8 of BCR2.

Signed-off-by: Christopher Kilgour <>
Signed-off-by: Anthony Liguori <>

884a0c76 01/13/2010 08:59 pm Blue Swirl

pcnet: remove dead nested assignment, spotted by clang

Although the value stored to 'addr' is used in the enclosing expression,
the value is never actually read from 'addr'.

Probably a typo.

Signed-off-by: Blue Swirl <>

97526229 12/23/2009 04:35 pm Michael S. Tsirkin

pcnet: switch to symbolic names for pci registers

No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <>
Acked-by: Juan Quintela <>
Acked-by: Glauber Costa <>

be73cfe2 12/03/2009 06:05 pm Juan Quintela

savevm: Port to qdev.vmsd all devices that have qdev

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

1fa51482 12/03/2009 05:41 pm Mark McLoughlin

net: convert pcnet to NICState

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

6e355d90 11/09/2009 04:43 pm Isaku Yamahata

pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t

This patch is preliminary for 64 bit BAR support.
Introduce dedicated type, pcibus_t, to represent pci bus address/size
instead of uint32_t.
Later this type will be changed to uint64_t....

89e8b13c 11/09/2009 04:43 pm Isaku Yamahata

pci: introduce FMT_PCIBUS for printf format for pcibus_t.

This patch is preliminary for 64bit BAR.
Later pcibus_t will be changed from uint32_t to uint64_t.
Introduce FMT_PCIBUS for printf format for pcibus_t.

Signed-off-by: Isaku Yamahata <>...

0392a017 11/09/2009 04:43 pm Isaku Yamahata

pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h

make constants for pci base address match pci_regs.h by
renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.

Signed-off-by: Isaku Yamahata <>
Acked-by: Michael S. Tsirkin <>...

a01d6ef4 11/07/2009 10:55 am Blue Swirl

sparc32 (mostly): remove unneeded calls to device reset

Signed-off-by: Blue Swirl <>

3d865059 10/27/2009 07:28 pm Juan Quintela

pcnet: port to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

94e1a912 10/27/2009 07:28 pm Gerd Hoffmann

pcnet: split away lance.c (sparc32 code).

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

76224833 10/27/2009 07:28 pm Gerd Hoffmann

pcnet: use qdev properties for configuration.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

de41ac92 10/15/2009 05:32 pm Jan Kiszka

pcnet: Extend hardware reset

Update the IRQ state and stop the poll timer on reset. Moreover,
register the reset function with qemu.

Patchworks-ID: 35462
Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

ad323081 10/09/2009 05:17 am Jan Kiszka

pcnet: Restart poll timer on pcnet_start

Just like we call into pcnet_poll_timer on stop, we need to call it on
start to trigger the setup of the poll timer.

Patchworks-ID: 35313
Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

efb56cf7 10/09/2009 05:17 am Jan Kiszka

pcnet: Drop unused recv_pos field

This state field was never used, simply remained 0. Drop it from the
PCNetState and update the save/restore code accordingly, keeping
backward compatibility.

Patchworks-ID: 35314
Signed-off-by: Jan Kiszka <>...

e3936fa5 10/05/2009 05:32 pm Gerd Hoffmann

pci: move unregister from PCIDevice to PCIDeviceInfo

One more cleanup while being at it ;)

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

c227f099 10/02/2009 12:12 am Anthony Liguori

Revert "Get rid of _t suffix"

In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem. Something
like this must be presented on the list first so people can provide input...

99a0949b 10/01/2009 09:45 pm malc

Get rid of _t suffix

Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <>

6ee093c9 09/11/2009 06:19 pm Juan Quintela

Unexport ticks_per_sec variable. Create get_ticks_per_sec() function

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

1f235a73 08/28/2009 04:47 am Juan Quintela

pcnet: Change casts to DO_UPCAST() for PCIPCNetState

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

9fdab57b 08/28/2009 04:47 am Juan Quintela

pcnet: remove useless casts This are casts to the very type of the function

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

0abaa7c1 08/28/2009 04:47 am Juan Quintela

pcnet: Add pci_pcnet_{save/load} functions, then remove PCNetState pci_dev field

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

81a322d4 08/28/2009 04:43 am Gerd Hoffmann

qdev: add return value to init() callbacks.

Sorry folks, but it has to be. One more of these invasive qdev patches.

We have a serious design bug in the qdev interface: device init
callbacks can't signal failure because the init() callback has no
return value. This patch fixes it....

d60efc6b 08/25/2009 09:29 pm Blue Swirl

Make CPURead/WriteFunc structure 'const'

Signed-off-by: Blue Swirl <>

186507b4 08/10/2009 09:05 pm Gerd Hoffmann

qdev/prop: convert pcnet.c to helper macros.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>
Message-Id:

ee6847d1 07/17/2009 01:28 am Gerd Hoffmann

qdev: rework device properties.

This patch is a major overhaul of the device properties. The properties
are saved directly in the device state struct now, the linked list of
property values is gone.

Advantages: * We don't have to maintain the list with the property values....

0aab0d3a 07/09/2009 03:07 pm Gerd Hoffmann

qdev: update pci device registration.

Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch
of parameters. Also adds config_read and config_write callbacks to
PCIDeviceInfo, so drivers needing these can be converted to the qdev
device API too....

28c2c264 06/16/2009 11:18 pm Avi Kivity

Rename pci_register_io_region() to pci_register_bar()

This function is used to manage a PCI BAR, so make the more generic
pci_register_io_region() available to other uses.

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

1eed09cb 06/16/2009 11:18 pm Avi Kivity

Remove io_index argument from cpu_register_io_memory()

The parameter is always zero except when registering the three internal
io regions (ROM, unassigned, notdirty). Remove the parameter to reduce
the API's power, thus facilitating future change.

Signed-off-by: Avi Kivity <>...

463af534 06/09/2009 01:38 pm Mark McLoughlin

net: add fd_readv() handler to qemu_new_vlan_client() args

This, apparently, is the style we prefer - all VLANClientState
should be an argument to qemu_new_vlan_client().

Signed-off-by: Mark McLoughlin <>

cda9046b 06/09/2009 01:38 pm Mark McLoughlin

net: re-name vc->fd_read() to vc->receive()

VLANClientState's fd_read() handler doesn't read from file
descriptors, it adds a buffer to the client's receive queue.

Re-name the handlers to make things a little less confusing.

Signed-off-by: Mark McLoughlin <>

e3f5ec2b 06/09/2009 01:38 pm Mark McLoughlin

net: pass VLANClientState* as first arg to receive handlers

Give static type checking a chance to catch errors.

Signed-off-by: Mark McLoughlin <>

4f1c942b 06/09/2009 01:38 pm Mark McLoughlin

net: add return value to packet receive handler

This allows us to handle queue full conditions rather than dropping
the packet on the floor.

Signed-off-by: Mark McLoughlin <>

067a3ddc 05/26/2009 04:56 pm Paul Brook

Remove qdev irq sink handling

We have both IRQ sinks and GPIO inputs. These are in principle exactly
the same thing, so remove the former.

Signed-off-by: Paul Brook <>

4856fcff 05/22/2009 07:44 pm Paul Brook

Fix lance segfaults

Signed-off-by: Paul Brook <>

9d07d757 05/15/2009 12:35 am Paul Brook

PCI network qdev conversion

Signed-off-by: Paul Brook <>

6407f373 05/03/2009 10:03 pm Isaku Yamahata

use PCI_HEADER_TYPE.

use symbolic value instead of 0x0e and related value.

Signed-off-by: Isaku Yamahata <>

aff427a1 05/01/2009 05:47 pm Chris Wright

Pci nic: pci_register_device can fail

The pci_register_device() call in PCI nic initialization routines can
fail. Handle this failure and propagate a meaningful error message to
the user instead of generating a SEGV.

Cc: Marcelo Tosatti <>...

b946a153 04/17/2009 08:11 pm aliguori

Introduce VLANClientState::cleanup() (Mark McLoughlin)

We're currently leaking memory and file descriptors on device
hot-unplug.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7150 c046a42c-6fe2-441c-8c8c-71466251a162

f1afe02a 04/09/2009 01:56 am aurel32

pcnet: Avoid double conversion via PHYSADDR

rdra and tdra are already kept converted in the pcnet state structure.
Avoid converting derivatives a second time. The same case with the local
variable xmit_cxda: it already contains a converted cxda address. This...

72da4208 02/11/2009 05:19 pm aliguori

qemu: return PCIDevice on net device init and record devfn (Marcelo Tosatti)

Change the PCI network drivers init functions to return the PCIDev, to
inform which slot has been hot-plugged.

Also record PCIDevice structure on NICInfo to locate for release on...

487414f1 02/06/2009 12:06 am aliguori

hw: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162

173a543b 02/01/2009 09:26 pm blueswir1

Add and use #defines for PCI device classes

This patch adds and uses #defines for PCI device classes and subclases,
using a new pci_config_set_class() function, similar to the recently
added pci_config_set_vendor_id() and pci_config_set_device_id().

Change since v1: fixed compilation of hw/sun4u.c...

deb54399 01/26/2009 05:37 pm aliguori

Define PCI vendor and device IDs in pci.h (Stuart Brady)

This patch defines PCI vendor and device IDs in pci.h (matching those
from Linux's pci_ids.h), and uses those definitions where appropriate.

Change from v1:
Introduces pci_config_set_vendor_id() / pci_config_set_device_id()...

5653494a 01/17/2009 10:47 pm blueswir1

Remove unused info_str parameter to pcnet_common_init()

I noticed that pcnet_common_init() takes an unused 'info_str'
parameter, added in r2142. Since then, we always pass "pcnet"
to register_savevm() (and never "lance").

Note that r6218 changed vc->info_str to "lance" for sun4m emulation....

0ae18cee 01/13/2009 09:39 pm aliguori

Check NIC model in some NIC init functions (Mark McLoughlin)

Some NIC init functions are only called when that model is
the only valid model. In that case, it makes sense to use
qemu_check_nic_model() from the NIC init function itself.

Signed-off-by: Mark McLoughlin <>...

7a9f6e4a 01/07/2009 07:48 pm aliguori

Add a -net name=foo parameter (Mark McLoughlin)

Allow the user to supply a vlan client name on the command line.

This is probably only useful for management tools so that they can
use their own names rather than parsing the output of 'info network'.

Signed-off-by: Mark McLoughlin <>...

7cb7434b 01/07/2009 07:46 pm aliguori

Add qemu_format_nic_info_str() (Mark McLoughlin)

Factor out a simple little function for formatting a NIC's
info_str and make all NICs use it.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6218 c046a42c-6fe2-441c-8c8c-71466251a162

bf38c1a0 01/07/2009 07:42 pm aliguori

Add a model string to VLANClientState (Mark McLoughlin)

Don't lose track of what type/model a vlan client is so that we can
e.g. assign a global per-model id to clients.

The entire patch is basically a tedious excercise in making sure the
type/model string gets propagated down to qemu_new_vlan_client()....

e64d7d59 12/02/2008 07:47 pm blueswir1

Remove address masking

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5853 c046a42c-6fe2-441c-8c8c-71466251a162

b6c4f71f 10/02/2008 10:14 pm blueswir1

Resurrect the safe part of r5274

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5401 c046a42c-6fe2-441c-8c8c-71466251a162

2ca83a8d 09/25/2008 11:24 pm blueswir1

Revert r5274 which breaks savevm/loadvm

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5321 c046a42c-6fe2-441c-8c8c-71466251a162

67d8cec3 09/20/2008 11:04 am blueswir1

Add signed versions of save/load functions

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5274 c046a42c-6fe2-441c-8c8c-71466251a162

841c26a0 09/04/2008 07:35 am aurel32

hw/pcnet: use qemu_socket.h

(Jan Kiszka)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5149 c046a42c-6fe2-441c-8c8c-71466251a162

d317b92d 09/03/2008 02:26 am aurel32

hw/pcnet.c: windows compile fix

(Eduardo Felipe)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5140 c046a42c-6fe2-441c-8c8c-71466251a162

89b190a2 09/02/2008 07:18 pm aurel32

pcnet: add loopback mode emulation

This patch enhances the pcnet NIC emulation with better loopback mode
support, including CRC generation for looped-back packets in "raw" mode.
The patch has practically no impact on the normal RX and TX path.

Successfully tested against an ancient proprietary pcnet driver that...

cb3df91a 07/20/2008 06:22 pm blueswir1

Fix debug message address formats

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4910 c046a42c-6fe2-441c-8c8c-71466251a162

3c924ac0 07/20/2008 06:21 pm blueswir1

Fix wrong function names in debug messages (Stefan Weil)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4909 c046a42c-6fe2-441c-8c8c-71466251a162

18fdb1c5 07/18/2008 09:02 pm ths

Various NICs: Fix suspend/resume of multiple instances, by Jan Kiszka.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4892 c046a42c-6fe2-441c-8c8c-71466251a162

9bd0d294 04/20/2008 01:59 pm blueswir1

PCnet: Allow more then two TMDs (Jan Kiszka)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4225 c046a42c-6fe2-441c-8c8c-71466251a162

7c560456 01/01/2008 07:06 pm blueswir1

Register only valid register access widths

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3881 c046a42c-6fe2-441c-8c8c-71466251a162

69b34976 12/17/2007 05:15 am ths

Fix miscellaneous minor things, by Andre Przywara.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3826 c046a42c-6fe2-441c-8c8c-71466251a162

bee8d684 12/17/2007 01:41 am ths

qemu_put signedness fixes, by Andre Przywara.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162

87ecb68b 11/17/2007 07:14 pm pbrook

Break up vl.h.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162

3b46e624 09/17/2007 11:09 am ths

find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162

5fafdf24 09/17/2007 12:08 am ths

find -type f | xargs sed -i 's/[\t ]$//g' # on most files

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162

7f27bae6 08/18/2007 04:08 pm ths

Remove obsolete comment.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3122 c046a42c-6fe2-441c-8c8c-71466251a162

2d069bab 08/16/2007 10:56 pm blueswir1

Use qemu_irq for a reset signal between DMA and ESP/Lance

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3120 c046a42c-6fe2-441c-8c8c-71466251a162

5a84a5dd 06/28/2007 06:28 pm blueswir1

Fix Lance on 32-bit hosts

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3033 c046a42c-6fe2-441c-8c8c-71466251a162

dbe06e18 05/27/2007 10:38 pm blueswir1

Handle unconnected vlan case in lance

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2878 c046a42c-6fe2-441c-8c8c-71466251a162

70c0de96 05/27/2007 07:36 pm blueswir1

Use qemu_irqs between dma controllers and esp, lance

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2873 c046a42c-6fe2-441c-8c8c-71466251a162

5aca8c3b 05/26/2007 08:39 pm blueswir1

Split DMA controller in two
Fix register size related bugs

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2869 c046a42c-6fe2-441c-8c8c-71466251a162

5dcb6b91 05/19/2007 03:58 pm blueswir1

Use full 36-bit physical address space on SS10

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2830 c046a42c-6fe2-441c-8c8c-71466251a162

d537cf6c 04/07/2007 09:14 pm pbrook

Unify IRQ handling.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162

6d2980f5 03/06/2007 08:56 pm ths

Fix unportable bitfields use which broke pcnet for big endian hosts.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2469 c046a42c-6fe2-441c-8c8c-71466251a162

abcebc7e 01/10/2007 06:17 pm ths

Devfn number for network PCI cards, by Aurelien Jarno.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2314 c046a42c-6fe2-441c-8c8c-71466251a162

9b94dc32 09/03/2006 10:48 pm bellard

better PCNET endianness support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2147 c046a42c-6fe2-441c-8c8c-71466251a162

03c18475 09/03/2006 07:40 pm bellard

endianness fixes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2144 c046a42c-6fe2-441c-8c8c-71466251a162

91cc0295 09/03/2006 07:07 pm bellard

initial sparc32 lance and pcnet merge

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2142 c046a42c-6fe2-441c-8c8c-71466251a162

29b9a345 07/14/2006 12:40 pm bellard

win32 compilation fixes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2052 c046a42c-6fe2-441c-8c8c-71466251a162

ec607da7 07/14/2006 02:25 am bellard

avoid recursive tx

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2050 c046a42c-6fe2-441c-8c8c-71466251a162

219fb125 07/05/2006 12:42 am bellard

avoid unneeded dependencies

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2041 c046a42c-6fe2-441c-8c8c-71466251a162

e3c2613f 07/04/2006 02:33 pm bellard

pcnet nic support (Antony T Curtis)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2036 c046a42c-6fe2-441c-8c8c-71466251a162