ipxe.git
6 years ago[peerdist] Include trimmed range within content information block
Michael Brown [Mon, 20 Jul 2015 17:17:53 +0000 (18:17 +0100)] 
[peerdist] Include trimmed range within content information block

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[netdevice] Allow network devices to disclaim IRQ support at runtime
Michael Brown [Tue, 28 Jul 2015 14:05:44 +0000 (15:05 +0100)] 
[netdevice] Allow network devices to disclaim IRQ support at runtime

VLAN and 802.11 devices use a network device operations structure that
wraps an underlying structure.  For example, the vlan_operations
structure wraps the network device operations structure of the
underlying trunk device.  This can cause false positives from the
current implementation of netdev_irq_supported(), which will always
report that VLAN devices support interrupts since it has no visibility
into the support provided by the underlying trunk device.

Fix by allowing network devices to explicitly flag that interrupts are
not supported, despite the presence of an irq() method.

Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[iscsi] Add missing "break" statements
Michael Brown [Tue, 28 Jul 2015 13:11:35 +0000 (14:11 +0100)] 
[iscsi] Add missing "break" statements

iscsi_tx_done() is missing "break" statements at the end of each case.
(Fortunately, this happens not to cause a bug in practice, since
iscsi_login_request_done() is effectively a no-op when completing a
data-out PDU.)

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipv4] Allow IPv4 socket addresses to include a scope ID
Michael Brown [Tue, 21 Jul 2015 13:54:11 +0000 (14:54 +0100)] 
[ipv4] Allow IPv4 socket addresses to include a scope ID

Extend the IPv6 concept of "scope ID" (indicating the network device
index) to IPv4 socket addresses, so that IPv4 multicast transmissions
may specify the transmitting network device.

The scope ID is not (currently) exposed via the string representation
of the socket address, since IPv4 does not use the IPv6 concept of
link-local addresses (which could legitimately be specified in a URI).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipv4] Redefine IP address constants to avoid unnecessary byte swapping
Michael Brown [Tue, 21 Jul 2015 14:26:52 +0000 (15:26 +0100)] 
[ipv4] Redefine IP address constants to avoid unnecessary byte swapping

Redefine various IPv4 address constants and testing macros to avoid
unnecessary byte swapping at runtime, and slightly rename the macros
to prevent code from accidentally using the old definitions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[netdevice] Avoid using zero as a network device index
Michael Brown [Tue, 21 Jul 2015 13:51:16 +0000 (14:51 +0100)] 
[netdevice] Avoid using zero as a network device index

Avoid using zero as a network device index, so that a zero
sin6_scope_id can be used to mean "unspecified" (rather than
unintentionally meaning "net0").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipv6] Treat a missing network device name as "netX"
Michael Brown [Tue, 28 Jul 2015 12:00:15 +0000 (13:00 +0100)] 
[ipv6] Treat a missing network device name as "netX"

When an IPv6 socket address string specifies a link-local or multicast
address but does not specify the requisite network device name
(e.g. "fe80::69ff:fe50:5845" rather than "fe80::69ff:fe50:5845%net0"),
assume the use of "netX".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[build] Fix strict-aliasing warning on older gcc versions
Michael Brown [Mon, 27 Jul 2015 22:28:01 +0000 (23:28 +0100)] 
[build] Fix strict-aliasing warning on older gcc versions

Reported-by: James A. Peltier <jpeltier@sfu.ca>
Reported-by: Matthew Helton <mwhelton@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[crypto] Remove AXTLS headers
Michael Brown [Mon, 27 Jul 2015 14:06:20 +0000 (15:06 +0100)] 
[crypto] Remove AXTLS headers

Remove AXTLS headers now that no AXTLS code remains, with many thanks
to the AXTLS project for use of their cryptography code over the past
several years.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[test] Add NIST self-tests for AES192 in ECB and CBC modes
Michael Brown [Sat, 25 Jul 2015 13:54:57 +0000 (14:54 +0100)] 
[test] Add NIST self-tests for AES192 in ECB and CBC modes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[crypto] Replace AES implementation
Michael Brown [Fri, 24 Jul 2015 23:16:32 +0000 (00:16 +0100)] 
[crypto] Replace AES implementation

Replace the AES implementation from AXTLS with a dedicated iPXE
implementation which is slightly smaller and around 1000% faster.
This implementation has been verified using the existing self-tests
based on the NIST AES test vectors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[test] Add NIST self-tests for AES128 and AES256 in ECB mode
Michael Brown [Mon, 27 Jul 2015 13:53:32 +0000 (14:53 +0100)] 
[test] Add NIST self-tests for AES128 and AES256 in ECB mode

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[test] Define shortcuts for frequently-used NIST AES test vectors
Michael Brown [Mon, 27 Jul 2015 13:24:55 +0000 (14:24 +0100)] 
[test] Define shortcuts for frequently-used NIST AES test vectors

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[test] Generalise cipher tests and use okx()
Michael Brown [Mon, 27 Jul 2015 13:00:57 +0000 (14:00 +0100)] 
[test] Generalise cipher tests and use okx()

Generalise the existing support for performing CBC-mode block cipher
tests, and update the code to use okx() for neater reporting of test
results.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[crypto] Add ECB block cipher mode (for debug and self-tests only)
Michael Brown [Mon, 27 Jul 2015 01:48:49 +0000 (02:48 +0100)] 
[crypto] Add ECB block cipher mode (for debug and self-tests only)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[802.11] Use correct SHA1_DIGEST_SIZE constant name
Michael Brown [Sat, 25 Jul 2015 13:42:06 +0000 (14:42 +0100)] 
[802.11] Use correct SHA1_DIGEST_SIZE constant name

