open_esplibs libwpa: source code for os_xtensa.c (#283)
This commit is contained in:
parent
ca6c6e1d3e
commit
df76e77598
5 changed files with 49 additions and 0 deletions
|
@ -279,9 +279,11 @@ NoiseTimerInterval sdk_NoiseTimerInterval
|
|||
operation_test sdk_operation_test
|
||||
os_delay_us sdk_os_delay_us
|
||||
os_get_cpu_frequency sdk_os_get_cpu_frequency
|
||||
os_get_random sdk_os_get_random
|
||||
os_get_time sdk_os_get_time
|
||||
os_install_putc1 sdk_os_install_putc1
|
||||
os_putc sdk_os_putc
|
||||
os_random sdk_os_random
|
||||
os_timer_arm sdk_os_timer_arm
|
||||
os_timer_disarm sdk_os_timer_disarm
|
||||
os_timer_setfn sdk_os_timer_setfn
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
# Object files to be removed from libwpa
|
||||
os_xtensa.o
|
|
@ -35,6 +35,9 @@ int sdk_hostapd_setup_wpa_psk(struct _unknown_softap2 *);
|
|||
// md5.o
|
||||
|
||||
// os_xtensa.o
|
||||
int sdk_os_get_time(uint32_t time[]);
|
||||
uint32_t sdk_os_random();
|
||||
int sdk_os_get_random(uint8_t *dst, uint32_t size);
|
||||
|
||||
// rc4.o
|
||||
|
||||
|
|
|
@ -111,6 +111,10 @@
|
|||
#define OPEN_LIBWPA (OPEN_ESPLIBS)
|
||||
#endif
|
||||
|
||||
#ifndef OPEN_LIBWPA_OS_XTENSA
|
||||
#define OPEN_LIBWPA_OS_XTENSA (OPEN_LIBWPA)
|
||||
#endif
|
||||
|
||||
#ifndef OPEN_LIBWPA_WPA_MAIN
|
||||
#define OPEN_LIBWPA_WPA_MAIN (OPEN_LIBWPA)
|
||||
#endif
|
||||
|
|
38
open_esplibs/libwpa/os_xtensa.c
Normal file
38
open_esplibs/libwpa/os_xtensa.c
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* Recreated Espressif libwpa is_xtensa.s 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_LIBWPA_OS_XTENSA
|
||||
// The contents of this file are only built if OPEN_LIBWPA_WPA_MAIN is set to true
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <esplibs/libwpa.h>
|
||||
#include <common_macros.h>
|
||||
|
||||
// Used by wpa_get_ntp_timestamp.
|
||||
int IRAM sdk_os_get_time(uint32_t time[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t IRAM sdk_os_random() {
|
||||
return rand();
|
||||
}
|
||||
|
||||
int IRAM sdk_os_get_random(uint8_t *dst, uint32_t size) {
|
||||
uint32_t end = size >> 2;
|
||||
if (end > 0) {
|
||||
uint32_t i = 0;
|
||||
do {
|
||||
uint32_t n = rand();
|
||||
memcpy(dst, &n, sizeof(n));
|
||||
dst += 4;
|
||||
i++;
|
||||
} while (i < end);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* OPEN_LIBWPA_OS_XTENSA */
|
Loading…
Reference in a new issue