aboutsummaryrefslogtreecommitdiff
path: root/src/include
AgeCommit message (Collapse)AuthorFilesLines
2016-03-13[efi] Update to current EDK2 headersMichael Brown13-42/+123
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-13[build] Allow assembler section type character to vary by architectureMichael Brown2-4/+15
On some architectures (such as ARM) the "@" character is used as a comment delimiter. A section type argument such as "@progbits" therefore becomes "%progbits". This is further complicated by the fact that the "%" character has special meaning for inline assembly when input or output operands are used, in which cases "@progbits" becomes "%%progbits". Allow the section type character(s) to be defined via Makefile variables. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-12[arp] Validate length of ARP packetMichael Brown1-0/+10
There is no practical way to generate an underlength ARP packet since an ARP packet is always padded up to the minimum Ethernet frame length (or dropped by the receiving Ethernet hardware if incorrectly padded), but the absence of an explicit check causes warnings from some analysis tools. Fix by adding an explicit check on the I/O buffer length. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-11[crypto] Allow for zero-length ASN.1 cursorsMichael Brown1-2/+14
The assumption in asn1_type() that an ASN.1 cursor will always contain a type byte is incorrect. A cursor that has been cleanly invalidated via asn1_invalidate_cursor() will contain a type byte, but there are other ways in which to arrive at a zero-length cursor. Fix by explicitly checking the cursor length in asn1_type(). This allows asn1_invalidate_cursor() to be reduced to simply zeroing the length field. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-09[xsigo] Add support for Xsigo virtual Ethernet (XVE) EoIB devicesMichael Brown2-0/+407
Add support for EoIB devices as implemented by Xsigo. Based on the public (but out-of-tree) Linux kernel drivers at https://oss.oracle.com/git/?p=linux-uek.git;a=log;h=v4.1.12-32.2.1 Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-09[eoib] Support non-FullMember gateway devicesMichael Brown1-0/+22
Some EoIB implementations utilise an EoIB-to-Ethernet gateway device that does not perform a FullMember join to the multicast group for the EoIB broadcast domain. This has various exciting side-effects, such as requiring every EoIB node to send every broadcast packet twice. As an added bonus, the gateway may also break the EoIB MAC address to GID mapping protocol by sending Ethernet-sourced packets from the wrong QPN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-09[eoib] Allow the multicast group to be forcefully createdMichael Brown1-0/+21
Some EoIB implementations require each individual EoIB node to create the multicast group for the EoIB broadcast domain. It is left as an exercise for the interested reader to determine how such an implementation might ever allow the parameters of such a multicast group to be changed without requiring a simultaneous upgrade of every driver on every operating system on every machine currently attached to the fabric. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-09[eoib] Add Ethernet over Infiniband (EoIB) driverMichael Brown2-0/+61
EoIB is a fairly simple protocol in which raw Ethernet frames (excluding the CRC) are encapsulated within Infiniband Unreliable Datagrams, with a four-byte fixed EoIB header (which conveys no actual information). The Ethernet broadcast domain is provided by a multicast group, similar to the IPoIB IPv4 multicast group. The mapping from Ethernet MAC addresses to Infiniband address vectors is achieved by snooping incoming traffic and building a peer cache which can then be used to map a MAC address into a port GID. The address vector is completed using a path record lookup, as for IPoIB. Note that this requires every packet to include a GRH. Add basic support for EoIB devices. This driver is substantially derived from the IPoIB driver. There is currently no mechanism for automatically creating EoIB devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[ipoib] Resimplify test for received broadcast packetsMichael Brown1-0/+3
Commit e62e52b ("[ipoib] Simplify test for received broadcast packets") relies upon the multicast LID being present in the destination address vector as passed to ipoib_complete_recv(). Unfortunately, this information is not present in many Infiniband devices' completion queue entries. Fix by testing instead for the presence of a multicast GID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Add "ibstat" commandMichael Brown1-0/+16
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Assign names to queue pairsMichael Brown1-1/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Assign names to CMRC connectionsMichael Brown1-4/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Allow for the creation of multicast groupsMichael Brown1-1/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Parse MLID, rate, and SL from multicast membership recordMichael Brown1-13/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Record multicast GID attachment as part of group membershipMichael Brown1-0/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Use correct transaction identifier in CM responsesMichael Brown1-1/+7
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Assign names to Infiniband devices for debug messagesMichael Brown1-0/+7
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-08[infiniband] Add support for performing service record lookupsMichael Brown2-1/+39
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-07[infiniband] Remove concept of whole-device owner dataMichael Brown1-24/+0
Remove the implicit assumption that the IPoIB protocol owns the whole Infiniband device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-02-26[ioapi] Split ioremap() out to a separate IOMAP APIMichael Brown3-25/+112
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-27[tcp] Guard against malformed TCP optionsMichael Brown1-2/+0
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-19[usb] Allow USB endpoints to specify a reserved header length for refillsMichael Brown1-3/+8
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-09[image] Provide image_set_uri() to modify an image's URIMichael Brown1-0/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-06[usb] Add support for numeric keypad on USB keyboardsMichael Brown1-0/+34
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-04[smsc95xx] Fetch MAC from SMBIOS OEM string for Honeywell VM3Michael Brown1-0/+3
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>
2015-12-23[settings] Expose SMBIOS settings as global variablesMichael Brown1-0/+10
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-09[efi] Centralise EFI file system info GUIDsMichael Brown1-0/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07[acm] Add support for CDC-ACM (aka USB RNDIS) devicesMichael Brown2-0/+50
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07[usb] Allow USB device IDs to include arbitrary driver-specific dataMichael Brown1-0/+4
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07[usb] Record USB device speed separately from current port speedMichael Brown1-0/+2
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>
2015-12-01[bitops] Provide BIT_QWORD_PTR()Michael Brown1-0/+7
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>
2015-12-01[smsc95xx] Add driver for SMSC/Microchip LAN95xx USB Ethernet NICsMichael Brown1-0/+1
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>
2015-11-30[bitops] Fix definitions for big-endian devicesMichael Brown1-6/+13
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30[pci] Add definitions for PCI Express function level reset (FLR)Michael Brown1-0/+7
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30[infiniband] Add qword accessors for ib_guid and ib_gidMichael Brown1-0/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30[infiniband] Add definitions for FDR and EDR link speedsMichael Brown1-0/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-16[efi] Add support for EFI_GRAPHICS_OUTPUT_PROTOCOL frame buffer consolesMichael Brown1-0/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-14[fbcon] Move margin calculations to fbcon.cMichael Brown1-4/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-14[fbcon] Allow character height to be selected at runtimeMichael Brown1-8/+12
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-07[efi] Import EFI_HII_FONT_PROTOCOL definitionsMichael Brown3-0/+831
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-07[efi] Update to current EDK2 headersMichael Brown28-373/+12442
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14[efi] Expose unused USB devices via EFI_USB_IO_PROTOCOLMichael Brown2-0/+81
Allow the UEFI platform firmware to provide drivers for unrecognised devices, by exposing our own implementation of EFI_USB_IO_PROTOCOL. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14[usb] Allow for wildcard USB class IDsMichael Brown1-3/+42
Make the class ID a property of the USB driver (rather than a property of the USB device ID), and allow USB drivers to specify a wildcard ID for any of the three component IDs (class, subclass, or protocol). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14[usb] Select preferred USB device configuration based on driver scoreMichael Brown1-9/+39
Generate a score for each possible USB device configuration based on the available driver support, and select the configuration with the highest score. This will allow us to prefer ECM over RNDIS (for devices which support both) and will allow us to meaningfully select a configuration even when we have drivers available for all functions (e.g. when exposing unused functions via EFI_USB_IO_PROTOCOL). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-13[efi] Include a copy of the device path within struct efi_deviceMichael Brown1-0/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-13[efi] Provide efi_devpath_len()Michael Brown1-0/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-13[usb] Generalise zero-length packet generation logicMichael Brown1-2/+2
The decision on whether or not a zero-length packet needs to be transmitted is independent of the host controller and belongs in the USB core. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-10[tcpip] Avoid generating positive zero for transmitted UDP checksumsMichael Brown1-2/+36
TCP/IP checksum fields are one's complement values and therefore have two possible representations of zero: positive zero (0x0000) and negative zero (0xffff). In RFC768, UDP over IPv4 exploits this redundancy to repurpose the positive representation of zero (0x0000) to mean "no checksum calculated"; checksums are optional for UDP over IPv4. In RFC2460, checksums are made mandatory for UDP over IPv4. The wording of the RFC is such that the UDP header is mandated to use only the negative representation of zero (0xffff), rather than simply requiring the checksum to be correct but allowing for either representation of zero to be used. In RFC1071, an example algorithm is given for calculating the TCP/IP checksum. This algorithm happens to produce only the positive representation of zero (0x0000); this is an artifact of the way that unsigned arithmetic is used to calculate a signed one's complement sum (and its final negation). A common misconception has developed (exemplified in RFC1624) that this artifact is part of the specification. Many people have assumed that the checksum field should never contain the negative representation of zero (0xffff). A sensible receiver will calculate the checksum over the whole packet and verify that the result is zero (in whichever representation of zero happens to be generated by the receiver's algorithm). Such a receiver will not care which representation of zero happens to be used in the checksum field. However, there are receivers in existence which will verify the received checksum the hard way: by calculating the checksum over the remainder of the packet and comparing the result against the checksum field. If the representation of zero used by the receiver's algorithm does not match the representation of zero used by the transmitter (and so placed in the checksum field), and if the receiver does not explicitly allow for both representations to compare as equal, then the receiver may reject packets with a valid checksum. For UDP, the combined RFCs effectively mandate that we should generate only the negative representation of zero in the checksum field. For IP, TCP and ICMP, the RFCs do not mandate which representation of zero should be used, but the misconceptions which have grown up around RFC1071 and RFC1624 suggest that it would be least surprising to generate only the positive representation of zero in the checksum field. Fix by ensuring that all of our checksum algorithms generate only the positive representation of zero, and explicitly inverting this in the case of transmitted UDP packets. Reported-by: Wissam Shoukair <wissams@mellanox.com> Tested-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-07[efi] Add a USB host controller driver based on EFI_USB_IO_PROTOCOLMichael Brown2-1/+5
Allow iPXE to coexist with other USB device drivers, by attaching to the EFI_USB_IO_PROTOCOL instances provided by the UEFI platform firmware. The EFI_USB_IO_PROTOCOL is an unsurprisingly badly designed abstraction of a USB device. The poor design choices intrinsic in the UEFI specification prevent efficient operation as a network device, with the result that devices operated using the EFI_USB_IO_PROTOCOL operate approximately two orders of magnitude slower than devices operated using our native EHCI or xHCI host controller drivers. Since the performance is so abysmally slow, and since the underlying problems are due to fundamental architectural mistakes in the UEFI specification, support for the EFI_USB_IO_PROTOCOL host controller driver is left as disabled by default. Users are advised to use the native iPXE host controller drivers instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-06[efi] Add USB headers and GUID definitionsMichael Brown5-0/+1992
Signed-off-by: Michael Brown <mcb30@ipxe.org>