iPXE
mnp.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 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 /** @file
28  *
29  * MNP driver
30  *
31  */
32 
33 #include <errno.h>
34 #include <ipxe/efi/efi.h>
35 #include <ipxe/efi/efi_driver.h>
36 #include <ipxe/efi/mnpnet.h>
37 #include "snpnet.h"
38 
39 /**
40  * Check to see if driver supports a device
41  *
42  * @v device EFI device handle
43  * @ret rc Return status code
44  */
47 
48  return snpnet_supported ( device, binding, 0 );
49 }
50 
51 /** EFI MNP driver */
52 struct efi_driver mnp_driver __efi_driver ( EFI_DRIVER_MNP ) = {
53  .name = "MNP",
54  .supported = mnp_supported,
55  .start = mnpnet_start,
56  .stop = mnpnet_stop,
57 };
EFI driver interface.
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
Error codes.
struct efi_driver mnp_driver __efi_driver(EFI_DRIVER_MNP)
EFI MNP driver.
EFI_GUID efi_managed_network_service_binding_protocol_guid
Managed network service binding protocol GUID.
Definition: efi_guid.c:285
FILE_SECBOOT(PERMITTED)
static int mnp_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition: mnp.c:45
A hardware device.
Definition: device.h:77
int snpnet_supported(EFI_HANDLE device, EFI_GUID *protocol, int inhibit_wifi)
Check to see if driver supports a device.
Definition: snpnet.c:511
#define EFI_DRIVER_MNP
MNP protocol drivers.
Definition: efi_driver.h:76
MNP NIC driver.
SNP NIC driver.
void mnpnet_stop(struct efi_device *efidev)
Detach driver from device.
Definition: mnpnet.c:475
EFI API.
An EFI driver.
Definition: efi_driver.h:34
const char * name
Name.
Definition: efi_driver.h:36
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int mnpnet_start(struct efi_device *efidev)
Attach driver to device.
Definition: mnpnet.c:370
Definition: efi.h:62