diff --git a/drivers/wireless/ieee802154/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40.c index 3659fe1651e..2cb3300e5a0 100644 --- a/drivers/wireless/ieee802154/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40.c @@ -268,7 +268,8 @@ static void mrf24j40_dopoll_csma(FAR struct ieee802154_radio_s *radio) FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; /* Need to get exlusive access to the device so that we can use the copy - * buffer */ + * buffer. + */ while (sem_wait(&dev->exclsem) < 0) { } @@ -318,30 +319,31 @@ static void mrf24j40_txnotify_gts(FAR struct ieee802154_radio_s *radio) FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_radio_s *)radio; /* Need to get exclusive access to the device so that we can use the copy - * buffer */ + * buffer. + */ while (sem_wait(dev->exclsem) < 0) { } - for(gts = 0; gts < MRF24J40_GTS_SLOTS, gts++) - { - if(!dev->gts_txdesc[i].busy) - { - ret = dev->phyif->poll_gts(dev->phyif, &radio->gts_txdesc[i], - &dev->tx_buf[0]); + for (gts = 0; gts < MRF24J40_GTS_SLOTS, gts++) + { + if (!dev->gts_txdesc[i].busy) + { + ret = dev->phyif->poll_gts(dev->phyif, &radio->gts_txdesc[i], + &dev->tx_buf[0]); - if (ret > 0) - { - /* Now the txdesc is in use */ + if (ret > 0) + { + /* Now the txdesc is in use */ - dev->gts_txdesc[i].busy = 1; + dev->gts_txdesc[i].busy = 1; - /* Setup the transaction on the device in the open GTS FIFO */ + /* Setup the transaction on the device in the open GTS FIFO */ - mrf24j40_gts_setup(radio, i, &dev->tx_buf[0], - dev->gts_desc[i].psdu_length); - } - } - } + mrf24j40_gts_setup(radio, i, &dev->tx_buf[0], + dev->gts_desc[i].psdu_length); + } + } + } } /**************************************************************************** diff --git a/include/nuttx/wireless/ieee802154/ieee802154_radio.h b/include/nuttx/wireless/ieee802154/ieee802154_radio.h index bd7c725b150..d48b0d4e121 100644 --- a/include/nuttx/wireless/ieee802154/ieee802154_radio.h +++ b/include/nuttx/wireless/ieee802154/ieee802154_radio.h @@ -157,6 +157,7 @@ struct ieee802154_netradio_s #endif /* IEEE802.15.4 Radio Interface Operations **********************************/ + struct ieee802154_txdesc_s { uint8_t psdu_handle; /* The psdu handle identifying the transaction */ @@ -171,12 +172,9 @@ struct ieee802154_phyif_s; /* Forward Reference */ struct ieee802154_phyifops_s { CODE int (*poll_csma) (FAR struct ieee802154_phyif_s *phyif, - FAR struct ieee802154_txdesc_s *tx_desc, - uint8_t *buf); - + FAR struct ieee802154_txdesc_s *tx_desc, FAR uint8_t *buf); CODE int (*poll_gts) (FAR struct ieee802154_phyif_s *phyif, - FAR struct ieee802154_txdesc_s *tx_desc, - uint8_t *buf); + FAR struct ieee802154_txdesc_s *tx_desc, FAR uint8_t *buf); }; struct ieee802154_phyif_s @@ -185,7 +183,7 @@ struct ieee802154_phyif_s /* Driver-specific information */ - void * priv; + FAR void * priv; }; struct ieee802154_radio_s; /* Forward reference */ @@ -193,14 +191,11 @@ struct ieee802154_radio_s; /* Forward reference */ struct ieee802154_radioops_s { CODE int (*bind) (FAR struct ieee802154_radio_s *dev, - FAR const struct ieee802154_phyif_s *phyif); - + FAR const struct ieee802154_phyif_s *phyif); CODE int (*ioctl)(FAR struct ieee802154_radio_s *ieee, int cmd, unsigned long arg); - CODE int (*rxenable)(FAR struct ieee802154_radio_s *dev, bool state, FAR struct ieee802154_packet_s *packet); - CODE int (*txnotify_csma)(FAR struct ieee802154_radio_s *dev); CODE int (*txnotify_gts)(FAR struct ieee802154_radio_s *dev); }; diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index 32e78dd9165..8dc2e87b3fc 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -66,10 +66,10 @@ struct mac802154_trans_s uint8_t msdu_handle; - uint8_t *mhr_buf; + FAR uint8_t *mhr_buf; uint8_t mhr_len; - uint8_t *d_buf; + FAR uint8_t *d_buf; uint8_t d_len; sem_t sem; @@ -78,10 +78,11 @@ struct mac802154_trans_s struct mac802154_unsec_mhr_s { uint8_t length; - union { + union + { uint16_t frame_control; uint8_t data[IEEE802154_MAX_UNSEC_MHR_OVERHEAD]; - }; + } u; }; /* The privmac structure holds the internal state of the MAC and is the @@ -530,7 +531,7 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req) * from the transmitted frame. [1] pg. 41. */ - if(req->dest_addr.panid == priv->addr.panid) + if (req->dest_addr.panid == priv->addr.panid) { mhr.frame_control |= IEEE802154_FRAMECTRL_PANIDCOMP; }