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

modem: modem_cellular: Configurable MTU for CMUX #2661

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

SeppoTakalo
Copy link
Contributor

Pull in changes from zephyrproject-rtos/zephyr#87115

As the RC is approaching and the PR is slow to get in, I'll create a fromlist PR to get these changes into NCS for testing.

If the PR goes int before our RC, I'll refactor this to [fromtree]

Allow configuring MTU for CMUX.
Some AT manual and specification define this as a
frame size. Linux ldattach default to 127 bytes,
3GPP TS 27.010 defaults to 31.

We should limit our CMUX frames to a size that
remote end is capable of handling.
Linux silently drops oversized frames.

Also, remove MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE as
this was only limiting a buffer sizes, and resulted
CMUX frames to be capped to same value.
Use MODEM_CMUX_WORK_BUFFER_SIZE and MODEM_CMUX_MTU instead.

Also rename CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZES to
CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZE as it is now
only used as a Chat module. DLCI pipes use
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
(cherry picked from commit c78081e5cfe8412f43e8851d4060cbb4c93f5546)
If we end up writing zero bytes to cmux output, we can return
zero instead of -ENOMEM as it would break various modules when
using small buffers. For example modem_chat.c does not tolerate
-ENOMEM but handles zero OK.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
(cherry picked from commit 15b0f9033b3e5f820547fa291d72c23304aa0c7c)
@tomi-font
Copy link
Contributor

Can now be made a fromtree.

@SeppoTakalo
Copy link
Contributor Author

This is already changed to [nrf fromtree]

@SeppoTakalo SeppoTakalo added this to the ncs-3.0.0 milestone Mar 25, 2025
@nordicjm nordicjm merged commit 89fe459 into nrfconnect:main Mar 25, 2025
18 checks passed
@tomi-font
Copy link
Contributor

Ah, nice. 🙂 Somehow didn't get a notification for the force push.

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.

None yet

5 participants