Skip to content
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

drivers: ieee802154: rf2xx: Add EUI-64 from DT and iface no auto start #24096

Merged

Conversation

nandojve
Copy link
Member

@nandojve nandojve commented Apr 4, 2020

Add local-mac-address on DT and enable it on rf2xx driver. If user define local-mac-address this value will be used as default mac address. Otherwise driver automatically add a random mac address.

On application level user can change default mac address using net_mgmt command with NET_REQUEST_IEEE802154_SET_EXT_ADDR parameter defined on include/net/ieee802154_mgmt.h header.

Refactor get_mac to rf2xx_get_mac and turn it as a weak method. This allows any user to create their own set mac address. This is important because RF2xx is a transceiver over SPI and may need mac address be defined when system is booting.
Add a Kconfig option that sets NET_IF_NO_AUTO_START at driver init. This way user can control when net_if will be up with proper configuration.

Fixes #23193

Signed-off-by: Gerson Fernando Budke [email protected]

@nandojve nandojve added DNM This PR should not be merged (Do Not Merge) area: IEEE 802.15.4 labels Apr 4, 2020
@nandojve nandojve changed the title drivers: ieee802154: rf2xx: Add local-mac-address [WIP] drivers: ieee802154: rf2xx: Add local-mac-address Apr 4, 2020
@nandojve nandojve force-pushed the at86rf233_add_local_mac_address branch from cb65946 to 79e5fde Compare April 11, 2020 15:04
@nandojve nandojve removed the DNM This PR should not be merged (Do Not Merge) label Apr 11, 2020
@zephyrbot zephyrbot added the area: API Changes to public APIs label Apr 11, 2020
@nandojve nandojve changed the title [WIP] drivers: ieee802154: rf2xx: Add local-mac-address drivers: ieee802154: rf2xx: Add local-mac-address Apr 11, 2020
@nandojve nandojve changed the title drivers: ieee802154: rf2xx: Add local-mac-address drivers: ieee802154: rf2xx: Refactor get-mac address Apr 11, 2020
@carlescufi carlescufi requested a review from rlubos April 14, 2020 15:28
Copy link
Collaborator

@tbursztyka tbursztyka left a comment

Choose a reason for hiding this comment

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

no need of the 2nd patch

drivers/ieee802154/ieee802154_rf2xx.c Outdated Show resolved Hide resolved
drivers/ieee802154/ieee802154_rf2xx.h Outdated Show resolved Hide resolved
drivers/ieee802154/ieee802154_rf2xx.c Outdated Show resolved Hide resolved
include/drivers/ieee802154/rf2xx.h Outdated Show resolved Hide resolved
@nandojve nandojve mentioned this pull request Apr 18, 2020
61 tasks
Add local-mac-address on DT and enable it on rf2xx driver. If user
define local-mac-address this value will be used as default mac address.
Otherwise driver automatically add a random mac address.

On application level user can change default mac address using net_mgmt
command with NET_REQUEST_IEEE802154_SET_EXT_ADDR parameter defined on
include/net/ieee802154_mgmt.h header.

Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve nandojve force-pushed the at86rf233_add_local_mac_address branch from 79e5fde to 906a1e2 Compare April 24, 2020 02:59
@nandojve nandojve changed the title drivers: ieee802154: rf2xx: Refactor get-mac address drivers: ieee802154: rf2xx: Add EUI-64 from DT and iface no auto start Apr 24, 2020
@nandojve nandojve force-pushed the at86rf233_add_local_mac_address branch from 906a1e2 to f2482d9 Compare April 24, 2020 03:14
@nandojve
Copy link
Member Author

The new proposal: if for any reason CONFIG_IEEE802154_RF2XX_NET_IF_NO_AUTO_START should be defined as true, who did that should call net_if_up() at some point.

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

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

Looks good, one nit about the config option.

drivers/ieee802154/Kconfig.rf2xx Outdated Show resolved Hide resolved
Add a Kconfig option that allows user to set any necessary config
using management interface before interface be operational. A use
case is set the EUI-64 address from an external EEPROM by the
NET_REQUEST_IEEE802154_SET_EXT_ADDR command. After all configs
are done net_if_up() can be invoked to bring interface up.

Fixes zephyrproject-rtos#23193.

Signed-off-by: Gerson Fernando Budke <[email protected]>
@nandojve nandojve force-pushed the at86rf233_add_local_mac_address branch from f2482d9 to 63a95dd Compare April 24, 2020 13:06
@nandojve nandojve requested a review from jukkar April 24, 2020 21:16
@jukkar jukkar merged commit 9be1ba9 into zephyrproject-rtos:master Apr 28, 2020
@nandojve nandojve deleted the at86rf233_add_local_mac_address branch April 28, 2020 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow overriding get_mac() function in ieee802154 drivers
4 participants