aboutsummaryrefslogtreecommitdiffstats
path: root/hw/rtl8139.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-16Rename pci_register_io_region() to pci_register_bar()Avi Kivity1-2/+2
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 <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16Remove io_index argument from cpu_register_io_memory()Avi Kivity1-1/+1
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 <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-10Merge branch 'net-queue'Anthony Liguori1-18/+21
* net-queue: (28 commits) virtio-net: Increase filter and control limits virtio-net: Add new RX filter controls virtio-net: MAC filter optimization virtio-net: Fix MAC filter overflow handling virtio-net: reorganize receive_filter() virtio-net: Use a byte to store RX mode flags virtio-net: Add version_id 7 placeholder for vnet header support virtio-net: implement rx packet queueing net: make use of async packet sending API in tap client net: add qemu_send_packet_async() net: split out packet queueing and flushing into separate functions net: return status from qemu_deliver_packet() net: add return value to packet receive handler net: pass VLANClientState* as first arg to receive handlers net: re-name vc->fd_read() to vc->receive() net: add fd_readv() handler to qemu_new_vlan_client() args net: only read from tapfd when we can send net: vlan clients with no fd_can_read() can always receive net: move the tap buffer into TAPState net: factor tap_read_packet() out of tap_send() ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-09Update irqs on reset and device loadBlue Swirl1-0/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09Register reset functions for e1000 and rtl8139Blue Swirl1-1/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-09net: add return value to packet receive handlerMark McLoughlin1-13/+16
This allows us to handle queue full conditions rather than dropping the packet on the floor. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-09net: pass VLANClientState* as first arg to receive handlersMark McLoughlin1-7/+7
Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-09net: re-name vc->fd_read() to vc->receive()Mark McLoughlin1-1/+1
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 <markmc@redhat.com>
2009-06-09net: add fd_readv() handler to qemu_new_vlan_client() argsMark McLoughlin1-1/+1
This, apparently, is the style we prefer - all VLANClientState should be an argument to qemu_new_vlan_client(). Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-05-14PCI network qdev conversionPaul Brook1-12/+11
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-03use PCI_HEADER_TYPE.Isaku Yamahata1-1/+1
use symbolic value instead of 0x0e and related value. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-05-01Pci nic: pci_register_device can failChris Wright1-0/+4
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 <mtosatti@redhat.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-04-17Introduce VLANClientState::cleanup() (Mark McLoughlin)aliguori1-1/+30
We're currently leaking memory and file descriptors on device hot-unplug. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7150 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-11qemu: return PCIDevice on net device init and record devfn (Marcelo Tosatti)aliguori1-1/+2
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 hot-removal. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6593 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-01Add and use #defines for PCI device classesblueswir11-2/+1
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 Signed-off-by: Stuart Brady <stuart.brady@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6491 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-26Define PCI vendor and device IDs in pci.h (Stuart Brady)aliguori1-6/+4
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() accessors as suggested by Anthony Liguori. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6442 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-13RTL8139: Latch C+ mode state instead of inferring it from C+ Command ↵aliguori1-3/+17
register (Avi Kivity) It was observed that Windows 2003 x64 hangs when shutting down if an RTL8139 NIC and a USB device tablet are both present. What seems to be happening is: - the guest shuts down the transmitter and receiver - time passes - the guest requests a tally counter dump As it happens, the tally counter command register overlaps the transmit status register in C mode. Qemu determines whether the chip is in C or C+ mode by looking at the C+ transmit enable bit; as this is now unset, the dump tally counter command is interpreted as a C mode transmit command. The guest doesn't think so, however, and continues to poll for completion of the tally counter dump command. This never occurs, so the guest hangs. Fix by redefining C+ mode as "a write to the C+ command register has occurred since the last reset". The data sheet is silent on the matter. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6279 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-07Add a -net name=foo parameter (Mark McLoughlin)aliguori1-1/+1
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 <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6220 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-07Add qemu_format_nic_info_str() (Mark McLoughlin)aliguori1-8/+1
Factor out a simple little function for formatting a NIC's info_str and make all NICs use it. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6218 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-07Add a model string to VLANClientState (Mark McLoughlin)aliguori1-2/+2
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(). Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6216 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-13Remove unnecessary trailing newlinesblueswir11-1/+0
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-26Fix undeclared symbol warnings from sparseblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-06Fix most warnings that would be caused by gcc flag -Wundefblueswir11-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5173 c046a42c-6fe2-441c-8c8c-71466251a162
2008-08-06Add qemu_realloc(), by Gerd Hoffmann.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4986 c046a42c-6fe2-441c-8c8c-71466251a162
2008-07-18Various NICs: Fix suspend/resume of multiple instances, by Jan Kiszka.ths1-2/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4892 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-13rtl8139: fix endianness on big endian targetsaurel321-26/+16
On big endian targets with mmio accesses, the values are not always swapped, depending on the accessed register. The Linux 8139too module was 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
2007-12-16qemu_put signedness fixes, by Andre Przywara.ths1-6/+6
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
2007-12-16Fix wrong signedness, by Andre Przywara.ths1-2/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-18Add statics and missing #includes for prototypes.pbrook1-5/+6
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-17Break up vl.h.pbrook1-1/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-09Fix typo, spotted by Samuel Thibault.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3558 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in ↵ths1-9/+9
the regex. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths1-26/+26
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-08-01Fix rtl8139 checksum calculation, by Tim Deegan.ths1-6/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3109 c046a42c-6fe2-441c-8c8c-71466251a162
2007-07-11Spelling fixes, by Stefan Weil.ths1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3066 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-07Unify IRQ handling.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-07Remove dead code.pbrook1-13/+6
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2632 c046a42c-6fe2-441c-8c8c-71466251a162
2007-03-19Fix big endian host operation, by Ben Taylor and Igor Kovalenko.ths1-3/+6
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2509 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-10Devfn number for network PCI cards, by Aurelien Jarno.ths1-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2314 c046a42c-6fe2-441c-8c8c-71466251a162
2006-08-17PCI save/restore changesbellard1-5/+11
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2115 c046a42c-6fe2-441c-8c8c-71466251a162
2006-07-10fixed for TCP segmentation offloading - removed dependency on slirp.h (Igor ↵bellard1-67/+268
Kovalenko) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2046 c046a42c-6fe2-441c-8c8c-71466251a162
2006-07-04rtl8139 fixes (Igor Kovalenko)bellard1-442/+837
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2035 c046a42c-6fe2-441c-8c8c-71466251a162
2006-07-01disable unimplemented C+ mode (aka windows xp 64 fix)bellard1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2032 c046a42c-6fe2-441c-8c8c-71466251a162
2006-02-05Allow selection of emulated network card.pbrook1-0/+2875
rtl8139 emulation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1745 c046a42c-6fe2-441c-8c8c-71466251a162