Skip to content
Snippets Groups Projects
Commit 8db42427 authored by Martine Lenders's avatar Martine Lenders
Browse files

native/drivers/sys: adapt ethernet netdev2 for info struct

parent dad883c7
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ static void _sigio_child(netdev2_tap_t *dev);
/* netdev2 interface */
static int _init(netdev2_t *netdev);
static int _send(netdev2_t *netdev, const struct iovec *vector, int n);
static int _recv(netdev2_t *netdev, char* buf, int n);
static int _recv(netdev2_t *netdev, char* buf, int n, void *info);
static inline void _get_mac_addr(netdev2_t *netdev, uint8_t *dst)
{
......@@ -187,9 +187,10 @@ static inline bool _is_addr_multicast(uint8_t *addr)
return (addr[0] & 0x01);
}
static int _recv(netdev2_t *netdev2, char *buf, int len)
static int _recv(netdev2_t *netdev2, char *buf, int len, void *info)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev2;
(void)info;
if (!buf) {
/* no way of figuring out packet size without racey buffering,
......
......@@ -243,13 +243,14 @@ static int nd_send(netdev2_t *netdev, const struct iovec *data, int count)
return c;
}
static int nd_recv(netdev2_t *netdev, char *buf, int max_len)
static int nd_recv(netdev2_t *netdev, char *buf, int max_len, void *info)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
uint8_t head[6];
size_t size;
uint16_t next;
(void)info;
mutex_lock(&dev->devlock);
/* set read pointer to RX read address */
......
......@@ -60,7 +60,7 @@ static void _get_mac_addr(netdev2_t *dev, uint8_t* buf);
/* netdev2 interface */
static int _send(netdev2_t *netdev, const struct iovec *vector, int count);
static int _recv(netdev2_t *netdev, char* buf, int len);
static int _recv(netdev2_t *netdev, char* buf, int len, void *info);
static int _init(netdev2_t *dev);
static void _isr(netdev2_t *dev);
int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len);
......@@ -352,11 +352,12 @@ static void _get_mac_addr(netdev2_t *encdev, uint8_t* buf)
unlock(dev);
}
static int _recv(netdev2_t *netdev, char* buf, int len)
static int _recv(netdev2_t *netdev, char* buf, int len, void *info)
{
encx24j600_t * dev = (encx24j600_t *) netdev;
encx24j600_frame_hdr_t hdr;
(void)info;
lock(dev);
/* read frame header */
......
......@@ -32,7 +32,7 @@
static gnrc_pktsnip_t *_recv(gnrc_netdev2_t *gnrc_netdev2)
{
netdev2_t *dev = gnrc_netdev2->dev;
int bytes_expected = dev->driver->recv(dev, NULL, 0);
int bytes_expected = dev->driver->recv(dev, NULL, 0, NULL);
gnrc_pktsnip_t *pkt = NULL;
if (bytes_expected) {
......@@ -45,7 +45,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netdev2_t *gnrc_netdev2)
goto out;
}
int nread = dev->driver->recv(dev, pkt->data, bytes_expected);
int nread = dev->driver->recv(dev, pkt->data, bytes_expected, NULL);
if(nread <= 0) {
DEBUG("_recv_ethernet_packet: read error.\n");
goto safe_out;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment