iPXE
linux.h File Reference

Linux devices, drivers and device requests. More...

#include <ipxe/list.h>
#include <ipxe/device.h>
#include <ipxe/settings.h>

Go to the source code of this file.

Data Structures

struct  linux_device
 A linux device. More...
struct  linux_driver
 A linux driver. More...
struct  linux_device_request
 A device request. More...
struct  linux_setting
 A device request setting. More...

Macros

#define ELINUX(errno)
 Convert a Linux error number to an iPXE status code.
#define LINUX_DRIVERS   __table(struct linux_driver, "linux_drivers")
 Linux driver table.
#define __linux_driver   __table_entry(LINUX_DRIVERS, 01)
 Declare a Linux driver.
#define LINUX_ROM(_name, _desc)
 Define build rules for a Linux driver.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static void linux_set_drvdata (struct linux_device *device, void *priv)
 Set linux device driver-private data.
static void * linux_get_drvdata (struct linux_device *device)
 Get linux device driver-private data.
struct linux_settinglinux_find_setting (char *name, struct list_head *settings)
 Look for the last occurrence of a setting with the specified name.
void linux_apply_settings (struct list_head *new_settings, struct settings *settings_block)
 Apply a list of linux settings to a settings block.

Variables

struct list_head linux_device_requests
 List of requested devices.
struct list_head linux_global_settings
 List of global settings to apply.

Detailed Description

Linux devices, drivers and device requests.

Definition in file linux.h.

Macro Definition Documentation

◆ ELINUX

#define ELINUX ( errno)
Value:
int errno
Global "last error" number.
Definition errno.c:21
#define EPLATFORM(einfo_base, platform,...)
Generate an error based on an external platform error code.
Definition errno.h:249
#define EINFO_EPLATFORM
Platform-generated base error.
Definition errno.h:692

Convert a Linux error number to an iPXE status code.

Parameters
errnoLinux error number
Return values
rciPXE status code (before negation)

Definition at line 39 of file linux.h.

Referenced by slirp_poll().

◆ LINUX_DRIVERS

#define LINUX_DRIVERS   __table(struct linux_driver, "linux_drivers")

Linux driver table.

Definition at line 64 of file linux.h.

◆ __linux_driver

#define __linux_driver   __table_entry(LINUX_DRIVERS, 01)

Declare a Linux driver.

Definition at line 67 of file linux.h.

◆ LINUX_ROM

#define LINUX_ROM ( _name,
_desc )

Define build rules for a Linux driver.

Definition at line 70 of file linux.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ linux_set_drvdata()

void linux_set_drvdata ( struct linux_device * device,
void * priv )
inlinestatic

Set linux device driver-private data.

Parameters
deviceLinux device
privPrivate data

Definition at line 78 of file linux.h.

79{
80 device->priv = priv;
81}
A hardware device.
Definition device.h:77
static struct tlan_private * priv
Definition tlan.c:225

References priv.

Referenced by af_packet_nic_probe(), slirp_probe(), and tap_probe().

◆ linux_get_drvdata()

void * linux_get_drvdata ( struct linux_device * device)
inlinestatic

Get linux device driver-private data.

Parameters
deviceLinux device
Return values
privPrivate data

Definition at line 89 of file linux.h.

90{
91 return device->priv;
92}

Referenced by af_packet_nic_remove(), slirp_remove(), and tap_remove().

◆ linux_find_setting()

struct linux_setting * linux_find_setting ( char * name,
struct list_head * settings )

Look for the last occurrence of a setting with the specified name.

Parameters
nameName of the setting to look for
settingsList of the settings to look through

References name.

Referenced by af_packet_nic_probe(), and tap_probe().

◆ linux_apply_settings()

void linux_apply_settings ( struct list_head * new_settings,
struct settings * settings_block )
extern

Apply a list of linux settings to a settings block.

Parameters
new_settingsList of linux_setting's to apply
settings_blockSettings block to apply the settings to
Return values
rc0 on success

Referenced by af_packet_nic_probe(), slirp_probe(), and tap_probe().

Variable Documentation

◆ linux_device_requests

struct list_head linux_device_requests
extern

List of requested devices.

Filled by the UI code. Linux root_driver walks over this list looking for an appropriate driver to handle each request by matching the driver's name.

Referenced by linux_args_cleanup(), and parse_net_args().

◆ linux_global_settings

struct list_head linux_global_settings
extern

List of global settings to apply.

Filled by the UI code. Linux root_driver applies these settings.

Referenced by linux_args_cleanup(), and parse_settings_args().