This is an automated email from the ASF dual-hosted git repository.
jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 097cc8c8a67 boards/esp32s3: Fix MAC address byte order in LAN9250
driver
097cc8c8a67 is described below
commit 097cc8c8a67391a3ef2f2d8d031286fead749d1b
Author: nuttxs <[email protected]>
AuthorDate: Tue Mar 10 10:58:58 2026 +0800
boards/esp32s3: Fix MAC address byte order in LAN9250 driver
Fix MAC address byte order by reversing 6 bytes after reading
from eFuse. Adjust offset logic to apply after byte reversal,
ensuring Ethernet MAC is base_mac +3. Comply with Espressif's
MAC address generation specification for ESP32S3
Signed-off-by: nuttxs <[email protected]>
---
boards/xtensa/esp32s3/common/src/esp32s3_lan9250.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/boards/xtensa/esp32s3/common/src/esp32s3_lan9250.c
b/boards/xtensa/esp32s3/common/src/esp32s3_lan9250.c
index 3accb752fce..5eeae968f45 100644
--- a/boards/xtensa/esp32s3/common/src/esp32s3_lan9250.c
+++ b/boards/xtensa/esp32s3/common/src/esp32s3_lan9250.c
@@ -188,8 +188,8 @@ static int lan9250_getmac(const struct lan9250_lower_s
*lower, uint8_t *mac)
{
int fd;
int ret;
-#ifndef CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR
int i;
+#ifndef CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR
uint8_t tmp;
#endif
@@ -227,6 +227,11 @@ static int lan9250_getmac(const struct lan9250_lower_s
*lower, uint8_t *mac)
close(fd);
+ for (i = 0; i < 6; i++)
+ {
+ mac[i] = mac[5 - i];
+ }
+
#ifdef CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR
mac[5] += 3;
#else