coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lenovo_serials.c File Reference
#include <types.h>
#include <string.h>
#include <device/device.h>
#include <device/smbus.h>
#include <smbios.h>
#include <console/console.h>
#include <version.h>
#include "lenovo.h"
Include dependency graph for lenovo_serials.c:

Go to the source code of this file.

Macros

#define ERROR_STRING   "*INVALID*"
 

Functions

static struct deviceat24rf08c_find_bank (u8 bank)
 
static int at24rf08c_read_byte (struct device *dev, u8 addr)
 
static void at24rf08c_read_string_dev (struct device *dev, u8 start, u8 len, char *result)
 
static void at24rf08c_read_string (u8 bank, u8 start, u8 len, char *result)
 
const char * smbios_mainboard_serial_number (void)
 
const char * lenovo_mainboard_partnumber (void)
 
const char * smbios_mainboard_product_name (void)
 
void smbios_system_set_uuid (u8 *uuid)
 
const char * smbios_mainboard_version (void)
 
const char * smbios_mainboard_bios_version (void)
 
const char * smbios_mainboard_manufacturer (void)
 

Macro Definition Documentation

◆ ERROR_STRING

#define ERROR_STRING   "*INVALID*"

Definition at line 12 of file lenovo_serials.c.

Function Documentation

◆ at24rf08c_find_bank()

static struct device* at24rf08c_find_bank ( u8  bank)
static

Definition at line 14 of file lenovo_serials.c.

References BIOS_WARNING, dev_find_slot_on_smbus(), and printk.

Referenced by at24rf08c_read_string(), and smbios_mainboard_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ at24rf08c_read_byte()

static int at24rf08c_read_byte ( struct device dev,
u8  addr 
)
static

Definition at line 23 of file lenovo_serials.c.

References addr, and smbus_read_byte().

Referenced by at24rf08c_read_string_dev(), and smbios_mainboard_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ at24rf08c_read_string()

static void at24rf08c_read_string ( u8  bank,
u8  start,
u8  len,
char *  result 
)
static

Definition at line 56 of file lenovo_serials.c.

References at24rf08c_find_bank(), at24rf08c_read_string_dev(), BIOS_WARNING, ERROR_STRING, memcpy(), NULL, and printk.

Referenced by lenovo_mainboard_partnumber(), and smbios_mainboard_serial_number().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ at24rf08c_read_string_dev()

static void at24rf08c_read_string_dev ( struct device dev,
u8  start,
u8  len,
char *  result 
)
static

Definition at line 40 of file lenovo_serials.c.

References at24rf08c_read_byte(), ERROR_STRING, and memcpy().

Referenced by at24rf08c_read_string(), and smbios_mainboard_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lenovo_mainboard_partnumber()

const char* lenovo_mainboard_partnumber ( void  )

Definition at line 85 of file lenovo_serials.c.

References at24rf08c_read_string(), and memset().

Referenced by drivers_lenovo_is_wacom_present(), and smbios_mainboard_product_name().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ smbios_mainboard_bios_version()

const char* smbios_mainboard_bios_version ( void  )

Definition at line 184 of file lenovo_serials.c.

References coreboot_version, NULL, s, strconcat(), and strlen().

Here is the call graph for this function:

◆ smbios_mainboard_manufacturer()

const char* smbios_mainboard_manufacturer ( void  )

Definition at line 198 of file lenovo_serials.c.

◆ smbios_mainboard_product_name()

const char* smbios_mainboard_product_name ( void  )

Definition at line 100 of file lenovo_serials.c.

References lenovo_mainboard_partnumber().

Here is the call graph for this function:

◆ smbios_mainboard_serial_number()

const char* smbios_mainboard_serial_number ( void  )

Definition at line 70 of file lenovo_serials.c.

References at24rf08c_read_string(), and memset().

Here is the call graph for this function:

◆ smbios_mainboard_version()

const char* smbios_mainboard_version ( void  )

Definition at line 154 of file lenovo_serials.c.

References at24rf08c_find_bank(), at24rf08c_read_byte(), at24rf08c_read_string_dev(), ERROR_STRING, memcpy(), memset(), and NULL.

Here is the call graph for this function:

◆ smbios_system_set_uuid()

void smbios_system_set_uuid ( u8 uuid)

Definition at line 105 of file lenovo_serials.c.

References BIOS_WARNING, dev_find_slot_on_smbus(), memcpy(), memset(), NULL, printk, and smbus_read_byte().

Here is the call graph for this function: