mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Costmetic change from review of last PR
This commit is contained in:
@@ -74,11 +74,11 @@ struct ieee802154_privmac_s
|
|||||||
/* Support a singly linked list of transactions that will be sent using the
|
/* Support a singly linked list of transactions that will be sent using the
|
||||||
* CSMA algorithm. On a non-beacon enabled PAN, these transactions will be
|
* CSMA algorithm. On a non-beacon enabled PAN, these transactions will be
|
||||||
* sent whenever. On a beacon-enabled PAN, these transactions will be sent
|
* sent whenever. On a beacon-enabled PAN, these transactions will be sent
|
||||||
* during the CAP of the Coordinator's superframe. */
|
* during the CAP of the Coordinator's superframe.
|
||||||
|
*/
|
||||||
|
|
||||||
FAR struct mac802154_trans_s *csma_head;
|
FAR struct mac802154_trans_s *csma_head;
|
||||||
FAR struct mac802154_trans_s *csma_tail;
|
FAR struct mac802154_trans_s *csma_tail;
|
||||||
|
|
||||||
struct mac802154_trans_s csma_buf[5];
|
struct mac802154_trans_s csma_buf[5];
|
||||||
|
|
||||||
/* Support a singly linked list of transactions that will be sent indirectly.
|
/* Support a singly linked list of transactions that will be sent indirectly.
|
||||||
@@ -86,16 +86,16 @@ struct ieee802154_privmac_s
|
|||||||
* transactions will stay here until the data is extracted by the destination
|
* transactions will stay here until the data is extracted by the destination
|
||||||
* device sending a Data Request MAC command or if too much time passes. This
|
* device sending a Data Request MAC command or if too much time passes. This
|
||||||
* list should also be used to populate the address list of the outgoing
|
* list should also be used to populate the address list of the outgoing
|
||||||
* beacon frame */
|
* beacon frame.
|
||||||
|
*/
|
||||||
|
|
||||||
FAR struct mac802154_trans_s *indirect_head;
|
FAR struct mac802154_trans_s *indirect_head;
|
||||||
FAR struct mac802154_trans_s *indirect_tail;
|
FAR struct mac802154_trans_s *indirect_tail;
|
||||||
|
|
||||||
FAR struct mac802154_trans_s *active_trans;
|
FAR struct mac802154_trans_s *active_trans;
|
||||||
|
|
||||||
/* MAC PIB attributes, grouped to save memory */
|
/* MAC PIB attributes, grouped to save memory */
|
||||||
|
|
||||||
/* Holds all address information (Extended, Short, and PAN ID) for the MAC */
|
/* Holds all address information (Extended, Short, and PAN ID) for the MAC. */
|
||||||
|
|
||||||
struct ieee802154_addr_s addr;
|
struct ieee802154_addr_s addr;
|
||||||
|
|
||||||
@@ -107,7 +107,8 @@ struct ieee802154_privmac_s
|
|||||||
* arrive following a transmitted data frame. [1] pg. 126
|
* arrive following a transmitted data frame. [1] pg. 126
|
||||||
*
|
*
|
||||||
* NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't
|
* NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't
|
||||||
* sure at the time what the range of reasonable values was */
|
* sure at the time what the range of reasonable values was.
|
||||||
|
*/
|
||||||
|
|
||||||
uint32_t ack_wait_dur;
|
uint32_t ack_wait_dur;
|
||||||
|
|
||||||
@@ -116,12 +117,14 @@ struct ieee802154_privmac_s
|
|||||||
* Frame Pending field set to one. [1] pg. 127
|
* Frame Pending field set to one. [1] pg. 127
|
||||||
*
|
*
|
||||||
* NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't
|
* NOTE: This may be able to be a 16-bit or even an 8-bit number. I wasn't
|
||||||
* sure at the time what the range of reasonable values was */
|
* sure at the time what the range of reasonable values was.
|
||||||
|
*/
|
||||||
|
|
||||||
uint32_t max_frame_wait_time;
|
uint32_t max_frame_wait_time;
|
||||||
|
|
||||||
/* The maximum time (in unit periods) that a transaction is stored by a
|
/* The maximum time (in unit periods) that a transaction is stored by a
|
||||||
* coordinator and indicated in its beacon. */
|
* coordinator and indicated in its beacon.
|
||||||
|
*/
|
||||||
|
|
||||||
uint16_t trans_persist_time;
|
uint16_t trans_persist_time;
|
||||||
|
|
||||||
@@ -139,12 +142,14 @@ struct ieee802154_privmac_s
|
|||||||
|
|
||||||
/* The maximum time, in multiples of aBaseSuperframeDuration, a device shall
|
/* The maximum time, in multiples of aBaseSuperframeDuration, a device shall
|
||||||
* wait for a response command frame to be available following a request
|
* wait for a response command frame to be available following a request
|
||||||
* command frame. [1] 128 */
|
* command frame. [1] 128.
|
||||||
|
*/
|
||||||
|
|
||||||
uint8_t resp_wait_time;
|
uint8_t resp_wait_time;
|
||||||
|
|
||||||
/* The total transmit duration (including PHY header and FCS) specified in
|
/* The total transmit duration (including PHY header and FCS) specified in
|
||||||
* symbols. [1] pg. 129 */
|
* symbols. [1] pg. 129.
|
||||||
|
*/
|
||||||
|
|
||||||
uint32_t tx_total_dur;
|
uint32_t tx_total_dur;
|
||||||
|
|
||||||
@@ -173,7 +178,8 @@ struct ieee802154_privmac_s
|
|||||||
/* The offset, measured is symbols, between the symbol boundary at which the
|
/* The offset, measured is symbols, between the symbol boundary at which the
|
||||||
* MLME captures the timestamp of each transmitted and received frame, and
|
* MLME captures the timestamp of each transmitted and received frame, and
|
||||||
* the onset of the first symbol past the SFD, namely the first symbol of
|
* the onset of the first symbol past the SFD, namely the first symbol of
|
||||||
* the frames [1] pg. 129 */
|
* the frames [1] pg. 129.
|
||||||
|
*/
|
||||||
|
|
||||||
uint32_t sync_symb_offset : 12;
|
uint32_t sync_symb_offset : 12;
|
||||||
}
|
}
|
||||||
@@ -189,15 +195,12 @@ struct ieee802154_privmac_s
|
|||||||
{
|
{
|
||||||
uint32_t tx_ctrl_active_dur : 17; /* Duration for which tx is permitted to
|
uint32_t tx_ctrl_active_dur : 17; /* Duration for which tx is permitted to
|
||||||
* be active */
|
* be active */
|
||||||
|
|
||||||
uint32_t tx_ctrl_pause_dur : 1; /* Duration after tx before another tx is
|
uint32_t tx_ctrl_pause_dur : 1; /* Duration after tx before another tx is
|
||||||
* permitted. 0=2000, 1= 10000 */
|
* permitted. 0=2000, 1= 10000 */
|
||||||
|
|
||||||
uint32_t timestamp_support : 1; /* Does MAC layer supports timestamping */
|
uint32_t timestamp_support : 1; /* Does MAC layer supports timestamping */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Add Security-related MAC PIB attributes */
|
/* TODO: Add Security-related MAC PIB attributes */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mac802154_trans_s
|
struct mac802154_trans_s
|
||||||
@@ -220,7 +223,8 @@ 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];
|
||||||
};
|
};
|
||||||
@@ -309,9 +313,9 @@ static int mac802154_applymib(FAR struct ieee802154_privmac_s *priv)
|
|||||||
* should register a set of callbacks with the MAC layer by setting the
|
* should register a set of callbacks with the MAC layer by setting the
|
||||||
* mac->cbs member.
|
* mac->cbs member.
|
||||||
*
|
*
|
||||||
* NOTE: This API does not create any device accessible to userspace. If you
|
* NOTE: This API does not create any device accessible to userspace. If
|
||||||
* want to call these APIs from userspace, you have to wrap your mac in a
|
* you want to call these APIs from userspace, you have to wrap your mac
|
||||||
* character device via mac802154_device.c.
|
* in a character device via mac802154_device.c.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* radiodev - an instance of an IEEE 802.15.4 radio
|
* radiodev - an instance of an IEEE 802.15.4 radio
|
||||||
@@ -439,7 +443,8 @@ int mac802154_ioctl(MACHANDLE mac, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
FAR struct mac802154_trans_s *trans;
|
FAR struct mac802154_trans_s *trans;
|
||||||
struct mac802154_unsec_mhr_s mhr;
|
struct mac802154_unsec_mhr_s mhr;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -465,7 +470,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
mhr.frame_control |= IEEE802154_FRAME_DATA << IEEE802154_FRAMECTRL_SHIFT_FTYPE;
|
mhr.frame_control |= IEEE802154_FRAME_DATA << IEEE802154_FRAMECTRL_SHIFT_FTYPE;
|
||||||
|
|
||||||
/* If the msduLength is greater than aMaxMACSafePayloadSize, the MAC sublayer
|
/* If the msduLength is greater than aMaxMACSafePayloadSize, the MAC sublayer
|
||||||
* will set the Frame Version to one. [1] pg. 118 */
|
* will set the Frame Version to one. [1] pg. 118.
|
||||||
|
*/
|
||||||
|
|
||||||
if (req->msdu_length > IEEE802154_MAX_SAFE_MAC_PAYLOAD_SIZE)
|
if (req->msdu_length > IEEE802154_MAX_SAFE_MAC_PAYLOAD_SIZE)
|
||||||
{
|
{
|
||||||
@@ -474,12 +480,14 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
|
|
||||||
/* If the TXOptions parameter specifies that an acknowledged transmission is
|
/* If the TXOptions parameter specifies that an acknowledged transmission is
|
||||||
* required, the AR field will be set appropriately, as described in
|
* required, the AR field will be set appropriately, as described in
|
||||||
* 5.1.6.4 [1] pg. 118 */
|
* 5.1.6.4 [1] pg. 118.
|
||||||
|
*/
|
||||||
|
|
||||||
mhr.frame_ctrl |= (req->ack_tx << IEEE802154_FRAMECTRL_SHIFT_ACKREQ);
|
mhr.frame_ctrl |= (req->ack_tx << IEEE802154_FRAMECTRL_SHIFT_ACKREQ);
|
||||||
|
|
||||||
/* If the destination address is present, copy the PAN ID and one of the
|
/* If the destination address is present, copy the PAN ID and one of the
|
||||||
* addresses, depending on mode, into the MHR */
|
* addresses, depending on mode, into the MHR .
|
||||||
|
*/
|
||||||
|
|
||||||
if (req->dest_addr.mode != IEEE802154_ADDRMODE_NONE)
|
if (req->dest_addr.mode != IEEE802154_ADDRMODE_NONE)
|
||||||
{
|
{
|
||||||
@@ -513,14 +521,16 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
|
|
||||||
/* If both destination and source addressing information is present, the MAC
|
/* If both destination and source addressing information is present, the MAC
|
||||||
* sublayer shall compare the destination and source PAN identifiers.
|
* sublayer shall compare the destination and source PAN identifiers.
|
||||||
* [1] pg. 41 */
|
* [1] pg. 41.
|
||||||
|
*/
|
||||||
|
|
||||||
if (req->src_addr_mode != IEEE802154_ADDRMODE_NONE &&
|
if (req->src_addr_mode != IEEE802154_ADDRMODE_NONE &&
|
||||||
req->dest_addr.mode != IEEE802154_ADDRMODE_NONE)
|
req->dest_addr.mode != IEEE802154_ADDRMODE_NONE)
|
||||||
{
|
{
|
||||||
/* If the PAN identifiers are identical, the PAN ID Compression field
|
/* If the PAN identifiers are identical, the PAN ID Compression field
|
||||||
* shall be set to one, and the source PAN identifier shall be omitted
|
* shall be set to one, and the source PAN identifier shall be omitted
|
||||||
* from the transmitted frame. [1] pg. 41 */
|
* from the transmitted frame. [1] pg. 41.
|
||||||
|
*/
|
||||||
|
|
||||||
if(req->dest_addr.panid == priv->addr.panid)
|
if(req->dest_addr.panid == priv->addr.panid)
|
||||||
{
|
{
|
||||||
@@ -531,7 +541,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
if (req->src_addr_mode != IEEE802154_ADDRMODE_NONE)
|
if (req->src_addr_mode != IEEE802154_ADDRMODE_NONE)
|
||||||
{
|
{
|
||||||
/* If the destination address is not included, or if PAN ID Compression
|
/* If the destination address is not included, or if PAN ID Compression
|
||||||
* is off, we need to include the Source PAN ID */
|
* is off, we need to include the Source PAN ID.
|
||||||
|
*/
|
||||||
|
|
||||||
if (req->dest_addr.mode == IEEE802154_ADDRMODE_NONE ||
|
if (req->dest_addr.mode == IEEE802154_ADDRMODE_NONE ||
|
||||||
(mhr.frame_control & IEEE802154_FRAMECTRL_PANIDCOMP)
|
(mhr.frame_control & IEEE802154_FRAMECTRL_PANIDCOMP)
|
||||||
@@ -558,12 +569,14 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
|
|
||||||
/* Each time a data or a MAC command frame is generated, the MAC sublayer
|
/* Each time a data or a MAC command frame is generated, the MAC sublayer
|
||||||
* shall copy the value of macDSN into the Sequence Number field of the MHR
|
* shall copy the value of macDSN into the Sequence Number field of the MHR
|
||||||
* of the outgoing frame and then increment it by one. [1] pg. 40 */
|
* of the outgoing frame and then increment it by one. [1] pg. 40.
|
||||||
|
*/
|
||||||
|
|
||||||
mhr.data[mhr.length++] = priv.dsn++;
|
mhr.data[mhr.length++] = priv.dsn++;
|
||||||
|
|
||||||
/* Now that we know which fields are included in the header, we can make
|
/* Now that we know which fields are included in the header, we can make
|
||||||
* sure we actually have enough room in the PSDU */
|
* sure we actually have enough room in the PSDU.
|
||||||
|
*/
|
||||||
|
|
||||||
if (mhr.length + req->msdu_length + IEEE802154_MFR_LENGTH >
|
if (mhr.length + req->msdu_length + IEEE802154_MFR_LENGTH >
|
||||||
IEEE802154_MAX_PHY_PACKET_SIZE)
|
IEEE802154_MAX_PHY_PACKET_SIZE)
|
||||||
@@ -588,7 +601,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
* either slotted CSMA-CA in the CAP for a beacon-enabled PAN or unslotted
|
* either slotted CSMA-CA in the CAP for a beacon-enabled PAN or unslotted
|
||||||
* CSMA-CA for a nonbeacon-enabled PAN. Specifying a GTS transmission in the
|
* CSMA-CA for a nonbeacon-enabled PAN. Specifying a GTS transmission in the
|
||||||
* TxOptions parameter overrides an indirect transmission request.
|
* TxOptions parameter overrides an indirect transmission request.
|
||||||
* [1] pg. 118 */
|
* [1] pg. 118.
|
||||||
|
*/
|
||||||
|
|
||||||
if (req->gts_tx)
|
if (req->gts_tx)
|
||||||
{
|
{
|
||||||
@@ -596,7 +610,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
* the transaction. Instead of going in the CSMA transaction list, it
|
* the transaction. Instead of going in the CSMA transaction list, it
|
||||||
* should be linked to the GTS' transaction list. We'll need to check if
|
* should be linked to the GTS' transaction list. We'll need to check if
|
||||||
* the GTS is valid, and then find the GTS, before linking. Note, we also
|
* the GTS is valid, and then find the GTS, before linking. Note, we also
|
||||||
* don't have to try and kick-off any transmission here. */
|
* don't have to try and kick-off any transmission here.
|
||||||
|
*/
|
||||||
|
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
@@ -605,7 +620,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
/* If the TxOptions parameter specifies that an indirect transmission is
|
/* If the TxOptions parameter specifies that an indirect transmission is
|
||||||
* required and this primitive is received by the MAC sublayer of a
|
* required and this primitive is received by the MAC sublayer of a
|
||||||
* coordinator, the data frame is sent using indirect transmission, as
|
* coordinator, the data frame is sent using indirect transmission, as
|
||||||
* described in 5.1.5 and 5.1.6.3. [1] */
|
* described in 5.1.5 and 5.1.6.3. [1]
|
||||||
|
*/
|
||||||
|
|
||||||
if (req->indirect_tx)
|
if (req->indirect_tx)
|
||||||
{
|
{
|
||||||
@@ -613,7 +629,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req)
|
|||||||
* is required and if the device receiving this primitive is not a
|
* is required and if the device receiving this primitive is not a
|
||||||
* coordinator, the destination address is not present, or the
|
* coordinator, the destination address is not present, or the
|
||||||
* TxOptions parameter also specifies a GTS transmission, the indirect
|
* TxOptions parameter also specifies a GTS transmission, the indirect
|
||||||
* transmission option will be ignored. [1] */
|
* transmission option will be ignored. [1]
|
||||||
|
*/
|
||||||
|
|
||||||
if (priv->is_coord && req->dest_addr.mode != IEEE802154_ADDRMODE_NONE)
|
if (priv->is_coord && req->dest_addr.mode != IEEE802154_ADDRMODE_NONE)
|
||||||
{
|
{
|
||||||
@@ -684,7 +701,8 @@ static uint16_t mac802154_poll_csma(FAR struct ieee802154_phyif_s *phyif,
|
|||||||
/* Now that we've passed off the data, notify the waiting thread.
|
/* Now that we've passed off the data, notify the waiting thread.
|
||||||
* NOTE: The transaction was allocated on the waiting thread's stack so
|
* NOTE: The transaction was allocated on the waiting thread's stack so
|
||||||
* it will be automatically deallocated when that thread awakens and
|
* it will be automatically deallocated when that thread awakens and
|
||||||
* returns */
|
* returns.
|
||||||
|
*/
|
||||||
|
|
||||||
sem_post(trans->sem);
|
sem_post(trans->sem);
|
||||||
|
|
||||||
@@ -698,15 +716,16 @@ static uint16_t mac802154_poll_csma(FAR struct ieee802154_phyif_s *phyif,
|
|||||||
* Name: mac802154_req_purge
|
* Name: mac802154_req_purge
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MCPS-PURGE.request primitive allows the next higher layer to purge an
|
* The MCPS-PURGE.request primitive allows the next higher layer to purge
|
||||||
* MSDU from the transaction queue. Confirmation is returned via
|
* an MSDU from the transaction queue. Confirmation is returned via
|
||||||
* the struct ieee802154_maccb_s->conf_purge callback.
|
* the struct ieee802154_maccb_s->conf_purge callback.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int mac802154_req_purge(MACHANDLE mac, uint8_t handle)
|
int mac802154_req_purge(MACHANDLE mac, uint8_t handle)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -723,7 +742,8 @@ int mac802154_req_purge(MACHANDLE mac, uint8_t handle)
|
|||||||
int mac802154_req_associate(MACHANDLE mac,
|
int mac802154_req_associate(MACHANDLE mac,
|
||||||
FAR struct ieee802154_assoc_req_s *req)
|
FAR struct ieee802154_assoc_req_s *req)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
|
|
||||||
/* Set the channel of the PHY layer */
|
/* Set the channel of the PHY layer */
|
||||||
|
|
||||||
@@ -765,7 +785,8 @@ int mac802154_req_associate(MACHANDLE mac,
|
|||||||
int mac802154_req_disassociate(MACHANDLE mac,
|
int mac802154_req_disassociate(MACHANDLE mac,
|
||||||
FAR struct ieee802154_disassoc_req_s *req)
|
FAR struct ieee802154_disassoc_req_s *req)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,7 +802,8 @@ int mac802154_req_disassociate(MACHANDLE mac,
|
|||||||
|
|
||||||
int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e attr)
|
int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e attr)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,7 +820,8 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e attr)
|
|||||||
|
|
||||||
int mac802154_req_gts(MACHANDLE mac, FAR uint8_t *characteristics)
|
int mac802154_req_gts(MACHANDLE mac, FAR uint8_t *characteristics)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -814,7 +837,8 @@ int mac802154_req_gts(MACHANDLE mac, FAR uint8_t *characteristics)
|
|||||||
|
|
||||||
int mac802154_req_reset(MACHANDLE mac, bool setdefaults)
|
int mac802154_req_reset(MACHANDLE mac, bool setdefaults)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s * priv = (FAR struct ieee802154_privmac_s *) mac;
|
FAR struct ieee802154_privmac_s * priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *) mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -832,7 +856,8 @@ int mac802154_req_reset(MACHANDLE mac, bool setdefaults)
|
|||||||
int mac802154_req_rxenable(MACHANDLE mac, bool deferrable, int ontime,
|
int mac802154_req_rxenable(MACHANDLE mac, bool deferrable, int ontime,
|
||||||
int duration)
|
int duration)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s * priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s * priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,7 +879,8 @@ int mac802154_req_rxenable(MACHANDLE mac, bool deferrable, int ontime,
|
|||||||
int mac802154_req_scan(MACHANDLE mac, uint8_t type, uint32_t channels,
|
int mac802154_req_scan(MACHANDLE mac, uint8_t type, uint32_t channels,
|
||||||
int duration)
|
int duration)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -871,7 +897,8 @@ int mac802154_req_scan(MACHANDLE mac, uint8_t type, uint32_t channels,
|
|||||||
int mac802154_req_set(MACHANDLE mac, int attribute, FAR uint8_t *value,
|
int mac802154_req_set(MACHANDLE mac, int attribute, FAR uint8_t *value,
|
||||||
int valuelen)
|
int valuelen)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -889,7 +916,8 @@ int mac802154_req_start(MACHANDLE mac, uint16_t panid, int channel,
|
|||||||
uint8_t bo, uint8_t fo, bool coord, bool batext,
|
uint8_t bo, uint8_t fo, bool coord, bool batext,
|
||||||
bool realign)
|
bool realign)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -906,7 +934,8 @@ int mac802154_req_start(MACHANDLE mac, uint16_t panid, int channel,
|
|||||||
|
|
||||||
int mac802154_req_sync(MACHANDLE mac, int channel, bool track)
|
int mac802154_req_sync(MACHANDLE mac, int channel, bool track)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -914,8 +943,8 @@ int mac802154_req_sync(MACHANDLE mac, int channel, bool track)
|
|||||||
* Name: mac802154_req_poll
|
* Name: mac802154_req_poll
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-POLL.request primitive prompts the device to request data from the
|
* The MLME-POLL.request primitive prompts the device to request data from
|
||||||
* coordinator. Confirmation is returned via the
|
* the coordinator. Confirmation is returned via the
|
||||||
* struct ieee802154_maccb_s->conf_poll callback, followed by a
|
* struct ieee802154_maccb_s->conf_poll callback, followed by a
|
||||||
* struct ieee802154_maccb_s->ind_data callback.
|
* struct ieee802154_maccb_s->ind_data callback.
|
||||||
*
|
*
|
||||||
@@ -923,7 +952,8 @@ int mac802154_req_sync(MACHANDLE mac, int channel, bool track)
|
|||||||
|
|
||||||
int mac802154_req_poll(MACHANDLE mac, FAR uint8_t *coordaddr)
|
int mac802154_req_poll(MACHANDLE mac, FAR uint8_t *coordaddr)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,15 +961,16 @@ int mac802154_req_poll(MACHANDLE mac, FAR uint8_t *coordaddr)
|
|||||||
* Name: mac802154_rsp_associate
|
* Name: mac802154_rsp_associate
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-ASSOCIATE.response primitive is used to initiate a response to an
|
* The MLME-ASSOCIATE.response primitive is used to initiate a response to
|
||||||
* MLME-ASSOCIATE.indication primitive.
|
* an MLME-ASSOCIATE.indication primitive.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int mac802154_rsp_associate(MACHANDLE mac, uint8_t eadr, uint16_t saddr,
|
int mac802154_rsp_associate(MACHANDLE mac, uint8_t eadr, uint16_t saddr,
|
||||||
int status)
|
int status)
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s *priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s *priv =
|
||||||
|
(FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ int mac802154_req_data(MACHANDLE mac, FAR struct ieee802154_data_req_s *req);
|
|||||||
* Name: mac802154_req_purge
|
* Name: mac802154_req_purge
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MCPS-PURGE.request primitive allows the next higher layer to purge an
|
* The MCPS-PURGE.request primitive allows the next higher layer to purge
|
||||||
* MSDU from the transaction queue. Confirmation is returned via
|
* an MSDU from the transaction queue. Confirmation is returned via
|
||||||
* the struct ieee802154_maccb_s->conf_purge callback.
|
* the struct ieee802154_maccb_s->conf_purge callback.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -139,9 +139,11 @@ int mac802154_req_associate(MACHANDLE mac,
|
|||||||
* Name: mac802154_req_disassociate
|
* Name: mac802154_req_disassociate
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-DISASSOCIATE.request primitive is used by an associated device to
|
* The MLME-DISASSOCIATE.request primitive is used by an associated device
|
||||||
* notify the coordinator of its intent to leave the PAN. It is also used by
|
* to notify the coordinator of its intent to leave the PAN. It is also
|
||||||
* the coordinator to instruct an associated device to leave the PAN.
|
* used by the coordinator to instruct an associated device to leave the
|
||||||
|
* PAN.
|
||||||
|
*
|
||||||
* Confirmation is returned via the
|
* Confirmation is returned via the
|
||||||
* struct ieee802154_maccb_s->conf_disassociate callback.
|
* struct ieee802154_maccb_s->conf_disassociate callback.
|
||||||
*
|
*
|
||||||
@@ -166,8 +168,8 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_pib_attr_e attr);
|
|||||||
* Name: mac802154_req_gts
|
* Name: mac802154_req_gts
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-GTS.request primitive allows a device to send a request to the PAN
|
* The MLME-GTS.request primitive allows a device to send a request to the
|
||||||
* coordinator to allocate a new GTS or to deallocate an existing GTS.
|
* PAN coordinator to allocate a new GTS or to deallocate an existing GTS.
|
||||||
* Confirmation is returned via the
|
* Confirmation is returned via the
|
||||||
* struct ieee802154_maccb_s->conf_gts callback.
|
* struct ieee802154_maccb_s->conf_gts callback.
|
||||||
*
|
*
|
||||||
@@ -205,14 +207,14 @@ int mac802154_req_rxenable(MACHANDLE mac, bool deferrable, int ontime,
|
|||||||
* Name: mac802154_req_scan
|
* Name: mac802154_req_scan
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-SCAN.request primitive is used to initiate a channel scan over a
|
* The MLME-SCAN.request primitive is used to initiate a channel scan over
|
||||||
* given list of channels. A device can use a channel scan to measure the
|
* a given list of channels. A device can use a channel scan to measure
|
||||||
* energy on the channel, search for the coordinator with which it associated,
|
* the energy on the channel, search for the coordinator with which it
|
||||||
* or search for all coordinators transmitting beacon frames within the POS of
|
* associated, or search for all coordinators transmitting beacon frames
|
||||||
* the scanning device. Scan results are returned
|
* within the POS of the scanning device. Scan results are returned
|
||||||
* via MULTIPLE calls to the struct ieee802154_maccb_s->conf_scan callback.
|
* via MULTIPLE calls to the struct ieee802154_maccb_s->conf_scan
|
||||||
* This is a difference with the official 802.15.4 specification, implemented
|
* callback. This is a difference with the official 802.15.4
|
||||||
* here to save memory.
|
* specification, implemented here to save memory.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -236,8 +238,8 @@ int mac802154_req_set(MACHANDLE mac, int attribute, FAR uint8_t *value,
|
|||||||
* Name: mac802154_req_start
|
* Name: mac802154_req_start
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-START.request primitive makes a request for the device to start
|
* The MLME-START.request primitive makes a request for the device to
|
||||||
* using a new superframe configuration. Confirmation is returned
|
* start using a new superframe configuration. Confirmation is returned
|
||||||
* via the struct ieee802154_maccb_s->conf_start callback.
|
* via the struct ieee802154_maccb_s->conf_start callback.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -263,8 +265,8 @@ int mac802154_req_sync(MACHANDLE mac, int channel, bool track);
|
|||||||
* Name: mac802154_req_poll
|
* Name: mac802154_req_poll
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-POLL.request primitive prompts the device to request data from the
|
* The MLME-POLL.request primitive prompts the device to request data from
|
||||||
* coordinator. Confirmation is returned via the
|
* the coordinator. Confirmation is returned via the
|
||||||
* struct ieee802154_maccb_s->conf_poll callback, followed by a
|
* struct ieee802154_maccb_s->conf_poll callback, followed by a
|
||||||
* struct ieee802154_maccb_s->ind_data callback.
|
* struct ieee802154_maccb_s->ind_data callback.
|
||||||
*
|
*
|
||||||
@@ -276,8 +278,8 @@ int mac802154_req_poll(MACHANDLE mac, FAR uint8_t *coordaddr);
|
|||||||
* Name: mac802154_rsp_associate
|
* Name: mac802154_rsp_associate
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The MLME-ASSOCIATE.response primitive is used to initiate a response to an
|
* The MLME-ASSOCIATE.response primitive is used to initiate a response to
|
||||||
* MLME-ASSOCIATE.indication primitive.
|
* an MLME-ASSOCIATE.indication primitive.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ struct mac802154_devwrapper_s
|
|||||||
|
|
||||||
struct mac802154dev_notify_s md_mlme_notify;
|
struct mac802154dev_notify_s md_mlme_notify;
|
||||||
pid_t md_mlme_pid;
|
pid_t md_mlme_pid;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -526,6 +525,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAC802154IOC_MCPS_REGISTER:
|
case MAC802154IOC_MCPS_REGISTER:
|
||||||
{
|
{
|
||||||
FAR struct mac802154dev_notify_s *notify =
|
FAR struct mac802154dev_notify_s *notify =
|
||||||
@@ -543,14 +543,14 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MAC802154IOC_MLME_ASSOC_REQUEST:
|
case MAC802154IOC_MLME_ASSOC_REQUEST:
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_assoc_req_s *req =
|
FAR struct ieee802154_assoc_req_s *req =
|
||||||
(FAR struct ieee802154_assoc_req_s *)((uintptr_t)arg);
|
(FAR struct ieee802154_assoc_req_s *)((uintptr_t)arg);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wlerr("ERROR: Unrecognized command %ld\n", cmd);
|
wlerr("ERROR: Unrecognized command %ld\n", cmd);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
@@ -617,7 +617,6 @@ void mac802154dev_conf_data(MACHANDLE mac,
|
|||||||
mac802154dev_givesem(&dev->md_exclsem);
|
mac802154dev_givesem(&dev->md_exclsem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
/* Send a signal to the registered application */
|
/* Send a signal to the registered application */
|
||||||
|
|
||||||
@@ -631,7 +630,6 @@ void mac802154dev_conf_data(MACHANDLE mac,
|
|||||||
(void)sigqueue(dev->md_mcps_pid, dev->md_mcps_notify.mn_signo,
|
(void)sigqueue(dev->md_mcps_pid, dev->md_mcps_notify.mn_signo,
|
||||||
value.sival_ptr);
|
value.sival_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user