Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
dmi_scan.c File Reference
#include <linux/types.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ctype.h>
#include <linux/dmi.h>
#include <linux/efi.h>
#include <linux/bootmem.h>
#include <linux/random.h>
#include <asm/dmi.h>

Go to the source code of this file.

Functions

void __init dmi_scan_machine (void)
 
int dmi_check_system (const struct dmi_system_id *list)
 
 EXPORT_SYMBOL (dmi_check_system)
 
struct dmi_system_iddmi_first_match (const struct dmi_system_id *list)
 
 EXPORT_SYMBOL (dmi_first_match)
 
const chardmi_get_system_info (int field)
 
 EXPORT_SYMBOL (dmi_get_system_info)
 
int dmi_name_in_serial (const char *str)
 
int dmi_name_in_vendors (const char *str)
 
 EXPORT_SYMBOL (dmi_name_in_vendors)
 
: device name string or NULL to match all

dmi_find_device - find onboard device by type/name : device type or DMI_DEV_TYPE_ANY to match all device types

: previous device found in search, or NULL for new search.

Iterates through the list of known onboard devices. If a device is found with a matching and , a pointer to its device structure is returned. Otherwise, NULL is returned. A new search is initiated by passing NULL as the argument. If is not NULL, searches continue from next device.

struct dmi_devicedmi_find_device (int type, const char *name, const struct dmi_device *from)
 
 EXPORT_SYMBOL (dmi_find_device)
 
bool dmi_get_date (int field, int *yearp, int *monthp, int *dayp)
 
 EXPORT_SYMBOL (dmi_get_date)
 
int dmi_walk (void(*decode)(const struct dmi_header *, void *), void *private_data)
 
 EXPORT_SYMBOL_GPL (dmi_walk)
 
bool dmi_match (enum dmi_field f, const char *str)
 
 EXPORT_SYMBOL_GPL (dmi_match)
 

Variables

int dmi_available
 

Function Documentation

int dmi_check_system ( const struct dmi_system_id list)

dmi_check_system - check system DMI data : array of dmi_system_id structures to match against All non-null elements of the list must match their slot's (field index's) data (i.e., each list string must be a substring of the specified DMI slot's string data) to be considered a successful match.

Walk the blacklist table running matching functions until someone returns non zero or we hit the end. Callback function is called for each successful match. Returns the number of matches.

Definition at line 525 of file dmi_scan.c.

struct dmi_device* dmi_find_device ( int  type,
const char name,
const struct dmi_device from 
)
read

Definition at line 619 of file dmi_scan.c.

struct dmi_system_id* dmi_first_match ( const struct dmi_system_id list)
read

dmi_first_match - find dmi_system_id structure matching system DMI data : array of dmi_system_id structures to match against All non-null elements of the list must match their slot's (field index's) data (i.e., each list string must be a substring of the specified DMI slot's string data) to be considered a successful match.

Walk the blacklist table until the first match is found. Return the pointer to the matching entry or NULL if there's no match.

Definition at line 553 of file dmi_scan.c.

bool dmi_get_date ( int  field,
int yearp,
int monthp,
int dayp 
)

dmi_get_date - parse a DMI date : data index (see enum dmi_field) : optional out parameter for the year : optional out parameter for the month : optional out parameter for the day

The date field is assumed to be in the form resembling [mm[/dd]]/yy[yy] and the result is stored in the out parameters any or all of which can be omitted.

If the field doesn't exist, all out parameters are set to zero and false is returned. Otherwise, true is returned with any invalid part of date set to zero.

On return, year, month and day are guaranteed to be in the range of [0,9999], [0,12] and [0,31] respectively.

Definition at line 656 of file dmi_scan.c.

const char* dmi_get_system_info ( int  field)

dmi_get_system_info - return DMI data value : data index (see enum dmi_field)

Returns one DMI data value, can be used to perform complex DMI data checks.

Definition at line 572 of file dmi_scan.c.

bool dmi_match ( enum dmi_field  f,
const char str 
)

dmi_match - compare a string to the dmi field (if exists) : DMI field identifier : string to compare the DMI field to

Returns true if the requested field equals to the str (including NULL).

Definition at line 743 of file dmi_scan.c.

int dmi_name_in_serial ( const char str)

dmi_name_in_serial - Check if string is in the DMI product serial information : string to check for

Definition at line 582 of file dmi_scan.c.

int dmi_name_in_vendors ( const char str)

dmi_name_in_vendors - Check if string is in the DMI system or board vendor name : Case sensitive Name

Definition at line 594 of file dmi_scan.c.

void __init dmi_scan_machine ( void  )

Definition at line 430 of file dmi_scan.c.

int dmi_walk ( void(*)(const struct dmi_header *, void *)  decode,
void private_data 
)

dmi_walk - Walk the DMI table and get called back for every record : Callback function : Private data to be passed to the callback function

Returns -1 when the DMI table can't be reached, 0 on success.

Definition at line 717 of file dmi_scan.c.

EXPORT_SYMBOL ( dmi_check_system  )
EXPORT_SYMBOL ( dmi_first_match  )
EXPORT_SYMBOL ( dmi_get_system_info  )
EXPORT_SYMBOL ( dmi_name_in_vendors  )
EXPORT_SYMBOL ( dmi_find_device  )
EXPORT_SYMBOL ( dmi_get_date  )
EXPORT_SYMBOL_GPL ( dmi_walk  )
EXPORT_SYMBOL_GPL ( dmi_match  )

Variable Documentation

int dmi_available

Definition at line 134 of file dmi_scan.c.