diff options
Diffstat (limited to 'gpxe/src/interface')
-rw-r--r-- | gpxe/src/interface/efi/efi_console.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_init.c | 18 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_io.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_pci.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_smbios.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_snp.c | 21 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_strerror.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_timer.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_uaccess.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/efi/efi_umalloc.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/smbios/smbios.c | 2 | ||||
-rw-r--r-- | gpxe/src/interface/smbios/smbios_settings.c | 27 |
12 files changed, 44 insertions, 40 deletions
diff --git a/gpxe/src/interface/efi/efi_console.c b/gpxe/src/interface/efi/efi_console.c index b78de618..04af28a2 100644 --- a/gpxe/src/interface/efi/efi_console.c +++ b/gpxe/src/interface/efi/efi_console.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stddef.h> #include <assert.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/efi/efi_init.c b/gpxe/src/interface/efi/efi_init.c index 6e54cf7e..ad550375 100644 --- a/gpxe/src/interface/efi/efi_init.c +++ b/gpxe/src/interface/efi/efi_init.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <string.h> #include <gpxe/efi/efi.h> #include <gpxe/uuid.h> @@ -26,18 +28,6 @@ EFI_HANDLE efi_image_handle; /** System table passed to entry point */ EFI_SYSTEM_TABLE *efi_systab; -/** Declared used EFI protocols */ -static struct efi_protocol efi_protocols[0] \ - __table_start ( struct efi_protocol, efi_protocols ); -static struct efi_protocol efi_protocols_end[0] \ - __table_end ( struct efi_protocol, efi_protocols ); - -/** Declared used EFI configuration tables */ -static struct efi_config_table efi_config_tables[0] \ - __table_start ( struct efi_config_table, efi_config_tables ); -static struct efi_config_table efi_config_tables_end[0] \ - __table_end ( struct efi_config_table, efi_config_tables ); - /** * Look up EFI configuration table * @@ -92,7 +82,7 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, /* Look up used protocols */ bs = systab->BootServices; - for ( prot = efi_protocols ; prot < efi_protocols_end ; prot++ ) { + for_each_table_entry ( prot, EFI_PROTOCOLS ) { if ( ( efirc = bs->LocateProtocol ( &prot->u.guid, NULL, prot->protocol ) ) == 0 ) { DBGC ( systab, "EFI protocol %s is at %p\n", @@ -106,7 +96,7 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, } /* Look up used configuration tables */ - for ( tab = efi_config_tables ; tab < efi_config_tables_end ; tab++ ) { + for_each_table_entry ( tab, EFI_CONFIG_TABLES ) { if ( ( *(tab->table) = efi_find_table ( &tab->u.guid ) ) ) { DBGC ( systab, "EFI configuration table %s is at %p\n", uuid_ntoa ( &tab->u.uuid ), *(tab->table) ); diff --git a/gpxe/src/interface/efi/efi_io.c b/gpxe/src/interface/efi/efi_io.c index e11f9bfd..0ba16f8f 100644 --- a/gpxe/src/interface/efi/efi_io.c +++ b/gpxe/src/interface/efi/efi_io.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <assert.h> #include <gpxe/io.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/efi/efi_pci.c b/gpxe/src/interface/efi/efi_pci.c index f87b5407..ec43391b 100644 --- a/gpxe/src/interface/efi/efi_pci.c +++ b/gpxe/src/interface/efi/efi_pci.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <errno.h> #include <gpxe/pci.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/efi/efi_smbios.c b/gpxe/src/interface/efi/efi_smbios.c index 5888f2f9..8caf624c 100644 --- a/gpxe/src/interface/efi/efi_smbios.c +++ b/gpxe/src/interface/efi/efi_smbios.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <errno.h> #include <gpxe/smbios.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/efi/efi_snp.c b/gpxe/src/interface/efi/efi_snp.c index 771b9174..b5241e54 100644 --- a/gpxe/src/interface/efi/efi_snp.c +++ b/gpxe/src/interface/efi/efi_snp.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -117,20 +119,20 @@ static EFI_GUID efi_pci_io_protocol_guid static void efi_snp_set_mode ( struct efi_snp_device *snpdev ) { struct net_device *netdev = snpdev->netdev; EFI_SIMPLE_NETWORK_MODE *mode = &snpdev->mode; - unsigned int ll_addr_len = netdev->ll_protocol->ll_addr_len; + struct ll_protocol *ll_protocol = netdev->ll_protocol; + unsigned int ll_addr_len = ll_protocol->ll_addr_len; mode->HwAddressSize = ll_addr_len; - mode->MediaHeaderSize = netdev->ll_protocol->ll_header_len; + mode->MediaHeaderSize = ll_protocol->ll_header_len; mode->MaxPacketSize = netdev->max_pkt_len; mode->ReceiveFilterMask = ( EFI_SIMPLE_NETWORK_RECEIVE_UNICAST | EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST | EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST ); assert ( ll_addr_len <= sizeof ( mode->CurrentAddress ) ); memcpy ( &mode->CurrentAddress, netdev->ll_addr, ll_addr_len ); - memcpy ( &mode->BroadcastAddress, netdev->ll_protocol->ll_broadcast, - ll_addr_len ); - memcpy ( &mode->PermanentAddress, netdev->ll_addr, ll_addr_len ); - mode->IfType = ntohs ( netdev->ll_protocol->ll_proto ); + memcpy ( &mode->BroadcastAddress, netdev->ll_broadcast, ll_addr_len ); + ll_protocol->init_addr ( netdev->hw_addr, &mode->PermanentAddress ); + mode->IfType = ntohs ( ll_protocol->ll_proto ); mode->MacAddressChangeable = TRUE; mode->MediaPresentSupported = TRUE; mode->MediaPresent = ( netdev_link_ok ( netdev ) ? TRUE : FALSE ); @@ -592,7 +594,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, /* Create link-layer header, if specified */ if ( ll_header_len ) { iob_pull ( iobuf, ll_header_len ); - if ( ( rc = ll_protocol->push ( iobuf, ll_dest, ll_src, + if ( ( rc = ll_protocol->push ( snpdev->netdev, + iobuf, ll_dest, ll_src, htons ( *net_proto ) )) != 0 ){ DBGC ( snpdev, "SNPDEV %p TX could not construct " "header: %s\n", snpdev, strerror ( rc ) ); @@ -670,8 +673,8 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, *len = iob_len ( iobuf ); /* Attempt to decode link-layer header */ - if ( ( rc = ll_protocol->pull ( iobuf, &iob_ll_dest, &iob_ll_src, - &iob_net_proto ) ) != 0 ) { + if ( ( rc = ll_protocol->pull ( snpdev->netdev, iobuf, &iob_ll_dest, + &iob_ll_src, &iob_net_proto ) ) != 0 ){ DBGC ( snpdev, "SNPDEV %p could not parse header: %s\n", snpdev, strerror ( rc ) ); efirc = RC_TO_EFIRC ( rc ); diff --git a/gpxe/src/interface/efi/efi_strerror.c b/gpxe/src/interface/efi/efi_strerror.c index adfeaed5..2bf4581d 100644 --- a/gpxe/src/interface/efi/efi_strerror.c +++ b/gpxe/src/interface/efi/efi_strerror.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdio.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/efi/efi_timer.c b/gpxe/src/interface/efi/efi_timer.c index d1ba43af..0dcb7605 100644 --- a/gpxe/src/interface/efi/efi_timer.c +++ b/gpxe/src/interface/efi/efi_timer.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <limits.h> #include <assert.h> #include <unistd.h> diff --git a/gpxe/src/interface/efi/efi_uaccess.c b/gpxe/src/interface/efi/efi_uaccess.c index 1c54c031..63e9521c 100644 --- a/gpxe/src/interface/efi/efi_uaccess.c +++ b/gpxe/src/interface/efi/efi_uaccess.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <gpxe/uaccess.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/efi/efi_umalloc.c b/gpxe/src/interface/efi/efi_umalloc.c index 4de3789d..7113c792 100644 --- a/gpxe/src/interface/efi/efi_umalloc.c +++ b/gpxe/src/interface/efi/efi_umalloc.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <assert.h> #include <gpxe/umalloc.h> #include <gpxe/efi/efi.h> diff --git a/gpxe/src/interface/smbios/smbios.c b/gpxe/src/interface/smbios/smbios.c index 8207c1fa..cc7df59a 100644 --- a/gpxe/src/interface/smbios/smbios.c +++ b/gpxe/src/interface/smbios/smbios.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <string.h> #include <errno.h> diff --git a/gpxe/src/interface/smbios/smbios_settings.c b/gpxe/src/interface/smbios/smbios_settings.c index 61c2d919..1c965646 100644 --- a/gpxe/src/interface/smbios/smbios_settings.c +++ b/gpxe/src/interface/smbios/smbios_settings.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +FILE_LICENCE ( GPL2_OR_LATER ); + #include <stdint.h> #include <string.h> #include <errno.h> @@ -62,22 +64,6 @@ ( offsetof ( _structure, _field ) << 8 ) ) /** - * Store value of SMBIOS setting - * - * @v settings Settings block - * @v setting Setting to store - * @v data Setting data, or NULL to clear setting - * @v len Length of setting data - * @ret rc Return status code - */ -static int smbios_store ( struct settings *settings __unused, - struct setting *setting __unused, - const void *data __unused, size_t len __unused ) { - /* Cannot write data into SMBIOS */ - return -ENOTSUP; -} - -/** * Fetch value of SMBIOS setting * * @v settings Settings block, or NULL to search all blocks @@ -133,7 +119,6 @@ static int smbios_fetch ( struct settings *settings __unused, /** SMBIOS settings operations */ static struct settings_operations smbios_settings_operations = { - .store = smbios_store, .fetch = smbios_fetch, }; @@ -198,4 +183,12 @@ struct setting smbios_named_settings[] __setting = { serial ), .type = &setting_type_string, }, + { + .name = "asset", + .description = "Asset tag", + .tag = SMBIOS_STRING_TAG ( SMBIOS_TYPE_ENCLOSURE_INFORMATION, + struct smbios_enclosure_information, + asset_tag ), + .type = &setting_type_string, + }, }; |