gpxe.git
10 years ago[errcode] Remove unused contrib/errcode scripts
Stefan Hajnoczi [Sun, 11 Jul 2010 07:52:57 +0000 (08:52 +0100)]
[errcode] Remove unused contrib/errcode scripts

The new errdb error code database is more accurate than the regular
expression-based errcode scripts.  This patch removes errcode scripts in
favor of errdb.

The gpxebot.py script is no longer needed, gpxebot has been released as
a separate open source codebase:

  http://git.etherboot.org/?p=people/stefanha/gpxebot.git;a=summary

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[compiler] Mark weak functions noinline
Stefan Hajnoczi [Wed, 14 Jul 2010 07:32:48 +0000 (08:32 +0100)]
[compiler] Mark weak functions noinline

Weak functions whose visibility is hidden may be inlined due to a bug in
GCC.  Explicitly mark weak functions noinline to work around the
problem.

This makes the PXE_MENU config option work again, the PXE boot menu was
never being called because the compiler inlined a weak stub function.

The GCC bug was identified and fixed by Richard Sandiford
<rdsandiford@googlemail.com> but in the meantime gPXE needs to implement
a workaround.

Reported-by: Steve Jones <steve@squaregoldfish.co.uk>
Reported-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Suggested-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[image] Fix a memleak in free_image()
Piotr Jaroszyński [Thu, 8 Jul 2010 13:54:55 +0000 (15:54 +0200)]
[image] Fix a memleak in free_image()

image_set_cmdline() strdup()s cmdline, which free_image() doesn't clean
up.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[tcp] Fix potential use-after-free when accessing timestamp option
Michael Brown [Wed, 7 Jul 2010 11:57:08 +0000 (12:57 +0100)]
[tcp] Fix potential use-after-free when accessing timestamp option

Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[refcnt] Fix embedded image building
Alessandro Salvatori [Mon, 5 Jul 2010 10:01:23 +0000 (11:01 +0100)]
[refcnt] Fix embedded image building

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pcnet32] Fix pcnet32_wio_reset() bug
Andrei Faur [Wed, 7 Jul 2010 12:43:41 +0000 (15:43 +0300)]
[pcnet32] Fix pcnet32_wio_reset() bug

This bug caused .probe to fail because the NIC did not reset properly.

Signed-off-by: Andrei Faur <da3drus@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Do not check for BBS compatibility
Michael Brown [Thu, 24 Jun 2010 18:03:04 +0000 (19:03 +0100)]
[romprefix] Do not check for BBS compatibility

The existence and usage of the BEV entry point is covered by the PnP
spec, not the BBS spec; the BBS spec merely describes a policy for
selecting the boot device order.  gPXE should therefore check only for
a PnP BIOS in order to decide whether or not to hook INT19.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Avoid hard-coding the path to perl
Michael Brown [Thu, 24 Jun 2010 00:23:00 +0000 (01:23 +0100)]
[build] Avoid hard-coding the path to perl

The path "/usr/bin/perl" has been hard-coded since Etherboot 5.1, for
no discernible reason.  Use just "perl" instead to fix the
inconsistency and allow building on systems with Perl installed
outside of /usr/bin.

This commit also includes a later fix that removes a dependency on
"perl" which broke builds from fully clean trees.

Reported-by: Gabor Z. Papp <gzp@papp.hu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[efi] Build gPXE script support into EFI binaries by default
Geoff Lywood [Wed, 16 Jun 2010 21:35:24 +0000 (14:35 -0700)]
[efi] Build gPXE script support into EFI binaries by default

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[refcnt] Add ref_no_free handler
Joshua Oreman [Thu, 26 Nov 2009 01:27:50 +0000 (17:27 -0800)]
[refcnt] Add ref_no_free handler

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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[retry] Use start_timer_fixed() instead of direct timeout manipulation
Michael Brown [Tue, 15 Jun 2010 17:16:02 +0000 (18:16 +0100)]
[retry] Use start_timer_fixed() instead of direct timeout manipulation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[retry] Add timer_init() wrapper function
Michael Brown [Tue, 15 Jun 2010 17:13:36 +0000 (18:13 +0100)]
[retry] Add timer_init() wrapper function

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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[refcnt] Add ref_init() wrapper function
Michael Brown [Tue, 15 Jun 2010 16:33:23 +0000 (17:33 +0100)]
[refcnt] Add ref_init() wrapper function

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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[errdb] Add errdb.pl script to build error database
Michael Brown [Mon, 31 May 2010 13:22:24 +0000 (14:22 +0100)]
[errdb] Add errdb.pl script to build error database

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[libc] Enable automated extraction of error usage reports
Michael Brown [Sun, 30 May 2010 14:29:05 +0000 (15:29 +0100)]
[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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[process] Hold reference to process during call to step()
Michael Brown [Fri, 13 Jun 2008 02:39:22 +0000 (03:39 +0100)]
[process] Hold reference to process during call to step()

It is conceivable that the process may terminate during the execution
of step().  If nothing else holds a reference to the containing
object, this would cause the object to be freed prior to returning
from step().

Add a ref_get()/ref_put() around the call to ->step() to prevent this
from happening.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[qib7322] Fix whitespace errors
Michael Brown [Tue, 1 Jun 2010 18:11:38 +0000 (19:11 +0100)]
[qib7322] Fix whitespace errors

Fix up the whitespace errors inadvertently introduced by the
last-minute rename from the internal QLogic codename to "qib7322".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[qib7322] Fix uninitialized variables warning
Shao Miller [Tue, 1 Jun 2010 17:19:33 +0000 (17:19 +0000)]
[qib7322] Fix uninitialized variables warning

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pxe] Remove obsolete pxe_errortab.c
Michael Brown [Sun, 30 May 2010 22:27:22 +0000 (23:27 +0100)]
[pxe] Remove obsolete pxe_errortab.c

