From a058f492deed0a3f98fd442fbae23632d6e8cd57 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 28 Mar 2020 19:51:51 +0100 Subject: [PATCH] drivers/enc28j60: convert to use netdev_eth_t --- drivers/enc28j60/enc28j60.c | 3 ++- drivers/include/enc28j60.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/enc28j60/enc28j60.c b/drivers/enc28j60/enc28j60.c index 500966c8ce3e9..620c4a2a08f1f 100644 --- a/drivers/enc28j60/enc28j60.c +++ b/drivers/enc28j60/enc28j60.c @@ -543,7 +543,8 @@ static const netdev_driver_t netdev_driver_enc28j60 = { void enc28j60_setup(enc28j60_t *dev, const enc28j60_params_t *params) { - dev->netdev.driver = &netdev_driver_enc28j60; + netdev_eth_reset(&dev->netdev); + dev->netdev.netdev.driver = &netdev_driver_enc28j60; dev->p = *params; mutex_init(&dev->lock); dev->tx_time = 0; diff --git a/drivers/include/enc28j60.h b/drivers/include/enc28j60.h index 4d3263ec1b41d..8c29c3af93c32 100644 --- a/drivers/include/enc28j60.h +++ b/drivers/include/enc28j60.h @@ -27,6 +27,7 @@ #include "periph/spi.h" #include "periph/gpio.h" #include "net/netdev.h" +#include "net/netdev/eth.h" #ifdef __cplusplus extern "C" { @@ -46,7 +47,7 @@ typedef struct { * @brief ENC28J60 device descriptor */ typedef struct { - netdev_t netdev; /**< pull in the netdev fields */ + netdev_eth_t netdev; /**< pull in the netdev fields */ enc28j60_params_t p; /**< SPI and pin confiuration */ mutex_t lock; /**< lock the device on access */ uint32_t tx_time; /**< last transmission time for timeout handling */