david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

2705 Commits

Author SHA1 Message Date
Michael Brown e78bcb6175 [netdevice] Kill off the various guess_boot_netdev() functions
Remove the assortment of miscellaneous hacks to guess the "network
boot device", and replace them each with a call to last_opened_netdev().

It still isn't guaranteed correct, but it won't be any worse than
before, and it will at least be consistent.
2008-11-21 20:34:42 +00:00
Michael Brown 02a0215873 [netdevice] Provide function to retrieve the most recently opened net device
There are currently four places within the codebase that use a
heuristic to guess the "boot network device", with varying degrees of
success.  Add a feature to the net device core to maintain a list of
open network devices, in order of opening, and provide a function
last_opened_netdev() to retrieve the most recently opened net device.
This should do a better job than the current assortment of
guess_boot_netdev() functions.
2008-11-21 20:34:02 +00:00
Michael Brown 8e8a348fd4 [pxe] Select the correct network device on multiport cards
When trying to find the "first open network device", it helps to
actually check the NETDEV_OPEN flag.
2008-11-21 19:45:05 +00:00
Michael Brown 246ddf5ee4 [aoe] Use an AoE config query to identify the target MAC address
The AoE spec does not specify that the source MAC address of a
received packet actually matches the MAC address of the AoE target.
In principle an AoE server can respond to an AoE request on any
interface available to it, which may not be an address configured to
accept AoE requests.

This issue is resolved by implementing AoE device discovery.  The
purpose of AoE discovery is to find out which addresses an AoE target
can use for requests.  An AoE configuration command is sent when the
AoE attach is attempted.  The AoE target must respond to that
configuration query from an interface that can accept requests.

Based on a patch from Ryan Thomas <ryan@coraid.com>
2008-11-19 21:42:33 +00:00
Laurent Vivier a2686a55c4 [blockdev] Move block device operations to structure block_device_operations
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 20:04:43 +00:00
Laurent Vivier b48f37e69a [virtio] Split virtio-net.c into several files.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:58:51 +00:00
Laurent Vivier 14a739ba6a [virtio] Consolidate virtio-net static data into a struct vring_virtqueue
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:55:54 +00:00
Laurent Vivier d3d8f20626 [virtio] Remove dependency on nic for virtio PCI functions
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:51:38 +00:00
Laurent Vivier fc49421c7e [virtio] Consolidate vring_get_buf() by using a buffer list to add to the vring
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:50:51 +00:00
Laurent Vivier 5dd5107976 [virtio] Move virtio-pci.h and virtio-ring.h to include/gpxe
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:48:30 +00:00
Michael Brown 0ebbbb95fa [x86_64] Fix assorted 64-bit compilation errors and warnings
Remove various 32-bit assumptions scattered throughout the codebase.
The code is still not necessarily 64-bit clean, but will at least
compile.
2008-11-19 19:33:05 +00:00
Michael Brown 7d36a1b7b0 [build] Explicitly link efilink against -liberty
On some systems, libbfd is supplied only as a static library; linking
will fail unless -liberty is also specified.
2008-11-19 19:24:48 +00:00
Michael Brown 3f85626fa9 [efi] Add efi_strerror()
EFI_STATUS is defined as an INTN, which maps to UINT32 (i.e. unsigned
int) on i386 and UINT64 (i.e. unsigned long) on x86_64.  This would
require a cast each time the error status is printed.

Add efi_strerror() to avoid this ickiness and simultaneously enable
prettier reporting of EFI status codes.
2008-11-19 19:22:49 +00:00
Michael Brown d9b3d09910 [i386] Move iSCSI and AoE boot code to arch/i386/interface/pcbios 2008-11-19 19:20:45 +00:00
Michael Brown b59e0cc56e [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] long
This brings us in to line with Linux definitions, and also simplifies
adding x86_64 support since both platforms have 2-byte shorts, 4-byte
ints and 8-byte long longs.
2008-11-19 19:15:44 +00:00
Michael Brown 849e4b12d6 [libgcc] Make __libgcc architecture-specific 2008-11-19 19:14:24 +00:00
Michael Brown dc60c24146 [i386] Rename __cdecl to __asmcall
__cdecl is a misleading name, since it currently encapsulates both
cdecl and regparm(0) attributes.  Rename to __asmcall.
2008-11-19 19:12:53 +00:00
Michael Brown 446b6d5fdd [pxe] Move all PXE files to arch/i386
The initial PXE implementation in Etherboot had the goal of being
architecture-agnostic, but this goal has not been realised.
2008-11-18 22:27:02 +00:00
Michael Brown fca2dcabb8 [elf] Kill off unused <bits/elf.h> and <bits/elf_x.h> header files 2008-11-18 22:16:15 +00:00
Michael Brown ab96932ab3 [efi] Update to latest UEFI headers 2008-11-18 21:54:51 +00:00
Michael Brown 0a8a17e669 [i386] Free allocated base memory on exit, if possible
Code paths that automatically allocate memory from the FBMS at 40:13
should also free it, if possible.