The constant SHA1_SIZE is defined only as part of the imported AXTLS code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[crypto] Add bit-rotation functions for 8-bit and 16-bit values
Michael Brown [Sat, 25 Jul 2015 13:41:30 +0000 (14:41 +0100)] 
[crypto] Add bit-rotation functions for 8-bit and 16-bit values

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[build] Fix compiler warnings on some gcc versions
Michael Brown [Mon, 27 Jul 2015 14:15:12 +0000 (15:15 +0100)] 
[build] Fix compiler warnings on some gcc versions

xfer_buffer() uses intf_get_dest_op() to obtain the destination
interface for xfer_deliver(), in order to check that this is the same
interface which provides xfer_buffer().  The return value from
intf_get_dest_op() (which contains the actual method implementing
xfer_deliver()) is not used.

On some gcc versions, this triggers a "value computed is not used"
warning, since the explicit type cast included within the
intf_get_dest_op() macro is treated as a "value computed".

Fix by explicitly casting the result of intf_get_dest_op() to void.

Reported-by: Matthew Helton <mwhelton@gmail.com>
Reported-by: James A. Peltier <jpeltier@sfu.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[downloader] Provide direct access to the underlying data transfer buffer
Michael Brown [Mon, 20 Jul 2015 11:17:13 +0000 (12:17 +0100)] 
[downloader] Provide direct access to the underlying data transfer buffer

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[downloader] Use generic data-transfer buffer mechanism
Michael Brown [Wed, 15 Jul 2015 12:55:56 +0000 (13:55 +0100)] 
[downloader] Use generic data-transfer buffer mechanism

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xferbuf] Add xfer_buffer() to provide direct access to underlying buffer
Michael Brown [Mon, 20 Jul 2015 11:15:21 +0000 (12:15 +0100)] 
[xferbuf] Add xfer_buffer() to provide direct access to underlying buffer

Allow data transfer buffer users to provide direct access to their
underlying data transfer buffer.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xferbuf] Generalise to handle umalloc()-based buffers
Michael Brown [Wed, 15 Jul 2015 12:43:58 +0000 (13:43 +0100)] 
[xferbuf] Generalise to handle umalloc()-based buffers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xfer] Add xfer_check_order() utility function
Michael Brown [Mon, 20 Jul 2015 16:53:30 +0000 (17:53 +0100)] 
[xfer] Add xfer_check_order() utility function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xfer] Use intf_poke() to implement xfer_window_changed()
Michael Brown [Wed, 8 Jul 2015 15:25:44 +0000 (16:25 +0100)] 
[xfer] Use intf_poke() to implement xfer_window_changed()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[interface] Add intf_poke() helper
Michael Brown [Wed, 8 Jul 2015 15:24:11 +0000 (16:24 +0100)] 
[interface] Add intf_poke() helper

Reduce the cost of implementing object methods which convey no
information beyond the fact that the method has been called.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[profile] Add profile_custom() for profiling with arbitrary time units
Michael Brown [Tue, 21 Jul 2015 21:26:48 +0000 (22:26 +0100)] 
[profile] Add profile_custom() for profiling with arbitrary time units

Provide profile_custom() as a trivial wrapper around profile_update()
to allow for the use of the profiling infrastructure by code using
timers other than the default profile_timestamp() provider.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[fault] Add inject_corruption() to randomly corrupt data
Michael Brown [Wed, 22 Jul 2015 13:29:20 +0000 (14:29 +0100)] 
[fault] Add inject_corruption() to randomly corrupt data

Provide an inject_corruption() function that can be used to randomly
corrupt data bytes with configurable probabilities.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[fault] Generalise NETDEV_DISCARD_RATE fault injection mechanism
Michael Brown [Wed, 22 Jul 2015 01:56:49 +0000 (02:56 +0100)] 
[fault] Generalise NETDEV_DISCARD_RATE fault injection mechanism

Provide a generic inject_fault() function that can be used to inject
random faults with configurable probabilities.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[tcp] Ensure FIN is actually sent if connection is closed while idle
Michael Brown [Sat, 18 Jul 2015 09:57:51 +0000 (10:57 +0100)] 
[tcp] Ensure FIN is actually sent if connection is closed while idle

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[build] Add named configuration for qemu
Michael Brown [Wed, 22 Jul 2015 19:55:44 +0000 (20:55 +0100)] 
[build] Add named configuration for qemu

Add a named configuration for qemu, based on the config.ipxe.general.h
file taken from the current qemu repository and enabling the option to
work around the missing EFI_PXE_BASE_CODE_PROTOCOL.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[efi] Allow user experience to be downgraded
Michael Brown [Wed, 22 Jul 2015 19:25:17 +0000 (20:25 +0100)] 
[efi] Allow user experience to be downgraded

iPXE does not currently provide EFI_PXE_BASE_CODE_PROTOCOL: this
causes failures when chainloading bootloaders such as shim.efi which
assume that this protocol will be present.

Provide the ability to work around these problems via the build
configuration option EFI_DOWNGRADE_UX.  If this option is enabled,
then we will not install our usual EFI_LOAD_FILE_PROTOCOL
implementation, thereby allowing the platform firmware to install its
own EFI_PXE_BASE_CODE_PROTOCOL implementation on top of our
EFI_SIMPLE_NETWORK_PROTOCOL handle.

A somewhat major side-effect of this workaround is that almost all
iPXE features will be disabled.

This configuration option will be removed in future when support for
EFI_PXE_BASE_CODE_PROTOCOL is added.

