Skip to content
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

Various improvements for the eth_mcux driver #28874

Merged

Conversation

armandciejak
Copy link
Contributor

@armandciejak armandciejak commented Oct 2, 2020

Here is the list of improvements:

  • Implement set_config
  • Use devicetree status okay instead of CONFIG_ETH_MCUX_*
  • Make eth_context.clock correct for both Kinetis and i.MX RT
  • Simplify MAC address assignment function: there is now a single function defined per instance
  • Other small things

NOTE: There should be absolutely no functional change.

@galak galak requested review from agansari and jukkar October 2, 2020 15:46
@armandciejak armandciejak force-pushed the eth-mcux-improvements branch 2 times, most recently from 0c0fbf9 to 01b12c1 Compare October 5, 2020 07:40
@github-actions github-actions bot added the area: Samples Samples label Oct 5, 2020
drivers/ethernet/eth_mcux.c Outdated Show resolved Hide resolved
drivers/ethernet/CMakeLists.txt Outdated Show resolved Hide resolved
This allows setting the MAC address at run time.

Signed-off-by: Antoine Zen-Ruffinen <[email protected]>
Signed-off-by: Armand Ciejak <[email protected]>
drivers/ethernet/eth_mcux.c Show resolved Hide resolved
drivers/ethernet/eth_mcux.c Show resolved Hide resolved
Armand Ciejak added 9 commits October 5, 2020 18:54
Use node's status in device tree instead.

Signed-off-by: Armand Ciejak <[email protected]>
This fixes wrong value for i.MX RT.
This is one less hard-coded value in eth_N_context structures.

Signed-off-by: Armand Ciejak <[email protected]>
This is better than declaring it unused.

Signed-off-by: Armand Ciejak <[email protected]>
Spare a function call.

Signed-off-by: Armand Ciejak <[email protected]>
Do not override OUI of the local MAC address in the devicetree.
Simplify the mac address assignment conditions. Each interface has
its own function. Code duplication will be eliminated with the
use of DT_INST_FOREACH_STATUS_OKAY in a later commit to completely
remove duplicated code.
The 3 possible MAC address assignment (local, random and unique)
are covered and have been tested.

Signed-off-by: Armand Ciejak <[email protected]>
As well as #ifndef.
Apply it for all CONFIG_* defines.

Signed-off-by: Armand Ciejak <[email protected]>
This covers the case of 1 controller having PTP enabled and
the other not.

Signed-off-by: Armand Ciejak <[email protected]>
Both eth_* and eth* were used before.

Signed-off-by: Armand Ciejak <[email protected]>
VALN -> VLAN

Signed-off-by: Armand Ciejak <[email protected]>
@armandciejak armandciejak force-pushed the eth-mcux-improvements branch from 972a399 to a0db435 Compare October 5, 2020 16:54
@armandciejak armandciejak requested a review from dleach02 October 8, 2020 06:50
@carlescufi carlescufi merged commit 1faf2a9 into zephyrproject-rtos:master Oct 9, 2020
chrta added a commit to lemonbeat/zephyr that referenced this pull request Nov 5, 2020
When setting the MAC address, the ethernet driver has to call
net_if_set_link_addr() with the updated address. This was missing and is
added now.
See e.g.
zephyrproject-rtos#28874

Signed-off-by: Christian Taedcke <[email protected]>
jukkar pushed a commit that referenced this pull request Nov 6, 2020
When setting the MAC address, the ethernet driver has to call
net_if_set_link_addr() with the updated address. This was missing and is
added now.
See e.g.
#28874

Signed-off-by: Christian Taedcke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants