History | View | Annotate | Download (68.1 kB)
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>
eepro100: convert to memory API
Note: the existing code aliases the flash BAR into the MMIO bar. This isprobably a bug. This patch does not correct the problem.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
eepro100: 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
eepro100: Support byte/word writes to pointer register
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>
eepro100: Support byte/word read/write access to MDI control register
MDI control is a 32 bit register, but may be read or written using8 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>...
eepro100: Support byte read access to general control register
The general control register is a byte register.Add support for byte reads.
eepro100: Support 32 bit read/write access to flash register
eepro100: Fix endianness issues
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)...
eepro100: Support byte/word writes to port address
port is a 32 bit register, but may be written using 8 or 16 bit writes.Add support for byte/word writes.
eepro100: Pad received short frames
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 receivedframes. This patch enables this workaround for eepro100, too....
eepro100: Remove unused structure element
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).
eepro100: Remove type casts which are no longer needed
eepro100: Avoid duplicate debug messages
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice.Now logging in eepro100_write1 and eepro100_write2 is similar to thelogging in eepro100_write4 (which already was correct).
PXE: Use consistent naming for PXE ROMs
And add missing ROMs to tarbin build target.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
eepro100: convert to pci_register_bar_simple()
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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>...
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...
eepro100: Use a single rom file for all i825xx devices
Patching the rom data during load (in qemu) nowalso 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....
Merge branch 'pci' into for_anthony
eepro100: initialize a variable in all cases
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]...
eepro100: Add support for multiple individual addresses (multiple IA)
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)....
pci: consolidate pci_add_capability_at_offset() into pci_add_capability().
By making pci_add_capability() the special case ofpci_add_capability_at_offset() of offset = 0,consolidate pci_add_capability_at_offset() into pci_add_capability().
Cc: Stefan Weil <weil@mail.berlios.de>...
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
eepro100: Add a dev field to eeprom new/free functions
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>
Move stdbool.h
Move inclusion of stdbool.h to common header files, instead of includingin an ad-hoc manner.
Signed-off-by: Paul Brook <paul@codesourcery.com>
eepro100: convert to new capability API
Using new pci_add_capability_at_offset makeseepro100 code cleaner.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Stefan Weil <weil@mail.berlios.de>
eepro100: Set power management capability using pci_reserve_capability
pci_add_capability automatically updates PCI status andPCI capability pointer, so use it. Use pci_reserve_capabilityto make the new capability appear at the correct offset.
eepro100: fix mapping of flash memory
eepro100: fix PCI interrupt pin configuration regression
Commit 15e89f5916c9e82347cbd1fd416db3e348bab426removed this setting, but it is still needed.
Without this patch, e100 device drivers usinginterrupts don't work with qemu.
See other nic emulations which also set the...
eepro100: Set configuration bit for standard TCB
For some devices, this bit is always set.For the others, it is set by default.
eepro100: Add new device variant i82801
This ethernet device is used in Toshiba Tecra 8200 notebooks.
eepro100: Simplified device instantiation
By using a private device info structure(as suggested by Gerd Hoffmann), handling of thedifferent device variants becomes much easier.
eepro100: Simplify status handling
Includes a minor STATUS_NOT_OK -> 0 tweak.
eepro100: Don't allow writing SCBStatus
SCBStatus is readonly, but most drivers which were derivedfrom the old Linux eepro100.c do a word write to this addresswhen they want to acknowledge interrupts.
So we have to mask these writes here.
The patch also removes old unused code for status read / write....
eepro100: address pci todo's, use pci_set_xx
eepro100 uses macros which rely on a specificlocal variable name (pci_conf) which is scary.Some of the uses are wrong or unnecessary,remove them. The rest are small in number, open-codethem using pci_set_xx functions....
eepro100: Keep includes sorted
I always try to keep standard includes sortedand add a comment why they are there (so theycan be removed when they are no longer needed).
eepro100: Remove C++ comments
C++ comments are unwanted, so this is fixed here.
eepro100: Add diagnose command
Real hardware would run an internal self-test.The emulation just returns a passed status.
Original patch was from Reimar Döffinger, thanks.
eepro100: New function for reading command block
Move code which reads the command block to thenew function read_cb. The patch also fixes someendianess issues related to the command blockand moves declarations of local variables tothe beginning of the block....
eepro100: Use tx.status
There is no need for a local variable "status".Using tx.status makes it clearer which statusis addressed.
eepro100: Prettify code (no functional changes)
eepro100: Fix CU Start command
CU Start is allowed when the CU is in the idle or suspended state.
eepro100: Support RNR interrupt
The RNR interrupt is triggered under these conditions:
eepro100: Replace variable name to fix a compiler warning
When compiling with -Wshadow, gcc gives a warningwhich is fixed by renaming stat -> status.
eepro100: Use symbolic names for bits in EEPROM id
V2 - Use UPPER_CASE for enum values
eepro100: Remove old unused code
This code is no longer needed.
eepro100: Use symbolic names and BIT macros in binary operations
Instead of magic numbers like 0x8000, symbolic names are usedfor the SCB command and status bits.
There are too many configuration bits to use symbolic namesthere, too. Using the BIT macro is a little help when comparing...
eepro100: Add device descriptions
Add descriptions for all devices.These descriptions are shown when users call qemu -device ?
eepro100: Update copyright notice
eepro100: Add TODO list
eepro100: Support gpxe boot for all eepro100 devices
Only two boot ROM files are needed for all devices.
eepro100: Fix PXE boot
The phy handling was wrong for PXE, GPXE boot:GPXE's eepro100 driver did not detect a valid link.
This is fixed here.
eepro100: Add missing SCB register names
Some system control block registers were addressedusing their offset value. Use symbolic names nowand clean the documentation.
eepro100: Fix compiler errors from debug messages
When debug output was enabled (by defining DEBUG_EEPRO100),some debug messages resulted in a compiler error.
eepro100: Fix multicast support
This patch is a step to synchronize my maintainer versionof eepro100.c (git://repo.or.cz/qemu/ar7.git) with the...
eepro100: Restructure code (new function tx_command)
Handling of transmit commands is rather complex,so about 80 lines of code were moved from functionaction_command to the new function tx_command.
The two new values "tx" and "cb_address" in theeepro100 status structure made this possible without...
eepro100: Update ROM file support
Use new way to associate ROM files to devices.
Currently, there is only a ROM file for i82559erincluded in QEMU, so the patch does not add.romfile for the other devices.
When flexible mode is fixed in eepro100, adding...
eepro100: Fix initial value for PCI_STATUS
The numerical value was wrong (0x2800 instead of 0x0280)which indeed did not make sense.
eepro100: symbolic names for pci registers
No functional changes. I verified that the generated binarydoes not change in meaningful ways.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
eepro100: Allocate a larger buffer for regname()
This should avoid truncating the register name when debugging.
Signed-off-by: David Benjamin <davidben@mit.edu>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: Improve debug messages
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: convert eepro100 to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: Fix boot ROM support
eepro100: Add missing .exit initialisation
Some devices did not have an initialisation valuefor entry ".exit". This is fixed here.
eepro100: Improve support for different devices
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: 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 <yamahata@valinux.co.jp>...
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>...
eepro100: port to vmstate
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: Restructure code
This patch only moves about 150 lines of code fromfunction eepro100_cu_command to a new function action_command.
A goto statement was replaced by a for loop.
There are no functional changes. Nor did I change commentsstarting with // (they will be removed by future patches)....
eepro100: Remove unused device status entries
Once upon the time when QEMU hacking was funthere was a brave knight who wanted to havea driver for a special intel nic.
So he started by cloning ne2000.c which alsomeant that the new born eepro100.c wasimmediately three years old....
eepro100: support 16 bit read from SCBCmd (== 2)
This is necessary to support OpenBSD 4.2 install, withoutthis change it triggers an assert.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Set revision in eeprom correctly for 82557 versions.
This is necessary to make FreeBSD recognize the device as 82557 - otherwise itsdriver will use unsupported features and fail to work.
eepro100: Don't allow guests to fail assertions
The idea of using assert() for input validation is rather questionable.Let's remove it from eepro100, so that guests need to find more interestingways if they want to crash qemu.
This patch replaces asserts that are directly dependent on guest-accessible...
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
Revert "eepro100: Remove unused device status entries"
This reverts commit 3031efabd0bb744126a53f32c5426580b5d394d5.
eepro100: Add more i825xx devices
The new devices added here are still not functional -partially because some patches are still missing,partially because I cannot test them. Neverthelessthey belong to the same family and will be supportedby this driver some day....
A lot of entries are unused (they were added by copy + pastefrom other drivers during development of eepro100.c).
Removing them from nic_save, nic_load makes anyold saved status incompatible, so a new version...
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>
eepro100: Fix format strings in debug messages
size_t arguments need %zu instead of %d.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
eepro100: Replace sprintf by snprintf
eepro100: Remove unused code
eepro100: Enhanced logging and comments
Make string arrays used to convert numbers to strings when DEBUG_EEPRO100 is enabled const.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
eepro100: Clean code which sets the PCI device id
Fix for commit 3f9cb1c14dc368f41447db5f78d6248c4f100ad4
Here's a patch to fix the issue introduced by me, as Reimar Döffinger pointed out,
Reimar Döffinger wrote:
On Thu, Aug 13, 2009 at 03:01:20PM +0300, Naphtali Sprei wrote: Bug fix for segfault when run as i82551 HW:...
On Thu, Aug 13, 2009 at 03:01:20PM +0300, Naphtali Sprei wrote:
Bug fix for segfault when run as i82551 HW:...
Remove typedef for bool from eepro100.c
eepro100.c shouldn't have the need to do this in its local header file.
And I recently started getting this:
$ make -j3... CC x86_64-softmmu/eepro100.o/home/amit/src/qemu/hw/eepro100.c:112: error: two or more data types...
eepro100: convert casts to DO_UPCAST()
eepro100: cast a void * makes no sense
eepro100: Remove unused indirection of PCIDevice
Once there, there is no way that we don't have a PCI Device at save/load time. Remove the check
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....
fix stack buffer overflows in eepro100.c tx
Hello,the real world issue is that the hardware allows sends up to 2600 bytes,and for some reason FreeBSD sometimes sends frames larger than theethernet frame size (102+1460 is the maximum I have seen so far),...
hw/eepro100.c: Use extended TBD only where applicable
Bug fix for segfault when run as i82551 HW:Use Extended TBD only when HW supports it (i82558 and up).
Added assertions to guard from such buffer overflowIntroduce the MAX_TCB_BYTE_COUNT macroAllocate buf big enough as HW needs (MAX_ETH_FRAME_SIZE -> MAX_TCB_BYTE_COUNT)...
Make CPURead/WriteFunc structure 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>