Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
dmi-sysfs.c File Reference
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kobject.h>
#include <linux/dmi.h>
#include <linux/capability.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/io.h>

Go to the source code of this file.

Data Structures

struct  dmi_sysfs_entry
 
struct  dmi_sysfs_attribute
 
struct  dmi_sysfs_mapped_attribute
 
struct  find_dmi_data
 
struct  dmi_read_state
 
struct  dmi_entry_attr_show_data
 
struct  dmi_system_event_log
 

Macros

#define MAX_ENTRY_TYPE
 
#define DMI_SYSFS_ATTR(_entry, _name)
 
#define DMI_SYSFS_MAPPED_ATTR(_entry, _name)
 
#define DMI_SEL_ACCESS_METHOD_IO8   0x00
 
#define DMI_SEL_ACCESS_METHOD_IO2x8   0x01
 
#define DMI_SEL_ACCESS_METHOD_IO16   0x02
 
#define DMI_SEL_ACCESS_METHOD_PHYS32   0x03
 
#define DMI_SEL_ACCESS_METHOD_GPNV   0x04
 
#define DMI_SYSFS_SEL_FIELD(_field)
 

Typedefs

typedef ssize_t(* dmi_callback )(struct dmi_sysfs_entry *, const struct dmi_header *dh, void *)
 
typedef u8(* sel_io_reader )(const struct dmi_system_event_log *sel, loff_t offset)
 

Functions

 DMI_SYSFS_SEL_FIELD (area_length)
 
 DMI_SYSFS_SEL_FIELD (header_start_offset)
 
 DMI_SYSFS_SEL_FIELD (data_start_offset)
 
 DMI_SYSFS_SEL_FIELD (access_method)
 
 DMI_SYSFS_SEL_FIELD (status)
 
 DMI_SYSFS_SEL_FIELD (change_token)
 
 DMI_SYSFS_SEL_FIELD (access_method_address)
 
 DMI_SYSFS_SEL_FIELD (header_format)
 
 DMI_SYSFS_SEL_FIELD (type_descriptors_supported_count)
 
 DMI_SYSFS_SEL_FIELD (per_log_type_descriptor_length)
 
 module_init (dmi_sysfs_init)
 
 module_exit (dmi_sysfs_exit)
 
 MODULE_AUTHOR ("Mike Waychison <[email protected]>")
 
 MODULE_DESCRIPTION ("DMI sysfs support")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct dmi_system_event_log __packed
 

Macro Definition Documentation

#define DMI_SEL_ACCESS_METHOD_GPNV   0x04

Definition at line 240 of file dmi-sysfs.c.

#define DMI_SEL_ACCESS_METHOD_IO16   0x02

Definition at line 238 of file dmi-sysfs.c.

#define DMI_SEL_ACCESS_METHOD_IO2x8   0x01

Definition at line 237 of file dmi-sysfs.c.

#define DMI_SEL_ACCESS_METHOD_IO8   0x00

Definition at line 236 of file dmi-sysfs.c.

#define DMI_SEL_ACCESS_METHOD_PHYS32   0x03

Definition at line 239 of file dmi-sysfs.c.

#define DMI_SYSFS_ATTR (   _entry,
  _name 
)
Value:
struct dmi_sysfs_attribute dmi_sysfs_attr_##_entry##_##_name = { \
.attr = {.name = __stringify(_name), .mode = 0400}, \
.show = dmi_sysfs_##_entry##_##_name, \
}

Definition at line 54 of file dmi-sysfs.c.

#define DMI_SYSFS_MAPPED_ATTR (   _entry,
  _name 
)
Value:
struct dmi_sysfs_mapped_attribute dmi_sysfs_attr_##_entry##_##_name = { \
.attr = {.name = __stringify(_name), .mode = 0400}, \
.show = dmi_sysfs_##_entry##_##_name, \
}

Definition at line 71 of file dmi-sysfs.c.

#define DMI_SYSFS_SEL_FIELD (   _field)
Value:
static ssize_t dmi_sysfs_sel_##_field(struct dmi_sysfs_entry *entry, \
const struct dmi_header *dh, \
char *buf) \
{ \
if (sizeof(sel) > dmi_entry_length(dh)) \
return -EIO; \
memcpy(&sel, dh, sizeof(sel)); \
return sprintf(buf, "%u\n", sel._field); \
} \
static DMI_SYSFS_MAPPED_ATTR(sel, _field)

Definition at line 265 of file dmi-sysfs.c.

#define MAX_ENTRY_TYPE
Value:
255 /* Most of these aren't used, but we consider
the top entry type is only 8 bits */

Definition at line 29 of file dmi-sysfs.c.

Typedef Documentation

typedef ssize_t(* dmi_callback)(struct dmi_sysfs_entry *, const struct dmi_header *dh, void *)

Definition at line 112 of file dmi-sysfs.c.

typedef u8(* sel_io_reader)(const struct dmi_system_event_log *sel, loff_t offset)

Definition at line 310 of file dmi-sysfs.c.

Function Documentation

DMI_SYSFS_SEL_FIELD ( area_length  )
DMI_SYSFS_SEL_FIELD ( header_start_offset  )
DMI_SYSFS_SEL_FIELD ( data_start_offset  )
DMI_SYSFS_SEL_FIELD ( access_method  )
DMI_SYSFS_SEL_FIELD ( status  )
DMI_SYSFS_SEL_FIELD ( change_token  )
DMI_SYSFS_SEL_FIELD ( access_method_address  )
DMI_SYSFS_SEL_FIELD ( header_format  )
DMI_SYSFS_SEL_FIELD ( type_descriptors_supported_count  )
DMI_SYSFS_SEL_FIELD ( per_log_type_descriptor_length  )
MODULE_AUTHOR ( "Mike Waychison <[email protected]>"  )
MODULE_DESCRIPTION ( "DMI sysfs support )
module_exit ( dmi_sysfs_exit  )
module_init ( dmi_sysfs_init  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation