History | View | Annotate | Download (100 kB)
rtl8139: Use PCI DMA stub functions
This updates the rtl8139 device emulation to use the explicit PCI DMAfunctions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pci: interrupt pin documentation update
Fix up some erroneous comments in code:interrupt pins are named A-D, theinterrupt pin register is always readonlyand isn't zeroed out on reset.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: rename pci_register_bar_region() to pci_register_bar()
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>
rtl8139: convert to memory API
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
hw/rtl8139.c: convert to PCIDeviceInfo to initialize ids
use PCIDeviceInfo to initialize ids.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fix typo in code and comments
Replace writeable -> writable
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
rtl8139: Fix compilation for w32/w64
Compilation for Windows needs a different declaration for theprintf format attribute, so use the macro which was defined forthis purpose.
Cc: Benjamin Poirier <benjamin.poirier@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
rtl8139: add format attribute to DPRINTF
gcc can check the format string for correctness even when debugging output isnot enabled.Have to make sure arguments are always available. They are optimized out ifunneeded.
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>...
rtl8139: use variadic macro for debug statements
Removes double (( )) to make DEBUG_PRINT compatible with real function calls.Change the name to DPRINTF to be consistent with other DPRINTF macrosthroughout qemu.Include the "RTL8139: " prefix in the macro. This changes some debug output...
rtl8139: use TARGET_FMT_plx in debug messages
Prevents a compilation failure when DEBUG_RTL8139 is defined:
CC libhw32/rtl8139.occ1: warnings being treated as errorshw/rtl8139.c: In function ‘rtl8139_cplus_transmit_one’:hw/rtl8139.c:1960: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 5 has type ‘target_phys_addr_t’...
PXE: Use consistent naming for PXE ROMs
And add missing ROMs to tarbin build target.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
rtl8139: convert to pci_register_bar_simple()
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
rtl8139: add vlan tag insertion
Add support to the emulated hardware to insert vlan tags in packetsgoing from the guest to the network.
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Cc: Jason Wang <jasowang@redhat.com>...
rtl8139: add vlan tag extraction
Add support to the emulated hardware to extract vlan tags in packetsgoing from the network to the guest.
rtl8139: cleanup FCS calculation
clean out ifdef's around ethernet checksum calculation
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>Acked-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Cc: Jason Wang <jasowang@redhat.com>Cc: Michael S. Tsirkin <mst@redhat.com>...
change all other clock references to use nanosecond resolution accessors
This was done with:
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
moving eeprom initialization
The initialization should not be only on reset but also when initializingthe device.It resolves a bug when hot plugging a pci network device: the mac addresswas always null.
Signed-off-by: William Dauchy <wdauchy@gmail.com>...
rtl8139: Use subsection to restrict migration after hotplug
rtl8139 includes a cpu_register_io_memory acquired value in it'smigration data. This is not only unecessary, but we should treatthese values as unique to the VM instances since the value depends...
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
rtl8139: Declare as little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
Because we don't depend on the target endianness anymore, we can alsomove the driver over to Makefile.objs.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
rtl8139: address TODOs
Make rtl8139 spec compliant, fixing reset valuesfor command register.
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() setsappropriately is lost.Anyway PCI_HEADER_TYPE_NORMAL is zero, so it is unnecessary to zerowhich is already zero cleared....
rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeoutirq wanted and timer set).
This patch is required for Darwin. Patch has been tested underFreeBSD, Darwin and Linux.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>...
rtl8139: fix clang reporting unused assignment of VLAN tagging data
Currently we do not implement VLAN tagging for rtl8139(C+),still data is read from ring buffer headers.
- augment unused assignment with TODO item- cast txdw1 to void for now
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>...
rtl: switch to symbolic names for pci registers
No functional changes. I verified that the generated binarydoes not change.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
Support PCI based option rom loading
Currently, we preload option roms into the option rom space in memory. Thisprevents DDIM from functioning correctly which severely limits the numberof roms we can support.
This patch introduces a pci_add_option_rom() which registers the...
pci romfiles: add property, add default to PCIDeviceInfo
This patch adds a romfile property to the pci bus. It allows to specifya romfile to load into the rom bar of the pci device. The default valuecomes from a new field in PCIDeviceInfo. The property allows to change...
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: convert rtl8139 to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix qemu_malloc/qemu_free use in rtl8139.c
rtl8139.c is using malloc()/free() instead of qemu_malloc()/qemu_free().Fix it.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
v3: don't call reset functions on cpu initialization
There is absolutely no need to call reset functions when initializingdevices. Since we are already registering them, calling qemu_system_reset()should suffice. Actually, it is what happens when we reboot the machine,...
rtl8139: port to vmstate
rtl8139: port TallyCounters to vmstate
rtl8139: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them asDeviceState * rather than void *.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
qdev: convert rtl8139 to reset
rtl8139: Remove unneeded double indirection of PCIRTL8139State
rtl8139: remove pointless cast from void *
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 initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
Make CPURead/WriteFunc structure 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix Sparse warnings: "Using plain integer as NULL pointer"
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunchof parameters. Also adds config_read and config_write callbacks toPCIDeviceInfo, so drivers needing these can be converted to the qdevdevice API too....
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Revert "Update irqs on reset and device load"
This reverts commit 3dcd219f09d6c1817bf9a132899e6b925f7a0914.
It is incorrect to call qemu_irq functions (or any other functions thataccess other device state) during savevm/loadvm.
Rename pci_register_io_region() to pci_register_bar()
This function is used to manage a PCI BAR, so make the more genericpci_register_io_region() available to other uses.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Merge branch 'net-queue'
Update irqs on reset and device load
Register reset functions for e1000 and rtl8139
net: add fd_readv() handler to qemu_new_vlan_client() args
This, apparently, is the style we prefer - all VLANClientStateshould be an argument to qemu_new_vlan_client().
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
net: re-name vc->fd_read() to vc->receive()
VLANClientState's fd_read() handler doesn't read from filedescriptors, it adds a buffer to the client's receive queue.
Re-name the handlers to make things a little less confusing.
net: pass VLANClientState* as first arg to receive handlers
Give static type checking a chance to catch errors.
net: add return value to packet receive handler
This allows us to handle queue full conditions rather than droppingthe packet on the floor.
PCI network qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
use PCI_HEADER_TYPE.
use symbolic value instead of 0x0e and related value.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Pci nic: pci_register_device can fail
The pci_register_device() call in PCI nic initialization routines canfail. Handle this failure and propagate a meaningful error message tothe user instead of generating a SEGV.
Cc: Marcelo Tosatti <mtosatti@redhat.com>...
Introduce VLANClientState::cleanup() (Mark McLoughlin)
We're currently leaking memory and file descriptors on devicehot-unplug.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7150 c046a42c-6fe2-441c-8c8c-71466251a162
qemu: return PCIDevice on net device init and record devfn (Marcelo Tosatti)
Change the PCI network drivers init functions to return the PCIDev, toinform which slot has been hot-plugged.
Also record PCIDevice structure on NICInfo to locate for release on...
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 recentlyadded pci_config_set_vendor_id() and pci_config_set_device_id().
Change since v1: fixed compilation of hw/sun4u.c...
Define PCI vendor and device IDs in pci.h (Stuart Brady)
This patch defines PCI vendor and device IDs in pci.h (matching thosefrom 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()...
RTL8139: Latch C+ mode state instead of inferring it from C+ Command register (Avi Kivity)
It was observed that Windows 2003 x64 hangs when shutting down if anRTL8139 NIC and a USB device tablet are both present. What seems to behappening is:
- the guest shuts down the transmitter and receiver...
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 canuse their own names rather than parsing the output of 'info network'.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
Add qemu_format_nic_info_str() (Mark McLoughlin)
Factor out a simple little function for formatting a NIC'sinfo_str and make all NICs use it.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6218 c046a42c-6fe2-441c-8c8c-71466251a162
Add a model string to VLANClientState (Mark McLoughlin)
Don't lose track of what type/model a vlan client is so that we cane.g. assign a global per-model id to clients.
The entire patch is basically a tedious excercise in making sure thetype/model string gets propagated down to qemu_new_vlan_client()....
Remove unnecessary trailing newlines
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
Fix undeclared symbol warnings from sparse
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
Fix most warnings that would be caused by gcc flag -Wundef
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5173 c046a42c-6fe2-441c-8c8c-71466251a162
Add qemu_realloc(), by Gerd Hoffmann.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4986 c046a42c-6fe2-441c-8c8c-71466251a162
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
rtl8139: fix endianness on big endian targets
On big endian targets with mmio accesses, the values are not alwaysswapped, depending on the accessed register. The Linux 8139too modulewas able to cope with that, but not the 8139cp one.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4045 c046a42c-6fe2-441c-8c8c-71466251a162
qemu_put signedness fixes, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
Fix wrong signedness, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
Add statics and missing #includes for prototypes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
Fix typo, spotted by Samuel Thibault.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3558 c046a42c-6fe2-441c-8c8c-71466251a162
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
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
Fix rtl8139 checksum calculation, by Tim Deegan.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3109 c046a42c-6fe2-441c-8c8c-71466251a162
Spelling fixes, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3066 c046a42c-6fe2-441c-8c8c-71466251a162
Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
Remove dead code.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2632 c046a42c-6fe2-441c-8c8c-71466251a162
Fix big endian host operation, by Ben Taylor and Igor Kovalenko.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2509 c046a42c-6fe2-441c-8c8c-71466251a162
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
PCI save/restore changes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2115 c046a42c-6fe2-441c-8c8c-71466251a162
fixed for TCP segmentation offloading - removed dependency on slirp.h (Igor Kovalenko)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2046 c046a42c-6fe2-441c-8c8c-71466251a162
rtl8139 fixes (Igor Kovalenko)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2035 c046a42c-6fe2-441c-8c8c-71466251a162
disable unimplemented C+ mode (aka windows xp 64 fix)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2032 c046a42c-6fe2-441c-8c8c-71466251a162
Allow selection of emulated network card.rtl8139 emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1745 c046a42c-6fe2-441c-8c8c-71466251a162