iPXE
|
Network device configuration settings. More...
#include <string.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/dhcp.h>
#include <ipxe/dhcpopts.h>
#include <ipxe/settings.h>
#include <ipxe/device.h>
#include <ipxe/netdevice.h>
#include <ipxe/init.h>
Go to the source code of this file.
Data Structures | |
struct | netdev_setting_operation |
A network device setting operation. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
const struct setting mac_setting | __setting (SETTING_NETDEV, mac) |
Network device predefined settings. More... | |
const struct setting hwaddr_setting | __setting (SETTING_NETDEV, hwaddr) |
const struct setting bustype_setting | __setting (SETTING_NETDEV, bustype) |
const struct setting busloc_setting | __setting (SETTING_NETDEV, busloc) |
const struct setting busid_setting | __setting (SETTING_NETDEV, busid) |
const struct setting linktype_setting | __setting (SETTING_NETDEV, linktype) |
const struct setting chip_setting | __setting (SETTING_NETDEV, chip) |
const struct setting ifname_setting | __setting (SETTING_NETDEV, ifname) |
const struct setting mtu_setting | __setting (SETTING_NETDEV, mtu) |
static int | netdev_store_mac (struct net_device *netdev, const void *data, size_t len) |
Store link-layer address setting. More... | |
static int | netdev_fetch_mac (struct net_device *netdev, void *data, size_t len) |
Fetch link-layer address setting. More... | |
static int | netdev_fetch_hwaddr (struct net_device *netdev, void *data, size_t len) |
Fetch hardware address setting. More... | |
static int | netdev_fetch_bustype (struct net_device *netdev, void *data, size_t len) |
Fetch bus type setting. More... | |
static int | netdev_fetch_busloc (struct net_device *netdev, void *data, size_t len) |
Fetch bus location setting. More... | |
static int | netdev_fetch_busid (struct net_device *netdev, void *data, size_t len) |
Fetch bus ID setting. More... | |
static int | netdev_fetch_linktype (struct net_device *netdev, void *data, size_t len) |
Fetch link layer type setting. More... | |
static int | netdev_fetch_chip (struct net_device *netdev, void *data, size_t len) |
Fetch chip setting. More... | |
static int | netdev_fetch_ifname (struct net_device *netdev, void *data, size_t len) |
Fetch ifname setting. More... | |
static int | netdev_store (struct settings *settings, const struct setting *setting, const void *data, size_t len) |
Store value of network device setting. More... | |
static int | netdev_fetch (struct settings *settings, struct setting *setting, void *data, size_t len) |
Fetch value of network device setting. More... | |
static void | netdev_clear (struct settings *settings) |
Clear network device settings. More... | |
static struct settings * | netdev_redirect (struct settings *settings) |
Redirect "netX" settings block. More... | |
static void | netdev_redirect_settings_init (void) |
Initialise "netX" settings. More... | |
struct init_fn netdev_redirect_settings_init_fn | __init_fn (INIT_LATE) |
"netX" settings initialiser More... | |
static int | apply_netdev_settings (void) |
Apply network device settings. More... | |
Variables | |
static struct netdev_setting_operation | netdev_setting_operations [] |
Network device settings. More... | |
struct settings_operations | netdev_settings_operations |
Network device configuration settings operations. More... | |
static struct settings_operations | netdev_redirect_settings_operations |
"netX" settings operations More... | |
static struct settings | netdev_redirect_settings |
"netX" settings More... | |
struct settings_applicator netdev_applicator | __settings_applicator |
Network device settings applicator. More... | |
Network device configuration settings.
Definition in file netdev_settings.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
const struct setting mac_setting __setting | ( | SETTING_NETDEV | , |
mac | |||
) |
Network device predefined settings.
const struct setting hwaddr_setting __setting | ( | SETTING_NETDEV | , |
hwaddr | |||
) |
const struct setting bustype_setting __setting | ( | SETTING_NETDEV | , |
bustype | |||
) |
const struct setting busloc_setting __setting | ( | SETTING_NETDEV | , |
busloc | |||
) |
const struct setting busid_setting __setting | ( | SETTING_NETDEV | , |
busid | |||
) |
const struct setting linktype_setting __setting | ( | SETTING_NETDEV | , |
linktype | |||
) |
const struct setting chip_setting __setting | ( | SETTING_NETDEV | , |
chip | |||
) |
const struct setting ifname_setting __setting | ( | SETTING_NETDEV | , |
ifname | |||
) |
const struct setting mtu_setting __setting | ( | SETTING_NETDEV | , |
mtu | |||
) |
|
static |
Store link-layer address setting.
netdev | Network device |
data | Setting data, or NULL to clear setting |
len | Length of setting data |
rc | Return status code |
Definition at line 98 of file netdev_settings.c.
References data, EINVAL, net_device::hw_addr, ll_protocol::init_addr, len, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_protocol, memcpy(), and netdev.
|
static |
Fetch link-layer address setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 123 of file netdev_settings.c.
References data, len, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_protocol, memcpy(), and netdev.
|
static |
Fetch hardware address setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 141 of file netdev_settings.c.
References data, net_device::hw_addr, ll_protocol::hw_addr_len, len, net_device::ll_protocol, memcpy(), and netdev.
|
static |
Fetch bus type setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 159 of file netdev_settings.c.
References assert(), BUS_TYPE_EFI, BUS_TYPE_EISA, BUS_TYPE_HV, BUS_TYPE_ISA, BUS_TYPE_ISAPNP, BUS_TYPE_MCA, BUS_TYPE_PCI, BUS_TYPE_TAP, BUS_TYPE_USB, BUS_TYPE_XEN, data, desc, device::desc, net_device::dev, ENOENT, len, netdev, strlen(), and strncpy().
|
static |
Fetch bus location setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 193 of file netdev_settings.c.
References cpu_to_be32, data, desc, device::desc, net_device::dev, len, memcpy(), and netdev.
|
static |
Fetch bus ID setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 213 of file netdev_settings.c.
References data, desc, device::desc, net_device::dev, dhcp_netdev_desc::device, htons, len, memcpy(), netdev, dhcp_netdev_desc::type, and dhcp_netdev_desc::vendor.
|
static |
Fetch link layer type setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 235 of file netdev_settings.c.
References data, len, net_device::ll_protocol, ll_protocol::name, netdev, strlen(), and strncpy().
|
static |
Fetch chip setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 251 of file netdev_settings.c.
References data, net_device::dev, device::driver_name, len, netdev, strlen(), and strncpy().
|
static |
Fetch ifname setting.
netdev | Network device |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 267 of file netdev_settings.c.
References data, len, net_device::name, netdev, strlen(), and strncpy().
|
static |
Store value of network device setting.
settings | Settings block |
setting | Setting to store |
data | Setting data, or NULL to clear setting |
len | Length of setting data |
rc | Return status code |
Definition at line 319 of file netdev_settings.c.
References container_of, data, ENOTSUP, generic_settings_store(), len, netdev, netdev_setting_operations, op, and setting_cmp().
|
static |
Fetch value of network device setting.
settings | Settings block |
setting | Setting to fetch |
data | Buffer to fill with setting data |
len | Length of buffer |
len | Length of setting data, or negative error |
Definition at line 352 of file netdev_settings.c.
References container_of, data, generic_settings_fetch(), len, netdev, netdev_setting_operations, op, and setting_cmp().
|
static |
Clear network device settings.
settings | Settings block |
Definition at line 375 of file netdev_settings.c.
References generic_settings_clear().
Redirect "netX" settings block.
settings | Settings block |
settings | Underlying settings block |
Definition at line 392 of file netdev_settings.c.
References find_netdev(), settings::name, netdev, netdev_settings(), and net_device::settings.
|
static |
Initialise "netX" settings.
Definition at line 418 of file netdev_settings.c.
References DBG, netdev_redirect_settings, NULL, rc, register_settings(), and strerror().
|
static |
Apply network device settings.
rc | Return status code |
Definition at line 439 of file netdev_settings.c.
References DBGC, fetch_uintz_setting(), for_each_netdev, ll_protocol::ll_header_len, net_device::ll_protocol, net_device::max_pkt_len, mtu, net_device::mtu, net_device::name, netdev, netdev_close(), netdev_is_open(), netdev_open(), netdev_settings(), rc, and strerror().
|
static |
Network device settings.
Definition at line 299 of file netdev_settings.c.
Referenced by netdev_fetch(), and netdev_store().
struct settings_operations netdev_settings_operations |
Network device configuration settings operations.
Definition at line 380 of file netdev_settings.c.
Referenced by netdev_settings_init().
|
static |
"netX" settings operations
Definition at line 405 of file netdev_settings.c.
|
static |
"netX" settings
Definition at line 410 of file netdev_settings.c.
Referenced by netdev_redirect_settings_init().
struct settings_applicator netdev_applicator __settings_applicator |
Network device settings applicator.
Definition at line 493 of file netdev_settings.c.