Requested-by: Laszlo Ersek <lersek@redhat.com>
Requested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[efi] Fix receive and transmit completion reporting
Michael Brown [Wed, 22 Jul 2015 17:31:45 +0000 (18:31 +0100)] 
[efi] Fix receive and transmit completion reporting

Fix the TxBuf value filled in by GetStatus() to report the transmit
buffer address as required by the (now clarified) specification.

Simplify "interrupt" handling in GetStatus() to report only that one
or more packets have been transmitted or received; there is no need to
report one GetStatus() "interrupt" per packet.

Simplify receive handling to dequeue received packets immediately from
the network device into an internal list (thereby avoiding the hacks
previously used to determine when to report new packet arrivals).

Originally-fixed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[bios] Add ANSI blink attribute
Christian Nilsson [Sat, 25 Apr 2015 23:18:37 +0000 (01:18 +0200)] 
[bios] Add ANSI blink attribute

Expose the high bit of the VGA text attribute byte via the ANSI SGR
parameters 5 ("blink on") and 25 ("blink off").

Note that some video cards (and virtual machines) may display a high
intensity background colour instead of blinking text.

Signed-off-by: Christian Nilsson <nikize@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[tg3] Add support for BCM57766
Bernd Wiebelt [Mon, 6 Jul 2015 13:27:48 +0000 (14:27 +0100)] 
[tg3] Add support for BCM57766

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipoib] Transmit multicast packets as broadcasts
Michael Brown [Mon, 6 Jul 2015 12:06:55 +0000 (13:06 +0100)] 
[ipoib] Transmit multicast packets as broadcasts

Multicast MAC addresses will never have REMAC cache entries, and the
corresponding multicast IPoIB MAC address cannot be obtained simply by
issuing an ARP request.

For the trivial volume of multicast packets that we expect to send in
any realistic scenario, the simplest solution is to send them as
broadcasts instead.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[tcp] Gracefully close connections during shutdown
Michael Brown [Sat, 4 Jul 2015 11:40:04 +0000 (12:40 +0100)] 
[tcp] Gracefully close connections during shutdown

We currently do not wait for a received FIN before exiting to boot a
loaded OS.  In the common case of booting from an HTTP server, this
means that the TCP connection is left consuming resources on the
server side: the server will retransmit the FIN several times before
giving up.

Fix by initiating a graceful close of all TCP connections and waiting
(for up to one second) for all connections to finish closing
gracefully (i.e. for the outgoing FIN to have been sent and ACKed, and
for the incoming FIN to have been received and ACKed at least once).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xen] Wait for and clear XenStore event before receiving data
Michael Brown [Tue, 30 Jun 2015 16:06:58 +0000 (17:06 +0100)] 
[xen] Wait for and clear XenStore event before receiving data

Older, out-of-tree Xen kernel modules (such as those provided with
SuSE Linux Enterprise Server 11) do not clear the leftover "event
pending" bit when opening an event channel.  Consequently, no event is
ever delivered to indicate that there is information in the XenStore
ring buffer, and the system hangs shortly after loading the
xen-platform-pci kernel module.

Work around this problem by always waiting for the XenStore event
channel to be signalled, and clearing the event before processing the
received data.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[gdb] Allow gdbstub to be started on an arbitrary serial port
Michael Brown [Mon, 29 Jun 2015 15:43:39 +0000 (16:43 +0100)] 
[gdb] Allow gdbstub to be started on an arbitrary serial port

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipoib] Attempt to generate ARPs as needed to repopulate REMAC cache
Michael Brown [Mon, 29 Jun 2015 13:50:16 +0000 (14:50 +0100)] 
[ipoib] Attempt to generate ARPs as needed to repopulate REMAC cache

The only way to map an eIPoIB MAC address (REMAC) to an IPoIB MAC
address is to intercept an incoming ARP request or reply.

If we do not have an REMAC cache entry for a particular destination
MAC address, then we cannot transmit the packet.  This can arise in at
least two situations:

 - An external program (e.g. a PXE NBP using the UNDI API) may attempt
   to transmit to a destination MAC address that has been obtained by
   some method other than ARP.

 - Memory pressure may have caused REMAC cache entries to be
   discarded.  This is fairly likely on a busy network, since REMAC
   cache entries are created for all received (broadcast) ARP
   requests.  (We can't sensibly avoid creating these cache entries,
   since they are required in order to send an ARP reply, and when we
   are being used via the UNDI API we may have no knowledge of which
   IP addresses are "ours".)

Attempt to ameliorate the situation by generating a semi-spurious ARP
request whenever we find a missing REMAC cache entry.  This will
hopefully trigger an ARP reply, which would then provide us with the
information required to populate the REMAC cache.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipoib] Mark REMAC cache as expensive
Michael Brown [Mon, 29 Jun 2015 13:12:43 +0000 (14:12 +0100)] 
[ipoib] Mark REMAC cache as expensive

As with the neighbour cache, discarding an REMAC cache entry is
potentially very disruptive.

Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[comboot] Implement INT22,0x000c
Wissam Shoukair [Mon, 29 Jun 2015 11:42:51 +0000 (12:42 +0100)] 
[comboot] Implement INT22,0x000c

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[serial] Use new UART abstraction in serial console driver
Michael Brown [Mon, 29 Jun 2015 07:43:16 +0000 (08:43 +0100)] 
[serial] Use new UART abstraction in serial console driver

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[gdb] Use new UART abstraction in GDB serial transport
Michael Brown [Mon, 29 Jun 2015 09:07:56 +0000 (10:07 +0100)] 
[gdb] Use new UART abstraction in GDB serial transport

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[serial] Add general abstraction of a 16550-compatible UART
Michael Brown [Mon, 29 Jun 2015 07:39:58 +0000 (08:39 +0100)] 
[serial] Add general abstraction of a 16550-compatible UART

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[pxe] Always reconstruct packet for PXENV_GET_CACHED_INFO
Michael Brown [Mon, 29 Jun 2015 08:58:16 +0000 (09:58 +0100)] 
[pxe] Always reconstruct packet for PXENV_GET_CACHED_INFO

