linux/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Common methods for use with hp-bioscfg driver
 *
 *  Copyright (c) 2022 HP Development Company, L.P.
 */

#define pr_fmt(fmt)

#include <linux/fs.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/wmi.h>
#include "bioscfg.h"
#include "../../firmware_attributes_class.h"
#include <linux/nls.h>
#include <linux/errno.h>

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

struct bioscfg_priv bioscfg_drv =;

static const struct class *fw_attr_class;

ssize_t display_name_language_code_show(struct kobject *kobj,
					struct kobj_attribute *attr,
					char *buf)
{}

struct kobj_attribute common_display_langcode =;

int hp_get_integer_from_buffer(u8 **buffer, u32 *buffer_size, u32 *integer)
{}

int hp_get_string_from_buffer(u8 **buffer, u32 *buffer_size, char *dst, u32 dst_size)
{}

int hp_get_common_data_from_buffer(u8 **buffer_ptr, u32 *buffer_size,
				   struct common_data *common_data)
{}

int hp_enforce_single_line_input(char *buf, size_t count)
{}

/* Set pending reboot value and generate KOBJ_NAME event */
void hp_set_reboot_and_signal_event(void)
{}

/**
 * hp_calculate_string_buffer() - determines size of string buffer for
 * use with BIOS communication
 *
 * @str: the string to calculate based upon
 */
size_t hp_calculate_string_buffer(const char *str)
{}

int hp_wmi_error_and_message(int error_code)
{}

static ssize_t pending_reboot_show(struct kobject *kobj,
				   struct kobj_attribute *attr,
				   char *buf)
{}

static struct kobj_attribute pending_reboot =;

/*
 * create_attributes_level_sysfs_files() - Creates pending_reboot attributes
 */
static int create_attributes_level_sysfs_files(void)
{}

static void attr_name_release(struct kobject *kobj)
{}

static const struct kobj_type attr_name_ktype =;

/**
 * hp_get_wmiobj_pointer() - Get Content of WMI block for particular instance
 *
 * @instance_id: WMI instance ID
 * @guid_string: WMI GUID (in str form)
 *
 * Fetches the content for WMI block (instance_id) under GUID (guid_string)
 * Caller must kfree the return
 */
union acpi_object *hp_get_wmiobj_pointer(int instance_id, const char *guid_string)
{}

/**
 * hp_get_instance_count() - Compute total number of instances under guid_string
 *
 * @guid_string: WMI GUID (in string form)
 */
int hp_get_instance_count(const char *guid_string)
{}

/**
 * hp_alloc_attributes_data() - Allocate attributes data for a particular type
 *
 * @attr_type: Attribute type to allocate
 */
static int hp_alloc_attributes_data(int attr_type)
{}

int hp_convert_hexstr_to_str(const char *input, u32 input_len, char **str, int *len)
{}

/* map output size to the corresponding WMI method id */
int hp_encode_outsize_for_pvsz(int outsize)
{}

/*
 * Update friendly display name for several attributes associated to
 * 'Schedule Power-On'
 */
void hp_friendly_user_name_update(char *path, const char *attr_name,
				  char *attr_display, int attr_size)
{}

/**
 * hp_update_attribute_permissions() - Update attributes permissions when
 * isReadOnly value is 1
 *
 * @is_readonly:  bool value to indicate if it a readonly attribute.
 * @current_val: kobj_attribute corresponding to attribute.
 *
 */
void hp_update_attribute_permissions(bool is_readonly, struct kobj_attribute *current_val)
{}

/**
 * destroy_attribute_objs() - Free a kset of kobjects
 * @kset: The kset to destroy
 *
 * Fress kobjects created for each attribute_name under attribute type kset
 */
static void destroy_attribute_objs(struct kset *kset)
{}

/**
 * release_attributes_data() - Clean-up all sysfs directories and files created
 */
static void release_attributes_data(void)
{}

/**
 * hp_add_other_attributes() - Initialize HP custom attributes not
 * reported by BIOS and required to support Secure Platform and Sure
 * Start.
 *
 * @attr_type: Custom HP attribute not reported by BIOS
 *
 * Initialize all 2 types of attributes: Platform and Sure Start
 * object.  Populates each attribute types respective properties
 * under sysfs files.
 *
 * Returns zero(0) if successful. Otherwise, a negative value.
 */
static int hp_add_other_attributes(int attr_type)
{}

static int hp_init_bios_package_attribute(enum hp_wmi_data_type attr_type,
					  union acpi_object *obj,
					  const char *guid, int min_elements,
					  int instance_id)
{}

static int hp_init_bios_buffer_attribute(enum hp_wmi_data_type attr_type,
					 union acpi_object *obj,
					 const char *guid, int min_elements,
					 int instance_id)
{}

/**
 * hp_init_bios_attributes() - Initialize all attributes for a type
 * @attr_type: The attribute type to initialize
 * @guid: The WMI GUID associated with this type to initialize
 *
 * Initialize all 5 types of attributes: enumeration, integer,
 * string, password, ordered list  object.  Populates each attribute types
 * respective properties under sysfs files
 */
static int hp_init_bios_attributes(enum hp_wmi_data_type attr_type, const char *guid)
{}

static int __init hp_init(void)
{}

static void __exit hp_exit(void)
{}

module_init();
module_exit(hp_exit);