strerror() has not been able to use the PXE-only error table since
commit 9aa61ad ("Add per-file error identifiers") back in 2007.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[efi] Tidy up output of EFI header import script
Michael Brown [Sat, 29 May 2010 22:47:30 +0000 (23:47 +0100)]
[efi] Tidy up output of EFI header import script

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[legal] Add FILE_LICENCE declarations to EFI header files
Michael Brown [Sat, 29 May 2010 22:06:06 +0000 (23:06 +0100)]
[legal] Add FILE_LICENCE declarations to EFI header files

Autodetect the BSD licence statement in EFI header files, and add a
suitable FILE_LICENCE macro to the version imported into the gPXE
tree.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[efi] Synchronise EFI header files
Michael Brown [Sat, 29 May 2010 21:39:22 +0000 (22:39 +0100)]
[efi] Synchronise EFI header files

Now that the PACKED macro conflict is resolved, we can use an
unmodified import of the EFI header files (using
include/gpxe/efi/import.pl).

Synchronised to EDK2 SVN revision 10556.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Remove PACKED macro
Michael Brown [Sat, 29 May 2010 15:51:48 +0000 (16:51 +0100)]
[build] Remove PACKED macro

Most of gPXE uses __attribute__((packed)) anyway, and PACKED conflicts
with an identically-named macro in the upstream EFI header files.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Add rtl8139.rom to the default build target list
Michael Brown [Thu, 27 May 2010 22:20:44 +0000 (23:20 +0100)]
[build] Add rtl8139.rom to the default build target list

rtl8139.rom is the target used in qemu/kvm, which is the default test
platform for iPXE and also commonly used for gPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Inhibit "skipping incompatible" message from ld
Michael Brown [Thu, 27 May 2010 08:42:53 +0000 (09:42 +0100)]
[build] Inhibit "skipping incompatible" message from ld

On 64-bit systems with both 32-bit and 64-bit libraries installed, ld
tends to generate noisy "skipping incompatible /usr/lib/libxxx.so"
messages when building elf2efi.c.

Fix by passing --no-warn-search-mismatch to ld.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[qib7322] Add support for QLogic 7322 HCA
Michael Brown [Wed, 11 Nov 2009 00:50:34 +0000 (00:50 +0000)]
[qib7322] Add support for QLogic 7322 HCA

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pxe] Treat PXENV_RESTART_TFTP as unreturnable
Michael Brown [Fri, 21 May 2010 02:10:03 +0000 (03:10 +0100)]
[pxe] Treat PXENV_RESTART_TFTP as unreturnable

Microsoft WDS can end up calling PXENV_RESTART_TFTP to execute a
second-stage NBP which then exits.  Specifically, wdsnbp.com uses
PXENV_RESTART_TFTP to execute pxeboot.com, which will exit if the user
does not press F12.  gPXE currently treats PXENV_RESTART_TFTP as a
normal PXE API call, and so attempts to return to wdsnbp.com, which
has just been vaporised by pxeboot.com.

Use rmsetjmp/rmlongjmp to preserve the stack state as of the initial
NBP execution, and to restore this state immediately prior to
executing the NBP loaded via PXENV_RESTART_TFTP.  This matches the
behaviour in the PXE spec (which says that "if TFTP is restarted,
control is never returned to the caller"), and allows pxeboot.com to
exit relatively cleanly back to gPXE.

As with all usage of setjmp/longjmp, there may be subtle corner case
bugs due to not gracefully unwinding any state accumulated by the time
of the longjmp call, but this seems to be the only viable way to
provide the specified behaviour.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[lacp] Add simple LACP implementation
Michael Brown [Mon, 10 May 2010 15:30:10 +0000 (16:30 +0100)]
[lacp] Add simple LACP implementation

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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Fix building with binutils 2.16
Michael Brown [Tue, 27 Apr 2010 08:52:22 +0000 (09:52 +0100)]
[build] Fix building with binutils 2.16

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Add .mrom format, allowing loading of large ROMs
Michael Brown [Sun, 25 Apr 2010 14:57:00 +0000 (15:57 +0100)]
[romprefix] Add .mrom format, allowing loading of large ROMs

Add an infrastructure allowing the prefix to provide an open_payload()
method for obtaining out-of-band access to the whole gPXE image.  Add
a mechanism within this infrastructure that allows raw access to the
expansion ROM BAR by temporarily borrowing an address from a suitable
memory BAR on the same PCI card.

For cards that have a memory BAR that is at least as large as their
expansion ROM BAR, this allows large gPXE ROMs to be supported even on
systems where PMM fails, or where option ROM space pressure makes it
impossible to use PMM shrinking.  The BIOS sees only a stub ROM of
approximately 3kB in size; the remainder (which can be well over 64kB)
is loaded only at the time gPXE is invoked.

As a nice side-effect, an gPXE .mrom image will continue to work even
if its PMM-allocated areas are overwritten between initialisation and
invocation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Replace obsolete makerom.pl with quick script using Option::ROM
Michael Brown [Sun, 25 Apr 2010 01:54:12 +0000 (02:54 +0100)]
[build] Replace obsolete makerom.pl with quick script using Option::ROM

The only remaining useful function of makerom.pl is to correct the ROM
and PnP checksums; the PCI IDs are set at link time, and padding is
performed using padimg.pl.

Option::ROM already provides a facility for correcting the checksums,
so we may as well just use this instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[main] Match "starting execution" and "initialising devices" message style
Michael Brown [Sun, 25 Apr 2010 00:47:03 +0000 (01:47 +0100)]
[main] Match "starting execution" and "initialising devices" message style

Add a trailing "ok" to the "initialising devices message", to match
the visual style of the "ok" now added to the "starting execution"
message.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Inhibit the use of relocation during POST
Michael Brown [Sun, 25 Apr 2010 00:37:25 +0000 (01:37 +0100)]
[romprefix] Inhibit the use of relocation during POST

It is common for system memory maps to be grotesquely unreliable
during POST.  Many sanity checks have been added to the memory map
reading code, but these do not catch all problems.

Skip relocation entirely if called during POST.  This should avoid the
problems typically encountered, at the cost of slightly disrupting the
memory map of an operating system booted via gPXE when gPXE was
entered during POST.  Since this is a very rare special case (used,
for example, when reflashing an experimental ROM that would otherwise
prevent the system from completing POST), this is an acceptable cost.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Split PMM allocations for image source and decompression area
Michael Brown [Sat, 24 Apr 2010 21:34:28 +0000 (22:34 +0100)]
[romprefix] Split PMM allocations for image source and decompression area

Some BIOSes (at least some AMI BIOSes) tend to refuse to allocate a
single area large enough to hold both the gPXE image source and the
temporary decompression area, despite promising a largest available
PMM memory block of several megabytes.  This causes ROM image
shrinking to fail on these BIOSes, with undesirable consequences:
other option ROMs may be disabled due to shortage of option ROM space,
and the gPXE ROM may itself be corrupted by a further BIOS bug (again,
observed on an AMI BIOS) which causes large ROMs to end up overlapping
reserved areas of memory.  This can potentially render a system
unbootable via any means.

Increase the chances of a successful PMM allocation by dropping the
alignment requirement (which is redundant now that we can enable A20
from within the prefix); this allows us to reduce the allocation size
from 2MB down to only the required size.

Increase the chances still further by using two separate allocations:
one to hold the image source (i.e. the copy of the ROM before being
shrunk) and the other to act as the decompression area.  This allows
ROM image shrinking to take place even on systems that fail to
allocate enough memory for the temporary decompression area.

Improve the behaviour of gPXE in systems with multiple gPXE ROMs by
sharing PMM allocations where possible.  Image source areas can be
shared with any gPXE ROMs with a matching build identifier, and the
temporary decompression area can be shared with any gPXE ROMs with the
same uncompressed size (rounded up to the nearest 128kB).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Use area at top of INT 15,88 memory map for temporary decompression
Michael Brown [Sat, 24 Apr 2010 21:22:54 +0000 (22:22 +0100)]
[prefix] Use area at top of INT 15,88 memory map for temporary decompression

Use INT 15,88 to find a suitable temporary decompression area, rather
than a fixed address.  This hopefully gives us a better chance of not
treading on any PMM-allocated areas, in BIOSes where PMM support
exists but tends not to give us the large blocks that we ask for.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pcbios] Always show INT 15,88 result under DEBUG=memmap
Michael Brown [Sat, 24 Apr 2010 20:52:48 +0000 (21:52 +0100)]
[pcbios] Always show INT 15,88 result under DEBUG=memmap

Always call INT 15,88 even if we don't use the result.  This allows
DEBUG=memmap to show the complete result set returned by all of the
INT 15 memory-map calls.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[build] Generate random build identifier
Michael Brown [Sat, 24 Apr 2010 18:15:51 +0000 (19:15 +0100)]
[build] Generate random build identifier

Randomly generate a 32-bit build identifier that can be used to
identify identical gPXE ROMs when multiple such ROMs are present in a
system (e.g. when a multi-function NIC exposes the same gPXE ROM image
via each function's expansion ROM BAR).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Provide indication of successful call to install_prealloc
Michael Brown [Wed, 21 Apr 2010 12:35:31 +0000 (13:35 +0100)]
[romprefix] Provide indication of successful call to install_prealloc

The existing "gPXE starting execution" message indicates that the BEV
(or INT19) was invoked, but gives no indication on whether or not the
gPXE source was successfully retrieved (e.g. from PMM).  Split the
"starting execution message" into "starting execution...ok"; the "ok"
indicates that the main gPXE body was successfully decompressed and
relocated.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Default to 1MB mark as fallback high memory load point
Michael Brown [Tue, 20 Apr 2010 19:44:23 +0000 (20:44 +0100)]
[prefix] Default to 1MB mark as fallback high memory load point

Now that we can use odd megabytes, there is no particular need to use
an even megabyte as the fallback temporary load point.

Note that the old warnings about avoiding 2MB pre-date our ability to
cooperate with other PXE ROMs by using PMM.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[relocate] Remove the even megabyte constraint
Michael Brown [Tue, 20 Apr 2010 18:33:41 +0000 (19:33 +0100)]
[relocate] Remove the even megabyte constraint

gPXE is now capable of operating in odd megabytes of memory, so remove
the obsolete code enforcing an even-megabyte constraint.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[librm] Use libflat to enable A20 line on each real-to-protected transition
Michael Brown [Tue, 20 Apr 2010 18:20:26 +0000 (19:20 +0100)]
[librm] Use libflat to enable A20 line on each real-to-protected transition

Use the shared code in libflat to perform the A20 transitions
automatically on each transition from real to protected mode.  This
allows us to remove all explicit calls to gateA20_set().

The old warnings about avoiding automatically enabling A20 are
essentially redundant; they date back to the time when we would always
start hammering the keyboard controller without first checking to see
if gate A20 was already enabled (which it almost always is).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Add A20-enabling code in libflat
Michael Brown [Tue, 20 Apr 2010 17:49:43 +0000 (18:49 +0100)]
[prefix] Add A20-enabling code in libflat

gPXE currently insists on residing in an even megabyte.  This imposes
undesirably severe constraints upon our PMM allocation strategy, and
limits our options for mechanisms to access ROMs greater than 64kB in
size.

Add A20 handling code to libflat so that prefixes are able to access
memory even in odd megabytes.

The algorithms and tuning parameters in the new A20 handling code are
based upon a mixture of the existing gPXE A20 code and the A20 code
from the 2.6.32 Linux kernel.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Move flatten_real_mode to libflat.S
Michael Brown [Tue, 20 Apr 2010 13:23:55 +0000 (14:23 +0100)]
[prefix] Move flatten_real_mode to libflat.S

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Move flatten_real_mode to .text16.early
Michael Brown [Tue, 20 Apr 2010 11:59:48 +0000 (12:59 +0100)]
[prefix] Move flatten_real_mode to .text16.early

The flatten_real_mode routine is not needed until after decompressing
.text16.early, and currently performs various contortions to
compensate for the fact that .prefix may not be writable.  Move
flatten_real_mode to .text16.early to save on (compressed) binary size
and simplify the code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Add .text16.early section
Michael Brown [Tue, 20 Apr 2010 10:05:53 +0000 (11:05 +0100)]
[prefix] Add .text16.early section

Add a section .text16.early which is always kept inline with the
prefix.  This will allow for some code sharing between the .prefix and
.text16 sections.

Note that the simple solution of just prepending the .prefix section
to the .text16 section will not work, because a bug in Wyse Streaming
Manager server (WLDRM13.BIN) requires us to place a dummy PXENV+ entry
point at the start of .text16.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Use flat real mode for access to high memory
Michael Brown [Mon, 19 Apr 2010 21:22:11 +0000 (22:22 +0100)]
[prefix] Use flat real mode for access to high memory

Use flat real mode rather than 16-bit protected mode for access to
high memory during installation.  This simplifies the code by reducing
the number of CPU modes we need to think about, and also increases the
amount of code in common between the normal and (somewhat
hypothetical) KEEP_IT_REAL methods of operation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[prefix] Use flat real mode instead of real mode
Michael Brown [Mon, 19 Apr 2010 20:53:36 +0000 (21:53 +0100)]
[prefix] Use flat real mode instead of real mode

When returning to real mode, set 4GB segment limits instead of 64kB
limits.  This change improves our chances of successfully returning to
a PMM-capable BIOS aftering entering gPXE during POST; the BIOS will
have set up flat real mode before calling our initialisation point,
and may be disconcerted if we then return in genuine real mode.

This change is unlikely to break anything, since any code that might
potentially access beyond 64kB must use addr32 prefixes to do so; if
this is the case then it is almost certainly code written to expect
flat real mode anyway.

Note that it is not possible to restore the real-mode segment limits
to their original values, since it is not possible to know which
protected-mode segment descriptor was originally used to initialise
the limit portion of the segment register.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Remove .hrom prefix
Michael Brown [Mon, 19 Apr 2010 19:38:35 +0000 (20:38 +0100)]
[romprefix] Remove .hrom prefix

The .hrom prefix provides an experimental mechanism for reducing
option ROM space usage on systems where PMM allocation fails, by
pretending that PMM allocation succeeded and gave us an address fixed
at compilation time.  This is unreliable, and potentially dangerous.
In particular, when multiple gPXE ROMs are present in a system, each
gPXE ROM will assume ownership of the same fixed address, resulting in
undefined behaviour.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[romprefix] Remove .xrom prefix
Michael Brown [Mon, 19 Apr 2010 19:32:25 +0000 (20:32 +0100)]
[romprefix] Remove .xrom prefix

The .xrom prefix provides an experimental mechanism for loading ROM
images greater than 64kB in size by mapping the expansion ROM BAR in
at a hopefully-unused address.  This is unreliable, and potentially
dangerous.  In particular, there is no guarantee that any PCI bridges
between the CPU and the device will respond to accesses for the
"unused" memory region that is chosen, and it is possible that the
process of scanning for the "unused" memory region may end up issuing
reads to other PCI devices.  If this ends up trampling on a register
with read side-effects belonging to an unrelated PCI device, this may
cause undefined behaviour.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[release] Update version to 1.0.1+ post release
Marty Connor [Tue, 29 Jun 2010 20:17:33 +0000 (16:17 -0400)]
[release] Update version to 1.0.1+ post release

Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[tls] Handle multiple handshake records
Michael Brown [Wed, 23 Jun 2010 00:01:32 +0000 (01:01 +0100)]
[tls] Handle multiple handshake records

The handshake record in TLS can contain multiple messages.

Originally-fixed-by: Timothy Stack <tstack@vmware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pcnet32] Fix uninitialised variable
Geoff Lywood [Tue, 29 Jun 2010 06:51:51 +0000 (07:51 +0100)]
[pcnet32] Fix uninitialised variable

