/*1* IEEE802.15.4-2003 specification2*3* Copyright (C) 2007, 2008 Siemens AG4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 27* as published by the Free Software Foundation.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.13*14* You should have received a copy of the GNU General Public License along15* with this program; if not, write to the Free Software Foundation, Inc.,16* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Written by:19* Pavel Smolenskiy <[email protected]>20* Maxim Gorbachyov <[email protected]>21* Maxim Osipov <[email protected]>22* Dmitry Eremin-Solenikov <[email protected]>23*/2425#ifndef NET_IEEE802154_H26#define NET_IEEE802154_H2728#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */29#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */30#define IEEE802154_FC_TYPE_ACK 0x2 /* Frame is acknowledgment */31#define IEEE802154_FC_TYPE_MAC_CMD 0x3 /* Frame is MAC command */3233#define IEEE802154_FC_TYPE_SHIFT 034#define IEEE802154_FC_TYPE_MASK ((1 << 3) - 1)35#define IEEE802154_FC_TYPE(x) ((x & IEEE802154_FC_TYPE_MASK) >> IEEE802154_FC_TYPE_SHIFT)36#define IEEE802154_FC_SET_TYPE(v, x) do { \37v = (((v) & ~IEEE802154_FC_TYPE_MASK) | \38(((x) << IEEE802154_FC_TYPE_SHIFT) & IEEE802154_FC_TYPE_MASK)); \39} while (0)4041#define IEEE802154_FC_SECEN (1 << 3)42#define IEEE802154_FC_FRPEND (1 << 4)43#define IEEE802154_FC_ACK_REQ (1 << 5)44#define IEEE802154_FC_INTRA_PAN (1 << 6)4546#define IEEE802154_FC_SAMODE_SHIFT 1447#define IEEE802154_FC_SAMODE_MASK (3 << IEEE802154_FC_SAMODE_SHIFT)48#define IEEE802154_FC_DAMODE_SHIFT 1049#define IEEE802154_FC_DAMODE_MASK (3 << IEEE802154_FC_DAMODE_SHIFT)5051#define IEEE802154_FC_SAMODE(x) \52(((x) & IEEE802154_FC_SAMODE_MASK) >> IEEE802154_FC_SAMODE_SHIFT)5354#define IEEE802154_FC_DAMODE(x) \55(((x) & IEEE802154_FC_DAMODE_MASK) >> IEEE802154_FC_DAMODE_SHIFT)565758/* MAC's Command Frames Identifiers */59#define IEEE802154_CMD_ASSOCIATION_REQ 0x0160#define IEEE802154_CMD_ASSOCIATION_RESP 0x0261#define IEEE802154_CMD_DISASSOCIATION_NOTIFY 0x0362#define IEEE802154_CMD_DATA_REQ 0x0463#define IEEE802154_CMD_PANID_CONFLICT_NOTIFY 0x0564#define IEEE802154_CMD_ORPHAN_NOTIFY 0x0665#define IEEE802154_CMD_BEACON_REQ 0x0766#define IEEE802154_CMD_COORD_REALIGN_NOTIFY 0x0867#define IEEE802154_CMD_GTS_REQ 0x096869/*70* The return values of MAC operations71*/72enum {73/*74* The requested operation was completed successfully.75* For a transmission request, this value indicates76* a successful transmission.77*/78IEEE802154_SUCCESS = 0x0,7980/* The beacon was lost following a synchronization request. */81IEEE802154_BEACON_LOSS = 0xe0,82/*83* A transmission could not take place due to activity on the84* channel, i.e., the CSMA-CA mechanism has failed.85*/86IEEE802154_CHNL_ACCESS_FAIL = 0xe1,87/* The GTS request has been denied by the PAN coordinator. */88IEEE802154_DENINED = 0xe2,89/* The attempt to disable the transceiver has failed. */90IEEE802154_DISABLE_TRX_FAIL = 0xe3,91/*92* The received frame induces a failed security check according to93* the security suite.94*/95IEEE802154_FAILED_SECURITY_CHECK = 0xe4,96/*97* The frame resulting from secure processing has a length that is98* greater than aMACMaxFrameSize.99*/100IEEE802154_FRAME_TOO_LONG = 0xe5,101/*102* The requested GTS transmission failed because the specified GTS103* either did not have a transmit GTS direction or was not defined.104*/105IEEE802154_INVALID_GTS = 0xe6,106/*107* A request to purge an MSDU from the transaction queue was made using108* an MSDU handle that was not found in the transaction table.109*/110IEEE802154_INVALID_HANDLE = 0xe7,111/* A parameter in the primitive is out of the valid range.*/112IEEE802154_INVALID_PARAMETER = 0xe8,113/* No acknowledgment was received after aMaxFrameRetries. */114IEEE802154_NO_ACK = 0xe9,115/* A scan operation failed to find any network beacons.*/116IEEE802154_NO_BEACON = 0xea,117/* No response data were available following a request. */118IEEE802154_NO_DATA = 0xeb,119/* The operation failed because a short address was not allocated. */120IEEE802154_NO_SHORT_ADDRESS = 0xec,121/*122* A receiver enable request was unsuccessful because it could not be123* completed within the CAP.124*/125IEEE802154_OUT_OF_CAP = 0xed,126/*127* A PAN identifier conflict has been detected and communicated to the128* PAN coordinator.129*/130IEEE802154_PANID_CONFLICT = 0xee,131/* A coordinator realignment command has been received. */132IEEE802154_REALIGMENT = 0xef,133/* The transaction has expired and its information discarded. */134IEEE802154_TRANSACTION_EXPIRED = 0xf0,135/* There is no capacity to store the transaction. */136IEEE802154_TRANSACTION_OVERFLOW = 0xf1,137/*138* The transceiver was in the transmitter enabled state when the139* receiver was requested to be enabled.140*/141IEEE802154_TX_ACTIVE = 0xf2,142/* The appropriate key is not available in the ACL. */143IEEE802154_UNAVAILABLE_KEY = 0xf3,144/*145* A SET/GET request was issued with the identifier of a PIB attribute146* that is not supported.147*/148IEEE802154_UNSUPPORTED_ATTR = 0xf4,149/*150* A request to perform a scan operation failed because the MLME was151* in the process of performing a previously initiated scan operation.152*/153IEEE802154_SCAN_IN_PROGRESS = 0xfc,154};155156157#endif158159160161162