Skip to content

Commit

Permalink
drivers/enc28j60: convert to use netdev_eth_t
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Mar 28, 2020
1 parent 3528f9c commit a058f49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/enc28j60/enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion drivers/include/enc28j60.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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 */
Expand Down

0 comments on commit a058f49

Please sign in to comment.