david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

49 Commits

Author SHA1 Message Date
Michael Brown 9b581158b5 [802.11] Remove redundant NULL pointer check after dereference
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-03-21 14:01:08 +02:00
Michael Brown 302f1eeb80 [time] Allow timer to be selected at runtime
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>
2017-01-26 08:17:37 +00:00
Michael Brown b20d4a1522 [netdevice] Allow network devices to disclaim IRQ support at runtime
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>
2015-07-28 15:14:40 +01:00
Michael Brown 1a30c20daf [802.11] Use correct SHA1_DIGEST_SIZE constant name
The constant SHA1_SIZE is defined only as part of the imported AXTLS code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-07-27 15:59:10 +01:00
Michael Brown fbc4ba4b4e [build] Fix the REQUIRE_SYMBOL mechanism
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>
2015-03-05 00:59:38 +00:00
Michael Brown 86ae6e6c18 [build] Use REQUIRE_OBJECT() to drag in per-object configuration
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-05 00:57:44 +00:00
Michael Brown 01d16d821f [libc] Rewrite byte-swapping code
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 16:35:37 +00:00
Michael Brown b0942534eb [settings] Force settings into alphabetical order within sections
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 12:43:28 +00:00
Michael Brown 22001cb206 [settings] Explicitly separate the concept of a completed fetched setting
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>
2013-12-05 00:37:02 +00:00
Michael Brown 0b65c8cad6 [netdevice] Add method for generating EUI-64 address from link-layer address
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03 01:24:15 +01:00
Michael Brown 15d2f947f5 [settings] Eliminate settings "tag magic"
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>
2013-05-01 19:52:12 +01:00
Michael Brown e42bc3aa37 [libc] Use __einfo() tuple as first argument to EUNIQ()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-04-19 00:45:13 +01:00
Michael Brown 1cbb1581f1 [ethernet] Expose eth_broadcast as a global constant
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-08-31 20:21:10 +01:00
Michael Brown c3b4860ce3 [legal] Update FSF mailing address in GPL licence texts
Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 19:55:45 +01:00
Michael Brown 554627c960 [802.11] Use rbg_generate() for secure random numbers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-13 15:58:04 +00:00
Michael Brown cdb4802ff1 [802.11] Avoid using struct md5_ctx directly
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 10:18:16 +00:00
Michael Brown 4fde501e39 [802.11] Add missing #include <byteswap.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:16 +00:00
Michael Brown a8756182c3 [802.11] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:37 +00:00
Michael Brown a667bf044a [netdevice] Allow link layer to report broadcast/multicast packets via pull()
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>
2011-07-15 18:48:46 +01:00
Michael Brown e01ec74601 [process] Pass containing object pointer to process step() methods
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>
2011-06-28 14:45:08 +01:00
Michael Brown 02a6f46c09 [settings] Match terminology in online documentation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-23 21:21:12 +00:00
Michael Brown 8482451812 [settings] Impose a fixed order on settings
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>
2011-03-23 11:57:29 +00:00
Michael Brown f5fd4dec3b [settings] Formalise notion of setting applicability
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>
2011-03-22 19:54:58 +00:00
Michael Brown ea631f6fb8 [list] Add list_first_entry()
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>
2010-11-08 03:15:28 +00:00
Michael Brown 88dd921e24 [netdevice] Pass both link-layer addresses in net_tx() and net_rx()
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>
2010-10-07 19:15:04 +01:00
Joshua Oreman 73aea88a62 [802.11] Fix a use-after-free
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>
2010-08-01 17:29:57 +01:00
Joshua Oreman 0c593d95e5 [802.11] Use correct name for sec80211_detect()
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>
2010-08-01 17:29:07 +01:00
Michael Brown 6c0e8c14be [libc] Enable automated extraction of error usage reports
Add preprocessor magic to the error definitions to enable every error
usage to be tracked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-31 03:11:57 +01:00
Piotr Jaroszyński 7c6d3752c9 [compiler] Fix 64bit compile time errors
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>
2010-05-27 10:23:06 +01:00
Joshua Oreman 2aad3fab23 [build] Use weak definitions instead of weak declarations
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>
2010-05-27 10:19:14 +01:00
Joshua Oreman 723cfad316 [wpa] Remove PMKID checking
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>
2010-05-27 01:18:25 +01:00
Michael Brown 8406115834 [build] Rename gPXE to iPXE
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>
2010-04-19 23:43:39 +01:00
Michael Brown 88e436376c [netdevice] Add netdev_is_open() wrapper function
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2010-03-23 00:46:35 +00:00
Joshua Oreman aa1b894ecd [802.11] Allow connecting to spectrum managed networks
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>
2010-01-05 10:16:25 -05:00
Joshua Oreman 5240fee38f [wpa] Add CCMP backend (new AES-based cryptosystem)
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 10:11:42 -05:00
Joshua Oreman 8106cb130b [wpa] Add TKIP backend (legacy RC4-based cryptosystem)
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 10:09:44 -05:00
Joshua Oreman 0758111345 [wpa] Add pre-shared key frontend (WPA "Personal" with just a passphrase)
Modified-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 10:07:59 -05:00
Joshua Oreman 8ec18a5b50 [wpa] Add general support for WPA-protected 802.11 networks
Modified-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:53:03 -05:00
Joshua Oreman 01b4f52089 [802.11] Add support for WEP-protected networks
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>
2010-01-05 09:14:08 -05:00
Joshua Oreman dd8a3e2e70 [802.11] Add core support for detecting and using encrypted networks
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:08:37 -05:00
Michael Brown 1b1e63d54d [netdevice] Add the concept of an "Ethernet-compatible" MAC address
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.
2009-10-23 22:14:05 +01:00
Michael Brown a7290a970c [802.11] Support multicast hashing
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>
2009-08-12 00:54:29 +01:00
Joshua Oreman 2310c30d1c [802.11] Properly initialize autoassociation process
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>
2009-08-12 00:31:34 +01:00
Michael Brown 4eab5bc8ca [netdevice] Allow the hardware and link-layer addresses to differ in size
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).
2009-08-12 00:23:38 +01:00
Michael Brown 37a0aab4ff [netdevice] Separate out the concept of hardware and link-layer addresses
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().
2009-08-12 00:19:14 +01:00
Joshua Oreman fc9750a68d [802.11] Fix memory leak on unsuccessful probes
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>
2009-08-09 00:12:53 +01:00
Joshua Oreman 1e810bebe9 [802.11] Set channels early on to avoid tuning to an undefined channel
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>
2009-08-09 00:11:33 +01:00
Joshua Oreman f128a6db21 [802.11] Enhance support for driver PHY differences
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>
2009-08-09 00:11:26 +01:00
Joshua Oreman ce64398f87 [802.11] Add support for 802.11 devices with software MAC layer
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>
2009-08-01 19:00:32 +01:00