Avoid accidentally returning stale packets (e.g. for a previously
attempted network device) by always constructing a fresh DHCP packet.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[dhcp] Defer discovery if link is blocked
Michael Brown [Thu, 25 Jun 2015 16:30:49 +0000 (17:30 +0100)] 
[dhcp] Defer discovery if link is blocked

If the link is blocked (e.g. due to a Spanning Tree Protocol port not
yet forwarding packets) then defer DHCP discovery until the link
becomes unblocked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[stp] Fix interpretaton of hello time
Michael Brown [Thu, 25 Jun 2015 16:30:12 +0000 (17:30 +0100)] 
[stp] Fix interpretaton of hello time

Times in STP packets are expressed in units of 1/256 of a second.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[stp] Add support for detecting Spanning Tree Protocol non-forwarding ports
Michael Brown [Thu, 25 Jun 2015 09:04:42 +0000 (10:04 +0100)] 
[stp] Add support for detecting Spanning Tree Protocol non-forwarding ports

A fairly common end-user problem is that the default configuration of
a switch may leave the port in a non-forwarding state for a
substantial length of time (tens of seconds) after link up.  This can
cause iPXE to time out and give up attempting to boot.

We cannot force the switch to start forwarding packets sooner, since
any attempt to send a Spanning Tree Protocol bridge PDU may cause the
switch to disable our port (if the switch happens to have the Bridge
PDU Guard feature enabled for the port).

For non-ancient versions of the Spanning Tree Protocol, we can detect
whether or not the port is currently forwarding and use this to inform
the network device core that the link is currently blocked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[netdevice] Add a generic concept of a "blocked link"
Michael Brown [Thu, 25 Jun 2015 15:41:39 +0000 (16:41 +0100)] 
[netdevice] Add a generic concept of a "blocked link"

When Spanning Tree Protocol (STP) is used, there may be a substantial
delay (tens of seconds) from the time that the link goes up to the
time that the port starts forwarding packets.

Add a generic concept of a "blocked link" (i.e. a link which is up but
which is not expected to communicate successfully), and allow "ifstat"
to indicate when a link is blocked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ethernet] Add minimal support for receiving LLC frames
Michael Brown [Thu, 25 Jun 2015 13:37:18 +0000 (14:37 +0100)] 
[ethernet] Add minimal support for receiving LLC frames

In some Ethernet framing variants the two-byte protocol field is used
as a length, with the Ethernet header being followed by an IEEE 802.2
LLC header.  The first two bytes of the LLC header are the DSAP and
SSAP.

If the received Ethernet packet appears to use this framing, then
interpret the two-byte DSAP and SSAP as being the network-layer
protocol.  This allows support for receiving Spanning Tree Protocol
frames (which use an LLC header with {DSAP,SSAP}=0x4242) to be added
without requiring a full LLC protocol layer.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[mromprefix] Report a dummy size at offset 0x02 of .mrom payload
Michael Brown [Thu, 25 Jun 2015 07:32:25 +0000 (08:32 +0100)] 
[mromprefix] Report a dummy size at offset 0x02 of .mrom payload

The size of the .mrom payload (the second PCI ROM image) is defined in
its PCI header.  The code type for the .mrom payload image is
deliberately set to an invalid value (0xff) to ensure that no BIOS
tries to parse anything in the image other than the PCI header.

