Skip to content

Commit 56a1760

Browse files
M-ichae-lCruz Monrreal II
authored andcommitted
realtek rtl8195am remove DEVICE_EMAC
1, remove DEVICE_EMAC for wifi feature
1 parent c56f1f5 commit 56a1760

File tree

5 files changed

+30
-27
lines changed

5 files changed

+30
-27
lines changed

targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#if DEVICE_EMAC
17+
#if defined(CONFIG_MBED_ENABLED)
1818

1919
#include <stdio.h>
2020
#include "mbed_assert.h"

targets/TARGET_Realtek/TARGET_AMEBA/sdk/common/api/wifi/wifi_conf.c

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ extern int inic_stop(void);
6666
/******************************************************
6767
* Variables Declarations
6868
******************************************************/
69-
#if !DEVICE_EMAC
69+
#if !defined(CONFIG_MBED_ENABLED)
7070
extern struct netif xnetif[NET_IF_NUM];
7171
#endif
7272
/******************************************************
@@ -975,10 +975,10 @@ int wifi_on(rtw_mode_t mode)
975975
}
976976

977977
#if CONFIG_LWIP_LAYER
978-
#if !DEVICE_EMAC
978+
#if !defined(CONFIG_MBED_ENABLED)
979979
netif_set_up(&xnetif[0]);
980980
if(mode == RTW_MODE_STA_AP) {
981-
netif_set_up(&xnetif[1]);
981+
netif_set_up(&xnetif[1]);
982982
}
983983
#endif
984984
#endif
@@ -1001,8 +1001,10 @@ int wifi_off(void)
10011001
return 0;
10021002
}
10031003
#if CONFIG_LWIP_LAYER
1004-
dhcps_deinit();
1005-
#if !DEVICE_EMAC
1004+
#ifndef CONFIG_MBED_ENABLED
1005+
dhcps_deinit();
1006+
#endif
1007+
#if !defined(CONFIG_MBED_ENABLED)
10061008
LwIP_DHCP(0, DHCP_STOP);
10071009
netif_set_down(&xnetif[0]);
10081010
netif_set_down(&xnetif[1]);
@@ -1043,8 +1045,10 @@ int wifi_off(void)
10431045
int wifi_off_fastly(void)
10441046
{
10451047
#if CONFIG_LWIP_LAYER
1046-
dhcps_deinit();
1047-
#if !DEVICE_EMAC
1048+
#ifndef CONFIG_MBED_ENABLED
1049+
dhcps_deinit();
1050+
#endif
1051+
#if !defined(CONFIG_MBED_ENABLED)
10481052
LwIP_DHCP(0, DHCP_STOP);
10491053
#endif
10501054
#endif
@@ -1672,7 +1676,7 @@ int wifi_restart_ap(
16721676
int channel)
16731677
{
16741678
unsigned char idx = 0;
1675-
#if !DEVICE_EMAC
1679+
#if !defined(CONFIG_MBED_ENABLED)
16761680
ip_addr_t ipaddr;
16771681
ip_addr_t netmask;
16781682
ip_addr_t gw;
@@ -1700,7 +1704,7 @@ int wifi_restart_ap(
17001704
else
17011705
#endif
17021706
{
1703-
#if !DEVICE_EMAC
1707+
#if !defined(CONFIG_MBED_ENABLED)
17041708
IP4_ADDR(&ipaddr, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
17051709
IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3);
17061710
IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
@@ -1750,7 +1754,7 @@ int wifi_restart_ap(
17501754
#if (INCLUDE_uxTaskGetStackHighWaterMark == 1)
17511755
printf("\r\nWebServer Thread: High Water Mark is %ld\n", uxTaskGetStackHighWaterMark(NULL));
17521756
#endif
1753-
#if !DEVICE_EMAC
1757+
#if !defined(CONFIG_MBED_ENABLED)
17541758
// start dhcp server
17551759
dhcps_init(&xnetif[idx]);
17561760
#endif
@@ -1773,12 +1777,12 @@ struct wifi_autoreconnect_param {
17731777

17741778
static void wifi_autoreconnect_thread(void *param)
17751779
{
1776-
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER
1780+
#if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
17771781
int ret = RTW_ERROR;
17781782
#endif
17791783
struct wifi_autoreconnect_param *reconnect_param = (struct wifi_autoreconnect_param *) param;
17801784
WIFI_CONF_MSG("\n\rauto reconnect ...\n");
1781-
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER
1785+
#if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
17821786
ret =
17831787
#endif
17841788
wifi_connect(reconnect_param->ssid,
@@ -1788,7 +1792,7 @@ static void wifi_autoreconnect_thread(void *param)
17881792
reconnect_param->password_len,
17891793
reconnect_param->key_id,
17901794
NULL);
1791-
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER
1795+
#if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
17921796
if(ret == RTW_SUCCESS) {
17931797
#if ATCMD_VER == ATVER_2
17941798
if (dhcp_mode_sta == 2){

targets/TARGET_Realtek/TARGET_AMEBA/sdk/common/drivers/wlan/realtek/src/osdep/lwip_intf.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <lwip_intf.h>
2121
#include <lwip/netif.h>
2222

23-
#if !DEVICE_EMAC
23+
#if !defined(CONFIG_MBED_ENABLED)
2424
#include <lwip_netconf.h>
2525
#include <ethernetif.h>
2626
#endif
@@ -32,7 +32,7 @@
3232
// External Reference
3333
//----- ------------------------------------------------------------------
3434
#if (CONFIG_LWIP_LAYER == 1)
35-
#if DEVICE_EMAC
35+
#if defined(CONFIG_MBED_ENABLED)
3636
extern struct netif *xnetif[];
3737
#else
3838
extern struct netif xnetif[]; //LWIP netif
@@ -52,7 +52,7 @@
5252
void rltk_wlan_set_netif_info(int idx_wlan, void * dev, unsigned char * dev_addr)
5353
{
5454
#if (CONFIG_LWIP_LAYER == 1)
55-
#if DEVICE_EMAC
55+
#if defined(CONFIG_MBED_ENABLED)
5656
//rtw_memcpy(xnetif[idx_wlan]->hwaddr, dev_addr, 6);
5757
//set netif hwaddr later
5858
#else
@@ -156,7 +156,7 @@ void rltk_wlan_recv(int idx, struct eth_drv_sg *sg_list, int sg_len)
156156
int netif_is_valid_IP(int idx, unsigned char *ip_dest)
157157
{
158158
#if CONFIG_LWIP_LAYER == 1
159-
#if DEVICE_EMAC
159+
#if defined(CONFIG_MBED_ENABLED)
160160
return 1;
161161
#else
162162
struct netif *pnetif = &xnetif[idx];
@@ -188,7 +188,7 @@ int netif_is_valid_IP(int idx, unsigned char *ip_dest)
188188
}
189189

190190
DBG_TRACE("invalid IP: %d.%d.%d.%d ",ip_dest[0],ip_dest[1],ip_dest[2],ip_dest[3]);
191-
#endif
191+
#endif
192192
#ifdef CONFIG_DONT_CARE_TP
193193
if (pnetif->flags & NETIF_FLAG_IPSWITCH) {
194194
return 1;
@@ -199,7 +199,7 @@ int netif_is_valid_IP(int idx, unsigned char *ip_dest)
199199
#endif
200200
}
201201

202-
#if DEVICE_EMAC
202+
#if defined(CONFIG_MBED_ENABLED)
203203

204204
#else
205205
int netif_get_idx(struct netif *pnetif)
@@ -240,7 +240,7 @@ void set_callback_func(emac_callback p, void *data) {
240240
void netif_rx(int idx, unsigned int len)
241241
{
242242
#if (CONFIG_LWIP_LAYER == 1)
243-
#if DEVICE_EMAC
243+
#if defined(CONFIG_MBED_ENABLED)
244244
emac_callback_func(emac_callback_data, NULL, len);
245245
#else
246246
ethernetif_recv(&xnetif[idx], len);
@@ -255,7 +255,7 @@ void netif_rx(int idx, unsigned int len)
255255
void netif_post_sleep_processing(void)
256256
{
257257
#if (CONFIG_LWIP_LAYER == 1)
258-
#if DEVICE_EMAC
258+
#if defined(CONFIG_MBED_ENABLED)
259259
#else
260260
lwip_POST_SLEEP_PROCESSING(); //For FreeRTOS tickless to enable Lwip ARP timer when leaving IPS - Alex Fang
261261
#endif
@@ -265,7 +265,7 @@ void netif_post_sleep_processing(void)
265265
void netif_pre_sleep_processing(void)
266266
{
267267
#if (CONFIG_LWIP_LAYER == 1)
268-
#if DEVICE_EMAC
268+
#if defined(CONFIG_MBED_ENABLED)
269269
#else
270270
lwip_PRE_SLEEP_PROCESSING();
271271
#endif

targets/TARGET_Realtek/TARGET_AMEBA/sdk/common/drivers/wlan/realtek/src/osdep/lwip_intf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct netif;
2828
//----- ------------------------------------------------------------------
2929
// Ethernet Buffer
3030
//----- ------------------------------------------------------------------
31-
#if DEVICE_EMAC
31+
#if defined(CONFIG_MBED_ENABLED)
3232
struct eth_drv_sg {
3333
unsigned int buf;
3434
unsigned int len;
@@ -66,7 +66,7 @@ void netif_rx(int idx, unsigned int len);
6666
void netif_post_sleep_processing(void);
6767
void netif_pre_sleep_processing(void);
6868
#if (CONFIG_LWIP_LAYER == 1)
69-
#if !DEVICE_EMAC
69+
#if !defined(CONFIG_MBED_ENABLED)
7070
extern void ethernetif_recv(struct netif *netif, int total_len);
7171
#endif
7272
extern void lwip_PRE_SLEEP_PROCESSING(void);

targets/targets.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4071,8 +4071,7 @@
40714071
"extra_labels": ["Realtek", "AMEBA", "RTL8195A", "RTW_EMAC"],
40724072
"macros": ["__RTL8195A__","CONFIG_PLATFORM_8195A","CONFIG_MBED_ENABLED","PLATFORM_CMSIS_RTOS","MBED_FAULT_HANDLER_DISABLED"],
40734073
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
4074-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SPI", "TRNG", "FLASH", "EMAC"],
4075-
"features": ["LWIP"],
4074+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SPI", "TRNG", "FLASH"],
40764075
"post_binary_hook": {
40774076
"function": "RTL8195ACode.binary_hook",
40784077
"toolchains": ["ARM_STD", "GCC_ARM", "IAR"]

0 commit comments

Comments
 (0)