|
| | 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.
|
Network device configuration settings.
Definition in file netdev_settings.c.
| int netdev_fetch_bustype |
( |
struct net_device * | netdev, |
|
|
void * | data, |
|
|
size_t | len ) |
|
static |
Fetch bus type setting.
- Parameters
-
| netdev | Network device |
| data | Buffer to fill with setting data |
| len | Length of buffer |
- Return values
-
| len | Length of setting data, or negative error |
Definition at line 160 of file netdev_settings.c.
161 {
162 static const char *bustypes[] = {
174 };
176 const char *bustype;
177
178 assert (
desc->bus_type < ( sizeof ( bustypes ) /
179 sizeof ( bustypes[0] ) ) );
180 bustype = bustypes[
desc->bus_type];
181 if ( ! bustype )
184 return strlen ( bustype );
185}
#define assert(condition)
Assert a condition at run-time.
#define BUS_TYPE_PCI
PCI bus type.
#define BUS_TYPE_ISAPNP
ISAPnP bus type.
#define BUS_TYPE_EISA
EISA bus type.
#define BUS_TYPE_USB
USB bus type.
#define BUS_TYPE_EFI
EFI bus type.
#define BUS_TYPE_ISA
ISA bus type.
#define BUS_TYPE_MCA
MCA bus type.
#define BUS_TYPE_TAP
TAP bus type.
#define BUS_TYPE_XEN
Xen bus type.
#define BUS_TYPE_DT
Devicetree bus type.
#define BUS_TYPE_HV
Hyper-V bus type.
struct ena_llq_option desc
Descriptor counts.
#define ENOENT
No such file or directory.
size_t strlen(const char *src)
Get length of string.
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
A hardware device description.
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().
| int apply_netdev_settings |
( |
void | | ) |
|
|
static |
Apply network device settings.
- Return values
-
Definition at line 442 of file netdev_settings.c.
442 {
446 size_t max_mtu;
447 size_t old_mtu;
450
451
453
454
456
457
459
460
462 continue;
463
464
467 if (
mtu > max_mtu ) {
468 DBGC (
netdev,
"NETDEV %s cannot support MTU %zd (max "
471 }
472
473
476 if (
mtu != old_mtu ) {
479 }
480
481
488 }
489 }
490 }
491
492 return 0;
493}
int netdev_open(struct net_device *netdev)
Open network device.
void netdev_close(struct net_device *netdev)
Close network device.
#define for_each_netdev(netdev)
Iterate over all network devices.
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
unsigned long fetch_uintz_setting(struct settings *settings, const struct setting *setting)
Fetch value of unsigned integer setting, or zero.
uint8_t ll_header_len
Link-layer header length.
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().