Freeing this memory will not be possible if either

  1. The FBMS has been modified since our allocation, or

  2. We have not been able to unhook one or more BIOS interrupt vectors.
2008-11-18 19:43:13 +00:00
Marty Connor 85f82f09e9 [r8169] New rtl8169 family driver
This is a completely rewritten version of the rtl8169 family driver
using the gPXE driver API.
2008-11-18 04:04:07 +00:00
Michael Brown cc93556725 [build] Fix calculation of _filesz
_filesz was incorrectly forced to be aligned up to MAX_ALIGN.  In a
non-compressed build, this would cause a build failure unless _filesz
happened to already be aligned to MAX_ALIGN.
2008-11-17 19:58:02 -08:00
Michael Brown c661945e82 [build] Discard junk sections created by newer gcc versions 2008-11-18 03:46:27 +00:00
Michael Brown 54fbd11221 [build] Keep gcc 4.4 happy
gcc 4.4 adds another few warnings, and also seems to complain if we
place %ebp in the clobber list for any inline asm.
2008-11-18 01:52:40 +00:00
Michael Brown 464bf35cc0 [linda] Add missing copyright notices 2008-11-18 00:14:10 +00:00
Michael Brown 8a80e7ace1 [linda] Purge references to 8051 2008-11-17 23:55:43 +00:00
Michael Brown 1b3edd9e11 [infiniband] Respect hop pointer when building directed route SMP return path
The return path in directed route SMPs lists the egress ports in order
from SM to node, rather than from node to SM.

To write to the correct offset within the return path, we need to
parse the hop pointer.  This is held within the class-specific data
portion of the MAD header, which was previously unused by us and
defined to be a uint16_t.  Define this field to be a union type; this
requires some rearrangement of ib_mad.h and corresponding changes to
ipoib.c.
2008-11-12 15:35:45 +00:00
Michael Brown 2ca2607b1b [romprefix] Use smaller PMM allocations if possible
The only way that PMM allows us to request a block in a region with
A20=0 is to ask for a block with an alignment of 2MB.  Due to the PMM
API design, the only way we can do this is to ask for a block with a
size of 2MB.

Unfortunately, some BIOSes will hit problems if we allocate a 2MB
block.  In particular, it may not be possible to enter the BIOS setup
screen; the BIOS setup code attempts a PMM allocation, fails, and
hangs the machine.

We now try allocating only as much as we need via PMM.  If the
allocated block has A20=1, we free the allocated block, double the
allocation size, and try again.  Repeat until either we obtain a block
with A20=0 or allocation fails.  (This is guaranteed to terminate by
the time we reach an allocation size of 2MB.)
2008-11-11 20:00:13 +00:00
Michael Brown 125c6d66a8 [linda] Add support for QLogic 7220-based Infiniband HCAs
These cards very nearly support our current IB Verbs model.  There is
one minor difference: multicast packets will always be delivered by
the hardware to QP0, so the driver has to redirect them to the
appropriate QP.  This means that QP owners may see receive completions
for buffers that they never posted.  Nothing in our current codebase
will break because of this.
2008-11-11 05:58:47 +00:00
Michael Brown 9e5fd8ec59 [infiniband] Add raw packet parser and constructor
This can be used with cards that require the driver to construct and
parse packet headers manually.  Headers are optionally handled
out-of-line from the packet payload, since some such cards will split
received headers into a separate ring buffer.
2008-11-11 05:31:19 +00:00
Michael Brown c0ec00f47f [infiniband] Add a standalone subnet management agent
This generic SMA code can be used for any cards that do not provide
firmware-based embedded SMAs.
2008-11-11 05:31:18 +00:00
Michael Brown 9a35830d1f [ipoib] Kill off the IPoIB pseudo-header
Some Infiniband cards will not be as accommodating as the Arbel and
Hermon cards in providing enough space for us to push a fake extra
header at the start of the received packet.  We must therefore make do
with squeezing enough information to identify source and destination
addresses into the two bytes of padding within a genuine IPoIB
link-layer header.
2008-11-11 05:31:08 +00:00
Michael Brown 663904a7bc [infiniband] Split subnet management agent client out into ib_smc.c
Not all Infiniband cards have embedded subnet management agents.
Split out the code that communicates with such an embedded SMA into a
separate ib_smc.c file, and have drivers call ib_smc_update()
explicitly when they suspect that the answers given by the embedded
SMA may have changed.
2008-11-11 05:31:07 +00:00
Michael Brown 830e19eb54 [infiniband] Pass address vector in receive completions
Receive completion handlers now get passed an address vector
containing the information extracted from the packet headers
(including the GRH, if present), and only the payload remains in the
I/O buffer.

