summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [menu] Abstract out the generic concept of a jump scrollerMichael Brown2015-03-031-0/+50
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Rewrite unrelicensable portions of pci.hMichael Brown2015-03-031-296/+101Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Remove outdated and mostly-unused pci_ids.h fileMichael Brown2015-03-022-289/+50Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Relicense list.hMichael Brown2015-03-021-1/+1
| | | | | | | | | | | The code in list.h was originally taken from the Linux kernel many years ago, but has been rewritten to the point that no original code remains, and may therefore be relicensed. The functions and data structures remain largely API-compatible, to facilitate the conversion of Linux network drivers to iPXE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [elf] Rewrite ELF headerMichael Brown2015-03-021-215/+62Star
| | | | | | | Rewrite the ELF header to include only the relevant portions from the ELF specification. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite byte-swapping codeMichael Brown2015-03-024-140/+148
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite unrelicensable portions of ctype.hMichael Brown2015-03-021-17/+101
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite unrelicensable portions of stddef.hMichael Brown2015-03-021-11/+29
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0237-37/+41
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-028-8/+8
| | | | | | | | | | | | | | | Relicence files with kind permission from the following contributors: Alex Williamson <alex.williamson@redhat.com> Eduardo Habkost <ehabkost@redhat.com> Greg Jednaszewski <jednaszewski@gmail.com> H. Peter Anvin <hpa@zytor.com> Marin Hannache <git@mareo.fr> Robin Smidsrød <robin@smidsrod.no> Shao Miller <sha0.miller@gmail.com> Thomas Horsten <thomas@horsten.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-02201-201/+213
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add support for the Unmodified Binary Distribution LicenceMichael Brown2015-03-021-0/+11
| | | | | | | | | | | | | | | Add the text for the Unmodified Binary Distribution Licence. This Licence allows for the distribution of unmodified binaries built from publicly available source code, without imposing the obligations of the GNU General Public License upon anyone who chooses to distribute only the unmodified binaries built from that source code. See the licence text for the precise terms and conditions. Add the licence GPL2_OR_LATER_OR_UBDL to the set of licences which can be declared using FILE_LICENCE(), and add the corresponding support to licence.pl. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Include full licence text for all GPL2_OR_LATER filesMichael Brown2015-02-261-3/+13
| | | | | | | | Add the standard warranty disclaimer and Free Software Foundation address paragraphs to the licence text where these are not currently present. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Extract timing parameters out to config/dhcp.hAlex Williamson2015-02-251-10/+0Star
| | | | | | | | | | | | | | iPXE uses DHCP timeouts loosely based on values recommended by the specification, but often abbreviated to reduce timeouts for reliable and/or simple network topologies. Extract the DHCP timing parameters to config/dhcp.h and document them. The resulting default iPXE behavior is exactly the same, but downstreams are now afforded the opportunity to implement spec-compliant behavior via config file overrides. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite strtoul()Michael Brown2015-02-192-25/+17Star
| | | | | | | | | | The implementation of strtoul() has a partially unknown provenance. Rewrite this code to avoid potential licensing uncertainty. Since we now use -ffunction-sections, there is no need to place strtoull() in a separate file from strtoul(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add generic USB network device frameworkMichael Brown2015-02-172-0/+63
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite string functionsMichael Brown2015-02-172-42/+97
| | | | | | | | | | | | Some of the C library string functions have an unknown provenance. Reimplement all such functions to avoid potential licensing uncertainty. Remove the inline-assembler versions of strlen(), memswap(), and strncmp(); these save a minimal amount of space (around 40 bytes in total) and are not performance-critical. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Remove unused string functionsMichael Brown2015-02-161-6/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Provide generic framework for refilling receive endpointsMichael Brown2015-02-131-0/+40
| | | | | | | Provide a generic framework for allocating, refilling, and optionally recycling I/O buffers used by bulk IN and interrupt endpoints. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Handle port status changes received after failing to find a driverMichael Brown2015-02-121-1/+7
| | | | | | | | | | | | | | | | | | | | | Commit a60f2dd ("[usb] Try multiple USB device configurations") changed the behaviour of register_usb() such that if no drivers are found then the device will be closed and the memory used will be freed. If a port status change subsequently occurs while the device is still physically attached, then usb_hotplug() will see this as a new device having been attached, since there is no device recorded as being currently attached to the port. This can lead to spurious hotplug events (or even endless loops of hotplug events, if the process of opening and closing the device happens to generate a port status change). Fix by using a separate flag to indicate that a device is physically attached (even if we have no corresponding struct usb_device). Reported-by: Dan Ellis <Dan.Ellis@displaylink.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rndis] Add rndis_rx_err()Michael Brown2015-02-111-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Allow usb_stream() to enforce a terminating short packetMichael Brown2015-02-101-3/+5
| | | | | | | | | | Some USB endpoints require that a short packet be used to terminate transfers, since they have no other way to determine message boundaries. If the message length happens to be an exact multiple of the USB packet size, then this requires the use of an additional zero-length packet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Parse endpoint descriptor bInterval fieldMichael Brown2015-02-101-1/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Handle CDC union functional descriptorsMichael Brown2015-02-091-0/+17
| | | | | | | USB Communications Device Class devices may use a union functional descriptor to group several interfaces into a function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Try multiple USB device configurationsMichael Brown2015-02-091-3/+3
| | | | | | | Iterate over a USB device's available configurations until we find one for which we have working drivers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Allow tftp_uri() to construct a URI with a custom portMichael Brown2015-02-061-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Add support for CDC-NCM USB Ethernet devicesMichael Brown2015-02-032-0/+40
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add support for xHCI host controllersMichael Brown2015-02-031-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add basic support for USB hubsMichael Brown2015-02-031-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add basic support for USB devicesMichael Brown2015-02-033-1/+1154
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Allow drivers to specify a PCI classMichael Brown2015-02-022-93/+55Star
| | | | | | | | Allow drivers to specify a supported PCI class code. To save space in the final binary, make this an attribute of the driver rather than an attribute of a PCI device ID list entry. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Require support for VMBus version 3.0 or newerMichael Brown2014-12-211-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | We require the ability to disconnect from and reconnect to VMBus; if we don't have this then there is no (viable) way for a loaded operating system to continue to use any VMBus devices. (There is also a small but non-zero risk that the host will continue to write to our interrupt and monitor pages, since the VMBUS_UNLOAD message in earlier versions is essentially a no-op.) This requires us to ensure that the host supports protocol version 3.0 (VMBUS_VERSION_WIN8_1). However, we can't actually _use_ protocol version 3.0, since doing so causes an iSCSI-booted Windows Server 2012 R2 VM to crash due to a NULL pointer dereference in vmbus.sys. To work around this problem, we first ensure that we can connect using protocol v3.0, then disconnect and reconnect using the oldest known protocol. This deliberately prevents the use of the iPXE native Hyper-V drivers on older versions of Hyper-V, where we could use our drivers but in so doing would break the loaded operating system. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rndis] Ignore start-of-day RNDIS_INDICATE_STATUS_MSG with status 0x40020006Michael Brown2014-12-201-0/+2
| | | | | | | | | | | Windows Server 2012 R2 generates an RNDIS_INDICATE_STATUS_MSG with a status code of 0x4002006. This status code does not appear to be documented anywhere within the sphere of human knowledge. Explicitly ignore this status code in order to avoid unnecessarily cluttering the display when RNDIS debugging is enabled. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Assume that VMBus xfer page ranges correspond to RNDIS messagesMichael Brown2014-12-201-7/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The (undocumented) VMBus protocol seems to allow for transfer page-based packets where the data payload is split into an arbitrary set of ranges within the transfer page set. The RNDIS protocol includes a length field within the header of each message, and it is known from observation that multiple RNDIS messages can be concatenated into a single VMBus message. iPXE currently assumes that the transfer page range boundaries are entirely arbitrary, and uses the RNDIS header length to determine the RNDIS message boundaries. Windows Server 2012 R2 generates an RNDIS_INDICATE_STATUS_MSG for an undocumented and unknown status code (0x40020006) with a malformed RNDIS header length: the length does not cover the StatusBuffer portion of the message. This causes iPXE to report a malformed RNDIS message and to discard any further RNDIS messages within the same VMBus message. The Linux Hyper-V driver assumes that the transfer page range boundaries correspond to RNDIS message boundaries, and so does not notice the malformed length field in the RNDIS header. Match the behaviour of the Linux Hyper-V driver: assume that the transfer page range boundaries correspond to the RNDIS message boundaries and ignore the RNDIS header length. This avoids triggering the "malformed packet" error and also avoids unnecessary data copying: since we now have one I/O buffer per RNDIS message, there is no longer any need to use iob_split(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rndis] Send RNDIS_HALT_MSGMichael Brown2014-12-191-1/+1
| | | | | | The RNDIS specification requires that we send RNDIS_HALT_MSG. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rndis] Send RNDIS_INITIALISE_MSGMichael Brown2014-12-191-2/+20
| | | | | | | | The Hyper-V RNDIS implementation on Windows Server 2012 R2 requires that we send an explicit RNDIS initialisation message in order to get a working RX datapath. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Add support for NetVSC paravirtual network devicesMichael Brown2014-12-181-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Add support for VMBus devicesMichael Brown2014-12-184-0/+635
| | | | | | Add support for an abstraction of a VMBus device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Add support for Hyper-V hypervisorMichael Brown2014-12-181-0/+230
| | | | | | | Add support for detecting and communicating with the Hyper-V hypervisor. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rndis] Add generic RNDIS device abstractionMichael Brown2014-12-183-6/+354
| | | | | | | RNDIS provides an abstraction of a network device on top of a generic packet transmission mechanism. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Add iob_split() to split an I/O buffer into portionsMichael Brown2014-12-181-0/+1
| | | | | | | | | | | RNDIS devices may provide multiple packets encapsulated into a single message. Provide an API to allow the RNDIS driver to split an I/O buffer into smaller portions. The current implementation will always copy the underlying data, rather than splitting the buffer in situ. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [device] Provide a driver-private data field for root devicesMichael Brown2014-12-181-0/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add sanity checks after list-adding functionsMichael Brown2014-12-121-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add ASSERTED macro to test if any assertion has triggeredMichael Brown2014-12-121-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ping] Allow "ping" command output to be inhibitedMichael Brown2014-10-231-1/+1
| | | | | Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ping] Allow termination after a specified number of packetsMichael Brown2014-10-232-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Add the "-c <count>" option to the "ping" command, allowing for automatic termination after a specified number of packets. When a number of packets is specified: - if a serious error (i.e. length mismatch or content mismatch) occurs, then the ping will be immediately terminated with the relevant status code; - if at least one response is received successfully, and all errors are non-serious (i.e. timeouts or out-of-sequence responses), then the ping will be terminated after the final response (or timeout) with a success status; - if no responses are received successfully, then the ping will be terminated after the final timeout with ETIMEDOUT. If no number of packets is specified, then the ping will continue until manually interrupted. Originally-implemented-by: Cedric Levasseur <cyr-ius@ipocus.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add NII / UNDI driverMichael Brown2014-10-164-0/+843
| | | | | | | | | | | | | | | | | | | | | | | Some UEFI network drivers provide a software UNDI interface which is exposed via the Network Interface Identifier Protocol (NII), rather than providing a Simple Network Protocol (SNP). The UEFI platform firmware will usually include the SnpDxe driver, which attaches to NII and provides an SNP interface. The SNP interface is usually provided on the same handle as the underlying NII device. This causes problems for our EFI driver model: when efi_driver_connect() detaches existing drivers from the handle it will cause the SNP interface to be uninstalled, and so our SNP driver will not be able to attach to the handle. The platform firmware will eventually reattach the SnpDxe driver and may attach us to the SNP handle, but we have no way to prevent other drivers from attaching first. Fix by providing a driver which can attach directly to the NII protocol, using the software UNDI interface to drive the network device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update to current EDK2 headersMichael Brown2014-10-165-15/+60
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Generalise snpnet_dev_info() to efi_device_info()Michael Brown2014-10-161-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add definitions of GUIDs observed when chainloading from Intel driverMichael Brown2014-09-2510-0/+4123
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>