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 
26 /** @file
27  *
28  * MNP driver
29  *
30  */
31 
32 #include <errno.h>
33 #include <ipxe/efi/efi.h>
34 #include <ipxe/efi/efi_driver.h>
35 #include <ipxe/efi/mnpnet.h>
36 #include "snpnet.h"
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, binding );
48 }
49 
50 /** EFI MNP driver */
51 struct efi_driver mnp_driver __efi_driver ( EFI_DRIVER_NORMAL ) = {
52  .name = "MNP",
53  .supported = mnp_supported,
54  .start = mnpnet_start,
55  .stop = mnpnet_stop,
56 };
EFI driver interface.
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
Error codes.
int snpnet_supported(EFI_HANDLE device, EFI_GUID *protocol)
Check to see if driver supports a device.
Definition: snpnet.c:495
EFI_GUID efi_managed_network_service_binding_protocol_guid
Managed network service binding protocol GUID.
Definition: efi_guid.c:255
static int mnp_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition: mnp.c:44
struct efi_driver mnp_driver __efi_driver(EFI_DRIVER_NORMAL)
EFI MNP driver.
A hardware device.
Definition: device.h:73
MNP NIC driver.
SNP NIC driver.
void mnpnet_stop(struct efi_device *efidev)
Detach driver from device.
Definition: mnpnet.c:484
EFI API.
An EFI driver.
Definition: efi_driver.h:33
const char * name
Name.
Definition: efi_driver.h:35
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int mnpnet_start(struct efi_device *efidev)
Attach driver to device.
Definition: mnpnet.c:369
Definition: efi.h:59
#define EFI_DRIVER_NORMAL
Normal drivers.
Definition: efi_driver.h:65