summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [dhcp] Use generic option-parsing libraryMichael Brown2010-11-221-120/+35Star
| | | | | | Total saving: 329 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Use generic option-parsing libraryMichael Brown2010-11-225-97/+219
| | | | | | Total cost: 66 bytes Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use generic option-parsing libraryMichael Brown2010-11-213-40/+202
| | | | | | Total cost: 75 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Use generic option-parsing libraryMichael Brown2010-11-213-36/+95
| | | | | | Total saving: 32 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Use generic option-parsing libraryMichael Brown2010-11-211-99/+66Star
| | | | | | Total saving: 261 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add generic option-parsing libraryMichael Brown2010-11-213-0/+347
| | | | | | | | | | | | | | | | Command implementations tend to include a substantial amount of common boilerplate code revolving around the parsing of command-line options and arguments. This increases the size cost of each command. Introduce an option-parsing library that abstracts out the common operations involved in command implementations. This enables the size of each individual command to be reduced, and also enhances consistency between commands. Total size of the library is 704 bytes, to be amortised across all command implementations. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Add "netboot" commandMichael Brown2010-11-203-4/+38
| | | | | Originally-implemented-by: michael-dev@fami-braun.de Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vlan] Add support for IEEE 802.1Q VLANsMichael Brown2010-11-2010-10/+725
| | | | | Originally-implemented-by: michael-dev@fami-braun.de Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Fix endianness in status messageMichael Brown2010-11-201-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Use network device receive queue freezingMichael Brown2010-11-201-2/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Use network device receive queue freezingMichael Brown2010-11-201-6/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow per-device receive queue processing to be frozenMichael Brown2010-11-202-6/+57
| | | | | | | | | | | | | | Several use cases (e.g. the UNDI API and the EFI SNP API) require access to the raw network device receive queue, and so currently use manual calls to netdev_poll() on a specific network device in order to prevent received packets from being processed by the network stack. As an alternative, provide a flag that allows receive queue processing to be frozen on a per-device basis. When receive queue processing is frozen, packets will be enqueued as normal, but will not be automatically dequeued and passed up the network stack. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Support underlying UNDI devices that don't support interruptsMichael Brown2010-11-191-17/+31
| | | | | | | | | | | | | | Some network cards do not generate interrupts when operated via the UNDI API. Allow for this by waiting for the ISR to be triggered only if the PXE stack advertises that it supports interrupts. When the PXE stack does not advertise interrupt support, we skip the call to PXENV_UNDI_ISR_IN_START and just poll the device using PXENV_UNDI_ISR_IN_PROCESS. This matches the observed behaviour of at least one other PXE NBP (emBoot's winBoot/i), so there is a reasonable chance of this working. Originally-implemented-by: Muralidhar Appalla <Muralidhar.Appalla@emulex.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Remove obsolete constantsMichael Brown2010-11-191-4/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Use MAX_LL_NET_HEADER_LEN instead of defining our own MAX_HDR_LENMichael Brown2010-11-192-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [udp] Remove obsolete constantsMichael Brown2010-11-191-3/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [udp] Use MAX_LL_NET_HEADER_LEN instead of defining our own UDP_MAX_HLENMichael Brown2010-11-192-4/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add MAX_NET_HEADER_LEN and MAX_LL_NET_HEADER_LENMichael Brown2010-11-191-0/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Always allow MAX_LL_HEADER_LEN for the link-layer headerMichael Brown2010-11-191-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Always allow MAX_LL_HEADER_LEN for the link-layer headerMichael Brown2010-11-191-1/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lotest] Move lotest.h to correct directoryMichael Brown2010-11-191-0/+0
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lacp] Fix dumping of raw LACP packetsMichael Brown2010-11-181-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Use net device name in debugging messagesMichael Brown2010-11-182-36/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "hexhyp" setting typeMichael Brown2010-11-131-4/+43
| | | | | | | | | | | | Provide a "hexhyp" setting type, which functions identically to the "hex" setting type except that it uses a hyphen instead of a colon as the byte delimiter. For example, if ${mac} expands to "52:54:00:12:34:56", then ${mac:hexhyp} will expand to "52-54-00-12-34-56". Originally-implemented-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bzimage] Increase maximum command-line size to 0x7ffJarrod Johnson2010-11-131-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Exit poll() as early as possible if no work to doMichael Brown2010-11-121-4/+4
| | | | | Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Set PSH flag only on packets containing dataMichael Brown2010-11-111-1/+1
| | | | | Suggested-by: Yelena Kadach <klenusik@hotmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Fix typographical error from previous commitShao Miller2010-11-112-2/+3
| | | | | | | | | | Fix typographical error from commit ea631f6 ("[list] Add list_first_entry()"). The symptom was PXELINUX 3.86 causing a stack overflow under VMware. Tested-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Add support for Fibre Channel name server lookupsMichael Brown2010-11-085-38/+585
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Hold ULP's peer reference while ULP existsMichael Brown2010-11-081-7/+14
| | | | | | | | Allow fc_ulp_decrement() to guarantee to fc_peer_decrement() that the peer reference remains valid for the duration of the call, by ensuring that ulp->peer remains valid while ulp is valid. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Allow peers and ULPs to log out when usage count reaches zeroMichael Brown2010-11-081-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Hold reference to peers and ULPs while calling fc_link_examine()Michael Brown2010-11-081-4/+16
| | | | | | | Allow link examination methods to safely assume that their self-reference remains valid for the duration of the method call. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Log out correct port ID after a successful LOGO requestMichael Brown2010-11-081-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Support Fibre Channel ECHOMichael Brown2010-11-083-103/+237
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Use EINVAL for URI parsing errors and EPROTO for protocol errorsMichael Brown2010-11-081-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Process at most one timer's expiry in each call to retry_step()Michael Brown2010-11-081-3/+9
| | | | | | | | | | | | | | | | | | | | | Calling a timer's expiry method may cause arbitrary consequences, including arbitrary modifications of the list of retry timers. list_for_each_entry_safe() guards against only deletion of the current list entry; it provides no protection against other list modifications. In particular, if a timer's expiry method causes the subsequent timer in the list to be deleted, then the next loop iteration will access a timer that may no longer exist. This is a particularly nasty bug, since absolutely none of the list-manipulation or reference-counting assertion checks will be triggered. (The first assertion failure happens on the next iteration through list_for_each_entry(), showing that the list has become corrupted but providing no clue as to when this happened.) Fix by stopping traversal of the list of retry timers as soon as we hit an expired timer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Avoid immediately clobbering reference count when freeing memoryMichael Brown2010-11-081-2/+14
| | | | | | | | | | Rearrange the fields in struct memory_block (without altering MIN_MEMBLOCK_SIZE) so that the "count" field of a reference-counted object is left intact when the memory containing the object is freed. This allows for the possibility of detecting reference-counting errors such as double-freeing. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Check reference validity on each use of ref_get() and ref_put()Michael Brown2010-11-082-12/+52
| | | | | | | | Check that the reference count is valid (i.e. non-negative) on each call to ref_get() and ref_put(), using an assert() at the point of use. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Use list_for_each_entry_safe() when we may delete a list entryMichael Brown2010-11-081-1/+2
| | | | | | | | | | | | | | free_memblock() currently uses list_for_each_entry() to iterate over the free list, and may delete an entry over which it iterates. While there is no way that the deleted list entry could be overwritten before we reference it, this does rely upon list_del() leaving the "next" pointer intact, which is not guaranteed. Discovered while tracking down a list-corruption bug (as a result of having modified list_del() to sanitise the deleted list entry). Fix by using list_for_each_entry_safe(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add list_first_entry()Michael Brown2010-11-087-28/+41
| | | | | | | | | There are several points in the iPXE codebase where list_for_each_entry() is (ab)used to extract only the first entry from a list. Add a macro list_first_entry() to make this code easier to read. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Extend list-manipulation assertions to all list-handling functionsMichael Brown2010-11-081-82/+92
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [process] Include step() function pointer in process debugging messagesMichael Brown2010-11-081-6/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Avoid quoting exchange ID before exchange is createdMichael Brown2010-11-031-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fcp] Fix potential memory leaks on error pathsMichael Brown2010-11-031-0/+2
| | | | | | | | Functions that instantiate objects generally own one reference to the object being created. The error paths must therefore usually call ref_put() to release this reference. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Add FreeBSD location for isolinuxMichael Brown2010-11-031-1/+2
| | | | | Reported-by: Jedrzej Kalinowski <kalinoj1@iem.pw.edu.pl> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add missing addr32 prefixMichael Brown2010-10-291-1/+1
| | | | | Reported-by: Jedrzej Kalinowski <kalinoj1@iem.pw.edu.pl> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Introduce "skip-san-boot" optionDave Hansen2010-10-222-6/+27
| | | | | | | | | | | | | For some install-to-SAN scenarios, the OS needs to be able to reboot to reread the partition table. On this second boot attempt, the SAN disk will not be empty and so iPXE will attempt to boot from it, rather than falling back to the OS' installation media. Work around this problem by introducing the "skip-san-boot" option, similar in spirit to "keep-san". Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Improve visibility of error messagesMichael Brown2010-10-221-27/+34
| | | | | | | Improve the visibility of error messages by removing the redundant final printing of the URL being booted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Wait for a successful TEST UNIT READY commandMichael Brown2010-10-192-3/+144
| | | | | | | | | | | | | Some SCSI targets (observed with an EMC CLARiiON Fibre Channel target) will not respond to commands correctly until a TEST UNIT READY has been issued. In particular, a READ CAPACITY (10) command will return with a success status, but no capacity data. Fix by issuing a TEST UNIT READY command automatically, and delaying further SCSI commands until the TEST UNIT READY has succeeded. Reported-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fc] Do not use the command reference number in FCP_CMND IUsMichael Brown2010-10-193-62/+65
| | | | | | | | | | | | | | | The FCP command reference number is intended to be used for controlling precise delivery of FCP commands, rather than being an essentially arbitrary tag field (as with iSCSI and SRP). Use the Fibre Channel local exchange ID as the tag for FCP commands, instead of the FCP command reference. The local exchange ID does not appear within the FCP IU itself, but does appear within the FC frame header; debug traces can therefore still be correlated with packet captures. Reported-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>