From 63a47f7b6f7543f26ad3a2be81314aa27fa1cf62 Mon Sep 17 00:00:00 2001
From: Our Air Quality <info@ourairquality.org>
Date: Fri, 11 Nov 2016 19:39:24 +1100
Subject: [PATCH] open_esplibs libnet80211: source code for
 sdk_ieee80211_getmgtframe.

---
 open_esplibs/libnet80211/ieee80211_ets.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/open_esplibs/libnet80211/ieee80211_ets.c b/open_esplibs/libnet80211/ieee80211_ets.c
index 7d0620d..fec6cce 100644
--- a/open_esplibs/libnet80211/ieee80211_ets.c
+++ b/open_esplibs/libnet80211/ieee80211_ets.c
@@ -7,4 +7,21 @@
 #if OPEN_LIBNET80211_ETS
 // The contents of this file are only built if OPEN_LIBNET80211_ETS is set to true
 
+#include "esplibs/libnet80211.h"
+#include "esplibs/libpp.h"
+
+struct esf_buf IRAM *sdk_ieee80211_getmgtframe(void **arg0, uint32_t arg1, uint32_t arg2) {
+    uint32_t len = (arg1 + arg2 + 3) & 0xfffffffc;
+    if (len >= 256) return NULL;
+
+    struct esf_buf *esf_buf = sdk_esf_buf_alloc(NULL, len < 65 ? 5 : 4);
+    if (esf_buf) {
+        struct pbuf *pbuf = esf_buf->pbuf2;
+        void *payload = pbuf->payload;
+        *arg0 = payload + arg1;
+    }
+
+    return esf_buf;
+}
+
 #endif /* OPEN_LIBNET80211_ETS */