libsmbios_c library
smi.h
Go to the documentation of this file.
1 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2 /*
3  * Copyright (C) 2005 Dell Inc.
4  * by Michael Brown <Michael_E_Brown@dell.com>
5  * Licensed under the Open Software License version 2.1
6  *
7  * Alternatively, you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published
9  * by the Free Software Foundation; either version 2 of the License,
10  * or (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  * See the GNU General Public License for more details.
16  */
17 
18 #ifndef C_SMI_H
19 #define C_SMI_H
20 
21 // include smbios_c/compat.h first
22 #include "smbios_c/compat.h"
23 #include "smbios_c/types.h"
24 
26 
27 enum {
28  cbARG1 = 0,
29  cbARG2 = 1,
30  cbARG3 = 2,
31  cbARG4 = 3,
32  cbRES1 = 0,
33  cbRES2 = 1,
34  cbRES3 = 2,
35  cbRES4 = 3,
36 };
37 
39 
40 LIBSMBIOS_C_DLL_SPEC int dell_simple_ci_smi(u16 smiClass, u16 select, const u32 args[4], u32 res[4]);
41 
42 // not yet implemented
43 LIBSMBIOS_C_DLL_SPEC int dell_adv_ci_smi(u16 smiClass, u16 select, const u32 args[4], u32 res[4], const u8 *buffer[4], const size_t buffer_size[4]);
44 
45 LIBSMBIOS_C_DLL_SPEC int dell_smi_read_nv_storage (u32 location, u32 *curValue, u32 *minValue, u32 *maxValue);
46 LIBSMBIOS_C_DLL_SPEC int dell_smi_read_battery_mode_setting(u32 location, u32 *curValue, u32 *minValue, u32 *maxValue);
47 LIBSMBIOS_C_DLL_SPEC int dell_smi_read_ac_mode_setting (u32 location, u32 *curValue, u32 *minValue, u32 *maxValue);
48 
49 LIBSMBIOS_C_DLL_SPEC int dell_smi_write_nv_storage (u16 security_key, u32 location, u32 value, u32 *smiret);
50 LIBSMBIOS_C_DLL_SPEC int dell_smi_write_battery_mode_setting(u16 security_key, u32 location, u32 value, u32 *smiret);
51 LIBSMBIOS_C_DLL_SPEC int dell_smi_write_ac_mode_setting (u16 security_key, u32 location, u32 value, u32 *smiret);
52 
53 // password related functions
57 LIBSMBIOS_C_DLL_SPEC int dell_smi_get_security_key(const char *password, u16 *security_key);
59 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_verify(int which, const char *password);
62 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_change(int which, const char *oldpass, const char *newpass);
63 
65 
66 #endif /* C_SMI_H */
LIBSMBIOS_C_DLL_SPEC int dell_smi_password_min_len(int which)
LIBSMBIOS_C_DLL_SPEC int dell_smi_write_battery_mode_setting(u16 security_key, u32 location, u32 value, u32 *smiret)
Definition: smi.h:29
LIBSMBIOS_C_DLL_SPEC int dell_smi_password_format(int which)
Definition: smi.h:54
LIBSMBIOS_C_DLL_SPEC int dell_simple_ci_smi(u16 smiClass, u16 select, const u32 args[4], u32 res[4])
LIBSMBIOS_C_DLL_SPEC int dell_smi_read_nv_storage(u32 location, u32 *curValue, u32 *minValue, u32 *maxValue)
#define LIBSMBIOS_C_DLL_SPEC
Definition: compat.h:48
LIBSMBIOS_C_DLL_SPEC int dell_smi_get_security_key(const char *password, u16 *security_key)
Definition: smi.h:28
Definition: smi.h:30
LIBSMBIOS_C_DLL_SPEC int dell_smi_password_verify(int which, const char *password)
Definition: smi.h:33
LIBSMBIOS_C_DLL_SPEC int dell_smi_write_ac_mode_setting(u16 security_key, u32 location, u32 value, u32 *smiret)
LIBSMBIOS_C_DLL_SPEC int dell_smi_read_ac_mode_setting(u32 location, u32 *curValue, u32 *minValue, u32 *maxValue)
Definition: smi.h:54
Definition: smi.h:34
Definition: smi.h:54
Definition: smi.h:35
Definition: smi.h:55
LIBSMBIOS_C_DLL_SPEC bool dell_smi_is_password_present(int which)
Definition: smi.h:31
unsigned int u32
Definition: types.h:37
LIBSMBIOS_C_DLL_SPEC int dell_smi_password_max_len(int which)
LIBSMBIOS_C_DLL_SPEC const char * dell_smi_strerror()
#define EXTERN_C_BEGIN
Definition: compat.h:55
LIBSMBIOS_C_DLL_SPEC int dell_smi_write_nv_storage(u16 security_key, u32 location, u32 value, u32 *smiret)
unsigned short u16
Definition: types.h:33
unsigned char u8
Definition: types.h:29
Definition: smi.h:55
Definition: smi.h:32
Definition: smi.h:54
LIBSMBIOS_C_DLL_SPEC int dell_smi_password_change(int which, const char *oldpass, const char *newpass)
#define EXTERN_C_END
Definition: compat.h:56
LIBSMBIOS_C_DLL_SPEC int dell_adv_ci_smi(u16 smiClass, u16 select, const u32 args[4], u32 res[4], const u8 *buffer[4], const size_t buffer_size[4])
LIBSMBIOS_C_DLL_SPEC int dell_smi_read_battery_mode_setting(u32 location, u32 *curValue, u32 *minValue, u32 *maxValue)