I would like to restrict these to devices with "device_has": "EMAC", but
the framework doesn't currently permit that. Revisit as more drivers
are EMAC-enabled or if the framework changes.
Make ETHERNET configuration the default if DEVICE_EMAC is present,
instead of if FEATURE_LWIP is present.
This limits it to targets which have been ported to the new EMAC API.
Add LWIP feature to JSON config, as in principle the targets shouldn't
be adding it themselves. Opens scope to having Nanostack-based tests.
Disable tests for the Realtek and Wifi drivers that aren't ported yet.
As we've introduced virtual inheritance to support EMACInterface, we can
no longer use C-style casts or static_cast to downcast from
NetworkInterface to more specific types. RTTI is disabled in the
toolchains, so dynamic_cast is unavailables.
Add virtual downcast methods to permit conversions to the 6 derived
classes. Probably only needed for EMACInterface, WiFiInterface and
EthInterface, but handles the set.
The soft device is not consistent as it is required to force the connection to a resolved resolvable address so it should be known if the target is an identity address.
This has been superceded by CellularBase. Name change occurred late
in review of https://github.com/ARMmbed/mbed-os/pull/4119 and
original unused CellularInterface was left behind.
Rather than let "EthernetInterface" be the base EMAC NetworkInterface,
insert an "EMACInterface" class.
EthernetInterface then derives from EMACInterface and EthInterface.
A Wi-Fi driver can derive from EMACInterface and WiFiInterface - this
will be more logical than deriving from EthernetInterface and
WiFiInterface.
This does mean adding a couple of virtual inheritances to avoid
duplicate NetworkInterfaces:
NetworkInterface
/ \
virtual / \ virtual
/ \
EMACInterface WiFiInterface
\ /
\ /
\ /
MyCustomWiFiInterface
Initial work by Bartek Szatkowski in https://github.com/ARMmbed/mbed-os/pull/4079,
reworked following review of https://github.com/ARMmbed/mbed-os/pull/5202 to
transform the entire system into C++, retaining the basic functionality.
Bartek's summary:
* Porting ethernet to EMAC
* Updating EMAC to enable multiple interfaces
* Untangling networking classes, making the abstractions a bit clearer to follow, etc
* General refactoring
* Removal of DEVICE_EMAC flag and introducing DEVICE_ETH and DEVICE_WIFI
Revisions since initial branch:
* Remove lwip depencies
* Correct doxygen warnings
* Remove emac_api.h, replace with C++ EMAC abstract class.
* Create OnboardNetworkInterface, and LWIP implementation.
* Mappings since #4079
lwip-interface/nsapi_stack_lwip.c -> LWIPStack.cpp
lwip-interface/ipstack_lwip.c -> LWIPInterface.cpp
netsocket/mbed_ipstack.h -> OnboardNetworkStack.h
hal/emac_api.h -> EMAC.h
* Reinstate use of EthInterface abstraction
* Correct and clarify HW address EMAC ops
* Restore MBED_MAC_ADDR implementation
* Integrate PPP support with LWIP::Interface.
* Convert K64F lwIP driver to K64F_EMAC.
To do:
* Convert emac_stack_mem.h to follow this pattern.
* Figure out DEVICE_ETH/EMAC
* Update all drivers to use EMAC