aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-05-19[intel] Add intelxvf_stats() to dump packet statistics registersMichael Brown2-0/+46
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-19[int13con] Add basic ability to log to a local disk via INT 13Michael Brown5-6/+304
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>
2015-05-16[intel] Add intelxvf driver for Intel 10 GigE virtual function NICsMichael Brown3-0/+455
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-16[intel] Add support for mailbox used by virtual functionsMichael Brown4-0/+414
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>
2015-05-16[intel] Allow for the use of advanced TX descriptorsMichael Brown3-42/+126
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>
2015-05-15[intel] Expose intel_diag() for use by other Intel NIC driversMichael Brown2-26/+19
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-13[usb] Always clear recorded disconnections after performing hotplug actionsMichael Brown1-7/+7
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>
2015-05-13[usb] Do not call usb_hotplug() when registering a new hubMichael Brown1-3/+3
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>
2015-05-12[usb] Add basic support for USB keyboardsMichael Brown7-0/+680
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>
2015-05-12[usb] Add generic USB human interface device (HID) frameworkMichael Brown3-0/+258
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-11[usb] Add USB_INTERRUPT_OUT internal typeMichael Brown4-5/+9
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-11[ipv6] Disambiguate received ICMPv6 errorsMichael Brown2-2/+90
Originally-implemented-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-10[uhci] Use meaningful device names in debug messagesMichael Brown2-15/+21
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-10[ehci] Use meaningful device names in debug messagesMichael Brown2-43/+52
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-10[xhci] Use meaningful device names in debug messagesMichael Brown2-119/+124
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-09[usb] Provide usb_endpoint_name() for use by host controller driversMichael Brown2-33/+30
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-09[uhci] Add support for UHCI host controllersMichael Brown7-0/+1937
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-09[ehci] Allow UHCI/OHCI controllers to locate the EHCI companion controllerMichael Brown3-0/+29
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-09[usb] Add find_usb_bus_by_location() helper functionMichael Brown2-0/+22
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-09[ehci] Poll child companion controllers after disowning portMichael Brown2-0/+59
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-09[usb] Maintain single lists of halted endpoints and changed portsMichael Brown2-50/+55
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>
2015-05-09[usb] Maintain a list of all USB busesMichael Brown2-0/+18
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-05-08[usb] Detect missed disconnectionsMichael Brown5-51/+78
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>
2015-05-08[pci] Provide PCI_CLASS() to calculate a scalar PCI class valueMichael Brown4-9/+17
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>
2015-05-01[usb] Include setup packet within I/O buffer for message transfersMichael Brown5-49/+41
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>
2015-04-24[vram] Add "vram" built-in setting to dump video RAMMichael Brown3-0/+76
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>
2015-04-24[settings] Add "base64" setting typeMichael Brown3-0/+57
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-24[base64] Add buffer size parameter to base64_encode() and base64_decode()Michael Brown7-77/+84
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-24[base16] Add buffer size parameter to base16_encode() and base16_decode()Michael Brown12-127/+112
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>
2015-04-24[test] Include IPv6 support when performing settings self-testsMichael Brown1-0/+4
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>
2015-04-24[ath9k] Remove confusing logic inversion in an ANI variableChristian Hesse4-24/+24
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>
2015-04-24[build] Add missing "const" qualifiersChristian Hesse1-2/+2
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>
2015-04-22[intel] Add PCI device IDs for Intel I218-LM and I218-VChristian Hesse1-1/+6
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>
2015-04-22[build] Construct all-drivers list based on driver classMichael Brown4-4/+11
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>
2015-04-22[rtl818x] Obviate RTL_ROM() hackMichael Brown4-35/+31
Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-21[realtek] Do not attempt to access EEPROM on RTL8169 chipsMichael Brown1-2/+3
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>
2015-04-21[intel] Force RX polling on VMware emulated 82545emMichael Brown2-1/+13
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>
2015-04-21[intel] Report any unexpected interrupt causesMichael Brown2-0/+10
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-21[intel] Update PCI device IDs for Intel 82599 and X540 10G NICsEd Swierk1-4/+9
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>
2015-04-18[build] Use a single call to parserom.pl to speed up buildingMichael Brown1-21/+60
Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-18[build] Work around binutils quirk on OpenBSD 5.7Michael Brown1-0/+3
The assembler on OpenBSD 5.7 seems not to correctly handle the combinations of .struct and .previous used in unlzma.S, and ends up complaining about an "attempt to allocate data in absolute section". Work around this problem by explicitly resetting the section after the data structure definitions. Reported-by: Jiri B <jirib@devio.us> Tested-by: Jiri B <jirib@devio.us> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-17[build] Fix compiler warning on OpenBSD 5.7Michael Brown1-1/+1
Reported-by: Jiri B <jirib@devio.us> Tested-by: Jiri B <jirib@devio.us> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-15[build] Allow building PCI ROMs with device ID listsMichael Brown3-5/+38
PCI v3.0 supports a "device list" which allows the ROM to claim support for multiple PCI device IDs (but only a single vendor ID). Add support for building such ROMs by scanning the build target element list and incorporating any device IDs into the ROM's device list header. For example: make bin/8086153a--8086153b.mrom would build a ROM claiming support for both 8086:153a and 8086:153b. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-15[prism2] Remove duplicate PCI_ROM() linesMichael Brown1-2/+0
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-15[eepro100] Remove duplicate PCI_ROM() lineMichael Brown1-1/+0
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-14[efi] Use the EFI_RNG_PROTOCOL as an entropy source if availableMichael Brown2-3/+234
Entropy gathering via timer ticks is slow under UEFI (of the order of 20-30 seconds on some machines). Use the EFI_RNG_PROTOCOL if available, to speed up the process of entropy gathering. Note that some implementations (including EDK2) will fail if we request fewer than 32 random bytes at a time, and that the RNG protocol provides no guarantees about the amount of entropy provided by a call to GetRNG(). We take the (hopefully pessimistic) view that a 32-byte block returned by GetRNG() will contain at least the 1.3 bits of entropy claimed by min_entropy_per_sample(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-14[efi] Poll for TX completions only when there is an outstanding TX bufferMichael Brown1-8/+4
At least one NII implementation (in a Microsoft Surface tablet) seems to fail to report the absence (sic) of TX completions properly. Work around this by checking for TX completions only when we expect to see one. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-14[efi] Poll media status only if advertised as supportedMichael Brown1-2/+14
Some NII implementations will fail the GET_STATUS operation if we request the media status. Fix by doing so only if GET_INIT_INFO reported that media status is supported. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-14[efi] Provide a dummy data block in nii_initialise()Michael Brown1-1/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-04-14[efi] Add EFI time sourceMichael Brown5-1/+98
Signed-off-by: Michael Brown <mcb30@ipxe.org>