summaryrefslogtreecommitdiffstats
path: root/src/net/80211
Commit message (Collapse)AuthorAgeFilesLines
* [802.11] Remove redundant NULL pointer check after dereferenceMichael Brown2017-03-211-3/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Allow timer to be selected at runtimeMichael Brown2017-01-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow network devices to disclaim IRQ support at runtimeMichael Brown2015-07-281-0/+4
| | | | | | | | | | | | | | | | VLAN and 802.11 devices use a network device operations structure that wraps an underlying structure. For example, the vlan_operations structure wraps the network device operations structure of the underlying trunk device. This can cause false positives from the current implementation of netdev_irq_supported(), which will always report that VLAN devices support interrupts since it has no visibility into the support provided by the underlying trunk device. Fix by allowing network devices to explicitly flag that interrupts are not supported, despite the presence of an irq() method. Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Use correct SHA1_DIGEST_SIZE constant nameMichael Brown2015-07-271-1/+1
| | | | | | The constant SHA1_SIZE is defined only as part of the imported AXTLS code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-052-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | At some point in the past few years, binutils became more aggressive at removing unused symbols. To function as a symbol requirement, a relocation record must now be in a section marked with @progbits and must not be in a section which gets discarded during the link (either via --gc-sections or via /DISCARD/). Update REQUIRE_SYMBOL() to generate relocation records meeting these criteria. To minimise the impact upon the final binary size, we use existing symbols (specified via the REQUIRING_SYMBOL() macro) as the relocation targets where possible. We use R_386_NONE or R_X86_64_NONE relocation types to prevent any actual unwanted relocation taking place. Where no suitable symbol exists for REQUIRING_SYMBOL() (such as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to generate a one-byte-long symbol to act as the relocation target. If there are versions of binutils for which this approach fails, then the fallback will probably involve killing off REQUEST_SYMBOL(), redefining REQUIRE_SYMBOL() to use the current definition of REQUEST_SYMBOL(), and postprocessing the linked ELF file with something along the lines of "nm -u | wc -l" to check that there are no undefined symbols remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use REQUIRE_OBJECT() to drag in per-object configurationMichael Brown2015-03-051-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite byte-swapping codeMichael Brown2015-03-021-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Force settings into alphabetical order within sectionsMichael Brown2013-12-051-3/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-052-7/+7
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add method for generating EUI-64 address from link-layer addressMichael Brown2013-09-031-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate settings "tag magic"Michael Brown2013-05-011-3/+0Star
| | | | | | | Create an explicit concept of "settings scope" and eliminate the magic values used for numerical setting tags. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Use __einfo() tuple as first argument to EUNIQ()Michael Brown2013-04-191-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Expose eth_broadcast as a global constantMichael Brown2012-08-311-5/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-208-8/+16
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Use rbg_generate() for secure random numbersMichael Brown2012-03-131-1/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Avoid using struct md5_ctx directlyMichael Brown2012-03-051-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Add missing #include <byteswap.h>Michael Brown2012-03-041-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Add missing #include <string.h>Michael Brown2012-02-213-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow link layer to report broadcast/multicast packets via pull()Michael Brown2011-07-151-2/+8
| | | | | | | | Allow the link layer to directly report whether or not a packet is multicast or broadcast at the time of calling pull(), rather than relying on heuristics to determine this at a later stage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [process] Pass containing object pointer to process step() methodsMichael Brown2011-06-281-8/+11
| | | | | | | | | Give the step() method a pointer to the containing object, rather than a pointer to the process. This is consistent with the operation of interface methods, and allows a single function to serve as both an interface method and a process step() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Match terminology in online documentationMichael Brown2011-03-231-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-231-3/+3
| | | | | | | Improve the appearance of the "config" user interface by ensuring that settings appear in some kind of logical order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Formalise notion of setting applicabilityMichael Brown2011-03-221-0/+3
| | | | | | | | | | | | | | | Expose a function setting_applies() to allow a caller to determine whether or not a particular setting is applicable to a particular settings block. Restrict DHCP-backed settings blocks to accepting only DHCP-based settings. Restrict network device settings blocks to accepting only DHCP-based settings and network device-specific settings such as "mac". Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Add list_first_entry()Michael Brown2010-11-081-5/+5
| | | | | | | | | 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>
* [netdevice] Pass both link-layer addresses in net_tx() and net_rx()Michael Brown2010-10-071-1/+3
| | | | | | | | | FCoE requires the use of fabric-provided MAC addresses, which breaks the assumption that the net device's MAC address is implicitly the source address for net_tx() and the (unicast) destination address for net_rx(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Fix a use-after-freeJoshua Oreman2010-08-011-0/+1
| | | | | | | | | When we received an encrypted packet, after replacing it with its decrypted version and freeing the encrypted original, we would continue to look at the header of the now-freed original packet. Fix by moving the header pointer to point at the decrypted packet instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Use correct name for sec80211_detect()Joshua Oreman2010-08-011-3/+3
| | | | | | | | | The workhorse function for detecting 802.11 security was still named _sec80211_detect(), a holdover from the old style of weak function handling, with the result that all networks would be identified as "unknown". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-312-41/+31Star
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [compiler] Fix 64bit compile time errorsPiotr Jaroszyński2010-05-271-3/+3
| | | | | | | | | | | | Apart from format specifier fixes there are two changes in proper code: - Change type of regs in skge_hw to unsigned long - Cast result of sizeof in myri10ge to uint32_t Both don't change anything for i386 and should be fine on x86_64. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-271-0/+11
| | | | | | | | | | | | | | | 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>
* [wpa] Remove PMKID checkingJoshua Oreman2010-05-271-64/+0Star
| | | | | | | | | | | | PMKID checking is an additional pre-check that helps detect invalid passphrases before going through the full handshaking procedure. It takes up some amount of code size, and is not necessary from a security perspective. It also is implemented improperly by some routers, which was causing iPXE to give spurious authentication errors. Remove it for these reasons. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-208-59/+59
| | | | | | | | | | | 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>
* [netdevice] Add netdev_is_open() wrapper functionMichael Brown2010-03-231-6/+6
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [802.11] Allow connecting to spectrum managed networksJoshua Oreman2010-01-051-6/+0Star
| | | | | | | | | | | | | | Contrary to the IEEE specification, some access points apparently set the Spectrum Mgmt bit in the capabilities field even when broadcasting on a 2.4GHz band that does not require spectrum management. Allow gPXE to attempt to connect to such networks; if spectrum management is really required, our advertisement of capabilities not including it will result in an association failure. Reported-by: Peter Meyer <residue@xmail.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add CCMP backend (new AES-based cryptosystem)Joshua Oreman2010-01-051-0/+528
| | | | Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add TKIP backend (legacy RC4-based cryptosystem)Joshua Oreman2010-01-051-0/+586
| | | | Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add pre-shared key frontend (WPA "Personal" with just a passphrase)Joshua Oreman2010-01-051-0/+125
| | | | | Modified-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [wpa] Add general support for WPA-protected 802.11 networksJoshua Oreman2010-01-051-0/+973
| | | | | Modified-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [802.11] Add support for WEP-protected networksJoshua Oreman2010-01-051-0/+303
| | | | | | | | WEP is a highly flawed cryptosystem, barely better than no encryption at all, but many people still use it. It does have the advantage of being very simple and small in code size. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [802.11] Add core support for detecting and using encrypted networksJoshua Oreman2010-01-052-59/+751
| | | | Signed-off-by: Marty Connor <mdc@etherboot.org>
* [netdevice] Add the concept of an "Ethernet-compatible" MAC addressMichael Brown2009-10-231-0/+1
| | | | | | | | | | | | | | The iBFT is Ethernet-centric in providing only six bytes for a MAC address. This is most probably an indirect consequence of a similar design flaw in the Windows NDIS stack. (The WinOF IPoIB stack performs all sorts of contortions in order to pretend to the NDIS layer that it is dealing with six-byte MAC addresses.) There is no sensible way in which to extend the iBFT without breaking compatibility with programs that expect to parse it. Add the notion of an "Ethernet-compatible" MAC address to our link layer abstraction, so that link layers can provide their own workarounds for this limitation.
* [802.11] Support multicast hashingMichael Brown2009-08-121-20/+1Star
| | | | | | | 802.11 multicast hashing is the same as standard Ethernet hashing, so just expose and use eth_mc_hash(). Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
* [802.11] Properly initialize autoassociation processJoshua Oreman2009-08-121-1/+2
| | | | | | | | | | | | | The recent change to process_add() to detect duplicate process additions relies on the fact that all processes will be initialized using process_init_stopped() before being passed to that function. The autoassociation process was not initialized in this fashion, so process_add() erroneously detected it as a duplicate. Fix by using process_init_stopped() to initialize the autoassociation process instead of setting the step member directly. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Allow the hardware and link-layer addresses to differ in sizeMichael Brown2009-08-121-0/+2
| | | | | | | | | | IPoIB has a 20-byte link-layer address, of which only eight bytes represent anything relating to a "hardware address". The PXE and EFI SNP APIs expect the permanent address to be the same size as the link-layer address, so fill in the "permanent address" field with the initial link layer address (as generated by register_netdev() based upon the real hardware address).
* [netdevice] Separate out the concept of hardware and link-layer addressesMichael Brown2009-08-121-1/+1
| | | | | | | | | | | The hardware address is an intrinsic property of the hardware, while the link-layer address can be changed at runtime. This separation is exposed via APIs such as PXE and EFI, but is currently elided by gPXE. Expose the hardware and link-layer addresses as separate properties within a net device. Drivers should now fill in hw_addr, which will be used to initialise ll_addr at the time of calling register_netdev().
* [802.11] Fix memory leak on unsuccessful probesJoshua Oreman2009-08-091-2/+1Star
| | | | | | | When a probe found no results, the list head of beacons would not be freed, leaking 16 bytes of memory per probe. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [802.11] Set channels early on to avoid tuning to an undefined channelJoshua Oreman2009-08-091-0/+5
| | | | | | | | | | | Some cards (such as ath5k) always need to tune to a particular channel when they are reset; the reset may happen upon open(), which is before the channels array would be set up (in prepare_probe()). Avoid tuning the card to an inconsistent state by copying the hardware supported-channels array to the 802.11 device's allowable-channels array even before channels are "properly" set up. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [802.11] Enhance support for driver PHY differencesJoshua Oreman2009-08-091-14/+76
| | | | | | | | | | | | | | | | | The prior net80211 model of physical-layer behavior for drivers was overly simplistic and limited the drivers that could be written. To be more flexible, split the driver-provided list of supported rates by band, and add a means for specifying a list of supported channels. Allow drivers to specify a hardware channel value that will be tied to uses of the channel. Expose net80211_duration() to drivers, and make the rate it uses in its computations configurable, so that it can be used in calculating durations that must be set in hardware for ACK and CTS packets. Add net80211_cts_duration() for the common case of calculating the duration for a CTS packet. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [802.11] Add support for 802.11 devices with software MAC layerJoshua Oreman2009-08-012-0/+2966
This is required for all modern 802.11 devices, and allows drivers to be written for them with minimally more effort than is required for a wired NIC. Signed-off-by: Michael Brown <mcb30@etherboot.org> Modified-by: Michael Brown <mcb30@etherboot.org>