summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [dhcp] Use Ethernet-compatible chaddr, if possibleMichael Brown2010-12-153-30/+38
| | | | | | | | | | | | | | | For IPoIB, we currently use the hardware address (i.e. the eight-byte GUID) as the DHCP chaddr. This works, but some PXE servers (notably Altiris RDP) refuse to respond if the chaddr field is anything other than six bytes in length. We already have the notion of an Ethernet-compatible link-layer address, which is used in the iBFT (the design of which similarly fails to account for non-Ethernet link layers). Use this as the first preferred alternative to the actual link-layer address when constructing the DHCP chaddr field. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Improve pxe_udp debug messagesMichael Brown2010-12-151-9/+14
| | | | | | | | | | The PXE debugging messages have remained pretty much unaltered since Etherboot 5.4, and are now difficult to read in comparison to most of the rest of iPXE. Bring the pxe_udp debug messages up to normal iPXE standards. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Include both DNS addresses in iBFT, if availableMichael Brown2010-12-091-9/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetch_ipv4_array_setting()Michael Brown2010-12-092-5/+25
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [debug] Add DBG_MD5() and related macrosMichael Brown2010-12-092-0/+108
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add missing copyright header and FILE_LICENCE macroMichael Brown2010-12-091-0/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fnrec] Enhance function recordingMichael Brown2010-12-094-71/+265
| | | | | | | | | | | | | | | | | | | | | | | | | Enhance the information collected by the function recorder to include the call site and entry/exit counts. This allows fnrec.pl to produce a call tree such as: step (from core/getkey.c:46 = 0x17e90) { ref_increment (from core/process.c:93 = 0x73ec) { } net_step (from core/process.c:96 = 0x73f1) { net_poll (from net/netdevice.c:741 = 0xbce6) { netdev_poll (from net/netdevice.c:700 = 0xbc58) { } netdev_rx_dequeue (from net/netdevice.c:709 = 0xbc65) { } } } ref_decrement (from core/process.c:96 = 0x73f9) { } } Note that inlined functions are reported, confusingly, as extra calls to the *containing* function. Minimise this confusion by adding the attribute "no_instrument_function" to all functions declared as inline. (Static functions that have been inlined autonomously by gcc will still be problematic, but these are far fewer in number.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Set correct PktType in PXENV_UNDI_ISRMichael Brown2010-12-091-1/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Avoid touching fields that may not exist in PXENV_UNDI_GET_NIC_TYPEMichael Brown2010-12-091-5/+5
| | | | | | | | | | | Earlier versions of the PXE specification do not have the SubVendor_ID and SubDevice_ID fields, and some NBPs may not provide space for them. Avoid overwriting the contents of these fields, just in case. This is similar to the problem with the BufferLimit field in PXENV_GET_CACHED_INFO. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "reboot" commandMichael Brown2010-12-093-0/+70
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [r8169] Disabling IRQs should not also acknowledge the IRQsMichael Brown2010-12-091-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add FILE_LICENCE macro to some GPL-v2-or-later filesShao Miller2010-12-0411-0/+22
| | | | | | | | | Changes were made to files where the licence text within the files themselves confirms that the files are GPL version 2 or later. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add FILE_LICENCE macro to some GPL-v2 filesShao Miller2010-12-043-0/+7
| | | | | | | | Changes were made to files where the licence text within the files themselves confirms that the files are GPL version 2. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libflat] Test A20 gate without switching to flat real modeMichael Brown2010-12-031-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Use the real-mode address ffff:0010 to access the linear address 0x100000, and so test whether or not the A20 gate is enabled without requiring a switch into flat real mode (or some other addressing mode). This speeds up CPU mode transitions, and also avoids breaking the NBP from IBM's Tivoli Provisioning Manager for Operating System Deployment. This NBP makes some calls to iPXE in VM86 mode rather than true real mode and does not correctly emulate our transition into flat real mode. Interestingly, Tivoli's VMM *does* allow us to switch into protected mode (though it patches our GDT so that we execute in ring 1 rather than ring 0). However, paging is still disabled and we have a 4GB segment limit. Being in ring 1 does not, therefore, restrict us in any meaningful way; this has been verified by deliberately writing garbage over Tivoli's own GDT (at address 0x02201010) during a nominally VM86-mode PXE API call. It's unclear precisely what protection this VMM is supposed to be offering. Suggested-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Work around hardware stripping of VLAN tagsMichael Brown2010-12-012-3/+21
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Expose vlan_find() to network card driversMichael Brown2010-12-012-2/+3
| | | | | | | | | Some network cards automatically strip the VLAN header, providing the VLAN tag via a side channel such as a completion queue entry. These cards need to be able to report receive completions directly against the relevant VLAN device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Use "-" instead of "." as separator in VLAN device namesMichael Brown2010-12-011-1/+1
| | | | | | | | | | | | | | | | | VLAN device names have the form "netX.Y", e.g. "net0.5" for VLAN 5 on net0. This use of "." conflicts with the use of "." as the hierarchical separator in settings block names, with the result that VLAN device settings cannot be accessed by name. It would be trivial to treat the VLAN device settings as being a child of the trunk device settings, but this would cause the VLAN device settings to be applied to the trunk device: for example, setting "net0.5/ip" would then apply the IP address to both net0.5 and net0. Fix by changing the VLAN device name to use "-" instead of ".": the VLAN device "net0.5" is now "net0-5". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Apply settings block name in register_settings()Michael Brown2010-12-0110-32/+30Star
| | | | | | | | Pass the settings block name as a parameter to register_settings(), rather than defining it with settings_init() (and then possibly changing it by directly manipulating settings->name). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Disambiguate the common EINVAL casesMichael Brown2010-12-011-4/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Disambiguate "no nameserver" and "no DNS record" errorsMichael Brown2010-12-011-2/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Fix inconsistent information in HERMON_SET_PORT_GENERAL_PARAMMichael Brown2010-11-291-6/+4Star
| | | | | | pptx and pfctx should not be set together, nor should pprx and pfcrx. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Remove "Aborting on <line>" messageMichael Brown2010-11-291-3/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Match user expectations for &&, ||, goto, and exitMichael Brown2010-11-295-52/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The && and || operators should be left-associative, since that is how they are treated in most other languages (including C and Unix shell). For example, in the command: dhcp net0 && goto dhcp_ok || echo No DHCP on net0 if the "dhcp net0" fails then the "echo" should be executed. After an "exit" or a successful "goto", further commands on the same line should never be executed. For example: goto somewhere && echo This should never be printed exit 0 && echo This should never be printed exit 1 && echo This should never be printed An "exit" should cause the current shell or script to terminate and return the specified exit status to its caller. For example: chain test.ipxe && echo Success || echo Failure [in test.ipxe] #!ipxe exit 0 should echo "Success". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued optionsMichael Brown2010-11-291-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [shell] Add "shell" commandMichael Brown2010-11-282-3/+46
| | | | | | | The "shell" command allows a script to enter an interactive shell, which is potentially useful for troubleshooting. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Really use __builtin_offsetof() when availableArkadiusz Miskiewicz2010-11-281-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use __builtin_offsetof() when availableMichael Brown2010-11-281-0/+4
| | | | | | | | | | | Some newer versions of gcc (observed with a patched gcc 4.5.1) seem to treat our offsetof() implementation as not being a compile-time constant. Fix by using __builtin_offsetof() when available. (As with the original offsetof() macro, this code is copied from the Linux kernel's stddef.h.) Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Enable priority flow control on the FCoE priorityMichael Brown2010-11-271-2/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Use only the first instance of a FIP descriptorMichael Brown2010-11-271-1/+3
| | | | | | | | | | Almost all FIP packets contain at most one instance of each descriptor. A VLAN notification may contain multiple VLAN descriptors. The FCoE specification does not provide any guidance regarding prioritisation of VLANs, so we may choose to arbitrarily choose the first listed VLAN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Treat VLAN 0 as validMichael Brown2010-11-271-1/+1
| | | | | | | | | VLAN headers are allowed to contain a VLAN tag of zero, indicating that the header specifies only a priority and that the packet does not belong to any VLAN. The easiest way to handle this is to treat VLAN 0 as being a normal VLAN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Tidy up debug messageMichael Brown2010-11-271-4/+2Star
| | | | | | | | The increase in length in Fibre Channel device names causes the "selected FCF" message to wrap beyond 80 characters. Fix by using abbreviations where possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Allow Fibre Channel ports to be explicitly namedMichael Brown2010-11-273-7/+7
| | | | | | Use the network interface name as the Fibre Channel port name. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Create Fibre Channel port only when we have selected an FCFMichael Brown2010-11-271-10/+21
| | | | | | | | | Create the Fibre Channel port only when the FCoE port has selected a Fibre Channel Forwarder to use. This avoids the confusion of having an FC port created for the network device on which only VLAN discovery is performed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcoe] Add support for FIP VLAN discoveryMichael Brown2010-11-262-3/+152
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Provide vlan_can_be_trunk()Michael Brown2010-11-262-8/+24
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Add non-error debug messagesMichael Brown2010-11-261-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Allow duplicate VLAN creation attemptsMichael Brown2010-11-261-5/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nvo] Allow fragment list to be omittedMichael Brown2010-11-251-6/+20
| | | | | | | | Allow the fragment list to be omitted when calling nvo_init(). Omitting the list will cause the whole of the NVS device to be used for NVO storage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Add a mechanism for using a PCI VPD field as an NVS deviceMichael Brown2010-11-252-0/+157
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Add support for reading and writing PCI Vital Product Data (VPD)Michael Brown2010-11-253-0/+552
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Standardise debug message formatMichael Brown2010-11-242-19/+24
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Fix multi-layer variable expansion (again)Michael Brown2010-11-231-3/+3
| | | | | | | | | | | | | | Expansion of the (admittedly perverse) "aaa}bbb${ccc" will currently fail because expand_command() does not check that the closing "}" occurs later than the opening "${". Fix by ensuring that the most recent opening "${" is used to match against the first *subsequent* closing "}". Total cost of this change: -12 bytes, bringing the overall cost of this feature to -4 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Fix multi-layer variable expansionMichael Brown2010-11-221-8/+12
| | | | | | | | | | | | | Expansion of ${${foo}} will currently fail, because the first opening "${" will be incorrectly matched against the first closing "}", leading to an attempt to expand the variable "${foo". Fix by ensuring that the most recent opening "${" is used to match against the first closing "}". Total cost: 8 bytes. :) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow "set" command to take an empty valueMichael Brown2010-11-221-1/+1
| | | | | | | | | | Allow "set <variable>" to be used to set the variable to an empty value, if permitted by the setting type. Note that some settings backends do not differentiate between an empty value and a non-existent value, so this may or may not be equivalent to "clear <variable>". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Merge "netboot" command into "autoboot"Michael Brown2010-11-222-82/+23Star
| | | | | | | | | | Allow "autoboot" to accept an optional list of network devices, and remove the "netboot" command. This saves around 130 bytes. The "netboot" command has existed for approximately 48 hours, so its removal should not cause backwards compatibility issues for anyone. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "isset" commandMichael Brown2010-11-221-0/+35
| | | | | | | | | The "isset" command can be used to determine whether or not a setting is present. For example: isset ${net0/ip} || dhcp net0 # If we have no IP address, try DHCP Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Allow "exit" to exit a scriptMichael Brown2010-11-224-45/+92
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Implement "goto" in iPXE scriptsMichael Brown2010-11-221-25/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow script labels to be defined using the syntax :<labelname> (nothing else allowed on the line, including whitespace). Labels are ignored during script execution, but can be used as the target of the "goto" command. For example: #!ipxe goto machine_${net0/ip} || goto machine_default # Linux kernel boot :machine_10.0.0.101 :machine_10.0.0.102 set filename http://my.boot.server/vmlinuz goto done # Default configuration :machine_default set filename pxelinux.0 goto done # Boot selected configuration :done chain ${filename} Originally-implemented-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Originally-implemented-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add trivial logical operators to iPXE command linesMichael Brown2010-11-221-36/+115
| | | | | | | | | | | | | | | | | Make the "||" and "&&" operators available within iPXE commands. For example: dhcp net0 || set net0/ip 192.168.0.2 would attempt to acquire an IP address via DHCP, falling back to a static address if DHCP fails. As a side-effect, comments may now be appended to any line. For example: dhcp net0 || set net0/ip 192.168.0.2 # Try DHCP first, then static Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Remove startpxe and stoppxe commands from default buildsMichael Brown2010-11-222-2/+1Star
| | | | | | | These commands exist primarily for debugging and are not generally useful, so save 137 bytes by removing them by default. Signed-off-by: Michael Brown <mcb30@ipxe.org>