aboutsummaryrefslogtreecommitdiff
path: root/hw/eepro100.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-23Rename target_phys_addr_t to hwaddrAvi Kivity1-2/+2
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-09-14eepro100: Fix network hang when rx buffers run outBo Yang1-1/+3
This is reported by QA. When installing os with pxe, after the initial kernel and initrd are loaded, the procedure tries to copy files from install server to local harddisk, the network becomes stall because of running out of receive descriptor. [Whitespace fixes and removed qemu_notify_event() because Paolo's earlier net patches have moved it into qemu_flush_queued_packets(). Additional info: I can reproduce the network hang with a tap device doing a iPXE HTTP boot as follows: $ qemu -enable-kvm -m 1024 \ -netdev tap,id=netdev0,script=no,downscript=no \ -device i82559er,netdev=netdev0,romfile=80861209.rom \ -drive if=virtio,cache=none,file=test.img iPXE> ifopen net0 iPXE> config # set static network configuration iPXE> kernel http://mirror.bytemark.co.uk/fedora/linux/releases/17/Fedora/x86_64/os/images/pxeboot/vmlinuz I needed a vanilla iPXE ROM to get to the iPXE prompt. I think the boot prompt has been disabled in the ROMs that ship with QEMU to reduce boot time. During the vmlinuz HTTP download there is a network hang. hw/eepro100.c has reached the end of the rx descriptor list. When the iPXE driver replenishes the rx descriptor list we don't kick the QEMU net subsystem and event loop, thereby leaving the tap netdev without its file descriptor in select(2). Stefan Hajnoczi <stefanha@gmail.com>] Signed-off-by: Bo Yang <boyang@suse.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-08-01net: Rename qemu_del_vlan_client() to qemu_del_net_client()Stefan Hajnoczi1-1/+1
Another step in moving the vlan feature out of net core. Users only deal with NetClientState and therefore qemu_del_vlan_client() should be named qemu_del_net_client(). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2012-08-01net: Rename VLANClientState to NetClientStateStefan Hajnoczi1-3/+3
The vlan feature is no longer part of net core. Rename VLANClientState to NetClientState because net clients are not explicitly associated with a vlan at all, instead they have a peer net client to which they are connected. This patch is a mechanical search-and-replace except for a few whitespace fixups where changing VLANClientState to NetClientState misaligned whitespace. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2012-07-29Merge branch pci into masterMichael S. Tsirkin1-2/+1
Merge master and pci branch, resolve build breakage in hw/esp.c introduced by f90c2bcd. Conflicts: hw/esp.c
2012-07-28Avoid returning voidBlue Swirl1-4/+11
It's silly and non-conforming to standards to return void, don't do it. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-23hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)Laszlo Ersek1-1/+1
NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_ Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-04pci: convert PCIUnregisterFunc to voidAlex Williamson1-2/+1
Not a single driver has any possibility of failure on their exit function, let's keep it that way. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-04-25eepro100: Fix multicast regressionStefan Weil1-2/+26
Commit 7fc8d918b9674c3e9233d6d25da2457345d414a0 removed code from eepro100.c and replaced it by different code: the code in net.c returns bits 31...26, but eepro100 needs bits 7...2. This patch partially reverts 7fc8d918b9674c3e9233d6d25da2457345d414a0. To avoid future problems, I renamed the function and changed the comment. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-03-16net: move compute_mcast_idx() to net.hJason Wang1-25/+0
Reduce duplicated codes. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-02-15qom: Unify type registrationAndreas Färber1-2/+2
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: register all types natively through QEMU Object ModelAnthony Liguori1-39/+44
This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori1-75/+125
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: don't access name through infoAnthony Liguori1-1/+1
We already have a QOM interface for this so let's use it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: move qdev->info to classAnthony Liguori1-2/+2
Right now, DeviceInfo acts as the class for qdev. In order to switch to a proper ObjectClass derivative, we need to ween all of the callers off of interacting directly with the info pointer. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-14Merge remote-tracking branch 'stefanha/trivial-patches-next' into stagingAnthony Liguori1-1/+1
2011-12-12Remove unnecessary casts from PCI DMA code in eepro100David Gibson1-4/+3
This patch removes some unnecessary casts in the eepro100 device, introduced by commit 16ef60c9a8eeee269f7cbc95219a431b1d7cbf29 'eepro100: Use PCI DMA stub functions'. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-06fix typo: delete redundant semicolonDong Xu Wang1-1/+1
Double semicolons should be single. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-28eepro100: Fix alignment requirement for statistical countersStefan Weil1-1/+9
According to Intel's Open Source Software Developer Manual, the dump counters address must be Dword aligned. The new code enforces this alignment, so s->statsaddr may now be used with stw_le_pci_dma() and stl_le_pci_dma(). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-01eepro100: Use PCI DMA stub functionsEduard - Gabriel Munteanu1-72/+49
This updates the eepro100 device emulation to use the explicit PCI DMA functions, instead of directly calling physical memory access functions. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-1/+1
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08pci: rename pci_register_bar_region() to pci_register_bar()Avi Kivity1-4/+3
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-08eepro100: convert to memory APIAvi Kivity1-145/+37
Note: the existing code aliases the flash BAR into the MMIO bar. This is probably a bug. This patch does not correct the problem. 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-06-15Merge remote-tracking branch 'origin/master' into pciMichael S. Tsirkin1-1/+1
Conflicts: hw/virtio-pci.c
2011-06-12eepro100: convert to PCIDeviceInfo to initialize idsIsaku Yamahata1-41/+33
use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-06Fix typo in code and commentsStefan Weil1-1/+1
Replace writeable -> writable Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-05-05Merge remote branch 'origin/master' into pciMichael S. Tsirkin1-1/+1
Conflicts: exec.c
2011-05-05eepro100: Support 32 bit read/write access to flash registerStefan Weil1-0/+9
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte read access to general control registerStefan Weil1-0/+3
The general control register is a byte register. Add support for byte reads. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte/word read/write access to MDI control registerStefan Weil1-2/+32
MDI control is a 32 bit register, but may be read or written using 8 or 16 bit access. Data is latched when the MSB is written. Add support for byte/word read/write access. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte/word writes to pointer registerStefan Weil1-17/+16
pointer is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte/word writes to port addressStefan Weil1-2/+18
port is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Fix endianness issuesStefan Weil1-44/+97
Like other Intel devices, e100 (eepro100) uses little endian byte order. This patch was tested with these combinations: i386 host, i386 + mipsel guests (le-le) mipsel host, i386 guest (le-le) i386 host, mips + ppc guests (le-be) mips host, i386 guest (be-le) mips and mipsel hosts were emulated machines. v2: Use prefix for new functions. Add the same prefix to stl_le_phys. Fix alignment of mem (needed for word/dword reads/writes). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Pad received short framesStefan Weil1-1/+25
QEMU sends frames smaller than 60 bytes to ethernet nics. Such frames are rejected by real NICs and their emulations. To avoid this behaviour, other NIC emulations pad received frames. This patch enables this workaround for eepro100, too. All related code is marked with CONFIG_PAD_RECEIVED_FRAMES, so we can drop this in case QEMU's networking code is ever changed. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Remove unused structure elementStefan Weil1-3/+3
cppcheck reports that 'packet' is unused. It was only used to calculate the size of the preceding data. Removing it saves a lot of stack space (local variable rx). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Remove type casts which are no longer neededStefan Weil1-7/+6
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Avoid duplicate debug messagesStefan Weil1-5/+9
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice. Now logging in eepro100_write1 and eepro100_write2 is similar to the logging in eepro100_write4 (which already was correct). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-04-18PXE: Use consistent naming for PXE ROMsAlex Williamson1-1/+1
And add missing ROMs to tarbin build target. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2011-04-07eepro100: convert to pci_register_bar_simple()Avi Kivity1-30/+13
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-12-11Add bootindex parameter to net/block/fd deviceGleb Natapov1-0/+3
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 <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-12-11Add endianness as io mem parameterAlexander Graf1-1/+2
As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-11-22eepro100: Use a single rom file for all i825xx devicesStefan Weil1-11/+3
Patching the rom data during load (in qemu) now also supports i82801 (which had no rom file). We only need a single rom file for the whole device family, so remove the second one which is no longer needed. Cc: Markus Armbruster <armbru@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27Merge branch 'pci' into for_anthonyMichael S. Tsirkin1-2/+2
2010-10-13eepro100: initialize a variable in all casesBlue Swirl1-3/+3
Compiling with GCC 4.6.0 20100925 produced warnings: /src/qemu/hw/eepro100.c: In function 'eepro100_read4': /src/qemu/hw/eepro100.c:1351:14: error: 'val' may be used uninitialized in this function [-Werror=uninitialized] /src/qemu/hw/eepro100.c: In function 'eepro100_read2': /src/qemu/hw/eepro100.c:1328:14: error: 'val' may be used uninitialized in this function [-Werror=uninitialized] /src/qemu/hw/eepro100.c: In function 'eepro100_read1': /src/qemu/hw/eepro100.c:1285:13: error: 'val' may be used uninitialized in this function [-Werror=uninitialized] Fix by initializing 'val' at start. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-07eepro100: Add support for multiple individual addresses (multiple IA)Stefan Weil1-9/+21
I reviewed the latest sources of Linux, FreeBSD and NetBSD. They all reset the multiple IA bit (multi_ia in BSD) to zero, but I did not find code which sets this bit to one (like it is done by some routers). Running Windows guests also did not set this bit. Intel's Open Source Software Developer Manual does not give much information on the semantics related to this bit, so I had to guess how it works. The guess was good enough to make the router emulation work. Related changes in this patch: * Update naming and documentation of the internal hash register. It is not limited to multicast, but also used for multiple IA. * Dump complete configuration register when debug traces are enabled. * Debug output when multiple IA bit is set during CmdConfigure. * Debug output when frames are received because multiple IA bit is set, or when they are ignored although it is set. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07pci: consolidate pci_add_capability_at_offset() into pci_add_capability().Isaku Yamahata1-2/+2
By making pci_add_capability() the special case of pci_add_capability_at_offset() of offset = 0, consolidate pci_add_capability_at_offset() into pci_add_capability(). Cc: Stefan Weil <weil@mail.berlios.de> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-07-06eepro100: Add a dev field to eeprom new/free functionsAlex Williamson1-2/+2
This allows us to create a more meaningful savevm string. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-06savevm: Add DeviceState paramAlex Williamson1-2/+2
When available, we'd like to be able to access the DeviceState when registering a savevm. For buses with a get_dev_path() function, this will allow us to create more unique savevm id strings. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-13Move stdbool.hPaul Brook1-1/+0
Move inclusion of stdbool.h to common header files, instead of including in an ad-hoc manner. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-11eepro100: convert to new capability APIMichael S. Tsirkin1-13/+9
Using new pci_add_capability_at_offset makes eepro100 code cleaner. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Stefan Weil <weil@mail.berlios.de>