Skip to content

Commit b6a67c1

Browse files
committed
realtek rtl8195am remove DEVICE_EMAC
1, remove DEVICE_EMAC for wifi feature
1 parent dd6482b commit b6a67c1

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
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: 11 additions & 11 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
@@ -1004,7 +1004,7 @@ int wifi_off(void)
10041004
#ifndef CONFIG_MBED_ENABLED
10051005
dhcps_deinit();
10061006
#endif
1007-
#if !DEVICE_EMAC
1007+
#if !defined(CONFIG_MBED_ENABLED)
10081008
LwIP_DHCP(0, DHCP_STOP);
10091009
netif_set_down(&xnetif[0]);
10101010
netif_set_down(&xnetif[1]);
@@ -1048,7 +1048,7 @@ int wifi_off_fastly(void)
10481048
#ifndef CONFIG_MBED_ENABLED
10491049
dhcps_deinit();
10501050
#endif
1051-
#if !DEVICE_EMAC
1051+
#if !defined(CONFIG_MBED_ENABLED)
10521052
LwIP_DHCP(0, DHCP_STOP);
10531053
#endif
10541054
#endif
@@ -1676,7 +1676,7 @@ int wifi_restart_ap(
16761676
int channel)
16771677
{
16781678
unsigned char idx = 0;
1679-
#if !DEVICE_EMAC
1679+
#if !defined(CONFIG_MBED_ENABLED)
16801680
ip_addr_t ipaddr;
16811681
ip_addr_t netmask;
16821682
ip_addr_t gw;
@@ -1706,7 +1706,7 @@ int wifi_restart_ap(
17061706
else
17071707
#endif
17081708
{
1709-
#if !DEVICE_EMAC
1709+
#if !defined(CONFIG_MBED_ENABLED)
17101710
IP4_ADDR(&ipaddr, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
17111711
IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3);
17121712
IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
@@ -1756,7 +1756,7 @@ int wifi_restart_ap(
17561756
#if (INCLUDE_uxTaskGetStackHighWaterMark == 1)
17571757
printf("\r\nWebServer Thread: High Water Mark is %ld\n", uxTaskGetStackHighWaterMark(NULL));
17581758
#endif
1759-
#if !DEVICE_EMAC
1759+
#if !defined(CONFIG_MBED_ENABLED)
17601760
// start dhcp server
17611761
dhcps_init(&xnetif[idx]);
17621762
#endif
@@ -1779,12 +1779,12 @@ struct wifi_autoreconnect_param {
17791779

17801780
static void wifi_autoreconnect_thread(void *param)
17811781
{
1782-
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER
1782+
#if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
17831783
int ret = RTW_ERROR;
17841784
#endif
17851785
struct wifi_autoreconnect_param *reconnect_param = (struct wifi_autoreconnect_param *) param;
17861786
WIFI_CONF_MSG("\n\rauto reconnect ...\n");
1787-
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER
1787+
#if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
17881788
ret =
17891789
#endif
17901790
wifi_connect(reconnect_param->ssid,
@@ -1794,7 +1794,7 @@ static void wifi_autoreconnect_thread(void *param)
17941794
reconnect_param->password_len,
17951795
reconnect_param->key_id,
17961796
NULL);
1797-
#if !DEVICE_EMAC && CONFIG_LWIP_LAYER
1797+
#if !defined(CONFIG_MBED_ENABLED) && CONFIG_LWIP_LAYER
17981798
if(ret == RTW_SUCCESS) {
17991799
#if ATCMD_VER == ATVER_2
18001800
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4051,7 +4051,7 @@
40514051
"extra_labels": ["Realtek", "AMEBA", "RTL8195A", "RTW_EMAC"],
40524052
"macros": ["__RTL8195A__","CONFIG_PLATFORM_8195A","CONFIG_MBED_ENABLED","PLATFORM_CMSIS_RTOS","MBED_FAULT_HANDLER_DISABLED"],
40534053
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
4054-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SPI", "TRNG", "FLASH", "EMAC"],
4054+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SPI", "TRNG", "FLASH"],
40554055
"post_binary_hook": {
40564056
"function": "RTL8195ACode.binary_hook",
40574057
"toolchains": ["ARM_STD", "GCC_ARM", "IAR"]

0 commit comments

Comments
 (0)