-
Notifications
You must be signed in to change notification settings - Fork 1.5k
boards/boardctl: Add BOARDIOC_NET_GETMAC command #18031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e979139 to
e97eee7
Compare
e97eee7 to
2078d72
Compare
8d1a92a to
f4cfe96
Compare
f4cfe96 to
0cd5410
Compare
46010d1 to
7bdef73
Compare
7bdef73 to
b140211
Compare
boards/boardctl.c
Outdated
| FAR struct boardioc_macaddr_s *req = | ||
| (FAR struct boardioc_macaddr_s *)arg; | ||
|
|
||
| ret = board_macaddr((FAR const char *)req->ifname, req->macaddr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ret = board_macaddr((FAR const char *)req->ifname, req->macaddr); | |
| ret = board_macaddr(req->ifname, req->macaddr); |
include/sys/boardctl.h
Outdated
| #ifdef CONFIG_BOARDCTL_MACADDR | ||
| struct boardioc_macaddr_s | ||
| { | ||
| uint8_t ifname[IFNAMSIZ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| uint8_t ifname[IFNAMSIZ]; | |
| char ifname[IFNAMSIZ]; |
| struct boardioc_macaddr_s | ||
| { | ||
| uint8_t ifname[IFNAMSIZ]; | ||
| uint8_t macaddr[RADIO_MAX_ADDRLEN]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need include some header file?
b140211 to
18e8e70
Compare
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>
18e8e70 to
4b1f1fe
Compare
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.
Impact
Testing