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
24FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25FILE_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 */
52struct 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};
58
59/* Generate build rules */
60EFI_ROM ( "mnp", "Managed 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_MNP
MNP protocol drivers.
Definition efi_driver.h:76
#define EFI_ROM(_name, _desc)
Define build rules for an EFI driver.
Definition efi_driver.h:79
EFI_GUID efi_managed_network_service_binding_protocol_guid
Managed network service binding protocol GUID.
Definition efi_guid.c:285
Error codes.
#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
EFI API.
#define EFI_HANDLE
Definition efi.h:53
static int mnp_supported(EFI_HANDLE device)
Check to see if driver supports a device.
Definition mnp.c:45
int mnpnet_start(struct efi_device *efidev)
Attach driver to device.
Definition mnpnet.c:370
void mnpnet_stop(struct efi_device *efidev)
Detach driver from device.
Definition mnpnet.c:475
MNP NIC driver.
int snpnet_supported(EFI_HANDLE device, EFI_GUID *protocol, int inhibit_wifi)
Check to see if driver supports a device.
Definition snpnet.c:511
SNP NIC driver.
A hardware device.
Definition device.h:77
An EFI driver.
Definition efi_driver.h:34