Add EtherCAT support#48
Open
ec-support wants to merge 1 commit into
Open
Conversation
f6ae2c5 to
e9c8f48
Compare
shifty91
requested changes
May 1, 2026
| CONFIG_STORE_MAC_PARAM_CLASS(TsnLowDestination, l2_destination); | ||
|
|
||
| CONFIG_STORE_BOOL_PARAM_CLASS(RtcEnabled, enabled); | ||
| CONFIG_STORE_BOOL_PARAM_CLASS(RtcEcatEnabled, ecat_enabled); |
Collaborator
There was a problem hiding this comment.
Please, add this to GenericL2 traffic class instead. RTC etc. are Profinet specific.
Also, I suggest to call it GenericL2FrameType (e.g. L2, EtherCAT, ...) instead of EcatEnabled. This allows to add further frame types later.
| struct thread_context *thread_context = data; | ||
| uint64_t tx_sw_timestamp, rx_sw_timestamp; | ||
| struct timespec rx_time = {}; | ||
| // uint64_t sequence_counter; |
| struct ethhdr *eth; | ||
| uint16_t proto; | ||
|
|
||
| clock_gettime(app_config.application_clock_id, &rx_time); |
| frame_config.tx_timestamp = ts_to_ns(&tx_time); | ||
| frame_config.meta_data_offset = thread_context->meta_data_offset; | ||
|
|
||
| err = prepare_frame_for_tx(&frame_config); |
Collaborator
There was a problem hiding this comment.
Adjust prepare_frame_for_tx() for EtherCAT. You can check if traffic_class == L2 and FrameType == EtherCAT, then add the EtherCAT time stamp.
| eth = (struct vlan_ethernet_header *)data; | ||
| memcpy(eth->destination, app_config.debug_monitor_destination, ETH_ALEN); | ||
| if (xdp->ecat_enabled) { | ||
| ecat_add_timestamp(&data[0], ts_to_ns(&tx_time), xdp->frame_length); |
Collaborator
There was a problem hiding this comment.
Same comment here. Please, adjust prepare_frame_for_tx() for EtherCAT.
| @@ -0,0 +1,57 @@ | |||
| // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | |||
| /* | |||
| * Copyright (C) 2021,2022 Linutronix GmbH | |||
Collaborator
There was a problem hiding this comment.
Copyright (C) 2026 acontis technologies GmbH
Collaborator
|
Thanks for your contribution. Please, rework according to the review comments. My main points are:
Thanks, Kurt |
2e6de77 to
9e793c0
Compare
Signed-off-by: ec-support <ecsupport@acontis.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.