aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/interface/efi
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/interface/efi')
-rw-r--r--gpxe/src/interface/efi/efi_console.c2
-rw-r--r--gpxe/src/interface/efi/efi_init.c18
-rw-r--r--gpxe/src/interface/efi/efi_io.c2
-rw-r--r--gpxe/src/interface/efi/efi_pci.c2
-rw-r--r--gpxe/src/interface/efi/efi_smbios.c2
-rw-r--r--gpxe/src/interface/efi/efi_snp.c21
-rw-r--r--gpxe/src/interface/efi/efi_strerror.c2
-rw-r--r--gpxe/src/interface/efi/efi_timer.c2
-rw-r--r--gpxe/src/interface/efi/efi_uaccess.c2
-rw-r--r--gpxe/src/interface/efi/efi_umalloc.c2
10 files changed, 32 insertions, 23 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>