summaryrefslogtreecommitdiffstats
path: root/hw/e1000.c
Commit message (Collapse)AuthorAgeFilesLines
* Change #define DEBUG to #define E1000_DEBUG in hw/e1000.cJes Sorensen2010-06-141-2/+2
| | | | | | | | Change #define DEBUG to #define E1000_DEBUG in hw/e1000.c to make it possible to build QEMU with -DDEBUG Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: make some tables 'const'Blue Swirl2010-05-141-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* e1000: fix build on Ubuntu with _FORTIFY_SOURCEThomas Monjalon2010-04-081-1/+1
| | | | | | | | | | There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled. _FORTIFY_SOURCE had been disabled by 4a24470497360d8b77568b83008d0e9d6eb0787d and reenabled by 849583050d5f6f782718be8cb50688978973fbea. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2010-01-061-4/+7
|\
| * e1000: switch to symbolic names for pci registersMichael S. Tsirkin2009-12-231-4/+7
| | | | | | | | | | | | | | | | | | No functional changes. I verified that the generated object binary does 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>
* | e1000: add link to data sheetMichael S. Tsirkin2009-12-231-0/+3
|/ | | | | | | Link to data sheet at intel.com so people can find it. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* e1000: Don't muck with PCI commmand registerAnthony Liguori2009-12-191-1/+0
| | | | | | | | | Otherwise, the driver does not work in Linux after the INT_DISABLE changes in PCI. Michael Tsirkin had a patch to do this, I'm not sure what happened to it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci romfiles: add property, add default to PCIDeviceInfoGerd Hoffmann2009-12-181-8/+1
| | | | | | | | | | This patch adds a romfile property to the pci bus. It allows to specify a romfile to load into the rom bar of the pci device. The default value comes from a new field in PCIDeviceInfo. The property allows to change the file and also to disable the rom loading using an empty string. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Support PCI based option rom loadingAnthony Liguori2009-12-181-1/+1
| | | | | | | | | | | | | | | | | Currently, we preload option roms into the option rom space in memory. This prevents DDIM from functioning correctly which severely limits the number of roms we can support. This patch introduces a pci_add_option_rom() which registers the PCI_ROM_ADDRESS bar which points to our option rom. It also converts over the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this new mechanism. The result is that PXE boot functions even with three unique types of cards. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: Fix warning from code reviewStefan Weil2009-12-031-1/+3
| | | | | | | | | | | | | A code review run by Steve Grubb complained about code in e1000.c: In hw/e1000.c at line 89, vlan is declared to be 4 bytes. At line 382 is an attempt to do a memmove over it with a size of 12. This was fixed by splitting the memmove in two calls and adding a comment to the declaration of vlan and data. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* savevm: Port to qdev.vmsd all devices that have qdevJuan Quintela2009-12-031-3/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: convert e1000 to NICStateMark McLoughlin2009-12-031-21/+26
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000 fix: read access to some registers is missing.Kay Ackermann2009-11-121-0/+2
| | | | | | | | | While writing working on an e1000 driver for my university's OS I noticed that some registers aren't readable in QEMU, but they should be readable as stated in Intels Driver Developer Manual (and also verified on real hardware). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: introduce FMT_PCIBUS for printf format for pcibus_t.Isaku Yamahata2009-11-091-2/+4
| | | | | | | | | | 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 <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: introduce pcibus_t to represent pci bus address/size instead of uint32_tIsaku Yamahata2009-11-091-3/+3
| | | | | | | | | | | 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. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.hIsaku Yamahata2009-11-091-2/+2
| | | | | | | | | 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 <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* v3: don't call reset functions on cpu initializationGlauber Costa2009-11-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | There is absolutely no need to call reset functions when initializing devices. Since we are already registering them, calling qemu_system_reset() should suffice. Actually, it is what happens when we reboot the machine, and using the same process instead of a special case semantics will even allow us to find bugs easier. Furthermore, the fact that we initialize things like the cpu quite early, leads to the need to introduce synchronization stuff like qemu_system_cond. This patch removes it entirely. All we need to do is call qemu_system_reset() only when we're already sure the system is up and running I tested it with qemu (with and without io-thread) and qemu-kvm, and it seems to be doing okay - although qemu-kvm uses a slightly different patch. [ v2: user mode still needs cpu_reset, so put it in ifdef. ] [ v3: leave qemu_system_cond for now. ] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove e1000 rom loading hackAnthony Liguori2009-10-301-2/+0
| | | | | | The gPXE rom supports BEV properly. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: move net-checksum.c under net/Mark McLoughlin2009-10-301-0/+1
| | | | | | | Also add a new net/checksum.h header Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: port to vmstateJuan Quintela2009-10-271-163/+81
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: unfold mac_regarraystosave arrayJuan Quintela2009-10-271-16/+14
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: unfold mac_reg_tosave arrayJuan Quintela2009-10-271-13/+74
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* e1000: use qdev properties for configuration.Gerd Hoffmann2009-10-271-11/+38
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: move unregister from PCIDevice to PCIDeviceInfoGerd Hoffmann2009-10-051-1/+1
| | | | | | | One more cleanup while being at it ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-9/+9
| | | | | | | | | | | | 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 and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-9/+9
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* e1000 cleanupJuan Quintela2009-08-271-5/+5
| | | | | | | | Remove un needed casts from void *. Use DO_UPCAST() instead of blind casts Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: add return value to init() callbacks.Gerd Hoffmann2009-08-271-1/+2
| | | | | | | | | | | | | | | | | | 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. We have already one case in-tree where this is needed: Try -device virtio-blk-pci (without drive= specified) and watch qemu segfault. This patch fixes it. With usb+scsi being converted to qdev we'll get more devices where the init callback can fail for various reasons. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make CPURead/WriteFunc structure 'const'Blue Swirl2009-08-251-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* e1000.c doesn't properly emulate EERD and ICS registersBill Paul2009-07-301-4/+9
| | | | | | | | | | | | | | | Once again, the emulation of the EERD and ICS registers in e1000.c is incorrect. Nobody has noticed this before because none of the Intel-written e1000 drivers use these registers, and all of the independently written open source drivers copy Intel's example, so they don't use them either. Regardless, these registers are documented in the programmer's manuals, and their emulated behavior doesn't match the verified behavior of real hardware, so any software that does use them doesn't function correctly. -Bill Signed-off-by: Bill Paul <wpaul@windriver.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix for bad macaddr of e1000 in Windows 2003 server with original MS driverNaphtali Sprei2009-07-161-0/+5
| | | | | | | | | The sequence of reading from eeprom is "offset by one" moved because of a false detection of a clock cycle after an eeprom reset. Keeping the last clock value after a reset keeps it in sync. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Update to a hopefully more future proof FSF addressBlue Swirl2009-07-161-2/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: update pci device registration.Gerd Hoffmann2009-07-091-1/+7
| | | | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-1/+1
| | | | | | | | | This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Update irqs on reset and device load"Blue Swirl2009-06-171-9/+1
| | | | | | | | | This reverts commit 3dcd219f09d6c1817bf9a132899e6b925f7a0914. It is incorrect to call qemu_irq functions (or any other functions that access other device state) during savevm/loadvm. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rename pci_register_io_region() to pci_register_bar()Avi Kivity2009-06-161-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>
* Remove io_index argument from cpu_register_io_memory()Avi Kivity2009-06-161-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>
* Merge branch 'net-queue'Anthony Liguori2009-06-101-14/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * net: add return value to packet receive handlerMark McLoughlin2009-06-091-6/+8
| | | | | | | | | | | | | | This allows us to handle queue full conditions rather than dropping the packet on the floor. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: pass VLANClientState* as first arg to receive handlersMark McLoughlin2009-06-091-4/+4
| | | | | | | | | | | | Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: re-name vc->fd_read() to vc->receive()Mark McLoughlin2009-06-091-3/+3
| | | | | | | | | | | | | | | | | | 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>
| * net: add fd_readv() handler to qemu_new_vlan_client() argsMark McLoughlin2009-06-091-2/+2
| | | | | | | | | | | | | | 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>
* | Update irqs on reset and device loadBlue Swirl2009-06-091-1/+9
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Register reset functions for e1000 and rtl8139Blue Swirl2009-06-091-7/+14
|/ | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* e1000: Ignore reset commandKevin Wolf2009-05-271-2/+9
| | | | | | | | | | When a reset is requested, the current e1000 emulation never clears the reset bit which may cause a driver to hang. This patch masks the reset bit out when setting the control registert, so the reset is immediately completed. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* PCI network qdev conversionPaul Brook2009-05-141-13/+13
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* Replace gcc variadic macro extension with C99 version (missed one)Blue Swirl2009-05-131-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* e1000: Do not reinit pci config space to 0Amit Shah2009-05-081-1/+0
| | | | | | | | | | | pci_register_device already mallocs the pci config space buffer filled with zeroes. Doing this again breaks some default config space writes like setting the subsystem vendor id and subsystem device id. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Pci nic: pci_register_device can failChris Wright2009-05-011-0/+3
| | | | | | | | | | | 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>
* Introduce VLANClientState::cleanup() (Mark McLoughlin)aliguori2009-04-171-1/+10
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud