git: 707cfc54f8f3 - stable/14 - LinuxKPI: add is_unicast_ether_addr()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 07 May 2025 11:50:33 UTC
The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=707cfc54f8f3abcf04212960757a3f844773990e commit 707cfc54f8f3abcf04212960757a3f844773990e Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2025-05-03 23:44:52 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2025-05-07 08:52:22 +0000 LinuxKPI: add is_unicast_ether_addr() Needed by mediatek/mt76 wireless driver. While here adjust the way is_multicast_ether_addr() is implemented to not look weird. [1] Sponsored by: The FreeBSD Foundation Suggested by: emaste [1] Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50152 (cherry picked from commit a4618caa43c16e6e672c27dac1943fd833f8bd8f) --- sys/compat/linuxkpi/common/include/linux/etherdevice.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h index 5d3df744ae0e..1f2d6cf22d7e 100644 --- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h @@ -57,10 +57,16 @@ is_zero_ether_addr(const u8 * addr) 0x00); } +static inline bool +is_unicast_ether_addr(const u8 * addr) +{ + return ((addr[0] & 0x01) == 0x00); +} + static inline bool is_multicast_ether_addr(const u8 * addr) { - return (0x01 & addr[0]); + return ((addr[0] & 0x01) == 0x01); } static inline bool