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.
*/
#if DEVICE_EMAC
#if defined(CONFIG_MBED_ENABLED)
#include <stdio.h>
#include "mbed_assert.h"

View File

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

View File

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

View File

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

View File

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