drivers: ieee802154: rf2xx: Add no auto start option

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 #23193.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is contained in:
Gerson Fernando Budke 2020-04-23 23:54:30 -03:00 committed by Jukka Rissanen
parent c755821608
commit 9be1ba9e08
2 changed files with 18 additions and 1 deletions

View file

@ -18,6 +18,18 @@ config IEEE802154_RF2XX_DRV_NAME
help
This option sets the driver name
config IEEE802154_RF2XX_NET_IF_NO_AUTO_START
bool "RF2X must wait configuration before change to operational mode"
help
This option allows user to set any configuration and/or filter before
radio became operational. For instance, the EUI-64 value can be
configured using NET_REQUEST_IEEE802154_SET_EXT_ADDR available from
ieee802154 management interface. When all configurations are done
net_if_up() can be invoked to bring interface up.
This option can be useful when using OpenThread or Zigbee. If you
have any doubt about this option leave it as default value.
config IEEE802154_RF2XX_RX_STACK_SIZE
int "Driver's internal RX thread stack size"
default 800

View file

@ -319,7 +319,7 @@ static inline u8_t *get_mac(struct device *dev)
/*
* Clear bit 0 to ensure it isn't a multicast address and set
* bit 1 to indicate address is locally administrered and may
* bit 1 to indicate address is locally administered and may
* not be globally unique.
*/
ctx->mac_addr[0] = (ctx->mac_addr[0] & ~0x01) | 0x02;
@ -792,6 +792,11 @@ static void rf2xx_iface_init(struct net_if *iface)
ctx->iface = iface;
#if defined(CONFIG_IEEE802154_RF2XX_NET_IF_NO_AUTO_START)
LOG_DBG("Interface auto start disabled. Waiting configuration...");
net_if_flag_set(iface, NET_IF_NO_AUTO_START);
#endif
ieee802154_init(iface);
}