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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ void wifi_indication(WIFI_EVENT_INDICATE event, unsigned char *buf, int buf_len,
|
|||
// , and tries not to share the same stack with wlan driver if remaining stack space is
|
||||
// not available for the following operations.
|
||||
// ex: using semaphore to notice another thread.
|
||||
switch (event) {
|
||||
switch ((int)event) {
|
||||
case WIFI_EVENT_DISCONNECT:
|
||||
#if(WIFI_INDICATE_MSG>0)
|
||||
info_printf("%s(%d): Disconnection indication received\n", __func__, event);
|
||||
|
|
|
|||
|
|
@ -19,9 +19,8 @@
|
|||
extern void _promisc_deinit(_adapter *padapter);
|
||||
extern int _promisc_recv_func(_adapter *padapter, recv_frame *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, unsigned char *ssid, int *ssid_length);
|
||||
extern unsigned char is_promisc_enabled(void);
|
||||
extern unsigned char _is_promisc_enabled(void);
|
||||
extern int _promisc_get_fixed_channel(void *fixed_bssid, unsigned char *ssid, int *ssid_length);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -111,7 +110,7 @@ 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};
|
||||
rtw_packet_filter_info_t paff_array[MAX_PACKET_FILTER_INFO]; // ={0, 0, 0, 0, 0};
|
||||
static u8 packet_filter_enable_num = 0;
|
||||
|
||||
void promisc_init_packet_filter()
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ int wext_get_passphrase(const char *ifname, __u8 *passphrase) {
|
|||
rtw_result_t ret = RTW_ERROR;
|
||||
if(pdev) {
|
||||
uint16 len[4];
|
||||
ret = rtw_wx_get_passphrase(pdev, 0, &len, passphrase);
|
||||
ret = rtw_wx_get_passphrase(pdev, 0,(union iwreq_data *) &len, passphrase);
|
||||
if(ret == RTW_SUCCESS) passphrase[len[2]] = '\0';
|
||||
debug_printf("pas[%d]-<%s>\n", len[2], passphrase);
|
||||
}
|
||||
|
|
@ -404,7 +404,6 @@ int wext_get_lps_dtim(const char *ifname, __u8 *lps_dtim) {
|
|||
|
||||
int wext_set_tos_value(const char *ifname, __u8 *tos_value) {
|
||||
struct iwreq iwr;
|
||||
int ret = -1;
|
||||
__u8 para[sizeof("set_tos_value") + 4];
|
||||
int cmd_len = sizeof("set_tos_value");
|
||||
memset(&iwr, 0, sizeof(iwr));
|
||||
|
|
@ -562,6 +561,8 @@ int wext_get_mode(const char *ifname, int *mode) {
|
|||
#endif
|
||||
}
|
||||
|
||||
extern int rtw_wx_set_ap_essid(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra);
|
||||
|
||||
int wext_set_ap_ssid(const char *ifname, const __u8 *ssid, __u16 ssid_len) {
|
||||
#ifdef USE_WIFI_ADAPTER
|
||||
struct net_device * pdev = rltk_wlan_info[0].dev;
|
||||
|
|
@ -572,7 +573,7 @@ int wext_set_ap_ssid(const char *ifname, const __u8 *ssid, __u16 ssid_len) {
|
|||
uint16 len[2];
|
||||
len[0] = ssid_len;
|
||||
len[1] = (ssid_len != 0);
|
||||
ret = rtw_wx_set_ap_essid(pdev, 0, &len, ssid);
|
||||
ret = rtw_wx_set_ap_essid(pdev, 0, (union iwreq_data *) &len, (char *)ssid);
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
|
|
@ -751,7 +752,7 @@ int wext_private_command_with_retval(const char *ifname, char *cmd,
|
|||
iwr.u.data.length = buf_size;
|
||||
iwr.u.data.flags = 0;
|
||||
ret = iw_ioctl(ifname, SIOCDEVPRIVATE, &iwr);
|
||||
if (ret >= 0 & ret_buf != NULL) {
|
||||
if (ret >= 0 && ret_buf != NULL) {
|
||||
if (ret_len > iwr.u.data.length)
|
||||
ret_len = iwr.u.data.length;
|
||||
memcpy(ret_buf, (char *) iwr.u.data.pointer, ret_len);
|
||||
|
|
@ -923,7 +924,6 @@ int wext_set_gen_ie(const char *ifname, char *buf, __u16 buf_len, __u16 flags) {
|
|||
int wext_set_autoreconnect(const char *ifname, __u8 mode, __u8 retyr_times,
|
||||
__u16 timeout) {
|
||||
struct iwreq iwr;
|
||||
int ret = 0;
|
||||
__u8 para[sizeof("SetAutoRecnt") + 4];
|
||||
int cmd_len = sizeof("SetAutoRecnt");
|
||||
memset(&iwr, 0, sizeof(iwr));
|
||||
|
|
@ -1017,7 +1017,7 @@ int wext_update_custom_ie(const char *ifname, void * cus_ie, int ie_index) {
|
|||
#endif
|
||||
} else {
|
||||
memset(&iwr, 0, sizeof(iwr));
|
||||
cmd_len = para = pvPortMalloc((4) * 2 + cmd_len); //size:addr len+cmd_len
|
||||
para = pvPortMalloc((4) * 2 + cmd_len); //size:addr len+cmd_len
|
||||
if (para != NULL) {
|
||||
//Cmd
|
||||
snprintf(para, cmd_len, "UpdateIE");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue