diff --git a/drivers/cc2420/cc2420.c b/drivers/cc2420/cc2420.c index 7e6e46d0f8..2ce998b399 100644 --- a/drivers/cc2420/cc2420.c +++ b/drivers/cc2420/cc2420.c @@ -145,7 +145,7 @@ size_t cc2420_tx_prepare(cc2420_t *dev, const iolist_t *iolist) void cc2420_tx_exec(cc2420_t *dev) { /* trigger the transmission */ - if (dev->options & CC2420_OPT_TELL_TX_START) { + if (dev->netdev.netdev.event_callback) { dev->netdev.netdev.event_callback(&dev->netdev.netdev, NETDEV_EVENT_TX_STARTED); } diff --git a/drivers/cc2420/cc2420_getset.c b/drivers/cc2420/cc2420_getset.c index a0bed1c68b..4c33b4f3fa 100644 --- a/drivers/cc2420/cc2420_getset.c +++ b/drivers/cc2420/cc2420_getset.c @@ -199,14 +199,6 @@ int cc2420_set_option(cc2420_t *dev, uint16_t option, bool state) DEBUG("cc2420: set_opt: CC2420_OPT_PRELOADING\n"); break; - case CC2420_OPT_TELL_TX_START: - case CC2420_OPT_TELL_TX_END: - case CC2420_OPT_TELL_RX_START: - case CC2420_OPT_TELL_RX_END: - DEBUG("cc2420: set_opt: TX/RX START/END\n"); - /* TODO */ - break; - default: return -ENOTSUP; } @@ -242,14 +234,6 @@ int cc2420_set_option(cc2420_t *dev, uint16_t option, bool state) DEBUG("cc2420: clr_opt: CC2420_OPT_PRELOADING\n"); break; - case CC2420_OPT_TELL_TX_START: - case CC2420_OPT_TELL_TX_END: - case CC2420_OPT_TELL_RX_START: - case CC2420_OPT_TELL_RX_END: - DEBUG("cc2420: clr_opt: TX/RX START/END\n"); - /* TODO */ - break; - default: return -ENOTSUP; } diff --git a/drivers/cc2420/cc2420_netdev.c b/drivers/cc2420/cc2420_netdev.c index 010c4ce3ea..4d238d478f 100644 --- a/drivers/cc2420/cc2420_netdev.c +++ b/drivers/cc2420/cc2420_netdev.c @@ -213,16 +213,11 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len) return opt_state(val, (dev->options & CC2420_OPT_PROMISCUOUS)); case NETOPT_RX_START_IRQ: - return opt_state(val, (dev->options & CC2420_OPT_TELL_RX_START)); - case NETOPT_RX_END_IRQ: - return opt_state(val, (dev->options & CC2420_OPT_TELL_TX_END)); - case NETOPT_TX_START_IRQ: - return opt_state(val, (dev->options & CC2420_OPT_TELL_RX_START)); - case NETOPT_TX_END_IRQ: - return opt_state(val, (dev->options & CC2420_OPT_TELL_RX_END)); + *((netopt_enable_t *)val) = NETOPT_ENABLE; + return sizeof(netopt_enable_t); default: return -ENOTSUP; @@ -280,18 +275,6 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t val_len) case NETOPT_PROMISCUOUSMODE: return cc2420_set_option(dev, CC2420_OPT_PROMISCUOUS, to_bool(val)); - case NETOPT_RX_START_IRQ: - return cc2420_set_option(dev, CC2420_OPT_TELL_RX_START, to_bool(val)); - - case NETOPT_RX_END_IRQ: - return cc2420_set_option(dev, CC2420_OPT_TELL_RX_END, to_bool(val)); - - case NETOPT_TX_START_IRQ: - return cc2420_set_option(dev, CC2420_OPT_TELL_TX_START, to_bool(val)); - - case NETOPT_TX_END_IRQ: - return cc2420_set_option(dev, CC2420_OPT_TELL_TX_END, to_bool(val)); - default: return ext; } diff --git a/drivers/cc2420/include/cc2420_registers.h b/drivers/cc2420/include/cc2420_registers.h index 00725aa1fb..83708c9408 100644 --- a/drivers/cc2420/include/cc2420_registers.h +++ b/drivers/cc2420/include/cc2420_registers.h @@ -31,17 +31,8 @@ extern "C" { */ #define CC2420_OPT_AUTOACK (0x0001) /**< auto ACKs active */ #define CC2420_OPT_CSMA (0x0002) /**< CSMA active */ -#define CC2420_OPT_PROMISCUOUS (0x0004) /**< promiscuous mode - * active */ +#define CC2420_OPT_PROMISCUOUS (0x0004) /**< promiscuous mode active */ #define CC2420_OPT_PRELOADING (0x0008) /**< preloading enabled */ -#define CC2420_OPT_TELL_TX_START (0x0010) /**< notify MAC layer on TX - * start */ -#define CC2420_OPT_TELL_TX_END (0x0020) /**< notify MAC layer on TX - * finished */ -#define CC2420_OPT_TELL_RX_START (0x0040) /**< notify MAC layer on RX - * start */ -#define CC2420_OPT_TELL_RX_END (0x0080) /**< notify MAC layer on RX - * finished */ /** @} */ /** @@ -49,11 +40,11 @@ extern "C" { * @{ */ enum { - CC2420_GOTO_PD, /**< power down */ + CC2420_GOTO_PD, /**< power down */ CC2420_GOTO_IDLE, /**< idle */ - CC2420_GOTO_RX, /**< receive state */ + CC2420_GOTO_RX, /**< receive state */ CC2420_GOTO_TXON, /**< transmit packet without CCA */ - CC2420_GOTO_TXONCCA /**< transmit packet using CCA */ + CC2420_GOTO_TXONCCA /**< transmit packet using CCA */ }; /**