net: usb: ipheth: add CDC NCM support

From: Georgi Valkov
Date: Thu May 11 2023 - 06:04:37 EST


Can you please review, and accept the following patch. I’ve been using it for one year.
I added the author Foster Snowhill to this mail, as well as a link to his Github [1].
If needed, we can ask him to add the tag Signed-off-by:


From 257d843a7f90e4e519635f82fe5b73fba918ec33 Mon Sep 17 00:00:00 2001
From: Foster Snowhill <Forst@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Apr 2022 23:50:09 +0200
Subject: [PATCH] net: usb: ipheth: add CDC NCM support (PoC)

Recent iOS releases support CDC NCM encapsulation on RX. This mode is
the default on macOS and Windows.

When reconnecting a device from a macOS/Windows machine to a Linux
machine, the device stays in NCM mode. Therefore to correctly support
such a device, the driver has to either support the NCM mode too, or
somehow put the device back into legacy mode.

To match the behaviour of the macOS/Windows driver, and since there
are no documented control commands to revert to legacy mode, I chose
to implement basic NCM support.

With this change, the device is attempted to be put into NCM mode by
default, and falls back to legacy mode if said attempt failed.

Tested-by: Georgi Valkov <gvalkov@xxxxxx>



[1] https://github.com/Forst/linux-stable/commit/257d843a7f90e4e519635f82fe5b73fba918ec33#diff-d13f85b8acc1204f31e7abc538e9fdb1faa07b94cd928800b6b976561d32f6e3

This can be applied directly to Linux master, as well as 5.10 and 5.15 stable.

Attachment: 0001-net-usb-ipheth-add-CDC-NCM-support-PoC.patch
Description: Binary data