|
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) | |
| FILE_SECBOOT (PERMITTED) | |
| 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 int | netdev_store_mac (struct net_device *netdev, const void *data, size_t len) |
| Store link-layer address setting. | |
| static int | netdev_fetch_mac (struct net_device *netdev, void *data, size_t len) |
| Fetch link-layer address setting. | |
| static int | netdev_fetch_hwaddr (struct net_device *netdev, void *data, size_t len) |
| Fetch hardware address setting. | |
| static int | netdev_fetch_bustype (struct net_device *netdev, void *data, size_t len) |
| Fetch bus type setting. | |
| static int | netdev_fetch_busloc (struct net_device *netdev, void *data, size_t len) |
| Fetch bus location setting. | |
| static int | netdev_fetch_busid (struct net_device *netdev, void *data, size_t len) |
| Fetch bus ID setting. | |
| static int | netdev_fetch_linktype (struct net_device *netdev, void *data, size_t len) |
| Fetch link layer type setting. | |
| static int | netdev_fetch_chip (struct net_device *netdev, void *data, size_t len) |
| Fetch chip setting. | |
| static int | netdev_fetch_ifname (struct net_device *netdev, void *data, size_t len) |
| Fetch ifname setting. | |
| static int | netdev_store (struct settings *settings, const struct setting *setting, const void *data, size_t len) |
| Store value of network device setting. | |
| static int | netdev_fetch (struct settings *settings, struct setting *setting, void *data, size_t len) |
| Fetch value of network device setting. | |
| static void | netdev_clear (struct settings *settings) |
| Clear network device settings. | |
| static struct settings * | netdev_redirect (struct settings *settings) |
| Redirect "netX" settings block. | |
| static void | netdev_redirect_settings_init (void) |
| Initialise "netX" settings. | |
| struct init_fn netdev_redirect_settings_init_fn | __init_fn (INIT_LATE) |
| "netX" settings initialiser | |
| static int | apply_netdev_settings (void) |
| Apply network device settings. | |
Variables | |
| static struct netdev_setting_operation | netdev_setting_operations [] |
| Network device settings. | |
| struct settings_operations | netdev_settings_operations |
| Network device configuration settings operations. | |
| static struct settings_operations | netdev_redirect_settings_operations |
| "netX" settings operations | |
| static struct settings | netdev_redirect_settings |
| "netX" settings | |
| struct settings_applicator netdev_applicator | __settings_applicator |
| Network device settings applicator. | |
Network device configuration settings.
Definition in file netdev_settings.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
| const struct setting mac_setting __setting | ( | SETTING_NETDEV | , |
| mac | ) |
Network device predefined settings.
References __setting, mac, and SETTING_NETDEV.
| const struct setting hwaddr_setting __setting | ( | SETTING_NETDEV | , |
| hwaddr | ) |
References __setting, and SETTING_NETDEV.
| const struct setting bustype_setting __setting | ( | SETTING_NETDEV | , |
| bustype | ) |
References __setting, and SETTING_NETDEV.
| const struct setting busloc_setting __setting | ( | SETTING_NETDEV | , |
| busloc | ) |
References __setting, and SETTING_NETDEV.
| const struct setting busid_setting __setting | ( | SETTING_NETDEV | , |
| busid | ) |
References __setting, and SETTING_NETDEV.
| const struct setting linktype_setting __setting | ( | SETTING_NETDEV | , |
| linktype | ) |
References __setting, and SETTING_NETDEV.
| const struct setting chip_setting __setting | ( | SETTING_NETDEV | , |
| chip | ) |
References __setting, and SETTING_NETDEV.
| const struct setting ifname_setting __setting | ( | SETTING_NETDEV | , |
| ifname | ) |
References __setting, and SETTING_NETDEV.
| const struct setting mtu_setting __setting | ( | SETTING_NETDEV | , |
| mtu | ) |
References __setting, DHCP_MTU, mtu, and SETTING_NETDEV.
|
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 99 of file netdev_settings.c.
References data, EINVAL, ll_protocol::init_addr, len, memcpy(), and netdev.
|
static |
Fetch link-layer address setting.
| len | Length of setting data, or negative error |
Definition at line 124 of file netdev_settings.c.
|
static |
Fetch hardware address setting.
| len | Length of setting data, or negative error |
Definition at line 142 of file netdev_settings.c.
|
static |
Fetch bus type setting.
| len | Length of setting data, or negative error |
Definition at line 160 of file netdev_settings.c.
References assert, BUS_TYPE_DT, 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, ENOENT, len, netdev, strlen(), and strncpy().
|
static |
Fetch bus location setting.
| len | Length of setting data, or negative error |
Definition at line 195 of file netdev_settings.c.
References cpu_to_be32, data, desc, len, memcpy(), and netdev.
|
static |
Fetch bus ID setting.
| len | Length of setting data, or negative error |
Definition at line 215 of file netdev_settings.c.
References data, desc, dhcp_netdev_desc::device, htons, len, memcpy(), netdev, dhcp_netdev_desc::type, and dhcp_netdev_desc::vendor.
|
static |
Fetch link layer type setting.
| len | Length of setting data, or negative error |
Definition at line 237 of file netdev_settings.c.
|
static |
Fetch chip setting.
| len | Length of setting data, or negative error |
Definition at line 253 of file netdev_settings.c.
|
static |
Fetch ifname setting.
| len | Length of setting data, or negative error |
Definition at line 269 of file netdev_settings.c.
|
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 321 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 354 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 377 of file netdev_settings.c.
References generic_settings_clear().
Redirect "netX" settings block.
| settings | Settings block |
| settings | Underlying settings block |
Definition at line 394 of file netdev_settings.c.
References find_netdev(), settings::name, netdev, and netdev_settings().
|
static |
Initialise "netX" settings.
Definition at line 420 of file netdev_settings.c.
References DBG, netdev_redirect_settings, NULL, rc, register_settings(), and strerror().
Referenced by __init_fn().
"netX" settings initialiser
References __init_fn, INIT_LATE, and netdev_redirect_settings_init().
|
static |
Apply network device settings.
| rc | Return status code |
Definition at line 442 of file netdev_settings.c.
References DBGC, fetch_uintz_setting(), for_each_netdev, ll_protocol::ll_header_len, mtu, netdev, netdev_close(), netdev_is_open(), netdev_open(), netdev_settings(), rc, and strerror().
|
static |
Network device settings.
Definition at line 301 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 382 of file netdev_settings.c.
Referenced by netdev_settings_init().
|
static |
"netX" settings operations
Definition at line 407 of file netdev_settings.c.
|
static |
"netX" settings
Definition at line 412 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 496 of file netdev_settings.c.