Lines Matching +full:address +full:- +full:aligned

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
81 * is_link_local_ether_addr - Determine if given Ethernet address is link-local
82 * @addr: Pointer to a six-byte array containing the Ethernet address
84 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
87 * Please note: addr must be aligned to u16.
104 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
105 * @addr: Pointer to a six-byte array containing the Ethernet address
107 * Return true if the address is all zeroes.
109 * Please note: addr must be aligned to u16.
123 * is_multicast_ether_addr - Determine if the Ethernet address is a multicast.
124 * @addr: Pointer to a six-byte array containing the Ethernet address
126 * Return true if the address is a multicast address.
127 * By definition the broadcast address is also a multicast address.
137 return 0x01 & (a >> ((sizeof(a) * 8) - 8)); in is_multicast_ether_addr()
157 * is_local_ether_addr - Determine if the Ethernet address is locally-assigned one (IEEE 802).
158 * @addr: Pointer to a six-byte array containing the Ethernet address
160 * Return true if the address is a local address.
168 * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
169 * @addr: Pointer to a six-byte array containing the Ethernet address
171 * Return true if the address is the broadcast address.
173 * Please note: addr must be aligned to u16.
183 * is_unicast_ether_addr - Determine if the Ethernet address is unicast
184 * @addr: Pointer to a six-byte array containing the Ethernet address
186 * Return true if the address is a unicast address.
194 * is_valid_ether_addr - Determine if the given Ethernet address is valid
195 * @addr: Pointer to a six-byte array containing the Ethernet address
197 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
198 * a multicast address, and is not FF:FF:FF:FF:FF:FF.
200 * Return true if the address is valid.
202 * Please note: addr must be aligned to u16.
206 /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to in is_valid_ether_addr()
212 * eth_proto_is_802_3 - Determine if a given Ethertype/length is a protocol
230 * eth_random_addr - Generate software assigned random Ethernet address
231 * @addr: Pointer to a six-byte array containing the Ethernet address
233 * Generate a random Ethernet address (MAC) that is not multicast
244 * eth_broadcast_addr - Assign broadcast address
245 * @addr: Pointer to a six-byte array containing the Ethernet address
247 * Assign the broadcast address to the given address array.
255 * eth_zero_addr - Assign zero address
256 * @addr: Pointer to a six-byte array containing the Ethernet address
258 * Assign the zero address to the given address array.
266 * eth_hw_addr_random - Generate software assigned random Ethernet and
270 * Generate a random Ethernet address (MAC) to be used by a net device
280 dev->addr_assign_type = NET_ADDR_RANDOM; in eth_hw_addr_random()
284 * eth_hw_addr_crc - Calculate CRC from netdev_hw_addr
285 * @ha: pointer to hardware address
287 * Calculate CRC from a hardware address as basis for filter hashes.
291 return ether_crc(ETH_ALEN, ha->addr); in eth_hw_addr_crc()
295 * ether_addr_copy - Copy an Ethernet address
296 * @dst: Pointer to a six-byte array Ethernet address destination
297 * @src: Pointer to a six-byte array Ethernet address source
299 * Please note: dst & src must both be aligned to u16.
317 * eth_hw_addr_set - Assign Ethernet address to a net_device
319 * @addr: address to assign
321 * Assign given address to the net_device, addr_assign_type is not changed.
329 * eth_hw_addr_inherit - Copy dev_addr from another net_device
333 * Copy the Ethernet address from one net_device to another along with
334 * the address attributes (addr_assign_type).
339 dst->addr_assign_type = src->addr_assign_type; in eth_hw_addr_inherit()
340 eth_hw_addr_set(dst, src->dev_addr); in eth_hw_addr_inherit()
344 * ether_addr_equal - Compare two Ethernet addresses
345 * @addr1: Pointer to a six-byte array containing the Ethernet address
346 * @addr2: Pointer other six-byte array containing the Ethernet address
350 * Please note: addr1 & addr2 must both be aligned to u16.
368 * ether_addr_equal_64bits - Compare two Ethernet addresses
397 * ether_addr_equal_unaligned - Compare two not u16 aligned Ethernet addresses
398 * @addr1: Pointer to a six-byte array containing the Ethernet address
399 * @addr2: Pointer other six-byte array containing the Ethernet address
403 * Please note: Use only when any Ethernet address may not be u16 aligned.
415 * ether_addr_equal_masked - Compare two Ethernet addresses with a mask
416 * @addr1: Pointer to a six-byte array containing the 1st Ethernet address
417 * @addr2: Pointer to a six-byte array containing the 2nd Ethernet address
418 * @mask: Pointer to a six-byte array containing the Ethernet address bitmask
458 * ether_addr_to_u64 - Convert an Ethernet address into a u64 value.
459 * @addr: Pointer to a six-byte array containing the Ethernet address
461 * Return a u64 value of the address
475 * u64_to_ether_addr - Convert a u64 to an Ethernet address.
476 * @u: u64 to convert to an Ethernet MAC address
477 * @addr: Pointer to a six-byte array to contain the Ethernet address
483 for (i = ETH_ALEN - 1; i >= 0; i--) { in u64_to_ether_addr()
490 * eth_addr_dec - Decrement the given MAC address
492 * @addr: Pointer to a six-byte array containing Ethernet address to decrement
498 u--; in eth_addr_dec()
503 * eth_addr_inc() - Increment the given MAC address.
504 * @addr: Pointer to a six-byte array containing Ethernet address to increment.
515 * eth_addr_add() - Add (or subtract) an offset to/from the given MAC address.
518 * @addr: Pointer to a six-byte array containing Ethernet address to increment.
529 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
531 * @addr: Pointer to a six-byte array containing the Ethernet address
533 * Compare passed address with all addresses of the device. Return true if the
534 * address if one of the device addresses.
547 res = ether_addr_equal_64bits(addr, ha->addr); in is_etherdev_addr()
557 * compare_ether_header - Compare two Ethernet headers
562 * This assumes that the network header (i.e., IP header) is 4-byte
563 * aligned OR the platform can handle unaligned access. This is the
594 * eth_hw_addr_gen - Generate and assign Ethernet address to a port
596 * @base_addr: base Ethernet address
597 * @id: offset to add to the base address
599 * Generate a MAC address using a base address and an offset and assign it
615 * eth_skb_pkt_type - Assign packet type if destination address does not match
616 * @skb: Assigned a packet type if address does not match @dev address
617 * @dev: Network device used to compare packet address against
619 * If the destination MAC address of the packet does not match the network
620 * device address, assign an appropriate packet type.
627 if (unlikely(!ether_addr_equal_64bits(eth->h_dest, dev->dev_addr))) { in eth_skb_pkt_type()
628 if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) { in eth_skb_pkt_type()
629 if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) in eth_skb_pkt_type()
630 skb->pkt_type = PACKET_BROADCAST; in eth_skb_pkt_type()
632 skb->pkt_type = PACKET_MULTICAST; in eth_skb_pkt_type()
634 skb->pkt_type = PACKET_OTHERHOST; in eth_skb_pkt_type()
641 struct ethhdr *eth = (struct ethhdr *)skb->data; in eth_skb_pull_mac()
648 * eth_skb_pad - Pad buffer to minimum number of octets for Ethernet frame