realtek rtl8195am remove DEVICE_EMAC

1, remove DEVICE_EMAC for wifi feature
pull/7631/head
zzw 2018-07-19 18:07:18 +08:00 committed by Cruz Monrreal II
parent 73fedecfd8
commit ad7cb6563c
5 changed files with 29 additions and 26 deletions

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
#include <stdio.h> #include <stdio.h>
#include "mbed_assert.h" #include "mbed_assert.h"

View File

@ -66,7 +66,7 @@ extern int inic_stop(void);
/****************************************************** /******************************************************
* Variables Declarations * Variables Declarations
******************************************************/ ******************************************************/
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
extern struct netif xnetif[NET_IF_NUM]; extern struct netif xnetif[NET_IF_NUM];
#endif #endif
/****************************************************** /******************************************************
@ -975,7 +975,7 @@ int wifi_on(rtw_mode_t mode)
} }
#if CONFIG_LWIP_LAYER #if CONFIG_LWIP_LAYER
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
netif_set_up(&xnetif[0]); netif_set_up(&xnetif[0]);
if(mode == RTW_MODE_STA_AP) { if(mode == RTW_MODE_STA_AP) {
netif_set_up(&xnetif[1]); netif_set_up(&xnetif[1]);
@ -1001,8 +1001,10 @@ int wifi_off(void)
return 0; return 0;
} }
#if CONFIG_LWIP_LAYER #if CONFIG_LWIP_LAYER
#ifndef CONFIG_MBED_ENABLED
dhcps_deinit(); dhcps_deinit();
#if !DEVICE_EMAC #endif
#if !defined(CONFIG_MBED_ENABLED)
LwIP_DHCP(0, DHCP_STOP); LwIP_DHCP(0, DHCP_STOP);
netif_set_down(&xnetif[0]); netif_set_down(&xnetif[0]);
netif_set_down(&xnetif[1]); netif_set_down(&xnetif[1]);
@ -1043,8 +1045,10 @@ int wifi_off(void)
int wifi_off_fastly(void) int wifi_off_fastly(void)
{ {
#if CONFIG_LWIP_LAYER #if CONFIG_LWIP_LAYER
#ifndef CONFIG_MBED_ENABLED
dhcps_deinit(); dhcps_deinit();
#if !DEVICE_EMAC #endif
#if !defined(CONFIG_MBED_ENABLED)
LwIP_DHCP(0, DHCP_STOP); LwIP_DHCP(0, DHCP_STOP);
#endif #endif
#endif #endif
@ -1672,7 +1676,7 @@ int wifi_restart_ap(
int channel) int channel)
{ {
unsigned char idx = 0; unsigned char idx = 0;
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
ip_addr_t ipaddr; ip_addr_t ipaddr;
ip_addr_t netmask; ip_addr_t netmask;
ip_addr_t gw; ip_addr_t gw;
@ -1700,7 +1704,7 @@ int wifi_restart_ap(
else else
#endif #endif
{ {
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
IP4_ADDR(&ipaddr, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3); IP4_ADDR(&ipaddr, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3); IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3);
IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3); IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
@ -1750,7 +1754,7 @@ int wifi_restart_ap(
#if (INCLUDE_uxTaskGetStackHighWaterMark == 1) #if (INCLUDE_uxTaskGetStackHighWaterMark == 1)
printf("\r\nWebServer Thread: High Water Mark is %ld\n", uxTaskGetStackHighWaterMark(NULL)); printf("\r\nWebServer Thread: High Water Mark is %ld\n", uxTaskGetStackHighWaterMark(NULL));
#endif #endif
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
// start dhcp server // start dhcp server
dhcps_init(&xnetif[idx]); dhcps_init(&xnetif[idx]);
#endif #endif
@ -1773,12 +1777,12 @@ struct wifi_autoreconnect_param {
static void wifi_autoreconnect_thread(void *param) static void wifi_autoreconnect_thread(void *param)
{ {
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER #if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
int ret = RTW_ERROR; int ret = RTW_ERROR;
#endif #endif
struct wifi_autoreconnect_param *reconnect_param = (struct wifi_autoreconnect_param *) param; struct wifi_autoreconnect_param *reconnect_param = (struct wifi_autoreconnect_param *) param;
WIFI_CONF_MSG("\n\rauto reconnect ...\n"); WIFI_CONF_MSG("\n\rauto reconnect ...\n");
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER #if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
ret = ret =
#endif #endif
wifi_connect(reconnect_param->ssid, wifi_connect(reconnect_param->ssid,
@ -1788,7 +1792,7 @@ static void wifi_autoreconnect_thread(void *param)
reconnect_param->password_len, reconnect_param->password_len,
reconnect_param->key_id, reconnect_param->key_id,
NULL); NULL);
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER #if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
if(ret == RTW_SUCCESS) { if(ret == RTW_SUCCESS) {
#if ATCMD_VER == ATVER_2 #if ATCMD_VER == ATVER_2
if (dhcp_mode_sta == 2){ if (dhcp_mode_sta == 2){

View File

@ -20,7 +20,7 @@
#include <lwip_intf.h> #include <lwip_intf.h>
#include <lwip/netif.h> #include <lwip/netif.h>
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
#include <lwip_netconf.h> #include <lwip_netconf.h>
#include <ethernetif.h> #include <ethernetif.h>
#endif #endif
@ -32,7 +32,7 @@
// External Reference // External Reference
//----- ------------------------------------------------------------------ //----- ------------------------------------------------------------------
#if (CONFIG_LWIP_LAYER == 1) #if (CONFIG_LWIP_LAYER == 1)
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
extern struct netif *xnetif[]; extern struct netif *xnetif[];
#else #else
extern struct netif xnetif[]; //LWIP netif extern struct netif xnetif[]; //LWIP netif
@ -52,7 +52,7 @@
void rltk_wlan_set_netif_info(int idx_wlan, void * dev, unsigned char * dev_addr) void rltk_wlan_set_netif_info(int idx_wlan, void * dev, unsigned char * dev_addr)
{ {
#if (CONFIG_LWIP_LAYER == 1) #if (CONFIG_LWIP_LAYER == 1)
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
//rtw_memcpy(xnetif[idx_wlan]->hwaddr, dev_addr, 6); //rtw_memcpy(xnetif[idx_wlan]->hwaddr, dev_addr, 6);
//set netif hwaddr later //set netif hwaddr later
#else #else
@ -156,7 +156,7 @@ void rltk_wlan_recv(int idx, struct eth_drv_sg *sg_list, int sg_len)
int netif_is_valid_IP(int idx, unsigned char *ip_dest) int netif_is_valid_IP(int idx, unsigned char *ip_dest)
{ {
#if CONFIG_LWIP_LAYER == 1 #if CONFIG_LWIP_LAYER == 1
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
return 1; return 1;
#else #else
struct netif *pnetif = &xnetif[idx]; struct netif *pnetif = &xnetif[idx];
@ -199,7 +199,7 @@ int netif_is_valid_IP(int idx, unsigned char *ip_dest)
#endif #endif
} }
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
#else #else
int netif_get_idx(struct netif *pnetif) int netif_get_idx(struct netif *pnetif)
@ -240,7 +240,7 @@ void set_callback_func(emac_callback p, void *data) {
void netif_rx(int idx, unsigned int len) void netif_rx(int idx, unsigned int len)
{ {
#if (CONFIG_LWIP_LAYER == 1) #if (CONFIG_LWIP_LAYER == 1)
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
emac_callback_func(emac_callback_data, NULL, len); emac_callback_func(emac_callback_data, NULL, len);
#else #else
ethernetif_recv(&xnetif[idx], len); ethernetif_recv(&xnetif[idx], len);
@ -255,7 +255,7 @@ void netif_rx(int idx, unsigned int len)
void netif_post_sleep_processing(void) void netif_post_sleep_processing(void)
{ {
#if (CONFIG_LWIP_LAYER == 1) #if (CONFIG_LWIP_LAYER == 1)
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
#else #else
lwip_POST_SLEEP_PROCESSING(); //For FreeRTOS tickless to enable Lwip ARP timer when leaving IPS - Alex Fang lwip_POST_SLEEP_PROCESSING(); //For FreeRTOS tickless to enable Lwip ARP timer when leaving IPS - Alex Fang
#endif #endif
@ -265,7 +265,7 @@ void netif_post_sleep_processing(void)
void netif_pre_sleep_processing(void) void netif_pre_sleep_processing(void)
{ {
#if (CONFIG_LWIP_LAYER == 1) #if (CONFIG_LWIP_LAYER == 1)
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
#else #else
lwip_PRE_SLEEP_PROCESSING(); lwip_PRE_SLEEP_PROCESSING();
#endif #endif

View File

@ -28,7 +28,7 @@ struct netif;
//----- ------------------------------------------------------------------ //----- ------------------------------------------------------------------
// Ethernet Buffer // Ethernet Buffer
//----- ------------------------------------------------------------------ //----- ------------------------------------------------------------------
#if DEVICE_EMAC #if defined(CONFIG_MBED_ENABLED)
struct eth_drv_sg { struct eth_drv_sg {
unsigned int buf; unsigned int buf;
unsigned int len; unsigned int len;
@ -66,7 +66,7 @@ void netif_rx(int idx, unsigned int len);
void netif_post_sleep_processing(void); void netif_post_sleep_processing(void);
void netif_pre_sleep_processing(void); void netif_pre_sleep_processing(void);
#if (CONFIG_LWIP_LAYER == 1) #if (CONFIG_LWIP_LAYER == 1)
#if !DEVICE_EMAC #if !defined(CONFIG_MBED_ENABLED)
extern void ethernetif_recv(struct netif *netif, int total_len); extern void ethernetif_recv(struct netif *netif, int total_len);
#endif #endif
extern void lwip_PRE_SLEEP_PROCESSING(void); extern void lwip_PRE_SLEEP_PROCESSING(void);

View File

@ -4071,7 +4071,6 @@
"extra_labels": ["Realtek", "AMEBA", "RTL8195A", "RTW_EMAC"], "extra_labels": ["Realtek", "AMEBA", "RTL8195A", "RTW_EMAC"],
"macros": ["__RTL8195A__","CONFIG_PLATFORM_8195A","CONFIG_MBED_ENABLED","PLATFORM_CMSIS_RTOS","MBED_FAULT_HANDLER_DISABLED"], "macros": ["__RTL8195A__","CONFIG_PLATFORM_8195A","CONFIG_MBED_ENABLED","PLATFORM_CMSIS_RTOS","MBED_FAULT_HANDLER_DISABLED"],
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"], "supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SPI", "TRNG", "FLASH", "EMAC"],
"features": ["LWIP"], "features": ["LWIP"],
"post_binary_hook": { "post_binary_hook": {
"function": "RTL8195ACode.binary_hook", "function": "RTL8195ACode.binary_hook",