This breaks the symmetry between transmit and receive completions, so
remove the ib_completer_t type and use an ib_completion_queue_operations
structure instead.

Rename the "destination QPN" and "destination LID" fields in struct
ib_address_vector to reflect its new dual usage.

Since the ib_completion structure now contains only an IB status code,
("syndrome") replace it with a generic gPXE integer status code.
2008-11-11 05:31:07 +00:00
Michael Brown 0de5f7af6d [infiniband] Maintain queue fill level as a property of a work queue
Both queue owners and drivers often need to keep track of the fill
level, so let's make it a generic property.
2008-11-11 05:31:06 +00:00
Michael Brown d9751edafa [infiniband] Flush uncompleted work queue entries at QP teardown
Avoid leaking I/O buffers in ib_destroy_qp() by completing any
outstanding work queue entries with a generic error code.  This
requires the completion handlers to be available to ib_destroy_qp(),
which is done by making them static configuration parameters of the CQ
(set by ib_create_cq()) rather than being provided on each call to
ib_poll_cq().

This mimics the functionality of netdev_{tx,rx}_flush().  The netdev
flush functions would previously have been catching any I/O buffers
leaked by the IPoIB data queue (though not by the IPoIB metadata
queue).
2008-11-11 05:31:06 +00:00
Pantelis Koukousoulas dd34500188 [ne2k_isa] Restore support for ne2k isa cards
Add the simplified ne2k_isa driver.  It is just a selective copy+paste
of the relevant parts from ns8390.c plus a little trivial hacking to
make it actually work.

It is true that the code is pretty ugly, but:
  a) ns8390.c is worse
  b) It is only 372 lines and no #ifdefs
  c) It works both in qemu/bochs and in real hardware
     and we all know it is easier to cleanup working code

Hope someone will find the time to rewrite this driver properly,
but until then at least for me this is an ok solution.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-08 13:01:20 +00:00
Pantelis Koukousoulas 180d99fc22 [isa] Fix a small typo in isa.c.
With this patch ISA drivers actually get probed so they have a fair
chance of working now.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-08 12:54:18 +00:00
Michael Brown 9a52ba0cfa [netdevice] Retain and report detailed error breakdowns
netdev_rx_err() and netdev_tx_complete_err() get passed the error
code, but currently use it only in debug messages.

Retain error numbers and frequencey counts for up to
NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX.
This allows the "ifstat" command to report the reasons for TX/RX
errors in most cases, even in non-debug builds.
2008-11-08 05:30:30 +00:00
Michael Brown 46f43d8ea7 [phantom] Do not halt PEGs on driver shutdown
Halting the PEGs breaks platforms where there is sideband access to
the NIC (e.g. HP machines using iLO).  (We have to retain the
unhalting code because on some other platforms (e.g. IBM blades with
BOFM) the pre-PXE firmware must halt the PEGs to avoid issues with the
BIOS rereading via the expansion ROM BAR.)
2008-11-08 05:10:23 +00:00
Michael Brown 43aa69d7b3 [aoe] Start retry timer before potential temporary transmission failure
The retry timer needs to be running as soon as we know that we are
trying to transmit a command.  If transmission fails because of a
temporary error condition, then the timer will allow us to retry the
transmission later.
2008-11-08 04:36:42 +00:00
Michael Brown ed196a3ed2 [settings] Ensure fetch_string_setting() returns a NUL-terminated string
This fixes a regression introduced in commit 612f4e7:

  [settings] Avoid returning uninitialised data on error in fetch_xxx_setting()

