ieee802154: Renaming of some fields

This commit is contained in:
Anthony Merlino 2017-07-17 01:20:01 -04:00
parent 2f89ebeebd
commit 3158188846
4 changed files with 28 additions and 28 deletions

View File

@ -697,17 +697,17 @@ enum ieee802154_scantype_e
struct ieee802154_frame_meta_s struct ieee802154_frame_meta_s
{ {
enum ieee802154_addrmode_e srcaddr_mode; /* Source Address Mode */ enum ieee802154_addrmode_e srcmode; /* Source Address Mode */
struct ieee802154_addr_s destaddr; /* Destination Address */ struct ieee802154_addr_s destaddr; /* Destination Address */
uint8_t msdu_handle; /* Handle assoc. with MSDU */ uint8_t handle; /* User-specified handle identifier */
struct struct
{ {
uint8_t ack_tx : 1; /* Acknowledge TX? */ uint8_t ackreq : 1;
uint8_t gts_tx : 1; /* 1=GTS used for TX, 0=CAP used for TX */ uint8_t usegts : 1;
uint8_t indirect_tx : 1; /* Should indirect transmission be used? */ uint8_t indirect : 1;
} msdu_flags; } flags;
#ifdef CONFIG_IEEE802154_SECURITY #ifdef CONFIG_IEEE802154_SECURITY
/* Security information if enabled */ /* Security information if enabled */
@ -718,7 +718,7 @@ struct ieee802154_frame_meta_s
#ifdef CONFIG_IEEE802154_UWB #ifdef CONFIG_IEEE802154_UWB
/* The UWB Pulse Repetition Frequency to be used for the transmission */ /* The UWB Pulse Repetition Frequency to be used for the transmission */
enum ieee802154_uwbprf_e uwb_prf; enum ieee802154_uwbprf_e uwbprf;
/* The UWB preamble symbol repititions /* The UWB preamble symbol repititions
* Should be one of: * Should be one of:
@ -729,7 +729,7 @@ struct ieee802154_frame_meta_s
/* The UWB Data Rate to be used for the transmission */ /* The UWB Data Rate to be used for the transmission */
enum ieee802154_uwb_datarate_e data_rate; enum ieee802154_uwb_datarate_e datarate;
#endif #endif
enum ieee802154_ranging_e ranging; enum ieee802154_ranging_e ranging;

View File

@ -163,9 +163,9 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee,
/* Source address mode */ /* Source address mode */
meta->srcaddr_mode = pktmeta->sextended != 0? meta->srcmode = pktmeta->sextended != 0?
IEEE802154_ADDRMODE_EXTENDED : IEEE802154_ADDRMODE_EXTENDED :
IEEE802154_ADDRMODE_SHORT; IEEE802154_ADDRMODE_SHORT;
/* Check for a broadcast destination address (all zero) */ /* Check for a broadcast destination address (all zero) */
@ -184,7 +184,7 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee,
if (rcvrnull) if (rcvrnull)
{ {
meta->msdu_flags.ack_tx = TRUE; meta->flags.ackreq = TRUE;
} }
/* Destination address */ /* Destination address */
@ -223,7 +223,7 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee,
* fragment of a disassembled packet. * fragment of a disassembled packet.
*/ */
meta->msdu_handle = ieee->i_msdu_handle++; meta->handle = ieee->i_msdu_handle++;
#ifdef CONFIG_IEEE802154_SECURITY #ifdef CONFIG_IEEE802154_SECURITY
# warning CONFIG_IEEE802154_SECURITY not yet supported # warning CONFIG_IEEE802154_SECURITY not yet supported

View File

@ -118,7 +118,7 @@ int mac802154_req_data(MACHANDLE mac,
* 5.1.6.4 [1] pg. 118. * 5.1.6.4 [1] pg. 118.
*/ */
*frame_ctrl |= (meta->msdu_flags.ack_tx << IEEE802154_FRAMECTRL_SHIFT_ACKREQ); *frame_ctrl |= (meta->flags.ackreq << 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.
@ -161,7 +161,7 @@ int mac802154_req_data(MACHANDLE mac,
* [1] pg. 41. * [1] pg. 41.
*/ */
if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE && if (meta->srcmode != IEEE802154_ADDRMODE_NONE &&
meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) meta->destaddr.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
@ -175,7 +175,7 @@ int mac802154_req_data(MACHANDLE mac,
} }
} }
if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE) if (meta->srcmode != 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.
@ -188,12 +188,12 @@ int mac802154_req_data(MACHANDLE mac,
mhr_len += 2; mhr_len += 2;
} }
if (meta->srcaddr_mode == IEEE802154_ADDRMODE_SHORT) if (meta->srcmode == IEEE802154_ADDRMODE_SHORT)
{ {
IEEE802154_SADDRCOPY(&frame->io_data[mhr_len], priv->addr.saddr); IEEE802154_SADDRCOPY(&frame->io_data[mhr_len], priv->addr.saddr);
mhr_len += 2; mhr_len += 2;
} }
else if (meta->srcaddr_mode == IEEE802154_ADDRMODE_EXTENDED) else if (meta->srcmode == IEEE802154_ADDRMODE_EXTENDED)
{ {
IEEE802154_EADDRCOPY(&frame->io_data[mhr_len], priv->addr.eaddr); IEEE802154_EADDRCOPY(&frame->io_data[mhr_len], priv->addr.eaddr);
mhr_len += IEEE802154_EADDRSIZE; mhr_len += IEEE802154_EADDRSIZE;
@ -214,7 +214,7 @@ int mac802154_req_data(MACHANDLE mac,
/* Set the source addr mode inside the frame control field */ /* Set the source addr mode inside the frame control field */
*frame_ctrl |= (meta->srcaddr_mode << IEEE802154_FRAMECTRL_SHIFT_SADDR); *frame_ctrl |= (meta->srcmode << IEEE802154_FRAMECTRL_SHIFT_SADDR);
/* 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
@ -255,7 +255,7 @@ int mac802154_req_data(MACHANDLE mac,
/* Then initialize the TX descriptor */ /* Then initialize the TX descriptor */
txdesc->conf->handle = meta->msdu_handle; txdesc->conf->handle = meta->handle;
txdesc->frame = frame; txdesc->frame = frame;
txdesc->frametype = IEEE802154_FRAME_DATA; txdesc->frametype = IEEE802154_FRAME_DATA;
@ -271,7 +271,7 @@ int mac802154_req_data(MACHANDLE mac,
* [1] pg. 118. * [1] pg. 118.
*/ */
if (meta->msdu_flags.gts_tx) if (meta->flags.usegts)
{ {
/* TODO: Support GTS transmission. This should just change where we link /* TODO: Support GTS transmission. This should just change where we link
* the transaction. Instead of going in the CSMA transaction list, it * the transaction. Instead of going in the CSMA transaction list, it
@ -291,7 +291,7 @@ int mac802154_req_data(MACHANDLE mac,
* described in 5.1.5 and 5.1.6.3. [1] * described in 5.1.5 and 5.1.6.3. [1]
*/ */
if (meta->msdu_flags.indirect_tx) if (meta->flags.indirect)
{ {
/* If the TxOptions parameter specifies that an indirect transmission /* If the TxOptions parameter specifies that an indirect transmission
* is required and if the device receiving this primitive is not a * is required and if the device receiving this primitive is not a

View File

@ -76,14 +76,14 @@ int mac802154_get_mhrlen(MACHANDLE mac,
* to NONE */ * to NONE */
if (meta->destaddr.mode == IEEE802154_ADDRMODE_NONE && if (meta->destaddr.mode == IEEE802154_ADDRMODE_NONE &&
meta->srcaddr_mode == IEEE802154_ADDRMODE_NONE) meta->srcmode == IEEE802154_ADDRMODE_NONE)
{ {
return -EINVAL; return -EINVAL;
} }
/* The source address can only be set to NONE if the device is the PAN coord */ /* The source address can only be set to NONE if the device is the PAN coord */
if (meta->srcaddr_mode == IEEE802154_ADDRMODE_NONE && if (meta->srcmode == IEEE802154_ADDRMODE_NONE &&
priv->devmode != IEEE802154_DEVMODE_PANCOORD) priv->devmode != IEEE802154_DEVMODE_PANCOORD)
{ {
return -EINVAL; return -EINVAL;
@ -95,14 +95,14 @@ int mac802154_get_mhrlen(MACHANDLE mac,
/* Add the source address length */ /* Add the source address length */
ret += mac802154_addr_length[ meta->srcaddr_mode]; ret += mac802154_addr_length[ meta->srcmode];
/* 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 (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE && if (meta->srcmode != IEEE802154_ADDRMODE_NONE &&
meta->destaddr.mode != IEEE802154_ADDRMODE_NONE) meta->destaddr.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
@ -121,7 +121,7 @@ int mac802154_get_mhrlen(MACHANDLE mac,
* PAN ID if the respective address is included * PAN ID if the respective address is included
*/ */
if (meta->srcaddr_mode != IEEE802154_ADDRMODE_NONE) if (meta->srcmode != IEEE802154_ADDRMODE_NONE)
{ {
ret += 2; /* 2 bytes for source PAN ID */ ret += 2; /* 2 bytes for source PAN ID */
} }