Skip to content

Commit

Permalink
drivers: netdev2: rename isr_arg
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Feb 21, 2016
1 parent c39f220 commit 9c2a95a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion drivers/include/net/netdev2.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ typedef void (*netdev2_event_cb_t)(netdev2_t *dev, netdev2_event_t event);
*
* Supposed to be extended by driver implementations.
* The extended structure should contain all variable driver state.
*
* Contains a field @p context which is not used by the drivers, but supposed to
* be used by upper layers to store reference information.
*/
struct netdev2 {
const struct netdev2_driver *driver; /**< ptr to that driver's interface. */
netdev2_event_cb_t event_callback; /**< callback for device events */
void* isr_arg; /**< argument to pass on isr event */
void* context; /**< ptr to network stack context */
};

/**
Expand Down
4 changes: 2 additions & 2 deletions sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void _pass_on_packet(gnrc_pktsnip_t *pkt);
static void _event_cb(netdev2_t *dev, netdev2_event_t event)
{
(void) data;
gnrc_netdev2_t *gnrc_netdev2 = (gnrc_netdev2_t*) dev->isr_arg;
gnrc_netdev2_t *gnrc_netdev2 = (gnrc_netdev2_t*) dev->context;

if (event == NETDEV2_EVENT_ISR) {
msg_t msg;
Expand Down Expand Up @@ -116,7 +116,7 @@ static void *_gnrc_netdev2_thread(void *args)

/* register the event callback with the device driver */
dev->event_callback = _event_cb;
dev->isr_arg = (void*) gnrc_netdev2;
dev->context = (void*) gnrc_netdev2;

/* register the device to the network stack*/
gnrc_netif_add(thread_getpid());
Expand Down

0 comments on commit 9c2a95a

Please sign in to comment.