summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/dell-smbios.h
blob: c5e94742505bcbae2597efd077a1a78c87385811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 dell_smbios_get_buffer(void);
void dell_smbios_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
OpenPOWER on IntegriCloud