Skip to content

Commit

Permalink
drivers: net: adapt to removed event_callback argument
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Feb 21, 2016
1 parent e90fcde commit c39f220
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions cpu/native/netdev2_tap/netdev2_tap.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static inline int _set_promiscous(netdev2_t *netdev, int value)
static inline void _isr(netdev2_t *netdev)
{
if (netdev->event_callback) {
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE, NULL);
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
}
#if DEVELHELP
else {
Expand Down Expand Up @@ -273,7 +273,7 @@ static void _tap_isr(void) {
netdev2_t *netdev = (netdev2_t *)&netdev2_tap;

if (netdev->event_callback) {
netdev->event_callback(netdev, NETDEV2_EVENT_ISR, netdev->isr_arg);
netdev->event_callback(netdev, NETDEV2_EVENT_ISR);
}
else {
puts("netdev2_tap: _isr: no event callback.");
Expand Down
4 changes: 2 additions & 2 deletions drivers/cc110x/cc110x-netdev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ static int _set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
static void _netdev2_cc110x_isr(void *arg)
{
netdev2_t *netdev2 = (netdev2_t*) arg;
netdev2->event_callback(netdev2, NETDEV2_EVENT_ISR, netdev2->isr_arg);
netdev2->event_callback(netdev2, NETDEV2_EVENT_ISR);
}

static void _netdev2_cc110x_rx_callback(void *arg)
{
netdev2_t *netdev2 = (netdev2_t*) arg;
cc110x_t *cc110x = &((netdev2_cc110x_t*) arg)->cc110x;
gpio_irq_disable(cc110x->params.gdo2);
netdev2->event_callback(netdev2, NETDEV2_EVENT_RX_COMPLETE, NULL);
netdev2->event_callback(netdev2, NETDEV2_EVENT_RX_COMPLETE);
}

static void _isr(netdev2_t *dev)
Expand Down
10 changes: 5 additions & 5 deletions drivers/enc28j60/enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static void mac_set(enc28j60_t *dev, uint8_t *mac)
static void on_int(void *arg)
{
netdev2_t *netdev = (netdev2_t *)arg;
netdev->event_callback(arg, NETDEV2_EVENT_ISR, netdev->isr_arg);
netdev->event_callback(arg, NETDEV2_EVENT_ISR);
}

static int nd_send(netdev2_t *netdev, const struct iovec *data, int count)
Expand Down Expand Up @@ -387,17 +387,17 @@ static void nd_isr(netdev2_t *netdev)
/* go and tell the new link layer state to upper layers */
if (cmd_r_phy(dev, REG_PHY_PHSTAT2) & PHSTAT2_LSTAT) {
DEBUG("[enc28j60] isr: link up!\n");
netdev->event_callback(netdev, NETDEV2_EVENT_LINK_UP, NULL);
netdev->event_callback(netdev, NETDEV2_EVENT_LINK_UP);
}
else {
DEBUG("[enc28j60] isr: link down!\n");
netdev->event_callback(netdev, NETDEV2_EVENT_LINK_DOWN, NULL);
netdev->event_callback(netdev, NETDEV2_EVENT_LINK_DOWN);
}
}
if (eir & EIR_PKTIF) {
do {
DEBUG("[enc28j60] isr: packet received\n");
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE, NULL);
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
} while (cmd_rcr(dev, REG_B1_EPKTCNT, 1) > 0);
}
if (eir & EIR_RXERIF) {
Expand All @@ -406,7 +406,7 @@ static void nd_isr(netdev2_t *netdev)
}
if (eir & EIR_TXIF) {
DEBUG("[enc28j60] isr: packet transmitted\n");
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE, NULL);
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
cmd_bfc(dev, REG_EIR, -1, EIR_TXIF);
}
if (eir & EIR_TXERIF) {
Expand Down
7 changes: 3 additions & 4 deletions drivers/encx24j600/encx24j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void encx24j600_isr(void *arg)
gpio_irq_disable(dev->int_pin);

/* call netdev2 hook */
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_ISR, dev->isr_arg);
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_ISR);
}

static void _isr(netdev2_t *netdev)
Expand All @@ -123,15 +123,14 @@ static void _isr(netdev2_t *netdev)
NETDEV2_EVENT_LINK_DOWN :
NETDEV2_EVENT_LINK_UP;

netdev->event_callback(netdev, event, NULL);
netdev->event_callback(netdev, event);
}

/* check & handle available packets */
if (eir & PKTIF) {
while (_packets_available(dev)) {
unlock(dev);
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE,
NULL);
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
lock(dev);
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/ethos/ethos.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static void _end_of_frame(ethos_t *dev)
case ETHOS_FRAME_TYPE_DATA:
if (dev->framesize) {
dev->last_framesize = dev->framesize;
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_ISR, dev->netdev.isr_arg);
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_ISR);
}
break;
case ETHOS_FRAME_TYPE_HELLO:
Expand Down Expand Up @@ -176,7 +176,7 @@ static void ethos_isr(void *arg, char c)
static void _isr(netdev2_t *netdev)
{
ethos_t *dev = (ethos_t *) netdev;
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_RX_COMPLETE, NULL);
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_RX_COMPLETE);
}

static int _init(netdev2_t *encdev)
Expand Down
3 changes: 1 addition & 2 deletions sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ static void _pass_on_packet(gnrc_pktsnip_t *pkt);
* @brief Function called by the device driver on device events
*
* @param[in] event type of event
* @param[in] data optional parameter
*/
static void _event_cb(netdev2_t *dev, netdev2_event_t event, void *data)
static void _event_cb(netdev2_t *dev, netdev2_event_t event)
{
(void) data;
gnrc_netdev2_t *gnrc_netdev2 = (gnrc_netdev2_t*) dev->isr_arg;
Expand Down

0 comments on commit c39f220

Please sign in to comment.