Using gcc 4.1.2, I get the following error when running 'make bin/pcnet32.rom':

  [BUILD] bin/pcnet32.o
cc1: warnings being treated as errors
drivers/net/pcnet32.c: In function 'pcnet32_probe':
drivers/net/pcnet32.c:516: warning: 'phycount' may be used uninitialized in this function
make: *** [bin/pcnet32.o] Error 1

This patch fixes the problem.

Signed-off-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[r8169] Remove r8169 driver cfg lookup, use pci_device_id->driver_data instead
Andrei Faur [Tue, 22 Jun 2010 16:41:58 +0000 (19:41 +0300)]
[r8169] Remove r8169 driver cfg lookup, use pci_device_id->driver_data instead

This patch removes the cfg lookup made in the r8169 driver
and replaces it with equivalent information found in the
driver_data field of the pci_device_id structure.

Signed-off-by: Andrei Faur <da3drus@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[myri10ge] Add NonVolatile Option (nvo) support
Glenn Brown [Wed, 23 Jun 2010 20:18:36 +0000 (13:18 -0700)]
[myri10ge] Add NonVolatile Option (nvo) support

Add NonVolatile Option (nvo) and NonVolatile Storage (nvs) support to
the myri10ge driver using the EEPROM read/write mechanism provided by
the NIC's Vendor Specific PCI capability.

The myri10ge NIC is capabile of storing 64KB or more of nonvolatile
options, but this patch advertises only 512 bytes of nvo storage because
gPXE malloc's a buffer matching the total size we advertise.  512 is
plenty without wasting malloc'd memory.  (The 2 other drivers currently
supporting nvo advertise 256 bytes or less.)

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[Settings] Add setting deletion (Ctrl-D) interface
Glenn Brown [Wed, 23 Jun 2010 20:18:35 +0000 (13:18 -0700)]
[Settings] Add setting deletion (Ctrl-D) interface

Make Ctrl-D delete a settings, because the Text User Interface (tui)
previously provided no way to delete a setting.  Also, update the
on-screen instructions to describe the new feature.  Deleting settings is
especially important for settings stored in precious nonvolatile storate.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[Settings] Enable jump scroll in config UI
Glenn Brown [Wed, 23 Jun 2010 20:18:34 +0000 (13:18 -0700)]
[Settings] Enable jump scroll in config UI

Implement jump scrolling with "..." displayed where the settings list
continues off-screen, because there are now too many settings to fit on
screen in the "config ..." text user interface.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pci] Define Vendor Specific capability ID
Glenn Brown [Wed, 23 Jun 2010 20:18:33 +0000 (13:18 -0700)]
[pci] Define Vendor Specific capability ID

Add a PCI_CAP_ID_VNDR definition for the PCI standard "Vendor Specific"
capability ID.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[pcnet32] Replace pcnet32 with native driver
Andrei Faur [Sun, 20 Jun 2010 19:23:01 +0000 (22:23 +0300)]
[pcnet32] Replace pcnet32 with native driver

