ipxe.git
5 years ago[infiniband] Use correct transaction identifier in CM responses
Michael Brown [Fri, 4 Mar 2016 12:24:22 +0000 (12:24 +0000)] 
[infiniband] Use correct transaction identifier in CM responses

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Use connection's local ID as debug message identifier
Michael Brown [Thu, 3 Mar 2016 18:09:03 +0000 (18:09 +0000)] 
[infiniband] Use connection's local ID as debug message identifier

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Use "%d" as format specifier for LIDs
Michael Brown [Tue, 8 Mar 2016 09:11:15 +0000 (09:11 +0000)] 
[infiniband] Use "%d" as format specifier for LIDs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Use "%#lx" as format specifier for queue pair numbers
Michael Brown [Tue, 8 Mar 2016 09:06:37 +0000 (09:06 +0000)] 
[infiniband] Use "%#lx" as format specifier for queue pair numbers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Assign names to Infiniband devices for debug messages
Michael Brown [Fri, 4 Mar 2016 09:17:08 +0000 (09:17 +0000)] 
[infiniband] Assign names to Infiniband devices for debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Add support for performing service record lookups
Michael Brown [Tue, 1 Mar 2016 09:41:11 +0000 (09:41 +0000)] 
[infiniband] Add support for performing service record lookups

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Avoid multiple calls to ib_cmrc_shutdown()
Michael Brown [Wed, 2 Mar 2016 09:29:33 +0000 (09:29 +0000)] 
[infiniband] Avoid multiple calls to ib_cmrc_shutdown()

When a CMRC connection is closed, the deferred shutdown process calls
ib_destroy_qp().  This will cause the receive work queue entries to
complete in error (since they are being cancelled), which will in turn
reschedule the deferred shutdown process.  This eventually leads to
ib_destroy_conn() being called on a connection that has already been
freed.

Fix by explicitly cancelling any pending shutdown process after the
shutdown process has completed.