Since the code type is not set to 0x00 ("Intel x86, PC-AT
compatible"), bytes 0x02-0x17 should not be interpreted by the BIOS as
being in the standard ISA expansion ROM format.  In particular, the
byte at offset 0x02 does not represent the length of the ROM image (in
512-byte blocks).

However, some Dell BIOSes seem to erroneously use the byte at offset
0x02 to determine the length of the .mrom payload when walking the
list of PCI ROM images.  Since this byte is currently set to zero,
this can lead to the BIOS getting stuck in an infinite loop during
POST.  (This problem may not arise if the .mrom payload is the final
image in the ROM, since the BIOS will then have no reason to attempt
to locate the next image.)

One possible workaround would be to put the real payload size in this
byte, but doing so would constrain the .mrom payload size to 128kB
(see commit 8049a52 ("[mromprefix] Allow for .mrom images larger than
128kB") for more details).

Another possible workaround would be to put the real payload size as a
word in bytes 0x02-0x03 (as is done for EFI ROMs).  This would not
constrain the .mrom payload size, but a payload size which happened to
be exactly 128kB would result in a zero value in the byte at offset
0x02 and so could still result in infinite loops on BIOSes with this
bug.

We choose to place a fixed value of 0x01 in the byte at offset 0x02.
This should at least prevent the BIOS from getting stuck in an
infinite loop.  (The BIOS may walk into the middle of the .mrom
payload, where it will almost certainly not find a valid {0x55,0xaa}
signature or a valid PCIR header, and will therefore hopefully abort
processing.)

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[tcp] Do not shrink window when discarding received packets
Michael Brown [Thu, 25 Jun 2015 09:07:21 +0000 (10:07 +0100)] 
[tcp] Do not shrink window when discarding received packets

We currently shrink the TCP window permanently if we are ever forced
(by a low-memory condition) to discard a previously received TCP
packet.  This behaviour was intended to reduce the number of
retransmissions in a lossy network, since lost packets might
potentially result in the entire window contents being retransmitted.

Since commit e0fc8fe ("[tcp] Implement support for TCP Selective
Acknowledgements (SACK)") the cost of lost packets has been reduced by
around one order of magnitude, and the reduction in the window size
(which affects the maximum throughput) is now the more significant
cost.

Remove the code which reduces the TCP maximum window size when a
received packet is discarded.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Tested-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[pci] Use flat real mode to call INT 1a,b101
Michael Brown [Tue, 23 Jun 2015 19:37:55 +0000 (20:37 +0100)] 
[pci] Use flat real mode to call INT 1a,b101

Some HP BIOSes (observed with an HP ProLiant m710p Server Cartridge)
have a bug in the implementation of INT 1a,b101: they blithely assume
that real-mode code is able to read from anywhere in the 32-bit memory
space.

This problem affects the call to INT 1a,b101 made from within
pcibios_num_bus() (which uses REAL_CODE() and hence executes in
genuine real mode) but does not affect the call made from within
romprefix.S (since with a PMM BIOS, that call executes in flat real
mode anyway).

Work around the problem by explicitly calling flatten_real_mode()
before invoking INT 1a,b101.  This is a rarely-used code path, and so
the extra overhead of emulating instructions in some VM configurations
(see commit 6d4deee ("[librm] Use genuine real mode to accelerate
operation in virtual machines") for more details) is negligible.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Debugged-by: Wissam Shoukair <wissams@mellanox.com>
Debugged-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xhci] Ignore invalid protocol speed ID values on Intel Skylake platforms
Michael Brown [Thu, 18 Jun 2015 14:09:57 +0000 (15:09 +0100)] 
[xhci] Ignore invalid protocol speed ID values on Intel Skylake platforms

Some Intel Skylake platforms (observed on a prototype Lenovo ThinkPad)
report the list of available USB3 protocol speed ID values as {1,2,3}
but then report a port's speed using ID value 4.

The value 4 happens to be the default value for SuperSpeed (when no
protocol speed ID value list is explicitly defined), and the hardware
seems to function correctly if we simply ignore its protocol speed ID
table and assume that it uses the default values.

Fix by adding a "broken PSI values" quirk for this controller.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xhci] Record device-specific quirks in xHCI device structure
Michael Brown [Thu, 18 Jun 2015 14:05:54 +0000 (15:05 +0100)] 
[xhci] Record device-specific quirks in xHCI device structure

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipoib] Fix REMAC cache discarder
Michael Brown [Mon, 1 Jun 2015 17:02:55 +0000 (18:02 +0100)] 
[ipoib] Fix REMAC cache discarder

Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xhci] Fix comparison of signed and unsigned integers
Michael Brown [Mon, 1 Jun 2015 16:18:08 +0000 (17:18 +0100)] 
[xhci] Fix comparison of signed and unsigned integers

gcc 4.8.2 fails to report this erroneous comparison unless assertions
are enabled.

Reported-by: Mary-Ann Johnson <MaryAnn.Johnson@displaylink.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[build] Fix .ids.o creation for drivers not in the all-drivers build
Michael Brown [Mon, 1 Jun 2015 15:50:56 +0000 (16:50 +0100)] 
[build] Fix .ids.o creation for drivers not in the all-drivers build

Commit dc19e63 ("[build] Construct all-drivers list based on driver
class") accidentally excluded the USB bus drivers from the list of
files parsed in order to create PCI 3.0 device ID lists.

Fix by returning $(DRIVERS) to its previous definition as a list of
all driver files, and use only $(DRIVERS_ipxe) to contain the
filtered list containing only those drivers which we want to include
in the "all-drivers" build.

Reported-by: Mary-Ann Johnson <MaryAnn.Johnson@displaylink.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xhci] Fix length of allocated slot array
Michael Brown [Mon, 1 Jun 2015 12:47:34 +0000 (13:47 +0100)] 
[xhci] Fix length of allocated slot array

The xHCI slot ID is one-based, not zero-based.  Fix the length of the
xhci->slot[] array to account for this, and add assertions to check
that the hardware returns a valid slot ID in response to the Enable
Slot command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[neighbour] Return success when deferring a packet
Michael Brown [Wed, 20 May 2015 14:19:47 +0000 (15:19 +0100)] 
[neighbour] Return success when deferring a packet

Deferral of a packet for neighbour discovery is not really an error.
If we fail to discover a neighbour then the failure will eventually be
reported by the call to neighbour_destroy() when any outstanding I/O
buffers are discarded.

The current behaviour breaks PXE booting on FreeBSD, which seems to
treat the error return from PXENV_UDP_WRITE as a fatal error and so
never proceeds to poll PXENV_UDP_READ (and hence never allows iPXE to
receive the ARP reply and send the deferred UDP packet).

Change neighbour_tx() to return success when deferring a packet.  This
fixes interoperability with FreeBSD and removes transient neighbour
cache misses from the "ifstat" error output, while leaving genuine
neighbour discovery failures visible via "ifstat" (once neighbour
discovery times out, or the interface is closed).

Debugged-by: Wissam Shoukair <wissams@mellanox.com>
Tested-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Fix operation when physical function has jumbo frames enabled
Michael Brown [Tue, 19 May 2015 11:20:37 +0000 (12:20 +0100)] 
[intel] Fix operation when physical function has jumbo frames enabled

When jumbo frames are enabled, the Linux ixgbe physical function
driver will disable the virtual function's receive datapath by
default, and will enable it only if the virtual function negotiates
API version 1.1 (or higher) and explicitly selects an MTU.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Add intelxvf_stats() to dump packet statistics registers
Michael Brown [Mon, 18 May 2015 21:09:47 +0000 (22:09 +0100)] 
[intel] Add intelxvf_stats() to dump packet statistics registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[int13con] Add basic ability to log to a local disk via INT 13
Michael Brown [Mon, 18 May 2015 15:02:02 +0000 (16:02 +0100)] 
[int13con] Add basic ability to log to a local disk via INT 13

Several popular public cloud providers do not provide any sensible
mechanism for obtaining debug output from an OS which is failing to
boot.  For example, Amazon EC2 provides the "Get System Log" facility,
which occasionally deigns to report a random subset of the characters
emitted via the VM's serial port, but usually returns only a blank
screen.  (Amazingly, this is still superior to the debugging
facilities provided by Azure.)

Work around these shortcomings by adding a console type which sends
output to a magically detected raw disk partition, and including such
a partition within any iPXE .usb-format image.

To use this facility:

 - build an iPXE .usb image with CONSOLE_INT13 enabled

 - boot the cloud VM from this image

 - after the boot fails, attach the VM's boot disk to a second VM

 - from this second VM, use "less -f -R /dev/sdb3" (or similar) to
   view the iPXE output.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Add intelxvf driver for Intel 10 GigE virtual function NICs
Michael Brown [Sat, 16 May 2015 13:36:56 +0000 (14:36 +0100)] 
[intel] Add intelxvf driver for Intel 10 GigE virtual function NICs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Add support for mailbox used by virtual functions
Michael Brown [Sat, 16 May 2015 13:35:13 +0000 (14:35 +0100)] 
[intel] Add support for mailbox used by virtual functions

Virtual functions use a mailbox to communicate with the physical
function driver: this covers functionality such as obtaining the MAC
address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Allow for the use of advanced TX descriptors
Michael Brown [Sat, 16 May 2015 13:26:00 +0000 (14:26 +0100)] 
[intel] Allow for the use of advanced TX descriptors

Intel virtual function NICs almost work with the use of "legacy"
transmit and receive descriptors (which are backwards compatible right
back to the original Intel Gigabit NICs).

Unfortunately the "TX switching" feature (which allows for VM<->VM
traffic to be looped back within the NIC itself) does not work when a
legacy TX descriptor is used: the packet is instead sent onto the
wire.

Fix by allowing for the use of an "advanced" TX descriptor (containing
exactly the same information as is found in the "legacy" descriptor).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Expose intel_diag() for use by other Intel NIC drivers
Michael Brown [Fri, 15 May 2015 10:52:56 +0000 (11:52 +0100)] 
[intel] Expose intel_diag() for use by other Intel NIC drivers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Always clear recorded disconnections after performing hotplug actions
Michael Brown [Wed, 13 May 2015 13:45:21 +0000 (14:45 +0100)] 
[usb] Always clear recorded disconnections after performing hotplug actions

The recorded disconnections (in port->disconnected) will currently be
left uncleared if usb_attached() returns an error (e.g. because there
are no drivers for a particular USB device).  This is incorrect
behaviour: the disconnection has been handled and the record should be
cleared until the next physical disconnection is detected (via the CSC
bit).

The problem is masked for EHCI, UHCI, and USB hubs, since these will
report a changed port (via usb_port_changed()) only when the
underlying hardware reports a change.  xHCI will call
usb_port_changed() in response to any port status event, at which
point the stale value of port->disconnected will be erroneously acted
upon.  This can lead to an endless loop of repeatedly enumerating the
same device when a driverless device is attached to an xHCI root hub
port.

Fix by unconditionally clearing port->disconnected in usb_hotplugged().

Reported-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Do not call usb_hotplug() when registering a new hub
Michael Brown [Wed, 13 May 2015 13:13:09 +0000 (14:13 +0100)] 
[usb] Do not call usb_hotplug() when registering a new hub

The action of registering a new hub can itself happen in only two
ways: either a new USB hub has been created (in which case we are
already inside a call to usb_hotplug()), or a new root hub has been
created.

In the former case, we do not need to issue a further call to
usb_hotplug(), since the hub's ports will all be marked as changed and
so will be handled after the return from register_usb_hub() anyway.
Calling usb_hotplug() within register_usb_hub() leads to a confusing
order of events, such as:

- root hub port 1 detects a change
- root hub port 2 detects a change
- usb_hotplug() is called
  - root hub port 1 finds a USB hub
    - usb_hotplug() is called
      - this inner call to usb_hotplug() handles root hub port 2

Fix by calling usb_hotplug() only from usb_step() and from
register_usb_bus().  This avoids recursive calls to usb_hotplug() and
ensures that devices are enumerated in the order of detection.

Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Add basic support for USB keyboards
Michael Brown [Mon, 11 May 2015 14:42:54 +0000 (15:42 +0100)] 
[usb] Add basic support for USB keyboards

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.  This currently results in
USB keyboards becoming non-functional in USB-enabled builds of iPXE.

Fix by adding basic support for USB keyboards, enabled by default in
iPXE builds which include USB support.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Add generic USB human interface device (HID) framework
Michael Brown [Mon, 11 May 2015 13:57:28 +0000 (14:57 +0100)] 
[usb] Add generic USB human interface device (HID) framework

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Add USB_INTERRUPT_OUT internal type
Michael Brown [Mon, 11 May 2015 13:56:46 +0000 (14:56 +0100)] 
[usb] Add USB_INTERRUPT_OUT internal type

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ipv6] Disambiguate received ICMPv6 errors
Michael Brown [Mon, 11 May 2015 11:45:14 +0000 (12:45 +0100)] 
[ipv6] Disambiguate received ICMPv6 errors

Originally-implemented-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[uhci] Use meaningful device names in debug messages
Michael Brown [Sat, 9 May 2015 23:18:46 +0000 (00:18 +0100)] 
[uhci] Use meaningful device names in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ehci] Use meaningful device names in debug messages
Michael Brown [Sat, 9 May 2015 22:45:43 +0000 (23:45 +0100)] 
[ehci] Use meaningful device names in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[xhci] Use meaningful device names in debug messages
Michael Brown [Sat, 9 May 2015 23:11:07 +0000 (00:11 +0100)] 
[xhci] Use meaningful device names in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Provide usb_endpoint_name() for use by host controller drivers
Michael Brown [Sat, 9 May 2015 22:45:13 +0000 (23:45 +0100)] 
[usb] Provide usb_endpoint_name() for use by host controller drivers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[uhci] Add support for UHCI host controllers
Michael Brown [Sat, 9 May 2015 22:14:34 +0000 (23:14 +0100)] 
[uhci] Add support for UHCI host controllers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ehci] Allow UHCI/OHCI controllers to locate the EHCI companion controller
Michael Brown [Fri, 8 May 2015 15:51:12 +0000 (16:51 +0100)] 
[ehci] Allow UHCI/OHCI controllers to locate the EHCI companion controller

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Add find_usb_bus_by_location() helper function
Michael Brown [Fri, 8 May 2015 15:50:47 +0000 (16:50 +0100)] 
[usb] Add find_usb_bus_by_location() helper function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ehci] Poll child companion controllers after disowning port
Michael Brown [Fri, 8 May 2015 14:33:18 +0000 (15:33 +0100)] 
[ehci] Poll child companion controllers after disowning port

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Maintain single lists of halted endpoints and changed ports
Michael Brown [Fri, 8 May 2015 17:02:50 +0000 (18:02 +0100)] 
[usb] Maintain single lists of halted endpoints and changed ports

