chore: sdk compiles almost w/o warnings?
This commit is contained in:
18
.vscode/c_cpp_properties.json
vendored
Normal file
18
.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "ARM",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/lib/freertos/portable/GCC/ARM_CM4F/",
|
||||
"/usr/arm-none-eabi/include/"
|
||||
],
|
||||
"defines": ["__ARM_ARCH_7M__", "__ARM_ARCH_7EM__", "CONFIG_PLATFORM_8711B"],
|
||||
"cStandard": "gnu99",
|
||||
"intelliSenseMode": "linux-gcc-arm",
|
||||
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
|
||||
"compilerArgs": ["-mcpu=cortex-m4", "-mthumb"]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
49
.vscode/settings.json
vendored
Normal file
49
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"makefile.configureOnOpen": false,
|
||||
"makefile.configureOnEdit": false,
|
||||
"makefile.configureAfterCommand": false,
|
||||
"cmake.ignoreCMakeListsMissing": true,
|
||||
"files.associations": {
|
||||
"*.rmd": "markdown",
|
||||
"wifi_constants.h": "c",
|
||||
"freertos.h": "c",
|
||||
"complex": "c",
|
||||
"format": "c",
|
||||
"osdep_service.h": "c",
|
||||
"freertos_service.h": "c",
|
||||
"gpio_api.h": "c",
|
||||
"diag.h": "c",
|
||||
"device.h": "c",
|
||||
"objects.h": "c",
|
||||
"task.h": "c",
|
||||
"main.h": "c",
|
||||
"freertosconfig.h": "c",
|
||||
"epstruct.h": "c",
|
||||
"atomic": "cpp",
|
||||
"*.tcc": "cpp",
|
||||
"chrono": "cpp",
|
||||
"cstdint": "cpp",
|
||||
"random": "cpp",
|
||||
"stop_token": "cpp",
|
||||
"wifi_conf.h": "c",
|
||||
"example_wlan_fast_connect.h": "c",
|
||||
"dhcps.h": "c",
|
||||
"hal_crypto.h": "c",
|
||||
"ameba_soc.h": "c",
|
||||
"cmsis_os.h": "c",
|
||||
"core_cmfunc.h": "c",
|
||||
"wait_api.h": "c",
|
||||
"rtc_api.h": "c",
|
||||
"stdbool.h": "c",
|
||||
"build_info.h": "c"
|
||||
},
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
"lib/freertos/examples/": true
|
||||
}
|
||||
}
|
||||
11
Makefile
11
Makefile
@@ -16,7 +16,7 @@ ifneq ($(OTA_IDX),2)
|
||||
endif
|
||||
endif
|
||||
|
||||
FLASH_ADDRESS := $(if $(OTA_IDX),0x80000,0x0B000)
|
||||
FLASH_ADDRESS := $(if $(OTA_IDX),0x0B000,0x80000)
|
||||
FLASH_FILE := $(BIN_DIR)/image2_all_ota$(OTA_IDX).bin
|
||||
|
||||
.PHONY: all
|
||||
@@ -47,6 +47,15 @@ flash:
|
||||
-c 'reset run' \
|
||||
-c 'shutdown'
|
||||
|
||||
flash_boot:
|
||||
@$(OPENOCD_BASE) \
|
||||
-c 'rtl8710_flash_auto_erase 1' \
|
||||
-c 'rtl8710_flash_auto_verify 1' \
|
||||
-c 'rtl8710_flash_write $(BUILD_DIR)/boot/boot_all.bin 0' \
|
||||
-c 'rtl8710_reboot' \
|
||||
-c 'reset run' \
|
||||
-c 'shutdown'
|
||||
|
||||
# flasher targets
|
||||
.PHONY: rtl-test rtl-mac rtl-dump rtl-full-erase rtl-restore rtl-restore-nae rtl-verify rtl-reset
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ extern uint32_t SystemCoreClock;
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 0
|
||||
#define configGENERATE_RUN_TIME_STATS 0
|
||||
#if configGENERATE_RUN_TIME_STATS
|
||||
#ifdef configGENERATE_RUN_TIME_STATS
|
||||
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() //( ulHighFrequencyTimerTicks
|
||||
//= 0UL )
|
||||
#define portGET_RUN_TIME_COUNTER_VALUE() \
|
||||
@@ -67,8 +67,8 @@ extern uint32_t SystemCoreClock;
|
||||
|
||||
#if (__IASMARM__ != 1)
|
||||
|
||||
extern void freertos_pre_sleep_processing(unsigned int *expected_idle_time);
|
||||
extern void freertos_post_sleep_processing(unsigned int *expected_idle_time);
|
||||
extern void freertos_pre_sleep_processing(uint32_t *expected_idle_time);
|
||||
extern void freertos_post_sleep_processing(uint32_t *expected_idle_time);
|
||||
extern int freertos_ready_to_sleep();
|
||||
|
||||
/* Enable tickless power saving. */
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
#define CONFIG_JOINLINK 0
|
||||
|
||||
/*For promisc rx unsupported pkt info */
|
||||
#define CONFIG_UNSUPPORT_PLCPHDR_RPT 1
|
||||
#define CONFIG_UNSUPPORT_PLCPHDR_RPT 0
|
||||
|
||||
#endif //end of #if CONFIG_WLAN
|
||||
/*******************************************************************************/
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/dns.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "ethernetif.h"
|
||||
#include "main.h"
|
||||
#include "lwip_netconf.h"
|
||||
@@ -18,6 +19,7 @@
|
||||
#include "stm324xg_eval_lcd.h"
|
||||
#endif
|
||||
#include <platform/platform_stdlib.h>
|
||||
#include <osdep_service.h>
|
||||
|
||||
#if defined(CONFIG_FAST_DHCP) && CONFIG_FAST_DHCP
|
||||
#include "wlan_fast_connect/example_wlan_fast_connect.h"
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
#include <autoconf.h>
|
||||
|
||||
#define CONFIG_WLAN 1
|
||||
#include "FreeRTOSConfig.h"
|
||||
|
||||
#define CONFIG_WLAN 1
|
||||
|
||||
/* Header file declaration*/
|
||||
void wlan_network();
|
||||
|
||||
|
||||
/* Interactive Mode */
|
||||
#define SERIAL_DEBUG_RX 1
|
||||
#if defined(__ICCARM__)
|
||||
@@ -17,7 +17,6 @@ static
|
||||
#endif
|
||||
char uart_buf[64];
|
||||
|
||||
|
||||
/* WLAN and Netork */
|
||||
#define STA_MODE_SSID "ap" /* Set SSID here */
|
||||
#define AP_MODE_SSID "wlan_ap_ssid" /* Set SSID here */
|
||||
|
||||
@@ -166,6 +166,7 @@ extern void vPortFree( void *pv );
|
||||
#include "strproc.h"
|
||||
#include "memproc.h"
|
||||
#include "basic_types.h"
|
||||
#include "rand.h"
|
||||
#if USE_RTL_ROM_CLIB
|
||||
#include "rtl_lib.h"
|
||||
#include "rom_libc_string.h"
|
||||
@@ -200,10 +201,10 @@ extern void vPortFree( void *pv );
|
||||
#define printf buffered_printf
|
||||
#else
|
||||
#define printf rtl_printf
|
||||
#endif
|
||||
#define sprintf rtl_sprintf
|
||||
#define snprintf rtl_snprintf
|
||||
#define vsnprintf rtl_vsnprintf
|
||||
#endif
|
||||
#else
|
||||
#define printf DiagPrintf
|
||||
#define sprintf(fmt, arg...) DiagSPrintf((u8*)fmt, ##arg)
|
||||
@@ -233,7 +234,9 @@ extern void vPortFree( void *pv );
|
||||
#define atoi(str) prvAtoi(str)
|
||||
#define strpbrk(cs, ct) _strpbrk(cs, ct) // for B-cut ROM
|
||||
#if defined (__GNUC__)
|
||||
#undef sscanf
|
||||
// #undef sscanf
|
||||
// #define sscanf _sscanf_patch
|
||||
extern int _sscanf_patch(const char *s, const char *template, ...);
|
||||
#define sscanf _sscanf_patch
|
||||
#define rand Rand
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "utils/includes.h"
|
||||
#include "utils/common.h"
|
||||
#include "tls.h"
|
||||
#include "wifi_eap_config.h"
|
||||
|
||||
#define DEBUG_LEVEL 0 // For debug: 5
|
||||
|
||||
|
||||
@@ -78,14 +78,14 @@ void judge_station_disconnect(void)
|
||||
}
|
||||
}
|
||||
|
||||
void eap_disconnected_hdl(char *buf, int buf_len, int flags, void* handler_user_data){
|
||||
// printf("disconnected\n");
|
||||
wifi_unreg_event_handler(WIFI_EVENT_EAPOL_RECVD, eap_eapol_recvd_hdl);
|
||||
wifi_unreg_event_handler(WIFI_EVENT_DISCONNECT, eap_disconnected_hdl);
|
||||
eap_peer_unregister_methods();
|
||||
eap_sm_deinit();
|
||||
//reset_config();
|
||||
}
|
||||
// void eap_disconnected_hdl(char *buf, int buf_len, int flags, void* handler_user_data){
|
||||
// // printf("disconnected\n");
|
||||
// wifi_unreg_event_handler(WIFI_EVENT_EAPOL_RECVD, eap_eapol_recvd_hdl);
|
||||
// wifi_unreg_event_handler(WIFI_EVENT_DISCONNECT, eap_disconnected_hdl);
|
||||
// eap_peer_unregister_methods();
|
||||
// eap_sm_deinit();
|
||||
// //reset_config();
|
||||
// }
|
||||
|
||||
/*
|
||||
void eap_config(void){
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef __WIFI_EAP_CONFIG_H
|
||||
#define __WIFI_EAP_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "basic_types.h"
|
||||
|
||||
// Function declarations
|
||||
/**
|
||||
* @brief Set the EAP phase flag
|
||||
* @param is_trigger_eap Flag value to set
|
||||
*/
|
||||
void set_eap_phase(unsigned char is_trigger_eap);
|
||||
|
||||
/**
|
||||
* @brief Get the current EAP phase
|
||||
* @return Current EAP phase value
|
||||
*/
|
||||
int get_eap_phase(void);
|
||||
|
||||
/**
|
||||
* @brief Get the current EAP method
|
||||
* @return Current EAP method value
|
||||
*/
|
||||
int get_eap_method(void);
|
||||
|
||||
/**
|
||||
* @brief Reset all EAP configuration parameters to NULL
|
||||
*/
|
||||
void reset_config(void);
|
||||
|
||||
/**
|
||||
* @brief Start the EAP authentication process
|
||||
* @param method The EAP method to use ("peap", "tls", or "ttls")
|
||||
* @return 0 on success, -1 on failure
|
||||
*/
|
||||
int eap_start(char *method);
|
||||
|
||||
/**
|
||||
* @brief Handle auto-reconnection for EAP
|
||||
* @param method_id The EAP method ID to use for reconnection
|
||||
*/
|
||||
void eap_autoreconnect_hdl(u8 method_id);
|
||||
|
||||
/**
|
||||
* @brief Initialize EAP certificates
|
||||
* @return 0 on success, -1 on failure
|
||||
*/
|
||||
int eap_cert_init(void);
|
||||
|
||||
/**
|
||||
* @brief Free client certificate resources
|
||||
*/
|
||||
void eap_client_cert_free(void);
|
||||
|
||||
/**
|
||||
* @brief Free server certificate resources
|
||||
*/
|
||||
void eap_server_cert_free(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __WIFI_EAP_CONFIG_H */
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "tcpip.h"
|
||||
#include <osdep_service.h>
|
||||
#include <device_lock.h>
|
||||
#include "wifi_promisc.h"
|
||||
// #include "dhcp.h"
|
||||
|
||||
#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT || CONFIG_JD_SMART
|
||||
#include "wlan_fast_connect/example_wlan_fast_connect.h"
|
||||
@@ -67,7 +69,7 @@ static unsigned char ap_bssid[6];
|
||||
#if CONFIG_WIFI_IND_USE_THREAD
|
||||
static void* disconnect_sema = NULL;
|
||||
#endif
|
||||
extern rtw_mode_t wifi_mode;
|
||||
rtw_mode_t wifi_mode = RTW_MODE_STA;
|
||||
static rtw_wpa_mode wifi_wpa_mode = WPA_AUTO_MODE;
|
||||
|
||||
int error_flag = RTW_UNKNOWN;
|
||||
@@ -460,7 +462,7 @@ static void wifi_handshake_done_hdl( char* buf, int buf_len, int flags, void* us
|
||||
if(join_user_data != NULL)
|
||||
rtw_up_sema(&join_user_data->join_sema);
|
||||
}
|
||||
|
||||
extern void dhcp_stop(struct netif *netif);
|
||||
static void wifi_disconn_hdl( char* buf, int buf_len, int flags, void* userdata)
|
||||
{
|
||||
#define REASON_4WAY_HNDSHK_TIMEOUT 15
|
||||
@@ -871,7 +873,7 @@ int wifi_connect(
|
||||
|
||||
error:
|
||||
if(semaphore == NULL){
|
||||
rtw_free_sema( &join_semaphore);
|
||||
rtw_free_sema((_sema*)&join_semaphore);
|
||||
}
|
||||
join_user_data = NULL;
|
||||
rtw_free((u8*)join_result);
|
||||
@@ -1021,11 +1023,11 @@ int wifi_connect_bssid(
|
||||
rtw_free(join_result->network_info.password);
|
||||
}
|
||||
rtw_free((u8*)join_result);
|
||||
rtw_free_sema( &join_semaphore);
|
||||
rtw_free_sema((_sema*)&join_semaphore);
|
||||
result = RTW_TIMEOUT;
|
||||
goto error;
|
||||
} else {
|
||||
rtw_free_sema( &join_semaphore );
|
||||
rtw_free_sema((_sema*)&join_semaphore);
|
||||
if(join_result->network_info.password_len) {
|
||||
rtw_free(join_result->network_info.password);
|
||||
}
|
||||
@@ -1283,7 +1285,7 @@ int wifi_connect_concurrent(
|
||||
|
||||
error:
|
||||
if(semaphore == NULL){
|
||||
rtw_free_sema( &join_semaphore);
|
||||
rtw_free_sema((_sema*)&join_semaphore);
|
||||
}
|
||||
join_user_data = NULL;
|
||||
rtw_free((u8*)join_result);
|
||||
@@ -1433,11 +1435,11 @@ int wifi_connect_bssid_concurrent(
|
||||
rtw_free(join_result->network_info.password);
|
||||
}
|
||||
rtw_free((u8*)join_result);
|
||||
rtw_free_sema( &join_semaphore);
|
||||
rtw_free_sema((_sema*)&join_semaphore);
|
||||
result = RTW_TIMEOUT;
|
||||
goto error;
|
||||
} else {
|
||||
rtw_free_sema( &join_semaphore );
|
||||
rtw_free_sema((_sema*)&join_semaphore);
|
||||
if(join_result->network_info.password_len) {
|
||||
rtw_free(join_result->network_info.password);
|
||||
}
|
||||
@@ -1681,6 +1683,7 @@ int wifi_get_channel_plan(uint8_t *channel_plan)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
extern int rltk_wlan_get_sta_max_data_rate(u8 *inidata_rate);
|
||||
int wifi_get_sta_max_data_rate(OUT u8 * inidata_rate)
|
||||
{
|
||||
return rltk_wlan_get_sta_max_data_rate(inidata_rate);
|
||||
@@ -1995,7 +1998,7 @@ int wifi_set_power_mode(unsigned char ips_mode, unsigned char lps_mode)
|
||||
|
||||
int wifi_set_powersave_level(u8 level)
|
||||
{
|
||||
return rltk_set_lps_level(level);
|
||||
// return rltk_set_lps_level(level);
|
||||
}
|
||||
|
||||
int wifi_set_tdma_param(unsigned char slot_period, unsigned char rfon_period_len_1, unsigned char rfon_period_len_2, unsigned char rfon_period_len_3)
|
||||
@@ -2017,7 +2020,7 @@ static void wifi_ap_sta_assoc_hdl( char* buf, int buf_len, int flags, void* user
|
||||
{
|
||||
#ifdef CONFIG_PLATFORM_8711B
|
||||
if(enable_softap_adjust_phy){
|
||||
softap_adjust_phy();
|
||||
// softap_adjust_phy();
|
||||
}
|
||||
#endif
|
||||
//USER TODO
|
||||
@@ -2056,6 +2059,7 @@ int wifi_set_pmk_cache_enable(unsigned char value)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int set_hidden_ssid(const char *ifname, uint8_t value);
|
||||
int wifi_start_ap(
|
||||
char *ssid,
|
||||
rtw_security_t security_type,
|
||||
@@ -2154,7 +2158,7 @@ int wifi_start_ap(
|
||||
// for adjust/recover phy parameters before/after link on softap mode
|
||||
#ifdef CONFIG_PLATFORM_8711B
|
||||
if(enable_softap_adjust_phy){
|
||||
softap_adjust_phy();
|
||||
// softap_adjust_phy();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2523,7 +2527,7 @@ int wifi_scan_networks_with_ssid_by_extended_security(int (results_handler)(char
|
||||
return RTW_NOMEM;
|
||||
}
|
||||
|
||||
rltk_wlan_enable_scan_with_ssid_by_extended_security(1);
|
||||
// rltk_wlan_enable_scan_with_ssid_by_extended_security(1);
|
||||
|
||||
//set ssid
|
||||
memset(scan_buf.buf, 0, scan_buf.buf_len);
|
||||
@@ -2934,7 +2938,7 @@ int wifi_get_setting(const char *ifname, rtw_wifi_setting_t *pSetting)
|
||||
int ret = 0;
|
||||
int mode = 0;
|
||||
unsigned short security = 0;
|
||||
unsigned int auth_type = 0;
|
||||
u32 auth_type = 0;
|
||||
|
||||
memset(pSetting, 0, sizeof(rtw_wifi_setting_t));
|
||||
if(wext_get_mode(ifname, &mode) < 0)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "FreeRTOS.h"
|
||||
#include "wifi_promisc.h"
|
||||
|
||||
#include "task.h"
|
||||
#include "main.h"
|
||||
#include "tcpip.h"
|
||||
#include "wifi/wifi_conf.h"
|
||||
|
||||
#ifndef CONFIG_WLAN
|
||||
#define CONFIG_WLAN 1
|
||||
@@ -11,6 +11,19 @@
|
||||
#if CONFIG_WLAN
|
||||
#include <platform/platform_stdlib.h>
|
||||
|
||||
#ifdef CONFIG_PROMISC
|
||||
|
||||
#define _adapter void
|
||||
#define recv_frame void
|
||||
extern void _promisc_deinit(void *padapter);
|
||||
extern int _promisc_recv_func(void *padapter, void *rframe);
|
||||
extern int _promisc_set(rtw_rcr_level_t enabled, void (*callback)(unsigned char*, unsigned int, void*), unsigned char len_used);
|
||||
extern unsigned char _is_promisc_enabled(void);
|
||||
extern int _promisc_get_fixed_channel(void * fixed_bssid, u8 *ssid, int * ssid_length);
|
||||
extern void _promisc_filter_by_ap_and_phone_mac(u8 enable, void *ap_mac, void *phone_mac);
|
||||
|
||||
#endif
|
||||
|
||||
// Add extra interfaces to make release sdk able to determine promisc API linking
|
||||
void promisc_deinit(void *padapter)
|
||||
{
|
||||
@@ -132,7 +145,6 @@ struct inic_eth_frame {
|
||||
|
||||
static struct inic_eth_frame *inic_frame, *inic_frame_tail = NULL;
|
||||
static int inic_frame_cnt = 0;
|
||||
#define MAX_INIC_FRAME_NUM 50 //maximum packets for each channel
|
||||
extern void inic_c2h_msg(const char *atcmd, char status, char *msg, u16 msg_len);
|
||||
#endif
|
||||
|
||||
@@ -144,8 +156,6 @@ struct eth_buffer {
|
||||
static struct eth_buffer eth_buffer;
|
||||
|
||||
#ifdef CONFIG_PROMISC
|
||||
#define MAX_PACKET_FILTER_INFO 5
|
||||
#define FILTER_ID_INIT_VALUE 10
|
||||
rtw_packet_filter_info_t paff_array[MAX_PACKET_FILTER_INFO]={0, 0, 0, 0, 0};
|
||||
static u8 packet_filter_enable_num = 0;
|
||||
|
||||
|
||||
53
lib/amb1_sdk/common/api/wifi/wifi_promisc.h
Normal file
53
lib/amb1_sdk/common/api/wifi/wifi_promisc.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef WIFI_PROMISC_H
|
||||
#define WIFI_PROMISC_H
|
||||
|
||||
#include <platform/platform_stdlib.h>
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "wifi/wifi_conf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Promisc mode function declarations
|
||||
void promisc_deinit(void *padapter);
|
||||
int promisc_recv_func(void *padapter, void *rframe);
|
||||
int promisc_recv_lens_func(void *padapter, u8 *payload, u8 plen);
|
||||
int promisc_filter_retransmit_pkt(u8 enable, u8 filter_interval_ms);
|
||||
int promisc_filter_with_len(u16 len);
|
||||
int promisc_set(rtw_rcr_level_t enabled,
|
||||
void (*callback)(unsigned char *, unsigned int, void *),
|
||||
unsigned char len_used);
|
||||
unsigned char is_promisc_enabled(void);
|
||||
int promisc_get_fixed_channel(void *fixed_bssid, u8 *ssid, int *ssid_length);
|
||||
void promisc_filter_by_ap_and_phone_mac(u8 enable, void *ap_mac,
|
||||
void *phone_mac);
|
||||
|
||||
// Packet filter functions
|
||||
#ifdef CONFIG_PROMISC
|
||||
void promisc_init_packet_filter(void);
|
||||
int promisc_add_packet_filter(u8 filter_id, rtw_packet_filter_pattern_t *patt,
|
||||
rtw_packet_filter_rule_t rule);
|
||||
int promisc_enable_packet_filter(u8 filter_id);
|
||||
int promisc_disable_packet_filter(u8 filter_id);
|
||||
int promisc_remove_packet_filter(u8 filter_id);
|
||||
#endif
|
||||
|
||||
// Command function
|
||||
void cmd_promisc(int argc, char **argv);
|
||||
|
||||
// Constants
|
||||
#define MAX_PACKET_FILTER_INFO 5
|
||||
#define FILTER_ID_INIT_VALUE 10
|
||||
|
||||
#ifdef CONFIG_INIC_CMD_RSP
|
||||
// maximum packets for each channel
|
||||
#define MAX_INIC_FRAME_NUM 50
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* WIFI_PROMISC_H */
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "wifi_simple_config.h"
|
||||
#include "wifi_conf.h"
|
||||
#include "wifi_util.h"
|
||||
#include "wifi_promisc.h"
|
||||
|
||||
#if CONFIG_EXAMPLE_UART_ATCMD || CONFIG_EXAMPLE_SPI_ATCMD
|
||||
#include "at_cmd/atcmd_wifi.h"
|
||||
@@ -97,7 +98,7 @@ struct ack_msg {
|
||||
PACK_STRUCT_FIELD(u16_t device_type);
|
||||
PACK_STRUCT_FIELD(u32_t device_ip);
|
||||
PACK_STRUCT_FIELD(u8_t device_name[64]);
|
||||
};PACK_STRUCT_STRUCT;
|
||||
} PACK_STRUCT_STRUCT;
|
||||
PACK_STRUCT_END
|
||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||
#include "arch/epstruct.h"
|
||||
@@ -299,7 +300,7 @@ int SC_send_simple_config_ack(u8 round)
|
||||
}
|
||||
#endif
|
||||
printf("\nSending simple config ack\n");
|
||||
FD_ZERO(&to_addr);
|
||||
memset(&to_addr, 0, sizeof(struct sockaddr_in));
|
||||
to_addr.sin_family = AF_INET;
|
||||
to_addr.sin_port = htons(8864);
|
||||
to_addr.sin_addr.s_addr = (backup_sc_ctx->ip_addr);
|
||||
@@ -1022,19 +1023,19 @@ extern void rtk_sc_deinit(void);
|
||||
|
||||
void init_simple_config_lib_config(struct simple_config_lib_config* config)
|
||||
{
|
||||
config->free = rtw_mfree;
|
||||
config->malloc = rtw_malloc;
|
||||
config->memcmp = _memcmp;
|
||||
config->memcpy = _memcpy;
|
||||
config->memset = _memset;
|
||||
config->free = (simple_config_free_fn)rtw_mfree;
|
||||
config->malloc = (simple_config_malloc_fn)rtw_malloc;
|
||||
config->memcmp = (simple_config_memcmp_fn)_memcmp;
|
||||
config->memcpy = (simple_config_memcpy_fn)_memcpy;
|
||||
config->memset = (simple_config_memset_fn)_memset;
|
||||
config->printf = (simple_config_printf_fn)printf;
|
||||
config->strcpy = _strcpy;
|
||||
config->strlen = _strlen;
|
||||
config->zmalloc = rtw_zmalloc;
|
||||
config->strcpy = (simple_config_strcpy_fn)_strcpy;
|
||||
config->strlen = (simple_config_strlen_fn)_strlen;
|
||||
config->zmalloc = (simple_config_zmalloc_fn)rtw_zmalloc;
|
||||
#if CONFIG_LWIP_LAYER
|
||||
config->_ntohl = lwip_ntohl;
|
||||
config->_ntohl = (simple_config_ntohl_fn)lwip_ntohl;
|
||||
#else
|
||||
config->_ntohl = _ntohl;
|
||||
config->_ntohl = (simple_config_ntohl_fn)_ntohl;
|
||||
#endif
|
||||
config->is_promisc_callback_unlock = &is_promisc_callback_unlock;
|
||||
}
|
||||
@@ -1342,6 +1343,8 @@ static void init_promisc_scan_channel(unsigned char softAP_ch)
|
||||
return;
|
||||
}
|
||||
|
||||
extern void dhcps_deinit(void);
|
||||
extern void dhcps_init(struct netif * pnetif);
|
||||
static int SimpleConfig_softAP_start(const char* ap_name, const char *ap_password)
|
||||
{
|
||||
int timeout = 20;
|
||||
|
||||
@@ -1400,6 +1400,7 @@ void wext_set_low_power_mode(__u8 enable)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int rltk_get_auto_chl(const char *ifname, unsigned char *channel_set, unsigned char channel_num);
|
||||
int wext_get_auto_chl(const char *ifname, unsigned char *channel_set, unsigned char channel_num)
|
||||
{
|
||||
int ret = -1;
|
||||
@@ -1411,11 +1412,13 @@ int wext_get_auto_chl(const char *ifname, unsigned char *channel_set, unsigned c
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int rltk_set_sta_num(unsigned char ap_sta_num);
|
||||
int wext_set_sta_num(unsigned char ap_sta_num)
|
||||
{
|
||||
return rltk_set_sta_num(ap_sta_num);
|
||||
}
|
||||
|
||||
extern int rltk_del_station(const char *ifname, unsigned char* hwaddr);
|
||||
int wext_del_station(const char *ifname, unsigned char* hwaddr)
|
||||
{
|
||||
return rltk_del_station(ifname, hwaddr);
|
||||
@@ -1506,13 +1509,15 @@ void wext_set_indicate_mgnt(int enable)
|
||||
|
||||
void wext_set_sigstat_fast_enable(int enable)
|
||||
{
|
||||
rtw_set_sigstat_fast_enable(enable);
|
||||
// TODO: doesn't exist in lib_wlan
|
||||
// rtw_set_sigstat_fast_enable(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
void wext_set_lowrssi_use_b(int enable,int rssi)
|
||||
{
|
||||
rtw_set_lowrssi_use_b(enable,rssi);
|
||||
// TODO: doesn't exist in lib_wlan
|
||||
// rtw_set_lowrssi_use_b(enable,rssi);
|
||||
return ;
|
||||
}
|
||||
#ifdef CONFIG_AP_MODE
|
||||
@@ -1533,14 +1538,17 @@ void wext_suspend_softap_beacon(const char *ifname)
|
||||
}
|
||||
void wext_resume_softap(const char *ifname)
|
||||
{
|
||||
rltk_resume_softap(ifname);
|
||||
// TODO: doesn't exist in lib_wlan
|
||||
// rltk_resume_softap(ifname);
|
||||
}
|
||||
// extern int rtw_ap_switch_chl_and_inform(unsigned char new_channel);
|
||||
int wext_ap_switch_chl_and_inform(unsigned char new_channel)
|
||||
{
|
||||
if(rtw_ap_switch_chl_and_inform(new_channel))
|
||||
// TODO: doesn't exist in lib_wlan
|
||||
// if(rtw_ap_switch_chl_and_inform(new_channel))
|
||||
return RTW_SUCCESS;
|
||||
else
|
||||
return RTW_ERROR;
|
||||
// else
|
||||
// return RTW_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -84,7 +84,15 @@ int wext_del_custom_ie(const char *ifname);
|
||||
int wext_send_mgnt(const char *ifname, char *buf, __u16 buf_len, __u16 flags);
|
||||
int wext_send_eapol(const char *ifname, char *buf, __u16 buf_len, __u16 flags);
|
||||
int wext_set_gen_ie(const char *ifname, char *buf, __u16 buf_len, __u16 flags);
|
||||
int wext_get_drv_ability(const char *ifname, __u32 *ability);
|
||||
int wext_enable_forwarding(const char *ifname);
|
||||
int wext_disable_forwarding(const char *ifname);
|
||||
int wext_set_ch_deauth(const char *ifname, __u8 enable);
|
||||
void wext_set_sigstat_fast_enable(int enable);
|
||||
void wext_stop_softap(const char *ifname);
|
||||
void wext_suspend_softap(const char *ifname);
|
||||
void wext_suspend_softap_beacon(const char *ifname);
|
||||
void wext_resume_softap(const char *ifname);
|
||||
int wext_ap_switch_chl_and_inform(unsigned char new_channel);
|
||||
int wext_get_nhm_ratio_level(const char *ifname, __u32 *level);
|
||||
int wext_get_retry_drop_num(const char *ifname, rtw_fw_retry_drop_t * retry);
|
||||
@@ -107,6 +115,9 @@ __u8 wext_get_adaptivity_enable(const char *ifname);
|
||||
int wext_set_adaptivity_mode(const char *ifname, __u8 mode);
|
||||
__u8 wext_get_adaptivity_mode(const char *ifname);
|
||||
__u8 wext_get_channel_plan(const char *ifname);
|
||||
|
||||
int wext_get_bcn_rssi(const char *ifname, int *rssi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -259,7 +259,7 @@ void ethernet_mii_init()
|
||||
|
||||
}
|
||||
|
||||
|
||||
// why tho
|
||||
void rltk_mii_recv(struct eth_drv_sg *sg_list, int sg_len){
|
||||
struct eth_drv_sg *last_sg;
|
||||
u8* pbuf = RX_BUFFER;
|
||||
@@ -272,7 +272,7 @@ void rltk_mii_recv(struct eth_drv_sg *sg_list, int sg_len){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// also why
|
||||
s8 rltk_mii_send(struct eth_drv_sg *sg_list, int sg_len, int total_len){
|
||||
int ret =0;
|
||||
struct eth_drv_sg *last_sg;
|
||||
|
||||
@@ -11,4 +11,7 @@
|
||||
|
||||
typedef void (*link_up_down_callback)(int blinkup);
|
||||
|
||||
s8 rltk_mii_send(struct eth_drv_sg *sg_list, int sg_len, int total_len);
|
||||
void rltk_mii_recv(struct eth_drv_sg *sg_list, int sg_len);
|
||||
|
||||
#endif // __MII_ETHERNETIF_H__
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "platform_opts.h"
|
||||
#include "rtw_opt_crypto_ssl.h"
|
||||
#include "osdep_service.h"
|
||||
#include "ssl_ram_map.h"
|
||||
|
||||
#if CONFIG_USE_MBEDTLS
|
||||
/****************************************************************************************************
|
||||
|
||||
@@ -236,7 +236,7 @@ typedef unsigned char __u8;
|
||||
typedef char __s8;
|
||||
typedef unsigned short __u16;
|
||||
typedef short __s16;
|
||||
typedef unsigned int __u32;
|
||||
typedef unsigned long __u32;
|
||||
typedef int __s32;
|
||||
typedef unsigned long long __u64;
|
||||
typedef long long __i64;
|
||||
|
||||
@@ -41,7 +41,7 @@ struct sk_buff {
|
||||
// Wlan Interface opened for upper layer
|
||||
//----- ------------------------------------------------------------------
|
||||
int rltk_wlan_init(int idx_wlan, rtw_mode_t mode); //return 0: success. -1:fail
|
||||
//void rltk_wlan_deinit(void);
|
||||
void rltk_wlan_deinit(void);
|
||||
void rltk_wlan_deinit_fastly(void);
|
||||
void rltk_wlan_deinit_hardware(void);
|
||||
int rltk_wlan_start(int idx_wlan);
|
||||
@@ -70,7 +70,9 @@ void rltk_wlan_tx_auth(void);
|
||||
* Enum wlan low power mode
|
||||
******************************************************/
|
||||
#if defined(CONFIG_WLAN_LOW_PW)
|
||||
#ifndef BIT
|
||||
#define BIT(x) (1<<(x))
|
||||
#endif
|
||||
typedef enum {
|
||||
PW_MODE_NONE = 0,
|
||||
PW_MODE_1 = BIT(0), // CPU 31.25
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void RTC_ClokSource(u32 Source);
|
||||
|
||||
/** @addtogroup rtc RTC
|
||||
* @ingroup hal
|
||||
* @brief rtc functions
|
||||
@@ -47,10 +49,10 @@ extern "C" {
|
||||
typedef void (*alarm_irq_handler)(void);
|
||||
|
||||
struct alarm_s {
|
||||
uint32_t yday;//which day of the year
|
||||
uint32_t hour;
|
||||
uint32_t min;
|
||||
uint32_t sec;
|
||||
uint32_t sec; /* Seconds */
|
||||
uint32_t min; /* Minutes */
|
||||
uint32_t hour; /* Hours */
|
||||
uint32_t yday; /* Day of year */
|
||||
};
|
||||
|
||||
typedef struct alarm_s alarm_t;
|
||||
@@ -123,6 +125,11 @@ void rtc_disable_alarm(void);
|
||||
///@}
|
||||
#endif //CONFIG_PLATFORM_8711B || CONFIG_PLATFORM_8195BLP || CONFIG_PLATFORM_8721D || CONFIG_PLATFORM_8710C
|
||||
|
||||
/**
|
||||
* @brief Backup RTC time information before system reset
|
||||
*/
|
||||
void rtc_backup_timeinfo(void);
|
||||
|
||||
/*\@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/* mbed Microcontroller Library - CMSIS
|
||||
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
|
||||
*
|
||||
* A generic CMSIS include header, pulling in RTL8195A specifics
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_H
|
||||
#define MBED_CMSIS_H
|
||||
|
||||
#include <platform/platform_stdlib.h>
|
||||
#include <hal_platform.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/* mbed Microcontroller Library - CMSIS
|
||||
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
|
||||
*
|
||||
* A generic CMSIS include header, pulling in RTL8195A specifics
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_H
|
||||
#define MBED_CMSIS_H
|
||||
|
||||
#include <platform/platform_stdlib.h>
|
||||
#include <hal_platform.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -66,8 +66,8 @@ void ADC_ReceiveBuf_ACUT(u32 *pBuf)
|
||||
while (1) {
|
||||
isr = ADC_GetISR();
|
||||
if (isr & (BIT_ADC_FIFO_FULL | BIT_ADC_FIFO_RD_REQ)) {
|
||||
*pBuf = (u32)ADC_Read_RAM();
|
||||
*(pBuf+1)= (u32)ADC_Read_RAM();
|
||||
*pBuf = (u32)ADC_Read();
|
||||
*(pBuf+1)= (u32)ADC_Read();
|
||||
|
||||
ADC_INTClear();
|
||||
ADC_INTConfig(BIT_ADC_FIFO_FULL_EN|BIT_ADC_FIFO_RD_REQ_EN, DISABLE);
|
||||
|
||||
@@ -84,6 +84,8 @@ static u32 EFUSE_OTP_Check(u16 Addr, u8 Data)
|
||||
* @brief Get remaining efuse length
|
||||
* @retval remaining efuse length
|
||||
*/
|
||||
_LONG_CALL_ int EFUSE_RemainLength(void);
|
||||
|
||||
int efuse_get_remaining_length(void)
|
||||
{
|
||||
return EFUSE_RemainLength();
|
||||
@@ -293,6 +295,21 @@ void efuse_rdp_keyset(u8 *rdp_key)
|
||||
* @param SW_Key: key for encyption
|
||||
* @note none
|
||||
*/
|
||||
_LONG_CALL_ int aes_init(void);
|
||||
|
||||
_LONG_CALL_ int aes_encrypt_key(
|
||||
const unsigned char *key,
|
||||
const int key_len,
|
||||
aes_encrypt_ctx *ctx
|
||||
);
|
||||
|
||||
_LONG_CALL_ int aes_ecb_encrypt(
|
||||
const unsigned char *in,
|
||||
unsigned char *out,
|
||||
int length,
|
||||
aes_encrypt_ctx *ctx
|
||||
);
|
||||
|
||||
void efuse_rdp_check_image_encrypt(u8* SW_Key)
|
||||
{
|
||||
|
||||
@@ -301,7 +318,7 @@ void efuse_rdp_check_image_encrypt(u8* SW_Key)
|
||||
u8 * pByte;
|
||||
|
||||
pByte = (u8 *)&rdp_bin_checksum;
|
||||
memset(&enc_ctx, 0, sizeof(enc_ctx));
|
||||
_memset(&enc_ctx, 0, sizeof(enc_ctx));
|
||||
|
||||
/*calculate checksum using plaintext*/
|
||||
for(i=0; i<4; i++) {
|
||||
@@ -488,7 +505,7 @@ void efuse_otf_keyset(u8 *otf_key)
|
||||
IMAGE2_RAM_TEXT_SECTION
|
||||
void efuse_otf_check(uint32_t origin_data)
|
||||
{
|
||||
extern char set_key[40];
|
||||
char set_key[40];
|
||||
FLASH_Write_Lock();
|
||||
uint32_t data = 0;
|
||||
u8 otf_iv[16]={0x21, 0x32, 0x53, 0x64, 0x75, 0x86, 0xa7, 0xb8,
|
||||
|
||||
@@ -46,7 +46,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
|
||||
GPIO_InitStruct.GPIO_ITTrigger = GPIO_INT_Trigger_EDGE;
|
||||
GPIO_InitStruct.GPIO_ITPolarity = GPIO_INT_POLARITY_ACTIVE_LOW;
|
||||
|
||||
InterruptRegister(GPIO_INTHandler, GPIO_IRQ, NULL, 10);
|
||||
InterruptRegister(GPIO_INTHandler, GPIO_IRQ, 0, 10);
|
||||
InterruptEn(GPIO_IRQ, 10);
|
||||
|
||||
GPIO_Init(&GPIO_InitStruct);
|
||||
|
||||
@@ -99,7 +99,7 @@ void i2s_init(i2s_t *obj, PinName sck, PinName ws, PinName sd_tx, PinName sd_rx,
|
||||
I2S_StructInit(&I2SInitStruct);
|
||||
|
||||
/*I2S Interrupt Initialization*/
|
||||
InterruptRegister((IRQ_FUN) i2s_isr, I2S0_PCM0_IRQ, NULL, 3);
|
||||
InterruptRegister((IRQ_FUN) i2s_isr, I2S0_PCM0_IRQ, 0, 3);
|
||||
InterruptEn(I2S0_PCM0_IRQ, 3);
|
||||
|
||||
/* enable system pll */
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
|
||||
#include "rtc_api.h"
|
||||
|
||||
#include <time.h>
|
||||
#include "timer_api.h"
|
||||
|
||||
static struct tm rtc_timeinfo;
|
||||
static int rtc_en = 0;
|
||||
static alarm_irq_handler rtc_alarm_handler;
|
||||
@@ -158,6 +155,7 @@ void rtc_backup_timeinfo(void)
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
|
||||
void rtc_init(void)
|
||||
{
|
||||
RTC_InitTypeDef RTC_InitStruct;
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
#include "wait_api.h"
|
||||
#include "us_ticker_api.h"
|
||||
#include "basic_types.h"
|
||||
|
||||
_LONG_CALL_ void DelayUs(u32 us);
|
||||
|
||||
void wait(float s)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#ifndef __CPU_H__
|
||||
#define __CPU_H__
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif /* __CPU_H__ */
|
||||
|
||||
@@ -163,6 +163,9 @@ static err_t low_level_output(struct netif *netif, struct pbuf *p)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
extern s8 rltk_mii_send(struct eth_drv_sg *sg_list, int sg_len, int total_len);
|
||||
extern void rltk_mii_recv(struct eth_drv_sg *sg_list, int sg_len);
|
||||
|
||||
/*for ethernet mii interface*/
|
||||
static err_t low_level_output_mii(struct netif *netif, struct pbuf *p)
|
||||
{
|
||||
@@ -311,27 +314,27 @@ err_t ethernetif_init(struct netif *netif)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_t ethernetif_mii_init(struct netif *netif)
|
||||
{
|
||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||
// err_t ethernetif_mii_init(struct netif *netif)
|
||||
// {
|
||||
// LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
netif->hostname = "lwip2";
|
||||
#endif /* LWIP_NETIF_HOSTNAME */
|
||||
// #if LWIP_NETIF_HOSTNAME
|
||||
// netif->hostname = "lwip2";
|
||||
// #endif /* LWIP_NETIF_HOSTNAME */
|
||||
|
||||
netif->output = etharp_output;
|
||||
//#if LWIP_IPV6
|
||||
// netif->output_ip6 = ethip6_output;
|
||||
//#endif
|
||||
netif->linkoutput = low_level_output_mii;
|
||||
// netif->output = etharp_output;
|
||||
// //#if LWIP_IPV6
|
||||
// // netif->output_ip6 = ethip6_output;
|
||||
// //#endif
|
||||
// netif->linkoutput = low_level_output_mii;
|
||||
|
||||
/* initialize the hardware */
|
||||
low_level_init(netif);
|
||||
// /* initialize the hardware */
|
||||
// low_level_init(netif);
|
||||
|
||||
etharp_init();
|
||||
// etharp_init();
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
// return ERR_OK;
|
||||
// }
|
||||
|
||||
static void arp_timer(void *arg)
|
||||
{
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/autoip.h"
|
||||
#include "lwip/dns.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "netif/etharp.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -92,6 +92,7 @@ err_t igmp_start(struct netif *netif);
|
||||
err_t igmp_stop(struct netif *netif);
|
||||
void igmp_report_groups(struct netif *netif);
|
||||
struct igmp_group *igmp_lookfor_group(struct netif *ifp, ip_addr_t *addr);
|
||||
void igmp_report_groups_leave(struct netif *netif);
|
||||
void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest);
|
||||
err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
|
||||
err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr);
|
||||
|
||||
@@ -121,6 +121,7 @@ err_t dhcp_start(struct netif *netif);
|
||||
err_t dhcp_renew(struct netif *netif);
|
||||
/** release the DHCP lease, usually called before dhcp_stop()*/
|
||||
err_t dhcp_release(struct netif *netif);
|
||||
err_t dhcp_release_unicast(struct netif *netif); //Realtek add
|
||||
/** stop DHCP configuration */
|
||||
void dhcp_stop(struct netif *netif);
|
||||
/** inform server of our manual IP address */
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
// lmao, importing hal_crypto imports the entire fwlib bloat
|
||||
// and conflicts with the variable names
|
||||
#include "rtl8711b_crypto.h"
|
||||
#include "rtl8710b_crypto_api.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined strcasecmp && !defined(EFIX64) && \
|
||||
!defined(EFI32)
|
||||
|
||||
@@ -1,57 +1,47 @@
|
||||
#include "rom_ssl_ram_map.h"
|
||||
#include <diag.h>
|
||||
#include "ssl_ram_map.h"
|
||||
|
||||
extern struct _rom_ssl_ram_map rom_ssl_ram_map;
|
||||
|
||||
//AES HW CRYPTO
|
||||
extern int rtl_crypto_aes_ecb_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_aes_ecb_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
// AES HW CRYPTO
|
||||
int rtl_crypto_aes_ecb_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_aes_ecb_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_aes_ecb_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
int rtl_crypto_aes_ecb_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_aes_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_aes_cbc_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
int rtl_crypto_aes_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_aes_cbc_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_aes_cbc_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
int rtl_crypto_aes_cbc_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
|
||||
//DES HW CRYPTO
|
||||
extern int rtl_crypto_des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_des_cbc_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
// DES HW CRYPTO
|
||||
int rtl_crypto_des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_des_cbc_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_des_cbc_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
int rtl_crypto_des_cbc_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_3des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_3des_cbc_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
int rtl_crypto_3des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_3des_cbc_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_3des_cbc_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
int rtl_crypto_3des_cbc_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
|
||||
int platform_set_malloc_free( void * (*malloc_func)( size_t ),
|
||||
void (*free_func)( void * ) )
|
||||
{
|
||||
int platform_set_malloc_free(void* (*malloc_func)(size_t),
|
||||
void (*free_func)(void*)) {
|
||||
/* OS interface */
|
||||
rom_ssl_ram_map.ssl_malloc = malloc_func;
|
||||
rom_ssl_ram_map.ssl_free = free_func;
|
||||
rom_ssl_ram_map.ssl_printf = (int (*)(char const *, ...))DiagPrintf;
|
||||
rom_ssl_ram_map.ssl_printf = (int (*)(char const*, ...))DiagPrintf;
|
||||
|
||||
//AES HW CRYPTO
|
||||
// AES HW CRYPTO
|
||||
rom_ssl_ram_map.hw_crypto_aes_ecb_init = rtl_crypto_aes_ecb_init;
|
||||
rom_ssl_ram_map.hw_crypto_aes_ecb_decrypt = rtl_crypto_aes_ecb_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_aes_ecb_encrypt = rtl_crypto_aes_ecb_encrypt;
|
||||
@@ -59,7 +49,7 @@ int platform_set_malloc_free( void * (*malloc_func)( size_t ),
|
||||
rom_ssl_ram_map.hw_crypto_aes_cbc_decrypt = rtl_crypto_aes_cbc_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_aes_cbc_encrypt = rtl_crypto_aes_cbc_encrypt;
|
||||
|
||||
//DES HW CRYPTO
|
||||
// DES HW CRYPTO
|
||||
rom_ssl_ram_map.hw_crypto_des_cbc_init = rtl_crypto_des_cbc_init;
|
||||
rom_ssl_ram_map.hw_crypto_des_cbc_decrypt = rtl_crypto_des_cbc_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_des_cbc_encrypt = rtl_crypto_des_cbc_encrypt;
|
||||
|
||||
52
lib/amb1_sdk/common/network/ssl/ssl_ram_map/ssl_ram_map.h
Normal file
52
lib/amb1_sdk/common/network/ssl/ssl_ram_map/ssl_ram_map.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef SSL_RAM_MAP_H
|
||||
#define SSL_RAM_MAP_H
|
||||
|
||||
#include <diag.h>
|
||||
|
||||
#include "rom_ssl_ram_map.h"
|
||||
|
||||
/* Function declarations */
|
||||
|
||||
/**
|
||||
* @brief Sets up malloc, free and other platform-specific functions for SSL
|
||||
* operations
|
||||
* @param malloc_func Function pointer to memory allocation function
|
||||
* @param free_func Function pointer to memory deallocation function
|
||||
* @return 0 on success
|
||||
*/
|
||||
int platform_set_malloc_free(void* (*malloc_func)(size_t),
|
||||
void (*free_func)(void*));
|
||||
|
||||
/* AES Hardware Crypto Function Declarations */
|
||||
int rtl_crypto_aes_ecb_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_aes_ecb_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
int rtl_crypto_aes_ecb_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
int rtl_crypto_aes_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_aes_cbc_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
int rtl_crypto_aes_cbc_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
|
||||
/* DES Hardware Crypto Function Declarations */
|
||||
int rtl_crypto_des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_des_cbc_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
int rtl_crypto_des_cbc_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
int rtl_crypto_3des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
int rtl_crypto_3des_cbc_decrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
int rtl_crypto_3des_cbc_encrypt(IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
|
||||
#endif /* SSL_RAM_MAP_H */
|
||||
@@ -36,7 +36,7 @@ static const char *ep;
|
||||
|
||||
const char *cJSON_GetErrorPtr(void) {return ep;}
|
||||
|
||||
#define sprintf rtl_sprintf
|
||||
// #define sprintf rtl_sprintf
|
||||
|
||||
static int cJSON_strcasecmp(const char *s1,const char *s2)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "task.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <osdep_service.h>
|
||||
|
||||
#include "platform_opts.h"
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
#include "timers.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
#include "rtl8710b.h"
|
||||
// #include "core_cm4.h"
|
||||
|
||||
|
||||
#define FREERTOS_VERSION 0x00080001 // bits[31:16] main version, bits[15:0] sub-version
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
#include <stdio.h>
|
||||
#include <freertos_pmu.h>
|
||||
//#include <tcm_heap.h>
|
||||
#include "rtl8710b.h"
|
||||
#include "rtl8710b_freertos_pmu.h"
|
||||
/********************* os depended utilities ********************/
|
||||
|
||||
extern int rtw_if_wifi_thread(const char *name);
|
||||
|
||||
#ifndef USE_MUTEX_FOR_SPINLOCK
|
||||
#define USE_MUTEX_FOR_SPINLOCK 1
|
||||
#endif
|
||||
@@ -534,7 +538,7 @@ static int _freertos_arc4random(void)
|
||||
return (int)seed;
|
||||
}
|
||||
|
||||
static int _freertos_get_random_bytes(void *buf, size_t len)
|
||||
static int _freertos_get_random_bytes(void *buf, u32 len)
|
||||
{
|
||||
#if 1 //becuase of 4-byte align, we use the follow code style.
|
||||
unsigned int ranbuf;
|
||||
@@ -620,7 +624,7 @@ static int _freertos_create_task(struct task_struct *ptask, const char *name,
|
||||
stack_size,
|
||||
task_ctx,
|
||||
priority,
|
||||
&ptask->task);
|
||||
(TaskHandle_t*)&ptask->task);
|
||||
#endif
|
||||
}
|
||||
else{
|
||||
@@ -630,7 +634,7 @@ static int _freertos_create_task(struct task_struct *ptask, const char *name,
|
||||
stack_size,
|
||||
task_ctx,
|
||||
priority,
|
||||
&ptask->task);
|
||||
(TaskHandle_t*)&ptask->task);
|
||||
|
||||
}
|
||||
if(ret != pdPASS){
|
||||
@@ -687,7 +691,7 @@ _timerHandle _freertos_timerCreate( const signed char *pcTimerName,
|
||||
if(xTimerPeriodInTicks == TIMER_MAX_DELAY) {
|
||||
xTimerPeriodInTicks = portMAX_DELAY;
|
||||
}
|
||||
return xTimerCreate((const char *)pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction);
|
||||
return xTimerCreate((const char *)pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, (TimerCallbackFunction_t)pxCallbackFunction);
|
||||
}
|
||||
|
||||
u32 _freertos_timerDelete( _timerHandle xTimer,
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* This module is a confidential and proprietary property of RealTek and
|
||||
* possession or use of this module requires written permission of RealTek.
|
||||
*/
|
||||
#include "basic_types.h"
|
||||
|
||||
u32
|
||||
Rand (
|
||||
extern _LONG_CALL_ u32 Rand (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include <device_lock.h>
|
||||
#include "rtl8710b_ota.h"
|
||||
#include "lwip/netdb.h"
|
||||
#include "rtc_api.h"
|
||||
|
||||
#define OTA2_DEFAULT_ADDR (0x08080000)
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* This module is a confidential and proprietary property of RealTek and
|
||||
* possession or use of this module requires written permission of RealTek.
|
||||
*/
|
||||
#include "basic_types.h"
|
||||
|
||||
u32
|
||||
Rand (
|
||||
extern _LONG_CALL_ u32 Rand (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ static inline int isodigit(const char c)
|
||||
return c >= '0' && c <= '7';
|
||||
}
|
||||
#ifndef strtoul
|
||||
#define strtoul(str, endp, base) Strtoul(str, endp, base)
|
||||
#define strtoul(str, endp, base) simple_strtoul(str, endp, base)
|
||||
#endif
|
||||
#ifndef strtol
|
||||
#define strtol(str, endp, base) simple_strtol(str, endp, base)
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
# Toolchain configuration
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
TARGET := application
|
||||
|
||||
BUILD_DIR := build
|
||||
BIN_DIR := $(BUILD_DIR)/bin
|
||||
DEP_DIR := $(BUILD_DIR)/dep
|
||||
|
||||
# SDK Paths
|
||||
# -------------------------------------------------------------------
|
||||
SDK_ROOT := lib/amb1_sdk
|
||||
SOC_PATH := $(SDK_ROOT)/soc/realtek/8711b
|
||||
# Define tool directories
|
||||
AMEBA_TOOLS := $(SOC_PATH)/misc/iar_utility/common/tools
|
||||
FLASH_TOOLS := $(SDK_ROOT)/soc/realtek/8195a/misc/gcc_utility
|
||||
FLASH_DOWNLOAD := $(SOC_PATH)/misc/gnu_utility/flash_download/image
|
||||
DEBUG_TOOLS := $(SOC_PATH)/misc/gcc_utility
|
||||
|
||||
# Build Tools
|
||||
# -------------------------------------------------------------------
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
AR := $(CROSS_COMPILE)ar
|
||||
AS := $(CROSS_COMPILE)as
|
||||
NM := $(CROSS_COMPILE)nm
|
||||
LD := $(CROSS_COMPILE)gcc
|
||||
GDB := $(CROSS_COMPILE)gdb
|
||||
OBJCOPY := $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP := $(CROSS_COMPILE)objdump
|
||||
PYTHON ?= python tools/
|
||||
|
||||
# OS-Specific Tool Selection
|
||||
# -------------------------------------------------------------------
|
||||
OS := $(shell uname)
|
||||
ifeq ($(findstring CYGWIN, $(OS)), CYGWIN)
|
||||
EXT := .exe
|
||||
else
|
||||
EXT :=
|
||||
endif
|
||||
|
||||
PICK := $(AMEBA_TOOLS)/pick$(EXT)
|
||||
PAD := $(AMEBA_TOOLS)/padding$(EXT)
|
||||
CHKSUM := $(AMEBA_TOOLS)/checksum$(EXT)
|
||||
OTA := $(AMEBA_TOOLS)/ota$(EXT)
|
||||
|
||||
# OTA Configuration and Image Names
|
||||
# -------------------------------------------------------------------
|
||||
OTA_IDX ?= 1
|
||||
ifeq ($(OTA_IDX),1)
|
||||
LINKER_SCRIPT := rlx8711B-symbol-v02-img2_xip1.ld
|
||||
IMAGE2_OTA := image2_all_ota1.bin
|
||||
else ifeq ($(OTA_IDX),2)
|
||||
LINKER_SCRIPT := rlx8711B-symbol-v02-img2_xip2.ld
|
||||
IMAGE2_OTA := image2_all_ota2.bin
|
||||
else
|
||||
$(error OTA_IDX must be 1 or 2)
|
||||
endif
|
||||
|
||||
|
||||
# Image configuration based on build type
|
||||
# -------------------------------------------------------------------
|
||||
ifeq ($(MAKECMDGOALS),mp)
|
||||
RAMALL_BIN := ram_all_mp.bin
|
||||
OTA_BIN := ota_mp.bin
|
||||
IMAGE2_OTA1 := image2_all_ota1_mp.bin
|
||||
IMAGE2_OTA2 := image2_all_ota2_mp.bin
|
||||
OTA_ALL := ota_all_mp.bin
|
||||
else
|
||||
RAMALL_BIN := ram_all.bin
|
||||
OTA_BIN := ota.bin
|
||||
IMAGE2_OTA1 := image2_all_ota1.bin
|
||||
IMAGE2_OTA2 := image2_all_ota2.bin
|
||||
OTA_ALL := ota_all.bin
|
||||
endif
|
||||
|
||||
# Include other makefiles
|
||||
# -------------------------------------------------------------------
|
||||
include $(MKFILES)/includes.mk
|
||||
include $(MKFILES)/sources.mk
|
||||
|
||||
# Build Configuration
|
||||
# -------------------------------------------------------------------
|
||||
CFLAGS := \
|
||||
-DM3 -DCONFIG_PLATFORM_8711B \
|
||||
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
|
||||
-g2 -w -O2 -fno-common -fmessage-length=0 \
|
||||
-ffunction-sections -fdata-sections -fomit-frame-pointer \
|
||||
-fno-short-enums -DF_CPU=166000000L -std=gnu99 -fsigned-char \
|
||||
-Wno-pointer-sign -Wno-implicit-function-declaration \
|
||||
-Wno-incompatible-pointer-types -Wno-int-conversion
|
||||
|
||||
LFLAGS := \
|
||||
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
|
||||
-g --specs=nano.specs -nostartfiles \
|
||||
-Wl,-Map=$(BIN_DIR)/application.map -Os -Wl,--gc-sections \
|
||||
-Wl,--cref -Wl,--entry=Reset_Handler \
|
||||
-Wl,--no-enum-size-warning -Wl,--no-wchar-size-warning \
|
||||
-Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc -Wl,--wrap=rom_psk_CalcGTK \
|
||||
-Wl,--wrap=rom_psk_CalcPTK -Wl,--wrap=CalcMIC -Wl,--wrap=CheckMIC \
|
||||
-Wl,--wrap=aes_80211_encrypt -Wl,--wrap=aes_80211_decrypt -Wl,--wrap=DecGTK
|
||||
|
||||
# Library configuration
|
||||
# -------------------------------------------------------------------
|
||||
LIB_DIR := $(SOC_PATH)/misc/bsp/lib/common/GCC
|
||||
|
||||
# Platform-specific libraries (with underscore)
|
||||
PLATFORM_LIBS := platform wlan eap http wps p2p rtlstd
|
||||
MP_PLATFORM_LIBS := platform wlan_mp eap wps p2p rtlstd
|
||||
|
||||
# System libraries (without underscore)
|
||||
SYS_LIBS := m c nosys gcc
|
||||
|
||||
# Combined library flags
|
||||
LIBFLAGS := -L$(LIB_DIR) $(addprefix -l_,$(PLATFORM_LIBS)) $(addprefix -l,$(SYS_LIBS))
|
||||
MP_LIBFLAGS := -L$(LIB_DIR) $(addprefix -l_,$(MP_PLATFORM_LIBS)) $(addprefix -l,$(SYS_LIBS))
|
||||
|
||||
# Object files
|
||||
# -------------------------------------------------------------------
|
||||
SRC_O := $(patsubst %.c,$(BUILD_DIR)/%.o,$(SRC_C))
|
||||
DRAM_O := $(patsubst %.c,$(BUILD_DIR)/%.o,$(DRAM_C))
|
||||
DEPENDENCY_LIST := $(patsubst %.c,$(BUILD_DIR)/%.d,$(SRC_C) $(DRAM_C))
|
||||
|
||||
VPATH := $(sort $(dir $(SRC_C)) $(dir $(DRAM_C)))
|
||||
|
||||
# Main targets
|
||||
# -------------------------------------------------------------------
|
||||
.PHONY: all mp clean directories application manipulate_images build_info prerequirement
|
||||
|
||||
all mp: directories application manipulate_images
|
||||
|
||||
directories:
|
||||
@mkdir -p $(BIN_DIR) $(DEP_DIR) $(dir $(SRC_O) $(DRAM_O))
|
||||
|
||||
# Compilation rules
|
||||
# -------------------------------------------------------------------
|
||||
$(filter $(BUILD_DIR)/%,$(SRC_O)): $(BUILD_DIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -MM -MT $@ -MF $(patsubst %.o,%.d,$@)
|
||||
|
||||
$(filter $(BUILD_DIR)/%,$(DRAM_O)): $(BUILD_DIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
$(OBJCOPY) --prefix-alloc-sections .sdram $@
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -MM -MT $@ -MF $(patsubst %.o,%.d,$@)
|
||||
|
||||
# Build Info Generation
|
||||
# -------------------------------------------------------------------
|
||||
.PHONY: build_info
|
||||
build_info:
|
||||
@echo "Generating build information..."
|
||||
@( \
|
||||
echo '#define RTL_FW_COMPILE_TIME "'`date +%Y/%m/%d-%T`'"'; \
|
||||
echo '#define RTL_FW_COMPILE_DATE "'`date +%Y%m%d`'"'; \
|
||||
echo '#define UTS_VERSION "'`date +%Y/%m/%d-%T`'"'; \
|
||||
echo '#define RTL8195AFW_COMPILE_TIME "'`date +%Y/%m/%d-%T`'"'; \
|
||||
echo '#define RTL8195AFW_COMPILE_DATE "'`date +%Y%m%d`'"'; \
|
||||
echo '#define RTL8195AFW_COMPILE_BY "'`id -u -n`'"'; \
|
||||
echo '#define RTL8195AFW_COMPILE_HOST "'`$(HOSTNAME_APP)`'"'; \
|
||||
if [ -x /bin/dnsdomainname ]; then \
|
||||
echo '#define RTL8195AFW_COMPILE_DOMAIN "'`dnsdomainname`'"'; \
|
||||
elif [ -x /bin/domainname ]; then \
|
||||
echo '#define RTL8195AFW_COMPILE_DOMAIN "'`domainname`'"'; \
|
||||
else \
|
||||
echo '#define RTL8195AFW_COMPILE_DOMAIN ""'; \
|
||||
fi; \
|
||||
echo '#define RTL195AFW_COMPILER "gcc '`$(CC) $(CFLAGS) -dumpversion | tr --delete '\r'`'"'; \
|
||||
) > include/build_info.h
|
||||
|
||||
# Image Manipulation
|
||||
# -------------------------------------------------------------------
|
||||
.PHONY: manipulate_images
|
||||
manipulate_images:
|
||||
@echo "=== Image Manipulation ==="
|
||||
|
||||
# Generate symbol maps
|
||||
$(NM) $(BIN_DIR)/$(TARGET).axf | sort > $(BIN_DIR)/$(TARGET).nmap
|
||||
|
||||
# Extract sections
|
||||
$(OBJCOPY) -j .ram_image2.entry -j .ram_image2.data -j .ram_image2.text -j .ram_image2.bss -j .ram_image2.skb.bss -j .ram_heap.data -Obinary $(BIN_DIR)/$(TARGET).axf $(BIN_DIR)/ram_2.r.bin
|
||||
$(OBJCOPY) -j .xip_image2.text -Obinary $(BIN_DIR)/$(TARGET).axf $(BIN_DIR)/xip_image2.bin
|
||||
$(OBJCOPY) -j .ram_rdp.text -Obinary $(BIN_DIR)/$(TARGET).axf $(BIN_DIR)/rdp.bin
|
||||
|
||||
# Prepare boot image
|
||||
cp $(SOC_PATH)/misc/bsp/image/boot_all.bin $(BIN_DIR)/boot_all.bin
|
||||
chmod 777 $(BIN_DIR)/boot_all.bin
|
||||
chmod +rx $(PICK) $(CHKSUM) $(PAD) $(OTA)
|
||||
|
||||
# Process memory images
|
||||
$(PICK) 0x`grep __ram_image2_text_start__ $(BIN_DIR)/$(TARGET).nmap | gawk '{print $$1}'` 0x`grep __ram_image2_text_end__ $(BIN_DIR)/$(TARGET).nmap | gawk '{print $$1}'` $(BIN_DIR)/ram_2.r.bin $(BIN_DIR)/ram_2.bin raw
|
||||
$(PICK) 0x`grep __ram_image2_text_start__ $(BIN_DIR)/$(TARGET).nmap | gawk '{print $$1}'` 0x`grep __ram_image2_text_end__ $(BIN_DIR)/$(TARGET).nmap | gawk '{print $$1}'` $(BIN_DIR)/ram_2.bin $(BIN_DIR)/ram_2.p.bin
|
||||
$(PICK) 0x`grep __xip_image2_start__ $(BIN_DIR)/$(TARGET).nmap | gawk '{print $$1}'` 0x`grep __xip_image2_start__ $(BIN_DIR)/$(TARGET).nmap | gawk '{print $$1}'` $(BIN_DIR)/xip_image2.bin $(BIN_DIR)/xip_image2.p.bin
|
||||
|
||||
# Generate OTA images
|
||||
ifeq ("${OTA_IDX}", "1")
|
||||
cat $(BIN_DIR)/xip_image2.p.bin > $(BIN_DIR)/$(IMAGE2_OTA1)
|
||||
chmod 777 $(BIN_DIR)/$(IMAGE2_OTA1)
|
||||
cat $(BIN_DIR)/ram_2.p.bin >> $(BIN_DIR)/$(IMAGE2_OTA1)
|
||||
$(CHKSUM) $(BIN_DIR)/$(IMAGE2_OTA1) || true
|
||||
#rm $(BIN_DIR)/xip_image2.p.bin $(BIN_DIR)/ram_2.p.bin
|
||||
else ifeq ("${OTA_IDX}", "2")
|
||||
cat $(BIN_DIR)/xip_image2.p.bin > $(BIN_DIR)/$(IMAGE2_OTA2)
|
||||
chmod 777 $(BIN_DIR)/$(IMAGE2_OTA2)
|
||||
cat $(BIN_DIR)/ram_2.p.bin >> $(BIN_DIR)/$(IMAGE2_OTA2)
|
||||
$(CHKSUM) $(BIN_DIR)/$(IMAGE2_OTA2) || true
|
||||
$(OTA) $(BIN_DIR)/$(IMAGE2_OTA1) 0x800B000 $(BIN_DIR)/$(IMAGE2_OTA2) 0x08080000 0x20170111 $(BIN_DIR)/$(OTA_ALL)
|
||||
endif
|
||||
|
||||
# Prerequisite setup
|
||||
# -------------------------------------------------------------------
|
||||
.PHONY: prerequirement
|
||||
prerequirement:
|
||||
@echo "=== Setting up prerequisites for $(TARGET) ==="
|
||||
@mkdir -p $(BUILD_DIR)/boot $(BIN_DIR)
|
||||
cp $(SOC_PATH)/misc/bsp/image/boot_all.bin $(BUILD_DIR)/boot/boot_all.bin
|
||||
chmod 777 $(BUILD_DIR)/boot/boot_all.bin
|
||||
$(OBJCOPY) -I binary -O elf32-littlearm -B arm \
|
||||
$(BUILD_DIR)/boot/boot_all.bin $(BUILD_DIR)/boot/boot_all.o
|
||||
|
||||
# Main build target
|
||||
# -------------------------------------------------------------------
|
||||
application: prerequirement build_info $(SRC_O) $(DRAM_O)
|
||||
$(LD) $(LFLAGS) -o $(BIN_DIR)/$(TARGET).axf $(SRC_O) $(DRAM_O) \
|
||||
$(BUILD_DIR)/boot/boot_all.o $(LIBFLAGS) -T./$(LINKER_SCRIPT)
|
||||
$(OBJDUMP) -d $(BIN_DIR)/$(TARGET).axf > $(BIN_DIR)/$(TARGET).asm
|
||||
|
||||
# Include generated dependencies
|
||||
-include $(DEPENDENCY_LIST)
|
||||
|
||||
# Clean target
|
||||
# -------------------------------------------------------------------
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
@@ -32,25 +32,27 @@ include $(MKFILES)/sources.mk
|
||||
|
||||
# compiler flags
|
||||
COMMON_FLAGS := \
|
||||
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
|
||||
-Os -g2 -w
|
||||
-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
|
||||
-Os
|
||||
|
||||
CFLAGS := $(COMMON_FLAGS) \
|
||||
-DM4 -DCONFIG_PLATFORM_8711B \
|
||||
-ffunction-sections -fdata-sections -fomit-frame-pointer \
|
||||
-fno-common -fno-short-enums -std=gnu99 -fsigned-char \
|
||||
-Wno-pointer-sign -Wno-implicit-function-declaration \
|
||||
-Wno-incompatible-pointer-types -Wno-int-conversion
|
||||
-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables \
|
||||
-fno-builtin -fno-short-enums \
|
||||
-std=gnu99 \
|
||||
|
||||
LFLAGS := $(COMMON_FLAGS) \
|
||||
--specs=nano.specs -nostartfiles \
|
||||
-Wl,--gc-sections -Wl,--entry=Reset_Handler \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,--entry=Reset_Handler \
|
||||
-Wl,--no-enum-size-warning -Wl,--no-wchar-size-warning \
|
||||
-Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc \
|
||||
-Wl,--wrap=rom_psk_CalcGTK -Wl,--wrap=rom_psk_CalcPTK \
|
||||
-Wl,--wrap=CalcMIC -Wl,--wrap=CheckMIC \
|
||||
-Wl,--wrap=aes_80211_encrypt -Wl,--wrap=aes_80211_decrypt \
|
||||
-Wl,--wrap=DecGTK
|
||||
-Wl,--wrap=DecGTK \
|
||||
-Wl,--print-memory-usage
|
||||
|
||||
# libs
|
||||
LIB_DIR := $(SOC_PATH)/misc/bsp/lib/common/GCC
|
||||
|
||||
@@ -47,6 +47,7 @@ INCLUDES += -Ilib/amb1_sdk/common/network/lwip/lwip_v1.4.1/port/realtek/freertos
|
||||
# SSL includes
|
||||
INCLUDES += -Ilib/amb1_sdk/common/network/ssl/polarssl-1.3.8/include
|
||||
INCLUDES += -Ilib/amb1_sdk/common/network/ssl/mbedtls-2.4.0/include
|
||||
INCLUDES += -Ilib/amb1_sdk/common/network/ssl/ssl_ram_map/
|
||||
INCLUDES += -Ilib/amb1_sdk/common/network/ssl/ssl_ram_map/rom
|
||||
|
||||
# Driver includes
|
||||
@@ -76,7 +77,7 @@ INCLUDES += -Ilib/amb1_sdk/common/mbed/targets/hal/rtl8711b
|
||||
|
||||
# Application and utility includes
|
||||
INCLUDES += -Ilib/amb1_sdk/common/api
|
||||
INCLUDES += -Ilib/amb1_sdk/common/api/at_cmd
|
||||
# INCLUDES += -Ilib/amb1_sdk/common/api/at_cmd
|
||||
INCLUDES += -Ilib/amb1_sdk/common/api/platform
|
||||
INCLUDES += -Ilib/amb1_sdk/common/application
|
||||
INCLUDES += -Ilib/amb1_sdk/common/utilities
|
||||
@@ -90,8 +91,8 @@ INCLUDES += -Ilib/amb1_sdk/common/application/mqtt/MQTTPacket
|
||||
INCLUDES += -Ilib/amb1_sdk/common/application/realmesh/include
|
||||
|
||||
# Example includes
|
||||
INCLUDES += -Ilib/amb1_sdk/common/example
|
||||
INCLUDES += -Ilib/amb1_sdk/common/example/wlan_fast_connect
|
||||
# INCLUDES += -Ilib/amb1_sdk/common/example
|
||||
# INCLUDES += -Ilib/amb1_sdk/common/example/wlan_fast_connect
|
||||
|
||||
# Monitor includes
|
||||
INCLUDES += -Ilib/amb1_sdk/soc/realtek/8711b/app/monitor/include
|
||||
|
||||
@@ -5,8 +5,8 @@ SRC_C =
|
||||
DRAM_C =
|
||||
|
||||
#app uart_adapter
|
||||
SRC_C += lib/amb1_sdk/common/application/uart_adapter/uart_adapter.c
|
||||
SRC_C += lib/amb1_sdk/common/application/xmodem/uart_fw_update.c
|
||||
# SRC_C += lib/amb1_sdk/common/application/uart_adapter/uart_adapter.c
|
||||
# SRC_C += lib/amb1_sdk/common/application/xmodem/uart_fw_update.c
|
||||
|
||||
#cmsis
|
||||
SRC_C += lib/amb1_sdk/soc/realtek/8711b/cmsis/device/app_start.c
|
||||
@@ -14,14 +14,14 @@ SRC_C += lib/amb1_sdk/soc/realtek/8711b/fwlib/ram_lib/startup.c
|
||||
#SRC_C += lib/amb1_sdk/soc/realtek/8711b/cmsis/device/system_8195a.c
|
||||
|
||||
#console
|
||||
SRC_C += lib/amb1_sdk/common/api/at_cmd/atcmd_lwip.c
|
||||
SRC_C += lib/amb1_sdk/common/api/at_cmd/atcmd_sys.c
|
||||
SRC_C += lib/amb1_sdk/common/api/at_cmd/atcmd_wifi.c
|
||||
SRC_C += lib/amb1_sdk/common/api/at_cmd/log_service.c
|
||||
SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/low_level_io.c
|
||||
SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/monitor.c
|
||||
SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/rtl_consol.c
|
||||
SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/rtl_trace.c
|
||||
# SRC_C += lib/amb1_sdk/common/api/at_cmd/atcmd_lwip.c
|
||||
# SRC_C += lib/amb1_sdk/common/api/at_cmd/atcmd_sys.c
|
||||
# SRC_C += lib/amb1_sdk/common/api/at_cmd/atcmd_wifi.c
|
||||
# SRC_C += lib/amb1_sdk/common/api/at_cmd/log_service.c
|
||||
# SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/low_level_io.c
|
||||
# SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/monitor.c
|
||||
# SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/rtl_consol.c
|
||||
# SRC_C += lib/amb1_sdk/soc/realtek/8711b/app/monitor/ram/rtl_trace.c
|
||||
#SRC_C += lib/amb1_sdk/common/api/wifi_interactive_mode.c
|
||||
|
||||
#lib
|
||||
@@ -181,7 +181,7 @@ SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/flash_api.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/gpio_api.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/gpio_irq_api.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/i2c_api.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/i2s_api.c
|
||||
# SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/i2s_api.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/nfc_api.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/pinmap.c
|
||||
SRC_C += lib/amb1_sdk/common/mbed/targets/hal/rtl8711b/pinmap_common.c
|
||||
@@ -212,31 +212,31 @@ SRC_C += lib/amb1_sdk/soc/realtek/8711b/fwlib/ram_lib/rtl8710b_sleepcfg.c
|
||||
#SRC_C += lib/amb1_sdk/common/drivers/wlan/realtek/src/core/option/rtw_opt_skbuf.c
|
||||
|
||||
#utilities example
|
||||
SRC_C += lib/amb1_sdk/common/example/bcast/example_bcast.c
|
||||
SRC_C += lib/amb1_sdk/common/example/eap/example_eap.c
|
||||
SRC_C += lib/amb1_sdk/common/example/example_entry.c
|
||||
SRC_C += lib/amb1_sdk/common/example/get_beacon_frame/example_get_beacon_frame.c
|
||||
SRC_C += lib/amb1_sdk/common/example/high_load_memory_use/example_high_load_memory_use.c
|
||||
SRC_C += lib/amb1_sdk/common/example/http_client/example_http_client.c
|
||||
SRC_C += lib/amb1_sdk/common/example/http_download/example_http_download.c
|
||||
SRC_C += lib/amb1_sdk/common/example/inic_gspi/example_inic_gspi.c
|
||||
SRC_C += lib/amb1_sdk/common/example/mcast/example_mcast.c
|
||||
SRC_C += lib/amb1_sdk/common/example/mdns/example_mdns.c
|
||||
SRC_C += lib/amb1_sdk/common/example/nonblock_connect/example_nonblock_connect.c
|
||||
SRC_C += lib/amb1_sdk/common/example/rarp/example_rarp.c
|
||||
SRC_C += lib/amb1_sdk/common/example/sntp_showtime/example_sntp_showtime.c
|
||||
SRC_C += lib/amb1_sdk/common/example/socket_select/example_socket_select.c
|
||||
SRC_C += lib/amb1_sdk/common/example/ssl_download/example_ssl_download.c
|
||||
SRC_C += lib/amb1_sdk/common/example/ssl_server/example_ssl_server.c
|
||||
SRC_C += lib/amb1_sdk/common/example/tcp_keepalive/example_tcp_keepalive.c
|
||||
SRC_C += lib/amb1_sdk/common/example/uart_atcmd/example_uart_atcmd.c
|
||||
SRC_C += lib/amb1_sdk/common/example/wifi_mac_monitor/example_wifi_mac_monitor.c
|
||||
SRC_C += lib/amb1_sdk/common/example/wlan_fast_connect/example_wlan_fast_connect.c
|
||||
SRC_C += lib/amb1_sdk/common/example/wlan_scenario/example_wlan_scenario.c
|
||||
SRC_C += lib/amb1_sdk/common/example/websocket_server/example_ws_server.c
|
||||
SRC_C += lib/amb1_sdk/common/example/websocket_client/example_wsclient.c
|
||||
SRC_C += lib/amb1_sdk/common/example/xml/example_xml.c
|
||||
SRC_C += lib/amb1_sdk/common/example/uart_firmware_update/example_uart_update.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/bcast/example_bcast.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/eap/example_eap.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/example_entry.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/get_beacon_frame/example_get_beacon_frame.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/high_load_memory_use/example_high_load_memory_use.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/http_client/example_http_client.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/http_download/example_http_download.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/inic_gspi/example_inic_gspi.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/mcast/example_mcast.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/mdns/example_mdns.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/nonblock_connect/example_nonblock_connect.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/rarp/example_rarp.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/sntp_showtime/example_sntp_showtime.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/socket_select/example_socket_select.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/ssl_download/example_ssl_download.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/ssl_server/example_ssl_server.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/tcp_keepalive/example_tcp_keepalive.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/uart_atcmd/example_uart_atcmd.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/wifi_mac_monitor/example_wifi_mac_monitor.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/wlan_fast_connect/example_wlan_fast_connect.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/wlan_scenario/example_wlan_scenario.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/websocket_server/example_ws_server.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/websocket_client/example_wsclient.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/xml/example_xml.c
|
||||
# SRC_C += lib/amb1_sdk/common/example/uart_firmware_update/example_uart_update.c
|
||||
|
||||
#utilities
|
||||
SRC_C += lib/amb1_sdk/common/utilities/cJSON.c
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/portable/MemMang/heap_5.c b/portable/MemMang/heap_5.c
|
||||
index 4e872f6..eae4f2f 100644
|
||||
index 4e872f6..4ab72d2 100644
|
||||
--- a/portable/MemMang/heap_5.c
|
||||
+++ b/portable/MemMang/heap_5.c
|
||||
@@ -78,6 +78,12 @@
|
||||
@@ -95,10 +95,10 @@ index 4e872f6..eae4f2f 100644
|
||||
+ xHeapRegions[0].xSizeInBytes = (uint32_t)((uint8_t*)0x10005000 - (uint8_t*)boot_export_symbol.boot_ram_end);
|
||||
+ xHeapRegions[0].pucStartAddress = (uint8_t*)boot_export_symbol.boot_ram_end;
|
||||
+
|
||||
+ if(!IsRDPenabled()) {
|
||||
+ xHeapRegions[2].xSizeInBytes = 0x1000;
|
||||
+ xHeapRegions[2].pucStartAddress = (uint8_t*)0x1003f000;
|
||||
+ }
|
||||
+ // if(!IsRDPenabled()) {
|
||||
+ // xHeapRegions[2].xSizeInBytes = 0x1000;
|
||||
+ // xHeapRegions[2].pucStartAddress = (uint8_t*)0x1003f000;
|
||||
+ // }
|
||||
+
|
||||
+ vPortDefineHeapRegions(xHeapRegions);
|
||||
+ }
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "main.h"
|
||||
|
||||
#include <example_entry.h>
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "diag.h"
|
||||
#include "gpio_api.h"
|
||||
@@ -11,6 +9,7 @@
|
||||
#include "wifi_structures.h"
|
||||
|
||||
#define LED_PIN PA_0
|
||||
|
||||
static TaskHandle_t led_task_handle = NULL;
|
||||
gpio_t gpio_led;
|
||||
|
||||
@@ -35,7 +34,7 @@ void start_led_blink(void) {
|
||||
xTaskCreate(led_blink_task, "LED_Task", 128, NULL, 1, &led_task_handle);
|
||||
}
|
||||
|
||||
static void scan_network(void) {
|
||||
static void scan_network(void* pvParameters) {
|
||||
printf("\n\r[WIFI] Initializing Wi-Fi scan...\n");
|
||||
|
||||
if (wifi_on(RTW_MODE_STA) < 0) {
|
||||
@@ -119,10 +118,6 @@ static rtw_result_t scan_result_RSSI_handler(
|
||||
* @retval None
|
||||
*/
|
||||
int main(void) {
|
||||
/* Initialize log uart and at command service */
|
||||
// console_init();
|
||||
ReRegisterPlatformLogUart();
|
||||
|
||||
start_led_blink();
|
||||
|
||||
if (xTaskCreate(scan_network, "scan_network", STACKSIZE, NULL,
|
||||
|
||||
54
src/stubs.c
Normal file
54
src/stubs.c
Normal file
@@ -0,0 +1,54 @@
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/unistd.h>
|
||||
|
||||
#include "ameba_soc.h"
|
||||
#include "osdep_service.h"
|
||||
|
||||
int LOGUART_SetBaud(uint32_t BaudRate) {
|
||||
UART_INTConfig(UART2_DEV, RUART_IER_ERBI | RUART_IER_ELSI, DISABLE);
|
||||
UART_RxCmd(UART2_DEV, DISABLE);
|
||||
|
||||
UART_SetBaud(UART2_DEV, BaudRate);
|
||||
|
||||
UART_INTConfig(UART2_DEV, RUART_IER_ERBI | RUART_IER_ELSI, ENABLE);
|
||||
UART_RxCmd(UART2_DEV, ENABLE);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void LOGUART_SetBaud_FromFlash(void) {
|
||||
// nop
|
||||
}
|
||||
|
||||
void ReRegisterPlatformLogUart(void) {
|
||||
// nop
|
||||
}
|
||||
|
||||
// syscalls
|
||||
|
||||
int _close(int file) { return -1; }
|
||||
|
||||
int _fstat(int file, struct stat *st) {
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _getpid(void) { return 1; }
|
||||
|
||||
int _isatty(int file) { return 1; }
|
||||
|
||||
int _kill(int pid, int sig) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _lseek(int file, int ptr, int dir) { return 0; }
|
||||
|
||||
int _read(int file, char *ptr, int len) { return 0; }
|
||||
|
||||
int _write(int file, char *ptr, int len) {
|
||||
return len; // pretend we wrote all bytes
|
||||
}
|
||||
20
warnings.txt
Normal file
20
warnings.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c: In function 'ssl_calc_finished_tls_sha384':
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c:3045:5: warning: 'sha512_finish' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
|
||||
3045 | sha512_finish( &sha512, padbuf );
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c:3045:5: note: referencing argument 2 of type 'unsigned char[64]'
|
||||
In file included from lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/include/polarssl/ssl.h:54,
|
||||
from lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/include/polarssl/debug.h:35,
|
||||
from lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c:42:
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/include/polarssl/sha512.h:109:6: note: in a call to function 'sha512_finish'
|
||||
109 | void sha512_finish( sha512_context *ctx, unsigned char output[64] );
|
||||
| ^~~~~~~~~~~~~
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c: In function 'tls_prf_sha384':
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c:332:9: warning: 'sha512_hmac' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
|
||||
332 | sha512_hmac( secret, slen, tmp, 48 + nb, h_i, 1 );
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/library/ssl_tls.c:332:9: note: referencing argument 5 of type 'unsigned char[64]'
|
||||
lib/amb1_sdk/common/network/ssl/polarssl-1.3.8/include/polarssl/sha512.h:191:6: note: in a call to function 'sha512_hmac'
|
||||
191 | void sha512_hmac( const unsigned char *key, size_t keylen,
|
||||
| ^~~~~~~~~~~
|
||||
/usr/lib/gcc/arm-none-eabi/14.1.0/../../../../arm-none-eabi/bin/ld: warning: build/bin/application.axf has a LOAD segment with RWX permissions
|
||||
Reference in New Issue
Block a user