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

1264 Commits

Author SHA1 Message Date
Peter von Konigsmark 9720f8396f [exanic] Add PCI device ID for another X40 variant
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-09-07 12:37:09 +01:00
Peter von Konigsmark f756fd78f7 [exanic] Power up optical PHYs (if present)
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-09-07 12:36:33 +01:00
Michael Brown 3ae70be5ba [efi] Raise TPL when calling UNDI entry point
The SnpDxe driver raises the task priority level to TPL_CALLBACK when
calling the UNDI entry point.  This does not appear to be a documented
requirement, but we should probably match the behaviour of SnpDxe to
minimise surprises to third party code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-09-05 10:48:41 +01:00
Michael Brown 306465bef3 [linux] Impose receive quota on tap driver
The tap driver can retrieve a potentially unlimited number of packets
in a single poll.  This can lead to heap exhaustion under heavy load.

Fix by imposing an artificial receive quota (as already used in other
drivers without natural receive limits).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-09-04 18:00:34 +01:00
Richard Moore 8b104d881a [intel] Add various PCI device IDs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-08-22 10:39:00 +01:00
Michael Brown 9ccd8fe569 [efi] Enumerate PCI BARs in same order as SnpDxe
The UEFI specification has an implicit and demonstrably incorrect
requirement (in the Mem_IO() calling convention) that any UNDI network
device has at most one memory BAR and one I/O BAR.

Some UEFI platforms have been observed to report the existence of
non-existent additional I/O BARs, causing iPXE to select the wrong
BAR.  This problem does not affect the SnpDxe driver, since that
driver will always choose the lowest numbered existent BAR of each
type.

Adjust iPXE's behaviour to match that of SnpDxe, i.e. to always select
the lowest numbered BAR(s).

Debugged-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Debugged-by: Adklei <adklei@realtek.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-21 15:00:17 +01:00
Michael Brown 0600d3ae94 [lan78xx] Add driver for Microchip LAN78xx USB Ethernet NICs
Originally-implemented-by: Ravi Hegde <ravi.hegde@microchip.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-10 13:01:03 +01:00
Michael Brown 1ee7f4e036 [smsc75xx] Expose functionality shared with LAN78xx devices
The LAN78xx datapath is essentially identical to that of the SMSC75xx.
Expose the transmit, poll, and bulk IN endpoint operations to allow
for reuse by the LAN78xx driver.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-10 12:41:23 +01:00
Michael Brown 74f934a14e [smscusb] Allow for alternative PHY register layouts
The LAN78xx PHY interrupt source and mask registers do not match those
used by the SMSC75xx and SMSC95xx.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-10 12:41:23 +01:00
Michael Brown 340f03392d [smscusb] Move non-inline register access functions to smscusb.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-10 11:55:04 +01:00
Jason Wang 6a258d8d55 [virtio] Support VIRTIO_NET_F_IOMMU_PLATFORM
Since we don't enable IOMMU at all, we can then simply enable the
IOMMU support by claiming the support of VIRITO_F_IOMMU_PLATFORM.
This fixes booting failure when iommu_platform is set from qemu cli.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-10 11:10:45 +01:00
Michael Brown d4df9f573f [smscusb] Add ability to read MAC address from OTP
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-07 20:34:06 +01:00
Michael Brown b1df34d7bd [smsc75xx] Use common SMSC USB device functionality
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-07 17:33:09 +01:00
Michael Brown 550e0d8353 [smsc95xx] Use common SMSC USB device functionality
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-07 17:33:09 +01:00
Michael Brown 5a7558447a [smscusb] Abstract out common SMSC USB device functionality
The smsc75xx and smsc95xx drivers include a substantial amount of
identical functionality, varying only in the base address of register
sets.  Abstract out this common functionality to allow code to be
shared between the drivers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-07 16:44:28 +01:00
Jerone Young 1015a350f7 [intel] Add support for I219-V in 7th Gen Intel NUC
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-05 10:57:59 +01:00
Michael Brown 8e48d0df6b [usb] Use non-zero language ID to retrieve strings
We currently use a zero language ID to retrieve strings such as the
ECM/NCM MAC address.  This works on most hardware devices, but is
known to fail on some software emulated CDC-NCM devices.

