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

3524 Commits

Author SHA1 Message Date
Michael Brown ec42ba366f [lotest] Use generic option-parsing library
Total saving: 145 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-22 00:34:47 +00:00
Michael Brown 1e2a8aa9c1 [gdb] Use generic option-parsing library
Total saving: 42 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-22 00:34:47 +00:00
Michael Brown 59980a6176 [fc] Use generic option-parsing library
Total saving: 111 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-22 00:34:40 +00:00
Michael Brown ee53e69bab [digest] Use generic option-parsing library
Total saving: 68 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 23:37:56 +00:00
Michael Brown 07c6b79102 [dhcp] Use generic option-parsing library
Total saving: 329 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 23:37:55 +00:00
Michael Brown 398a6e9a50 [ifmgmt] Use generic option-parsing library
Total cost: 66 bytes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 23:37:49 +00:00
Michael Brown 9e9c9adf10 [settings] Use generic option-parsing library
Total cost: 75 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 20:38:39 +00:00
Michael Brown 17b337d4a8 [autoboot] Use generic option-parsing library
Total saving: 32 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 20:38:39 +00:00
Michael Brown 2877af3ff5 [vlan] Use generic option-parsing library
Total saving: 261 bytes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 20:38:39 +00:00
Michael Brown 216fd0a5cf [parseopt] Add generic option-parsing library
Command implementations tend to include a substantial amount of common
boilerplate code revolving around the parsing of command-line options
and arguments.  This increases the size cost of each command.

Introduce an option-parsing library that abstracts out the common
operations involved in command implementations.  This enables the size
of each individual command to be reduced, and also enhances
consistency between commands.

Total size of the library is 704 bytes, to be amortised across all
command implementations.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 20:38:26 +00:00
Michael Brown 4448285142 [autoboot] Add "netboot" command
Originally-implemented-by: michael-dev@fami-braun.de
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-20 17:20:03 +00:00
Michael Brown 6fd09b541f [vlan] Add support for IEEE 802.1Q VLANs
Originally-implemented-by: michael-dev@fami-braun.de
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-20 16:52:04 +00:00
Michael Brown f12fcd53b1 [lotest] Fix endianness in status message
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-20 16:51:05 +00:00
Michael Brown 3633bb246c [lotest] Use network device receive queue freezing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-20 16:51:05 +00:00
Michael Brown 69d1e6cf57 [pxe] Use network device receive queue freezing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-20 16:51:05 +00:00
Michael Brown 4576c2da58 [netdevice] Allow per-device receive queue processing to be frozen
Several use cases (e.g. the UNDI API and the EFI SNP API) require
access to the raw network device receive queue, and so currently use
manual calls to netdev_poll() on a specific network device in order to
prevent received packets from being processed by the network stack.

