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>
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>
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>
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>
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>
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>
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>
Commit 15e89f5916
removed this setting, but it is still needed.
Without this patch, e100 device drivers using
interrupts don't work with qemu.
See other nic emulations which also set the
PCI interrupt pin.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci_add_capability automatically updates PCI status and
PCI capability pointer, so use it. Use pci_reserve_capability
to make the new capability appear at the correct offset.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
For some devices, this bit is always set.
For the others, it is set by default.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This ethernet device is used in Toshiba Tecra 8200 notebooks.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
By using a private device info structure
(as suggested by Gerd Hoffmann), handling of the
different device variants becomes much easier.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
SCBStatus is readonly, but most drivers which were derived
from the old Linux eepro100.c do a word write to this address
when they want to acknowledge interrupts.
So we have to mask these writes here.
The patch also removes old unused code for status read / write.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100 uses macros which rely on a specific
local variable name (pci_conf) which is scary.
Some of the uses are wrong or unnecessary,
remove them. The rest are small in number, open-code
them using pci_set_xx functions.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
I always try to keep standard includes sorted
and add a comment why they are there (so they
can be removed when they are no longer needed).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
C++ comments are unwanted, so this is fixed here.
* Replace C++ comments by C comments.
* Put code which was deactivated by a C++ comment in #if 0...#endif.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Real hardware would run an internal self-test.
The emulation just returns a passed status.
Original patch was from Reimar Döffinger, thanks.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Move code which reads the command block to the
new function read_cb. The patch also fixes some
endianess issues related to the command block
and moves declarations of local variables to
the beginning of the block.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
There is no need for a local variable "status".
Using tx.status makes it clearer which status
is addressed.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
CU Start is allowed when the CU is in the idle or suspended state.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
The RNR interrupt is triggered under these conditions:
* the RU is not ready to receive a frame due to missing resources
* the RU is ready and a RU abort command was requested
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
When compiling with -Wshadow, gcc gives a warning
which is fixed by renaming stat -> status.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Instead of magic numbers like 0x8000, symbolic names are used
for the SCB command and status bits.
There are too many configuration bits to use symbolic names
there, too. Using the BIT macro is a little help when comparing
code and documentation.
For the same reason, some other constants were replaced by
the BITS macro.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Add descriptions for all devices.
These descriptions are shown when users call
qemu -device ?
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Only two boot ROM files are needed for all devices.
* Add these GPXE ROM files using new naming convention
(as discussed on qemu-devel). Both files were created
with http://rom-o-matic.net/, PCI vendor / device ids
as in ROM filenames and option BANNER_TIMEOUT = 0.
* Remove old PXE ROM file for i82559er.
It was replaced by gpxe-eepro100-80861209.rom.
* Update pc-bios/README (and sort entries).
Full support still needs additional eepro100 fixes.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
The phy handling was wrong for PXE, GPXE boot:
GPXE's eepro100 driver did not detect a valid link.
This is fixed here.
V2 - Use UPPER_CASE for enum values
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Some system control block registers were addressed
using their offset value. Use symbolic names now
and clean the documentation.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
When debug output was enabled (by defining DEBUG_EEPRO100),
some debug messages resulted in a compiler error.
This is fixed here.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Handling of multicast list was missing.
* Multicast all was missing.
* Promiscuous mode for multicast frames was wrong.
This patch is a step to synchronize my maintainer version
of eepro100.c (git://repo.or.cz/qemu/ar7.git) with the
version integrated in QEMU.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Handling of transmit commands is rather complex,
so about 80 lines of code were moved from function
action_command to the new function tx_command.
The two new values "tx" and "cb_address" in the
eepro100 status structure made this possible without
passing too many parameters.
In addition, the moved code was cleaned a little bit:
old comments marked with //~ were removed, C++ style
comments were replaced by C style comments, C++ like
variable declarations after code were reordered.
Simplified mode is still broken. Nor did I fix
endianess issues. Both problems will be fixed in
additional patches (which need this one).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Use new way to associate ROM files to devices.
Currently, there is only a ROM file for i82559er
included in QEMU, so the patch does not add
.romfile for the other devices.
When flexible mode is fixed in eepro100, adding
more ROM files will be possible. It should be
possible to create them from pxe-i82559er.bin,
because etherboot uses the same driver for all
eepro100 devices (only PCI ids differ).
Maybe it is even possible to create a single
pxe-i8255x.bin which supports all eepro100 devices
(not supported with current etherboot).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
The numerical value was wrong (0x2800 instead of 0x0280)
which indeed did not make sense.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
No functional changes. I verified that the generated binary
does 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>
* buf was too small for longer register names.
* Use consistent upper case for nouns in register names.
* Use better name for array with e100 register names.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
Some devices did not have an initialisation value
for entry ".exit". This is fixed here.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename pxe-eepro100.bin to pxe-i82559er.bin.
The other devices supported by eepro100.c need
additional pxe boot ROM images.
* Call rom_add_option during initialisation.
The code won't work with two or more different
eepro100 devices, because it only adds one option
ROM, but this use case is perhaps never needed.
Using this patch, model=i82559er at least works partially.
For full support, more eepro100 patches are needed
(will follow later, can be fetched from ar7 branch
of QEMU).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add device properties (size of statistical data,
extended tcb support) to EEPRO100State and set
these values for the different devices.
* Fix PCI configuration for existing devices.
* Add initialisation code for missing devices.
* Remove function device_supports_eTxCB.
It is no longer needed.
* Fix dump of statistical data. It now respects
the real size of the statistical data.
An endianess issue was fixed here, too.
* CU_SHOWSTATS, CU_DUMPSTATS now write a
completion value after the statistical data.
There is no need to keep this value in
eepro100_stats_t, so member "complete"
could be removed.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
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>