Skip to content

Conversation

@13627105546
Copy link
Contributor

@13627105546 13627105546 commented Jan 20, 2026

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

Note: Please adhere to Contributing Guidelines.

Summary

This PR introduces a new boardctl command BOARDIOC_NET_GETMAC 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 BOARDIOC_NET_GETMAC definition in include/sys/boardctl.h .
  • Add board_get_netmac function prototype in include/nuttx/board.h .
  • Implement dispatch logic for BOARDIOC_NET_GETMAC in boards/boardctl.c .

Impact

  • Users : No direct impact unless BOARDIOC_NET_GETMAC 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 from 0cd5410 to 46010d1 Compare January 21, 2026 02:43
This commit adds 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 46010d1 to 7bdef73 Compare January 21, 2026 03:00
struct boardioc_macaddr_s
{
FAR const char *ifname;
FAR uint8_t *mac;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chnage to macaddr[RADIO_MAX_ADDRLEN]

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