ACPI: move ACPI functionality out of r8152 driver
Subsystems (5)
PATCH 2/3 ACPI: move ACPI functionality out of r8152 driver
This change moves ACPI functionality out of the Realtek r8152 driver to its own source and header file, making it available to other drivers as needed now and into the future. At the time this ACPI snippet was introduced in 2016, only the Realtek driver made use of it in support of Dell's enterprise IT policy efforts. There comes now a need for this same support in a different driver, also in support of Dell's enterprise IT policy efforts.
Signed-off-by Charles Hyde <[email protected]>
Cc Mario Limonciello <[email protected]>
Cc Realtek linux nic maintainers <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
--- drivers/acpi/Makefile | 1 + drivers/acpi/acpi_mac_passthru.c | 63 ++++++++++++++++++++++++++++++++ drivers/net/usb/r8152.c | 44 ++-------------------- include/acpi/acpi_mac_passthru.h | 29 +++++++++++++++ 4 files changed, 97 insertions(+), 40 deletions(-) create mode 100644 drivers/acpi/acpi_mac_passthru.c create mode 100644 include/acpi/acpi_mac_passthru.h
drivers/acpi/Makefile +1 -0
@@ -66,6 +66,7 @@ acpi-$(CONFIG_ACPI_WATCHDOG) += acpi_watchdog.o acpi-$(CONFIG_ACPI_ADXL) += acpi_adxl.o # These are (potentially) separate modules +acpi-y += acpi_mac_passthru.o # IPMI may be used by other drivers, so it has to initialise before them obj-$(CONFIG_ACPI_IPMI) += acpi_ipmi.o
drivers/acpi/acpi_mac_passthru.c new file +63 -0
63 lines not on this page · raw message
drivers/net/usb/r8152.c +4 -40
71 lines not on this page · raw message
include/acpi/acpi_mac_passthru.h new file +29 -0
@@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* acpi_mac_passthru.h - ACPI MAC address pass through driver +* +* Copyright (c) 2019 Dell Technology. All rights reserved. +* +* Search for MAC Address Pass Through information, and return the MAC address +* found. This is set through enterprise policy settings, and expected to be +* read by ethernet drivers that have software programmable MAC addresses. +* Failure to find the needed information results in -ENODEV. +*/ + +#include <linux/module.h> +#include <linux/acpi.h> +//#include <linux/device.h> +//#include <linux/socket.h> + +#ifdef CONFIG_ACPI + +int get_acpi_mac_passthru (char *macAddress); + +#else + +static inline int get_acpi_mac_passthru (char *macAddress) +{ +return -ENODEV ; +} + +#endif
Signature · 1 line
2.20.1