Bluetooth: Mesh: Export key packing helpers internally

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
diff --git a/subsys/bluetooth/host/mesh/cfg.c b/subsys/bluetooth/host/mesh/cfg.c
index f7505ef..4d523e1 100644
--- a/subsys/bluetooth/host/mesh/cfg.c
+++ b/subsys/bluetooth/host/mesh/cfg.c
@@ -42,21 +42,6 @@
 	u8_t  uuid[16];
 } labels[CONFIG_BT_MESH_LABEL_COUNT];
 
-static inline void key_idx_unpack(struct net_buf_simple *buf,
-				  u16_t *idx1, u16_t *idx2)
-{
-	*idx1 = sys_get_le16(&buf->data[0]) & 0xfff;
-	*idx2 = sys_get_le16(&buf->data[1]) >> 4;
-	net_buf_simple_pull(buf, 3);
-}
-
-static inline void key_idx_pack(struct net_buf_simple *buf,
-				u16_t idx1, u16_t idx2)
-{
-	net_buf_simple_add_le16(buf, idx1 | ((idx2 & 0x00f) << 12));
-	net_buf_simple_add_u8(buf, idx2 >> 4);
-}
-
 static void hb_send(struct bt_mesh_model *model)
 {
 
diff --git a/subsys/bluetooth/host/mesh/foundation.h b/subsys/bluetooth/host/mesh/foundation.h
index 85b237e..4b32b04 100644
--- a/subsys/bluetooth/host/mesh/foundation.h
+++ b/subsys/bluetooth/host/mesh/foundation.h
@@ -133,3 +133,20 @@
 u8_t bt_mesh_beacon_get(void);
 u8_t bt_mesh_gatt_proxy_get(void);
 u8_t bt_mesh_default_ttl_get(void);
+
+#include <misc/byteorder.h>
+
+static inline void key_idx_pack(struct net_buf_simple *buf,
+				u16_t idx1, u16_t idx2)
+{
+	net_buf_simple_add_le16(buf, idx1 | ((idx2 & 0x00f) << 12));
+	net_buf_simple_add_u8(buf, idx2 >> 4);
+}
+
+static inline void key_idx_unpack(struct net_buf_simple *buf,
+				  u16_t *idx1, u16_t *idx2)
+{
+	*idx1 = sys_get_le16(&buf->data[0]) & 0xfff;
+	*idx2 = sys_get_le16(&buf->data[1]) >> 4;
+	net_buf_simple_pull(buf, 3);
+}