]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/CC2420.h
cleanup some offsets in the cc2420 stack
[tinyos-2.x.git] / tos / chips / cc2420 / CC2420.h
index bdaefd6b4c5b6cf92a15ad04c0d8ad54af929556..eae62c35b82fb2e7add4e331a2859de8264f25e2 100644 (file)
@@ -38,8 +38,8 @@
 
 typedef uint8_t cc2420_status_t;
 
-#ifndef TFRAMES_ENABLED
-#define CC2420_IFRAME_TYPE
+#if defined(TFRAMES_ENABLED) && defined(IEEE154FRAMES_ENABLED)
+#error "Both TFRAMES and IEEE154FRAMES enabled!"
 #endif
 
 /**
@@ -99,20 +99,17 @@ typedef nx_struct cc2420_header_t {
   nxle_uint16_t destpan;
   nxle_uint16_t dest;
   nxle_uint16_t src;
-
+  /** CC2420 802.15.4 header ends here */
 #ifdef CC2420_HW_SECURITY
   security_header_t secHdr;
 #endif
   
+#ifndef TFRAMES_ENABLED
   /** I-Frame 6LowPAN interoperability byte */
-#ifdef CC2420_IFRAME_TYPE
   nxle_uint8_t network;
 #endif
 
-#ifndef TINYOS_IP
   nxle_uint8_t type;
-#endif
-
 } cc2420_header_t;
 
 /**
@@ -143,7 +140,6 @@ typedef nx_struct cc2420_metadata_t {
   nx_uint16_t maxRetries;
   nx_uint16_t retryDelay;
 #endif
-
 } cc2420_metadata_t;
 
 
@@ -180,7 +176,6 @@ typedef nx_struct cc2420_packet_t {
 #define TINYOS_6LOWPAN_NETWORK_ID 0x3f
 #endif
 
-
 enum {
   // size of the header not including the length byte
   MAC_HEADER_SIZE = sizeof( cc2420_header_t ) - 1,
@@ -190,6 +185,8 @@ enum {
   MAC_PACKET_SIZE = MAC_HEADER_SIZE + TOSH_DATA_LENGTH + MAC_FOOTER_SIZE,
 
   CC2420_SIZE = MAC_HEADER_SIZE + MAC_FOOTER_SIZE,
+
+  AM_OVERHEAD = 2,
 };
 
 enum cc2420_enums {