As an alternative, provide a flag that allows receive queue processing
to be frozen on a per-device basis.  When receive queue processing is
frozen, packets will be enqueued as normal, but will not be
automatically dequeued and passed up the network stack.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-20 15:46:00 +00:00
Michael Brown 006d9f1f60 [undi] Support underlying UNDI devices that don't support interrupts
Some network cards do not generate interrupts when operated via the
UNDI API.  Allow for this by waiting for the ISR to be triggered only
if the PXE stack advertises that it supports interrupts.  When the PXE
stack does not advertise interrupt support, we skip the call to
PXENV_UNDI_ISR_IN_START and just poll the device using
PXENV_UNDI_ISR_IN_PROCESS.  This matches the observed behaviour of at
least one other PXE NBP (emBoot's winBoot/i), so there is a reasonable
chance of this working.

Originally-implemented-by: Muralidhar Appalla <Muralidhar.Appalla@emulex.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 18:52:20 +00:00
Michael Brown 7e33adcb90 [tcp] Remove obsolete constants
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:05 +00:00
Michael Brown d012f87018 [tcp] Use MAX_LL_NET_HEADER_LEN instead of defining our own MAX_HDR_LEN
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:05 +00:00
Michael Brown 878a1f4e2f [udp] Remove obsolete constants
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:05 +00:00
Michael Brown 5de4fba4f9 [udp] Use MAX_LL_NET_HEADER_LEN instead of defining our own UDP_MAX_HLEN
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:05 +00:00
Michael Brown 0d7839678b [netdevice] Add MAX_NET_HEADER_LEN and MAX_LL_NET_HEADER_LEN
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:05 +00:00
Michael Brown fb78d086f1 [pxe] Always allow MAX_LL_HEADER_LEN for the link-layer header
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:05 +00:00
Michael Brown 308615cd97 [efi] Always allow MAX_LL_HEADER_LEN for the link-layer header
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-19 16:08:04 +00:00
Michael Brown 1782fc7011 [lotest] Move lotest.h to correct directory
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-18 23:30:50 +00:00
Michael Brown 3d9096f719 [lacp] Fix dumping of raw LACP packets
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-18 17:41:44 +00:00
Michael Brown 24fc6aa5b0 [netdevice] Use net device name in debugging messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-18 17:41:02 +00:00
Michael Brown 312ae024d8 [settings] Add "hexhyp" setting type
Provide a "hexhyp" setting type, which functions identically to the
"hex" setting type except that it uses a hyphen instead of a colon as
the byte delimiter.

For example, if ${mac} expands to "52:54:00:12:34:56", then
${mac:hexhyp} will expand to "52-54-00-12-34-56".

Originally-implemented-by: Jarrod Johnson <jarrod.b.johnson@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-13 00:28:26 +00:00
Jarrod Johnson 4526f431d7 [bzimage] Increase maximum command-line size to 0x7ff
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-13 00:13:34 +00:00
Thomas Miletich 06dbe701bb [forcedeth] Exit poll() as early as possible if no work to do
Fix incorrect authorship attribution on commit f122515 ("[forcedeth]
Exit poll() as early as possible if no work to do").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-12 00:12:17 +00:00
Michael Brown f122515515 [forcedeth] Exit poll() as early as possible if no work to do
Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-11 23:57:10 +00:00
Michael Brown 67dc832d15 [tcp] Set PSH flag only on packets containing data
Suggested-by: Yelena Kadach <klenusik@hotmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-11 01:14:05 +00:00
Shao Miller 98b3599a65 [list] Fix typographical error from previous commit
Fix typographical error from commit ea631f6 ("[list] Add
list_first_entry()").  The symptom was PXELINUX 3.86 causing a stack
overflow under VMware.

Tested-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-11 00:30:22 +00:00
Michael Brown 8e718df5e1 [fc] Add support for Fibre Channel name server lookups
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown 41231fda9c [fc] Hold ULP's peer reference while ULP exists
Allow fc_ulp_decrement() to guarantee to fc_peer_decrement() that the
peer reference remains valid for the duration of the call, by ensuring
that ulp->peer remains valid while ulp is valid.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown 0cd185e734 [fc] Allow peers and ULPs to log out when usage count reaches zero
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown c09f87e3b7 [fc] Hold reference to peers and ULPs while calling fc_link_examine()
Allow link examination methods to safely assume that their
self-reference remains valid for the duration of the method call.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown 00cffae5f9 [fc] Log out correct port ID after a successful LOGO request
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown 90930be8fe [fc] Support Fibre Channel ECHO
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown f5115f96f7 [fcp] Use EINVAL for URI parsing errors and EPROTO for protocol errors
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown 66e7619099 [retry] Process at most one timer's expiry in each call to retry_step()
Calling a timer's expiry method may cause arbitrary consequences,
including arbitrary modifications of the list of retry timers.
list_for_each_entry_safe() guards against only deletion of the current
list entry; it provides no protection against other list
modifications.  In particular, if a timer's expiry method causes the
subsequent timer in the list to be deleted, then the next loop
iteration will access a timer that may no longer exist.

This is a particularly nasty bug, since absolutely none of the
list-manipulation or reference-counting assertion checks will be
triggered.  (The first assertion failure happens on the next iteration
through list_for_each_entry(), showing that the list has become
corrupted but providing no clue as to when this happened.)

Fix by stopping traversal of the list of retry timers as soon as we
hit an expired timer.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:36 +00:00
Michael Brown 13e4b9ec49 [malloc] Avoid immediately clobbering reference count when freeing memory
Rearrange the fields in struct memory_block (without altering
MIN_MEMBLOCK_SIZE) so that the "count" field of a reference-counted
object is left intact when the memory containing the object is freed.
This allows for the possibility of detecting reference-counting errors
such as double-freeing.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:35 +00:00
Michael Brown 6e41f2cf18 [refcnt] Check reference validity on each use of ref_get() and ref_put()
Check that the reference count is valid (i.e. non-negative) on each
call to ref_get() and ref_put(), using an assert() at the point of
use.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:35:35 +00:00
Michael Brown fc69ab94d9 [malloc] Use list_for_each_entry_safe() when we may delete a list entry
free_memblock() currently uses list_for_each_entry() to iterate over
the free list, and may delete an entry over which it iterates.  While
there is no way that the deleted list entry could be overwritten
before we reference it, this does rely upon list_del() leaving the
"next" pointer intact, which is not guaranteed.  Discovered while
tracking down a list-corruption bug (as a result of having modified
list_del() to sanitise the deleted list entry).

Fix by using list_for_each_entry_safe().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 03:15:56 +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 295ba15bd6 [list] Extend list-manipulation assertions to all list-handling functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 02:22:53 +00:00
Michael Brown de1381578b [process] Include step() function pointer in process debugging messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-08 02:22:53 +00:00
Michael Brown a59bb9c313 [fcp] Avoid quoting exchange ID before exchange is created
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-03 01:55:53 +00:00
Michael Brown 0654698cd7 [fcp] Fix potential memory leaks on error paths
Functions that instantiate objects generally own one reference to the
object being created.  The error paths must therefore usually call
ref_put() to release this reference.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-03 01:48:59 +00:00
Michael Brown 41187aca2c [build] Add FreeBSD location for isolinux
Reported-by: Jedrzej Kalinowski <kalinoj1@iem.pw.edu.pl>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-02 23:19:15 +00:00