iPXE
snp.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 *
19 * You can also choose to distribute this program under the terms of
20 * the Unmodified Binary Distribution Licence (as given in the file
21 * COPYING.UBDL), provided that you have satisfied its requirements.
22 */
23
24FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25FILE_SECBOOT ( PERMITTED );
26
27#include <ipxe/efi/efi.h>
28#include <ipxe/efi/efi_driver.h>
29#include "snpnet.h"
30#include "nii.h"
31
32/** @file
33 *
34 * SNP driver
35 *
36 */
37
38/**
39 * Check to see if driver supports a device
40 *
41 * @v device EFI device handle
42 * @ret rc Return status code
43 */
49
50/**
51 * Check to see if driver supports a device
52 *
53 * @v device EFI device handle
54 * @ret rc Return status code
55 */
61
62/** EFI SNP driver */
63struct efi_driver snp_driver __efi_driver ( EFI_DRIVER_SNP ) = {
64 .name = "SNP",
65 .supported = snp_supported,
66 .exclude = snpnet_exclude,
67 .start = snpnet_start,
68 .stop = snpnet_stop,
69};
70
71/** EFI NII driver */
72struct efi_driver nii_driver __efi_driver ( EFI_DRIVER_NII ) = {
73 .name = "NII",
74 .supported = nii_supported,
75 .exclude = nii_exclude,
76 .start = nii_start,
77 .stop = nii_stop,
78};
79
80/** Drag in MNP driver */
81REQUIRING_SYMBOL ( snp_driver );
82REQUIRE_SYMBOL ( mnp_driver );
83
84/* Generate build rules */
85EFI_ROM ( "snp", "Simple Network Protocol NIC" );
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
EFI driver interface.
#define __efi_driver(order)
Declare an EFI driver.
Definition efi_driver.h:70
#define EFI_DRIVER_SNP
SNP protocol drivers.
Definition efi_driver.h:75
#define EFI_DRIVER_NII
NII protocol drivers.
Definition efi_driver.h:74
#define EFI_ROM(_name, _desc)
Define build rules for an EFI driver.
Definition efi_driver.h:79
EFI_GUID efi_simple_network_protocol_guid
Simple network protocol GUID.
Definition efi_guid.c:341
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
Definition efi_guid.c:309
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define REQUIRING_SYMBOL(symbol)
Specify the file's requiring symbol.
Definition compiler.h:140
#define REQUIRE_SYMBOL(symbol)
Require a symbol.
Definition compiler.h:121
EFI API.
#define EFI_HANDLE
Definition efi.h:53
int nii_start(struct efi_device *efidev)
Attach driver to device.
Definition nii.c:1287
int nii_exclude(EFI_HANDLE device)
Exclude existing drivers.
Definition nii.c:1267
void nii_stop(struct efi_device *efidev)
Detach driver from device.
Definition nii.c:1398
NII driver.
static int snp_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition snp.c:44
static int nii_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition snp.c:56
int snpnet_supported(EFI_HANDLE device, EFI_GUID *protocol, int inhibit_wifi)
Check to see if driver supports a device.
Definition snpnet.c:511
int snpnet_start(struct efi_device *efidev)
Attach driver to device.
Definition snpnet.c:728
int snpnet_exclude(EFI_HANDLE device)
Exclude existing drivers.
Definition snpnet.c:693
void snpnet_stop(struct efi_device *efidev)
Detach driver from device.
Definition snpnet.c:845
SNP NIC driver.
uint16_t protocol
Protocol ID.
Definition stp.h:7
A hardware device.
Definition device.h:77
An EFI driver.
Definition efi_driver.h:34