This commit is contained in:
Our Air Quality 2016-10-20 07:03:18 +00:00 committed by GitHub
commit 6111380759
5 changed files with 107 additions and 2 deletions

View file

@ -451,3 +451,18 @@ static __attribute__((noinline)) void dump_flash_config_sectors(uint32_t start_s
dump_flash_sector(start_sector + 3, BOOT_INFO_SIZE); dump_flash_sector(start_sector + 3, BOOT_INFO_SIZE);
} }
/*
* Hack references to dummy functions in open_esplibs object files to
* ensure that the linker uses the open definitions rather than the
* sdk definitions.
*/
void libnet80211_hostap_linker_hack();
void libnet80211_wl_cnx_linker_hack();
void open_esplibs_refs()
{
libnet80211_hostap_linker_hack();
libnet80211_wl_cnx_linker_hack();
}

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,34 @@
/* 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);
}
}
/* Needed to have the linker actually replace the above definitions. */
void libnet80211_hostap_linker_hack(){}
#endif /* OPEN_LIBNET80211_HOSTAP */

View file

@ -0,0 +1,37 @@
/* 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;
}
/* Needed to have the linker actually replace the above definitions. */
void libnet80211_wl_cnx_linker_hack(){}
#endif /* OPEN_LIBNET80211_WL_CNX */