This patch replaces the old pcnet32 driver with a new one that
uses gPXE's API.

Signed-off-by: Andrei Faur <da3drus@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[jme] Fix 64-bit compile of JMicron ethernet driver
Geoff Lywood [Tue, 15 Jun 2010 00:46:36 +0000 (17:46 -0700)]
[jme] Fix 64-bit compile of JMicron ethernet driver

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[ethernet] Move Ethernet MAC address checking routines to ethernet.h
Michael Brown [Fri, 4 Jun 2010 19:24:45 +0000 (22:24 +0300)]
[ethernet] Move Ethernet MAC address checking routines to ethernet.h

Originally-fixed-by: Faur Andrei <da3drus@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[jme] Fix refill behavior
Guo-Fu Tseng [Fri, 4 Jun 2010 14:23:15 +0000 (22:23 +0800)]
[jme] Fix refill behavior

After changing the driver to refill after feed, if any error occurs a
non-contiguous empty buffer will be introduced in the ring due to my
reuse-buffer-when-error implementation.

Reported-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[eepro100] Add PCI ID for Intel Pro/100 VE
Erwan Velu [Thu, 3 Jun 2010 20:28:38 +0000 (22:28 +0200)]
[eepro100] Add PCI ID for Intel Pro/100 VE

Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[lkrnprefix] Fix documentation path in comment
Wu Fengguang [Thu, 3 Jun 2010 03:16:03 +0000 (11:16 +0800)]
[lkrnprefix] Fix documentation path in comment

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[jme] Add JMicron Ethernet driver
Guo-Fu Tseng [Mon, 31 May 2010 22:09:02 +0000 (06:09 +0800)]
[jme] Add JMicron Ethernet driver

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>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[efi] Add the "snpnet" driver
Geoff Lywood [Fri, 28 May 2010 03:08:28 +0000 (20:08 -0700)]
[efi] Add the "snpnet" driver

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
gPXE was loaded from; the resulting behavior is similar to the
"undionly" driver for BIOS systems.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
10 years ago[efi] Update UEFI header files with latest version from TianoCore
Geoff Lywood [Fri, 28 May 2010 22:06:24 +0000 (15:06 -0700)]
[efi] Update UEFI header files with latest version from TianoCore

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[iscsi] Allow base64 encoding in large binary values
Piotr Jaroszyński [Fri, 28 May 2010 18:52:47 +0000 (19:52 +0100)]
[iscsi] Allow base64 encoding in large binary values

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
10 years ago[infiniband] Use generic base16 functions for SRP
Michael Brown [Fri, 28 May 2010 18:04:59 +0000 (19:04 +0100)]
[infiniband] Use generic base16 functions for SRP

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
10 years ago[iscsi] Use generic base16 functions for iSCSI
Michael Brown [Fri, 28 May 2010 15:21:56 +0000 (16:21 +0100)]
[iscsi] Use generic base16 functions for iSCSI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
10 years ago[base16] Add generic base16 encoding and decoding routines
Michael Brown [Fri, 28 May 2010 13:58:04 +0000 (14:58 +0100)]
[base16] Add generic base16 encoding and decoding routines

Base16 encoding is currently implemented in both iSCSI and SRP.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
10 years ago[base64] Add ability to decode base64 strings
Michael Brown [Fri, 28 May 2010 11:42:00 +0000 (12:42 +0100)]
[base64] Add ability to decode base64 strings

Inspired-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
10 years ago[base64] Allow base64_encode() to handle arbitrary data
Michael Brown [Fri, 28 May 2010 00:17:22 +0000 (01:17 +0100)]
[base64] Allow base64_encode() to handle arbitrary data

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
10 years ago[dhcp] Use correct DHCP options on EFI systems
Geoff Lywood [Tue, 4 May 2010 21:31:46 +0000 (14:31 -0700)]
[dhcp] Use correct DHCP options on EFI systems

See RFC 4578 for details.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[build] Allow building against a zlib in a non-standard location
Geoff Lywood [Thu, 27 May 2010 21:27:20 +0000 (14:27 -0700)]
[build] Allow building against a zlib in a non-standard location

Support a ZLIB_DIR= variable on the make command line.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[efi] Fix *.efi linking
Piotr Jaroszyński [Tue, 30 Mar 2010 16:18:43 +0000 (18:18 +0200)]
[efi] Fix *.efi linking

The linker chooses to look for _start first and always picks
efidrvprefix.o to satisfy it (probably because it's earlier in the
archive) which causes a multiple definition error when the linker
later has to pick efiprefix.o for other symbols. Use EFI-specific
LD_FLAGS with more --defsym magic to work around that.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[efi] Fix link order for elf2efi
Piotr Jaroszyński [Tue, 30 Mar 2010 13:34:17 +0000 (15:34 +0200)]
[efi] Fix link order for elf2efi

