[-]
[+]
|
Changed |
_service:set_version:ipxe.spec
|
|
[-]
[+]
|
Changed |
ipxe.spec
^
|
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/Makefile
^
|
@@ -143,7 +143,25 @@
bin-i386-efi/ipxe.efirom \
bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
bin-x86_64-efi/ipxe.efirom \
- bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux
+ bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux \
+ bin-i386-linux/tests.linux bin-x86_64-linux/tests.linux
+
+###############################################################################
+#
+# VMware build target: all ROMs used with VMware
+#
+vmware : bin/8086100f.mrom bin/808610d3.mrom bin/10222000.rom bin/15ad07b0.rom
+ @$(ECHO) '==========================================================='
+ @$(ECHO)
+ @$(ECHO) 'Available ROMs:'
+ @$(ECHO) ' bin/8086100f.mrom -- intel/e1000'
+ @$(ECHO) ' bin/808610d3.mrom -- intel/e1000e'
+ @$(ECHO) ' bin/10222000.rom -- vlance/pcnet32'
+ @$(ECHO) ' bin/15ad07b0.rom -- vmxnet3'
+ @$(ECHO)
+ @$(ECHO) 'For more information, see http://ipxe.org/howto/vmware'
+ @$(ECHO)
+ @$(ECHO) '==========================================================='
###############################################################################
#
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/core/relocate.c
^
|
@@ -33,8 +33,10 @@
/**
* Relocate iPXE
*
- * @v ix86 x86 register dump from prefix
- * @ret ix86 x86 registers to return to prefix
+ * @v ebp Maximum address to use for relocation
+ * @ret esi Current physical address
+ * @ret edi New physical address
+ * @ret ecx Length to copy
*
* This finds a suitable location for iPXE near the top of 32-bit
* address space, and returns the physical address of the new location
@@ -59,7 +61,7 @@
/* Determine maximum usable address */
max = MAX_ADDR;
- if ( ix86->regs.ebp && ( ix86->regs.ebp < max ) ) {
+ if ( ix86->regs.ebp < max ) {
max = ix86->regs.ebp;
DBG ( "Limiting relocation to [0,%lx)\n", max );
}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/drivers/net/undinet.c
^
|
@@ -531,6 +531,53 @@
.irq = undinet_irq,
};
+/** A device with broken support for generating interrupts */
+struct undinet_irq_broken {
+ /** PCI vendor ID */
+ uint16_t pci_vendor;
+ /** PCI device ID */
+ uint16_t pci_device;
+};
+
+/**
+ * List of devices with broken support for generating interrupts
+ *
+ * Some PXE stacks are known to claim that IRQs are supported, but
+ * then never generate interrupts. No satisfactory solution has been
+ * found to this problem; the workaround is to add the PCI vendor and
+ * device IDs to this list. This is something of a hack, since it
+ * will generate false positives for identical devices with a working
+ * PXE stack (e.g. those that have been reflashed with iPXE), but it's
+ * an improvement on the current situation.
+ */
+static const struct undinet_irq_broken undinet_irq_broken_list[] = {
+ /* HP XX70x laptops */
+ { .pci_vendor = 0x8086, .pci_device = 0x1502 },
+ { .pci_vendor = 0x8086, .pci_device = 0x1503 },
+};
+
+/**
+ * Check for devices with broken support for generating interrupts
+ *
+ * @v undi UNDI device
+ * @ret irq_is_broken Interrupt support is broken; no interrupts are generated
+ */
+static int undinet_irq_is_broken ( struct undi_device *undi ) {
+ const struct undinet_irq_broken *broken;
+ unsigned int i;
+
+ for ( i = 0 ; i < ( sizeof ( undinet_irq_broken_list ) /
+ sizeof ( undinet_irq_broken_list[0] ) ) ; i++ ) {
+ broken = &undinet_irq_broken_list[i];
+ if ( ( undi->dev.desc.bus_type == BUS_TYPE_PCI ) &&
+ ( undi->dev.desc.vendor == broken->pci_vendor ) &&
+ ( undi->dev.desc.device == broken->pci_device ) ) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
/**
* Probe UNDI device
*
@@ -647,6 +694,11 @@
undinic );
undinic->hacks |= UNDI_HACK_EB54;
}
+ if ( undinet_irq_is_broken ( undi ) ) {
+ DBGC ( undinic, "UNDINIC %p forcing polling mode due to "
+ "broken interrupts\n", undinic );
+ undinic->irq_supported = 0;
+ }
/* Register network device */
if ( ( rc = register_netdev ( netdev ) ) != 0 )
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/firmware/pcbios/hidemem.c
^
|
@@ -190,6 +190,8 @@
* possible.
*/
static void unhide_etherboot ( int flags __unused ) {
+ struct memory_map memmap;
+ int rc;
/* If we have more than one hooked interrupt at this point, it
* means that some other vector is still hooked, in which case
@@ -203,15 +205,23 @@
return;
}
- /* Try to unhook INT 15. If it fails, then just leave it
- * hooked; it takes care of protecting itself. :)
- */
- unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
- &int15_vector );
+ /* Try to unhook INT 15 */
+ if ( ( rc = unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
+ &int15_vector ) ) != 0 ) {
+ DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
+ /* Leave it hooked; there's nothing else we can do,
+ * and it should be intrinsically safe (though
+ * wasteful of RAM).
+ */
+ }
/* Unhook fake E820 map, if used */
if ( FAKE_E820 )
unfake_e820();
+
+ /* Dump memory map after unhiding */
+ DBG ( "Unhidden iPXE from system memory map\n" );
+ get_memmap ( &memmap );
}
/** Hide Etherboot startup function */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/firmware/pcbios/memmap.c
^
|
@@ -63,6 +63,10 @@
static struct e820_entry __bss16 ( e820buf );
#define e820buf __use_data16 ( e820buf )
+/** We are running during POST; inhibit INT 15,e820 and INT 15,e801 */
+uint8_t __bss16 ( memmap_post );
+#define memmap_post __use_data16 ( memmap_post )
+
/**
* Get size of extended memory via INT 15,e801
*
@@ -74,6 +78,12 @@
unsigned int flags;
unsigned int extmem;
+ /* Inhibit INT 15,e801 during POST */
+ if ( memmap_post ) {
+ DBG ( "INT 15,e801 not available during POST\n" );
+ return 0;
+ }
+
__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
"int $0x15\n\t"
"pushfw\n\t"
@@ -164,6 +174,12 @@
unsigned int flags;
unsigned int discard_D;
+ /* Inhibit INT 15,e820 during POST */
+ if ( memmap_post ) {
+ DBG ( "INT 15,e820 not available during POST\n" );
+ return -ENOTTY;
+ }
+
/* Clear the E820 buffer. Do this once before starting,
* rather than on each call; some BIOSes rely on the contents
* being preserved between calls.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/interface/pxe/pxe_tftp.c
^
|
@@ -72,6 +72,17 @@
}
/**
+ * Check flow control window
+ *
+ * @v pxe_tftp PXE TFTP connection
+ * @ret len Length of window
+ */
+static size_t pxe_tftp_xfer_window ( struct pxe_tftp_connection *pxe_tftp ) {
+
+ return pxe_tftp->blksize;
+}
+
+/**
* Receive new data
*
* @v pxe_tftp PXE TFTP connection
@@ -128,6 +139,8 @@
static struct interface_operation pxe_tftp_xfer_ops[] = {
INTF_OP ( xfer_deliver, struct pxe_tftp_connection *,
pxe_tftp_xfer_deliver ),
+ INTF_OP ( xfer_window, struct pxe_tftp_connection *,
+ pxe_tftp_xfer_window ),
INTF_OP ( intf_close, struct pxe_tftp_connection *, pxe_tftp_close ),
};
@@ -167,19 +180,19 @@
/* Reset PXE TFTP connection structure */
memset ( &pxe_tftp, 0, sizeof ( pxe_tftp ) );
intf_init ( &pxe_tftp.xfer, &pxe_tftp_xfer_desc, NULL );
+ if ( blksize < TFTP_DEFAULT_BLKSIZE )
+ blksize = TFTP_DEFAULT_BLKSIZE;
+ pxe_tftp.blksize = blksize;
pxe_tftp.rc = -EINPROGRESS;
/* Construct URI string */
address.s_addr = ipaddress;
if ( ! port )
port = htons ( TFTP_PORT );
- if ( blksize < TFTP_DEFAULT_BLKSIZE )
- blksize = TFTP_DEFAULT_BLKSIZE;
- snprintf ( uri_string, sizeof ( uri_string ),
- "tftp%s://%s:%d%s%s?blksize=%zd",
- sizeonly ? "size" : "",
- inet_ntoa ( address ), ntohs ( port ),
- ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize );
+ snprintf ( uri_string, sizeof ( uri_string ), "tftp%s://%s:%d%s%s",
+ sizeonly ? "size" : "", inet_ntoa ( address ),
+ ntohs ( port ), ( ( filename[0] == '/' ) ? "" : "/" ),
+ filename );
DBG ( " %s", uri_string );
/* Open PXE TFTP connection */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/prefix/exeprefix.S
^
|
@@ -114,7 +114,7 @@
call alloc_basemem
xorl %esi, %esi
movl $EXE_DECOMPRESS_ADDRESS, %edi
- xorl %ebp, %ebp
+ orl $0xffffffff, %ebp /* Allow arbitrary relocation */
call install_prealloc
/* Set up real-mode stack */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/prefix/libprefix.S
^
|
@@ -545,8 +545,7 @@
* Free space allocated with alloc_basemem.
*
* Parameters:
- * %ax : .text16 segment address
- * %bx : .data16 segment address
+ * none (.text16 segment address is implicit in %cs)
* Returns:
* %ax : 0 if successfully freed
* Corrupts:
@@ -559,14 +558,14 @@
free_basemem:
/* Preserve registers */
pushw %fs
+ pushw %ax
/* Check FBMS counter */
- pushw %ax
+ movw %cs, %ax
shrw $6, %ax
pushw $0x40
popw %fs
cmpw %ax, %fs:0x13
- popw %ax
jne 1f
/* Check hooked interrupt count */
@@ -574,6 +573,7 @@
jne 1f
/* OK to free memory */
+ movw %cs, %ax
addw $_text16_memsz_pgh, %ax
addw $_data16_memsz_pgh, %ax
shrw $6, %ax
@@ -581,6 +581,7 @@
xorw %ax, %ax
1: /* Restore registers and return */
+ popw %ax
popw %fs
ret
.size free_basemem, . - free_basemem
@@ -621,7 +622,7 @@
/* Image destination = default */
xorl %edi, %edi
/* Allow arbitrary relocation */
- xorl %ebp, %ebp
+ orl $0xffffffff, %ebp
/* Install text and data segments */
call install_prealloc
/* Restore registers and return */
@@ -641,7 +642,9 @@
* %bx : .data16 segment address
* %esi : Image source physical address (or zero for %cs:0000)
* %edi : Decompression temporary area physical address (or zero for default)
- * %ebp : Maximum end address for relocation (or zero for no maximum)
+ * %ebp : Maximum end address for relocation
+ * - 0xffffffff for no maximum
+ * - 0x00000000 to inhibit use of INT 15,e820 and INT 15,e801
* Corrupts:
* none
****************************************************************************
@@ -795,6 +798,13 @@
movw %ax, (init_librm_vector+2)
lcall *init_librm_vector
+ /* Inhibit INT 15,e820 and INT 15,e801 if applicable */
+ testl %ebp, %ebp
+ jnz 1f
+ incb memmap_post
+ decl %ebp
+1:
+
/* Call relocate() to determine target address for relocation.
* relocate() will return with %esi, %edi and %ecx set up
* ready for the copy to the new location.
@@ -872,8 +882,7 @@
* Uninstall all text and data segments.
*
* Parameters:
- * %ax : .text16 segment address
- * %bx : .data16 segment address
+ * none (.text16 segment address is implicit in %cs)
* Returns:
* none
* Corrupts:
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/prefix/lkrnprefix.S
^
|
@@ -231,9 +231,12 @@
movzwl %sp, %edx
no_cmd_line:
- /* Retrieve initrd pointer and size */
- movl %ds:ramdisk_image, %ebp
- movl %ds:ramdisk_size, %ecx
+ /* Calculate maximum relocation address */
+ movl ramdisk_image, %ebp
+ testl %ebp, %ebp
+ jnz 1f
+ orl $0xffffffff, %ebp /* Allow arbitrary relocation if no initrd */
+1:
/* Install iPXE */
call alloc_basemem
@@ -251,6 +254,10 @@
lret
.section ".text16", "awx", @progbits
1:
+ /* Retrieve initrd pointer and size */
+ movl ramdisk_image, %ebp
+ movl ramdisk_size, %ecx
+
/* Set up %ds for access to .data16 */
movw %bx, %ds
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/prefix/nbiprefix.S
^
|
@@ -54,6 +54,10 @@
/* Install iPXE */
call install
+ /* Set up real-mode stack */
+ movw %bx, %ss
+ movw $_estack16, %sp
+
/* Jump to .text16 segment */
pushw %ax
pushw $1f
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/prefix/romprefix.S
^
|
@@ -23,6 +23,7 @@
( PMM_HANDLE_BASE | 0x00001000 )
#define PMM_HANDLE_BASE_DECOMPRESS_TO \
( PMM_HANDLE_BASE | 0x00002000 )
+#define PCI_FUNC_MASK 0x07
/* ROM banner timeout. Based on the configurable BANNER_TIMEOUT in
* config.h, but converted to a number of (18Hz) timer ticks, and
@@ -422,6 +423,9 @@
xorw %di, %di
cs rep movsb
+ /* Skip prompt if this is not the first PCI function */
+ testb $PCI_FUNC_MASK, init_pci_busdevfn
+ jnz no_shell
/* Prompt for POST-time shell */
movw $init_message_prompt, %si
xorw %di, %di
@@ -440,15 +444,19 @@
movw $init_message_done, %si
call print_message
popf
- jnz 2f
+ jnz no_shell
/* Ctrl-B was pressed: invoke iPXE. The keypress will be
* picked up by the initial shell prompt, and we will drop
* into a shell.
*/
- movl $0xa0000, %ebp /* Inhibit relocation during POST */
+ xorl %ebp, %ebp /* Inhibit use of INT 15,e820 and INT 15,e801 */
pushw %cs
call exec
-2:
+no_shell:
+ movb $( '\n' ), %al
+ xorw %di, %di
+ call print_character
+
/* Restore registers */
popw %gs
popw %fs
@@ -595,7 +603,7 @@
*
*/
init_pci_busdevfn:
- .word 0xffff
+ .word 0
.size init_pci_busdevfn, . - init_pci_busdevfn
/* Image source area
@@ -630,7 +638,7 @@
* Called by the PnP BIOS when it wants to boot us.
*/
bev_entry:
- xorl %ebp, %ebp /* Allow relocation */
+ orl $0xffffffff, %ebp /* Allow arbitrary relocation */
pushw %cs
call exec
lret
@@ -665,7 +673,7 @@
/* Leave keypress in buffer and start iPXE. The keypress will
* cause the usual initial Ctrl-B prompt to be skipped.
*/
- xorl %ebp, %ebp /* Allow relocation */
+ orl $0xffffffff, %ebp /* Allow arbitrary relocation */
pushw %cs
call exec
1: /* Try to call original INT 19 vector */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/arch/i386/prefix/undiloader.S
^
|
@@ -31,7 +31,7 @@
movw %es:14(%di), %ax
movl image_source, %esi
movl decompress_to, %edi
- xorl %ebp, %ebp /* Allow relocation */
+ orl $0xffffffff, %ebp /* Allow arbitrary relocation */
call install_prealloc
popw %di
/* Call UNDI loader C code */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/core/iobuf.c
^
|
@@ -158,3 +158,45 @@
return -ENOBUFS;
}
+/**
+ * Concatenate I/O buffers into a single buffer
+ *
+ * @v list List of I/O buffers
+ * @ret iobuf Concatenated I/O buffer, or NULL on allocation failure
+ *
+ * After a successful concatenation, the list will be empty.
+ */
+struct io_buffer * iob_concatenate ( struct list_head *list ) {
+ struct io_buffer *iobuf;
+ struct io_buffer *tmp;
+ struct io_buffer *concatenated;
+ size_t len = 0;
+
+ /* If the list contains only a single entry, avoid an
+ * unnecessary additional allocation.
+ */
+ if ( list_is_singular ( list ) ) {
+ iobuf = list_first_entry ( list, struct io_buffer, list );
+ INIT_LIST_HEAD ( list );
+ return iobuf;
+ }
+
+ /* Calculate total length */
+ list_for_each_entry ( iobuf, list, list )
+ len += iob_len ( iobuf );
+
+ /* Allocate new I/O buffer */
+ concatenated = alloc_iob_raw ( len, __alignof__ ( *iobuf ), 0 );
+ if ( ! concatenated )
+ return NULL;
+
+ /* Move data to new I/O buffer */
+ list_for_each_entry_safe ( iobuf, tmp, list, list ) {
+ list_del ( &iobuf->list );
+ memcpy ( iob_put ( concatenated, iob_len ( iobuf ) ),
+ iobuf->data, iob_len ( iobuf ) );
+ free_iob ( iobuf );
+ }
+
+ return concatenated;
+}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/core/main.c
^
|
@@ -14,56 +14,18 @@
FILE_LICENCE ( GPL2_OR_LATER );
+#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
#include <ipxe/init.h>
-#include <ipxe/features.h>
-#include <ipxe/shell.h>
-#include <ipxe/image.h>
-#include <ipxe/keys.h>
-#include <ipxe/version.h>
-#include <usr/prompt.h>
#include <usr/autoboot.h>
#include <config/general.h>
-#define NORMAL "\033[0m"
-#define BOLD "\033[1m"
-#define CYAN "\033[36m"
-
-/** The "scriptlet" setting */
-struct setting scriptlet_setting __setting ( SETTING_MISC ) = {
- .name = "scriptlet",
- .description = "Boot scriptlet",
- .tag = DHCP_EB_SCRIPTLET,
- .type = &setting_type_string,
-};
-
-/**
- * Prompt for shell entry
- *
- * @ret enter_shell User wants to enter shell
- */
-static int shell_banner ( void ) {
-
- /* Skip prompt if timeout is zero */
- if ( BANNER_TIMEOUT <= 0 )
- return 0;
-
- /* Prompt user */
- printf ( "\n" );
- return ( prompt ( "Press Ctrl-B for the iPXE command line...",
- ( BANNER_TIMEOUT * 100 ), CTRL_B ) == 0 );
-}
-
/**
* Main entry point
*
* @ret rc Return status code
*/
__asmcall int main ( void ) {
- struct feature *feature;
- struct image *image;
- char *scriptlet;
/* Some devices take an unreasonably long time to initialise */
printf ( PRODUCT_SHORT_NAME " initialising devices..." );
@@ -71,49 +33,7 @@
startup();
printf ( "ok\n" );
- /*
- * Print welcome banner
- *
- *
- * If you wish to brand this build of iPXE, please do so by
- * defining the string PRODUCT_NAME in config/general.h.
- *
- * While nothing in the GPL prevents you from removing all
- * references to iPXE or http://ipxe.org, we prefer you not to
- * do so.
- *
- */
- printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "iPXE %s"
- NORMAL " -- Open Source Network Boot Firmware -- "
- CYAN "http://ipxe.org" NORMAL "\n"
- "Features:", product_version );
- for_each_table_entry ( feature, FEATURES )
- printf ( " %s", feature->name );
- printf ( "\n" );
-
- /* Boot system */
- if ( ( image = first_image() ) != NULL ) {
- /* We have an embedded image; execute it */
- image_exec ( image );
- } else if ( shell_banner() ) {
- /* User wants shell; just give them a shell */
- shell();
- } else {
- fetch_string_setting_copy ( NULL, &scriptlet_setting,
- &scriptlet );
- if ( scriptlet ) {
- /* User has defined a scriptlet; execute it */
- system ( scriptlet );
- free ( scriptlet );
- } else {
- /* Try booting. If booting fails, offer the
- * user another chance to enter the shell.
- */
- autoboot();
- if ( shell_banner() )
- shell();
- }
- }
+ ipxe ( NULL );
shutdown_exit();
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/block/ibft.c
^
|
@@ -37,6 +37,7 @@
#include <ipxe/in.h>
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
+#include <ipxe/vlan.h>
#include <ipxe/dhcp.h>
#include <ipxe/iscsi.h>
#include <ipxe/ibft.h>
@@ -264,6 +265,8 @@
DBG ( "iBFT NIC subnet = /%d\n", nic->subnet_mask_prefix );
/* Extract values from net-device configuration */
+ nic->vlan = cpu_to_le16 ( vlan_tag ( netdev ) );
+ DBG ( "iBFT NIC VLAN = %02x\n", le16_to_cpu ( nic->vlan ) );
if ( ( rc = ll_protocol->eth_addr ( netdev->ll_addr,
nic->mac_address ) ) != 0 ) {
DBG ( "Could not determine iBFT MAC: %s\n", strerror ( rc ) );
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/3c509.h
^
|
@@ -77,7 +77,7 @@
/**************************************************************************
*
* These define the EEPROM data structure. They are used in the probe
- * function to verify the existance of the adapter after having sent
+ * function to verify the existence of the adapter after having sent
* the ID_Sequence.
*
* There are others but only the ones we use are defined here.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/3c515.c
^
|
@@ -656,7 +656,7 @@
corkscrew_found_device(int ioaddr, int irq,
int product_index, int options, struct nic *nic)
{
- /* Direct copy from Becker 3c515.c with unecessary parts removed */
+ /* Direct copy from Becker 3c515.c with unnecessary parts removed */
vp->product_name = "3c515";
vp->options = options;
if (options >= 0) {
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/3c595.c
^
|
@@ -127,7 +127,7 @@
S_TX_COMPLETE | S_TX_AVAIL, BASE + VX_COMMAND);
/*
- * Attempt to get rid of any stray interrupts that occured during
+ * Attempt to get rid of any stray interrupts that occurred during
* configuration. On the i386 this isn't possible because one may
* already be queued. However, a single stray interrupt is
* unimportant.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/amd8111e.h
^
|
@@ -574,7 +574,7 @@
#define CSTATE 1
#define SSTATE 2
-/* amd8111e decriptor flag definitions */
+/* amd8111e descriptor flag definitions */
typedef enum {
OWN_BIT = (1 << 15),
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/cs89x0.c
^
|
@@ -58,7 +58,7 @@
Fri Nov 22 23:00:00 1996 Markus Gutschke <gutschk@math.uni-muenster.de>
* read the manuals for the CS89x0 chipsets and took note of all the
- changes that will be neccessary in order to adapt Russel Nelson's code
+ changes that will be necessary in order to adapt Russel Nelson's code
to the requirements of a BOOT-Prom
* 6
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/davicom.c
^
|
@@ -213,11 +213,11 @@
phy_write_1bit(io_dcr9, PHY_DATA_1);
phy_write_1bit(io_dcr9, PHY_DATA_0);
- /* Send Phy addres */
+ /* Send Phy address */
for (i=0x10; i>0; i=i>>1)
phy_write_1bit(io_dcr9, phy_addr&i ? PHY_DATA_1: PHY_DATA_0);
- /* Send register addres */
+ /* Send register address */
for (i=0x10; i>0; i=i>>1)
phy_write_1bit(io_dcr9, location&i ? PHY_DATA_1: PHY_DATA_0);
@@ -257,11 +257,11 @@
phy_write_1bit(io_dcr9, PHY_DATA_0);
phy_write_1bit(io_dcr9, PHY_DATA_1);
- /* Send Phy addres */
+ /* Send Phy address */
for (i=0x10; i>0; i=i>>1)
phy_write_1bit(io_dcr9, phy_addr&i ? PHY_DATA_1: PHY_DATA_0);
- /* Send register addres */
+ /* Send register address */
for (i=0x10; i>0; i=i>>1)
phy_write_1bit(io_dcr9, location&i ? PHY_DATA_1: PHY_DATA_0);
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/dmfe.c
^
|
@@ -261,15 +261,15 @@
db->cr0_data = 0;
db->dm910x_chk_mode = 1; /* Enter the check mode */
}
- /* Initilize DM910X board */
+ /* Initialize DM910X board */
dmfe_init_dm910x(nic);
return;
}
-/* Initilize DM910X board
+/* Initialize DM910X board
* Reset DM910X board
- * Initilize TX/Rx descriptor chain structure
+ * Initialize TX/Rx descriptor chain structure
* Send the set-up frame
* Enable Tx/Rx machine
*/
@@ -307,7 +307,7 @@
if (!(db->media_mode & DMFE_AUTO))
db->op_mode = db->media_mode; /* Force Mode */
- /* Initiliaze Transmit/Receive decriptor and CR3/4 */
+ /* Initiliaze Transmit/Receive descriptor and CR3/4 */
dmfe_descriptor_init(nic, ioaddr);
/* tx descriptor start pointer */
@@ -572,7 +572,7 @@
/*
* Send a setup frame for DM9132
- * This setup frame initilize DM910X addres filter mode
+ * This setup frame initialize DM910X address filter mode
*/
static void dm9132_id_table(struct nic *nic __unused)
@@ -623,7 +623,7 @@
/*
* Send a setup frame for DM9102/DM9102A
- * This setup frame initilize DM910X addres filter mode
+ * This setup frame initialize DM910X address filter mode
*/
static void send_filter_frame(struct nic *nic)
@@ -903,13 +903,13 @@
phy_write_1bit(ioaddr, PHY_DATA_0);
phy_write_1bit(ioaddr, PHY_DATA_1);
- /* Send Phy addres */
+ /* Send Phy address */
for (i = 0x10; i > 0; i = i >> 1)
phy_write_1bit(ioaddr,
phy_addr & i ? PHY_DATA_1 :
PHY_DATA_0);
- /* Send register addres */
+ /* Send register address */
for (i = 0x10; i > 0; i = i >> 1)
phy_write_1bit(ioaddr,
offset & i ? PHY_DATA_1 :
@@ -959,13 +959,13 @@
phy_write_1bit(ioaddr, PHY_DATA_1);
phy_write_1bit(ioaddr, PHY_DATA_0);
- /* Send Phy addres */
+ /* Send Phy address */
for (i = 0x10; i > 0; i = i >> 1)
phy_write_1bit(ioaddr,
phy_addr & i ? PHY_DATA_1 :
PHY_DATA_0);
- /* Send register addres */
+ /* Send register address */
for (i = 0x10; i > 0; i = i >> 1)
phy_write_1bit(ioaddr,
offset & i ? PHY_DATA_1 :
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/eepro100.c
^
|
@@ -910,7 +910,7 @@
* Initial allocation & initialization of the rx ring.
*
* @v netdev Device of rx ring.
- * @ret rc Non-zero if error occured
+ * @ret rc Non-zero if error occurred
*/
static int ifec_rx_setup ( struct net_device *netdev )
{
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/epic100.c
^
|
@@ -250,7 +250,7 @@
outl(tmp, txcon);
- /* Give adress of RX and TX ring to the chip */
+ /* Give address of RX and TX ring to the chip */
outl(virt_to_le32desc(&rx_ring), prcdar);
outl(virt_to_le32desc(&tx_ring), ptcdar);
@@ -365,7 +365,7 @@
* Arguments: none
*
* returns: 1 if a packet was received.
- * 0 if no pacet was received.
+ * 0 if no packet was received.
* side effects:
* returns the packet in the array nic->packet.
* returns the length of the packet in nic->packetlen.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/epic100.h
^
|
@@ -64,7 +64,7 @@
#define INTR_RX_STATUS_OK (0x00008000) /* rx status valid. NI */
#define INTR_PCI_TGT_ABT (0x00004000) /* PCI Target abort */
#define INTR_PCI_MASTER_ABT (0x00002000) /* PCI Master abort */
-#define INTR_PCI_PARITY_ERR (0x00001000) /* PCI adress parity error */
+#define INTR_PCI_PARITY_ERR (0x00001000) /* PCI address parity error */
#define INTR_PCI_DATA_ERR (0x00000800) /* PCI data parity error */
#define INTR_RX_THR_CROSSED (0x00000400) /* rx copy threshold crossed */
#define INTR_CNTFULL (0x00000200) /* Counter overflow */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/etherfabric.c
^
|
@@ -1566,7 +1566,7 @@
efab_dword_t md_stat;
int count;
- /* wait upto 10ms */
+ /* wait up to 10ms */
for (count = 0; count < 1000; count++) {
falcon_readl ( efab, &md_stat, FCN_MD_STAT_REG_KER );
if ( EFAB_DWORD_FIELD ( md_stat, FCN_MD_BSY ) == 0 ) {
@@ -2195,7 +2195,7 @@
falcon_xmac_writel ( efab, ®, FCN_XX_PWR_RST_REG_MAC );
/* Give some time for the link to establish */
- for (count = 0; count < 1000; count++) { /* wait upto 10ms */
+ for (count = 0; count < 1000; count++) { /* wait up to 10ms */
falcon_xmac_readl ( efab, ®, FCN_XX_PWR_RST_REG_MAC );
if ( EFAB_DWORD_FIELD ( reg, FCN_XX_RST_XX_EN ) == 0 ) {
falcon_setup_xaui ( efab );
@@ -3395,7 +3395,7 @@
falcon_read ( efab, ®, FCN_SRM_CFG_REG_KER );
if ( !EFAB_OWORD_FIELD ( reg, FCN_SRAM_OOB_BT_INIT_EN ) )
return 0;
- } while (++count < 20); /* wait upto 0.4 sec */
+ } while (++count < 20); /* wait up to 0.4 sec */
EFAB_ERR ( "timed out waiting for SRAM reset\n");
return -ETIMEDOUT;
@@ -3426,7 +3426,7 @@
falcon_write ( efab, ®, FCN_RX_DC_CFG_REG_KER );
/* Set number of RSS CPUs
- * bug7244: Increase filter depth to reduce RX_RESET likelyhood
+ * bug7244: Increase filter depth to reduce RX_RESET likelihood
*/
EFAB_POPULATE_OWORD_5 ( reg,
FCN_NUM_KER, 0,
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/forcedeth.c
^
|
@@ -998,7 +998,7 @@
DBG ( "forcedeth_poll: status = %#04x\n", status );
- /* Link change interrupt occured. Call always if link is down,
+ /* Link change interrupt occurred. Call always if link is down,
* to give auto-neg a chance to finish */
if ( ( status & NVREG_IRQ_LINK ) || ! ( netdev_link_ok ( netdev ) ) )
forcedeth_link_status ( netdev );
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/intel.c
^
|
@@ -945,6 +945,7 @@
PCI_ROM ( 0x8086, 0x1525, "82567v-4", "82567V-4", 0 ),
PCI_ROM ( 0x8086, 0x1526, "82576-5", "82576", 0 ),
PCI_ROM ( 0x8086, 0x1527, "82580-f2", "82580 Fiber", 0 ),
+ PCI_ROM ( 0x8086, 0x1533, "i210", "I210", 0 ),
PCI_ROM ( 0x8086, 0x294c, "82566dc-2", "82566DC-2", 0 ),
PCI_ROM ( 0x8086, 0x2e6e, "cemedia", "CE Media Processor", 0 ),
};
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/myri10ge.c
^
|
@@ -719,7 +719,7 @@
return 0;
}
- /* Initilize NonVolatile Storage state. */
+ /* Initialize NonVolatile Storage state. */
priv->nvs.word_len_log2 = 0;
priv->nvs.size = hdr.eeprom_len;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/p80211hdr.h
^
|
@@ -258,7 +258,7 @@
/*================================================================*/
/* Function Declarations */
-/* Frame and header lenght macros */
+/* Frame and header length macros */
#define WLAN_CTL_FRAMELEN(fstype) (\
(fstype) == WLAN_FSTYPE_BLOCKACKREQ ? 24 : \
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/pcnet32.c
^
|
@@ -407,7 +407,7 @@
/*
* On selected chips turn on the BCR18:NOUFLO bit. This stops transmit
* starting until the packet is loaded. Strike one for reliability, lose
- * one for latency - although on PCI this isnt a big loss. Older chips
+ * one for latency - although on PCI this isn't a big loss. Older chips
* have FIFO's smaller than a packet, so you can't do this.
* Turn on BCR18:BurstRdEn and BCR18:BurstWrEn.
*/
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/sis190.h
^
|
@@ -77,7 +77,7 @@
IntrStatus = 0x20,
IntrMask = 0x24,
IntrControl = 0x28,
- IntrTimer = 0x2c, // unused (Interupt Timer)
+ IntrTimer = 0x2c, // unused (Interrupt Timer)
PMControl = 0x30, // unused (Power Mgmt Control/Status)
rsv2 = 0x34, // reserved
ROMControl = 0x38,
@@ -218,7 +218,7 @@
RxSizeMask = 0x0000ffff
/*
* The asic could apparently do vlan, TSO, jumbo (sis191 only) and
- * provide two (unused with Linux) Tx queues. No publically
+ * provide two (unused with Linux) Tx queues. No publicly
* available documentation alas.
*/
};
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/sis900.c
^
|
@@ -328,7 +328,7 @@
*
* Side effects:
* leaves the ioaddress of the sis900 chip in the variable ioaddr.
- * leaves the sis900 initialized, and ready to recieve packets.
+ * leaves the sis900 initialized, and ready to receive packets.
*
* Returns: struct nic *: pointer to NIC data structure
*/
@@ -394,7 +394,7 @@
mii_status = sis900_mdio_read(phy_addr, MII_STATUS);
if (mii_status == 0xffff || mii_status == 0x0000)
- /* the mii is not accessable, try next one */
+ /* the mii is not accessible, try next one */
continue;
phy_id0 = sis900_mdio_read(phy_addr, MII_PHY_ID0);
@@ -508,7 +508,7 @@
/*
Read and write the MII management registers using software-generated
serial MDIO protocol. Note that the command bits and data bits are
- send out seperately
+ sent out separately
*/
static void sis900_mdio_idle(long mdio_addr)
@@ -1171,8 +1171,8 @@
*
* Arguments: struct nic *nic: NIC data structure
*
- * Returns: 1 if a packet was recieved.
- * 0 if no pacet was recieved.
+ * Returns: 1 if a packet was received.
+ * 0 if no packet was received.
*
* Side effects:
* Returns (copies) the packet to the array nic->packet.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/skge.h
^
|
@@ -1095,7 +1095,7 @@
PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */
PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */
- PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */
+ PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occurred */
PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */
PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */
PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */
@@ -1778,8 +1778,8 @@
GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */
GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */
GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */
- GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */
- GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */
+ GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occurred */
+ GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occurred */
GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */
GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */
@@ -2284,7 +2284,7 @@
XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */
XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */
XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */
- XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */
+ XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occurred */
XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */
XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */
XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/sky2.c
^
|
@@ -783,7 +783,7 @@
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR);
sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
- /* On chips without ram buffer, pause is controled by MAC level */
+ /* On chips without ram buffer, pause is controlled by MAC level */
if (!(hw->flags & SKY2_HW_RAM_BUFFER)) {
sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8);
sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8);
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/sky2.h
^
|
@@ -1056,7 +1056,7 @@
PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */
PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */
- PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */
+ PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occurred */
PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */
PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */
PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */
@@ -1587,8 +1587,8 @@
GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */
GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */
GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */
- GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */
- GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */
+ GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occurred */
+ GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occurred */
GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */
GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/smc9000.h
^
|
@@ -107,7 +107,7 @@
#define RPC_LED_10 (0x02) // LED = 10Mbps link detect
#define RPC_LED_FD (0x03) // LED = Full Duplex Mode
#define RPC_LED_TX_RX (0x04) // LED = TX or RX packet occurred
-#define RPC_LED_100 (0x05) // LED = 100Mbps link dectect
+#define RPC_LED_100 (0x05) // LED = 100Mbps link detect
#define RPC_LED_TX (0x06) // LED = TX packet occurred
#define RPC_LED_RX (0x07) // LED = RX packet occurred
#define RPC_DEFAULT (RPC_ANEG | (RPC_LED_100 << RPC_LSXA_SHFT) | (RPC_LED_FD << RPC_LSXB_SHFT) | RPC_SPEED | RPC_DPLX)
@@ -125,7 +125,7 @@
#define RPC_LED_10 (0x02) // LED = 10Mbps link detect
#define RPC_LED_FD (0x03) // LED = Full Duplex Mode
#define RPC_LED_TX_RX (0x04) // LED = TX or RX packet occurred
-#define RPC_LED_100 (0x05) // LED = 100Mbps link dectect
+#define RPC_LED_100 (0x05) // LED = 100Mbps link detect
#define RPC_LED_TX (0x06) // LED = TX packet occurred
#define RPC_LED_RX (0x07) // LED = RX packet occurred
#define RPC_DEFAULT (RPC_ANEG | (RPC_LED_100 << RPC_LSXA_SHFT) | (RPC_LED_FD << RPC_LSXB_SHFT) | RPC_SPEED | RPC_DPLX)
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/sundance.c
^
|
@@ -258,7 +258,7 @@
const char *nic_name;
/* Frequently used values */
- unsigned int cur_rx; /* Producer/consumer ring indicies */
+ unsigned int cur_rx; /* Producer/consumer ring indices */
unsigned int mtu;
/* These values keep track of the tranceiver/media in use */
@@ -441,7 +441,7 @@
/**************************************************************************
POLL - Wait for a frame
***************************************************************************/
-static int sundance_poll(struct nic *nic, int retreive)
+static int sundance_poll(struct nic *nic, int retrieve)
{
/* return true if there's an ethernet packet ready to read */
/* nic->packet should contain data on return */
@@ -455,7 +455,7 @@
return 0;
/* There is a packet ready */
- if(!retreive)
+ if(!retrieve)
return 1;
intr_status = inw(nic->ioaddr + IntrStatus);
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/tg3/tg3.h
^
|
@@ -298,6 +298,7 @@
#define ASIC_REV_57780 0x57780
#define ASIC_REV_5717 0x5717
#define ASIC_REV_57765 0x57785
+#define ASIC_REV_57766 0x57766
#define ASIC_REV_5719 0x5719
#define ASIC_REV_5720 0x5720
#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
@@ -1215,6 +1216,8 @@
#define TG3_CPMU_LNK_AWARE_PWRMD 0x00003610
#define CPMU_LNK_AWARE_MACCLK_MASK 0x001f0000
#define CPMU_LNK_AWARE_MACCLK_6_25 0x00130000
+
+#define TG3_CPMU_D0_CLCK_POLICY 0x00003614
/* 0x3614 --> 0x361c unused */
#define TG3_CPMU_HST_ACC 0x0000361c
@@ -1225,6 +1228,9 @@
#define TG3_CPMU_CLCK_ORIDE 0x00003624
#define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000
+#define TG3_CPMU_CLCK_ORIDE_EN 0x00003628
+#define CPMU_CLCK_ORIDE_MAC_CLCK_ORIDE_EN 0x00002000
+
#define TG3_CPMU_CLCK_STAT 0x00003630
#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/tg3/tg3_hw.c
^
|
@@ -322,7 +322,7 @@
}
if ((nic_cfg & NIC_SRAM_DATA_CFG_APE_ENABLE) &&
- tg3_flag(tp, 5750_PLUS))
+ tg3_flag(tp, ENABLE_ASF))
tg3_flag_set(tp, ENABLE_APE);
if (cfg2 & (1 << 17))
@@ -466,6 +466,7 @@
tg3_flag_set(tp, 5717_PLUS);
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57766 ||
tg3_flag(tp, 5717_PLUS))
tg3_flag_set(tp, 57765_PLUS);
@@ -1465,6 +1466,13 @@
tw32(TG3_CPMU_CLCK_ORIDE, val & ~CPMU_CLCK_ORIDE_MAC_ORIDE_EN);
}
+ if (tg3_flag(tp, CPMU_PRESENT)) {
+ tw32(TG3_CPMU_D0_CLCK_POLICY, 0);
+ val = tr32(TG3_CPMU_CLCK_ORIDE_EN);
+ tw32(TG3_CPMU_CLCK_ORIDE_EN,
+ val | CPMU_CLCK_ORIDE_MAC_CLCK_ORIDE_EN);
+ }
+
return 0;
}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/tlan.c
^
|
@@ -202,7 +202,7 @@
unsigned short vendor_id; /* PCI Vendor code */
unsigned short dev_id; /* PCI Device code */
const char *nic_name;
- unsigned int cur_rx, dirty_rx; /* Producer/consumer ring indicies */
+ unsigned int cur_rx, dirty_rx; /* Producer/consumer ring indices */
unsigned rx_buf_sz; /* Based on mtu + Slack */
struct TLanList *txList;
u32 txHead;
@@ -1085,11 +1085,11 @@
* for this device.
* phy The address of the PHY to be queried.
* reg The register whose contents are to be
-* retreived.
+* retrieved.
* val A pointer to a variable to store the
* retrieved value.
*
-* This function uses the TLAN's MII bus to retreive the contents
+* This function uses the TLAN's MII bus to retrieve the contents
* of a given register on a PHY. It sends the appropriate info
* and then reads the 16-bit register value from the MII bus via
* the TLAN SIO register.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/via-rhine.c
^
|
@@ -288,7 +288,7 @@
*/
#define EECSR_EEPR 0x80 /* eeprom programed status, 73h means programed */
-#define EECSR_EMBP 0x40 /* eeprom embeded programming */
+#define EECSR_EMBP 0x40 /* eeprom embedded programming */
#define EECSR_AUTOLD 0x20 /* eeprom content reload */
#define EECSR_DPM 0x10 /* eeprom direct programming */
#define EECSR_CS 0x08 /* eeprom CS pin */
@@ -322,7 +322,7 @@
* Bits in the CFGA register
*/
-#define CFGA_EELOAD 0x80 /* enable eeprom embeded and direct programming */
+#define CFGA_EELOAD 0x80 /* enable eeprom embedded and direct programming */
#define CFGA_JUMPER 0x40
#define CFGA_MTGPIO 0x08
#define CFGA_T10EN 0x02
@@ -693,7 +693,7 @@
static void rhine_init_ring (struct nic *dev);
static void rhine_disable (struct nic *nic);
static void rhine_reset (struct nic *nic);
-static int rhine_poll (struct nic *nic, int retreive);
+static int rhine_poll (struct nic *nic, int retrieve);
static void rhine_transmit (struct nic *nic, const char *d, unsigned int t,
unsigned int s, const char *p);
static void reload_eeprom(int ioaddr);
@@ -1286,7 +1286,7 @@
#define IOSYNC do { inb(nic->ioaddr + StationAddr); } while (0)
static int
-rhine_poll (struct nic *nic, int retreive)
+rhine_poll (struct nic *nic, int retrieve)
{
struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
int rxstatus, good = 0;;
@@ -1295,7 +1295,7 @@
{
unsigned int intr_status;
/* There is a packet ready */
- if(!retreive)
+ if(!retrieve)
return 1;
intr_status = inw(nic->ioaddr + IntrStatus);
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/via-velocity.c
^
|
@@ -125,7 +125,7 @@
/* IP_byte_align[] is used for IP header DWORD byte aligned
0: indicate the IP header won't be DWORD byte aligned.(Default) .
1: indicate the IP header will be DWORD byte aligned.
- In some enviroment, the IP header should be DWORD byte aligned,
+ In some environment, the IP header should be DWORD byte aligned,
or the packet will be droped when we receive it. (eg: IPVS)
*/
VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned");
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/via-velocity.h
^
|
@@ -878,7 +878,7 @@
* Bits in the EECSR register
*/
-#define EECSR_EMBP 0x40 /* eeprom embeded programming */
+#define EECSR_EMBP 0x40 /* eeprom embedded programming */
#define EECSR_RELOAD 0x20 /* eeprom content reload */
#define EECSR_DPM 0x10 /* eeprom direct programming */
#define EECSR_ECS 0x08 /* eeprom CS pin */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/virtio-net.c
^
|
@@ -69,7 +69,7 @@
* Linux source.
*/
-/* Virtqueue indicies */
+/* Virtqueue indices */
enum {
RX_INDEX = 0,
TX_INDEX,
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/drivers/net/vxge/vxge_main.c
^
|
@@ -252,7 +252,7 @@
/*
* vxge_irq - enable or Disable interrupts
*
- * @netdev netdevice sturcture reference
+ * @netdev netdevice structure reference
* @action requested interrupt action
*/
static void vxge_irq(struct net_device *netdev __unused, int action)
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/image/efi_image.c
^
|
@@ -21,7 +21,13 @@
#include <errno.h>
#include <stdlib.h>
+#include <wchar.h>
#include <ipxe/efi/efi.h>
+#include <ipxe/efi/efi_snp.h>
+#include <ipxe/efi/efi_download.h>
+#include <ipxe/efi/efi_file.h>
+#include <ipxe/efi/efi_driver.h>
+#include <ipxe/efi/efi_strings.h>
#include <ipxe/image.h>
#include <ipxe/init.h>
#include <ipxe/features.h>
@@ -34,79 +40,75 @@
EFI_LOADED_IMAGE_PROTOCOL_GUID;
/**
- * Create a Unicode command line for the image
+ * Create device path for image
+ *
+ * @v image EFI image
+ * @v parent Parent device path
+ * @ret path Device path, or NULL on failure
+ *
+ * The caller must eventually free() the device path.
+ */
+static EFI_DEVICE_PATH_PROTOCOL * efi_image_path ( struct image *image,
+ EFI_DEVICE_PATH *parent ) {
+ EFI_DEVICE_PATH_PROTOCOL *path;
+ FILEPATH_DEVICE_PATH *filepath;
+ EFI_DEVICE_PATH_PROTOCOL *end;
+ size_t name_len;
+ size_t prefix_len;
+ size_t filepath_len;
+ size_t len;
+
+ /* Calculate device path lengths */
+ end = efi_devpath_end ( parent );
+ prefix_len = ( ( void * ) end - ( void * ) parent );
+ name_len = strlen ( image->name );
+ filepath_len = ( SIZE_OF_FILEPATH_DEVICE_PATH +
+ ( name_len + 1 /* NUL */ ) * sizeof ( wchar_t ) );
+ len = ( prefix_len + filepath_len + sizeof ( *end ) );
+
+ /* Allocate device path */
+ path = zalloc ( len );
+ if ( ! path )
+ return NULL;
+
+ /* Construct device path */
+ memcpy ( path, parent, prefix_len );
+ filepath = ( ( ( void * ) path ) + prefix_len );
+ filepath->Header.Type = MEDIA_DEVICE_PATH;
+ filepath->Header.SubType = MEDIA_FILEPATH_DP;
+ filepath->Header.Length[0] = ( filepath_len & 0xff );
+ filepath->Header.Length[1] = ( filepath_len >> 8 );
+ efi_snprintf ( filepath->PathName, ( name_len + 1 /* NUL */ ),
+ "%s", image->name );
+ end = ( ( ( void * ) filepath ) + filepath_len );
+ end->Type = END_DEVICE_PATH_TYPE;
+ end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
+ end->Length[0] = sizeof ( *end );
+
+ return path;
+}
+
+/**
+ * Create command line for image
*
* @v image EFI image
- * @v devpath_out Device path to pass to image (output)
- * @v cmdline_out Unicode command line (output)
- * @v cmdline_len_out Length of command line in bytes (output)
- * @ret rc Return status code
+ * @ret cmdline Command line, or NULL on failure
*/
-static int efi_image_make_cmdline ( struct image *image,
- EFI_DEVICE_PATH **devpath_out,
- VOID **cmdline_out,
- UINT32 *cmdline_len_out ) {
- char *uri;
- size_t uri_len;
- FILEPATH_DEVICE_PATH *devpath;
- EFI_DEVICE_PATH *endpath;
- size_t devpath_len;
- CHAR16 *cmdline;
- UINT32 cmdline_len;
- size_t args_len = 0;
- UINT32 i;
-
- /* Get the URI string of the image */
- uri_len = unparse_uri ( NULL, 0, image->uri, URI_ALL ) + 1;
-
- /* Compute final command line length */
- if ( image->cmdline ) {
- args_len = strlen ( image->cmdline ) + 1;
- }
- cmdline_len = args_len + uri_len;
-
- /* Allocate space for the uri, final command line and device path */
- cmdline = malloc ( cmdline_len * sizeof ( CHAR16 ) + uri_len
- + SIZE_OF_FILEPATH_DEVICE_PATH
- + uri_len * sizeof ( CHAR16 )
- + sizeof ( EFI_DEVICE_PATH ) );
+static wchar_t * efi_image_cmdline ( struct image *image ) {
+ wchar_t *cmdline;
+ size_t len;
+
+ len = ( strlen ( image->name ) +
+ ( image->cmdline ?
+ ( 1 /* " " */ + strlen ( image->cmdline ) ) : 0 ) );
+ cmdline = zalloc ( ( len + 1 /* NUL */ ) * sizeof ( wchar_t ) );
if ( ! cmdline )
- return -ENOMEM;
- uri = (char *) ( cmdline + cmdline_len );
- devpath = (FILEPATH_DEVICE_PATH *) ( uri + uri_len );
- endpath = (EFI_DEVICE_PATH *) ( (char *) devpath
- + SIZE_OF_FILEPATH_DEVICE_PATH
- + uri_len * sizeof ( CHAR16 ) );
-
- /* Build the iPXE device path */
- devpath->Header.Type = MEDIA_DEVICE_PATH;
- devpath->Header.SubType = MEDIA_FILEPATH_DP;
- devpath_len = SIZE_OF_FILEPATH_DEVICE_PATH
- + uri_len * sizeof ( CHAR16 );
- devpath->Header.Length[0] = devpath_len & 0xFF;
- devpath->Header.Length[1] = devpath_len >> 8;
- endpath->Type = END_DEVICE_PATH_TYPE;
- endpath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- endpath->Length[0] = 4;
- endpath->Length[1] = 0;
- unparse_uri ( uri, uri_len, image->uri, URI_ALL );
-
- /* Convert to Unicode */
- for ( i = 0 ; i < uri_len ; i++ ) {
- cmdline[i] = uri[i];
- devpath->PathName[i] = uri[i];
- }
- if ( image->cmdline ) {
- cmdline[uri_len - 1] = ' ';
- }
- for ( i = 0 ; i < args_len ; i++ ) {
- cmdline[i + uri_len] = image->cmdline[i];
- }
-
- *devpath_out = &devpath->Header;
- *cmdline_out = cmdline;
- *cmdline_len_out = cmdline_len * sizeof ( CHAR16 );
- return 0;
+ return NULL;
+ efi_snprintf ( cmdline, ( len + 1 /* NUL */ ), "%s%s%s",
+ image->name,
+ ( image->cmdline ? " " : "" ),
+ ( image->cmdline ? image->cmdline : "" ) );
+ return cmdline;
}
/**
@@ -117,19 +119,60 @@
*/
static int efi_image_exec ( struct image *image ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
+ struct efi_snp_device *snpdev;
+ EFI_DEVICE_PATH_PROTOCOL *path;
union {
EFI_LOADED_IMAGE_PROTOCOL *image;
void *interface;
} loaded;
EFI_HANDLE handle;
- EFI_HANDLE device_handle = NULL;
- UINTN exit_data_size;
- CHAR16 *exit_data;
+ wchar_t *cmdline;
EFI_STATUS efirc;
int rc;
+ /* Find an appropriate device handle to use */
+ snpdev = last_opened_snpdev();
+ if ( ! snpdev ) {
+ DBGC ( image, "EFIIMAGE %p could not identify SNP device\n",
+ image );
+ rc = -ENODEV;
+ goto err_no_snpdev;
+ }
+
+ /* Install file I/O protocols */
+ if ( ( rc = efi_file_install ( &snpdev->handle ) ) != 0 ) {
+ DBGC ( image, "EFIIMAGE %p could not install file protocol: "
+ "%s\n", image, strerror ( rc ) );
+ goto err_file_install;
+ }
+
+ /* Install iPXE download protocol */
+ if ( ( rc = efi_download_install ( &snpdev->handle ) ) != 0 ) {
+ DBGC ( image, "EFIIMAGE %p could not install iPXE download "
+ "protocol: %s\n", image, strerror ( rc ) );
+ goto err_download_install;
+ }
+
+ /* Create device path for image */
+ path = efi_image_path ( image, &snpdev->path );
+ if ( ! path ) {
+ DBGC ( image, "EFIIMAGE %p could not create device path\n",
+ image );
+ rc = -ENOMEM;
+ goto err_image_path;
+ }
+
+ /* Create command line for image */
+ cmdline = efi_image_cmdline ( image );
+ if ( ! cmdline ) {
+ DBGC ( image, "EFIIMAGE %p could not create command line\n",
+ image );
+ rc = -ENOMEM;
+ goto err_cmdline;
+ }
+
/* Attempt loading image */
- if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, NULL,
+ if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, path,
user_to_virt ( image->data, 0 ),
image->len, &handle ) ) != 0 ) {
/* Not an EFI image */
@@ -149,22 +192,19 @@
goto err_open_protocol;
}
- /* Pass an iPXE download protocol to the image */
- if ( ( rc = efi_download_install ( &device_handle ) ) != 0 ) {
- DBGC ( image, "EFIIMAGE %p could not install iPXE download "
- "protocol: %s\n", image, strerror ( rc ) );
- goto err_download_install;
- }
- loaded.image->DeviceHandle = device_handle;
- loaded.image->ParentHandle = efi_loaded_image;
- if ( ( rc = efi_image_make_cmdline ( image, &loaded.image->FilePath,
- &loaded.image->LoadOptions,
- &loaded.image->LoadOptionsSize ) ) != 0 )
- goto err_make_cmdline;
+ /* Sanity checks */
+ assert ( loaded.image->ParentHandle == efi_image_handle );
+ assert ( loaded.image->DeviceHandle == snpdev->handle );
+ assert ( loaded.image->LoadOptionsSize == 0 );
+ assert ( loaded.image->LoadOptions == NULL );
+
+ /* Set command line */
+ loaded.image->LoadOptions = cmdline;
+ loaded.image->LoadOptionsSize =
+ ( ( wcslen ( cmdline ) + 1 /* NUL */ ) * sizeof ( wchar_t ) );
/* Start the image */
- if ( ( efirc = bs->StartImage ( handle, &exit_data_size,
- &exit_data ) ) != 0 ) {
+ if ( ( efirc = bs->StartImage ( handle, 0, NULL ) ) != 0 ) {
DBGC ( image, "EFIIMAGE %p returned with status %s\n",
image, efi_strerror ( efirc ) );
rc = EFIRC_TO_RC ( efirc );
@@ -175,17 +215,24 @@
rc = 0;
err_start_image:
- free ( loaded.image->LoadOptions );
- err_make_cmdline:
- efi_download_uninstall ( device_handle );
- err_download_install:
err_open_protocol:
/* Unload the image. We can't leave it loaded, because we
* have no "unload" operation.
*/
- bs->UnloadImage ( handle );
+ if ( ( efirc = bs->UnloadImage ( handle ) ) != 0 ) {
+ DBGC ( image, "EFIIMAGE %p could not unload: %s\n",
+ image, efi_strerror ( efirc ) );
+ }
err_load_image:
-
+ free ( cmdline );
+ err_cmdline:
+ free ( path );
+ err_image_path:
+ efi_download_uninstall ( snpdev->handle );
+ err_download_install:
+ efi_file_uninstall ( snpdev->handle );
+ err_file_install:
+ err_no_snpdev:
return rc;
}
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Guid/FileInfo.h
^
|
@@ -0,0 +1,73 @@
+/** @file
+ Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.SetInfo()
+ and EFI_FILE_PROTOCOL.GetInfo() to set or get generic file information.
+ This GUID is defined in UEFI specification.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __FILE_INFO_H__
+#define __FILE_INFO_H__
+
+FILE_LICENCE ( BSD3 );
+
+#define EFI_FILE_INFO_ID \
+ { \
+ 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct {
+ ///
+ /// The size of the EFI_FILE_INFO structure, including the Null-terminated FileName string.
+ ///
+ UINT64 Size;
+ ///
+ /// The size of the file in bytes.
+ ///
+ UINT64 FileSize;
+ ///
+ /// PhysicalSize The amount of physical space the file consumes on the file system volume.
+ ///
+ UINT64 PhysicalSize;
+ ///
+ /// The time the file was created.
+ ///
+ EFI_TIME CreateTime;
+ ///
+ /// The time when the file was last accessed.
+ ///
+ EFI_TIME LastAccessTime;
+ ///
+ /// The time when the file's contents were last modified.
+ ///
+ EFI_TIME ModificationTime;
+ ///
+ /// The attribute bits for the file.
+ ///
+ UINT64 Attribute;
+ ///
+ /// The Null-terminated name of the file.
+ ///
+ CHAR16 FileName[1];
+} EFI_FILE_INFO;
+
+///
+/// The FileName field of the EFI_FILE_INFO data structure is variable length.
+/// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
+/// be the size of the data structure without the FileName field. The following macro
+/// computes this size correctly no matter how big the FileName array is declared.
+/// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
+///
+#define SIZE_OF_EFI_FILE_INFO OFFSET_OF (EFI_FILE_INFO, FileName)
+
+extern EFI_GUID gEfiFileInfoGuid;
+
+#endif
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Guid/FileSystemInfo.h
^
|
@@ -0,0 +1,65 @@
+/** @file
+ Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.GetInfo()
+ or EFI_FILE_PROTOCOL.SetInfo() to get or set information about the system's volume.
+ This GUID is defined in UEFI specification.
+
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __FILE_SYSTEM_INFO_H__
+#define __FILE_SYSTEM_INFO_H__
+
+FILE_LICENCE ( BSD3 );
+
+#define EFI_FILE_SYSTEM_INFO_ID \
+ { \
+ 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct {
+ ///
+ /// The size of the EFI_FILE_SYSTEM_INFO structure, including the Null-terminated VolumeLabel string.
+ ///
+ UINT64 Size;
+ ///
+ /// TRUE if the volume only supports read access.
+ ///
+ BOOLEAN ReadOnly;
+ ///
+ /// The number of bytes managed by the file system.
+ ///
+ UINT64 VolumeSize;
+ ///
+ /// The number of available bytes for use by the file system.
+ ///
+ UINT64 FreeSpace;
+ ///
+ /// The nominal block size by which files are typically grown.
+ ///
+ UINT32 BlockSize;
+ ///
+ /// The Null-terminated string that is the volume's label.
+ ///
+ CHAR16 VolumeLabel[1];
+} EFI_FILE_SYSTEM_INFO;
+
+///
+/// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
+/// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
+/// to be the size of the data structure without the VolumeLable field. The following macro
+/// computes this size correctly no matter how big the VolumeLable array is declared.
+/// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
+///
+#define SIZE_OF_EFI_FILE_SYSTEM_INFO OFFSET_OF (EFI_FILE_SYSTEM_INFO, VolumeLabel)
+
+extern EFI_GUID gEfiFileSystemInfoGuid;
+
+#endif
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Guid/WinCertificate.h
^
|
@@ -1,7 +1,7 @@
/** @file
GUID for UEFI WIN_CERTIFICATE structure.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -76,7 +76,7 @@
typedef struct {
///
/// This is the standard WIN_CERTIFICATE header, where
- /// wCertificateType is set to WIN_CERT_TYPE_UEFI_GUID.
+ /// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
///
WIN_CERTIFICATE Hdr;
///
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/IndustryStandard/Pci22.h
^
|
@@ -6,7 +6,7 @@
PCI-to-PCI Bridge Architecture Specification, Revision 1.2
PC Card Standard, 8.0
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -221,7 +221,7 @@
#define PCI_IF_16550_MODEM 0x02
#define PCI_IF_16650_MODEM 0x03
#define PCI_IF_16750_MODEM 0x04
-#define PCI_SUBCLASS_SCC_OTHER 0x80
+#define PCI_SUBCLASS_SCC_OTHER 0x80
#define PCI_CLASS_SYSTEM_PERIPHERAL 0x08
#define PCI_SUBCLASS_PIC 0x00
@@ -240,7 +240,7 @@
#define PCI_IF_EISA_TIMER 0x02
#define PCI_SUBCLASS_RTC 0x03
#define PCI_IF_GENERIC_RTC 0x00
-#define PCI_IF_ISA_RTC 0x00
+#define PCI_IF_ISA_RTC 0x01
#define PCI_SUBCLASS_PNP_CONTROLLER 0x04 ///< HotPlug Controller
#define PCI_SUBCLASS_PERIPHERAL_OTHER 0x80
@@ -251,10 +251,12 @@
#define PCI_SUBCLASS_SCAN_CONTROLLER 0x03
#define PCI_SUBCLASS_GAMEPORT 0x04
#define PCI_IF_GAMEPORT 0x00
-#define PCI_IF_GAMEPORT1 0x01
+#define PCI_IF_GAMEPORT1 0x10
#define PCI_SUBCLASS_INPUT_OTHER 0x80
#define PCI_CLASS_DOCKING_STATION 0x0A
+#define PCI_SUBCLASS_DOCKING_GENERIC 0x00
+#define PCI_SUBCLASS_DOCKING_OTHER 0x80
#define PCI_CLASS_PROCESSOR 0x0B
#define PCI_SUBCLASS_PROC_386 0x00
@@ -282,7 +284,7 @@
#define PCI_CLASS_WIRELESS 0x0D
#define PCI_SUBCLASS_IRDA 0x00
#define PCI_SUBCLASS_IR 0x01
-#define PCI_SUBCLASS_RF 0x02
+#define PCI_SUBCLASS_RF 0x10
#define PCI_SUBCLASS_WIRELESS_OTHER 0x80
#define PCI_CLASS_INTELLIGENT_IO 0x0E
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Library/BaseLib.h
^
|
@@ -17,6 +17,8 @@
#ifndef __BASE_LIB__
#define __BASE_LIB__
+FILE_LICENCE ( BSD3 );
+
//
// Definitions for architecture-specific types
//
@@ -1291,7 +1293,7 @@
If Entry is NULL, then ASSERT().
If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
+ If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
of nodes in ListHead, including the ListHead node, is greater than or
equal to PcdMaximumLinkedListLength, then ASSERT().
@@ -1321,7 +1323,7 @@
If Entry is NULL, then ASSERT().
If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
+ If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
of nodes in ListHead, including the ListHead node, is greater than or
equal to PcdMaximumLinkedListLength, then ASSERT().
@@ -1350,7 +1352,7 @@
If List is NULL, then ASSERT().
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
+ If PcdMaximumLinkedListLength is not zero, and the number of nodes
in List, including the List node, is greater than or equal to
PcdMaximumLinkedListLength, then ASSERT().
@@ -1378,8 +1380,8 @@
If Node is NULL, then ASSERT().
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and List contains more than
- PcdMaximumLinkedListLenth nodes, then ASSERT().
+ If PcdMaximumLinkedListLength is not zero, and List contains more than
+ PcdMaximumLinkedListLength nodes, then ASSERT().
If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
@param List A pointer to the head node of a doubly linked list.
@@ -1407,8 +1409,8 @@
If Node is NULL, then ASSERT().
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and List contains more than
- PcdMaximumLinkedListLenth nodes, then ASSERT().
+ If PcdMaximumLinkedListLength is not zero, and List contains more than
+ PcdMaximumLinkedListLength nodes, then ASSERT().
If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
@param List A pointer to the head node of a doubly linked list.
@@ -1434,7 +1436,7 @@
If ListHead is NULL, then ASSERT().
If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
+ If PcdMaximumLinkedListLength is not zero, and the number of nodes
in List, including the List node, is greater than or equal to
PcdMaximumLinkedListLength, then ASSERT().
@@ -1464,7 +1466,7 @@
If Node is NULL, then ASSERT().
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(),
then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
+ If PcdMaximumLinkedListLength is not zero, and the number of nodes
in List, including the List node, is greater than or equal to
PcdMaximumLinkedListLength, then ASSERT().
If PcdVerifyNodeInList is TRUE and Node is not a node in List the and Node is not equal
@@ -1496,7 +1498,7 @@
If Node is NULL, then ASSERT().
If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
+ If PcdMaximumLinkedListLength is not zero, and the number of nodes
in List, including the List node, is greater than or equal to
PcdMaximumLinkedListLength, then ASSERT().
If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
@@ -2343,6 +2345,7 @@
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2376,6 +2379,7 @@
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2409,6 +2413,7 @@
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2443,6 +2448,8 @@
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2505,6 +2512,7 @@
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2538,6 +2546,7 @@
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2571,6 +2580,7 @@
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2605,6 +2615,8 @@
If StartBit is greater than 15, then ASSERT().
If EndBit is greater than 15, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2667,6 +2679,7 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2700,6 +2713,7 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2733,6 +2747,7 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2767,6 +2782,8 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2829,6 +2846,7 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2862,6 +2880,7 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2895,6 +2914,7 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -2929,6 +2949,8 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Operand Operand on which to perform the bitfield operation.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5380,6 +5402,7 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5416,6 +5439,7 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5452,6 +5476,7 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5490,6 +5515,8 @@
If StartBit is greater than 31, then ASSERT().
If EndBit is greater than 31, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5684,6 +5711,7 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5720,6 +5748,7 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5756,6 +5785,7 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
@@ -5793,6 +5823,8 @@
If StartBit is greater than 63, then ASSERT().
If EndBit is greater than 63, then ASSERT().
If EndBit is less than StartBit, then ASSERT().
+ If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
+ If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
@param Index The 32-bit MSR index to write.
@param StartBit The ordinal of the least significant bit in the bit field.
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Pi/PiBootMode.h
^
|
@@ -1,7 +1,7 @@
/** @file
Present the boot mode values in PI.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- PI Version 1.0
+ PI Version 1.2.1A
**/
@@ -35,6 +35,7 @@
#define BOOT_WITH_DEFAULT_SETTINGS 0x04
#define BOOT_ON_S4_RESUME 0x05
#define BOOT_ON_S5_RESUME 0x06
+#define BOOT_WITH_MFG_MODE_SETTINGS 0x07
#define BOOT_ON_S2_RESUME 0x10
#define BOOT_ON_S3_RESUME 0x11
#define BOOT_ON_FLASH_UPDATE 0x12
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Protocol/BlockIo.h
^
|
@@ -0,0 +1,243 @@
+/** @file
+ Block IO protocol as defined in the UEFI 2.0 specification.
+
+ The Block IO protocol is used to abstract block devices like hard drives,
+ DVD-ROMs and floppy drives.
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __BLOCK_IO_H__
+#define __BLOCK_IO_H__
+
+FILE_LICENCE ( BSD3 );
+
+#define EFI_BLOCK_IO_PROTOCOL_GUID \
+ { \
+ 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL;
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL_GUID
+
+///
+/// Protocol defined in EFI1.1.
+///
+typedef EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO;
+
+/**
+ Reset the Block Device.
+
+ @param This Indicates a pointer to the calling context.
+ @param ExtendedVerification Driver may perform diagnostics on reset.
+
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_DEVICE_ERROR The device is not functioning properly and could
+ not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_RESET)(
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+/**
+ Read BufferSize bytes from Lba into Buffer.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId Id of the media, changes every time the media is replaced.
+ @param Lba The starting Logical Block Address to read from
+ @param BufferSize Size of Buffer, must be a multiple of device block size.
+ @param Buffer A pointer to the destination buffer for the data. The caller is
+ responsible for either having implicit or explicit ownership of the buffer.
+
+ @retval EFI_SUCCESS The data was read correctly from the device.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.
+ @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
+ @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
+ or the buffer is not on proper alignment.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_READ)(
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA Lba,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Write BufferSize bytes from Lba into Buffer.
+
+ @param This Indicates a pointer to the calling context.
+ @param MediaId The media ID that the write request is for.
+ @param Lba The starting logical block address to be written. The caller is
+ responsible for writing to only legitimate locations.
+ @param BufferSize Size of Buffer, must be a multiple of device block size.
+ @param Buffer A pointer to the source buffer for the data.
+
+ @retval EFI_SUCCESS The data was written correctly to the device.
+ @retval EFI_WRITE_PROTECTED The device can not be written to.
+ @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
+ @retval EFI_NO_MEDIA There is no media in the device.
+ @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
+ @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
+ @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
+ or the buffer is not on proper alignment.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_WRITE)(
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA Lba,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Flush the Block Device.
+
+ @param This Indicates a pointer to the calling context.
+
+ @retval EFI_SUCCESS All outstanding data was written to the device
+ @retval EFI_DEVICE_ERROR The device reported an error while writting back the data
+ @retval EFI_NO_MEDIA There is no media in the device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLOCK_FLUSH)(
+ IN EFI_BLOCK_IO_PROTOCOL *This
+ );
+
+/**
+ Block IO read only mode data and updated only via members of BlockIO
+**/
+typedef struct {
+ ///
+ /// The curent media Id. If the media changes, this value is changed.
+ ///
+ UINT32 MediaId;
+
+ ///
+ /// TRUE if the media is removable; otherwise, FALSE.
+ ///
+ BOOLEAN RemovableMedia;
+
+ ///
+ /// TRUE if there is a media currently present in the device;
+ /// othersise, FALSE. THis field shows the media present status
+ /// as of the most recent ReadBlocks() or WriteBlocks() call.
+ ///
+ BOOLEAN MediaPresent;
+
+ ///
+ /// TRUE if LBA 0 is the first block of a partition; otherwise
+ /// FALSE. For media with only one partition this would be TRUE.
+ ///
+ BOOLEAN LogicalPartition;
+
+ ///
+ /// TRUE if the media is marked read-only otherwise, FALSE.
+ /// This field shows the read-only status as of the most recent WriteBlocks () call.
+ ///
+ BOOLEAN ReadOnly;
+
+ ///
+ /// TRUE if the WriteBlock () function caches write data.
+ ///
+ BOOLEAN WriteCaching;
+
+ ///
+ /// The intrinsic block size of the device. If the media changes, then
+ /// this field is updated.
+ ///
+ UINT32 BlockSize;
+
+ ///
+ /// Supplies the alignment requirement for any buffer to read or write block(s).
+ ///
+ UINT32 IoAlign;
+
+ ///
+ /// The last logical block address on the device.
+ /// If the media changes, then this field is updated.
+ ///
+ EFI_LBA LastBlock;
+
+ ///
+ /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
+ /// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the first LBA is aligned to
+ /// a physical block boundary.
+ ///
+ EFI_LBA LowestAlignedLba;
+
+ ///
+ /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
+ /// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the number of logical blocks
+ /// per physical block.
+ ///
+ UINT32 LogicalBlocksPerPhysicalBlock;
+
+ ///
+ /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
+ /// EFI_BLOCK_IO_PROTOCOL_REVISION3. Returns the optimal transfer length
+ /// granularity as a number of logical blocks.
+ ///
+ UINT32 OptimalTransferLengthGranularity;
+} EFI_BLOCK_IO_MEDIA;
+
+#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
+#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001
+#define EFI_BLOCK_IO_PROTOCOL_REVISION3 0x00020031
+
+///
+/// Revision defined in EFI1.1.
+///
+#define EFI_BLOCK_IO_INTERFACE_REVISION EFI_BLOCK_IO_PROTOCOL_REVISION
+
+///
+/// This protocol provides control over block devices.
+///
+struct _EFI_BLOCK_IO_PROTOCOL {
+ ///
+ /// The revision to which the block IO interface adheres. All future
+ /// revisions must be backwards compatible. If a future version is not
+ /// back wards compatible, it is not the same GUID.
+ ///
+ UINT64 Revision;
+ ///
+ /// Pointer to the EFI_BLOCK_IO_MEDIA data for this device.
+ ///
+ EFI_BLOCK_IO_MEDIA *Media;
+
+ EFI_BLOCK_RESET Reset;
+ EFI_BLOCK_READ ReadBlocks;
+ EFI_BLOCK_WRITE WriteBlocks;
+ EFI_BLOCK_FLUSH FlushBlocks;
+
+};
+
+extern EFI_GUID gEfiBlockIoProtocolGuid;
+
+#endif
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Protocol/SimpleFileSystem.h
^
|
@@ -0,0 +1,403 @@
+/** @file
+ SimpleFileSystem protocol as defined in the UEFI 2.0 specification.
+
+ The SimpleFileSystem protocol is the programmatic access to the FAT (12,16,32)
+ file system specified in UEFI 2.0. It can also be used to abstract a file
+ system other than FAT.
+
+ UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
+
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __SIMPLE_FILE_SYSTEM_H__
+#define __SIMPLE_FILE_SYSTEM_H__
+
+FILE_LICENCE ( BSD3 );
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
+ { \
+ 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
+ }
+
+typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
+
+typedef struct _EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL;
+typedef struct _EFI_FILE_PROTOCOL *EFI_FILE_HANDLE;
+
+///
+/// Protocol GUID name defined in EFI1.1.
+///
+#define SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID
+
+///
+/// Protocol name defined in EFI1.1.
+///
+typedef EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_FILE_IO_INTERFACE;
+typedef EFI_FILE_PROTOCOL EFI_FILE;
+
+/**
+ Open the root directory on a volume.
+
+ @param This A pointer to the volume to open the root directory.
+ @param Root A pointer to the location to return the opened file handle for the
+ root directory.
+
+ @retval EFI_SUCCESS The device was opened.
+ @retval EFI_UNSUPPORTED This volume does not support the requested file system type.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported. Any existing file handles for this volume are
+ no longer valid. To access the files on the new medium, the
+ volume must be reopened with OpenVolume().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
+ IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **Root
+ );
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
+
+///
+/// Revision defined in EFI1.1
+///
+#define EFI_FILE_IO_INTERFACE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION
+
+struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
+ ///
+ /// The version of the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. The version
+ /// specified by this specification is 0x00010000. All future revisions
+ /// must be backwards compatible.
+ ///
+ UINT64 Revision;
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
+};
+
+/**
+ Opens a new file relative to the source file's location.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to the source location. This would typically be an open
+ handle to a directory.
+ @param NewHandle A pointer to the location to return the opened handle for the new
+ file.
+ @param FileName The Null-terminated string of the name of the file to be opened.
+ The file name may contain the following path modifiers: "\", ".",
+ and "..".
+ @param OpenMode The mode to open the file. The only valid combinations that the
+ file may be opened with are: Read, Read/Write, or Create/Read/Write.
+ @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the
+ attribute bits for the newly created file.
+
+ @retval EFI_SUCCESS The file was opened.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_OPEN)(
+ IN EFI_FILE_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **NewHandle,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT64 Attributes
+ );
+
+//
+// Open modes
+//
+#define EFI_FILE_MODE_READ 0x0000000000000001ULL
+#define EFI_FILE_MODE_WRITE 0x0000000000000002ULL
+#define EFI_FILE_MODE_CREATE 0x8000000000000000ULL
+
+//
+// File attributes
+//
+#define EFI_FILE_READ_ONLY 0x0000000000000001ULL
+#define EFI_FILE_HIDDEN 0x0000000000000002ULL
+#define EFI_FILE_SYSTEM 0x0000000000000004ULL
+#define EFI_FILE_RESERVED 0x0000000000000008ULL
+#define EFI_FILE_DIRECTORY 0x0000000000000010ULL
+#define EFI_FILE_ARCHIVE 0x0000000000000020ULL
+#define EFI_FILE_VALID_ATTR 0x0000000000000037ULL
+
+/**
+ Closes a specified file handle.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to close.
+
+ @retval EFI_SUCCESS The file was closed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_CLOSE)(
+ IN EFI_FILE_PROTOCOL *This
+ );
+
+/**
+ Close and delete the file handle.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the
+ handle to the file to delete.
+
+ @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not deleted.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_DELETE)(
+ IN EFI_FILE_PROTOCOL *This
+ );
+
+/**
+ Reads data from a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to read data from.
+ @param BufferSize On input, the size of the Buffer. On output, the amount of data
+ returned in Buffer. In both cases, the size is measured in bytes.
+ @param Buffer The buffer into which the data is read.
+
+ @retval EFI_SUCCESS Data was read.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file.
+ @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_BUFFER_TO_SMALL The BufferSize is too small to read the current directory
+ entry. BufferSize has been updated with the size
+ needed to complete the request.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_READ)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Writes data to a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to write data to.
+ @param BufferSize On input, the size of the Buffer. On output, the amount of data
+ actually written. In both cases, the size is measured in bytes.
+ @param Buffer The buffer of data to write.
+
+ @retval EFI_SUCCESS Data was written.
+ @retval EFI_UNSUPPORTED Writes to open directory files are not supported.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read only.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_WRITE)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Sets a file's current position.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the
+ file handle to set the requested position on.
+ @param Position The byte position from the start of the file to set.
+
+ @retval EFI_SUCCESS The position was set.
+ @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open
+ directories.
+ @retval EFI_DEVICE_ERROR An attempt was made to set the position of a deleted file.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_SET_POSITION)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN UINT64 Position
+ );
+
+/**
+ Returns a file's current position.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to get the current position on.
+ @param Position The address to return the file's current position value.
+
+ @retval EFI_SUCCESS The position was returned.
+ @retval EFI_UNSUPPORTED The request is not valid on open directories.
+ @retval EFI_DEVICE_ERROR An attempt was made to get the position from a deleted file.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_GET_POSITION)(
+ IN EFI_FILE_PROTOCOL *This,
+ OUT UINT64 *Position
+ );
+
+/**
+ Returns information about a file.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle the requested information is for.
+ @param InformationType The type identifier for the information being requested.
+ @param BufferSize On input, the size of Buffer. On output, the amount of data
+ returned in Buffer. In both cases, the size is measured in bytes.
+ @param Buffer A pointer to the data buffer to return. The buffer's type is
+ indicated by InformationType.
+
+ @retval EFI_SUCCESS The information was returned.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.
+ BufferSize has been updated with the size needed to complete
+ the request.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_GET_INFO)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+ Sets information about a file.
+
+ @param File A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle the information is for.
+ @param InformationType The type identifier for the information being set.
+ @param BufferSize The size, in bytes, of Buffer.
+ @param Buffer A pointer to the data buffer to write. The buffer's type is
+ indicated by InformationType.
+
+ @retval EFI_SUCCESS The information was set.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_INFO_ID and the media is
+ read-only.
+ @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_PROTOCOL_SYSTEM_INFO_ID
+ and the media is read only.
+ @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_SYSTEM_VOLUME_LABEL_ID
+ and the media is read-only.
+ @retval EFI_ACCESS_DENIED An attempt is made to change the name of a file to a
+ file that is already present.
+ @retval EFI_ACCESS_DENIED An attempt is being made to change the EFI_FILE_DIRECTORY
+ Attribute.
+ @retval EFI_ACCESS_DENIED An attempt is being made to change the size of a directory.
+ @retval EFI_ACCESS_DENIED InformationType is EFI_FILE_INFO_ID and the file was opened
+ read-only and an attempt is being made to modify a field
+ other than Attribute.
+ @retval EFI_VOLUME_FULL The volume is full.
+ @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of the type indicated
+ by InformationType.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_SET_INFO)(
+ IN EFI_FILE_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+/**
+ Flushes all modified data associated with a file to a device.
+
+ @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file
+ handle to flush.
+
+ @retval EFI_SUCCESS The data was flushed.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FILE_FLUSH)(
+ IN EFI_FILE_PROTOCOL *This
+ );
+
+#define EFI_FILE_PROTOCOL_REVISION 0x00010000
+//
+// Revision defined in EFI1.1.
+//
+#define EFI_FILE_REVISION EFI_FILE_PROTOCOL_REVISION
+
+///
+/// The EFI_FILE_PROTOCOL provides file IO access to supported file systems.
+/// An EFI_FILE_PROTOCOL provides access to a file's or directory's contents,
+/// and is also a reference to a location in the directory tree of the file system
+/// in which the file resides. With any given file handle, other files may be opened
+/// relative to this file's location, yielding new file handles.
+///
+struct _EFI_FILE_PROTOCOL {
+ ///
+ /// The version of the EFI_FILE_PROTOCOL interface. The version specified
+ /// by this specification is 0x00010000. Future versions are required
+ /// to be backward compatible to version 1.0.
+ ///
+ UINT64 Revision;
+ EFI_FILE_OPEN Open;
+ EFI_FILE_CLOSE Close;
+ EFI_FILE_DELETE Delete;
+ EFI_FILE_READ Read;
+ EFI_FILE_WRITE Write;
+ EFI_FILE_GET_POSITION GetPosition;
+ EFI_FILE_SET_POSITION SetPosition;
+ EFI_FILE_GET_INFO GetInfo;
+ EFI_FILE_SET_INFO SetInfo;
+ EFI_FILE_FLUSH Flush;
+};
+
+
+extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
+
+#endif
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Protocol/SimpleTextInEx.h
^
|
@@ -5,7 +5,7 @@
which exposes much more state and modifier information from the input device,
also allows one to register a notification for a particular keystroke.
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -276,7 +276,7 @@
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
IN EFI_KEY_DATA *KeyData,
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
- OUT EFI_HANDLE *NotifyHandle
+ OUT VOID **NotifyHandle
);
/**
@@ -298,7 +298,7 @@
EFI_STATUS
(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
- IN EFI_HANDLE NotificationHandle
+ IN VOID *NotificationHandle
);
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h
^
|
@@ -887,9 +887,9 @@
EFI_IMAGE_ID Id;
} EFI_IFR_IMAGE;
-typedef struct _EFI_IFR_MODAL {
+typedef struct _EFI_IFR_MODAL_TAG {
EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MODAL;
+} EFI_IFR_MODAL_TAG;
typedef struct _EFI_IFR_LOCKED {
EFI_IFR_OP_HEADER Header;
@@ -907,6 +907,12 @@
EFI_IFR_TYPE_VALUE Value;
} EFI_IFR_DEFAULT;
+typedef struct _EFI_IFR_DEFAULT_2 {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 DefaultId;
+ UINT8 Type;
+} EFI_IFR_DEFAULT_2;
+
typedef struct _EFI_IFR_VALUE {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_VALUE;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/Uefi/UefiSpec.h
^
|
@@ -283,7 +283,9 @@
@retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
present in the system.
2) No drivers were connected to ControllerHandle.
-
+ @retval EFI_SECURITY_VIOLATION
+ The user has no permission to start UEFI device drivers on the device path
+ associated with the ControllerHandle or specified by the RemainingDevicePath.
**/
typedef
EFI_STATUS
@@ -850,8 +852,9 @@
@param ExitData The pointer to a pointer to a data buffer that includes a Null-terminated
string, optionally followed by additional binary data.
- @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
- has already been initialized with StartImage.
+ @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
+ has already been initialized with StartImage.
+ @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.
@return Exit code from image
**/
@@ -1138,8 +1141,8 @@
/**
Installs one or more protocol interfaces into the boot services environment.
- @param Handle The handle to install the new protocol interfaces on, or NULL if a new
- handle is to be allocated.
+ @param Handle The pointer to a handle to install the new protocol interfaces on,
+ or a pointer to NULL if a new handle is to be allocated.
@param ... A variable argument list containing pairs of protocol GUIDs and protocol
interfaces.
@@ -1722,6 +1725,10 @@
OUT UINT64 *MaximumVariableSize
);
+//
+// Firmware should stop at a firmware user interface on next boot
+//
+#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
//
// EFI Runtime Services Table
@@ -2006,50 +2013,46 @@
///
/// EFI Boot Key Data
///
-typedef union {
- struct {
- ///
- /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
- ///
- UINT32 Revision : 8;
- ///
- /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
- ///
- UINT32 ShiftPressed : 1;
- ///
- /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
- ///
- UINT32 ControlPressed : 1;
- ///
- /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
- ///
- UINT32 AltPressed : 1;
- ///
- /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
- ///
- UINT32 LogoPressed : 1;
- ///
- /// The Menu key must be pressed (1) or must not be pressed (0).
- ///
- UINT32 MenuPressed : 1;
- ///
- /// The SysReq key must be pressed (1) or must not be pressed (0).
- ///
- UINT32 SysReqPressed : 1;
- UINT32 Reserved : 16;
- ///
- /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
- /// zero, then only the shift state is considered. If more than one, then the boot option will
- /// only be launched if all of the specified keys are pressed with the same shift state.
- ///
- UINT32 InputKeyCount : 2;
- } Options;
- UINT32 PackedValue;
-} EFI_BOOT_KEY_DATA;
+typedef UINT32 EFI_BOOT_KEY_DATA;
+///
+/// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
+///
+#define EFI_KEY_OPTION_REVISION_MASK 0x000000FF
+///
+/// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
+///
+#define EFI_KEY_OPTION_SHIFT_PRESSED_MASK BIT8
+///
+/// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
+///
+#define EFI_KEY_OPTION_CONTROL_PRESSED_MASK BIT9
+///
+/// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
+///
+#define EFI_KEY_OPTION_ALT_PRESSED_MASK BIT10
+///
+/// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
+///
+#define EFI_KEY_OPTION_LOGO_PRESSED_MASK BIT11
+///
+/// The Menu key must be pressed (1) or must not be pressed (0).
+///
+#define EFI_KEY_OPTION_MENU_PRESSED_MASK BIT12
+///
+/// The SysReq key must be pressed (1) or must not be pressed (0).
+///
+#define EFI_KEY_OPTION_SYS_REQ_PRESSED_MASK BIT13
+///
+/// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
+/// zero, then only the shift state is considered. If more than one, then the boot option will
+/// only be launched if all of the specified keys are pressed with the same shift state.
+///
+#define EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK (BIT30 | BIT31)
///
/// EFI Key Option.
///
+#pragma pack(1)
typedef struct {
///
/// Specifies options about how the key will be processed.
@@ -2073,6 +2076,7 @@
///
//EFI_INPUT_KEY Keys[];
} EFI_KEY_OPTION;
+#pragma pack()
//
// EFI File location to boot from on removable media devices
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/efi.h
^
|
@@ -142,7 +142,5 @@
extern const char * efi_strerror ( EFI_STATUS efirc );
extern EFI_STATUS efi_init ( EFI_HANDLE image_handle,
EFI_SYSTEM_TABLE *systab );
-extern int efi_download_install ( EFI_HANDLE *device_handle );
-extern void efi_download_uninstall ( EFI_HANDLE device_handle );
#endif /* _IPXE_EFI_H */
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/efi_download.h
^
|
@@ -0,0 +1,157 @@
+#ifndef _IPXE_DOWNLOAD_H
+#define _IPXE_DOWNLOAD_H
+
+/*
+ * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+/** @file
+ *
+ * iPXE Download Protocol
+ *
+ * EFI applications started by iPXE may use this interface to download files.
+ */
+
+typedef struct _IPXE_DOWNLOAD_PROTOCOL IPXE_DOWNLOAD_PROTOCOL;
+
+/** Token to represent a currently downloading file */
+typedef VOID *IPXE_DOWNLOAD_FILE;
+
+/**
+ * Callback function that is invoked when data arrives for a particular file.
+ *
+ * Not all protocols will deliver data in order. Clients should not rely on the
+ * order of data delivery matching the order in the file.
+ *
+ * Some protocols are capable of determining the file size near the beginning
+ * of data transfer. To allow the client to allocate memory more efficiently,
+ * iPXE may give a hint about the file size by calling the Data callback with
+ * a zero BufferLength and the file size in FileOffset. Clients should be
+ * prepared to deal with more or less data than the hint actually arriving.
+ *
+ * @v Context Context provided to the Start function
+ * @v Buffer New data
+ * @v BufferLength Length of new data in bytes
+ * @v FileOffset Offset of new data in the file
+ * @ret Status EFI_SUCCESS to continue the download,
+ * or any error code to abort.
+ */
+typedef
+EFI_STATUS
+(EFIAPI *IPXE_DOWNLOAD_DATA_CALLBACK)(
+ IN VOID *Context,
+ IN VOID *Buffer,
+ IN UINTN BufferLength,
+ IN UINTN FileOffset
+ );
+
+/**
+ * Callback function that is invoked when the file is finished downloading, or
+ * when a connection unexpectedly closes or times out.
+ *
+ * The finish callback is also called when a download is aborted by the Abort
+ * function (below).
+ *
+ * @v Context Context provided to the Start function
+ * @v Status Reason for termination: EFI_SUCCESS when the entire
+ * file was transferred successfully, or an error
+ * otherwise
+ */
+typedef
+void
+(EFIAPI *IPXE_DOWNLOAD_FINISH_CALLBACK)(
+ IN VOID *Context,
+ IN EFI_STATUS Status
+ );
+
+/**
+ * Start downloading a file, and register callback functions to handle the
+ * download.
+ *
+ * @v This iPXE Download Protocol instance
+ * @v Url URL to download from
+ * @v DataCallback Callback that will be invoked when data arrives
+ * @v FinishCallback Callback that will be invoked when the download ends
+ * @v Context Context passed to the Data and Finish callbacks
+ * @v File Token that can be used to abort the download
+ * @ret Status EFI status code
+ */
+typedef
+EFI_STATUS
+(EFIAPI *IPXE_DOWNLOAD_START)(
+ IN IPXE_DOWNLOAD_PROTOCOL *This,
+ IN CHAR8 *Url,
+ IN IPXE_DOWNLOAD_DATA_CALLBACK DataCallback,
+ IN IPXE_DOWNLOAD_FINISH_CALLBACK FinishCallback,
+ IN VOID *Context,
+ OUT IPXE_DOWNLOAD_FILE *File
+ );
+
+/**
+ * Forcibly abort downloading a file that is currently in progress.
+ *
+ * It is not safe to call this function after the Finish callback has executed.
+ *
+ * @v This iPXE Download Protocol instance
+ * @v File Token obtained from Start
+ * @v Status Reason for aborting the download
+ * @ret Status EFI status code
+ */
+typedef
+EFI_STATUS
+(EFIAPI *IPXE_DOWNLOAD_ABORT)(
+ IN IPXE_DOWNLOAD_PROTOCOL *This,
+ IN IPXE_DOWNLOAD_FILE File,
+ IN EFI_STATUS Status
+ );
+
+/**
+ * Poll for more data from iPXE. This function will invoke the registered
+ * callbacks if data is available or if downloads complete.
+ *
+ * @v This iPXE Download Protocol instance
+ * @ret Status EFI status code
+ */
+typedef
+EFI_STATUS
+(EFIAPI *IPXE_DOWNLOAD_POLL)(
+ IN IPXE_DOWNLOAD_PROTOCOL *This
+ );
+
+/**
+ * The iPXE Download Protocol.
+ *
+ * iPXE will attach a iPXE Download Protocol to the DeviceHandle in the Loaded
+ * Image Protocol of all child EFI applications.
+ */
+struct _IPXE_DOWNLOAD_PROTOCOL {
+ IPXE_DOWNLOAD_START Start;
+ IPXE_DOWNLOAD_ABORT Abort;
+ IPXE_DOWNLOAD_POLL Poll;
+};
+
+#define IPXE_DOWNLOAD_PROTOCOL_GUID \
+ { \
+ 0x3eaeaebd, 0xdecf, 0x493b, { 0x9b, 0xd1, 0xcd, 0xb2, 0xde, 0xca, 0xe7, 0x19 } \
+ }
+
+extern int efi_download_install ( EFI_HANDLE *device );
+extern void efi_download_uninstall ( EFI_HANDLE device );
+
+#endif /* _IPXE_DOWNLOAD_H */
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/efi_file.h
^
|
@@ -0,0 +1,13 @@
+#ifndef _IPXE_EFI_FILE_H
+#define _IPXE_EFI_FILE_H
+
+/** @file
+ *
+ * EFI file protocols
+ *
+ */
+
+extern int efi_file_install ( EFI_HANDLE *handle );
+extern void efi_file_uninstall ( EFI_HANDLE handle );
+
+#endif /* _IPXE_EFI_FILE_H */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/efi_snp.h
^
|
@@ -16,6 +16,7 @@
#include <ipxe/efi/Protocol/DevicePath.h>
#include <ipxe/efi/Protocol/HiiConfigAccess.h>
#include <ipxe/efi/Protocol/HiiDatabase.h>
+#include <ipxe/efi/Protocol/LoadFile.h>
/** An SNP device */
struct efi_snp_device {
@@ -49,6 +50,8 @@
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii;
/** Component name protocol */
EFI_COMPONENT_NAME2_PROTOCOL name2;
+ /** Load file protocol handle */
+ EFI_LOAD_FILE_PROTOCOL load_file;
/** HII configuration access protocol */
EFI_HII_CONFIG_ACCESS_PROTOCOL hii;
/** HII package list */
@@ -71,5 +74,6 @@
extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
+extern struct efi_snp_device * last_opened_snpdev ( void );
#endif /* _IPXE_EFI_SNP_H */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/import.pl
^
|
@@ -59,6 +59,7 @@
open my $outfh, ">$outfile" or die "Could not open $outfile: $!\n";
my @dependencies = ();
my $licence;
+ my $maybe_guard;
my $guard;
while ( <$infh> ) {
# Strip CR and trailing whitespace
@@ -77,10 +78,16 @@
# Write out line
print $outfh "$_\n";
# Apply FILE_LICENCE() immediately after include guard
- if ( /^\#define\s+_?_\S+_H_?_$/ ) {
- die "Duplicate header guard detected in $infile\n" if $guard;
- $guard = 1;
- print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence;
+ if ( defined $maybe_guard ) {
+ if ( /^\#define\s+_?_${maybe_guard}_?_$/ ) {
+ die "Duplicate header guard detected in $infile\n" if $guard;
+ $guard = $maybe_guard;
+ print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence;
+ }
+ undef $maybe_guard;
+ }
+ if ( /^#ifndef\s+_?_(\S+)_?_/ ) {
+ $maybe_guard = $1;
}
}
close $outfh;
|
[-]
[+]
|
Deleted |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/efi/ipxe_download.h
^
|
@@ -1,154 +0,0 @@
-#ifndef _IPXE_DOWNLOAD_H
-#define _IPXE_DOWNLOAD_H
-
-/*
- * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * iPXE Download Protocol
- *
- * EFI applications started by iPXE may use this interface to download files.
- */
-
-typedef struct _IPXE_DOWNLOAD_PROTOCOL IPXE_DOWNLOAD_PROTOCOL;
-
-/** Token to represent a currently downloading file */
-typedef VOID *IPXE_DOWNLOAD_FILE;
-
-/**
- * Callback function that is invoked when data arrives for a particular file.
- *
- * Not all protocols will deliver data in order. Clients should not rely on the
- * order of data delivery matching the order in the file.
- *
- * Some protocols are capable of determining the file size near the beginning
- * of data transfer. To allow the client to allocate memory more efficiently,
- * iPXE may give a hint about the file size by calling the Data callback with
- * a zero BufferLength and the file size in FileOffset. Clients should be
- * prepared to deal with more or less data than the hint actually arriving.
- *
- * @v Context Context provided to the Start function
- * @v Buffer New data
- * @v BufferLength Length of new data in bytes
- * @v FileOffset Offset of new data in the file
- * @ret Status EFI_SUCCESS to continue the download,
- * or any error code to abort.
- */
-typedef
-EFI_STATUS
-(EFIAPI *IPXE_DOWNLOAD_DATA_CALLBACK)(
- IN VOID *Context,
- IN VOID *Buffer,
- IN UINTN BufferLength,
- IN UINTN FileOffset
- );
-
-/**
- * Callback function that is invoked when the file is finished downloading, or
- * when a connection unexpectedly closes or times out.
- *
- * The finish callback is also called when a download is aborted by the Abort
- * function (below).
- *
- * @v Context Context provided to the Start function
- * @v Status Reason for termination: EFI_SUCCESS when the entire
- * file was transferred successfully, or an error
- * otherwise
- */
-typedef
-void
-(EFIAPI *IPXE_DOWNLOAD_FINISH_CALLBACK)(
- IN VOID *Context,
- IN EFI_STATUS Status
- );
-
-/**
- * Start downloading a file, and register callback functions to handle the
- * download.
- *
- * @v This iPXE Download Protocol instance
- * @v Url URL to download from
- * @v DataCallback Callback that will be invoked when data arrives
- * @v FinishCallback Callback that will be invoked when the download ends
- * @v Context Context passed to the Data and Finish callbacks
- * @v File Token that can be used to abort the download
- * @ret Status EFI status code
- */
-typedef
-EFI_STATUS
-(EFIAPI *IPXE_DOWNLOAD_START)(
- IN IPXE_DOWNLOAD_PROTOCOL *This,
- IN CHAR8 *Url,
- IN IPXE_DOWNLOAD_DATA_CALLBACK DataCallback,
- IN IPXE_DOWNLOAD_FINISH_CALLBACK FinishCallback,
- IN VOID *Context,
- OUT IPXE_DOWNLOAD_FILE *File
- );
-
-/**
- * Forcibly abort downloading a file that is currently in progress.
- *
- * It is not safe to call this function after the Finish callback has executed.
- *
- * @v This iPXE Download Protocol instance
- * @v File Token obtained from Start
- * @v Status Reason for aborting the download
- * @ret Status EFI status code
- */
-typedef
-EFI_STATUS
-(EFIAPI *IPXE_DOWNLOAD_ABORT)(
- IN IPXE_DOWNLOAD_PROTOCOL *This,
- IN IPXE_DOWNLOAD_FILE File,
- IN EFI_STATUS Status
- );
-
-/**
- * Poll for more data from iPXE. This function will invoke the registered
- * callbacks if data is available or if downloads complete.
- *
- * @v This iPXE Download Protocol instance
- * @ret Status EFI status code
- */
-typedef
-EFI_STATUS
-(EFIAPI *IPXE_DOWNLOAD_POLL)(
- IN IPXE_DOWNLOAD_PROTOCOL *This
- );
-
-/**
- * The iPXE Download Protocol.
- *
- * iPXE will attach a iPXE Download Protocol to the DeviceHandle in the Loaded
- * Image Protocol of all child EFI applications.
- */
-struct _IPXE_DOWNLOAD_PROTOCOL {
- IPXE_DOWNLOAD_START Start;
- IPXE_DOWNLOAD_ABORT Abort;
- IPXE_DOWNLOAD_POLL Poll;
-};
-
-#define IPXE_DOWNLOAD_PROTOCOL_GUID \
- { \
- 0x3eaeaebd, 0xdecf, 0x493b, { 0x9b, 0xd1, 0xcd, 0xb2, 0xde, 0xca, 0xe7, 0x19 } \
- }
-
-#endif /* _IPXE_DOWNLOAD_H */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/iobuf.h
^
|
@@ -216,5 +216,6 @@
extern void free_iob ( struct io_buffer *iobuf );
extern void iob_pad ( struct io_buffer *iobuf, size_t min_len );
extern int iob_ensure_headroom ( struct io_buffer *iobuf, size_t len );
+extern struct io_buffer * iob_concatenate ( struct list_head *list );
#endif /* _IPXE_IOBUF_H */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/iscsi.h
^
|
@@ -36,7 +36,7 @@
*/
uint8_t data_len[3];
} bytes;
- /** Ths data length (measured in bytes), in network byte
+ /** The data length (measured in bytes), in network byte
* order, with ahs_len as the first byte.
*/
uint32_t ahs_and_data_len;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/pci.h
^
|
@@ -172,7 +172,7 @@
#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
-#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
+#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxiliary power support mask */
#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/tftp.h
^
|
@@ -80,6 +80,4 @@
struct tftp_oack oack;
};
-extern void tftp_set_request_blksize ( unsigned int blksize );
-
#endif /* _IPXE_TFTP_H */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/ipxe/vlan.h
^
|
@@ -61,6 +61,7 @@
extern struct net_device * vlan_find ( struct net_device *trunk,
unsigned int tag );
+extern unsigned int vlan_tag ( struct net_device *netdev );
extern int vlan_can_be_trunk ( struct net_device *trunk );
extern int vlan_create ( struct net_device *trunk, unsigned int tag,
unsigned int priority );
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/include/usr/autoboot.h
^
|
@@ -31,6 +31,7 @@
fetch_next_server_and_filename ( struct settings *settings );
extern int netboot ( struct net_device *netdev );
extern int autoboot ( void );
+extern void ipxe ( struct net_device *netdev );
extern int pxe_menu_boot ( struct net_device *netdev );
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/interface/efi/efi_download.c
^
|
@@ -25,7 +25,7 @@
#include <ipxe/iobuf.h>
#include <ipxe/xfer.h>
#include <ipxe/efi/efi.h>
-#include <ipxe/efi/ipxe_download.h>
+#include <ipxe/efi/efi_download.h>
/** iPXE download protocol GUID */
static EFI_GUID ipxe_download_protocol_guid
@@ -187,47 +187,39 @@
};
/**
- * Create a new device handle with a iPXE download protocol attached to it.
+ * Install iPXE download protocol
*
- * @v device_handle Newly created device handle (output)
+ * @v handle EFI handle
* @ret rc Return status code
*/
-int efi_download_install ( EFI_HANDLE *device_handle ) {
+int efi_download_install ( EFI_HANDLE *handle ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
EFI_STATUS efirc;
- EFI_HANDLE handle = NULL;
- if (efi_loaded_image->DeviceHandle) { /* TODO: ensure handle is the NIC (maybe efi_image has a better way to indicate the handle doing SNP?) */
- handle = efi_loaded_image->DeviceHandle;
- }
- DBG ( "Installing ipxe protocol interface (%p)... ",
- &ipxe_download_protocol_interface );
efirc = bs->InstallMultipleProtocolInterfaces (
- &handle,
+ handle,
&ipxe_download_protocol_guid,
&ipxe_download_protocol_interface,
NULL );
if ( efirc ) {
- DBG ( "failed (%s)\n", efi_strerror ( efirc ) );
+ DBG ( "Could not install download protocol: %s\n",
+ efi_strerror ( efirc ) );
return EFIRC_TO_RC ( efirc );
}
- DBG ( "success (%p)\n", handle );
- *device_handle = handle;
return 0;
}
/**
- * Remove the iPXE download protocol from the given handle, and if nothing
- * else is attached, destroy the handle.
+ * Uninstall iPXE download protocol
*
- * @v device_handle EFI device handle to remove from
+ * @v handle EFI handle
*/
-void efi_download_uninstall ( EFI_HANDLE device_handle ) {
+void efi_download_uninstall ( EFI_HANDLE handle ) {
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
bs->UninstallMultipleProtocolInterfaces (
- device_handle,
- ipxe_download_protocol_guid,
- ipxe_download_protocol_interface );
+ handle,
+ &ipxe_download_protocol_guid,
+ &ipxe_download_protocol_interface, NULL );
}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/interface/efi/efi_driver.c
^
|
@@ -90,12 +90,29 @@
*/
static EFI_STATUS EFIAPI
efi_driver_get_controller_name ( EFI_COMPONENT_NAME2_PROTOCOL *wtf __unused,
- EFI_HANDLE device __unused,
- EFI_HANDLE child __unused,
- CHAR8 *language __unused,
- CHAR16 **controller_name __unused ) {
+ EFI_HANDLE device, EFI_HANDLE child,
+ CHAR8 *language, CHAR16 **controller_name ) {
+ EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
+ union {
+ EFI_COMPONENT_NAME2_PROTOCOL *name2;
+ void *interface;
+ } name2;
+ EFI_STATUS efirc;
- /* Just let EFI use the default Device Path Name */
+ /* Delegate to the EFI_COMPONENT_NAME2_PROTOCOL instance
+ * installed on child handle, if present.
+ */
+ if ( ( child != NULL ) &&
+ ( ( efirc = bs->OpenProtocol (
+ child, &efi_component_name2_protocol_guid,
+ &name2.interface, NULL, NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) == 0 ) ) {
+ return name2.name2->GetControllerName ( name2.name2, device,
+ child, language,
+ controller_name );
+ }
+
+ /* Otherwise, let EFI use the default Device Path Name */
return EFI_UNSUPPORTED;
}
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/interface/efi/efi_file.c
^
|
@@ -0,0 +1,594 @@
+/*
+ * Copyright (C) 2013 Michael Brown <mbrown@fensystems.co.uk>.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+/**
+ * @file
+ *
+ * EFI file protocols
+ *
+ */
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+#include <ipxe/image.h>
+#include <ipxe/efi/efi.h>
+#include <ipxe/efi/Protocol/SimpleFileSystem.h>
+#include <ipxe/efi/Protocol/BlockIo.h>
+#include <ipxe/efi/Guid/FileInfo.h>
+#include <ipxe/efi/Guid/FileSystemInfo.h>
+#include <ipxe/efi/efi_strings.h>
+#include <ipxe/efi/efi_file.h>
+
+/** EFI simple file system protocol GUID */
+static EFI_GUID efi_simple_file_system_protocol_guid
+ = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
+
+/** EFI file information GUID */
+static EFI_GUID efi_file_info_id = EFI_FILE_INFO_ID;
+
+/** EFI file system information GUID */
+static EFI_GUID efi_file_system_info_id = EFI_FILE_SYSTEM_INFO_ID;
+
+/** EFI block I/O protocol GUID */
+static EFI_GUID efi_block_io_protocol_guid
+ = EFI_BLOCK_IO_PROTOCOL_GUID;
+
+/** EFI media ID */
+#define EFI_MEDIA_ID_MAGIC 0x69505845
+
+/** An image exposed as an EFI file */
+struct efi_file {
+ /** EFI file protocol */
+ EFI_FILE_PROTOCOL file;
+ /** Image */
+ struct image *image;
+ /** Current file position */
+ size_t pos;
+};
+
+static struct efi_file efi_file_root;
+
+/**
+ * Get EFI file name (for debugging)
+ *
+ * @v file EFI file
+ * @ret name Name
+ */
+static const char * efi_file_name ( struct efi_file *file ) {
+
+ return ( file->image ? file->image->name : "<root>" );
+}
+
+/**
+ * Open file
+ *
+ * @v this EFI file
+ * @ret new New EFI file
+ * @v wname Filename
+ * @v mode File mode
+ * @v attributes File attributes (for newly-created files)
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI
+efi_file_open ( EFI_FILE_PROTOCOL *this, EFI_FILE_PROTOCOL **new,
+ CHAR16 *wname, UINT64 mode __unused,
+ UINT64 attributes __unused ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+ char name[ wcslen ( wname ) + 1 /* NUL */ ];
+ struct efi_file *new_file;
+ struct image *image;
+
+ /* Initial '\' indicates opening from the root directory */
+ while ( *wname == L'\\' ) {
+ file = &efi_file_root;
+ wname++;
+ }
+
+ /* Allow root directory itself to be opened */
+ if ( ( wname[0] == L'\0' ) || ( wname[0] == L'.' ) ) {
+ *new = &efi_file_root.file;
+ return 0;
+ }
+
+ /* Fail unless opening from the root */
+ if ( file->image ) {
+ DBGC ( file, "EFIFILE %s is not a directory\n",
+ efi_file_name ( file ) );
+ return EFI_NOT_FOUND;
+ }
+
+ /* Identify image */
+ snprintf ( name, sizeof ( name ), "%ls", wname );
+ image = find_image ( name );
+ if ( ! image ) {
+ DBGC ( file, "EFIFILE \"%s\" does not exist\n", name );
+ return EFI_NOT_FOUND;
+ }
+
+ /* Fail unless opening read-only */
+ if ( mode != EFI_FILE_MODE_READ ) {
+ DBGC ( file, "EFIFILE %s cannot be opened in mode %#08llx\n",
+ image->name, mode );
+ return EFI_WRITE_PROTECTED;
+ }
+
+ /* Allocate and initialise file */
+ new_file = zalloc ( sizeof ( *new_file ) );
+ memcpy ( &new_file->file, &efi_file_root.file,
+ sizeof ( new_file->file ) );
+ new_file->image = image_get ( image );
+ *new = &new_file->file;
+ DBGC ( new_file, "EFIFILE %s opened\n", efi_file_name ( new_file ) );
+
+ return 0;
+}
+
+/**
+ * Close file
+ *
+ * @v this EFI file
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_close ( EFI_FILE_PROTOCOL *this ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ /* Do nothing if this is the root */
+ if ( ! file->image )
+ return 0;
+
+ /* Close file */
+ DBGC ( file, "EFIFILE %s closed\n", efi_file_name ( file ) );
+ image_put ( file->image );
+ free ( file );
+
+ return 0;
+}
+
+/**
+ * Close and delete file
+ *
+ * @v this EFI file
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_delete ( EFI_FILE_PROTOCOL *this ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ DBGC ( file, "EFIFILE %s cannot be deleted\n", efi_file_name ( file ) );
+
+ /* Close file */
+ efi_file_close ( this );
+
+ /* Warn of failure to delete */
+ return EFI_WARN_DELETE_FAILURE;
+}
+
+/**
+ * Return variable-length data structure
+ *
+ * @v base Base data structure (starting with UINT64)
+ * @v base_len Length of base data structure
+ * @v name Name to append to base data structure
+ * @v len Length of data buffer
+ * @v data Data buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS efi_file_varlen ( UINT64 *base, size_t base_len,
+ const char *name, UINTN *len, VOID *data ) {
+ size_t name_len;
+
+ /* Calculate structure length */
+ name_len = strlen ( name );
+ *base = ( base_len + ( name_len + 1 /* NUL */ ) * sizeof ( wchar_t ) );
+ if ( *len < *base ) {
+ *len = *base;
+ return EFI_BUFFER_TOO_SMALL;
+ }
+
+ /* Copy data to buffer */
+ *len = *base;
+ memcpy ( data, base, base_len );
+ efi_snprintf ( ( data + base_len ), ( name_len + 1 /* NUL */ ),
+ "%s", name );
+
+ return 0;
+}
+
+/**
+ * Return file information structure
+ *
+ * @v image Image, or NULL for the root directory
+ * @v len Length of data buffer
+ * @v data Data buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS efi_file_info ( struct image *image, UINTN *len,
+ VOID *data ) {
+ EFI_FILE_INFO info;
+ const char *name;
+
+ /* Populate file information */
+ memset ( &info, 0, sizeof ( info ) );
+ if ( image ) {
+ info.FileSize = image->len;
+ info.PhysicalSize = image->len;
+ info.Attribute = EFI_FILE_READ_ONLY;
+ name = image->name;
+ } else {
+ info.Attribute = ( EFI_FILE_READ_ONLY | EFI_FILE_DIRECTORY );
+ name = "";
+ }
+
+ return efi_file_varlen ( &info.Size, SIZE_OF_EFI_FILE_INFO, name,
+ len, data );
+}
+
+/**
+ * Read directory entry
+ *
+ * @v file EFI file
+ * @v len Length to read
+ * @v data Data buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS efi_file_read_dir ( struct efi_file *file, UINTN *len,
+ VOID *data ) {
+ EFI_STATUS efirc;
+ struct image *image;
+ unsigned int index;
+
+ /* Construct directory entry at current position */
+ index = file->pos;
+ for_each_image ( image ) {
+ if ( index-- == 0 ) {
+ efirc = efi_file_info ( image, len, data );
+ if ( efirc == 0 )
+ file->pos++;
+ return efirc;
+ }
+ }
+
+ /* No more entries */
+ *len = 0;
+ return 0;
+}
+
+/**
+ * Read from file
+ *
+ * @v this EFI file
+ * @v len Length to read
+ * @v data Data buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_read ( EFI_FILE_PROTOCOL *this,
+ UINTN *len, VOID *data ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+ size_t remaining;
+
+ /* If this is the root directory, then construct a directory entry */
+ if ( ! file->image )
+ return efi_file_read_dir ( file, len, data );
+
+ /* Read from the file */
+ remaining = ( file->image->len - file->pos );
+ if ( *len > remaining )
+ *len = remaining;
+ DBGC ( file, "EFIFILE %s read [%#08zx,%#08zx)\n",
+ efi_file_name ( file ), file->pos,
+ ( ( size_t ) ( file->pos + *len ) ) );
+ copy_from_user ( data, file->image->data, file->pos, *len );
+ file->pos += *len;
+ return 0;
+}
+
+/**
+ * Write to file
+ *
+ * @v this EFI file
+ * @v len Length to write
+ * @v data Data buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_write ( EFI_FILE_PROTOCOL *this,
+ UINTN *len, VOID *data __unused ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ DBGC ( file, "EFIFILE %s cannot write [%#08zx, %#08zx)\n",
+ efi_file_name ( file ), file->pos,
+ ( ( size_t ) ( file->pos + *len ) ) );
+ return EFI_WRITE_PROTECTED;
+}
+
+/**
+ * Set file position
+ *
+ * @v this EFI file
+ * @v position New file position
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_set_position ( EFI_FILE_PROTOCOL *this,
+ UINT64 position ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ /* If this is the root directory, reset to the start */
+ if ( ! file->image ) {
+ DBGC ( file, "EFIFILE root directory rewound\n" );
+ file->pos = 0;
+ return 0;
+ }
+
+ /* Check for the magic end-of-file value */
+ if ( position == 0xffffffffffffffffULL )
+ position = file->image->len;
+
+ /* Fail if we attempt to seek past the end of the file (since
+ * we do not support writes).
+ */
+ if ( position > file->image->len ) {
+ DBGC ( file, "EFIFILE %s cannot seek to %#08llx of %#08zx\n",
+ efi_file_name ( file ), position, file->image->len );
+ return EFI_UNSUPPORTED;
+ }
+
+ /* Set position */
+ file->pos = position;
+ DBGC ( file, "EFIFILE %s position set to %#08zx\n",
+ efi_file_name ( file ), file->pos );
+
+ return 0;
+}
+
+/**
+ * Get file position
+ *
+ * @v this EFI file
+ * @ret position New file position
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_get_position ( EFI_FILE_PROTOCOL *this,
+ UINT64 *position ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ *position = file->pos;
+ return 0;
+}
+
+/**
+ * Get file information
+ *
+ * @v this EFI file
+ * @v type Type of information
+ * @v len Buffer size
+ * @v data Buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_get_info ( EFI_FILE_PROTOCOL *this,
+ EFI_GUID *type,
+ UINTN *len, VOID *data ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+ EFI_FILE_SYSTEM_INFO fsinfo;
+ struct image *image;
+
+ /* Determine information to return */
+ if ( memcmp ( type, &efi_file_info_id, sizeof ( *type ) ) == 0 ) {
+
+ /* Get file information */
+ DBGC ( file, "EFIFILE %s get file information\n",
+ efi_file_name ( file ) );
+ return efi_file_info ( file->image, len, data );
+
+ } else if ( memcmp ( type, &efi_file_system_info_id,
+ sizeof ( *type ) ) == 0 ) {
+
+ /* Get file system information */
+ DBGC ( file, "EFIFILE %s get file system information\n",
+ efi_file_name ( file ) );
+ memset ( &fsinfo, 0, sizeof ( fsinfo ) );
+ fsinfo.ReadOnly = 1;
+ for_each_image ( image )
+ fsinfo.VolumeSize += image->len;
+ return efi_file_varlen ( &fsinfo.Size,
+ SIZE_OF_EFI_FILE_SYSTEM_INFO, "iPXE",
+ len, data );
+ } else {
+
+ DBGC ( file, "EFIFILE %s cannot get information of type %s\n",
+ efi_file_name ( file ),
+ uuid_ntoa ( ( union uuid * ) type ) );
+ return EFI_UNSUPPORTED;
+ }
+}
+
+/**
+ * Set file information
+ *
+ * @v this EFI file
+ * @v type Type of information
+ * @v len Buffer size
+ * @v data Buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI
+efi_file_set_info ( EFI_FILE_PROTOCOL *this, EFI_GUID *type,
+ UINTN len __unused, VOID *data __unused ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ DBGC ( file, "EFIFILE %s cannot set information of type %s\n",
+ efi_file_name ( file ), uuid_ntoa ( ( union uuid * ) type ) );
+ return EFI_WRITE_PROTECTED;
+}
+
+/**
+ * Flush file modified data
+ *
+ * @v this EFI file
+ * @v type Type of information
+ * @v len Buffer size
+ * @v data Buffer
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI efi_file_flush ( EFI_FILE_PROTOCOL *this ) {
+ struct efi_file *file = container_of ( this, struct efi_file, file );
+
+ DBGC ( file, "EFIFILE %s flushed\n", efi_file_name ( file ) );
+ return 0;
+}
+
+/** Root directory */
+static struct efi_file efi_file_root = {
+ .file = {
+ .Revision = EFI_FILE_PROTOCOL_REVISION,
+ .Open = efi_file_open,
+ .Close = efi_file_close,
+ .Delete = efi_file_delete,
+ .Read = efi_file_read,
+ .Write = efi_file_write,
+ .GetPosition = efi_file_get_position,
+ .SetPosition = efi_file_set_position,
+ .GetInfo = efi_file_get_info,
+ .SetInfo = efi_file_set_info,
+ .Flush = efi_file_flush,
+ },
+ .image = NULL,
+};
+
+/**
+ * Open root directory
+ *
+ * @v filesystem EFI simple file system
+ * @ret file EFI file handle
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI
+efi_file_open_volume ( EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *filesystem __unused,
+ EFI_FILE_PROTOCOL **file ) {
+
+ *file = &efi_file_root.file;
+ return 0;
+}
+
+/** EFI simple file system protocol */
+static EFI_SIMPLE_FILE_SYSTEM_PROTOCOL efi_simple_file_system_protocol = {
+ .Revision = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION,
+ .OpenVolume = efi_file_open_volume,
+};
+
+/** Dummy block I/O reset */
+static EFI_STATUS EFIAPI
+efi_block_io_reset ( EFI_BLOCK_IO_PROTOCOL *this __unused,
+ BOOLEAN extended __unused ) {
+ return 0;
+}
+
+/** Dummy block I/O read */
+static EFI_STATUS EFIAPI
+efi_block_io_read_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused,
+ UINT32 MediaId __unused, EFI_LBA lba __unused,
+ UINTN len __unused, VOID *data __unused ) {
+ return EFI_DEVICE_ERROR;
+}
+
+/** Dummy block I/O write */
+static EFI_STATUS EFIAPI
+efi_block_io_write_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused,
+ UINT32 MediaId __unused, EFI_LBA lba __unused,
+ UINTN len __unused, VOID *data __unused ) {
+ return EFI_DEVICE_ERROR;
+}
+
+/** Dummy block I/O flush */
+static EFI_STATUS EFIAPI
+efi_block_io_flush_blocks ( EFI_BLOCK_IO_PROTOCOL *this __unused ) {
+ return 0;
+}
+
+/** Dummy block I/O media */
+static EFI_BLOCK_IO_MEDIA efi_block_io_media = {
+ .MediaId = EFI_MEDIA_ID_MAGIC,
+ .MediaPresent = 1,
+ .ReadOnly = 1,
+ .BlockSize = 1,
+};
+
+/** Dummy EFI block I/O protocol */
+static EFI_BLOCK_IO_PROTOCOL efi_block_io_protocol = {
+ .Revision = EFI_BLOCK_IO_PROTOCOL_REVISION,
+ .Media = &efi_block_io_media,
+ .Reset = efi_block_io_reset,
+ .ReadBlocks = efi_block_io_read_blocks,
+ .WriteBlocks = efi_block_io_write_blocks,
+ .FlushBlocks = efi_block_io_flush_blocks,
+};
+
+/**
+ * Install EFI simple file system protocol
+ *
+ * @v handle EFI handle
+ * @ret rc Return status code
+ */
+int efi_file_install ( EFI_HANDLE *handle ) {
+ EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
+ EFI_STATUS efirc;
+
+ /* Install the simple file system protocol and the block I/O
+ * protocol. We don't have a block device, but large parts of
+ * the EDK2 codebase make the assumption that file systems are
+ * normally attached to block devices, and so we create a
+ * dummy block device on the same handle just to keep things
+ * looking normal.
+ */
+ if ( ( efirc = bs->InstallMultipleProtocolInterfaces (
+ handle,
+ &efi_block_io_protocol_guid,
+ &efi_block_io_protocol,
+ &efi_simple_file_system_protocol_guid,
+ &efi_simple_file_system_protocol, NULL ) ) != 0 ) {
+ DBGC ( handle, "Could not install simple file system protocol: "
+ "%s\n", efi_strerror ( efirc ) );
+ return EFIRC_TO_RC ( efirc );
+ }
+
+ return 0;
+}
+
+/**
+ * Uninstall EFI simple file system protocol
+ *
+ * @v handle EFI handle
+ */
+void efi_file_uninstall ( EFI_HANDLE handle ) {
+ EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
+
+ /* We must install the file system protocol first, since
+ * otherwise the EDK2 code will attempt to helpfully uninstall
+ * it when the block I/O protocol is uninstalled, leading to a
+ * system lock-up.
+ */
+ bs->UninstallMultipleProtocolInterfaces (
+ handle,
+ &efi_simple_file_system_protocol_guid,
+ &efi_simple_file_system_protocol,
+ &efi_block_io_protocol_guid,
+ &efi_block_io_protocol, NULL );
+}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/interface/efi/efi_snp.c
^
|
@@ -33,6 +33,8 @@
#include <ipxe/efi/efi_driver.h>
#include <ipxe/efi/efi_strings.h>
#include <ipxe/efi/efi_snp.h>
+#include <config/general.h>
+#include <usr/autoboot.h>
/** EFI simple network protocol GUID */
static EFI_GUID efi_simple_network_protocol_guid
@@ -56,10 +58,14 @@
{ 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 }
};
-/** EFI component name protocol */
+/** EFI component name protocol GUID */
static EFI_GUID efi_component_name2_protocol_guid
= EFI_COMPONENT_NAME2_PROTOCOL_GUID;
+/** EFI load file protocol GUID */
+static EFI_GUID efi_load_file_protocol_guid
+ = EFI_LOAD_FILE_PROTOCOL_GUID;
+
/** List of SNP devices */
static LIST_HEAD ( efi_snp_devices );
@@ -755,6 +761,49 @@
/******************************************************************************
*
+ * Load file protocol
+ *
+ ******************************************************************************
+ */
+
+/**
+ * Load file
+ *
+ * @v loadfile Load file protocol
+ * @v path File path
+ * @v booting Loading as part of a boot attempt
+ * @ret efirc EFI status code
+ */
+static EFI_STATUS EFIAPI
+efi_snp_load_file ( EFI_LOAD_FILE_PROTOCOL *load_file,
+ EFI_DEVICE_PATH_PROTOCOL *path __unused,
+ BOOLEAN booting, UINTN *len __unused,
+ VOID *data __unused ) {
+ struct efi_snp_device *snpdev =
+ container_of ( load_file, struct efi_snp_device, load_file );
+ struct net_device *netdev = snpdev->netdev;
+
+ /* Fail unless this is a boot attempt */
+ if ( ! booting ) {
+ DBGC ( snpdev, "SNPDEV %p cannot load non-boot file\n",
+ snpdev );
+ return EFI_UNSUPPORTED;
+ }
+
+ /* Boot from network device */
+ ipxe ( netdev );
+
+ /* Assume boot process was aborted */
+ return EFI_ABORTED;
+}
+
+/** Load file protocol */
+static EFI_LOAD_FILE_PROTOCOL efi_snp_load_file_protocol = {
+ .LoadFile = efi_snp_load_file,
+};
+
+/******************************************************************************
+ *
* iPXE network driver
*
******************************************************************************
@@ -849,16 +898,21 @@
/* Populate the component name structure */
efi_snprintf ( snpdev->driver_name,
( sizeof ( snpdev->driver_name ) /
- sizeof ( snpdev->driver_name[0] ) ), "%s",
- netdev->dev->driver_name );
+ sizeof ( snpdev->driver_name[0] ) ),
+ PRODUCT_SHORT_NAME " %s", netdev->dev->driver_name );
efi_snprintf ( snpdev->controller_name,
( sizeof ( snpdev->controller_name ) /
- sizeof ( snpdev->controller_name[0] ) ), "%s (%s)",
+ sizeof ( snpdev->controller_name[0] ) ),
+ PRODUCT_SHORT_NAME " %s (%s)",
netdev->name, netdev_addr ( netdev ) );
snpdev->name2.GetDriverName = efi_snp_get_driver_name;
snpdev->name2.GetControllerName = efi_snp_get_controller_name;
snpdev->name2.SupportedLanguages = "en";
+ /* Populate the load file protocol structure */
+ memcpy ( &snpdev->load_file, &efi_snp_load_file_protocol,
+ sizeof ( snpdev->load_file ) );
+
/* Populate the device name */
efi_snprintf ( snpdev->name, ( sizeof ( snpdev->name ) /
sizeof ( snpdev->name[0] ) ),
@@ -888,6 +942,7 @@
&efi_nii_protocol_guid, &snpdev->nii,
&efi_nii31_protocol_guid, &snpdev->nii,
&efi_component_name2_protocol_guid, &snpdev->name2,
+ &efi_load_file_protocol_guid, &snpdev->load_file,
NULL ) ) != 0 ) {
DBGC ( snpdev, "SNPDEV %p could not install protocols: "
"%s\n", snpdev, efi_strerror ( efirc ) );
@@ -929,6 +984,7 @@
&efi_nii_protocol_guid, &snpdev->nii,
&efi_nii31_protocol_guid, &snpdev->nii,
&efi_component_name2_protocol_guid, &snpdev->name2,
+ &efi_load_file_protocol_guid, &snpdev->load_file,
NULL );
err_install_protocol_interface:
bs->CloseEvent ( snpdev->snp.WaitForPacket );
@@ -990,6 +1046,7 @@
&efi_nii_protocol_guid, &snpdev->nii,
&efi_nii31_protocol_guid, &snpdev->nii,
&efi_component_name2_protocol_guid, &snpdev->name2,
+ &efi_load_file_protocol_guid, &snpdev->load_file,
NULL );
bs->CloseEvent ( snpdev->snp.WaitForPacket );
netdev_put ( snpdev->netdev );
@@ -1003,3 +1060,18 @@
.notify = efi_snp_notify,
.remove = efi_snp_remove,
};
+
+/**
+ * Get most recently opened SNP device
+ *
+ * @ret snpdev Most recently opened SNP device, or NULL
+ */
+struct efi_snp_device * last_opened_snpdev ( void ) {
+ struct net_device *netdev;
+
+ netdev = last_opened_netdev();
+ if ( ! netdev )
+ return NULL;
+
+ return efi_snp_demux ( netdev );
+}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/net/netdevice.c
^
|
@@ -33,6 +33,7 @@
#include <ipxe/init.h>
#include <ipxe/device.h>
#include <ipxe/errortab.h>
+#include <ipxe/vlan.h>
#include <ipxe/netdevice.h>
/** @file
@@ -783,5 +784,27 @@
net_poll();
}
+/**
+ * Get the VLAN tag (when VLAN support is not present)
+ *
+ * @v netdev Network device
+ * @ret tag 0, indicating that device is not a VLAN device
+ */
+__weak unsigned int vlan_tag ( struct net_device *netdev __unused ) {
+ return 0;
+}
+
+/**
+ * Identify VLAN device (when VLAN support is not present)
+ *
+ * @v trunk Trunk network device
+ * @v tag VLAN tag
+ * @ret netdev VLAN device, if any
+ */
+__weak struct net_device * vlan_find ( struct net_device *trunk __unused,
+ unsigned int tag __unused ) {
+ return NULL;
+}
+
/** Networking stack process */
PERMANENT_PROCESS ( net_process, net_step );
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/net/tls.c
^
|
@@ -105,10 +105,6 @@
#define EINFO_EINVAL_MAC \
__einfo_uniqify ( EINFO_EINVAL, 0x0d, \
"Invalid MAC" )
-#define EINVAL_NON_DATA __einfo_error ( EINFO_EINVAL_NON_DATA )
-#define EINFO_EINVAL_NON_DATA \
- __einfo_uniqify ( EINFO_EINVAL, 0x0e, \
- "Overlength non-data record" )
#define EIO_ALERT __einfo_error ( EINFO_EIO_ALERT )
#define EINFO_EIO_ALERT \
__einfo_uniqify ( EINFO_EINVAL, 0x01, \
@@ -137,6 +133,10 @@
#define EINFO_ENOMEM_RX_DATA \
__einfo_uniqify ( EINFO_ENOMEM, 0x07, \
"Not enough space for received data" )
+#define ENOMEM_RX_CONCAT __einfo_error ( EINFO_ENOMEM_RX_CONCAT )
+#define EINFO_ENOMEM_RX_CONCAT \
+ __einfo_uniqify ( EINFO_ENOMEM, 0x08, \
+ "Not enough space to concatenate received data" )
#define ENOTSUP_CIPHER __einfo_error ( EINFO_ENOTSUP_CIPHER )
#define EINFO_ENOTSUP_CIPHER \
__einfo_uniqify ( EINFO_ENOTSUP, 0x01, \
@@ -1743,14 +1743,12 @@
return 0;
}
- /* For all other records, fail unless we have exactly one I/O buffer */
- iobuf = list_first_entry ( rx_data, struct io_buffer, list );
- assert ( iobuf != NULL );
- list_del ( &iobuf->list );
- if ( ! list_empty ( rx_data ) ) {
- DBGC ( tls, "TLS %p overlength non-data record\n", tls );
- free_iob ( iobuf );
- return -EINVAL_NON_DATA;
+ /* For all other records, merge into a single I/O buffer */
+ iobuf = iob_concatenate ( rx_data );
+ if ( ! iobuf ) {
+ DBGC ( tls, "TLS %p could not concatenate non-data record "
+ "type %d\n", tls, type );
+ return -ENOMEM_RX_CONCAT;
}
/* Determine handler */
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/net/udp/dns.c
^
|
@@ -428,7 +428,7 @@
}
/* Determine what to do next based on the type of query we
- * issued and the reponse we received
+ * issued and the response we received
*/
switch ( qtype ) {
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/net/udp/tftp.c
^
|
@@ -288,24 +288,6 @@
}
/**
- * TFTP requested blocksize
- *
- * This is treated as a global configuration parameter.
- */
-static unsigned int tftp_request_blksize = TFTP_MAX_BLKSIZE;
-
-/**
- * Set TFTP request blocksize
- *
- * @v blksize Requested block size
- */
-void tftp_set_request_blksize ( unsigned int blksize ) {
- if ( blksize < TFTP_DEFAULT_BLKSIZE )
- blksize = TFTP_DEFAULT_BLKSIZE;
- tftp_request_blksize = blksize;
-}
-
-/**
* MTFTP multicast receive address
*
* This is treated as a global configuration parameter.
@@ -345,6 +327,7 @@
const char *path;
size_t len;
struct io_buffer *iobuf;
+ size_t blksize;
/* Strip initial '/' if present. If we were opened via the
* URI interface, then there will be an initial '/', since a
@@ -370,6 +353,11 @@
if ( ! iobuf )
return -ENOMEM;
+ /* Determine block size */
+ blksize = xfer_window ( &tftp->xfer );
+ if ( blksize > TFTP_MAX_BLKSIZE )
+ blksize = TFTP_MAX_BLKSIZE;
+
/* Build request */
rrq = iob_put ( iobuf, sizeof ( *rrq ) );
rrq->opcode = htons ( TFTP_RRQ );
@@ -378,8 +366,8 @@
if ( tftp->flags & TFTP_FL_RRQ_SIZES ) {
iob_put ( iobuf, snprintf ( iobuf->tail,
iob_tailroom ( iobuf ),
- "blksize%c%d%ctsize%c0", 0,
- tftp_request_blksize, 0, 0 ) + 1 );
+ "blksize%c%zd%ctsize%c0",
+ 0, blksize, 0, 0 ) + 1 );
}
if ( tftp->flags & TFTP_FL_RRQ_MULTICAST ) {
iob_put ( iobuf, snprintf ( iobuf->tail,
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/net/vlan.c
^
|
@@ -283,6 +283,23 @@
};
/**
+ * Get the VLAN tag
+ *
+ * @v netdev Network device
+ * @ret tag VLAN tag, or 0 if device is not a VLAN device
+ */
+unsigned int vlan_tag ( struct net_device *netdev ) {
+ struct vlan_device *vlan;
+
+ if ( netdev->op == &vlan_operations ) {
+ vlan = netdev->priv;
+ return vlan->tag;
+ } else {
+ return 0;
+ }
+}
+
+/**
* Check if network device can be used as a VLAN trunk device
*
* @v trunk Trunk network device
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/usr/autoboot.c
^
|
@@ -30,11 +30,18 @@
#include <ipxe/uri.h>
#include <ipxe/open.h>
#include <ipxe/init.h>
+#include <ipxe/keys.h>
+#include <ipxe/version.h>
+#include <ipxe/shell.h>
+#include <ipxe/features.h>
+#include <ipxe/image.h>
#include <usr/ifmgmt.h>
#include <usr/route.h>
#include <usr/dhcpmgmt.h>
#include <usr/imgmgmt.h>
+#include <usr/prompt.h>
#include <usr/autoboot.h>
+#include <config/general.h>
/** @file
*
@@ -47,6 +54,18 @@
#define EINFO_ENOENT_BOOT \
__einfo_uniqify ( EINFO_ENOENT, 0x01, "Nothing to boot" )
+#define NORMAL "\033[0m"
+#define BOLD "\033[1m"
+#define CYAN "\033[36m"
+
+/** The "scriptlet" setting */
+struct setting scriptlet_setting __setting ( SETTING_MISC ) = {
+ .name = "scriptlet",
+ .description = "Boot scriptlet",
+ .tag = DHCP_EB_SCRIPTLET,
+ .type = &setting_type_string,
+};
+
/**
* Perform PXE menu boot when PXE stack is not available
*/
@@ -423,3 +442,79 @@
printf ( "No more network devices\n" );
return rc;
}
+
+/**
+ * Prompt for shell entry
+ *
+ * @ret enter_shell User wants to enter shell
+ */
+static int shell_banner ( void ) {
+
+ /* Skip prompt if timeout is zero */
+ if ( BANNER_TIMEOUT <= 0 )
+ return 0;
+
+ /* Prompt user */
+ printf ( "\n" );
+ return ( prompt ( "Press Ctrl-B for the iPXE command line...",
+ ( BANNER_TIMEOUT * 100 ), CTRL_B ) == 0 );
+}
+
+/**
+ * Main iPXE flow of execution
+ *
+ * @v netdev Network device, or NULL
+ */
+void ipxe ( struct net_device *netdev ) {
+ struct feature *feature;
+ struct image *image;
+ char *scriptlet;
+
+ /*
+ * Print welcome banner
+ *
+ *
+ * If you wish to brand this build of iPXE, please do so by
+ * defining the string PRODUCT_NAME in config/general.h.
+ *
+ * While nothing in the GPL prevents you from removing all
+ * references to iPXE or http://ipxe.org, we prefer you not to
+ * do so.
+ *
+ */
+ printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "iPXE %s"
+ NORMAL " -- Open Source Network Boot Firmware -- "
+ CYAN "http://ipxe.org" NORMAL "\n"
+ "Features:", product_version );
+ for_each_table_entry ( feature, FEATURES )
+ printf ( " %s", feature->name );
+ printf ( "\n" );
+
+ /* Boot system */
+ if ( ( image = first_image() ) != NULL ) {
+ /* We have an embedded image; execute it */
+ image_exec ( image );
+ } else if ( shell_banner() ) {
+ /* User wants shell; just give them a shell */
+ shell();
+ } else {
+ fetch_string_setting_copy ( NULL, &scriptlet_setting,
+ &scriptlet );
+ if ( scriptlet ) {
+ /* User has defined a scriptlet; execute it */
+ system ( scriptlet );
+ free ( scriptlet );
+ } else {
+ /* Try booting. If booting fails, offer the
+ * user another chance to enter the shell.
+ */
+ if ( netdev ) {
+ netboot ( netdev );
+ } else {
+ autoboot();
+ }
+ if ( shell_banner() )
+ shell();
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/util/elf2efi.c
^
|
@@ -18,6 +18,8 @@
*/
#define _GNU_SOURCE
+#define PACKAGE "elf2efi"
+#define PACKAGE_VERSION "1"
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
@@ -614,8 +616,11 @@
struct pe_section *section;
unsigned long fpos = 0;
+ /* Align length of headers */
+ fpos = pe_header->nt.OptionalHeader.SizeOfHeaders =
+ efi_file_align ( pe_header->nt.OptionalHeader.SizeOfHeaders );
+
/* Assign raw data pointers */
- fpos = efi_file_align ( pe_header->nt.OptionalHeader.SizeOfHeaders );
for ( section = pe_sections ; section ; section = section->next ) {
if ( section->hdr.SizeOfRawData ) {
section->hdr.PointerToRawData = fpos;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:ipxe-1.0.0git.tar.gz/src/util/zbin.c
^
|
@@ -143,7 +143,7 @@
max_len );
return -1;
}
- memset ( output->buf, 0xff, sizeof ( output->buf ) );
+ memset ( output->buf, 0xff, max_len );
return 0;
}
|