summaryrefslogtreecommitdiff
path: root/src/drivers/wifi/generic_wifi.h
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2019-05-29 15:09:42 -0600
committerMartin Roth <martinroth@google.com>2019-07-13 18:25:47 +0000
commitfd5d788f5e8139b387314d453644d9e58b1a654f (patch)
treedef3b90d8d5951c8b27e1f25e4afdb0b2e7e41dc /src/drivers/wifi/generic_wifi.h
parent328c8bbd23284527a9d54697a4631c8bda95fd89 (diff)
drivers/wifi: Add generic WiFi driver
Add generic WiFi driver to support common device operations across multiple types of WiFi controller. BUG=None BRANCH=None TEST=Boot to ChromeOS. Ensure that the SSDT table contains SAR tables and wakeup GPE information. Ensure that the SSDT table is same after the change. Change-Id: Ica5edf95a37c8ed60f7e159d94fd58af5d41c0ef Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33155 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/drivers/wifi/generic_wifi.h')
-rw-r--r--src/drivers/wifi/generic_wifi.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/drivers/wifi/generic_wifi.h b/src/drivers/wifi/generic_wifi.h
new file mode 100644
index 0000000000..5f17c3e297
--- /dev/null
+++ b/src/drivers/wifi/generic_wifi.h
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Google LLC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _GENERIC_WIFI_H_
+#define _GENERIC_WIFI_H_
+
+/**
+ * struct generic_wifi_config - Data structure to contain common wifi config
+ * @wake: Wake pin for ACPI _PRW
+ * @maxsleep: Maximum sleep state to wake from
+ */
+struct generic_wifi_config {
+ unsigned int wake;
+ unsigned int maxsleep;
+};
+
+/**
+ * wifi_fill_ssdt() - Fill ACPI SSDT table for WiFi controller
+ * @dev: Device structure corresponding to WiFi controller.
+ * @config: Common wifi config required to fill ACPI SSDT table.
+ *
+ * This function implements common device operation to help fill ACPI SSDT
+ * table for WiFi controller.
+ */
+void generic_wifi_fill_ssdt(struct device *dev,
+ const struct generic_wifi_config *config);
+
+/**
+ * wifi_acpi_name() - Get ACPI name for WiFi controller
+ * @dev: Device structure corresponding to WiFi controller.
+ *
+ * This function implements common device operation to get the ACPI name for
+ * WiFi controller.
+ *
+ * Return: string representing the ACPI name for WiFi controller.
+ */
+const char *generic_wifi_acpi_name(const struct device *dev);
+
+#endif /* _GENERIC_WIFI_H_ */