diff --git a/features/lwipstack/LWIPInterface.cpp b/features/lwipstack/LWIPInterface.cpp index d0706c603b..1fe8f4f92e 100644 --- a/features/lwipstack/LWIPInterface.cpp +++ b/features/lwipstack/LWIPInterface.cpp @@ -565,41 +565,6 @@ nsapi_error_t LWIP::add_ethernet_interface(EMAC &emac, bool default_if, OnboardN #endif //LWIP_ETHERNET } -nsapi_error_t LWIP::remove_ethernet_interface(OnboardNetworkStack::Interface **interface_out) -{ -#if LWIP_ETHERNET - - if ((interface_out != NULL) && (*interface_out != NULL)) { - - Interface *lwip = static_cast(*interface_out); - Interface *node = lwip->list; - - if (lwip->list != NULL) { - if (lwip->list == lwip) { - lwip->list = lwip->list->next; - netif_remove(&node->netif); - *interface_out = NULL; - delete node; - } else { - while (node->next != NULL && node->next != lwip) { - node = node->next; - } - if (node->next != NULL && node->next == lwip) { - Interface *remove = node->next; - node->next = node->next->next; - netif_remove(&remove->netif); - *interface_out = NULL; - delete remove; - } - } - } - } - - return NSAPI_ERROR_OK; -#else - return NSAPI_ERROR_UNSUPPORTED; -#endif //LWIP_ETHERNET -} nsapi_error_t LWIP::add_l3ip_interface(L3IP &l3ip, bool default_if, OnboardNetworkStack::Interface **interface_out) { diff --git a/features/lwipstack/LWIPStack.h b/features/lwipstack/LWIPStack.h index bff801267e..18cf9d54f6 100644 --- a/features/lwipstack/LWIPStack.h +++ b/features/lwipstack/LWIPStack.h @@ -288,14 +288,6 @@ public: * @param[out] interface_out pointer to stack interface object controlling the L3IP * @return NSAPI_ERROR_OK on success, or error code */ - virtual nsapi_error_t remove_ethernet_interface(OnboardNetworkStack::Interface **interface_out); - - /** Remove a network interface from IP stack - * - * Removes PPP objects,network interface from stack list, and shutdown device driver. - * @param[out] interface_out pointer to stack interface object controlling the PPP - * @return NSAPI_ERROR_OK on success, or error code - */ virtual nsapi_error_t remove_l3ip_interface(OnboardNetworkStack::Interface **interface_out); /** Remove a network interface from IP stack diff --git a/features/netsocket/OnboardNetworkStack.h b/features/netsocket/OnboardNetworkStack.h index 16f1a79107..7a3f25d9ea 100644 --- a/features/netsocket/OnboardNetworkStack.h +++ b/features/netsocket/OnboardNetworkStack.h @@ -169,11 +169,6 @@ public: return NSAPI_ERROR_UNSUPPORTED; }; - virtual nsapi_error_t remove_ethernet_interface(Interface **interface_out) - { - return NSAPI_ERROR_OK; - }; - virtual nsapi_error_t remove_l3ip_interface(Interface **interface_out) { return NSAPI_ERROR_OK; diff --git a/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSTAInterface.cpp b/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSTAInterface.cpp index 7f4db2b2f9..de4ffdfbd6 100644 --- a/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSTAInterface.cpp +++ b/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSTAInterface.cpp @@ -355,15 +355,6 @@ nsapi_error_t WhdSTAInterface::disconnect() } whd_emac_wifi_link_state_changed(_whd_emac.ifp, WHD_FALSE); - // remove the interface added in connect - if (_interface) { - nsapi_error_t err = _stack.remove_ethernet_interface(&_interface); - if (err != NSAPI_ERROR_OK) { - return err; - } - _iface_shared.iface_sta = NULL; - } - res = whd_wifi_deregister_event_handler(_whd_emac.ifp, sta_link_update_entry); if (res != WHD_SUCCESS) { return whd_toerror(res); diff --git a/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSoftAPInterface.cpp b/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSoftAPInterface.cpp index 3446bf2bc5..6a764750ee 100644 --- a/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSoftAPInterface.cpp +++ b/features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_WHD/interface/WhdSoftAPInterface.cpp @@ -201,16 +201,6 @@ int WhdSoftAPInterface::stop(void) if (res != WHD_SUCCESS) { return whd_toerror(res); } - - // remove the interface added in start - if (_interface) { - nsapi_error_t err = _stack.remove_ethernet_interface(&_interface); - if (err != NSAPI_ERROR_OK) { - return err; - } - _iface_shared.iface_softap = NULL; - } - return NSAPI_ERROR_OK; }