summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/dell-smbios.h
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2016-01-22 17:27:13 +0300
committerDarren Hart <dvhart@linux.intel.com>2016-03-23 20:05:38 +0300
commit2f9f26bd8614740b3c3b950394d945a99492a28e (patch)
tree75ca9a6b8d4a117eb303e4e5f157c0c9b4210932 /drivers/platform/x86/dell-smbios.h
parent7faa6a37fa106cb0cad6203e8fc2aea646cb253a (diff)
downloadlinux-2f9f26bd8614740b3c3b950394d945a99492a28e.tar.xz
dell-laptop: extract SMBIOS-related code to a separate module
Extract SMBIOS-related code from dell-laptop to a new kernel module, dell-smbios. The static specifier is removed from exported symbols, otherwise code is just moved around. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> [dvhart: Include linux/io.h in dell-smbios.c as caught by lkp] Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/dell-smbios.h')
-rw-r--r--drivers/platform/x86/dell-smbios.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-smbios.h b/drivers/platform/x86/dell-smbios.h
new file mode 100644
index 000000000000..3bc9080e4c5d
--- /dev/null
+++ b/drivers/platform/x86/dell-smbios.h
@@ -0,0 +1,50 @@
+/*
+ * Common functions for kernel modules using Dell SMBIOS
+ *
+ * Copyright (c) Red Hat <mjg@redhat.com>
+ * Copyright (c) 2014 Gabriele Mazzotta <gabriele.mzt@gmail.com>
+ * Copyright (c) 2014 Pali Rohár <pali.rohar@gmail.com>
+ *
+ * Based on documentation in the libsmbios package:
+ * Copyright (C) 2005-2014 Dell Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _DELL_SMBIOS_H_
+#define _DELL_SMBIOS_H_
+
+/* This structure will be modified by the firmware when we enter
+ * system management mode, hence the volatiles */
+
+struct calling_interface_buffer {
+ u16 class;
+ u16 select;
+ volatile u32 input[4];
+ volatile u32 output[4];
+} __packed;
+
+struct calling_interface_token {
+ u16 tokenID;
+ u16 location;
+ union {
+ u16 value;
+ u16 stringlength;
+ };
+};
+
+extern struct calling_interface_buffer *buffer;
+extern struct calling_interface_token *da_tokens;
+
+void get_buffer(void);
+void clear_buffer(void);
+void release_buffer(void);
+struct calling_interface_buffer *
+dell_send_request(struct calling_interface_buffer *buffer,
+ int class, int select);
+
+int find_token_id(int tokenid);
+int find_token_location(int tokenid);
+#endif