git: a4618caa43c1 - main - LinuxKPI: add is_unicast_ether_addr()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 05 May 2025 10:45:29 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=a4618caa43c16e6e672c27dac1943fd833f8bd8f
commit a4618caa43c16e6e672c27dac1943fd833f8bd8f
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-05 10:44: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]
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D50152
---
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