diff --git a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c index 07cae2223..7dc6c5648 100644 --- a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c +++ b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c @@ -59,7 +59,7 @@ * Private Function Prototypes ****************************************************************************/ -static void acceptassoc_eventcb(FAR struct ieee802154_notif_s *notif, +static void acceptassoc_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg); /**************************************************************************** @@ -165,7 +165,7 @@ void i8sak_acceptassoc_cmd(FAR struct i8sak_s *i8sak, int argc, !i8sak->acceptall); } -static void acceptassoc_eventcb(FAR struct ieee802154_notif_s *notif, +static void acceptassoc_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg) { FAR struct i8sak_s *i8sak = (FAR struct i8sak_s *)arg; @@ -177,13 +177,14 @@ static void acceptassoc_eventcb(FAR struct ieee802154_notif_s *notif, * indication address into the association response primitive */ - IEEE802154_EADDRCOPY(assocresp.devaddr, notif->u.assocind.devaddr); + IEEE802154_EADDRCOPY(assocresp.devaddr, primitive->u.assocind.devaddr); /* If the address matches our device, accept the association. * Otherwise, reject the assocation. */ - if (IEEE802154_EADDRCMP(notif->u.assocind.devaddr, i8sak->ep_addr.eaddr)) + if (i8sak->acceptall || + IEEE802154_EADDRCMP(primitive->u.assocind.devaddr, i8sak->ep_addr.eaddr)) { /* Assign the short address */ diff --git a/wireless/ieee802154/i8sak/i8sak_assoc.c b/wireless/ieee802154/i8sak/i8sak_assoc.c index 05dd4f4a3..e9106c326 100644 --- a/wireless/ieee802154/i8sak/i8sak_assoc.c +++ b/wireless/ieee802154/i8sak/i8sak_assoc.c @@ -63,7 +63,7 @@ * Private Function Prototypes ****************************************************************************/ -static void assoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg); +static void assoc_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg); /**************************************************************************** * Public Functions @@ -318,11 +318,11 @@ void i8sak_assoc_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) * Private Functions ****************************************************************************/ -static void assoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg) +static void assoc_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg) { FAR struct i8sak_s *i8sak = (FAR struct i8sak_s *)arg; - if (notif->u.assocconf.status == IEEE802154_STATUS_SUCCESS) + if (primitive->u.assocconf.status == IEEE802154_STATUS_SUCCESS) { printf("i8sak: ASSOC.request succeeded\n"); i8sak->result = OK; @@ -330,7 +330,7 @@ static void assoc_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg) else { printf("i8sak: ASSOC.request failed: %s\n", - IEEE802154_STATUS_STRING[notif->u.assocconf.status]); + IEEE802154_STATUS_STRING[primitive->u.assocconf.status]); i8sak->result = -EAGAIN; } diff --git a/wireless/ieee802154/i8sak/i8sak_events.c b/wireless/ieee802154/i8sak/i8sak_events.c index eb27b0408..fce96040d 100644 --- a/wireless/ieee802154/i8sak/i8sak_events.c +++ b/wireless/ieee802154/i8sak/i8sak_events.c @@ -79,7 +79,7 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg) struct ieee802154_netmac_s netarg; #endif FAR struct i8sak_eventreceiver_s *receiver; - FAR struct ieee802154_notif_s *notif = NULL; + FAR struct ieee802154_primitive_s *primitive = NULL; int ret; if (i8sak->mode == I8SAK_MODE_CHAR) @@ -104,14 +104,14 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg) { ret = ioctl(i8sak->fd, MAC802154IOC_GET_EVENT, (unsigned long)((uintptr_t)&macarg)); - notif = &macarg.notif; + primitive = &macarg.primitive; } #ifdef CONFIG_NET_6LOWPAN else if (i8sak->mode == I8SAK_MODE_NETIF) { ret = ioctl(i8sak->fd, MAC802154IOC_GET_EVENT, (unsigned long)((uintptr_t)&netarg)); - notif = &netarg.u.notif; + primitive = &netarg.u.primitive; } #endif @@ -135,40 +135,40 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg) while (receiver != NULL) { - if ((notif->notiftype == IEEE802154_NOTIFY_CONF_DATA && + if ((primitive->type == IEEE802154_PRIMITIVE_CONF_DATA && receiver->filter.confevents.data) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_ASSOC && + (primitive->type == IEEE802154_PRIMITIVE_CONF_ASSOC && receiver->filter.confevents.assoc) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_DISASSOC && + (primitive->type == IEEE802154_PRIMITIVE_CONF_DISASSOC && receiver->filter.confevents.disassoc) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_GTS && + (primitive->type == IEEE802154_PRIMITIVE_CONF_GTS && receiver->filter.confevents.gts) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_RESET && + (primitive->type == IEEE802154_PRIMITIVE_CONF_RESET && receiver->filter.confevents.reset) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_RXENABLE && + (primitive->type == IEEE802154_PRIMITIVE_CONF_RXENABLE && receiver->filter.confevents.rxenable) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_SCAN && + (primitive->type == IEEE802154_PRIMITIVE_CONF_SCAN && receiver->filter.confevents.scan) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_START && + (primitive->type == IEEE802154_PRIMITIVE_CONF_START && receiver->filter.confevents.start) || - (notif->notiftype == IEEE802154_NOTIFY_CONF_POLL && + (primitive->type == IEEE802154_PRIMITIVE_CONF_POLL && receiver->filter.confevents.poll) || - (notif->notiftype == IEEE802154_NOTIFY_IND_ASSOC && + (primitive->type == IEEE802154_PRIMITIVE_IND_ASSOC && receiver->filter.indevents.assoc) || - (notif->notiftype == IEEE802154_NOTIFY_IND_DISASSOC && + (primitive->type == IEEE802154_PRIMITIVE_IND_DISASSOC && receiver->filter.indevents.disassoc) || - (notif->notiftype == IEEE802154_NOTIFY_IND_BEACONNOTIFY && + (primitive->type == IEEE802154_PRIMITIVE_IND_BEACONNOTIFY && receiver->filter.indevents.beacon) || - (notif->notiftype == IEEE802154_NOTIFY_IND_GTS && + (primitive->type == IEEE802154_PRIMITIVE_IND_GTS && receiver->filter.indevents.gts) || - (notif->notiftype == IEEE802154_NOTIFY_IND_ORPHAN && + (primitive->type == IEEE802154_PRIMITIVE_IND_ORPHAN && receiver->filter.indevents.orphan) || - (notif->notiftype == IEEE802154_NOTIFY_IND_COMMSTATUS && + (primitive->type == IEEE802154_PRIMITIVE_IND_COMMSTATUS && receiver->filter.indevents.commstatus) || - (notif->notiftype == IEEE802154_NOTIFY_IND_SYNCLOSS && + (primitive->type == IEEE802154_PRIMITIVE_IND_SYNCLOSS && receiver->filter.indevents.syncloss)) { - receiver->cb(notif, receiver->arg); + receiver->cb(primitive, receiver->arg); if (receiver->oneshot) { diff --git a/wireless/ieee802154/i8sak/i8sak_events.h b/wireless/ieee802154/i8sak/i8sak_events.h index 466688ee4..65382de01 100644 --- a/wireless/ieee802154/i8sak/i8sak_events.h +++ b/wireless/ieee802154/i8sak/i8sak_events.h @@ -59,7 +59,7 @@ * Public Types ****************************************************************************/ -typedef void (*i8sak_eventcallback_t) (FAR struct ieee802154_notif_s *notif, +typedef void (*i8sak_eventcallback_t) (FAR struct ieee802154_primitive_s *primitive, FAR void *arg); struct i8sak_eventfilter_s diff --git a/wireless/ieee802154/i8sak/i8sak_poll.c b/wireless/ieee802154/i8sak/i8sak_poll.c index 0fcc7e3bd..52b861393 100644 --- a/wireless/ieee802154/i8sak/i8sak_poll.c +++ b/wireless/ieee802154/i8sak/i8sak_poll.c @@ -61,7 +61,7 @@ * Private Function Prototypes ****************************************************************************/ -static void poll_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg); +static void poll_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg); /**************************************************************************** * Public Functions @@ -169,18 +169,18 @@ void i8sak_poll_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) * Private Function ****************************************************************************/ -static void poll_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg) +static void poll_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg) { FAR struct i8sak_s *i8sak = (FAR struct i8sak_s *)arg; - if (notif->u.pollconf.status == IEEE802154_STATUS_SUCCESS) + if (primitive->u.pollconf.status == IEEE802154_STATUS_SUCCESS) { printf("i8sak: POLL.request succeeded\n"); } else { printf("i8sak: POLL.request failed: %s\n", - IEEE802154_STATUS_STRING[notif->u.pollconf.status]); + IEEE802154_STATUS_STRING[primitive->u.pollconf.status]); } sem_post(&i8sak->sigsem); diff --git a/wireless/ieee802154/i8sak/i8sak_scan.c b/wireless/ieee802154/i8sak/i8sak_scan.c index 3b717e2f5..849c8d40d 100644 --- a/wireless/ieee802154/i8sak/i8sak_scan.c +++ b/wireless/ieee802154/i8sak/i8sak_scan.c @@ -59,7 +59,7 @@ * Private Function Prototypes ****************************************************************************/ -static void scan_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg); +static void scan_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg); /**************************************************************************** * Public Functions @@ -203,10 +203,10 @@ void i8sak_scan_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) * Private Functions ****************************************************************************/ -static void scan_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg) +static void scan_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg) { FAR struct i8sak_s *i8sak = (FAR struct i8sak_s *)arg; - FAR struct ieee802154_scan_conf_s *scan = ¬if->u.scanconf; + FAR struct ieee802154_scan_conf_s *scan = &primitive->u.scanconf; int i; printf("\n\ni8sak: Scan complete: %s\n", diff --git a/wireless/ieee802154/i8sak/i8sak_tx.c b/wireless/ieee802154/i8sak/i8sak_tx.c index 3f8c20049..0ff18e4bd 100644 --- a/wireless/ieee802154/i8sak/i8sak_tx.c +++ b/wireless/ieee802154/i8sak/i8sak_tx.c @@ -62,7 +62,7 @@ * Private Function Prototypes ****************************************************************************/ -static void tx_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg); +static void tx_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg); /**************************************************************************** * Public Functions @@ -281,18 +281,18 @@ void i8sak_tx_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[]) close(fd); } -static void tx_eventcb(FAR struct ieee802154_notif_s *notif, FAR void *arg) +static void tx_eventcb(FAR struct ieee802154_primitive_s *primitive, FAR void *arg) { FAR struct i8sak_s *i8sak = (FAR struct i8sak_s *)arg; - if (notif->u.dataconf.status == IEEE802154_STATUS_SUCCESS) + if (primitive->u.dataconf.status == IEEE802154_STATUS_SUCCESS) { printf("i8sak: frame tx success\n"); } else { printf("i8sak: frame failed to send: %s\n", - IEEE802154_STATUS_STRING[notif->u.dataconf.status]); + IEEE802154_STATUS_STRING[primitive->u.dataconf.status]); } sem_post(&i8sak->sigsem);