Skip to content

Networking update: general refactoring, unifying EMAC #5202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented Sep 26, 2017

Work picked up by Kari Haapalehto in
#4918, from Bartek Szatkowsi's
branch at #4079, commit 8c28917.

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:

  • Refactor k64f_emac
  • Remove lwip depencies
  • Correct doxygen warnings
  • Add weak definitions for mbed_ipstack.h functions.
  • Remove emac_interface_t - drivers register with emac_interface_ops_t and
    void *, and get an mbed_ipstack_interface_t to pass to stack.
  • Reinstate use of EthInterface abstraction
  • ipstack_lwip.c renamed as mbed_ipstack_lwip.c
  • Correct and clarify HW address EMAC ops
  • Restore MBED_MAC_ADDR implementation
  • Integrate PPP support with mbed_ipstack_lwip.cpp

Work picked up by Kari Haapalehto in
ARMmbed#4918, from Bartek Szatkowsi's
branch at ARMmbed#4079, commit 8c28917.

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:

* Refactor k64f_emac
* Remove lwip depencies
* Correct doxygen warnings
* Add weak definitions for mbed_ipstack.h functions.
* Remove emac_interface_t - drivers register with emac_interface_ops_t and
  void *, and get an mbed_ipstack_interface_t to pass to stack.
* Reinstate use of EthInterface abstraction
* ipstack_lwip.c renamed as mbed_ipstack_lwip.c
* Correct and clarify HW address EMAC ops
* Restore MBED_MAC_ADDR implementation
* Integrate PPP support with mbed_ipstack_lwip.cpp
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 26, 2017

cc @bulislaw @geky @c1728p9

@kjbracey
Copy link
Contributor Author

kjbracey commented Sep 26, 2017

This PR squashes together everything from #4079 and #4918, reintegrates bits from master lost in #4918, and merges it with current master, incorporating the PPP work and K64F updates that happened since.

I think this PR should finalise the API - it would leave only K64F Ethernet functional. Other driver updates can follow onto the feature_emac branch.

To do now:

  • Do we need DEVICE_ETH?
  • Align nsapi_ppp APIs? This leaves them untouched, but should move to use mbed_ipstack APIs directly. Maybe can follow?
  • Porting guide (from lwIP and current EMAC)
  • ...?

@kjbracey kjbracey mentioned this pull request Sep 26, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 26, 2017

@KariHaapalehto Please look at CI failures (travis and jenkins CI)

@kjbracey
Copy link
Contributor Author

kjbracey commented Sep 26, 2017

This is a PR to a feature branch, rather than to master - I think we'd be expecting failures on a number of platforms until driver updates follow. Will check though.

@mikaleppanen
Copy link

Would it make sence to unify emac_stack_mem.h and emac_api.h so that also memory interface would use function pointers and ip stack would register call backs to those.

@theotherjimmy
Copy link
Contributor

@kjbracey-arm Bump. What's going on with this PR?

@kjbracey
Copy link
Contributor Author

We reviewed this with @sg-, and agreed that we're going to go for a significant rework, making it more C++-ey.

I'll probably start review of that in a new PR, so close this one for archiving?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 10, 2017

thanks for the update, +1, closing it then

@0xc0170 0xc0170 closed this Oct 10, 2017
kjbracey added a commit to kjbracey/mbed-os that referenced this pull request Jan 10, 2018
Initial work by Bartek Szatkowski in ARMmbed#4079,
reworked following review of ARMmbed#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 ARMmbed#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
kjbracey added a commit to kjbracey/mbed-os that referenced this pull request Feb 1, 2018
Initial work by Bartek Szatkowski in ARMmbed#4079,
reworked following review of ARMmbed#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 ARMmbed#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
0xc0170 pushed a commit that referenced this pull request Feb 5, 2018
Initial work by Bartek Szatkowski in #4079,
reworked following review of #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
kjbracey added a commit that referenced this pull request Feb 12, 2018
Initial work by Bartek Szatkowski in #4079,
reworked following review of #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
kjbracey added a commit that referenced this pull request Apr 18, 2018
Initial work by Bartek Szatkowski in #4079,
reworked following review of #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
kjbracey added a commit to kjbracey/mbed-os that referenced this pull request Apr 24, 2018
Initial work by Bartek Szatkowski in ARMmbed#4079,
reworked following review of ARMmbed#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 ARMmbed#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
kjbracey added a commit to kjbracey/mbed-os that referenced this pull request May 8, 2018
Initial work by Bartek Szatkowski in ARMmbed#4079,
reworked following review of ARMmbed#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 ARMmbed#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
kjbracey added a commit that referenced this pull request May 22, 2018
Initial work by Bartek Szatkowski in #4079,
reworked following review of #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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants