libsmbios_c library
|
00001 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c: 00002 /* 00003 * Copyright (C) 2005 Dell Inc. 00004 * by Michael Brown <Michael_E_Brown@dell.com> 00005 * Licensed under the Open Software License version 2.1 00006 * 00007 * Alternatively, you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published 00009 * by the Free Software Foundation; either version 2 of the License, 00010 * or (at your option) any later version. 00011 00012 * This program is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00015 * See the GNU General Public License for more details. 00016 */ 00017 00018 #ifndef C_SMI_H 00019 #define C_SMI_H 00020 00021 // include smbios_c/compat.h first 00022 #include "smbios_c/compat.h" 00023 #include "smbios_c/types.h" 00024 00025 EXTERN_C_BEGIN; 00026 00027 enum { 00028 cbARG1 = 0, 00029 cbARG2 = 1, 00030 cbARG3 = 2, 00031 cbARG4 = 3, 00032 cbRES1 = 0, 00033 cbRES2 = 1, 00034 cbRES3 = 2, 00035 cbRES4 = 3, 00036 }; 00037 00038 LIBSMBIOS_C_DLL_SPEC const char *dell_smi_strerror(); 00039 00040 LIBSMBIOS_C_DLL_SPEC int dell_simple_ci_smi(u16 smiClass, u16 select, const u32 args[4], u32 res[4]); 00041 00042 // not yet implemented 00043 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]); 00044 00045 LIBSMBIOS_C_DLL_SPEC int dell_smi_read_nv_storage (u32 location, u32 *curValue, u32 *minValue, u32 *maxValue); 00046 LIBSMBIOS_C_DLL_SPEC int dell_smi_read_battery_mode_setting(u32 location, u32 *curValue, u32 *minValue, u32 *maxValue); 00047 LIBSMBIOS_C_DLL_SPEC int dell_smi_read_ac_mode_setting (u32 location, u32 *curValue, u32 *minValue, u32 *maxValue); 00048 00049 LIBSMBIOS_C_DLL_SPEC int dell_smi_write_nv_storage (u16 security_key, u32 location, u32 value, u32 *smiret); 00050 LIBSMBIOS_C_DLL_SPEC int dell_smi_write_battery_mode_setting(u16 security_key, u32 location, u32 value, u32 *smiret); 00051 LIBSMBIOS_C_DLL_SPEC int dell_smi_write_ac_mode_setting (u16 security_key, u32 location, u32 value, u32 *smiret); 00052 00053 // password related functions 00054 enum { DELL_SMI_PASSWORD_ANY = 0, DELL_SMI_PASSWORD_USER = 9, DELL_SMI_PASSWORD_ADMIN = 10, DELL_SMI_PASSWORD_OWNER = 12 }; 00055 enum { DELL_SMI_PASSWORD_FMT_SCANCODE = 0, DELL_SMI_PASSWORD_FMT_ASCII = 1 }; 00056 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_format(int which); 00057 LIBSMBIOS_C_DLL_SPEC int dell_smi_get_security_key(const char *password, u16 *security_key); 00058 LIBSMBIOS_C_DLL_SPEC bool dell_smi_is_password_present(int which); 00059 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_verify(int which, const char *password); 00060 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_max_len(int which); 00061 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_min_len(int which); 00062 LIBSMBIOS_C_DLL_SPEC int dell_smi_password_change(int which, const char *oldpass, const char *newpass); 00063 00064 EXTERN_C_END; 00065 00066 #endif /* C_SMI_H */