When an EHCI hotplug action results in the controller disowning the
port, it will result in a hotplug action on the corresponding UHCI or
OHCI controller.  Allow such hotplug actions to be carried out as part
of the same call to usb_step() or usb_register_bus(), by maintaining a
single central list of changed ports.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Maintain a list of all USB buses
Michael Brown [Fri, 8 May 2015 14:07:26 +0000 (15:07 +0100)] 
[usb] Maintain a list of all USB buses

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Detect missed disconnections
Michael Brown [Wed, 6 May 2015 15:38:28 +0000 (16:38 +0100)] 
[usb] Detect missed disconnections

The USB core will currently fail to detect disconnections if a new
device has attached by the time the port is examined in
usb_hotplug().

Fix by recording the fact that a disconnection has taken place
whenever the "connection status changed" (CSC) bit is observed to be
set.  (Whether the change represents a disconnection or a
reconnection, it indicates that the port has experienced some time of
being disconnected.)

Note that the time at which a disconnection can be detected varies by
hub type.  In particular: root hubs can observe the CSC bit when
polling, and so will record the disconnection before calling
usb_port_changed(), but USB hubs read the port status (and hence the
CSC bit) only during the call to hub_speed(), long after the call to
usb_port_changed().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[pci] Provide PCI_CLASS() to calculate a scalar PCI class value
Michael Brown [Fri, 8 May 2015 13:54:12 +0000 (14:54 +0100)] 
[pci] Provide PCI_CLASS() to calculate a scalar PCI class value

