Skip to content

Conversation

@13627105546
Copy link
Contributor

@13627105546 13627105546 commented Jan 20, 2026

This commit adds a new boardctl command BOARDCTL_MACADDR to retrieve the MAC address of the network interface. The board_macaddr function needs to be implemented by the board logic.

Note: Please adhere to Contributing Guidelines.

Summary

This PR introduces a new boardctl command BOARDCTL_MACADDR to allow applications (like netinit ) to retrieve the network interface MAC address from the board-specific logic.

Why In some embedded scenarios, the MAC address (especially for Wi-Fi) is stored in board-specific storage (e.g., OTP, NVM, or a config file) and needs to be retrieved by the network initialization logic at runtime. Currently, there is no standard boardctl command for this purpose.

  • Add BOARDCTL_MACADDR definition in include/sys/boardctl.h .
  • Add board_macaddr function prototype in include/nuttx/board.h .
  • Implement dispatch logic for BOARDCTL_MACADDR in boards/boardctl.c .

Impact

  • Users : No direct impact unless BOARDCTL_MACADDR is used.
  • Compatibility : Backward compatible.

Testing

@github-actions github-actions bot added Area: OS Components OS Components issues Size: S The size of the change in this PR is small labels Jan 20, 2026
jerpelea
jerpelea previously approved these changes Jan 20, 2026
jerpelea
jerpelea previously approved these changes Jan 20, 2026
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch from e97eee7 to 2078d72 Compare January 20, 2026 10:08
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch 2 times, most recently from 8d1a92a to f4cfe96 Compare January 20, 2026 10:17
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch from f4cfe96 to 0cd5410 Compare January 21, 2026 02:13
@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Jan 21, 2026
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch 2 times, most recently from 46010d1 to 7bdef73 Compare January 21, 2026 03:00
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch from 7bdef73 to b140211 Compare January 21, 2026 03:53
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch 2 times, most recently from 18e8e70 to 4b1f1fe Compare January 21, 2026 09:17
@13627105546 13627105546 changed the title boards/boardctl: Add BOARDIOC_NET_GETMAC command boards/boardctl: Add BOARDCTL_MACADDR command Jan 21, 2026
Add a new boardctl command BOARDIOC_MACADDR to retrieve the MAC address of the network interface.

The board_macaddr function needs to be implemented by the board logic.

Signed-off-by: daichuan <daichuan@xiaomi.com>
@13627105546 13627105546 force-pushed the topic/netinit-wifimac branch from 4b1f1fe to 98062ea Compare January 21, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Area: OS Components OS Components issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants