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 
24 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 FILE_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  */
46 
47  return snpnet_supported ( device, protocol, 1 );
48 }
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  */
58 
59  return snpnet_supported ( device, protocol, 1 );
60 }
61 
62 /** EFI SNP driver */
63 struct 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 */
72 struct 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 */
81 REQUIRING_SYMBOL ( snp_driver );
82 REQUIRE_SYMBOL ( mnp_driver );
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
Definition: efi_guid.c:309
NII driver.
REQUIRE_SYMBOL(mnp_driver)
EFI driver interface.
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
int nii_start(struct efi_device *efidev)
Attach driver to device.
Definition: nii.c:1287
void snpnet_stop(struct efi_device *efidev)
Detach driver from device.
Definition: snpnet.c:845
EFI_GUID efi_simple_network_protocol_guid
Simple network protocol GUID.
Definition: efi_guid.c:341
void nii_stop(struct efi_device *efidev)
Detach driver from device.
Definition: nii.c:1398
int nii_exclude(EFI_HANDLE device)
Exclude existing drivers.
Definition: nii.c:1267
static int snp_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition: snp.c:44
int snpnet_start(struct efi_device *efidev)
Attach driver to device.
Definition: snpnet.c:728
FILE_SECBOOT(PERMITTED)
A hardware device.
Definition: device.h:77
#define EFI_DRIVER_SNP
SNP protocol drivers.
Definition: efi_driver.h:75
int snpnet_supported(EFI_HANDLE device, EFI_GUID *protocol, int inhibit_wifi)
Check to see if driver supports a device.
Definition: snpnet.c:511
struct efi_driver snp_driver __efi_driver(EFI_DRIVER_SNP)
EFI SNP driver.
SNP NIC driver.
static int nii_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition: snp.c:56
EFI API.
An EFI driver.
Definition: efi_driver.h:34
REQUIRING_SYMBOL(snp_driver)
Drag in MNP driver.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const char * name
Name.
Definition: efi_driver.h:36
uint16_t protocol
Protocol ID.
Definition: stp.h:19
int snpnet_exclude(EFI_HANDLE device)
Exclude existing drivers.
Definition: snpnet.c:693
#define EFI_DRIVER_NII
NII protocol drivers.
Definition: efi_driver.h:74
Definition: efi.h:62