Rename PCI_CLASS() (which constructs a struct pci_class_id) to
PCI_CLASS_ID(), and provide PCI_CLASS() as a macro which constructs
the 24-bit scalar value of a PCI class code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[usb] Include setup packet within I/O buffer for message transfers
Michael Brown [Fri, 1 May 2015 15:28:45 +0000 (16:28 +0100)] 
[usb] Include setup packet within I/O buffer for message transfers

The USB API currently assumes that host controllers will have
immediate data buffer space available in which to store the setup
packet.  This is true for xHCI, partially true for EHCI (which happens
to have 12 bytes of padding in each transfer descriptor due to
alignment requirements), and not true at all for UHCI.

Include the setup packet within the I/O buffer passed to the host
controller's message() method, thereby eliminating the requirement for
host controllers to provide immediate data buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[vram] Add "vram" built-in setting to dump video RAM
Michael Brown [Fri, 24 Apr 2015 15:05:59 +0000 (16:05 +0100)] 
[vram] Add "vram" built-in setting to dump video RAM

The "vram" setting returns the (Base64-encoded) contents of video RAM,
and can be used to capture a screenshot.  For example: after running
memtest.0 and encountering an error, the output can be captured and
sent to a remote server for later diagnosis:

  #!ipxe
  chain -a http://server/memtest.0 && goto ok || goto bad
  :bad
  params
  param errno ${errno}
  param vram ${vram}
  chain -a http://server/report.php##params
  :ok

Inspired-by: Christian Nilsson <nikize@gmail.com>
Originally-implemented-by: Christian Nilsson <nikize@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[settings] Add "base64" setting type
Michael Brown [Fri, 24 Apr 2015 12:54:40 +0000 (13:54 +0100)] 
[settings] Add "base64" setting type

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[base64] Add buffer size parameter to base64_encode() and base64_decode()
Michael Brown [Fri, 24 Apr 2015 14:32:04 +0000 (15:32 +0100)] 
[base64] Add buffer size parameter to base64_encode() and base64_decode()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[base16] Add buffer size parameter to base16_encode() and base16_decode()
Michael Brown [Fri, 24 Apr 2015 13:34:32 +0000 (14:34 +0100)] 
[base16] Add buffer size parameter to base16_encode() and base16_decode()

