summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
Commit message (Collapse)AuthorAgeFilesLines
...
* [build] Fix misaligned table entries when using gcc 4.5Piotr Jaroszyński2010-08-206-15/+12Star
| | | | | | | | | | Declarations without the accompanying __table_entry cause misalignment of the table entries when using gcc 4.5. Fix by adding the appropriate __table_entry macro or (where possible) by removing unnecessary forward declarations. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add the tap driverPiotr Jaroszyński2010-08-191-0/+1
| | | | | | | | | Add the tap driver that can be used like: $ ./ipxe.linux --net tap,if=tap0,mac=00:0c:29:c5:39:a1 The if setting is mandatory. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add device and driver modelPiotr Jaroszyński2010-08-192-0/+145
| | | | | | | | | Add the base to build linux drivers and the linux UI code on. UI fills device requests, which are later walked over by the linux root_driver and delegated to specific linux drivers. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add empty smbiosPiotr Jaroszyński2010-08-193-0/+20
| | | | | | | | | There exists an smbios userspace library so implementing this is probably possible, but doesn't seem really important to have in userspace. Hence provide a dummy implementation returning an error. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add napPiotr Jaroszyński2010-08-192-0/+19
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add umallocPiotr Jaroszyński2010-08-192-0/+19
| | | | | | | Add umalloc API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add uaccessPiotr Jaroszyński2010-08-192-0/+105
| | | | | | | | | | | | | | | Add user access API for linux. On linux userspace virtual == user == phys addresses. Physical addresses also being the same is wrong, but there is no general way of converting userspace addresses to physical as what appears to be contiguous in userspace is physically fragmented. Currently only the DMA memory is special-cased, but its conversion to bus addresses is done in phys_to_bus. This is known to break virtio as it is passing phys addresses to the virtual device. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add timerPiotr Jaroszyński2010-08-192-0/+19
| | | | | | | Add linux timer API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Export find_setting()Piotr Jaroszyński2010-08-171-0/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Move get_memmap() to the I/O API groupPiotr Jaroszyński2010-08-162-36/+26Star
| | | | | | | | | pcbios specific get_memmap() is used by the b44 driver making all-drivers builds fail on other platforms. Move it to the I/O API group and provide a dummy implementation on EFI. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Allow out-of-order receive queue to be discardedMichael Brown2010-07-211-0/+12
| | | | | | | | | Allow packets in the receive queue to be discarded in order to free up memory. This avoids a potential deadlock condition in which the missing packet can never be received because the receive queue is occupying all of the memory available for further RX buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Add cache discard mechanismMichael Brown2010-07-211-0/+17
| | | | | | | Add a facility allowing cached data to be discarded in order to satisfy memory allocations that would otherwise fail. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Handle out-of-order received packetsMichael Brown2010-07-211-1/+30
| | | | | | | | | | | | | | | Maintain a queue of received packets, so that lost packets need not result in retransmission of the entire TCP window. Increase the TCP window to 8kB, in order that we can potentially transmit enough duplicate ACKs to trigger Fast Retransmission at the sender. Using a 10MB HTTP download in qemu-kvm with an artificial drop rate of 1 in 64 packets, this reduces the download time from around 26s to around 4s. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Replace virtio-net with native iPXE driverStefan Hajnoczi2010-07-173-4/+9
| | | | | | | | | | | | | | | | | | | | | | This patch adds a native iPXE virtio-net driver and removes the legacy Etherboot virtio-net driver. The main reasons for doing this are: 1. Multiple virtio-net NICs are now supported by iPXE. The legacy driver kept global state and caused issues in virtual machines with more than one virtio-net device. 2. Faster downloads. The native iPXE driver downloads 100 MB over HTTP in 12s, the legacy Etherboot driver in 37s. This simple benchmark uses KVM with tap networking and the Python SimpleHTTPServer both running on the same host. Changes to core virtio code reduce vring descriptors to 256 (QEMU uses 128 for virtio-blk and 256 for virtio-net) and change the opaque token from u16 to void*. Lowering the descriptor count reduces memory consumption. The void* opaque token change makes driver code simpler. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Fix embedded image buildingAlessandro Salvatori2010-07-051-3/+3
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Define Vendor Specific capability IDGlenn Brown2010-06-251-0/+1
| | | | | | | | Add a PCI_CAP_ID_VNDR definition for the PCI standard "Vendor Specific" capability ID. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_no_free handlerJoshua Oreman2010-06-231-0/+1
| | | | | | | Since more reference-counted structures than embedded images might want to mark themselves unfreeable, expose a dummy ref_no_free(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Allow for non-pass-through interface methodsMichael Brown2010-06-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | xfer_vredirect() should not be allowed to propagate to a pass-through interface. For example, when an HTTPS connection is opened, the redirect message should cause the TLS layer to reopen the TCP socket, rather than causing the HTTP layer to disconnect from the TLS layer. Fix by allowing for non-pass-through interface methods, and setting xfer_vredirect() to be one such method. This is slightly ugly, in that it complicates the notion of an interface method call by adding a "pass-through" / "non-pass-through" piece of metadata. However, the only current user of xfer_vredirect() is iscsi.c, which uses it only because we don't yet have an ioctl()-style call for retrieving the underlying socket address. The new interface infrastructure allows for such a call to be created, at which time this sole user of xfer_vredirect() can be removed, xfer_vredirect() can cease to be an interface method and become simply a wrapper around xfer_vreopen(), and the concept of a non-pass-through interface method can be reverted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-229-317/+60Star
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all name-resolution interfaces to generic interfacesMichael Brown2010-06-221-125/+6Star
| | | | | | | | Remove name-resolution as an interface type, and replace name-resolution interfaces with generic interfaces supporting the resolv_done() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all job-control interfaces to generic interfacesMichael Brown2010-06-224-141/+11Star
| | | | | | | | | Remove job-control as an interface type, and replace job-control interfaces with generic interfaces supporting the close() method. (Both done() and kill() are absorbed into the function of close(); kill() is merely close(-ECANCELED).) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Expand object interface to allow for polymorphic interfacesMichael Brown2010-06-224-30/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have several types of object interface at present (data-xfer, job control, name resolution), and there is some duplication of functionality between them. For example, job_done(), job_kill() and xfer_close() are almost isomorphic to each other. This updated version of the object interface mechanism allows for each interface to export an arbitrary list of supported operations. Advantages include: Operations methods now receive a pointer to the object, rather than a pointer to the interface. This allows an object to, for example, implement a single close() method that can handle close() operations from any of its exposed interfaces. The close() operation is implemented as a generic operation (rather than having specific variants for data-xfer, job control, etc.). This will allow functions such as monojob_wait() to be used to wait for e.g. a name resolution to complete. The amount of boilerplate code required in objects is reduced, not least because it is no longer necessary to include per-interface methods that simply use container_of() to derive a pointer to the object and then tail-call to a common per-object method. The cost of adding new operations is reduced; adding a new data-xfer operation such as stat() no longer incurs the penalty of adding a .stat member to the operations table of all existing data-xfer interfaces. The data-xfer, job control and name resolution interfaces have not yet been updated to use the new interface mechanism, but the code will still compile and run. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Add timer_init() wrapper functionMichael Brown2010-06-221-0/+12
| | | | | | | Standardise on using timer_init() to initialise an embedded retry timer, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-221-0/+35
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Move Ethernet MAC address checking routines to ethernet.hMichael Brown2010-06-071-0/+66
| | | | | Originally-fixed-by: Faur Andrei <da3drus@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [jme] Add JMicron Ethernet driverGuo-Fu Tseng2010-06-021-0/+1
| | | | | | | | | | | A new driver for JMicron Ethernet controller. Reviewed-by: Joshua Oreman <oremanj@rwcr.net> Reviewed-by: Michael Brown <mbrown@fensystems.co.uk> Reviewed-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add the "snpnet" driverGeoff Lywood2010-06-023-0/+92
| | | | | | | | | Add a new network driver that consumes the EFI Simple Network Protocol. Also add a bus driver that can find the Simple Network Protocol that iPXE was loaded from; the resulting behavior is similar to the "undionly" driver for BIOS systems. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-313-0/+639
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Tidy up output of EFI header import scriptMichael Brown2010-05-303-19/+65
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add FILE_LICENCE declarations to EFI header filesMichael Brown2010-05-3040-0/+96
| | | | | | | | Autodetect the BSD licence statement in EFI header files, and add a suitable FILE_LICENCE macro to the version imported into the iPXE tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Synchronise EFI header filesMichael Brown2010-05-302-7/+10
| | | | | | | | | | Now that the PACKED macro conflict is resolved, we can use an unmodified import of the EFI header files (using include/ipxe/efi/import.pl). Synchronised to EDK2 SVN revision 10556. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update UEFI header files with latest version from TianoCoreGeoff Lywood2010-05-3040-1612/+6071
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Add generic base16 encoding and decoding routinesMichael Brown2010-05-282-0/+39
| | | | | | Base16 encoding is currently implemented in both iSCSI and SRP. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base64] Add ability to decode base64 stringsMichael Brown2010-05-282-0/+16
| | | | | Inspired-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base64] Allow base64_encode() to handle arbitrary dataMichael Brown2010-05-281-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-272-35/+4Star
| | | | | | | | | | | | | | | This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bitmap] Fix bitmaps on 64-bitGeoff Lywood2010-05-271-1/+1
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [qib7322] Add support for QLogic 7322 HCAMichael Brown2010-05-251-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lacp] Add simple LACP implementationMichael Brown2010-05-102-0/+256
| | | | | | | | | | Some switch configurations will refuse to enable our port unless we can speak LACP to inform the switch that we are alive. Add a very simple passive LACP implementation that is sufficient to convince at least Linux's bonding driver (when tested using qemu attached to a tap device enslaved to a bond device configured as "mode=802.3ad"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-20185-0/+33572
Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>