iPXE
|
Ethernet protocol. More...
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | is_zero_ether_addr (const void *addr) |
Check if Ethernet address is all zeroes. More... | |
static int | is_multicast_ether_addr (const void *addr) |
Check if Ethernet address is a multicast address. More... | |
static int | is_local_ether_addr (const void *addr) |
Check if Ethernet address is locally assigned. More... | |
static int | is_broadcast_ether_addr (const void *addr) |
Check if Ethernet address is the broadcast address. More... | |
static int | is_valid_ether_addr (const void *addr) |
Check if Ethernet address is valid. More... | |
int | eth_push (struct net_device *netdev, struct io_buffer *iobuf, const void *ll_dest, const void *ll_source, uint16_t net_proto) |
int | eth_pull (struct net_device *netdev, struct io_buffer *iobuf, const void **ll_dest, const void **ll_source, uint16_t *net_proto, unsigned int *flags) |
void | eth_init_addr (const void *hw_addr, void *ll_addr) |
Initialise Ethernet address. More... | |
void | eth_random_addr (void *hw_addr) |
Generate random Ethernet address. More... | |
const char * | eth_ntoa (const void *ll_addr) |
Transcribe Ethernet address. More... | |
int | eth_mc_hash (unsigned int af, const void *net_addr, void *ll_addr) |
Hash multicast address. More... | |
int | eth_eth_addr (const void *ll_addr, void *eth_addr) |
Generate Ethernet-compatible compressed link-layer address. More... | |
int | eth_eui64 (const void *ll_addr, void *eui64) |
Generate EUI-64 address. More... | |
struct net_device * | alloc_etherdev (size_t priv_size) |
Allocate Ethernet device. More... | |
Variables | |
uint8_t | eth_broadcast [] |
Ethernet broadcast MAC address. More... | |
struct ll_protocol ethernet_protocol | __ll_protocol |
Ethernet protocol. More... | |
Ethernet protocol.
Definition in file ethernet.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Check if Ethernet address is all zeroes.
addr | Ethernet address |
is_zero | Address is all zeroes |
Definition at line 22 of file ethernet.h.
References addr.
Referenced by is_valid_ether_addr().
|
inlinestatic |
Check if Ethernet address is a multicast address.
addr | Ethernet address |
is_mcast | Address is a multicast address |
Note that the broadcast address is also a multicast address.
Definition at line 37 of file ethernet.h.
References addr.
Referenced by eoib_tx_av(), eth_pull(), ipoib_find_remac(), ipoib_transmit(), is_valid_ether_addr(), and net80211_ll_pull().
|
inlinestatic |
Check if Ethernet address is locally assigned.
addr | Ethernet address |
is_local | Address is locally assigned |
Definition at line 49 of file ethernet.h.
References addr.
|
inlinestatic |
Check if Ethernet address is the broadcast address.
addr | Ethernet address |
is_bcast | Address is the broadcast address |
Definition at line 61 of file ethernet.h.
References addr.
Referenced by eth_pull(), and net80211_ll_pull().
|
inlinestatic |
Check if Ethernet address is valid.
addr | Ethernet address |
is_valid | Address is valid |
Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not a multicast address, and is not ff:ff:ff:ff:ff:ff.
Definition at line 77 of file ethernet.h.
References addr, is_multicast_ether_addr(), and is_zero_ether_addr().
Referenced by __vxge_hw_vpath_addr_get(), acpimac_extract(), bnxt_get_device_address(), ice_admin_mac_read(), igbvf_probe(), igbvf_reset(), intel_fetch_mac(), intelx_try_fetch_mac(), intelxl_admin_mac_read(), nv_setup_mac_addr(), pcnet32_setup_mac_addr(), smscusb_eeprom_fetch_mac(), smscusb_otp_fetch_mac(), tg3_get_device_address(), and virtnet_probe_modern().
int eth_push | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf, | ||
const void * | ll_dest, | ||
const void * | ll_source, | ||
uint16_t | net_proto | ||
) |
int eth_pull | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf, | ||
const void ** | ll_dest, | ||
const void ** | ll_source, | ||
uint16_t * | net_proto, | ||
unsigned int * | flags | ||
) |
void eth_init_addr | ( | const void * | hw_addr, |
void * | ll_addr | ||
) |
Initialise Ethernet address.
hw_addr | Hardware address |
ll_addr | Link-layer address |
Definition at line 150 of file ethernet.c.
void eth_random_addr | ( | void * | hw_addr | ) |
Generate random Ethernet address.
hw_addr | Generated hardware address |
Definition at line 159 of file ethernet.c.
References addr, ETH_ALEN, and random().
Referenced by igbvf_probe(), intelvf_mbox_reset(), lan78xx_fetch_mac(), smsc95xx_fetch_mac(), and txnic_bgx_mac().
const char* eth_ntoa | ( | const void * | ll_addr | ) |
Transcribe Ethernet address.
ll_addr | Link-layer address |
string | Link-layer address in human-readable format |
Definition at line 175 of file ethernet.c.
References sprintf.
Referenced by acpimac_extract(), amd8111e_get_mac_address(), b44_probe(), bnx2_probe(), bofm_en(), bofm_test(), corkscrew_probe1(), cs89x0_probe(), davicom_probe(), dmfe_probe(), ecm_fetch_mac(), eepro_probe(), ena_get_device_attributes(), eoib_create(), eoib_rx_av(), eoib_tx_av(), epic100_probe(), eth_probe(), eth_slow_lacp_dump(), eth_slow_marker_dump(), exanic_probe(), fcoe_expired(), fcoe_fip_rx(), fcoe_fip_rx_advertisement(), fcoe_fip_rx_els_response(), fcoe_fip_rx_vlan(), fcoe_rx(), gve_describe(), hermon_bofm_harvest(), hermon_bofm_update(), ibft_fill_nic(), ice_admin_mac_read(), intel_fetch_mac(), intel_fetch_mac_eeprom(), intelvf_mbox_reset(), intelx_try_fetch_mac(), intelxl_admin_mac_read(), ipoib_find_remac(), ipoib_translate_tx_arp(), ipoib_transmit(), iwlist(), lan78xx_fetch_mac(), ne_probe(), net80211_probe_step(), net80211_step_associate(), nv_setup_mac_addr(), pcnet32_probe(), phantom_add_macaddr(), phantom_del_macaddr(), phantom_get_macaddr(), prism2_probe(), smc9000_probe(), smsc95xx_fetch_mac(), smsc95xx_vm3_fetch_mac(), smscusb_eeprom_fetch_mac(), smscusb_fdt_fetch_mac(), smscusb_otp_fetch_mac(), stp_rx(), t595_probe(), t5x9_probe(), tlan_probe(), tulip_probe(), txnic_lmac_probe(), undinet_probe(), virtnet_probe_legacy(), virtnet_probe_modern(), vxge_probe(), w89c840_probe(), wpa_derive_ptk(), xsmp_rx_xve_install(), and xve_create().
int eth_mc_hash | ( | unsigned int | af, |
const void * | net_addr, | ||
void * | ll_addr | ||
) |
Hash multicast address.
af | Address family |
net_addr | Network-layer address |
ll_addr | Link-layer address to fill in |
rc | Return status code |
Definition at line 193 of file ethernet.c.
int eth_eth_addr | ( | const void * | ll_addr, |
void * | eth_addr | ||
) |
Generate Ethernet-compatible compressed link-layer address.
ll_addr | Link-layer address |
eth_addr | Ethernet-compatible address to fill in |
Definition at line 222 of file ethernet.c.
int eth_eui64 | ( | const void * | ll_addr, |
void * | eui64 | ||
) |
Generate EUI-64 address.
ll_addr | Link-layer address |
eui64 | EUI-64 address to fill in |
rc | Return status code |
Definition at line 234 of file ethernet.c.
struct net_device* alloc_etherdev | ( | size_t | priv_size | ) |
Allocate Ethernet device.
priv_size | Size of driver private data |
netdev | Network device, or NULL |
Definition at line 264 of file ethernet.c.
References alloc_netdev(), eth_broadcast, ETH_FRAME_LEN, ETH_MAX_MTU, net_device::ll_broadcast, net_device::ll_protocol, net_device::max_pkt_len, net_device::mtu, and netdev.
Referenced by a3c90x_probe(), alloc_rndis(), atl1e_probe(), atl_probe(), axge_probe(), b44_probe(), bnxt_init_one(), dm96xx_probe(), ecm_probe(), efab_probe(), ena_probe(), eoib_create(), exanic_probe_port(), flexboot_nodnic_register_netdev(), forcedeth_probe(), gve_probe(), hermon_probe(), hunt_probe(), ice_probe(), icplus_probe(), ifec_pci_probe(), igbvf_probe(), intel_probe(), intelx_probe(), intelxl_probe(), intelxlvf_probe(), intelxvf_probe(), iphone_probe(), jme_probe(), lan78xx_probe(), legacy_probe(), mnpnet_start(), myri10ge_pci_probe(), myson_probe(), natsemi_probe(), ncm_probe(), netfront_probe(), pcnet32_probe(), phantom_probe(), pnic_probe(), rdc_probe(), realtek_probe(), rhine_probe(), sis190_init_board(), skeleton_probe(), skge_devinit(), sky2_init_netdev(), smsc75xx_probe(), smsc95xx_probe(), snpnet_start(), tg3_init_one(), txnic_alloc(), undinet_probe(), velocity_probe(), virtnet_probe_legacy(), virtnet_probe_modern(), vlan_create(), vmxnet3_probe(), and vxge_device_register().
uint8_t eth_broadcast[] |
Ethernet broadcast MAC address.
Definition at line 47 of file ethernet.c.
Referenced by alloc_etherdev(), alloc_ipoibdev(), ath9k_init_misc(), ice_probe(), ipoib_complete_recv(), net80211_alloc(), and net80211_probe_step().
struct ll_protocol ethernet_protocol __ll_protocol |