Skip to content

Commit 78e6748

Browse files
committed
Merge branches 'pr6941', 'pr6810' and 'pr6913' into feature-emac-17May-merge
* pr6941: Removed EMAC get default instance from EMAC tests * pr6810: LPC546XX: Correct Ethernet length calculations LPC546XX: Correct Ethernet MAC address write Add memory configuration for LPC546XX LPC546XX: Add ENET support * pr6913: WiFi EMAC class name reflected in WiFi drivers binaries WIFI_EMAC class renamed to OdinWiFiEMAC, Formatting Revert "in ODIN emac initialization required before connection" in ODIN emac initialization required before connection EMAC adaption added, updated ODIN drivers to v2.5.0 RC1
4 parents 75f17d4 + 3320497 + 39db644 + a907278 commit 78e6748

File tree

44 files changed

+2817
-1678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2817
-1678
lines changed

TESTS/network/emac/emac_TestNetworkStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ char *EmacTestNetworkStack::Interface::get_gateway(char *buf, nsapi_size_t bufle
161161

162162
nsapi_error_t EmacTestNetworkStack::Interface::bringup(bool dhcp, const char *ip, const char *netmask, const char *gw, const nsapi_ip_stack_t stack, bool blocking)
163163
{
164-
if (!emac_if_init()) {
164+
if (!emac_if_init(m_emac)) {
165165
TEST_ASSERT_MESSAGE(0, "emac initialization failed!");
166166
}
167167

TESTS/network/emac/emac_initialize.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define EMAC_INITIALIZE_H
2020

2121
unsigned char *emac_if_get_hw_addr(void);
22-
bool emac_if_init(void);
22+
bool emac_if_init(EMAC *emac);
2323
EMAC *emac_if_get(void);
2424
EmacTestMemoryManager *emac_m_mngr_get(void);
2525

TESTS/network/emac/emac_test_initialize.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
using namespace utest::v1;
4949

5050
static unsigned char eth_mac_addr[ETH_MAC_ADDR_LEN];
51+
EMAC *emac_handle = NULL;
5152

5253
void test_emac_initialize()
5354
{
@@ -104,17 +105,17 @@ unsigned char *emac_if_get_hw_addr(void)
104105

105106
EMAC *emac_if_get(void)
106107
{
107-
return &EMAC::get_default_instance();
108+
return emac_handle;
108109
}
109110

110111
EmacTestMemoryManager *emac_m_mngr_get(void)
111112
{
112113
return &EmacTestMemoryManager::get_instance();
113114
}
114115

115-
bool emac_if_init(void)
116+
bool emac_if_init(EMAC *emac)
116117
{
117-
static EMAC *emac = &EMAC::get_default_instance();
118+
emac_handle = emac;
118119

119120
emac->set_link_input_cb(emac_if_link_input_cb);
120121
emac->set_link_state_cb(emac_if_link_state_change_cb);

features/FEATURE_LWIP/lwip-interface/LWIPInterface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,11 @@ nsapi_error_t LWIP::Interface::bringdown()
587587
#if LWIP_IPV6
588588
mbed_lwip_clear_ipv6_addresses(&netif);
589589
#endif
590+
#if LWIP_IPV4
591+
ip_addr_set_zero(&(netif.ip_addr));
592+
ip_addr_set_zero(&(netif.netmask));
593+
ip_addr_set_zero(&(netif.gw));
594+
#endif
590595

591596
osSemaphoreDelete(has_any_addr);
592597
osSemaphoreAttr_t attr;

0 commit comments

Comments
 (0)