The current API for Base16 (and Base64) encoding requires the caller
to always provide sufficient buffer space.  This prevents the use of
the generic encoding/decoding functionality in some situations, such
as in formatting the hex setting types.

Implement a generic hex_encode() (based on the existing
format_hex_setting()), implement base16_encode() and base16_decode()
in terms of the more generic hex_encode() and hex_decode(), and update
all callers to provide the additional buffer length parameter.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[test] Include IPv6 support when performing settings self-tests
Michael Brown [Fri, 24 Apr 2015 13:38:14 +0000 (14:38 +0100)] 
[test] Include IPv6 support when performing settings self-tests

The settings self-tests include tests for the "ipv6" setting type.
When IPv6 support is not included, this setting type exists (since it
is referred to by some dual-stack code, such as dns.c) but is
non-functional.

Force IPv6 support to be included within a settings self-test build
using an explicit REQUIRE_OBJECT() macro.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[ath9k] Remove confusing logic inversion in an ANI variable
Christian Hesse [Thu, 23 Apr 2015 11:33:26 +0000 (13:33 +0200)] 
[ath9k] Remove confusing logic inversion in an ANI variable

This changed in Linux kernel the same way in commit 7067e701
("ath9k_hw: remove confusing logic inversion in an ANI variable") by
Felix Fietkau.

Additionally this fixes "error: logical not is only applied to the
left hand side of comparison" with GCC 5.1.0.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[build] Add missing "const" qualifiers
Christian Hesse [Thu, 23 Apr 2015 11:33:25 +0000 (13:33 +0200)] 
[build] Add missing "const" qualifiers

This fixes "initialization discards 'const' qualifier from pointer
target type" warnings with GCC 5.1.0.

Signed-off-by: Christian Hesse <mail@eworm.de>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Add PCI device IDs for Intel I218-LM and I218-V
Christian Hesse [Wed, 22 Apr 2015 12:48:01 +0000 (14:48 +0200)] 
[intel] Add PCI device IDs for Intel I218-LM and I218-V

I218-LM (rev 3) is found in Lenovo Thinkpad X250.  The remaining
device IDs are from linux/drivers/net/ethernet/intel/e1000e/hw.h

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[build] Construct all-drivers list based on driver class
Michael Brown [Wed, 22 Apr 2015 11:14:16 +0000 (12:14 +0100)] 
[build] Construct all-drivers list based on driver class

The USB bus drivers (ehci.c and xhci.c) have PCI device ID tables and
hence PCI_ROM() lines, but should probably not be included in the
all-drivers build on this basis, since they do nothing useful unless a
USB network driver is also present.

Fix by constructing the all-drivers list based on the driver class
(i.e. the portion of the source path immediately after "drivers/").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[rtl818x] Obviate RTL_ROM() hack
Michael Brown [Wed, 22 Apr 2015 10:05:19 +0000 (11:05 +0100)] 
[rtl818x] Obviate RTL_ROM() hack

Reported-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[realtek] Do not attempt to access EEPROM on RTL8169 chips
Michael Brown [Tue, 21 Apr 2015 16:42:36 +0000 (17:42 +0100)] 
[realtek] Do not attempt to access EEPROM on RTL8169 chips

On some RTL8169 onboard NICs (observed with a Lenovo ThinkPad 11e),
the EEPROM is not merely not present: any attempt to read from the
non-existent EEPROM will crash and reboot the system.

The equivalent code to read from the EEPROM was removed from the Linux
r8169 driver in 2009 with a comment suggesting that it was similarly
found to be unreliable on some systems.

Fix by accessing the EEPROM only on RTL8139 NICs, and assuming that
the MAC address will always be correctly preset on RTL8169 NICs.

Reported-by: Evan Prohaska <eprohaska@edkey.org>
Tested-by: Evan Prohaska <eprohaska@edkey.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Force RX polling on VMware emulated 82545em
Michael Brown [Tue, 21 Apr 2015 15:43:30 +0000 (16:43 +0100)] 
[intel] Force RX polling on VMware emulated 82545em

The emulated Intel 82545em in some versions of VMware (observed with
ESXi v5.1) seems to sometimes fail to set the RXT0 bit in the
interrupt cause register (ICR), causing iPXE to stop receiving
packets.  Work around this problem (for the 82545em only) by always
polling the receive queue regardless of the state of the ICR.

Reported-by: Slava Bendersky <volga629@networklab.ca>
Tested-by: Slava Bendersky <volga629@networklab.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Report any unexpected interrupt causes
Michael Brown [Tue, 21 Apr 2015 14:20:13 +0000 (15:20 +0100)] 
[intel] Report any unexpected interrupt causes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
6 years ago[intel] Update PCI device IDs for Intel 82599 and X540 10G NICs
Ed Swierk [Thu, 19 Feb 2015 21:12:44 +0000 (13:12 -0800)] 
[intel] Update PCI device IDs for Intel 82599 and X540 10G NICs

Identifiers are based on defines in Linux ixgbe_type.h.

Descriptive names are based on
https://www-ssl.intel.com/content/www/us/en/ethernet-controllers/82599-10-gbe-controller-spec-update.html
and
https://www-ssl.intel.com/content/www/us/en/network-adapters/10-gigabit-network-adapters/ethernet-x540-spec-update.html

Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>