summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [infiniband] Add raw packet parser and constructorMichael Brown2008-11-113-28/+62
| | | | | | | This can be used with cards that require the driver to construct and parse packet headers manually. Headers are optionally handled out-of-line from the packet payload, since some such cards will split received headers into a separate ring buffer.
* [infiniband] Add a standalone subnet management agentMichael Brown2008-11-112-0/+64
| | | | | This generic SMA code can be used for any cards that do not provide firmware-based embedded SMAs.
* [ipoib] Kill off the IPoIB pseudo-headerMichael Brown2008-11-112-24/+21Star
| | | | | | | | | Some Infiniband cards will not be as accommodating as the Arbel and Hermon cards in providing enough space for us to push a fake extra header at the start of the received packet. We must therefore make do with squeezing enough information to identify source and destination addresses into the two bytes of padding within a genuine IPoIB link-layer header.
* [infiniband] Split subnet management agent client out into ib_smc.cMichael Brown2008-11-114-271/+525
| | | | | | | | Not all Infiniband cards have embedded subnet management agents. Split out the code that communicates with such an embedded SMA into a separate ib_smc.c file, and have drivers call ib_smc_update() explicitly when they suspect that the answers given by the embedded SMA may have changed.
* [infiniband] Pass address vector in receive completionsMichael Brown2008-11-111-52/+53
| | | | | | | | | | | | | | | | | Receive completion handlers now get passed an address vector containing the information extracted from the packet headers (including the GRH, if present), and only the payload remains in the I/O buffer. This breaks the symmetry between transmit and receive completions, so remove the ib_completer_t type and use an ib_completion_queue_operations structure instead. Rename the "destination QPN" and "destination LID" fields in struct ib_address_vector to reflect its new dual usage. Since the ib_completion structure now contains only an IB status code, ("syndrome") replace it with a generic gPXE integer status code.
* [infiniband] Maintain queue fill level as a property of a work queueMichael Brown2008-11-111-59/+15Star
| | | | | Both queue owners and drivers often need to keep track of the fill level, so let's make it a generic property.
* [infiniband] Flush uncompleted work queue entries at QP teardownMichael Brown2008-11-111-33/+70
| | | | | | | | | | | | | | Avoid leaking I/O buffers in ib_destroy_qp() by completing any outstanding work queue entries with a generic error code. This requires the completion handlers to be available to ib_destroy_qp(), which is done by making them static configuration parameters of the CQ (set by ib_create_cq()) rather than being provided on each call to ib_poll_cq(). This mimics the functionality of netdev_{tx,rx}_flush(). The netdev flush functions would previously have been catching any I/O buffers leaked by the IPoIB data queue (though not by the IPoIB metadata queue).
* [ne2k_isa] Restore support for ne2k isa cardsPantelis Koukousoulas2008-11-081-0/+1
| | | | | | | | | | | | | | | | | Add the simplified ne2k_isa driver. It is just a selective copy+paste of the relevant parts from ns8390.c plus a little trivial hacking to make it actually work. It is true that the code is pretty ugly, but: a) ns8390.c is worse b) It is only 372 lines and no #ifdefs c) It works both in qemu/bochs and in real hardware and we all know it is easier to cleanup working code Hope someone will find the time to rewrite this driver properly, but until then at least for me this is an ok solution. Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
* [netdevice] Retain and report detailed error breakdownsMichael Brown2008-11-081-10/+21
| | | | | | | | | | netdev_rx_err() and netdev_tx_complete_err() get passed the error code, but currently use it only in debug messages. Retain error numbers and frequencey counts for up to NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX. This allows the "ifstat" command to report the reasons for TX/RX errors in most cases, even in non-debug builds.
* [settings] Add the notion of a "tag magic" to numbered settingsMichael Brown2008-10-301-2/+13
| | | | | | | | | | | | | | | | | | | Settings can be constructed using a dotted-decimal notation, to allow for access to unnamed settings. The default interpretation is as a DHCP option number (with encapsulated options represented as "<encapsulating option>.<encapsulated option>". In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to interpret the dotted-decimal notation as referring to non-DHCP options. In this case, it becomes necessary for these contexts to ignore standard DHCP options, otherwise we end up trying to, for example, retrieve the boot filename from SMBIOS. Allow settings blocks to specify a "tag magic". When dotted-decimal notation is used to construct a setting, the tag magic value of the originating settings block will be ORed in to the tag number. Store/fetch methods can then check for the magic number before interpreting arbitrarily-numbered settings.
* [efi] Add basic implementation of EFI SIMPLE_NETWORK_PROTOCOLMichael Brown2008-10-164-0/+1389
| | | | | This implementation is tested and working, but not currently tied in to the EFI build.
* [netdevice] Change link-layer push() and pull() methods to take raw typesMichael Brown2008-10-161-21/+11Star
| | | | | | | | | | EFI requires us to be able to specify the source address for individual transmitted packets, and to be able to extract the destination address on received packets. Take advantage of this to rationalise the push() and pull() methods so that push() takes a (dest,source,proto) tuple and pull() returns a (dest,source,proto) tuple.
* [netdevice] Split multicast hashing out into an mc_hash methodMichael Brown2008-10-161-0/+10
| | | | | | Multicast hashing is an ugly overlap between network and link layers. EFI requires us to provide access to this functionality, so move it out of ipv4.c and expose it as a method of the link layer.
* [netdevice] Add maximum packet length as a net device propertyMichael Brown2008-10-163-0/+11
| | | | | Currently this length is set at device allocation time, and is never changed.
* [efi] Add EFI image format and basic runtime environmentMichael Brown2008-10-1318-0/+2806
| | | | | | | | | We have EFI APIs for CPU I/O, PCI I/O, timers, console I/O, user access and user memory allocation. EFI executables are created using the vanilla GNU toolchain, with the EXE header handcrafted in assembly and relocations generated by a custom efilink utility.
* [sanboot] Quick and dirty hack to make SAN boot protocols selectableMichael Brown2008-10-133-12/+14
|
* [umalloc] Formalise the user memory allocation APIMichael Brown2008-10-131-3/+51
|
* [uaccess] Formalise the uaccess APIMichael Brown2008-10-133-20/+333
| | | | | | The userptr_t is now the fundamental type that gets used for conversions. For example, virt_to_phys() is implemented in terms of virt_to_user() and user_to_phys().
* [nap] Formalise the CPU sleeping APIMichael Brown2008-10-132-0/+75
|
* [timer] Formalise the timer APIMichael Brown2008-10-122-35/+77
| | | | | | We now have two implementations for the timer API: one using the time-of-day counter at 40:70 and one using RDTSC. Both make use of timer2_udelay().
* [retry] Use a separate flag to indicate that a retry timer is runningMichael Brown2008-10-121-5/+4Star
| | | | | Using start==0 to indicate a stopped timer is dangerous, because 0 is a valid value for the current tick counter.
* [pci] Formalise the PCI I/O APIMichael Brown2008-10-122-1/+122
|
* [legacy] Add missing #include <gpxe/io.h>Michael Brown2008-10-121-0/+1
|
* [ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O APIMichael Brown2008-10-121-15/+35
|
* [ioapi] Formalise the I/O API as used in i386-pcbiosMichael Brown2008-10-122-0/+565
|
* [makefile] Add -Wformat-nonliteral as an extra warning categoryMichael Brown2008-10-101-2/+2
| | | | | | | | | | | -Wformat-nonliteral is not enabled by -Wall and needs to be explicitly specified. Modified the few files that use nonliteral format strings to work with this new setting in place. Inspired by a patch from Carl Karsten <carl@personnelware.com> and an identical patch from Rorschach <r0rschach@lavabit.com>.
* [efi] Add EFI headers from the EFI Development Kit (edk2)Michael Brown2008-10-1025-0/+9013
| | | | | | | | | | | The intention is to include near-verbatim copies of the EFI headers required by gPXE. This is achieved using the import.pl script in src/include/gpxe/efi. Note that import.pl will modify any #include lines in each imported header to reflect its new location within the gPXE tree. It will also tidy up the file by removing carriage return characters and trailing whitespace.
* [libc] Define wchar_t in a gcc-compatible wayMichael Brown2008-10-071-0/+6
| | | | | gcc defines the magic __WCHAR_TYPE__ macro, in order to convey information about whether or not the user selected -fshort-wchar.
* [libc] Add function declaration for main() in stdlib.hMichael Brown2008-10-071-0/+1
|
* [crypto] Rename <gpxe/bitops.h> to <gpxe/rotate.h>Michael Brown2008-10-011-3/+3
|
* [i2c] Generalise i2c bit-bashing support to addressless devicesMichael Brown2008-10-011-5/+63
| | | | | | | | | | | | | | | | | | | | | | Some devices (e.g. the Atmel AT24C11) have no concept of a device address; they respond to every device address and use this value as the word address. Some other devices use part of the device address field to extend the word address field. Generalise the i2c bit-bashing support to handle this by defining the device address length and word address length as properties of an i2c device. The word address is assumed to overflow into the device address field if the address used exceeds the width of the word address field. Also add a bus reset mechanism. i2c chips don't usually have a reset line, so rebooting the host will not clear any bizarre state that the chip may be in. We reset the bus by clocking SCL until we see SDA high, at which point we know we can generate a start condition and have it seen by all devices. We then generate a stop condition to leave the bus in a known state prior to use. Finally, add some extra debugging messages to i2c_bit.c.
* [compiler] Allow for selective disabling of debug levels at runtimeMichael Brown2008-10-011-2/+17
| | | | | | | | | | | | | The usefulness of DBGLVL_IO is limited by the fact that many cards require large numbers of uninteresting I/O reads/writes at device probe time, typically when driving a bit-bashing I2C/SPI bus to read the MAC address. This patch adds the DBG_DISABLE() and DBG_ENABLE() macros, which can be used to temporarily disable and re-enable selected debug levels. Note that debug levels must still be enabled in the build in order to function at all: you can't use DBG_ENABLE(DBGLVL_IO) in an object built with DEBUG=object:1 and expect it to do anything.
* [compiler] Add __always_inline macroMichael Brown2008-10-011-0/+3
|
* [settings] Expose MAC address setting for general useMichael Brown2008-09-261-0/+1
|
* [dhcp] Accept BOOTP as well as DHCPMichael Brown2008-09-251-0/+1
|
* [uri] Add uri_encode() and uri_decode() functions for URI character encodingMichael Brown2008-09-241-0/+2
|
* [comboot] Add COMBOOT and COM32 supportDaniel Verkamp2008-08-291-0/+1
|
* [undi] Fill in ProtType correctly in PXENV_UNDI_ISRMichael Brown2008-08-201-11/+15
| | | | | | | | | Determine the network-layer packet type and fill it in for UNDI clients. This is required by some NBPs such as emBoot's winBoot/i. This change requires refactoring the link-layer portions of the gPXE netdevice API, so that it becomes possible to strip the link-layer header without passing the packet up the network stack.
* [pcbios] Support arbitrary splits of the e820 memory mapMichael Brown2008-08-181-10/+2Star
| | | | | | | | | | | | | | | | | | | | | | Allow for an arbitrary number of splits of the system memory map via INT 15,e820. Features of the new map-mangling algorithm include: Supports random access to e820 map entries. Requires only sequential access support from the underlying e820 map, even if our caller uses random access. Empty regions will always be stripped. Always terminates with %ebx=0, even if the underlying map terminates with CF=1. Allows for an arbitrary number of hidden regions, with underlying regions split into as many subregions as necessary. Total size increase to achieve this is 193 bytes.
* [retry] Added configurable timeouts to retry timerAndrew Schran2008-08-122-0/+20
| | | | | | | | New min_timeout and max_timeout fields in struct retry_timer allow users of this timer to set their own desired minimum and maximum timeouts, without being constrained to a single global minimum and maximum. Users of the timer can still elect to use the default global values by leaving the min_timeout and max_timeout fields as 0.
* [iSCSI] Add support for mutual CHAPMichael Brown2008-08-113-15/+49
| | | | Allow initiator to verify target authentication using CHAP.
* [libc] Add missing __attribute__ (( format ( printf ) )) to ssnprintf()Michael Brown2008-08-111-1/+2
|
* [autoboot] Retain initial-slash (if present) when constructing TFTP URIsMichael Brown2008-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we boot from a DHCP-supplied filename, we previously relied on the fact that the current working URI is set to tftp://[next-server]/ in order to resolve the filename into a full tftp:// URI. However, this process will eliminate the distinction between filenames with and without initial slashes: cwuri="tftp://10.0.0.1/" filename="vmlinuz" => URI="tftp://10.0.0.1/vmlinuz" cwuri="tftp://10.0.0.1/" filename="/vmlinuz" => URI="tftp://10.0.0.1/vmlinuz" This distinction is important for some TFTP servers. We now explicitly construct a string of the form "tftp://[next-server]/filename" so that a filename with an initial slash will result in a URI containing a double-slash, e.g. "tftp://10.0.0.1//vmlinuz" The TFTP code always strips a single initial slash, and so ends up presenting the correct path to the server. URIs entered explicitly by users at the command line must include a double slash if they want an initial slash presented to the TFTP server: "kernel tftp://10.0.0.1/vmlinuz" => filename="vmlinuz" "kernel tftp://10.0.0.1//vmlinuz" => filename="/vmlinuz"
* [tg3] Added support for tg3-5754.Andrew Schran2008-07-241-0/+1
| | | | | | | In tg3_chip_reset(), the PCI_EXPRESS change is taken from the Linux tg3 driver. I am not sure what exactly it does (it is not documented in the Linux driver), but it is necessary for the NIC to work correctly.
* [iSCSI] Support Windows Server 2008 direct iSCSI installationMichael Brown2008-07-175-8/+27
| | | | | | | | | | | | | Add yet another ugly hack to iscsiboot.c, this time to allow the user to inhibit the shutdown/removal of the iSCSI INT13 device (and the network devices, since they are required for the iSCSI device to function). On the plus side, the fact that shutdown() now takes flags to differentiate between shutdown-for-exit and shutdown-for-boot means that another ugly hack (to allow returning via the PXE stack on BIOSes that have broken INT 18 calls) will be easier. I feel dirty.
* [bzimage] Kill off the initrd image typeMichael Brown2008-07-081-14/+0Star
| | | | | | | We can just treat all non-kernel images as initrds, which matches our behaviour for multiboot kernels. This allows us to eliminate initrd as an image type, and treat the "initrd" command as just another synonym for "imgfetch".
* [phantom] Add support for NetXen Phantom NICsMichael Brown2008-07-051-0/+1
|
* [GDB] Provide functions to manually enter GDB stub.Stefan Hajnoczi2008-06-302-0/+41
|
* [GDB] Add watch and rwatch hardware watchpointsStefan Hajnoczi2008-06-301-0/+9
|
* [GDB] Remote debugging over UDPStefan Hajnoczi2008-06-301-0/+64
| | | | | | | | | | | | | | | | | This commit implements GDB over UDP. Using UDP is more complex than serial and has required some restructuring. The GDB stub is now built using one or both of GDBSERIAL and GDBUDP config.h options. To enter the debugger, execute the gPXE shell command: gdbstub <transport> [<options>...] Where <transport> is "serial" or "udp". For "udp", the name of a configured network device is required: gdbstub udp net0 The GDB stub listens on UDP port 43770 by default.