mirror of
https://github.com/pvvx/RTL00MP3.git
synced 2025-07-31 12:41:06 +00:00
update -Wall -Werror
This commit is contained in:
parent
2c29a376ba
commit
7cb9553f73
102 changed files with 3686 additions and 3504 deletions
|
|
@ -16,6 +16,8 @@
|
|||
#endif
|
||||
#include <lwip_netconf.h>
|
||||
#include <osdep_service.h>
|
||||
#include "dhcp.h"
|
||||
#include "dhcp/dhcps.h"
|
||||
|
||||
#if CONFIG_EXAMPLE_WLAN_FAST_CONNECT
|
||||
#include "wlan_fast_connect/example_wlan_fast_connect.h"
|
||||
|
|
@ -157,6 +159,9 @@ extern unsigned char dhcp_mode_sta;
|
|||
#include "freertos/wrapper.h"
|
||||
#include "skbuff.h"
|
||||
|
||||
extern int is_promisc_enabled();
|
||||
extern int promisc_set(rtw_rcr_level_t enabled, void (*callback)(u8 *, unsigned int, void *), int len_used);
|
||||
|
||||
//------------------------------------------------------------------------end-patch//
|
||||
static int wifi_connect_local(rtw_network_info_t *pWifi) {
|
||||
int ret = 0;
|
||||
|
|
@ -278,8 +283,8 @@ static void wifi_disconn_hdl(char* buf, int buf_len, int flags, void* userdata)
|
|||
else if (rtw_join_status == 0)
|
||||
error_flag = RTW_CONNECT_FAIL;
|
||||
|
||||
else if (rtw_join_status == JOIN_COMPLETE | JOIN_SECURITY_COMPLETE
|
||||
| JOIN_ASSOCIATED | JOIN_AUTHENTICATED | JOIN_LINK_READY)
|
||||
else if (rtw_join_status == (JOIN_COMPLETE | JOIN_SECURITY_COMPLETE
|
||||
| JOIN_ASSOCIATED | JOIN_AUTHENTICATED | JOIN_LINK_READY))
|
||||
error_flag = RTW_WRONG_PASSWORD;
|
||||
}
|
||||
|
||||
|
|
@ -368,6 +373,7 @@ void restore_wifi_info_to_flash() {
|
|||
|
||||
#endif
|
||||
|
||||
extern int wext_set_bssid(const char *ifname, const __u8 *bssid);
|
||||
//----------------------------------------------------------------------------//
|
||||
int wifi_connect(
|
||||
unsigned char bssid[ETH_ALEN],
|
||||
|
|
@ -380,7 +386,7 @@ int wifi_connect(
|
|||
|
||||
int ssid_len = 0;
|
||||
int password_len = 0;
|
||||
int bssid_len = 6;
|
||||
// int bssid_len = 6;
|
||||
xSemaphoreHandle join_semaphore;
|
||||
rtw_result_t result = RTW_SUCCESS;
|
||||
u8 wep_hex = 0;
|
||||
|
|
@ -440,7 +446,7 @@ int wifi_connect(
|
|||
|
||||
if (password_len == 10) {
|
||||
|
||||
u32 g[5] = { 0 };
|
||||
unsigned int g[5] = { 0 };
|
||||
u8 i = 0;
|
||||
sscanf((const char*) password, "%02x%02x%02x%02x%02x", &g[0],
|
||||
&g[1], &g[2], &g[3], &g[4]);
|
||||
|
|
@ -450,7 +456,7 @@ int wifi_connect(
|
|||
password_len = 5;
|
||||
wep_hex = 1;
|
||||
} else if (password_len == 26) {
|
||||
u32 g[13] = { 0 };
|
||||
unsigned int g[13] = { 0 };
|
||||
u8 i = 0;
|
||||
sscanf((const char*) password, "%02x%02x%02x%02x%02x%02x%02x"
|
||||
"%02x%02x%02x%02x%02x%02x", &g[0], &g[1], &g[2], &g[3],
|
||||
|
|
@ -731,6 +737,8 @@ int wifi_get_ap_info(rtw_bss_info_t * ap_info, rtw_security_t* security) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
extern int wext_get_drv_ability(const char *ifname, uint32_t *ability);
|
||||
|
||||
int wifi_get_drv_ability(uint32_t *ability) {
|
||||
return wext_get_drv_ability(WLAN0_NAME, ability);
|
||||
}
|
||||
|
|
@ -948,6 +956,8 @@ int wifi_get_last_error(void) {
|
|||
int wpas_wps_init(const char* ifname);
|
||||
#endif
|
||||
|
||||
extern int set_hidden_ssid(const char *ifname, uint8_t value);
|
||||
|
||||
int wifi_start_ap(char *ssid, rtw_security_t security_type, char *password, int channel, char ssid_hidden) {
|
||||
const char *ifname = WLAN0_NAME;
|
||||
int ssid_len = 0;
|
||||
|
|
@ -1543,10 +1553,8 @@ int wifi_restart_ap(unsigned char *ssid, rtw_security_t security_type,
|
|||
printf("AP: security_type=%d\n", setting.security_type);
|
||||
printf("AP: password=%s\n", (char* )setting.password);
|
||||
printf("AP: key_idx =%d\n", setting.key_idx);
|
||||
ret = wifi_connect((char*) setting.ssid, setting.security_type,
|
||||
(char*) setting.password, strlen((char* )setting.ssid),
|
||||
strlen((char* )setting.password), setting.key_idx,
|
||||
NULL);
|
||||
ret = wifi_connect(NULL, 0 , (char*) setting.ssid, setting.security_type,
|
||||
(char*) setting.password, setting.key_idx, NULL);
|
||||
if (ret == RTW_SUCCESS) {
|
||||
#if CONFIG_DHCP_CLIENT
|
||||
/* Start DHCPClient */
|
||||
|
|
@ -1726,6 +1734,9 @@ int wifi_remove_packet_filter(unsigned char filter_id) {
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
extern int wext_enable_forwarding(const char *ifname);
|
||||
extern int wext_disable_forwarding(const char *ifname);
|
||||
|
||||
int wifi_enable_forwarding(void) {
|
||||
return wext_enable_forwarding(WLAN0_NAME);
|
||||
}
|
||||
|
|
@ -1739,6 +1750,8 @@ int wifi_disable_forwarding(void) {
|
|||
* usage: wifi_set_ch_deauth(0) -> wlan0 wifi_connect -> wifi_set_ch_deauth(1)
|
||||
*/
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
extern int wext_set_ch_deauth(const char *ifname, __u8 enable);
|
||||
|
||||
int wifi_set_ch_deauth(__u8 enable) {
|
||||
return wext_set_ch_deauth(WLAN1_NAME, enable);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue