diff --git a/drivers/encx24j600/encx24j600.c b/drivers/encx24j600/encx24j600.c index d46fa63d2b74ffc7c4cd90fdccd8de1012e2b2c7..44b17061ecc18f8d9ca562a399a2edcd05202ea0 100644 --- a/drivers/encx24j600/encx24j600.c +++ b/drivers/encx24j600/encx24j600.c @@ -22,6 +22,10 @@ #include <assert.h> #include <errno.h> +#ifdef MODULE_NETSTATS_L2 +#include <string.h> +#endif + #include "mutex.h" #include "encx24j600.h" #include "encx24j600_internal.h" @@ -282,7 +286,7 @@ static int _init(netdev2_t *encdev) unlock(dev); #ifdef MODULE_NETSTATS_L2 - memset(&netdev->stats, 0, sizeof(netstats_t)); + memset(&encdev->stats, 0, sizeof(netstats_t)); #endif return 0; } @@ -359,7 +363,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info) if (buf) { #ifdef MODULE_NETSTATS_L2 netdev->stats.rx_count++; - netdev2->stats.rx_bytes += len; + netdev->stats.rx_bytes += len; #endif /* read packet (without 4 bytes checksum) */ sram_op(dev, ENC_RRXDATA, 0xFFFF, buf, payload_len);