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 
26 #include <ipxe/efi/efi.h>
27 #include <ipxe/efi/efi_driver.h>
28 #include "snpnet.h"
29 #include "nii.h"
30 
31 /** @file
32  *
33  * SNP driver
34  *
35  */
36 
37 /**
38  * Check to see if driver supports a device
39  *
40  * @v device EFI device handle
41  * @ret rc Return status code
42  */
45 
46  return snpnet_supported ( device, protocol, 1 );
47 }
48 
49 /**
50  * Check to see if driver supports a device
51  *
52  * @v device EFI device handle
53  * @ret rc Return status code
54  */
57 
58  return snpnet_supported ( device, protocol, 1 );
59 }
60 
61 /** EFI SNP driver */
62 struct efi_driver snp_driver __efi_driver ( EFI_DRIVER_SNP ) = {
63  .name = "SNP",
64  .supported = snp_supported,
65  .exclude = snpnet_exclude,
66  .start = snpnet_start,
67  .stop = snpnet_stop,
68 };
69 
70 /** EFI NII driver */
71 struct efi_driver nii_driver __efi_driver ( EFI_DRIVER_NII ) = {
72  .name = "NII",
73  .supported = nii_supported,
74  .exclude = nii_exclude,
75  .start = nii_start,
76  .stop = nii_stop,
77 };
78 
79 /** Drag in MNP driver */
80 REQUIRING_SYMBOL ( snp_driver );
81 REQUIRE_SYMBOL ( mnp_driver );
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
Definition: efi_guid.c:308
NII driver.
REQUIRE_SYMBOL(mnp_driver)
EFI driver interface.
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
int nii_start(struct efi_device *efidev)
Attach driver to device.
Definition: nii.c:1286
void snpnet_stop(struct efi_device *efidev)
Detach driver from device.
Definition: snpnet.c:844
EFI_GUID efi_simple_network_protocol_guid
Simple network protocol GUID.
Definition: efi_guid.c:340
void nii_stop(struct efi_device *efidev)
Detach driver from device.
Definition: nii.c:1397
int nii_exclude(EFI_HANDLE device)
Exclude existing drivers.
Definition: nii.c:1266
static int snp_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition: snp.c:43
int snpnet_start(struct efi_device *efidev)
Attach driver to device.
Definition: snpnet.c:727
A hardware device.
Definition: device.h:76
#define EFI_DRIVER_SNP
SNP protocol drivers.
Definition: efi_driver.h:74
int snpnet_supported(EFI_HANDLE device, EFI_GUID *protocol, int inhibit_wifi)
Check to see if driver supports a device.
Definition: snpnet.c:510
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:55
EFI API.
An EFI driver.
Definition: efi_driver.h:33
REQUIRING_SYMBOL(snp_driver)
Drag in MNP driver.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const char * name
Name.
Definition: efi_driver.h:35
uint16_t protocol
Protocol ID.
Definition: stp.h:18
int snpnet_exclude(EFI_HANDLE device)
Exclude existing drivers.
Definition: snpnet.c:692
#define EFI_DRIVER_NII
NII protocol drivers.
Definition: efi_driver.h:73
Definition: efi.h:61