diff --git a/drivers/at86rf2xx/at86rf2xx.c b/drivers/at86rf2xx/at86rf2xx.c index 84f09a41c08bc92c20891a57e3dad7dd3ea47caf..fbf916f30c42a18e647ecf09d797b296d4738e2d 100644 --- a/drivers/at86rf2xx/at86rf2xx.c +++ b/drivers/at86rf2xx/at86rf2xx.c @@ -56,15 +56,13 @@ void at86rf2xx_reset(at86rf2xx_t *dev) at86rf2xx_hardware_reset(dev); + netdev_ieee802154_reset(&dev->netdev); + /* Reset state machine to ensure a known state */ if (dev->state == AT86RF2XX_STATE_P_ON) { at86rf2xx_set_state(dev, AT86RF2XX_STATE_FORCE_TRX_OFF); } - /* reset options and sequence number */ - dev->netdev.seq = 0; - dev->netdev.flags = 0; - /* get an 8-byte unique ID to use as hardware address */ luid_get(addr_long.uint8, IEEE802154_LONG_ADDRESS_LEN); /* make sure we mark the address as non-multicast and not globally unique */ @@ -88,12 +86,7 @@ void at86rf2xx_reset(at86rf2xx_t *dev) #ifdef MODULE_NETSTATS_L2 at86rf2xx_set_option(dev, AT86RF2XX_OPT_TELL_TX_END, true); #endif - /* set default protocol */ -#ifdef MODULE_GNRC_SIXLOWPAN - dev->netdev.proto = GNRC_NETTYPE_SIXLOWPAN; -#elif MODULE_GNRC - dev->netdev.proto = GNRC_NETTYPE_UNDEF; -#endif + /* enable safe mode (protect RX FIFO until reading data starts) */ at86rf2xx_reg_write(dev, AT86RF2XX_REG__TRX_CTRL_2, AT86RF2XX_TRX_CTRL_2_MASK__RX_SAFE_MODE);