Fix by using the first supported language ID, falling back to English
(0x0409) if any error occurs when fetching the list of supported
languages.  This matches the behaviour of the Linux kernel.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-07-03 13:38:55 +01:00
Michael Brown 1e5c5a2163 [exanic] Add driver for Exablaze ExaNIC cards
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-06-24 19:17:55 +01:00
Michael Brown c8cb867d65 [ecm] Display invalid MAC address strings in debug messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-06-14 17:40:05 +01:00
Mika Tiainen 62573b99cc [intel] Add INTEL_NO_PHY_RST for I219-V
Fix booting on HP EliteBook 820 G3.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-06-14 12:22:08 +01:00
Michael Brown 63113f591f [usb] Allow for USB network devices with no interrupt endpoint
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-06-14 12:14:54 +01:00
Michael Brown 7457bfc5b2 [xen] Provide 18 4kB receive buffers to work around xen-netback bug
The Xen network backend (xen-netback) suffered from a regression
between upstream Linux kernels 3.18 and 4.2 inclusive, which would
cause packet reception to fail unless at least 18 receive buffers were
available.  This bug was fixed in kernel commit 1d5d485 ("xen-netback:
require fewer guest Rx slots when not using GSO").

Work around this bug in affected versions of xen-netback by providing
the requisite 18 receive buffers.

Reported-by: Taylor Schneider <tschneider@live.com>
Tested-by: Taylor Schneider <tschneider@live.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-05-19 02:56:53 +01:00
Michael Brown a19ac24971 [iscsi] Fix iBFT when no explicit initiator name setting exists
Commit 7cfdd76 ("[block] Describe all SAN devices via ACPI tables")
changed the definition of the iSCSI initiator IQN in the iBFT to
represent a common initiator IQN used for all iSCSI sessions, and
attempted to calculate this common initiator IQN by fetching the
common ${initiator-iqn} setting.

This fails when no explicit ${initiator-iqn} has been specified
(i.e. when an initiator IQN has instead been constructed from either
the hostname or system UUID), and results in an empty initiator IQN in
the iBFT.

Fix by using the initiator IQN of an arbitrary iSCSI session
present in the iBFT.

Debugged-by: Tal Aloni <tal.aloni.il@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-05-10 16:01:47 +01:00
Michael Brown b91cc983da [hyperv] Cope with Windows Server 2016 enlightenments
An "enlightened" external bootloader (such as Windows Server 2016's
winload.exe) may take ownership of the Hyper-V connection before all
INT 13 operations have been completed.  When this happens, all VMBus
devices are implicitly closed and we are left with a non-functional
network connection.

Detect when our Hyper-V connection has been lost (by checking the
SynIC message page MSR).  Reclaim ownership of the Hyper-V connection
and reestablish any VMBus devices, without disrupting any existing
iPXE state (such as IPv4 settings attached to the network device).

Windows Server 2016 will not cleanly take ownership of an active
Hyper-V connection.  Experimentation shows that we can quiesce by
resetting only the SynIC message page MSR; this results in a
successful SAN boot (on a Windows 2012 R2 physical host).  Choose to
quiesce by resetting (almost) all MSRs, in the hope that this will be
more robust against corner cases such as a stray synthetic interrupt
occurring during the handover.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-04-28 16:20:47 +01:00
Michael Brown 2d79b20f2a [intel] Do not enable ASDE on i350 backplane NIC
On most Intel NICs, Auto-Speed Detection Enable (ASDE) can be used to
automatically detect the correct link speed by sampling the link using
the internal PHY.  This feature is automatically inhibited when not
appropriate for the physical link (e.g. when using internal SerDes
mode on the 8254x).

On the i350 datasheet ASDE is a reserved bit, but the relevant
auto-speed detection hardware appears still to be present.  However,
enabling ASDE on the i350 1000BASE-KX backplane NIC seems to cause an
immediate link failure.  It is possible that the auto-speed detection
hardware is still present, is not connected to a physical link, and is
not inhibited from being applied in this mode.

Work around this problem by adding an INTEL_NO_ASDE flag bit
(analogous to INTEL_NO_PHY_RST), and applying this for the i350
backplane NIC.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-04-16 21:37:41 +01:00
Michael Brown e6616da8b8 [intel] Show original CTRL and STATUS values in debugging output
In situations where iPXE fails to reach link-up as expected, it is
useful to know the original values of the CTRL and STATUS registers
prior to our reset attempt.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-04-14 10:09:57 +01:00
Martin Habets f3788fa837 [sfc] Add driver for Solarflare SFC8XXX adapters
Signed-off-by: Martin Habets <mhabets@solarflare.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-04-10 16:17:08 +01:00
Adamczyk, Konrad fd6d1f4660 [thunderx] Use ThunderxConfigProtocol to obtain board configuration
Following changes were introduced:
 - added GetBgxProp and GetLmacProp methods to ThunderxConfigProtocol
 - replaced direct BOARD_CFG access with usage of introduced methods
 - removed redundant BOARD_CFG
 - changed GUID of ThunderxConfigProtocol, as this is not compatible
   with previous version
 - changed UINTN* to UINT64* buffer type to fix issue on 32-bit
   platforms with MAC address

This change allows us to avoid alignment of BOARD_CFG definitions
every time it changes in UEFI.

Signed-off-by: Konrad Adamczyk <konrad.adamczyk@cavium.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-31 09:08:13 +03:00
Michael Brown a66ac07165 [scsi] Retry TEST UNIT READY command
The TEST UNIT READY command is issued automatically when the device is
opened, and is not the result of a command being issued by the caller.
This is required in order that a permanent TEST UNIT READY failure can
be used to identify unusable paths in a multipath SAN device.

Since the TEST UNIT READY command is not part of the caller's command
issuing process, it is not covered by any external retry loops (such
as the main retry loop in sandev_command()).

We must therefore be prepared to retry the TEST UNIT READY command
within the SCSI layer itself.  We retry only the TEST UNIT READY
command so as not to multiply the number of potential retries for
normal commands (which are already retried by sandev_command()).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-29 12:42:36 +03:00
Michael Brown 2c056f02d0 [linux] Fix building with kernel 4.11 headers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-29 10:58:17 +03:00
Michael Brown 5f85cbb9ee [build] Avoid implicit-fallthrough warnings on GCC 7
Reported-by: Vinson Lee <vlee@freedesktop.org>
Reported-by: Liang Yan <lyan@suse.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-29 10:36:45 +03:00
Michael Brown 2ace5196e5 [iscsi] Do not install iBFT when no iSCSI targets exist
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-28 20:45:23 +03:00
Michael Brown 7cfdd769aa [block] Describe all SAN devices via ACPI tables
Describe all SAN devices via ACPI tables such as the iBFT.  For tables
that can describe only a single device (i.e. the aBFT and sBFT), one
table is installed per device.  For multi-device tables (i.e. the
iBFT), all devices are described in a single table.

An underlying SAN device connection may be closed at the time that we
need to construct an ACPI table.  We therefore introduce the concept
of an "ACPI descriptor" which enables the SAN boot code to maintain an
opaque pointer to the underlying object, and an "ACPI model" which can
build tables from a list of such descriptors.  This separates the
lifecycles of ACPI descriptions from the lifecycles of the block
device interfaces, and allows for construction of the ACPI tables even
if the block device interface has been closed.

For a multipath SAN device, iPXE will wait until sufficient
information is available to describe all devices but will not wait for
all paths to connect successfully.  For example: with a multipath
iSCSI boot iPXE will wait until at least one path has become available
and name resolution has completed on all other paths.  We do this
since the iBFT has to include IP addresses rather than DNS names.  We
will commence booting without waiting for the inactive paths to either
become available or close; this avoids unnecessary boot delays.

Note that the Linux kernel will refuse to accept an iBFT with more
than two NIC or target structures.  We therefore describe only the
NICs that are actually required in order to reach the described
targets.  Any iBFT with at most two targets is therefore guaranteed to
describe at most two NICs.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-28 19:12:48 +03:00
Michael Brown 6bc4a8ac91 [scsi] Avoid duplicate call to scsicmd_close() on TEST UNIT READY failure
When the TEST UNIT READY command receives an error response, the
shutdown of the command's block data interface will result in
scsidev_ready() closing the SCSI device.  This will subsequently
result in a duplicate call to scsicmd_close(), leading to an assertion
failure when list_del() is called for the second time.

Fix by removing the command from the list of outstanding commands
before shutting down the command's interfaces.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-26 11:29:18 +03:00
Michael Brown c13bf52509 [vxge] Fix use of stale I/O buffer on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23 21:10:25 +02:00
Mike McCormack a317e9a310 [sky2] Use 32-bit read to read Y2_VAUX_AVAIL
B0_CTST is a 24bit register according to the vendor driver (sk98lin).
A 16bit read on B0_CTST will always return 0 for Y2_VAUX_AVAIL
(1<<16), so use a 32bit read when testing Y2_VAUX_AVAIL.

[This patch is copied directly from the Linux kernel tree.]

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23 17:54:03 +02:00
Michael Brown 19d3e966d9 [pcnet32] Eliminate redundant register read
The value of ( ( x & 0x0c00 ) | 0x0c00 ) is always 0x0c00 regardless
of the value of x, and so the read_csr() is redundant.  (There are no
read side effects for this register, according to the datasheet.)

This line of code originated in Linux kernel 2.3.19pre1 as

  a->write_csr(ioaddr, 80, a->read_csr(ioaddr, 80) | 0x0c00);

and was modified in kernel 2.3.41pre4 to read

  a->write_csr(ioaddr, 80, (a->read_csr(ioaddr, 80) & 0x0C00) | 0x0c00);

In the absence of commit messages, the intention of the code is
unclear.  However, the logic resulting in a fixed value of 0x0c00 has
remained unaltered for over 17 years, and can probably be assumed to
have the correct overall result.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23 17:43:13 +02:00
Raed Salem 1ff1eebcf7 [golan] Bug fixes and improved paging allocation method
Updates:
- revert Support for clear interrupt via BAR

Signed-off-by: Raed Salem <raeds@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23 16:03:40 +02:00
Michael Brown ce240c8c2d [rtl818x] Fix resource leak on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-23 11:40:36 +02:00
Michael Brown 3870a7bde2 [sis190] Avoid NULL pointer dereference
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 16:12:56 +02:00
Michael Brown 99e1207a4d [w89c840] Avoid potential array overrun
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:59:27 +02:00
Michael Brown ad725fa7d9 [tlan] Guard against failure to identify chip
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:28:58 +02:00
Michael Brown dea5b74475 [hermon] Assert that mapping length is non-zero
An (impossible) mapping length of zero produces a negative bit shift,
which is technically undefined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:20:14 +02:00
Michael Brown 0ced99e97c [arbel] Assert that mapping length is non-zero
An (impossible) mapping length of zero produces a negative bit shift,
which is technically undefined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 15:18:54 +02:00
Michael Brown 21d8624da8 [usb] Use correct length for memcpy()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 14:14:57 +02:00
Michael Brown 45f2265bfc [ath] Add missing break statements
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 11:52:09 +02:00
Michael Brown 39ef530088 [infiniband] Return status code from ib_create_cq() and ib_create_qp()
Any underlying errors arising during ib_create_cq() or ib_create_qp()
are lost since the functions simply return NULL on error.  This makes
debugging harder, since a debug-enabled build is required to discover
the root cause of the error.

Fix by returning a status code from these functions, thereby allowing
any underlying errors to be propagated.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-22 11:18:02 +02:00
Michael Brown 6124c0ebfa [xhci] Avoid accessing beyond end of endpoint context array
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 16:22:42 +02:00
Michael Brown 1ec2a60614 [eoib] Avoid passing a NULL I/O buffer to netdev_tx_complete_err()
Report errors in eoib_duplicate() via netdev_tx_err() rather than
netdev_tx_complete_err(), since netdev_tx_complete_err() accepts only
valid I/O buffers that are currently in the network device's transmit
queue.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 15:07:10 +02:00
Michael Brown 7b113bc744 [usb] Use correct length for memcpy()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:21:54 +02:00