aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-06-25 12:48:01 -0500
committerDan Williams <dcbw@redhat.com>2012-06-25 12:48:01 -0500
commit91e6cc9f61034025310b5cec522895a2c4c7760b (patch)
tree81ca93bf1e4e7f0c96ce57866950fec3154196c5
parenta75ed35a9fea4a668be007469616e151cc8fb61f (diff)
decode: handle FUNCTION_CLASS_INTERFACE requests like CONTROL_TRANSFER
The Novatel USB551L uses these to send data to the device, but the data is QMUX.
-rw-r--r--decode/packet.py6
-rw-r--r--decode/qmux.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/decode/packet.py b/decode/packet.py
index 1259b124..695828d8 100644
--- a/decode/packet.py
+++ b/decode/packet.py
@@ -43,7 +43,7 @@ funcs = {
"-- URB_FUNCTION_CONTROL_TRANSFER:": (URBF_CONTROL, True, "C"),
"-- URB_FUNCTION_SET_FEATURE_TO_DEVICE:": (URBF_SET_FEATURE, False, None),
"-- URB_FUNCTION_ABORT_PIPE:": (URBF_SET_FEATURE, False, None),
- "-- URB_FUNCTION_CLASS_INTERFACE:": (URBF_CLASS_IFACE, False, None),
+ "-- URB_FUNCTION_CLASS_INTERFACE:": (URBF_CLASS_IFACE, True, "C"),
"-- URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE:": (URBF_CLEAR_FEATURE, False, None)
}
@@ -127,7 +127,7 @@ class Packet:
if self.func == URBF_TRANSFER:
self.protocol = self.transfer_prot
- elif self.func == URBF_CONTROL:
+ elif self.func == URBF_CONTROL or self.func == URBF_CLASS_IFACE:
self.protocol = self.control_prot
if self.protocol:
@@ -140,7 +140,7 @@ class Packet:
self.in_data = True
return False # not done; need more lines
- if line.find("UrbLink = ") >= 0:
+ if line.find("UrbLink = ") >= 0 or line.find("UrbLink =") >= 0:
if self.in_data:
self.in_data = False
diff --git a/decode/qmux.py b/decode/qmux.py
index b26d5345..a5543ac2 100644
--- a/decode/qmux.py
+++ b/decode/qmux.py
@@ -65,6 +65,8 @@ class Tlv:
cmd = svc[1][self.cmdno]
except KeyError:
pass
+ except TypeError:
+ pass
tlvlist = None
if self.direction == TP_REQUEST:
tlvlist = cmd[1]
@@ -184,6 +186,8 @@ def show(data, prefix, direction):
scmd = qmi_cmd_to_string(cmdno, service)
except KeyError:
pass
+ except TypeError:
+ pass
print prefix + " Cmd: 0x%04x (%s)" % (cmdno, scmd)
print prefix + " Size: 0x%04x" % size