in which the memset() was moved from fetch_string_setting() to
fetch_setting(), in order that it would be useful for non-string
setting types.  However, this neglects to take into account the fact
that fetch_string_setting() shrinks its buffer by one byte (to allow
for the NUL) before calling fetch_setting().

Restore the memset() in fetch_string_setting(), so that the
terminating NUL is guaranteed to actually be a NUL.
2008-11-07 03:48:29 +00:00
Michael Brown 29e6f9835e [i386] Add data32 prefixes to all lgdt/lidt instructions
With a 16-bit operand, lgdt/lidt will load only a 24-bit base address,
ignoring the high-order bits.  This meant that we could fail to fully
restore the GDT across a call into gPXE, if the GDT happened to be
located above the 16MB mark.

Not all of our lgdt/lidt instructions require a data32 prefix (for
example, reloading the real-mode IDT can never require a 32-bit base
address), but by adding them everywhere we will hopefully not forget
the necessary ones in future.
2008-11-07 03:48:25 +00:00
Michael Brown aa95744915 [phantom] Allow for PXE boot to be enabled/disabled on a per-port basis
This is something of an ugly hack to accommodate an OEM requirement.
The NIC has only one expansion ROM BAR, rather than one per port.  To
allow individual ports to be selectively enabled/disabled for PXE boot
(as required), we must therefore leave the expansion ROM always
enabled, and place the per-port enable/disable logic within the gPXE
driver.
2008-11-01 01:55:13 +00:00
Michael Brown 5e6b82104d [romprefix] Add vendor branding facilities and guidelines
Some hardware vendors have been known to remove all gPXE-related
branding from ROMs that they build.  While this is not prohibited by
the GPL, it is a little impolite.

Add a facility for adding branding messages via two #defines
(PRODUCT_NAME and PRODUCT_SHORT_NAME) in config/general.h.  This
should accommodate all known OEM-mandated branding requirements.
Vendors with branding requirements that cannot be satisfied by using
PRODUCT_NAME and/or PRODUCT_SHORT_NAME should contact us so that we
can extended this facility as necessary.
2008-10-31 19:10:28 +00:00
Michael Brown 32bc76f902 [phantom] Assume one net device per PCI function
The Phantom firmware selectively disables PCI functions based on the
board type, with the end result that we see one PCI function for each
network port.  This allows us to eliminate the code for reading from
flash and, more importantly, removes knowledge of the board type magic
number from the gPXE driver.
2008-10-31 01:55:58 +00:00
Michael Brown 467c4f77c3 [hacks] Improve the guess_boot_netdev() logic
This function is a major kludge, but can be made slightly more
accurate by ignoring net devices that aren't open.  Eventually it
needs to be removed entirely.
2008-10-31 01:51:26 +00:00
Michael Brown 0a6c66a830 [settings] Add the notion of a "tag magic" to numbered settings
Settings can be constructed using a dotted-decimal notation, to allow
for access to unnamed settings.  The default interpretation is as a
DHCP option number (with encapsulated options represented as
"<encapsulating option>.<encapsulated option>".

In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to
interpret the dotted-decimal notation as referring to non-DHCP
options.  In this case, it becomes necessary for these contexts to
ignore standard DHCP options, otherwise we end up trying to, for
example, retrieve the boot filename from SMBIOS.

Allow settings blocks to specify a "tag magic".  When dotted-decimal
notation is used to construct a setting, the tag magic value of the
originating settings block will be ORed in to the tag number.
Store/fetch methods can then check for the magic number before
interpreting arbitrarily-numbered settings.
2008-10-30 21:47:14 +00:00
Michael Brown 621101c36a [romprefix] Further sanity checks for the PCI 3 runtime segment address
This extends the sanity checks on the runtime segment address provided
in %bx, first implemented in commit 5600955.

We now allow the ROM to be placed anywhere above a000:0000 (rather
than c000:0000, as before), since this is the region allowed by the
PCI 3 spec.  If the BIOS asks us to place the runtime image such that
it would overlap with the init-time image (which is explicitly
prohibited by the PCI 3 spec), then we assume that the BIOS is faulty
and ignore the provided runtime segment address.

Testing on a SuperMicro BIOS providing overlapping segment addresses
shows that ignoring the provided runtime segment address is safe to do
in these circumstances.
2008-10-29 01:16:52 +00:00