-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve support for Cinterion ALAS5 modem #551
Open
ZabelinK
wants to merge
2
commits into
balena-os:master
Choose a base branch
from
ZabelinK:zabelk/kontron-come-xelx-mbim-patch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
...a-generic/recipes-connectivity/modemmanager/balena-files/77-mm-cinterion-port-types.rules
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# do not edit this file, it will be overwritten on update | ||
|
||
ACTION!="add|change|move|bind", GOTO="mm_cinterion_port_types_end" | ||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e2d", GOTO="mm_cinterion_port_types" | ||
GOTO="mm_cinterion_port_types_end" | ||
|
||
LABEL="mm_cinterion_port_types" | ||
SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" | ||
|
||
# PHS8 | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ENV{.MM_USBIFNUM}=="01", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
|
||
# PLS8 port types | ||
# ttyACM0 (if #0): AT port | ||
# ttyACM1 (if #2): AT port | ||
# ttyACM2 (if #4): GPS data port | ||
# ttyACM3 (if #6): unknown | ||
# ttyACM4 (if #8): unknown | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1" | ||
|
||
# PLS62 family non-mbim enumeration uses alternate settings for 2G band management | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005b", ENV{ID_MM_CINTERION_MODEM_FAMILY}="imt" | ||
# PLS62 family non-mbim enumeration | ||
# ttyACM0 (if #0): AT port | ||
# ttyACM1 (if #2): AT port | ||
# ttyACM2 (if #4): can be AT or GNSS in some models | ||
# ttyACM3 (if #6): AT port (but just ignore) | ||
# ttyACM4 (if #8): DIAG/QCDM | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005b", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005b", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005b", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005b", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005b", ENV{.MM_USBIFNUM}=="08", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1" | ||
|
||
# PLS62 family mbim enumeration | ||
# ttyACM0 (if #0): AT port | ||
# ttyACM1 (if #2): AT port | ||
# ttyACM2 (if #4): can be AT or GNSS in some models | ||
# ttyACM3 (if #6): AT port (but just ignore) | ||
# ttyACM4 (if #8): DIAG/QCDM | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005d", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005d", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005d", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005d", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="005d", ENV{.MM_USBIFNUM}=="08", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1" | ||
|
||
# PLS63 | ||
# ttyACM0 (if #0): AT port | ||
# ttyACM1 (if #2): AT port | ||
# ttyACM2 (if #4): GPS data port | ||
# ttyACM3 (if #6): DIAG/QCDM | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0069", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0069", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0069", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0069", ENV{.MM_USBIFNUM}=="06", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1" | ||
|
||
# PLS83 | ||
# ttyACM0 (if #0): AT port | ||
# ttyACM1 (if #2): AT port | ||
# ttyACM2 (if #4): GPS data port | ||
# ttyACM3 (if #6): DIAG/QCDM | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="006F", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="006F", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="006F", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="006F", ENV{.MM_USBIFNUM}=="06", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1" | ||
|
||
# ALAS5 | ||
# ttyACM0 (if #0): AT port | ||
# ttyACM1 (if #1): AT port | ||
# ttyACM2 (if #2): GNSS port | ||
# ttyACM3 (if #6): AT port (but just ignore) | ||
# ttyACM4 (if #8): DIAG/QCDM | ||
#ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" | ||
#ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" | ||
#ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_GPS}="1" | ||
#ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" | ||
#ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="08", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_QCDM}="1" | ||
|
||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="00", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="04", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="06", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" | ||
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0065", ENV{.MM_USBIFNUM}=="08", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1" | ||
|
||
LABEL="mm_cinterion_port_types_end" | ||
|
||
# ignore KBox | ||
ATTRS{idVendor}=="208b", ATTRS{idProduct}=="0035", ENV{ID_MM_DEVICE_IGNORE}="1" | ||
|
||
|
||
|
15 changes: 15 additions & 0 deletions
15
layers/meta-balena-generic/recipes-connectivity/modemmanager/modemmanager_%.bbappend
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FILESEXTRAPATHS:append := ":${THISDIR}/balena-files" | ||
SYSTEMD_AUTO_ENABLE = "enable" | ||
|
||
SRC_URI:append = " \ | ||
file://77-mm-cinterion-port-types.rules \ | ||
" | ||
|
||
|
||
do_install:append() { | ||
install -m 0644 ${WORKDIR}/77-mm-cinterion-port-types.rules ${D}${base_libdir}/udev/rules.d/ | ||
} | ||
|
||
FILES:${PN} += " \ | ||
${base_libdir}/udev/rules.d/77-mm-cinterion-port-types.rules \ | ||
" |
16 changes: 16 additions & 0 deletions
16
...eta-balena-generic/recipes-kernel/linux/files/kontron-come-xelx/0001-cinterion-mbim.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c | ||
index cd4083e0b3b9..afd784712ea6 100644 | ||
--- a/drivers/net/usb/cdc_mbim.c | ||
+++ b/drivers/net/usb/cdc_mbim.c | ||
@@ -670,6 +670,11 @@ static const struct usb_device_id mbim_devs[] = { | ||
.driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle, | ||
}, | ||
|
||
+ /* Kontron MBIM */ | ||
+ { USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0065, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | ||
+ .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle, | ||
+ }, | ||
+ | ||
/* default entry */ | ||
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE), | ||
.driver_info = (unsigned long)&cdc_mbim_info_zlp, |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of doing it like this I think it is best to do a separate meta-balena PR with a patch to ModemManager in src/plugins/cinterion/77-mm-cinterion-port-types.rules and add there the changes you need for ALAS5 modem
cc @alexgg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I move cdc_mbim.c patch there too or is it better to keep it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please