Skip to content

Commit 42a79ac

Browse files
committed
decode_pcapng: Add DPv6 AND HDMIV5
Original customer firmware Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 01ad902 commit 42a79ac

File tree

1 file changed

+53
-15
lines changed

1 file changed

+53
-15
lines changed

decode_pcapng.py

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,25 @@ def usb_urb(s):
5959

6060
# To find them, look at the pcap in wireguard and check the source/destination
6161
images = {
62-
101: {
62+
'dp-6': {
6363
'type': 'DP',
64-
'filename': 'reflash101.pcapng',
64+
'version': '006',
65+
'filename': 'dp-flash-006.pcapng',
6566
'second_first': False,
6667
'devices': {
6768
1: {
68-
'busid': 2,
69-
'device': 12,
69+
'busid': 1,
70+
'device': 7,
7071
},
7172
2: {
72-
'busid': 2,
73-
'device': 13,
73+
'busid': 1,
74+
'device': 8,
7475
}
7576
}
7677
},
77-
8: {
78+
'8': {
7879
'type': 'DP',
80+
'version': '008',
7981
'filename': 'flash-100-to-8.pcapng',
8082
'second_first': False,
8183
'devices': {
@@ -89,8 +91,9 @@ def usb_urb(s):
8991
}
9092
}
9193
},
92-
100: {
94+
'100': {
9395
'type': 'DP',
96+
'version': '100',
9497
'filename': 'reflash100.pcapng',
9598
'second_first': False,
9699
'devices': {
@@ -104,11 +107,43 @@ def usb_urb(s):
104107
}
105108
}
106109
},
110+
'101': {
111+
'type': 'DP',
112+
'version': '101',
113+
'filename': 'reflash101.pcapng',
114+
'second_first': False,
115+
'devices': {
116+
1: {
117+
'busid': 2,
118+
'device': 12,
119+
},
120+
2: {
121+
'busid': 2,
122+
'device': 13,
123+
}
124+
}
125+
},
107126
# HDMI
108-
6: {
127+
'5': {
128+
'type': 'HDMI',
129+
'version': '005',
130+
'filename': 'hdmi-flash-005.pcapng',
131+
'second_first': True,
132+
'devices': {
133+
1: {
134+
'busid': 1,
135+
'device': 4,
136+
},
137+
2: {
138+
'busid': 1,
139+
'device': 5,
140+
}
141+
}
142+
},
143+
'hdmi-6': {
109144
'type': 'HDMI',
110-
# Yeah.. wrong filename
111-
'filename': 'hdmi-flash-5.pcapng',
145+
'version': '005',
146+
'filename': 'hdmi-reflash-006.pcapng',
112147
'second_first': False,
113148
'devices': {
114149
1: {
@@ -123,6 +158,7 @@ def usb_urb(s):
123158
},
124159
102: {
125160
'type': 'HDMI',
161+
'version': '102',
126162
'filename': 'hdmi-flash-102.pcapng',
127163
'second_first': True,
128164
'devices': {
@@ -138,6 +174,7 @@ def usb_urb(s):
138174
},
139175
103: {
140176
'type': 'HDMI',
177+
'version': '103',
141178
'filename': 'hdmi-flash-103.pcapng',
142179
'second_first': True,
143180
'devices': {
@@ -153,6 +190,7 @@ def usb_urb(s):
153190
},
154191
104: {
155192
'type': 'HDMI',
193+
'version': '104',
156194
'filename': 'hdmi-flash-104.pcapng',
157195
'second_first': True,
158196
'devices': {
@@ -166,8 +204,9 @@ def usb_urb(s):
166204
}
167205
}
168206
},
169-
105: {
207+
'105': {
170208
'type': 'HDMI',
209+
'version': '105',
171210
'filename': 'hdmi-flash-105.pcapng',
172211
'second_first': False,
173212
'devices': {
@@ -185,7 +224,6 @@ def usb_urb(s):
185224

186225
ROW_SIZE = 128
187226
MAX_ROWS = 1024
188-
FW_VERSION = None
189227

190228
DEBUG = False
191229
VERBOSE = False
@@ -378,8 +416,8 @@ def decode_pcapng(path, info):
378416

379417

380418
def main():
381-
FW_VERSION = int(sys.argv[1])
382-
info = images[FW_VERSION]
419+
info = images[sys.argv[1]]
420+
FW_VERSION = info['version']
383421
path = '/home/zoid/framework/dp-card-fw-update/{}'.format(info['filename'])
384422

385423
(img1_binary, img2_binary) = decode_pcapng(path, info)

0 commit comments

Comments
 (0)