From 388c5d42440a2f5daf48c3d8a531caf8686d365e Mon Sep 17 00:00:00 2001
From: adamdunkels <adamdunkels>
Date: Thu, 28 Jan 2010 13:50:51 +0000
Subject: [PATCH] Made the sicslowpan MAC layer reachable from outside modules

---
 core/net/sicslowpan.c | 12 ++++++------
 core/net/sicslowpan.h |  3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/core/net/sicslowpan.c b/core/net/sicslowpan.c
index 357cec9f7e..d9cdd268d0 100644
--- a/core/net/sicslowpan.c
+++ b/core/net/sicslowpan.c
@@ -32,7 +32,7 @@
  *
  * This file is part of the Contiki operating system.
  *
- * $Id: sicslowpan.c,v 1.10 2009/11/02 11:58:56 adamdunkels Exp $
+ * $Id: sicslowpan.c,v 1.11 2010/01/28 13:50:51 adamdunkels Exp $
  */
 /**
  * \file
@@ -142,7 +142,7 @@ void uip_log(char *msg);
  *  @{
  */
 /** A pointer to the mac driver */
-static const struct mac_driver *mac;
+const struct mac_driver *sicslowpan_mac;
 
 /**
  * A pointer to the rime buffer.
@@ -1109,10 +1109,10 @@ send_packet(rimeaddr_t *dest)
    */
   packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, dest);
 
-  if(mac != NULL) {
+  if(sicslowpan_mac != NULL) {
   /** \todo: Fix sending delays so they aren't blocking, or even better would
    *         be to figure out how to get rid of delays entirely */
-    mac->send();
+    sicslowpan_mac->send();
   }
 }
 
@@ -1466,10 +1466,10 @@ void
 sicslowpan_init(const struct mac_driver *m)
 {
   /* remember the mac driver */
-  mac = m;
+  sicslowpan_mac = m;
  
   /* Set our input function as the receive function of the MAC. */
-  mac->set_receive_function(input);
+  sicslowpan_mac->set_receive_function(input);
 
   /*
    * Set out output function as the function to be called from uIP to
diff --git a/core/net/sicslowpan.h b/core/net/sicslowpan.h
index 97fc84ec2f..8acadda74d 100644
--- a/core/net/sicslowpan.h
+++ b/core/net/sicslowpan.h
@@ -33,7 +33,7 @@
  *
  * This file is part of the Contiki operating system.
  *
- * $Id: sicslowpan.h,v 1.4 2009/04/06 13:11:20 nifi Exp $
+ * $Id: sicslowpan.h,v 1.5 2010/01/28 13:50:51 adamdunkels Exp $
  */
 /**
  * \file
@@ -255,5 +255,6 @@ struct sicslowpan_addr_context {
  */
 void sicslowpan_init(const struct mac_driver *m);
 
+extern const struct mac_driver *sicslowpan_mac;
 #endif /* __SICSLOWPAN_H__ */
 /** @} */
-- 
GitLab