Dependencies are considered in left-to-right order so the source file
needs to come first in this case.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[elf2efi] Improve error handling
Geoff Lywood [Thu, 27 May 2010 00:04:12 +0000 (17:04 -0700)]
[elf2efi] Improve error handling

Currently, if you attempt to build 64-bit EFI binaries on a 32-bit system
without a suitable cross-compiling version of libbfd.a, the gPXE build will
die with a segmentation fault in elf2efi64. This fix makes it die with a
slightly more useful error message.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[bitmap] Fix bitmaps on 64-bit platforms
Geoff Lywood [Tue, 4 May 2010 21:18:04 +0000 (14:18 -0700)]
[bitmap] Fix bitmaps on 64-bit platforms

Fix mistaken truncation of bitmap blocks to integer size before
testing and comparison. A typical symptom of the error would be
TFTP transfers failing after 32 blocks.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[linker] Use weak definitions instead of weak declarations
Joshua Oreman [Thu, 27 May 2010 00:52:44 +0000 (17:52 -0700)]
[linker] 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>
10 years ago[dhcp] Don't consider invalid offers to be duplicates
Joshua Oreman [Wed, 26 May 2010 21:22:03 +0000 (14:22 -0700)]
[dhcp] Don't consider invalid offers to be duplicates

This fixes a regression in BOOTP support; since BOOTP requests often have
the `siaddr' field set to 0.0.0.0, they would be considered duplicates
of the first zeroed-out offer slot.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[compiler] Fix 64bit compile time errors
Piotr Jaroszyński [Tue, 30 Mar 2010 13:33:20 +0000 (15:33 +0200)]
[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>
10 years ago[dhcp] Honor PXEBS_SKIP option in discovery control
Joshua Oreman [Tue, 25 May 2010 20:17:40 +0000 (16:17 -0400)]
[dhcp] Honor PXEBS_SKIP option in discovery control

It is permissible for a DHCP packet containing PXE options to specify
only "discovery control", instead of the more typical boot menu +
prompt options. This is the strategy used by older versions of
dnsmasq; by specifying the discovery control as PXEBS_SKIP, they cause
vendor PXE ROMs to ignore boot server discovery and just use the
filename and next-server options in the initial (Proxy)DHCP packet.
Modify gPXE to accept this behavior, to be more compatible with the
Intel firmware.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Tested-by: Kyle Kienapfel <kyle@shadowmage.org>
10 years ago[wpa] Remove PMKID checking
Joshua Oreman [Wed, 19 May 2010 03:39:32 +0000 (23:39 -0400)]
[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 gPXE to give spurious
authentication errors. Remove it for these reasons.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
10 years ago[comboot] Propagate carry flag from COMBOOT API
Stefan Hajnoczi [Sat, 8 May 2010 10:49:09 +0000 (11:49 +0100)]
[comboot] Propagate carry flag from COMBOOT API

COMBOOT API calls set the carry flag on failure.  This was not being
propagated because the COMBOOT interrupt handler used iret to return
with EFLAGS restored from the stack.  This patch propagates CF before
returning from the interrupt.

Reported-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[uri] Special case NULL in churi()
Piotr Jaroszyński [Mon, 12 Apr 2010 15:37:10 +0000 (17:37 +0200)]
[uri] Special case NULL in churi()

resolve_uri() doesn't (and probably shouldn't) handle NULL relative_uri.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[uri] Fix NULL dereference in parse_uri()
Piotr Jaroszyński [Mon, 12 Apr 2010 15:15:44 +0000 (17:15 +0200)]
[uri] Fix NULL dereference in parse_uri()

Don't try to parse authority if it's not there.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[eepro100] Remove link-state checking
Thomas Miletich [Fri, 16 Apr 2010 16:11:39 +0000 (18:11 +0200)]
[eepro100] Remove link-state checking

Christopher Armenio reported link detection problems with an
integrated eepro100 NIC.  Thomas Miletich removed link detection code
from the eepro100 driver and verified that the driver continued to
function.  Christopher verified Thomas' patch on his integrated
eepro100 NIC.

Reported-by: Christopher Armenio <christopher.armenio@resquared.com>
Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[util] Hide an expected error from the 'which' command
Piotr Jaroszyński [Mon, 29 Mar 2010 00:15:03 +0000 (02:15 +0200)]
[util] Hide an expected error from the 'which' command

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[build] Look for isolinux.bin in more places
Piotr Jaroszyński [Mon, 29 Mar 2010 00:12:06 +0000 (02:12 +0200)]
[build] Look for isolinux.bin in more places

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[drivers] Fix warnings identified by gcc 4.5
Bruce Rogers [Sat, 3 Apr 2010 00:16:38 +0000 (18:16 -0600)]
[drivers] Fix warnings identified by gcc 4.5

In building gpxe for openSUSE Factory (part of kvm package), there were
a few problems identified by the compiler.  This patch addresses them.

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[build] Add support for local configuration files
Piotr Jaroszyński [Mon, 22 Mar 2010 22:19:00 +0000 (23:19 +0100)]
[build] Add support for local configuration files

Include config/local/$file in config/$file where it makes sense and
create empty local configs during build if not present.

Modified-by: Michael Brown <mcb30@etherboot.org>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
10 years ago[pxe] Remove pxe_set_cached_filename()
Michael Brown [Fri, 26 Mar 2010 17:53:24 +0000 (17:53 +0000)]
[pxe] Remove pxe_set_cached_filename()

gPXE currently overwrites the filename stored in the cached DHCP
packets when a call to PXENV_TFTP_READ_FILE or PXENV_RESTART_TFTP is
made.  This code has existed for many years as a workaround for RIS,
which seemed to require that this be done.

pxe_set_cached_filename() causes problems with the Bootix NBP, and a
recent test demonstrates that RIS will complete successfully even with
pxe_set_cached_filename() removed.  There have been many changes to
the DHCP and PXE logic since this code was first added, and it is
quite plausible that it was masking a bug that no longer exists.

Reported-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Debugged-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
10 years ago[pxe] Avoid potential interrupt storms when using shared interrupts
Michael Brown [Tue, 23 Mar 2010 00:58:52 +0000 (00:58 +0000)]
[pxe] Avoid potential interrupt storms when using shared interrupts

Current gPXE code always returns "OURS" in response to
PXENV_UNDI_ISR:START.  This is harmless for non-shared interrupt
lines, and avoids the complexity of trying to determine whether or not
we really did cause the interrupt.  (This is a non-trivial
determination; some drivers don't have interrupt support and hook the
system timer interrupt instead, for example.)

A problem occurs when we have a shared interrupt line, the other
device asserts an interrupt, and the controlling ISR does not chain to
the other device's ISR when we return "OURS".  Under these
circumstances, the other device's ISR never executes, and so the
interrupt remains asserted, causing an interrupt storm.

Work around this by returning "OURS" if and only if our net device's
interrupt is currently recorded as being enabled.  Since we always
disable interrupts as a result of a call to PXENV_UNDI_ISR:START, this
guarantees that we will eventually (on the second call) return "NOT
OURS", allowing the other ISR to be called.  Under normal operation,
including a non-shared interrupt situation, this change will make no
difference since PXENV_UNDI_ISR:START would be called only when
interrupts were enabled anyway.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
10 years ago[netdevice] Record whether or not interrupts are currently enabled
Michael Brown [Tue, 23 Mar 2010 00:55:19 +0000 (00:55 +0000)]
[netdevice] Record whether or not interrupts are currently enabled

Signed-off-by: Michael Brown <mcb30@etherboot.org>
10 years ago[netdevice] Add netdev_is_open() wrapper function
Michael Brown [Tue, 23 Mar 2010 00:46:23 +0000 (00:46 +0000)]
[netdevice] Add netdev_is_open() wrapper function

Signed-off-by: Michael Brown <mcb30@etherboot.org>
10 years ago[phantom] Update interrupt support to match current firmware
Michael Brown [Sat, 20 Mar 2010 03:11:03 +0000 (03:11 +0000)]
[phantom] Update interrupt support to match current firmware

The interrupt control mechanism on Phantom cards has changed
substantially since the driver was initially written.  This updates
the code to match the mechanism used in production firmware.

This is sufficient to allow DOS wget to function successfully using
the 3Com UNDI/NDIS, Intel UNDI/NDIS, and UNDIPD.COM UNDI/PD stacks.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
10 years ago[igb] Add igb driver
Marty Connor [Wed, 17 Mar 2010 07:44:27 +0000 (03:44 -0400)]
[igb] Add igb driver

This commit adds an igb (Intel GigaBit) driver based on Intel source
code available at:

    http://sourceforge.net/projects/e1000/

which is upstream source for the Linux kernel e1000 drivers, and
should support some PCIe e1000 variants.

Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[e1000e] Add e1000e driver
Marty Connor [Wed, 17 Mar 2010 07:18:46 +0000 (03:18 -0400)]
[e1000e] Add e1000e driver

This commit adds an e1000e driver based on Intel source code
available at:

    http://sourceforge.net/projects/e1000/

which is upstream source for the Linux kernel e1000 drivers, and
should support many PCIe e1000 variants.

Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[e1000] Update e1000 driver
Marty Connor [Wed, 17 Mar 2010 07:02:32 +0000 (03:02 -0400)]
[e1000] Update e1000 driver

This commit replaces the current gPXE e1000 driver with one ported
from Intel source code available at

    http://sourceforge.net/projects/e1000/

which is upstream source for the Linux kernel e1000 drivers, and
should support most if not all PCI e1000 variants.

Signed-off-by: Marty Connor <mdc@etherboot.org>
10 years ago[iscsi] Disambiguate some common authentication errors
Michael Brown [Wed, 17 Mar 2010 02:23:17 +0000 (02:23 +0000)]
[iscsi] Disambiguate some common authentication errors

Signed-off-by: Michael Brown <mcb30@etherboot.org>