[PATCH] filter: cdc-acm protocols 1 through 6 are all AT-capable
Aleksander Morgado
aleksander at aleksander.es
Thu Jan 18 15:33:22 UTC 2018
As per USB-IF "Class definitions for Communication Devices 1.2" docs.
Reported-by: Iván Sánchez Ortega <ivan at sanchezortega.es>
---
src/mm-filter.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/mm-filter.c b/src/mm-filter.c
index ca0241a0..6526cfaa 100644
--- a/src/mm-filter.c
+++ b/src/mm-filter.c
@@ -134,12 +134,28 @@ mm_filter_port (MMFilter *self,
return TRUE;
}
- /* If the TTY kernel driver is cdc-acm and the interface is class=2/subclass=2/protocol=1, allow it */
+ /*
+ * If the TTY kernel driver is cdc-acm and the interface is class=2/subclass=2/protocol=[1-6], allow it.
+ *
+ * Class definitions for Communication Devices 1.2
+ * Communications Interface Class Control Protocol Codes:
+ * 00h | USB specification | No class specific protocol required
+ * 01h | ITU-T V.250 | AT Commands: V.250 etc
+ * 02h | PCCA-101 | AT Commands defined by PCCA-101
+ * 03h | PCCA-101 | AT Commands defined by PCCA-101 & Annex O
+ * 04h | GSM 7.07 | AT Commands defined by GSM 07.07
+ * 05h | 3GPP 27.07 | AT Commands defined by 3GPP 27.007
+ * 06h | C-S0017-0 | AT Commands defined by TIA for CDMA
+ * 07h | USB EEM | Ethernet Emulation Model
+ * 08h-FDh | | RESERVED (future use)
+ * FEh | | External Protocol: Commands defined by Command Set Functional Descriptor
+ * FFh | USB Specification | Vendor-specific
+ */
if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_ACM_INTERFACE) &&
(!g_strcmp0 (driver, "cdc_acm")) &&
(mm_kernel_device_get_interface_class (port) == 2) &&
(mm_kernel_device_get_interface_subclass (port) == 2) &&
- (mm_kernel_device_get_interface_protocol (port) == 1)) {
+ (mm_kernel_device_get_interface_protocol (port) >= 1) && (mm_kernel_device_get_interface_protocol (port) <= 6)) {
mm_dbg ("[filter] (%s/%s): port allowed: cdc-acm interface reported AT-capable", subsystem, name);
return TRUE;
}
--
2.15.1
More information about the ModemManager-devel
mailing list