From: Felix Varghese <felixvarg...@gmail.com> Added #defines for MAC PIB attribute ids and default values for PIB attributes
Signed-off-by: Felix Varghese <felixvarg...@gmail.com> Signed-off-by: Prajosh Premdas <premdas.praj...@gmail.com> --- include/net/ieee802154.h | 148 ++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 137 insertions(+), 11 deletions(-) diff --git a/include/net/ieee802154.h b/include/net/ieee802154.h index ee59f8b..5134f13 100644 --- a/include/net/ieee802154.h +++ b/include/net/ieee802154.h @@ -63,15 +63,137 @@ #define IEEE802154_MFR_SIZE 2 /* 2 octets */ /* MAC's Command Frames Identifiers */ -#define IEEE802154_CMD_ASSOCIATION_REQ 0x01 -#define IEEE802154_CMD_ASSOCIATION_RESP 0x02 -#define IEEE802154_CMD_DISASSOCIATION_NOTIFY 0x03 -#define IEEE802154_CMD_DATA_REQ 0x04 -#define IEEE802154_CMD_PANID_CONFLICT_NOTIFY 0x05 -#define IEEE802154_CMD_ORPHAN_NOTIFY 0x06 -#define IEEE802154_CMD_BEACON_REQ 0x07 -#define IEEE802154_CMD_COORD_REALIGN_NOTIFY 0x08 -#define IEEE802154_CMD_GTS_REQ 0x09 +#define IEEE802154_CMD_ASSOCIATION_REQ 0x01 +#define IEEE802154_CMD_ASSOCIATION_RESP 0x02 +#define IEEE802154_CMD_DISASSOCIATION_NOTIFY 0x03 +#define IEEE802154_CMD_DATA_REQ 0x04 +#define IEEE802154_CMD_PANID_CONFLICT_NOTIFY 0x05 +#define IEEE802154_CMD_ORPHAN_NOTIFY 0x06 +#define IEEE802154_CMD_BEACON_REQ 0x07 +#define IEEE802154_CMD_COORD_REALIGN_NOTIFY 0x08 +#define IEEE802154_CMD_GTS_REQ 0x09 + +/* Section 7.4.1 of IEEE 802.15.4 Spec : MAC Layer Constants */ +#define aMaxPHYPacketSize (127) +#define aTurnaroundTime (12) +#define aBaseSlotDuration (60) +#define aBaseSuperframeDuration (aBaseSlotDuration * aNumSuperframeSlots) +#define aGTSDescPersistenceTime (4) +#define aMaxBeaconOverhead (75) +#define aMaxBeaconPayloadLength (aMaxPHYPacketSize - aMaxBeaconOverhead) +#define aMaxLostBeacons (4) +#define aMaxMACPayloadSize (aMaxPHYPacketSize - aMinMPDUOverhead) +#define aMaxMACSafePayloadSize (aMaxPHYPacketSize - aMaxMPDUUnsecuredOverhead) +#define aMaxMPDUUnsecuredOverhead (25) +#define aMaxSIFSFrameSize (18) +#define aMinCAPLength (440) +#define aMinMPDUOverhead (9) +#define aNumSuperframeSlots (16) +#define aUnitBackoffPeriod (20) + +/* Section 6.4.2 of IEEE 802.15.4 Spec : PHY PIB attributes */ +#define phyCurrentChannel (0x00) +#define phyChannelsSupported (0x01) +#define phyTransmitPower (0x02) +#define phyCCAMode (0x03) +#define phyCurrentPage (0x04) +#define phyMaxFrameDuration (0x05) +#define phySHRDuration (0x06) +#define phySymbolsPerOctet (0x07) +#define PHY_OVERHEAD (5) + +/* Section 7.4.2 of IEEE 802.15.4 Spec : MAC PIB Attributes */ +#define macAckWaitDuration (0x40) +#define macAckWaitDuration_def (54) + +#define macAssociationPermit (0x41) +#define macAssociationPermit_def (false) + +#define macAutoRequest (0x42) +#define macAutoRequest_def (true) + +#define macBattLifeExt (0x43) +#define macBattLifeExt_def (false) + +#define macBattLifeExtPeriods (0x44) +#define macBattLifeExtPeriods_def (6) + +#define macBeaconPayload (0x45) + +#define macBeaconPayloadLength (0x46) +#define macBeaconPayloadLength_def (0) + +#define macBeaconOrder (0x47) +#define macBeaconOrder_def (15) + +#define NON_BEACON_NWK (0x0F) + +#define macBeaconTxTime (0x48) +#define macBeaconTxTime_def (0x000000) + +#define macBSN (0x49) +#define macCoordExtendedAddress (0x4A) + +#define macCoordShortAddress (0x4B) +#define macCoordShortAddress_def (0xFFFF) + +#define macDSN (0x4C) + +#define macGTSPermit (0x4D) +#define macGTSPermit_def (true) + +#define macMaxCSMABackoffs (0x4E) +#define macMaxCSMABackoffs_def (4) + +#define macMinBE (0x4F) +#define macMinBE_def (3) + +#define macPANId (0x50) +#define macPANId_def (0xFFFF) + +#define macPromiscuousMode (0x51) + +#define macRxOnWhenIdle (0x52) +#define macRxOnWhenIdle_def (false) + +#define macShortAddress (0x53) +#define macShortAddress_def (0xFFFF) + +#define macSuperframeOrder (0x54) +#define macSuperframeOrder_def (15) + +#define macTransactionPersistenceTime (0x55) +#define macTransactionPersistenceTime_def (0x01F4) + +#define macAssociatedPANCoord (0x56) +#define macAssociatedPANCoord_def (false) + +#define macMaxBE (0x57) +#define macMaxBE_def (5) + +#define macMaxFrameTotalWaitTime (0x58) +#define macMaxFrameTotalWaitTime_def (1986) /* O-QPSK 2.4 GHz */ + +#define macMaxFrameRetries (0x59) + +#define macResponseWaitTime (0x5A) +#define macResponseWaitTime_def (32 * aBaseSuperframeDuration) + +#define macSyncSymbolOffset (0x5B) +#define macTimestampSupported (0x5C) + +#define macSecurityEnabled (0x5D) +#define macSecurityEnabled_def (false) + +#define macMinLIFSPeriod (0x5E) +#define macMinLIFSPeriod_def (40) + +#define macMinSIFSPeriod (0x5F) +#define macMinSIFSPeriod_def (12) + +#define macPANCoordExtendedAddress (0x7D) +#define macPANCoordShortAddress (0x7E) +#define macIeeeAddress (0xF0) /* * The return values of MAC operations @@ -157,10 +279,14 @@ enum { * A request to perform a scan operation failed because the MLME was * in the process of performing a previously initiated scan operation. */ + IEEE802154_READ_ONLY = 0xfb, + /* + * A request to perform a scan operation failed because the MLME was + * in the process of performing a previously initiated scan operation. + */ IEEE802154_SCAN_IN_PROGRESS = 0xfc, }; - -#endif +#endif /* NET_IEEE802154_H */ -- 1.7.4.1 ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel