mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
ieee802.15.4: Changes from review of last PR
This commit is contained in:
@@ -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;
|
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
|
/* Need to get exlusive access to the device so that we can use the copy
|
||||||
* buffer */
|
* buffer.
|
||||||
|
*/
|
||||||
|
|
||||||
while (sem_wait(&dev->exclsem) < 0) { }
|
while (sem_wait(&dev->exclsem) < 0) { }
|
||||||
|
|
||||||
@@ -318,7 +319,8 @@ static void mrf24j40_txnotify_gts(FAR struct ieee802154_radio_s *radio)
|
|||||||
FAR struct mrf24j40_radio_s *dev = (FAR struct mrf24j40_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
|
/* Need to get exclusive access to the device so that we can use the copy
|
||||||
* buffer */
|
* buffer.
|
||||||
|
*/
|
||||||
|
|
||||||
while (sem_wait(dev->exclsem) < 0) { }
|
while (sem_wait(dev->exclsem) < 0) { }
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ struct ieee802154_netradio_s
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* IEEE802.15.4 Radio Interface Operations **********************************/
|
/* IEEE802.15.4 Radio Interface Operations **********************************/
|
||||||
|
|
||||||
struct ieee802154_txdesc_s
|
struct ieee802154_txdesc_s
|
||||||
{
|
{
|
||||||
uint8_t psdu_handle; /* The psdu handle identifying the transaction */
|
uint8_t psdu_handle; /* The psdu handle identifying the transaction */
|
||||||
@@ -171,12 +172,9 @@ struct ieee802154_phyif_s; /* Forward Reference */
|
|||||||
struct ieee802154_phyifops_s
|
struct ieee802154_phyifops_s
|
||||||
{
|
{
|
||||||
CODE int (*poll_csma) (FAR struct ieee802154_phyif_s *phyif,
|
CODE int (*poll_csma) (FAR struct ieee802154_phyif_s *phyif,
|
||||||
FAR struct ieee802154_txdesc_s *tx_desc,
|
FAR struct ieee802154_txdesc_s *tx_desc, FAR uint8_t *buf);
|
||||||
uint8_t *buf);
|
|
||||||
|
|
||||||
CODE int (*poll_gts) (FAR struct ieee802154_phyif_s *phyif,
|
CODE int (*poll_gts) (FAR struct ieee802154_phyif_s *phyif,
|
||||||
FAR struct ieee802154_txdesc_s *tx_desc,
|
FAR struct ieee802154_txdesc_s *tx_desc, FAR uint8_t *buf);
|
||||||
uint8_t *buf);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ieee802154_phyif_s
|
struct ieee802154_phyif_s
|
||||||
@@ -185,7 +183,7 @@ struct ieee802154_phyif_s
|
|||||||
|
|
||||||
/* Driver-specific information */
|
/* Driver-specific information */
|
||||||
|
|
||||||
void * priv;
|
FAR void * priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ieee802154_radio_s; /* Forward reference */
|
struct ieee802154_radio_s; /* Forward reference */
|
||||||
@@ -194,13 +192,10 @@ struct ieee802154_radioops_s
|
|||||||
{
|
{
|
||||||
CODE int (*bind) (FAR struct ieee802154_radio_s *dev,
|
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,
|
CODE int (*ioctl)(FAR struct ieee802154_radio_s *ieee, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
|
|
||||||
CODE int (*rxenable)(FAR struct ieee802154_radio_s *dev, bool state,
|
CODE int (*rxenable)(FAR struct ieee802154_radio_s *dev, bool state,
|
||||||
FAR struct ieee802154_packet_s *packet);
|
FAR struct ieee802154_packet_s *packet);
|
||||||
|
|
||||||
CODE int (*txnotify_csma)(FAR struct ieee802154_radio_s *dev);
|
CODE int (*txnotify_csma)(FAR struct ieee802154_radio_s *dev);
|
||||||
CODE int (*txnotify_gts)(FAR struct ieee802154_radio_s *dev);
|
CODE int (*txnotify_gts)(FAR struct ieee802154_radio_s *dev);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -66,10 +66,10 @@ struct mac802154_trans_s
|
|||||||
|
|
||||||
uint8_t msdu_handle;
|
uint8_t msdu_handle;
|
||||||
|
|
||||||
uint8_t *mhr_buf;
|
FAR uint8_t *mhr_buf;
|
||||||
uint8_t mhr_len;
|
uint8_t mhr_len;
|
||||||
|
|
||||||
uint8_t *d_buf;
|
FAR uint8_t *d_buf;
|
||||||
uint8_t d_len;
|
uint8_t d_len;
|
||||||
|
|
||||||
sem_t sem;
|
sem_t sem;
|
||||||
@@ -78,10 +78,11 @@ struct mac802154_trans_s
|
|||||||
struct mac802154_unsec_mhr_s
|
struct mac802154_unsec_mhr_s
|
||||||
{
|
{
|
||||||
uint8_t length;
|
uint8_t length;
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
uint16_t frame_control;
|
uint16_t frame_control;
|
||||||
uint8_t data[IEEE802154_MAX_UNSEC_MHR_OVERHEAD];
|
uint8_t data[IEEE802154_MAX_UNSEC_MHR_OVERHEAD];
|
||||||
};
|
} u;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The privmac structure holds the internal state of the MAC and is the
|
/* The privmac structure holds the internal state of the MAC and is the
|
||||||
|
|||||||
Reference in New Issue
Block a user