libnet80211: start an open_esplib library.

This commit is contained in:
ourairquality 2016-09-16 12:22:57 +10:00
parent 8368929a66
commit 195eb3a97b
4 changed files with 86 additions and 2 deletions

View file

@ -5,11 +5,18 @@ INC_DIRS += $(open_esplibs_ROOT)include
$(eval $(call component_compile_rules,open_esplibs)) $(eval $(call component_compile_rules,open_esplibs))
# args for passing into compile rule generation # args for passing into compile rule generation
open_esplibs_libmain_ROOT = $(open_esplibs_libmain_DEFAULT_ROOT)libmain open_esplibs_libmain_ROOT = $(open_esplibs_ROOT)libmain
open_esplibs_libmain_INC_DIR = open_esplibs_libmain_INC_DIR =
open_esplibs_libmain_SRC_DIR = $(open_esplibs_libmain_ROOT) open_esplibs_libmain_SRC_DIR = $(open_esplibs_libmain_ROOT)
open_esplibs_libmain_EXTRA_SRC_FILES = open_esplibs_libmain_EXTRA_SRC_FILES =
open_esplibs_libmain_CFLAGS = $(CFLAGS) open_esplibs_libmain_CFLAGS = $(CFLAGS)
$(eval $(call component_compile_rules,open_esplibs_libmain)) $(eval $(call component_compile_rules,open_esplibs_libmain))
open_esplibs_libnet80211_ROOT = $(open_esplibs_ROOT)libnet80211
open_esplibs_libnet80211_INC_DIR =
open_esplibs_libnet80211_SRC_DIR = $(open_esplibs_libnet80211_ROOT)
open_esplibs_libnet80211_EXTRA_SRC_FILES =
open_esplibs_libnet80211_CFLAGS = $(CFLAGS)
$(eval $(call component_compile_rules,open_esplibs_libnet80211))

View file

@ -36,4 +36,16 @@
#define OPEN_LIBMAIN_USER_INTERFACE (OPEN_LIBMAIN) #define OPEN_LIBMAIN_USER_INTERFACE (OPEN_LIBMAIN)
#endif #endif
#ifndef OPEN_LIBNET80211
#define OPEN_LIBNET80211 (OPEN_ESPLIBS)
#endif
#ifndef OPEN_LIBNET80211_WL_CNX
#define OPEN_LIBNET80211_WL_CNX (OPEN_LIBNET80211)
#endif
#ifndef OPEN_LIBNET80211_HOSTAP
#define OPEN_LIBNET80211_HOSTAP (OPEN_LIBNET80211)
#endif
#endif /* _OPEN_ESPLIBS_H */ #endif /* _OPEN_ESPLIBS_H */

View file

@ -0,0 +1,31 @@
/* Recreated Espressif libnet80211 ieee80211_hostap.o contents.
Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries.
BSD Licensed as described in the file LICENSE
*/
#include "open_esplibs.h"
#if OPEN_LIBNET80211_HOSTAP
// The contents of this file are only built if OPEN_LIBNET80211_HOSTAP is set to true
#include "sdk_internal.h"
void sdk_ieee80211_send_mgmt(void *, int, int);
void sdk_cnx_node_leave(struct sdk_g_ic_netif_info *netif, struct sdk_netif_conninfo *conn);
void sdk_hostap_handle_timer(struct sdk_netif_conninfo *cnx_node)
{
uint32_t count1 = *(uint32_t *)(((void *)cnx_node) + 0x108);
uint32_t count2 = TIMER_FRC2.COUNT;
if ((count2 - count1) > 93599688U) {
struct sdk_g_ic_netif_info *info = sdk_g_ic.v.softap_netif_info;
struct sdk_netif_conninfo *conninfo = info->_unknown88;
info->_unknown88 = cnx_node;
sdk_ieee80211_send_mgmt(info, 160, 4);
sdk_ieee80211_send_mgmt(info, 192, 2);
info->_unknown88 = conninfo;
sdk_cnx_node_leave(info, cnx_node);
}
}
#endif /* OPEN_LIBNET80211_HOSTAP */

View file

@ -0,0 +1,34 @@
/* Recreated Espressif libnet80211 wl_cnx.o contents.
Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries.
BSD Licensed as described in the file LICENSE
*/
#include "open_esplibs.h"
#if OPEN_LIBNET80211_WL_CNX
// The contents of this file are only built if OPEN_LIBNET80211_WL_CNX is set to true
#include "espressif/esp_misc.h"
#include "sdk_internal.h"
#include <string.h>
void *sdk_cnx_node_search(uint8_t mac[6])
{
int count = sdk_g_ic.s._unknown310 + 2;
if (count < 1)
return NULL;
struct sdk_netif_conninfo **conninfo = sdk_g_ic.v.softap_netif_info->conninfo;
int i = 0;
do {
struct sdk_netif_conninfo *info = conninfo[i];
if (info && memcmp(mac, info, 6) == 0)
return info;
i = i + 1;
} while (i != count);
return NULL;
}
#endif /* OPEN_LIBNET80211_WL_CNX */