Ironically, this almost exactly reverts commit 019d4c1 ("[infiniband]
Use a one-shot process for CMRC shutdown"); prior to the introduction
of one-shot processes the only way to achieve a one-shot process was
for the process to cancel itself.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Remove concept of whole-device owner data
Michael Brown [Tue, 1 Mar 2016 15:26:32 +0000 (15:26 +0000)] 
[infiniband] Remove concept of whole-device owner data

Remove the implicit assumption that the IPoIB protocol owns the whole
Infiniband device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[netdevice] Refuse to create duplicate network device names
Michael Brown [Mon, 7 Mar 2016 21:03:25 +0000 (21:03 +0000)] 
[netdevice] Refuse to create duplicate network device names

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Support ioremap() for addresses above 4GB in a 64-bit build
Michael Brown [Fri, 26 Feb 2016 15:34:28 +0000 (15:34 +0000)] 
[librm] Support ioremap() for addresses above 4GB in a 64-bit build

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[ioapi] Split ioremap() out to a separate IOMAP API
Michael Brown [Fri, 26 Feb 2016 15:33:40 +0000 (15:33 +0000)] 
[ioapi] Split ioremap() out to a separate IOMAP API

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Add support for running in 64-bit long mode
Michael Brown [Thu, 18 Feb 2016 02:44:19 +0000 (02:44 +0000)] 
[librm] Add support for running in 64-bit long mode

Add support for running the BIOS version of iPXE in 64-bit long mode.
A 64-bit BIOS version of iPXE can be built using e.g.

  make bin-x86_64-pcbios/ipxe.usb
  make bin-x86_64-pcbios/8086100e.mrom

The 64-bit BIOS version should appear to function identically to the
normal 32-bit BIOS version.  The physical memory layout is unaltered:
iPXE is still relocated to the top of the available 32-bit address
space.  The code is linked to a virtual address of 0xffffffffeb000000
(in the negative 2GB as required by -mcmodel=kernel), with 4kB pages
created to cover the whole of .textdata.  2MB pages are created to
cover the whole of the 32-bit address space.

The 32-bit portions of the code run with VIRTUAL_CS and VIRTUAL_DS
configured such that truncating a 64-bit virtual address gives a
32-bit virtual address pointing to the same physical location.

The stack pointer remains as a physical address when running in long
mode (although the .stack section is accessible via the negative 2GB
virtual address); this is done in order to simplify the handling of
interrupts occurring while executing a portion of 32-bit code with
flat physical addressing via PHYS_CODE().

Interrupts may be enabled in either 64-bit long mode, 32-bit protected
mode with virtual addresses, 32-bit protected mode with physical
addresses, or 16-bit real mode.  Interrupts occurring in any mode
other than real mode will be reflected down to real mode and handled
by whichever ISR is hooked into the BIOS interrupt vector table.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Rename prot_call() to virt_call()
Michael Brown [Mon, 22 Feb 2016 00:49:08 +0000 (00:49 +0000)] 
[librm] Rename prot_call() to virt_call()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Support userptr_t in 64-bit builds
Michael Brown [Sun, 21 Feb 2016 11:37:37 +0000 (11:37 +0000)] 
[librm] Support userptr_t in 64-bit builds

In a 64-bit build, the entirety of the 32-bit address space is
identity-mapped and so any valid physical address may immediately be
used as a virtual address.  Conversely, a virtual address that is
already within the 32-bit address space may immediately be used as a
physical address.

A valid virtual address that lies outside the 32-bit address space
must be an address within .textdata, and so can be converted to a
physical address by adding virt_offset.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Mark virt_offset, text16, data16, rm_cs, and rm_ds as constant
Michael Brown [Sun, 21 Feb 2016 11:13:04 +0000 (11:13 +0000)] 
[librm] Mark virt_offset, text16, data16, rm_cs, and rm_ds as constant

The physical locations of .textdata, .text16 and .data16 are constant
from the point of view of C code.  Mark the relevant variables as
constant to allow gcc to optimise out redundant reads.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Do not preserve flags unnecessarily
Michael Brown [Sun, 21 Feb 2016 01:01:28 +0000 (01:01 +0000)] 
[librm] Do not preserve flags unnecessarily

No callers of prot_to_phys, phys_to_prot, or intr_to_prot require the
flags to be preserved.  Remove the unnecessary pushfl/popfl pairs.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Add phys_call() wrapper for calling code with physical addressing
Michael Brown [Fri, 19 Feb 2016 19:43:04 +0000 (19:43 +0000)] 
[librm] Add phys_call() wrapper for calling code with physical addressing

Add a phys_call() wrapper function (analogous to the existing
real_call() wrapper function) for calling code with flat physical
addressing, and use this wrapper within the PHYS_CODE() macro.

Move the relevant functionality inside librm.S, where it more
naturally belongs.

The COMBOOT code currently uses explicit calls to _virt_to_phys and
_phys_to_virt.  These will need to be rewritten if our COMBOOT support
is ever generalised to be able to run in a 64-bit build.
Specifically:

  - com32_exec_loop() should be restructured to use PHYS_CODE()

  - com32_wrapper.S should be restructured to use an equivalent of
    prot_call(), passing parameters via a struct i386_all_regs

  - there appears to be no need for com32_wrapper.S to switch between
    external and internal stacks; this could be omitted to simplify
    the design.

For now, librm.S continues to expose _virt_to_phys and _phys_to_virt
for use by com32.c and com32_wrapper.S.  Similarly, librm.S continues
to expose _intr_to_virt for use by gdbidt.S.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[build] Fix building on older versions of binutils
Michael Brown [Fri, 19 Feb 2016 19:45:23 +0000 (19:45 +0000)] 
[build] Fix building on older versions of binutils

Some older versions of binutils have issues with both the use of
PROVIDE() and the interpretation of numeric literals within a section
description.

Work around these older versions by defining the required numeric
literals outside of any section description, and by automatically
determining whether or not to generate extra space for page tables
rather than relying on LDFLAGS.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Generate page tables for 64-bit builds
Michael Brown [Fri, 19 Feb 2016 03:18:11 +0000 (03:18 +0000)] 
[librm] Generate page tables for 64-bit builds

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Prepare for long-mode memory map
Michael Brown [Fri, 19 Feb 2016 01:50:13 +0000 (01:50 +0000)] 
[librm] Prepare for long-mode memory map

The bulk of the iPXE binary (the .textdata section) is physically
relocated at runtime to the top of the 32-bit address space in order
to allow space for an OS to be loaded.  The relocation is achieved
with the assistance of segmentation: we adjust the code and data
segment bases so that the link-time addresses remain valid.

Segmentation is not available (for normal code and data segments) in
long mode.  We choose to compile the C code with -mcmodel=kernel and
use a link-time address of 0xffffffffeb000000.  This choice allows us
to identity-map the entirety of the 32-bit address space, and to alias
our chosen link-time address to the physical location of our .textdata
section.  (This requires the .textdata section to always be aligned to
a page boundary.)

We simultaneously choose to set the 32-bit virtual address segment
bases such that the link-time addresses may simply be truncated to 32
bits in order to generate a valid 32-bit virtual address.  This allows
symbols in .textdata to be trivially accessed by both 32-bit and
64-bit code.

There is no (sensible) way in 32-bit assembly code to generate the
required R_X86_64_32S relocation records for these truncated symbols.
However, subtracting the fixed constant 0xffffffff00000000 has the
same effect as truncation, and can be represented in a standard
R_X86_64_32 relocation record.  We define the VIRTUAL() macro to
abstract away this truncation operation, and apply it to all
references by 32-bit (or 16-bit) assembly code to any symbols within
the .textdata section.

We define "virt_offset" for a 64-bit build as "the value to be added
to an address within .textdata in order to obtain its physical
address".  With this definition, the low 32 bits of "virt_offset" can
be treated by 32-bit code as functionally equivalent to "virt_offset"
in a 32-bit build.

We define "text16" and "data16" for a 64-bit build as the physical
addresses of the .text16 and .data16 sections.  Since a physical
address within the 32-bit address space may be used directly as a
64-bit virtual address (thanks to the identity map), this definition
provides the most natural access to variables in .text16 and .data16.
Note that this requires a minor adjustment in prot_to_real(), which
accesses .text16 using 32-bit virtual addresses.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[relocate] Preserve page alignment during relocation
Michael Brown [Fri, 19 Feb 2016 02:38:48 +0000 (02:38 +0000)] 
[relocate] Preserve page alignment during relocation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Transition to protected mode within init_librm()
Michael Brown [Fri, 19 Feb 2016 00:56:20 +0000 (00:56 +0000)] 
[librm] Transition to protected mode within init_librm()

Long-mode operation will require page tables, which are too large to
sensibly fit in our .data16 segment in base memory.

Add a portion of init_librm() running in 32-bit protected mode to
provide access to high memory.  Use this portion of init_librm() to
initialise the .textdata variables "virt_offset", "text16", and
"data16", eliminating the redundant (re)initialisation currently
performed on every mode transition as part of real_to_prot().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Provide an abstraction wrapper for prot_call
Michael Brown [Thu, 18 Feb 2016 23:23:38 +0000 (23:23 +0000)] 
[librm] Provide an abstraction wrapper for prot_call

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Convert prot_call() to a real-mode near call
Michael Brown [Thu, 18 Feb 2016 16:36:04 +0000 (16:36 +0000)] 
[librm] Convert prot_call() to a real-mode near call

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[prefix] Standardise calls to prot_call()
Michael Brown [Thu, 18 Feb 2016 16:32:37 +0000 (16:32 +0000)] 
[prefix] Standardise calls to prot_call()

Use the standard "pushl $function ; pushw %cs ; call prot_call"
sequence everywhere that prot_call() is used.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Simplify definitions for prot_call() and real_call() stack frames
Michael Brown [Thu, 18 Feb 2016 16:41:48 +0000 (16:41 +0000)] 
[librm] Simplify definitions for prot_call() and real_call() stack frames

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[prefix] Use garbage-collectable section names
Michael Brown [Thu, 18 Feb 2016 16:02:55 +0000 (16:02 +0000)] 
[prefix] Use garbage-collectable section names

Allow unused sections of libprefix.o to be removed via --gc-sections.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Use an 8kB stack for x86_64
Michael Brown [Thu, 18 Feb 2016 15:56:41 +0000 (15:56 +0000)] 
[bios] Use an 8kB stack for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Use garbage-collectable section names
Michael Brown [Thu, 18 Feb 2016 15:40:33 +0000 (15:40 +0000)] 
[librm] Use garbage-collectable section names

Allow unused sections of librm.o to be removed via --gc-sections.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Make uses of REAL_CODE() and PHYS_CODE() 64-bit clean
Michael Brown [Thu, 18 Feb 2016 14:38:41 +0000 (14:38 +0000)] 
[bios] Make uses of REAL_CODE() and PHYS_CODE() 64-bit clean

On a 64-bit CPU, any modification of a register by 32-bit or 16-bit
code will destroy the invisible upper 32 bits of the corresponding
64-bit register.  For example: a 32-bit "pushl %eax" followed by a
"popl %eax" will zero the upper half of %rax.  This differs from the
treatment of upper halves of 32-bit registers by 16-bit code: a
"pushw %ax" followed by a "popw %ax" will leave the upper 16 bits of
%eax unmodified.

Inline assembly generated using REAL_CODE() or PHYS_CODE() will
therefore have to preserve the upper halves of all registers, to avoid
clobbering registers that gcc expects to be preserved.

Output operands from REAL_CODE() and PHYS_CODE() assembly may
therefore contain undefined values in the upper 32 bits.

Fix by using explicit variable widths (e.g. uint32_t) for
non-discarded output operands, to ensure that undefined values in the
upper 32 bits of 64-bit registers are ignored.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[romprefix] Align PMM temporary decompression area to a page boundary
Michael Brown [Thu, 18 Feb 2016 02:58:03 +0000 (02:58 +0000)] 
[romprefix] Align PMM temporary decompression area to a page boundary

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[prefix] Align INT 15,88 temporary decompression area to a page boundary
Michael Brown [Wed, 17 Feb 2016 15:26:31 +0000 (15:26 +0000)] 
[prefix] Align INT 15,88 temporary decompression area to a page boundary

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Discard argument as part of return from real_call()
Michael Brown [Tue, 16 Feb 2016 23:37:46 +0000 (23:37 +0000)] 
[librm] Discard argument as part of return from real_call()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[librm] Discard argument as part of return from prot_call()
Michael Brown [Tue, 16 Feb 2016 23:16:49 +0000 (23:16 +0000)] 
[librm] Discard argument as part of return from prot_call()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Add bin-x86_64-pcbios build platform
Michael Brown [Tue, 16 Feb 2016 15:19:01 +0000 (15:19 +0000)] 
[bios] Add bin-x86_64-pcbios build platform

Move most arch/i386 files to arch/x86, and adjust the contents of the
Makefiles and the include/bits/*.h headers to reflect the new
locations.

This patch makes no substantive code changes, as can be seen using a
rename-aware diff (e.g. "git show -M5").

This patch does not make the pcbios platform functional for x86_64; it
merely allows it to compile without errors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Move isolinux definitions to Makefile.pcbios
Michael Brown [Tue, 16 Feb 2016 17:42:36 +0000 (17:42 +0000)] 
[bios] Move isolinux definitions to Makefile.pcbios

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Allow librm to be compiled for x86_64
Michael Brown [Tue, 16 Feb 2016 16:45:12 +0000 (16:45 +0000)] 
[bios] Allow librm to be compiled for x86_64

This commit does not make librm functional for x86_64; it merely
allows it to compile without errors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Allow memmap.c to be compiled for x86_64
Michael Brown [Tue, 16 Feb 2016 18:49:38 +0000 (18:49 +0000)] 
[bios] Allow memmap.c to be compiled for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Allow bios_console.c to be compiled for x86_64
Michael Brown [Tue, 16 Feb 2016 18:48:37 +0000 (18:48 +0000)] 
[bios] Allow bios_console.c to be compiled for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Allow bzimage.c to be compiled for x86_64
Michael Brown [Tue, 16 Feb 2016 18:41:58 +0000 (18:41 +0000)] 
[bios] Allow bzimage.c to be compiled for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Allow rtc_entropy.c to be compiled for x86_64
Michael Brown [Tue, 16 Feb 2016 16:57:46 +0000 (16:57 +0000)] 
[bios] Allow rtc_entropy.c to be compiled for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Allow relocate.c to be compiled for x86_64
Michael Brown [Tue, 16 Feb 2016 16:13:30 +0000 (16:13 +0000)] 
[bios] Allow relocate.c to be compiled for x86_64

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Use size_t when casting _text16_memsz and _data16_memsz
Michael Brown [Tue, 16 Feb 2016 16:28:12 +0000 (16:28 +0000)] 
[bios] Use size_t when casting _text16_memsz and _data16_memsz

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Use intptr_t when casting .text16 function pointers
Michael Brown [Tue, 16 Feb 2016 16:24:30 +0000 (16:24 +0000)] 
[bios] Use intptr_t when casting .text16 function pointers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.h
Michael Brown [Tue, 16 Feb 2016 15:48:03 +0000 (15:48 +0000)] 
[libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.h

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[prefix] Pad .text16 and .data16 segment sizes at build time
Michael Brown [Fri, 12 Feb 2016 13:59:06 +0000 (13:59 +0000)] 
[prefix] Pad .text16 and .data16 segment sizes at build time

Commit c64747d ("[librm] Speed up real-to-protected mode transition
under KVM") rounded down the .text16 segment address calculated in
alloc_basemem() to a multiple of 64 bytes in order to speed up mode
transitions under KVM.

This creates a potential discrepancy between alloc_basemem() and
free_basemem(), meaning that free_basemem() may free less memory than
was allocated by alloc_basemem().

Fix by padding the calculated sizes of both .text16 and .data16 to a
multiple of 64 bytes at build time.

Debugged-by: Yossef Efraim <yossefe@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[intel] Add INTEL_NO_PHY_RST for another I218-LM variant
Mika Tiainen [Tue, 9 Feb 2016 20:38:29 +0000 (22:38 +0200)] 
[intel] Add INTEL_NO_PHY_RST for another I218-LM variant

Fixed booting on HP EliteBook 820 G2 laptop.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[efi] Add missing definitions for function key scancodes
Michael Brown [Fri, 12 Feb 2016 13:08:52 +0000 (13:08 +0000)] 
[efi] Add missing definitions for function key scancodes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[pxe] Clarify comments regarding shrinking of cached DHCP packet
Michael Brown [Thu, 11 Feb 2016 19:14:00 +0000 (19:14 +0000)] 
[pxe] Clarify comments regarding shrinking of cached DHCP packet

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[iobuf] Improve robustness of I/O buffer allocation
Michael Brown [Thu, 11 Feb 2016 18:44:24 +0000 (18:44 +0000)] 
[iobuf] Improve robustness of I/O buffer allocation

Guard against various corner cases (such as zero-length buffers, zero
alignments, and integer overflow when rounding up allocation lengths
and alignments) and ensure that the struct io_buffer is correctly
aligned even when the caller requests a non-zero alignment for the I/O
buffer itself.

Add self-tests to verify that the resulting alignments and lengths are
correct for a range of allocations.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[malloc] Guard against unsigned integer overflow
Michael Brown [Sat, 6 Feb 2016 10:20:57 +0000 (10:20 +0000)] 
[malloc] Guard against unsigned integer overflow

Commit f3fbb5f ("[malloc] Avoid integer overflow for excessively large
memory allocations") fixed signed integer overflow issues caused by
the use of ssize_t, but did not guard against unsigned integer
overflow.

Add explicit checks for unsigned integer overflow where needed.  As a
side bonus, erroneous calls to malloc_dma() with an (illegal) size of
zero will now fail cleanly.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[ehci] Add extra debugging information
Michael Brown [Fri, 5 Feb 2016 21:03:17 +0000 (21:03 +0000)] 
[ehci] Add extra debugging information

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[ath9k] Remove broken ath_rxbuf_alloc()
Michael Brown [Thu, 28 Jan 2016 14:15:36 +0000 (14:15 +0000)] 
[ath9k] Remove broken ath_rxbuf_alloc()

ath_rx_init() demonstrates some serious confusion over how to use
pointers, resulting in (uint32_t*)NULL being used as a temporary
variable.  This does not end well.

The broken code in question is performing manual alignment of I/O
buffers, which can now be achieved more simply using alloc_iob_raw().
Fix by removing ath_rxbuf_alloc() entirely.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[slam] Avoid potential division by zero
Michael Brown [Wed, 27 Jan 2016 23:27:47 +0000 (23:27 +0000)] 
[slam] Avoid potential division by zero

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[tcp] Guard against malformed TCP options
Michael Brown [Wed, 27 Jan 2016 23:06:50 +0000 (23:06 +0000)] 
[tcp] Guard against malformed TCP options

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[intel] Add INTEL_NO_PHY_RST for I218-LM
Hummel Frank [Wed, 27 Jan 2016 13:07:42 +0000 (13:07 +0000)] 
[intel] Add INTEL_NO_PHY_RST for I218-LM

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[uri] Apply URI decoding for all parsed URIs
Michael Brown [Tue, 26 Jan 2016 16:16:13 +0000 (16:16 +0000)] 
[uri] Apply URI decoding for all parsed URIs

The various early-exit paths in parse_uri() accidentally bypass the
URI field decoding.  The result is that opaque or relative URIs do not
undergo URI field decoding, resulting in double-encoding when the URIs
are subsequently used.  For example:

  #!ipxe
  set mac ${macstring}
  imgfetch /boot/by-mac/${mac:uristring}

would result in an HTTP GET such as

  GET /boot/by-mac/00%253A0c%253A29%253Ac5%253A39%253Aa1 HTTP/1.1

rather than the expected

  GET /boot/by-mac/00%3A0c%3A29%3Ac5%3A39%3Aa1 HTTP/1.1

Fix by ensuring that URI decoding is always applied regardless of the
URI format.

Reported-by: Andrew Widdersheim <awiddersheim@inetu.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[tftp] Mangle initial slash on TFTP URIs
Michael Brown [Thu, 21 Jan 2016 16:24:16 +0000 (16:24 +0000)] 
[tftp] Mangle initial slash on TFTP URIs

TFTP URIs are intrinsically problematic, since:

- TFTP servers may use either normal slashes or backslashes as a
  directory separator,

- TFTP servers allow filenames to be specified using relative paths
  (with no initial directory separator),

- TFTP filenames present in a DHCP filename field may use special
  characters such as "?" or "#" that prevent parsing as a generic URI.

As of commit 7667536 ("[uri] Refactor URI parsing and formatting"), we
have directly constructed TFTP URIs from DHCP next-server and filename
pairs, avoiding the generic URI parser.  This eliminated the problems
related to special characters, but indirectly made it impossible to
parse a "tftp://..." URI string into a TFTP URI with a non-absolute
path.

Re-introduce the convention of requiring an extra slash in a
"tftp://..." URI string in order to specify a TFTP URI with an initial
slash in the filename.  For example:

  tftp://192.168.0.1/boot/pxelinux.0  => RRQ "boot/pxelinux.0"
  tftp://192.168.0.1//boot/pxelinux.0 => RRQ "/boot/pxelinux.0"

This is ugly, but there seems to be no other sensible way to provide
the ability to specify all possible TFTP filenames.

A side-effect of this change is that format_uri() will no longer add a
spurious initial "/" when formatting a relative URI string.  This
improves the console output when fetching an image specified via a
relative URI.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[ocsp] Avoid including a double path separator in request URI
Michael Brown [Thu, 21 Jan 2016 17:50:34 +0000 (17:50 +0000)] 
[ocsp] Avoid including a double path separator in request URI

The OCSP responder URI included within an X.509 certificate may or may
not include a trailing slash.  We currently rely on the fact that
format_uri() incorrectly inserts an initial slash, which we include
unconditionally within the OCSP request URI.

Switch to using uri_encode() directly, and insert a slash only if the
X.509 certificate's OCSP responder URI does not already include a
trailing slash.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[uri] Avoid potentially large stack allocation
Michael Brown [Thu, 21 Jan 2016 15:53:44 +0000 (15:53 +0000)] 
[uri] Avoid potentially large stack allocation

Avoid potentially large stack allocation in resolve_path().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[autoboot] Fix incorrect boolean logic
Michael Brown [Tue, 19 Jan 2016 08:16:17 +0000 (08:16 +0000)] 
[autoboot] Fix incorrect boolean logic

Commit 53d2d9e ("[uri] Generalise tftp_uri() to pxe_uri()") introduced
a regression in which an NFS root path would no longer be treated as
an unsupported root path, causing a boot with an NFS root path to fail
with a "Could not open SAN device" error.

Reported-by: David Evans <dave.evans55@googlemail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[smsc95xx] Reserve headroom in received packets
Michael Brown [Tue, 19 Jan 2016 00:04:33 +0000 (00:04 +0000)] 
[smsc95xx] Reserve headroom in received packets

Some protocols (such as ARP) may modify the received packet and re-use
the same I/O buffer for transmission of a reply.  The SMSC95XX
transmit header is larger than the receive header: the re-used I/O
buffer therefore does not have sufficient headroom for the transmit
header, and the ARP reply will therefore fail to be transmitted.  This
is essentially the same problem as in commit 2e72d10 ("[ncm] Reserve
headroom in received packets").

Fix by reserving sufficient space at the start of each received packet
to allow for the difference between the lengths of the transmit and
receive headers.

This problem is not caught by the current driver development test
suite (documented at http://ipxe.org/dev/driver), since even the large
file transfer tests tend to completely sufficiently quickly that there
is no need for the server to ever send an ARP request.  The failure
shows up only when using a very slow protocol such as RFC7440-enhanced
TFTP (as used by Windows Deployment Services).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[usb] Allow USB endpoints to specify a reserved header length for refills
Michael Brown [Tue, 19 Jan 2016 00:01:11 +0000 (00:01 +0000)] 
[usb] Allow USB endpoints to specify a reserved header length for refills

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[smsc95xx] Enable LEDs
Michael Brown [Wed, 13 Jan 2016 07:25:05 +0000 (07:25 +0000)] 
[smsc95xx] Enable LEDs

The LED pins are configured by default as GPIO inputs.  While it is
conceivable that a board might actually use these pins as GPIOs, no
such board is known to exist.

The Linux smsc95xx driver configures these pins unconditionally as LED
outputs.  Assume that it is safe to do likewise.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[netdevice] Add "ifname" setting
Andrew Widdersheim [Sat, 16 Jan 2016 16:21:34 +0000 (11:21 -0500)] 
[netdevice] Add "ifname" setting

Expose the network interface name (e.g. "net0") as a setting.  This
allows a script to obtain the name of the most recently opened network
interface via ${netX/ifname}.

Signed-off-by: Andrew Widdersheim <amwiddersheim@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[build] Add named configuration for public cloud environments
Michael Brown [Mon, 18 Jan 2016 08:37:27 +0000 (08:37 +0000)] 
[build] Add named configuration for public cloud environments

Add a named CONFIG=cloud configuration, which enables console types
useful for obtaining output from virtual machines in public clouds
such as AWS EC2.

An image suitable for use in AWS EC2 can be built using

  make bin/ipxe.usb CONFIG=cloud EMBED=config/cloud/aws.ipxe

The embedded script will direct iPXE to download and execute the EC2
"user-data" file, which is always available to an EC2 VM via the URI
http://169.254.169.254/latest/user-data (regardless of the VPC
networking settings).  The boot can therefore be controlled by
modifying the per-instance user data, without having to modify the
boot disk image.

Console output can be obtained via syslog (with a syslog server
configured in the user-data script), via the AWS "System Log" (after
the instance has been stopped), or as a last resort from the log
partition on the boot disk.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[stp] Fix incorrectly disambiguated errors
Michael Brown [Thu, 14 Jan 2016 12:39:01 +0000 (12:39 +0000)] 
[stp] Fix incorrectly disambiguated errors

The three nominally-disambiguated ENOTSUP errors accidentally all used
the same error disambiguator, rendering them identical.  Fix by
changing all three values.  We avoid reusing the 0x01 disambiguator
value, since that remains ambiguous in older binaries.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[debug] Allow debug colourisation to be disabled
Michael Brown [Tue, 12 Jan 2016 15:35:06 +0000 (15:35 +0000)] 
[debug] Allow debug colourisation to be disabled

Some BIOS console redirection capabilities do not work well with the
colourised debug messages used by iPXE.  We already allow the range of
colours to be controlled via the DBGCOL=... build parameter.  Extend
this syntax to allow DBGCOL=0 to be used to mean "disable colours".

Requested-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[i386] Add check_bios_interrupts() debug function
Michael Brown [Tue, 12 Jan 2016 08:27:59 +0000 (08:27 +0000)] 
[i386] Add check_bios_interrupts() debug function

Provide a debug function check_bios_interrupts() to look for changes
to the interrupt vector table.  This can be useful when investigating
the behaviour (including crashes) of external PXE NBPs.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[pxe] Add debug message to display real-mode segment addresses
Michael Brown [Mon, 11 Jan 2016 16:21:08 +0000 (16:21 +0000)] 
[pxe] Add debug message to display real-mode segment addresses

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[pxe] Colourise debug output
Michael Brown [Mon, 11 Jan 2016 16:20:05 +0000 (16:20 +0000)] 
[pxe] Colourise debug output

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Profile post work queue entry operations
Michael Brown [Sun, 10 Jan 2016 15:44:00 +0000 (15:44 +0000)] 
[infiniband] Profile post work queue entry operations

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[tftp] Do not change current working URI when TFTP server is cleared
Michael Brown [Sat, 9 Jan 2016 14:51:21 +0000 (14:51 +0000)] 
[tftp] Do not change current working URI when TFTP server is cleared

For historical reasons, iPXE sets the current working URI to the root
of the TFTP server whenever the TFTP server address is changed.  This
was originally implemented in the hope of allowing a DHCP-provided
TFTP filename to be treated simply as a relative URI.  This usage
turns out to be impractical since DHCP-provided TFTP filenames may
include characters which would have special significance to the URI
parser, and so the DHCP next-server+filename combination is now
handled by the dedicated pxe_uri() function instead.

The practice of setting the current working URI to the root of the
TFTP server is potentially helpful for interactive uses of iPXE,
allowing a user to type e.g.

  iPXE> dhcp
  Configuring (net0 52:54:00:12:34:56)... ok
  iPXE> chain pxelinux.0

and have the URI "pxelinux.0" interpreted as being relative to the
root of the TFTP server provided via DHCP.

The current implementation of tftp_apply_settings() has an unintended
flaw.  When the "dhcp" command is used to renew a DHCP lease (or to
pick up potentially modified DHCP options), the old settings block
will be unregistered before the new settings block is registered.
This causes tftp_apply_settings() to believe that the TFTP server has
been changed twice (to 0.0.0.0 and back again), and so the current
working URI will always be set to the root of the TFTP server, even if
the DHCP response provides exactly the same TFTP server as previously.

Fix by doing nothing in tftp_apply_settings() whenever there is no
TFTP server address.

Debugged-by: Andrew Widdersheim <awiddersheim@inetu.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[downloader] Update image URI in response to a redirection
Michael Brown [Sat, 9 Jan 2016 13:23:13 +0000 (13:23 +0000)] 
[downloader] Update image URI in response to a redirection

Update the image's recorded URI when a download redirection occurs.
This ensures that URIs relative to a redirected download are resolved
correctly.

In particular, this allows for the use of relative URIs in scripts
that are themselves downloaded via a redirection, such as the HTTP 301
redirection used to fix up URIs pointing to directories but omitting
the trailing slash (e.g. "http://boot.ipxe.org/demo", which will be
redirected to "http://boot.ipxe.org/demo/").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[image] Provide image_set_uri() to modify an image's URI
Michael Brown [Sat, 9 Jan 2016 13:22:37 +0000 (13:22 +0000)] 
[image] Provide image_set_uri() to modify an image's URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[http] Handle relative redirection URIs
Michael Brown [Sat, 9 Jan 2016 13:20:55 +0000 (13:20 +0000)] 
[http] Handle relative redirection URIs

Resolve redirection URIs as being relative to the original HTTP
request URI, rather than treating them as being implicitly relative to
the current working URI.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[usb] Add support for numeric keypad on USB keyboards
Michael Brown [Wed, 6 Jan 2016 16:30:01 +0000 (16:30 +0000)] 
[usb] Add support for numeric keypad on USB keyboards

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[romprefix] Report an optimistic runtime size estimate
Michael Brown [Tue, 5 Jan 2016 23:40:18 +0000 (23:40 +0000)] 
[romprefix] Report an optimistic runtime size estimate

Commit 5de45cd ("[romprefix] Report a pessimistic runtime size
estimate") set the PCI3.0 "runtime size" field equal to the worst-case
runtime size, on the basis that there is no guarantee that PMM
allocation will succeed and hence no guarantee that we will be able to
shrink the ROM image.

On a PCI3.0 system where PMM allocation would succeed, this can cause
the BIOS to unnecessarily refuse to initialise the iPXE ROM due to a
perceived shortage of option ROM space.

Fix by reporting the best-case runtime size via the PCI header, and
checking that we have sufficient runtime space (if applicable).  This
allows iPXE ROMs to initialise on PCI3.0 systems that might otherwise
fail due to a shortage of option ROM space.

This may cause iPXE ROMs to fail to initialise on PCI3.0 systems where
PMM is broken.  (Pre-PCI3.0 systems are unaffected since there must
already have been sufficient option ROM space available for the
initialisation entry point to be called.)

On balance, it seems preferable to avoid breaking "good" systems
(PCI3.0 with working PMM) at the cost of potentially breaking "bad"
systems (PCI3.0 with broken PMM).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[vmware] Expose GuestRPC mechanism in 64-bit builds
Michael Brown [Tue, 5 Jan 2016 17:20:36 +0000 (17:20 +0000)] 
[vmware] Expose GuestRPC mechanism in 64-bit builds

The GuestRPC mechanism (used for VMWARE_SETTINGS and CONSOLE_VMWARE)
does not use any real-mode code and so can be exposed in both 64-bit
and 32-bit builds.

Reported-by: Matthew Helton <mwhelton@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[crypto] Dual-license more selected DRBG files
Michael Brown [Mon, 4 Jan 2016 15:39:07 +0000 (15:39 +0000)] 
[crypto] Dual-license more selected DRBG files

Allow the use of the iPXE DRBG implementation in BSD-licensed
projects.

Requested-by: Sean Davis <dive@hq.endersgame.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[smsc95xx] Fetch MAC from SMBIOS OEM string for Honeywell VM3
Michael Brown [Wed, 23 Dec 2015 15:25:31 +0000 (15:25 +0000)] 
[smsc95xx] Fetch MAC from SMBIOS OEM string for Honeywell VM3

The Honeywell VM3 has no attached EEPROM, and records the MAC address
within an SMBIOS OEM string.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[crypto] Dual-license selected DRBG files
Michael Brown [Thu, 31 Dec 2015 14:44:45 +0000 (14:44 +0000)] 
[crypto] Dual-license selected DRBG files

Allow the use of the iPXE DRBG implementation in BSD-licensed
projects.

Requested-by: Sean Davis <dive@hq.endersgame.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[smsc95xx] Allow for multiple methods for obtaining the MAC address
Michael Brown [Wed, 23 Dec 2015 15:02:48 +0000 (15:02 +0000)] 
[smsc95xx] Allow for multiple methods for obtaining the MAC address

The SMSC95xx devices tend to be used in embedded systems with a
variety of ad-hoc mechanisms for storing the MAC address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[settings] Expose SMBIOS settings as global variables
Michael Brown [Wed, 23 Dec 2015 15:28:08 +0000 (15:28 +0000)] 
[settings] Expose SMBIOS settings as global variables

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bios] Add support for injecting keypresses
Michael Brown [Fri, 18 Dec 2015 10:05:58 +0000 (10:05 +0000)] 
[bios] Add support for injecting keypresses

When USB network card drivers are used, the BIOS' legacy USB
capability is necessarily disabled since there is no way to share the
host controller between the BIOS and iPXE.

Commit 3726722 ("[usb] Add basic support for USB keyboards") added
support allowing a USB keyboard to be used within iPXE.  However,
external code such as a PXE NBP has no way to utilise this support,
and so a USB keyboard cannot be used to control a PXE NBP loaded from
a USB network card.

Add support for injecting keypresses from any iPXE console into the
BIOS keyboard buffer.  This allows external code such as a PXE NBP to
function with a USB keyboard even after the BIOS' legacy USB
capability has been disabled.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[build] Allow extra objects to be included in an all-drivers build
Michael Brown [Thu, 17 Dec 2015 13:45:35 +0000 (13:45 +0000)] 
[build] Allow extra objects to be included in an all-drivers build

The build system allows for additional drivers (or other objects) to
be specified using build targets such as

  make bin/intel--realtek.usb
  make bin/8086100e--8086100f.mrom

This currently fails if the base target is the "bin/ipxe.*" all-drivers
target, e.g.

  make bin/ipxe--acm.usb

Fix the build target parsing logic to allow additional drivers (or
other objects) to be included on top of the base all-drivers target.

This can be used to include USB network card drivers, which are not
yet included by default in the all-drivers build.

Reported-by: Andrew Sloma <asloma@lenovo.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[efi] Centralise EFI file system info GUIDs
Michael Brown [Wed, 9 Dec 2015 17:35:24 +0000 (17:35 +0000)] 
[efi] Centralise EFI file system info GUIDs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[xhci] Ensure that zero-length packets are not part of a TRB chain
Michael Brown [Mon, 7 Dec 2015 22:30:27 +0000 (22:30 +0000)] 
[xhci] Ensure that zero-length packets are not part of a TRB chain

Some xHCI controllers (such as qemu's emulated xHCI controller) do not
correctly handle zero-length packets that are part of a TRB chain.
The zero-length TRB ends up being squashed and does not result in a
zero-length packet as seen by the device.

Work around this problem by marking the zero-length packet as
belonging to a separate transfer descriptor.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[intel] Add INTEL_NO_PHY_RST for I217-LM
Torgeir Wulfsberg [Mon, 7 Dec 2015 19:52:16 +0000 (19:52 +0000)] 
[intel] Add INTEL_NO_PHY_RST for I217-LM

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[acm] Add support for CDC-ACM (aka USB RNDIS) devices
Michael Brown [Tue, 1 Dec 2015 14:46:48 +0000 (14:46 +0000)] 
[acm] Add support for CDC-ACM (aka USB RNDIS) devices

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[usb] Allow additional settling time for out-of-spec hubs
Michael Brown [Mon, 7 Dec 2015 00:54:01 +0000 (00:54 +0000)] 
[usb] Allow additional settling time for out-of-spec hubs

Some hubs (e.g. the Avocent Corp. Virtual Hub on a Lenovo x3550
Integrated Management Module) have been observed to require more than
the standard 200ms for ports to stabilise, with the result that
devices appear to disconnect and immediately reconnect during the
initial bus enumeration.

Work around this problem by allowing specific hubs an extra 500ms of
settling time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[usb] Allow USB device IDs to include arbitrary driver-specific data
Michael Brown [Mon, 7 Dec 2015 00:32:08 +0000 (00:32 +0000)] 
[usb] Allow USB device IDs to include arbitrary driver-specific data

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[usb] Record USB device speed separately from current port speed
Michael Brown [Sun, 6 Dec 2015 23:41:26 +0000 (23:41 +0000)] 
[usb] Record USB device speed separately from current port speed

Record the speed of a USB device based on the port's speed at the time
that the device was enabled.  This allows us to remember the device's
speed even after the device has been disconnected (and so the port's
current speed has changed).

In particular, this allows us to correctly identify the transaction
translator for a low-speed or full-speed device after the device has
been disconnected.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[usb] Use port->disconnected to check for disconnected devices
Michael Brown [Sun, 6 Dec 2015 23:22:37 +0000 (23:22 +0000)] 
[usb] Use port->disconnected to check for disconnected devices

The usb_message() and usb_stream() functions currently check for
port->speed==USB_SPEED_NONE to determine whether or not a device has
been unplugged.  This test will give a false negative result if a new
device has been plugged in before the hotplug mechanism has finished
handling the removal of the old device.

Fix by checking instead the port->disconnected flag, which is now
cleared only after completing the removal of the old device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[efi] Add %.usb target for building EFI-bootable USB (or other) disk images
Michael Brown [Sat, 5 Dec 2015 23:54:10 +0000 (23:54 +0000)] 
[efi] Add %.usb target for building EFI-bootable USB (or other) disk images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bitops] Provide BIT_QWORD_PTR()
Michael Brown [Tue, 24 Nov 2015 17:28:23 +0000 (17:28 +0000)] 
[bitops] Provide BIT_QWORD_PTR()

Provide BIT_QWORD_PTR() to allow for easy extraction of non-endian
fields (e.g. Infiniband GUIDs) without unnecessary byte swapping.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[smsc95xx] Add driver for SMSC/Microchip LAN95xx USB Ethernet NICs
Michael Brown [Fri, 13 Nov 2015 13:51:17 +0000 (13:51 +0000)] 
[smsc95xx] Add driver for SMSC/Microchip LAN95xx USB Ethernet NICs

Tested using QEMU and usbredir to expose the LAN9512 chip present on a
Raspberry Pi.

There is a known issue with the LAN9512: an extra two bytes are
appended to every transmitted packet.  These two bytes comprise:

  {   0x00,   0x08 } if packet length == 0 (mod 8)
  { CRC[0],   0x00 } if packet length == 7 (mod 8)
  { CRC[0], CRC[1] } otherwise

The extra bytes are appended whether the Ethernet CRC is generated
manually or added automatically by the hardware.  The issue occurs
with the Linux kernel driver as well as the iPXE driver.  It appears
to be an undocumented hardware errata.

TCP/IP traffic is not affected, since the IP header length field
causes the extraneous bytes to be discarded by the receiver.  However,
protocols that rely on the length of the Ethernet frame (such as FCoE
or iPXE's "lotest" protocol) will be unusable on this hardware.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[bitops] Fix definitions for big-endian devices
Michael Brown [Mon, 30 Nov 2015 22:22:13 +0000 (22:22 +0000)] 
[bitops] Fix definitions for big-endian devices

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[pci] Add definitions for PCI Express function level reset (FLR)
Michael Brown [Wed, 25 Nov 2015 09:32:45 +0000 (09:32 +0000)] 
[pci] Add definitions for PCI Express function level reset (FLR)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
5 years ago[infiniband] Add qword accessors for ib_guid and ib_gid
Michael Brown [Mon, 30 Nov 2015 16:24:23 +0000 (16:24 +0000)] 
[infiniband] Add qword accessors for ib_guid and ib_gid

Signed-off-by: Michael Brown <mcb30@ipxe.org>