| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Common functions for kernel modules using Dell SMBIOS |
| 3 | * |
| 4 | * Copyright (c) Red Hat <mjg@redhat.com> |
| 5 | * Copyright (c) 2014 Gabriele Mazzotta <gabriele.mzt@gmail.com> |
| 6 | * Copyright (c) 2014 Pali Rohár <pali.rohar@gmail.com> |
| 7 | * |
| 8 | * Based on documentation in the libsmbios package: |
| 9 | * Copyright (C) 2005-2014 Dell Inc. |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. |
| 14 | */ |
| 15 | |
| 16 | #ifndef _DELL_SMBIOS_H_ |
| 17 | #define _DELL_SMBIOS_H_ |
| 18 | |
| 19 | /* This structure will be modified by the firmware when we enter |
| 20 | * system management mode, hence the volatiles */ |
| 21 | |
| 22 | struct calling_interface_buffer { |
| 23 | u16 class; |
| 24 | u16 select; |
| 25 | volatile u32 input[4]; |
| 26 | volatile u32 output[4]; |
| 27 | } __packed; |
| 28 | |
| 29 | struct calling_interface_token { |
| 30 | u16 tokenID; |
| 31 | u16 location; |
| 32 | union { |
| 33 | u16 value; |
| 34 | u16 stringlength; |
| 35 | }; |
| 36 | }; |
| 37 | |
| 38 | extern struct calling_interface_buffer *buffer; |
| 39 | extern struct calling_interface_token *da_tokens; |
| 40 | |
| Michał Kępień | ee83c47 | 2016-01-22 15:27:14 +0100 | [diff] [blame] | 41 | void dell_smbios_get_buffer(void); |
| Michał Kępień | b6aa7e1 | 2016-01-22 15:27:15 +0100 | [diff] [blame] | 42 | void dell_smbios_clear_buffer(void); |
| Michał Kępień | cb16176 | 2016-01-22 15:27:16 +0100 | [diff] [blame^] | 43 | void dell_smbios_release_buffer(void); |
| Michał Kępień | 2f9f26b | 2016-01-22 15:27:13 +0100 | [diff] [blame] | 44 | struct calling_interface_buffer * |
| 45 | dell_send_request(struct calling_interface_buffer *buffer, |
| 46 | int class, int select); |
| 47 | |
| 48 | int find_token_id(int tokenid); |
| 49 | int find_token_location(int tokenid); |
| 50 | #endif |