]> 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 91138798702f948c122b7e650d5852b4b2bc3ae8..eae62c35b82fb2e7add4e331a2859de8264f25e2 100644 (file)
 
 typedef uint8_t cc2420_status_t;
 
-#if !defined(TFRAMES_ENABLED) && !defined(IEEE154FRAMES_ENABLED)
-#define CC2420_IFRAME_TYPE
-#endif
-
 #if defined(TFRAMES_ENABLED) && defined(IEEE154FRAMES_ENABLED)
 #error "Both TFRAMES and IEEE154FRAMES enabled!"
 #endif
@@ -108,15 +104,12 @@ typedef nx_struct cc2420_header_t {
   security_header_t secHdr;
 #endif
   
-#ifdef CC2420_IFRAME_TYPE
+#ifndef TFRAMES_ENABLED
   /** I-Frame 6LowPAN interoperability byte */
   nxle_uint8_t network;
 #endif
 
-#if defined(TFRAMES_ENABLED) || defined(CC2420_IFRAME_TYPE)
   nxle_uint8_t type;
-#endif
-
 } cc2420_header_t;
 
 /**
@@ -191,20 +184,11 @@ enum {
   // MDU
   MAC_PACKET_SIZE = MAC_HEADER_SIZE + TOSH_DATA_LENGTH + MAC_FOOTER_SIZE,
 
-  AM_OVERHEAD = 0
-#if defined(TFRAMES_ENABLED) || defined(CC2420_IFRAME_TYPE)
-  + 1 // add one for the AM byte
-#if defined(CC2420_IFRAME_TYPE)
-  + 1 // and one for the network byte
-#endif
-#endif    
-  ,
+  CC2420_SIZE = MAC_HEADER_SIZE + MAC_FOOTER_SIZE,
 
-  CC2420_SIZE = MAC_HEADER_SIZE + MAC_FOOTER_SIZE - AM_OVERHEAD,
+  AM_OVERHEAD = 2,
 };
 
-#define CC2420_PAYLOAD(mbuf)  (((uint8_t *)(mbuf)->data) - AM_OVERHEAD)
-
 enum cc2420_enums {
   CC2420_TIME_ACK_TURNAROUND = 7, // jiffies
   CC2420_TIME_VREN = 20,          // jiffies