Commit 96f7ef90 authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart

dell-smbios: implement new function for finding DMI table 0xDA tokens

Ultimately, the da_tokens table should not be exported from dell-smbios.
Currently, in some cases, dell-laptop accesses that table's members
directly, so implement a new function, dell_smbios_find_token(), which
returns a pointer to an entry inside the da_tokens table with the given
token ID (or NULL if it is not found).
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 92ebd0d1
......@@ -77,6 +77,19 @@ void dell_smbios_send_request(int class, int select)
}
EXPORT_SYMBOL_GPL(dell_smbios_send_request);
struct calling_interface_token *dell_smbios_find_token(int tokenid)
{
int i;
for (i = 0; i < da_num_tokens; i++) {
if (da_tokens[i].tokenID == tokenid)
return &da_tokens[i];
}
return NULL;
}
EXPORT_SYMBOL_GPL(dell_smbios_find_token);
int find_token_id(int tokenid)
{
int i;
......
......@@ -42,6 +42,8 @@ void dell_smbios_clear_buffer(void);
void dell_smbios_release_buffer(void);
void dell_smbios_send_request(int class, int select);
struct calling_interface_token *dell_smbios_find_token(int tokenid);
int find_token_id(int tokenid);
int find_token_location(int tokenid);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment