Lines Matching +full:two +full:- +full:ethernet
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
7 * Definitions for the Ethernet handlers.
69 /* Reserved Ethernet Addresses per IEEE 802.1Q */
75 * is_link_local_ether_addr - Determine if given Ethernet address is link-local
76 * @addr: Pointer to a six-byte array containing the Ethernet address
98 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
99 * @addr: Pointer to a six-byte array containing the Ethernet address
117 * is_multicast_ether_addr - Determine if the Ethernet address is a multicast.
118 * @addr: Pointer to a six-byte array containing the Ethernet address
131 return 0x01 & (a >> ((sizeof(a) * 8) - 8)); in is_multicast_ether_addr()
151 * is_local_ether_addr - Determine if the Ethernet address is locally-assigned one (IEEE 802).
152 * @addr: Pointer to a six-byte array containing the Ethernet address
162 * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
163 * @addr: Pointer to a six-byte array containing the Ethernet address
177 * is_unicast_ether_addr - Determine if the Ethernet address is unicast
178 * @addr: Pointer to a six-byte array containing the Ethernet address
188 * is_valid_ether_addr - Determine if the given Ethernet address is valid
189 * @addr: Pointer to a six-byte array containing the Ethernet address
191 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
206 * eth_proto_is_802_3 - Determine if a given Ethertype/length is a protocol
224 * eth_random_addr - Generate software assigned random Ethernet address
225 * @addr: Pointer to a six-byte array containing the Ethernet address
227 * Generate a random Ethernet address (MAC) that is not multicast
238 * eth_broadcast_addr - Assign broadcast address
239 * @addr: Pointer to a six-byte array containing the Ethernet address
249 * eth_zero_addr - Assign zero address
250 * @addr: Pointer to a six-byte array containing the Ethernet address
260 * eth_hw_addr_random - Generate software assigned random Ethernet and
264 * Generate a random Ethernet address (MAC) to be used by a net device
274 dev->addr_assign_type = NET_ADDR_RANDOM; in eth_hw_addr_random()
278 * eth_hw_addr_crc - Calculate CRC from netdev_hw_addr
285 return ether_crc(ETH_ALEN, ha->addr); in eth_hw_addr_crc()
289 * ether_addr_copy - Copy an Ethernet address
290 * @dst: Pointer to a six-byte array Ethernet address destination
291 * @src: Pointer to a six-byte array Ethernet address source
311 * eth_hw_addr_set - Assign Ethernet address to a net_device
323 * eth_hw_addr_inherit - Copy dev_addr from another net_device
327 * Copy the Ethernet address from one net_device to another along with
333 dst->addr_assign_type = src->addr_assign_type; in eth_hw_addr_inherit()
334 eth_hw_addr_set(dst, src->dev_addr); in eth_hw_addr_inherit()
338 * ether_addr_equal - Compare two Ethernet addresses
339 * @addr1: Pointer to a six-byte array containing the Ethernet address
340 * @addr2: Pointer other six-byte array containing the Ethernet address
342 * Compare two Ethernet addresses, returns true if equal
362 * ether_addr_equal_64bits - Compare two Ethernet addresses
366 * Compare two Ethernet addresses, returns true if equal, false otherwise.
391 * ether_addr_equal_unaligned - Compare two not u16 aligned Ethernet addresses
392 * @addr1: Pointer to a six-byte array containing the Ethernet address
393 * @addr2: Pointer other six-byte array containing the Ethernet address
395 * Compare two Ethernet addresses, returns true if equal
397 * Please note: Use only when any Ethernet address may not be u16 aligned.
409 * ether_addr_equal_masked - Compare two Ethernet addresses with a mask
410 * @addr1: Pointer to a six-byte array containing the 1st Ethernet address
411 * @addr2: Pointer to a six-byte array containing the 2nd Ethernet address
412 * @mask: Pointer to a six-byte array containing the Ethernet address bitmask
414 * Compare two Ethernet addresses with a mask, returns true if for every bit
415 * set in the bitmask the equivalent bits in the ethernet addresses are equal.
454 * ether_addr_to_u64 - Convert an Ethernet address into a u64 value.
455 * @addr: Pointer to a six-byte array containing the Ethernet address
471 * u64_to_ether_addr - Convert a u64 to an Ethernet address.
472 * @u: u64 to convert to an Ethernet MAC address
473 * @addr: Pointer to a six-byte array to contain the Ethernet address
479 for (i = ETH_ALEN - 1; i >= 0; i--) { in u64_to_ether_addr()
486 * eth_addr_dec - Decrement the given MAC address
488 * @addr: Pointer to a six-byte array containing Ethernet address to decrement
494 u--; in eth_addr_dec()
499 * eth_addr_inc() - Increment the given MAC address.
500 * @addr: Pointer to a six-byte array containing Ethernet address to increment.
511 * eth_addr_add() - Add (or subtract) an offset to/from the given MAC address.
514 * @addr: Pointer to a six-byte array containing Ethernet address to increment.
525 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
527 * @addr: Pointer to a six-byte array containing the Ethernet address
543 res = ether_addr_equal_64bits(addr, ha->addr); in is_etherdev_addr()
553 * compare_ether_header - Compare two Ethernet headers
554 * @a: Pointer to Ethernet header
555 * @b: Pointer to Ethernet header
557 * Compare two Ethernet headers, returns 0 if equal.
558 * This assumes that the network header (i.e., IP header) is 4-byte
572 * Use two long XOR, ORed together, with an overlap of two bytes. in compare_ether_header()
575 * This means the [a6 a7] ^ [b6 b7] part is done two times. in compare_ether_header()
590 * eth_hw_addr_gen - Generate and assign Ethernet address to a port
592 * @base_addr: base Ethernet address
611 * eth_skb_pkt_type - Assign packet type if destination address does not match
623 if (unlikely(!ether_addr_equal_64bits(eth->h_dest, dev->dev_addr))) { in eth_skb_pkt_type()
624 if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) { in eth_skb_pkt_type()
625 if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) in eth_skb_pkt_type()
626 skb->pkt_type = PACKET_BROADCAST; in eth_skb_pkt_type()
628 skb->pkt_type = PACKET_MULTICAST; in eth_skb_pkt_type()
630 skb->pkt_type = PACKET_OTHERHOST; in eth_skb_pkt_type()
636 * eth_skb_pad - Pad buffer to mininum number of octets for Ethernet frame
639 * An Ethernet frame should have a minimum size of 60 bytes. This function