lkml.org 
[lkml]   [2017]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v10 11/15] platform/x86: dell-smbios-smm: test for WSMT
    On Thursday 19 October 2017 12:50:14 Mario Limonciello wrote:
    > +/* When enabled this indicates that SMM won't work */
    > +static bool test_wsmt_enabled(void)
    > +{
    > + struct calling_interface_token *token;
    > +
    > + /* if token doesn't exist, SMM will work */
    > + token = dell_smbios_find_token(WSMT_EN_TOKEN);
    > + if (!token)
    > + return false;
    > +
    > + /* if token exists, try to access over SMM */
    > + buffer->class = CLASS_TOKEN_READ;
    > + buffer->select = SELECT_TOKEN_STD;
    > + memset(buffer, 0, sizeof(struct calling_interface_buffer));
    > + buffer->input[0] = token->location;
    > + dell_smbios_smm_call(buffer);
    > +
    > + /* if lookup failed, we know WSMT was enabled */
    > + if (buffer->output[0] != 0)
    > + return true;
    > +
    > + /* query token status if it didn't fail */
    > + return (buffer->output[1] == token->value);
    > +}
    > +
    > static int __init dell_smbios_smm_init(void)
    > {
    > int ret;
    > @@ -115,6 +140,13 @@ static int __init dell_smbios_smm_init(void)
    >
    > dmi_walk(find_cmd_address, NULL);
    >
    > + ret = test_wsmt_enabled();

    ret is int, but test_wsmt_enabled() returns bool.

    --
    Pali Rohár
    pali.rohar@gmail.com

    \
     
     \ /
      Last update: 2017-10-22 17:29    [W:3.542 / U:0.184 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site