|
iPXE
|
Virtual LANs. More...
#include <ipxe/netdevice.h>Go to the source code of this file.
Data Structures | |
| struct | vlan_header |
| A VLAN header. More... | |
Macros | |
| #define | VLAN_TAG(tci) |
| Extract VLAN tag from tag control information. | |
| #define | VLAN_PRIORITY(tci) |
| Extract VLAN priority from tag control information. | |
| #define | VLAN_TCI(tag, priority) |
| Construct VLAN tag control information. | |
| #define | VLAN_TAG_IS_VALID(tag) |
| Check VLAN tag is valid. | |
| #define | VLAN_PRIORITY_IS_VALID(priority) |
| Check VLAN priority is valid. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| unsigned int | vlan_tci (struct net_device *netdev) |
| Get the VLAN tag control information. | |
| static unsigned int | vlan_tag (struct net_device *netdev) |
| Get the VLAN tag. | |
| struct net_device * | vlan_find (struct net_device *trunk, unsigned int tag) |
| Identify VLAN device. | |
| int | vlan_can_be_trunk (struct net_device *trunk) |
| Check if network device can be used as a VLAN trunk device. | |
| int | vlan_create (struct net_device *trunk, unsigned int tag, unsigned int priority) |
| Create VLAN device. | |
| int | vlan_destroy (struct net_device *netdev) |
| Destroy VLAN device. | |
| void | vlan_auto (const void *ll_addr, unsigned int tag) |
| Configure automatic VLAN device. | |
| void | vlan_netdev_rx (struct net_device *netdev, unsigned int tag, struct io_buffer *iobuf) |
| Add VLAN tag-stripped packet to queue (when VLAN support is not present) | |
| void | vlan_netdev_rx_err (struct net_device *netdev, unsigned int tag, struct io_buffer *iobuf, int rc) |
| Discard received VLAN tag-stripped packet (when VLAN support is not present) | |
Virtual LANs.
Definition in file vlan.h.
| #define VLAN_TAG | ( | tci | ) |
Extract VLAN tag from tag control information.
| tci | Tag control information |
| tag | VLAN tag |
Definition at line 30 of file vlan.h.
Referenced by efi_snp_probe(), efi_vlan_find(), intelxl_poll_rx(), vlan_rx(), and vlan_tag().
| #define VLAN_PRIORITY | ( | tci | ) |
Extract VLAN priority from tag control information.
| tci | Tag control information |
| priority | Priority |
Definition at line 38 of file vlan.h.
Referenced by efi_vlan_find().
Construct VLAN tag control information.
| tag | VLAN tag |
| priority | Priority |
| tci | Tag control information |
Definition at line 47 of file vlan.h.
Referenced by vlan_tci(), and vlan_transmit().
| #define VLAN_TAG_IS_VALID | ( | tag | ) |
Check VLAN tag is valid.
| tag | VLAN tag |
| is_valid | VLAN tag is valid |
Definition at line 55 of file vlan.h.
Referenced by efi_vlan_find(), and vlan_create().
| #define VLAN_PRIORITY_IS_VALID | ( | priority | ) |
Check VLAN priority is valid.
| priority | VLAN priority |
| is_valid | VLAN priority is valid |
Definition at line 63 of file vlan.h.
Referenced by vlan_create().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Get the VLAN tag control information.
| netdev | Network device |
| tci | VLAN tag control information, or 0 if not a VLAN device |
Definition at line 302 of file vlan.c.
References netdev, vlan_device::priority, vlan_device::tag, vlan_operations, and VLAN_TCI.
|
inlinestatic |
Get the VLAN tag.
| netdev | Network device |
| tag | VLAN tag, or 0 if device is not a VLAN device |
Definition at line 74 of file vlan.h.
References netdev, VLAN_TAG, and vlan_tci().
Referenced by cachedhcp_apply(), eapol_probe(), efi_netdev_path(), efi_path_net_probe(), ibft_fill_nic(), and is_autoboot_ll_addr().
|
extern |
Identify VLAN device.
| trunk | Trunk network device |
| tag | VLAN tag |
| netdev | VLAN device, if any |
Definition at line 209 of file vlan.c.
References for_each_netdev, netdev, NULL, tag, vlan_device::tag, vlan_device::trunk, and vlan_operations.
Referenced by efi_vlan_find(), efi_vlan_remove(), vlan_create(), vlan_netdev_rx(), vlan_netdev_rx_err(), and vlan_rx().
|
extern |
Check if network device can be used as a VLAN trunk device.
| trunk | Trunk network device |
| is_ok | Trunk network device is usable |
VLAN devices will be created as Ethernet devices. (We cannot simply clone the link layer of the trunk network device, because this link layer may expect the network device structure to contain some link-layer-private data.) The trunk network device must therefore have a link layer that is in some sense 'compatible' with Ethernet; specifically, it must have link-layer addresses that are the same length as Ethernet link-layer addresses.
As an additional check, and primarily to assist with the sanity of the FCoE code, we refuse to allow nested VLANs.
Definition at line 330 of file vlan.c.
References ETH_ALEN, ll_protocol::ll_addr_len, net_device::ll_protocol, net_device::op, vlan_device::trunk, and vlan_operations.
Referenced by fcoe_expired(), fcoe_reset(), vlan_create(), and vlan_probe().
|
extern |
Create VLAN device.
| trunk | Trunk network device |
| tag | VLAN tag |
| priority | Default VLAN priority |
| rc | Return status code |
Definition at line 344 of file vlan.c.
References alloc_etherdev(), DBGC, net_device::dev, EINVAL, ENOMEM, ENOTTY, ETH_ALEN, net_device::ll_addr, memcpy(), net_device::name, netdev, netdev_get(), netdev_init(), netdev_irq_supported(), NETDEV_IRQ_UNSUPPORTED, netdev_nullify(), netdev_put(), NULL, priority, vlan_device::priority, rc, register_netdev(), snprintf(), strerror(), tag, vlan_device::tag, vlan_device::trunk, unregister_netdev(), vlan_can_be_trunk(), vlan_find(), vlan_operations, VLAN_PRIORITY_IS_VALID, vlan_sync(), and VLAN_TAG_IS_VALID.
Referenced by efi_vlan_set(), fcoe_fip_rx_vlan(), vcreate_exec(), and vlan_probe().
|
extern |
Destroy VLAN device.
| netdev | Network device |
| rc | Return status code |
Definition at line 434 of file vlan.c.
References DBGC, ENOTTY, netdev, netdev_nullify(), netdev_put(), vlan_device::trunk, unregister_netdev(), and vlan_operations.
Referenced by efi_vlan_remove(), vdestroy_exec(), and vlan_remove_first().
|
extern |
Configure automatic VLAN device.
| ll_addr | Link-layer address |
| tag | VLAN tag |
Definition at line 463 of file vlan.c.
References ETH_ALEN, net_device::ll_addr, memcpy(), tag, vlan_auto_ll_addr, and vlan_auto_tag.
Referenced by efi_set_autoboot_ll_addr().
|
extern |
Add VLAN tag-stripped packet to queue (when VLAN support is not present)
| netdev | Network device |
| tag | VLAN tag, or zero |
| iobuf | I/O buffer |
Add VLAN tag-stripped packet to queue (when VLAN support is not present)
| netdev | Network device |
| tag | VLAN tag, or zero |
| iobuf | I/O buffer |
Definition at line 1210 of file netdevice.c.
References __weak, ENODEV, netdev, netdev_rx(), netdev_rx_err(), NULL, tag, and vlan_find().
Referenced by hermon_eth_complete_recv(), and intelxl_poll_rx().
|
extern |
Discard received VLAN tag-stripped packet (when VLAN support is not present)
| netdev | Network device |
| tag | VLAN tag, or zero |
| iobuf | I/O buffer, or NULL |
| rc | Packet status code |
Discard received VLAN tag-stripped packet (when VLAN support is not present)
| netdev | Network device |
| tag | VLAN tag, or zero |
| iobuf | I/O buffer, or NULL |
| rc | Packet status code |
Definition at line 1228 of file netdevice.c.
References __unused, __weak, netdev, netdev_rx_err(), NULL, rc, tag, and vlan_find().
Referenced by hermon_eth_complete_recv(), and intelxl_poll_rx().