@@ -59,23 +59,25 @@ def usb_urb(s):
59
59
60
60
# To find them, look at the pcap in wireguard and check the source/destination
61
61
images = {
62
- 101 : {
62
+ 'dp-6' : {
63
63
'type' : 'DP' ,
64
- 'filename' : 'reflash101.pcapng' ,
64
+ 'version' : '006' ,
65
+ 'filename' : 'dp-flash-006.pcapng' ,
65
66
'second_first' : False ,
66
67
'devices' : {
67
68
1 : {
68
- 'busid' : 2 ,
69
- 'device' : 12 ,
69
+ 'busid' : 1 ,
70
+ 'device' : 7 ,
70
71
},
71
72
2 : {
72
- 'busid' : 2 ,
73
- 'device' : 13 ,
73
+ 'busid' : 1 ,
74
+ 'device' : 8 ,
74
75
}
75
76
}
76
77
},
77
- 8 : {
78
+ '8' : {
78
79
'type' : 'DP' ,
80
+ 'version' : '008' ,
79
81
'filename' : 'flash-100-to-8.pcapng' ,
80
82
'second_first' : False ,
81
83
'devices' : {
@@ -89,8 +91,9 @@ def usb_urb(s):
89
91
}
90
92
}
91
93
},
92
- 100 : {
94
+ ' 100' : {
93
95
'type' : 'DP' ,
96
+ 'version' : '100' ,
94
97
'filename' : 'reflash100.pcapng' ,
95
98
'second_first' : False ,
96
99
'devices' : {
@@ -104,11 +107,43 @@ def usb_urb(s):
104
107
}
105
108
}
106
109
},
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
+ },
107
126
# 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' : {
109
144
'type' : 'HDMI' ,
110
- # Yeah.. wrong filename
111
- 'filename' : 'hdmi-flash-5 .pcapng' ,
145
+ 'version' : '005' ,
146
+ 'filename' : 'hdmi-reflash-006 .pcapng' ,
112
147
'second_first' : False ,
113
148
'devices' : {
114
149
1 : {
@@ -123,6 +158,7 @@ def usb_urb(s):
123
158
},
124
159
102 : {
125
160
'type' : 'HDMI' ,
161
+ 'version' : '102' ,
126
162
'filename' : 'hdmi-flash-102.pcapng' ,
127
163
'second_first' : True ,
128
164
'devices' : {
@@ -138,6 +174,7 @@ def usb_urb(s):
138
174
},
139
175
103 : {
140
176
'type' : 'HDMI' ,
177
+ 'version' : '103' ,
141
178
'filename' : 'hdmi-flash-103.pcapng' ,
142
179
'second_first' : True ,
143
180
'devices' : {
@@ -153,6 +190,7 @@ def usb_urb(s):
153
190
},
154
191
104 : {
155
192
'type' : 'HDMI' ,
193
+ 'version' : '104' ,
156
194
'filename' : 'hdmi-flash-104.pcapng' ,
157
195
'second_first' : True ,
158
196
'devices' : {
@@ -166,8 +204,9 @@ def usb_urb(s):
166
204
}
167
205
}
168
206
},
169
- 105 : {
207
+ ' 105' : {
170
208
'type' : 'HDMI' ,
209
+ 'version' : '105' ,
171
210
'filename' : 'hdmi-flash-105.pcapng' ,
172
211
'second_first' : False ,
173
212
'devices' : {
@@ -185,7 +224,6 @@ def usb_urb(s):
185
224
186
225
ROW_SIZE = 128
187
226
MAX_ROWS = 1024
188
- FW_VERSION = None
189
227
190
228
DEBUG = False
191
229
VERBOSE = False
@@ -378,8 +416,8 @@ def decode_pcapng(path, info):
378
416
379
417
380
418
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' ]
383
421
path = '/home/zoid/framework/dp-card-fw-update/{}' .format (info ['filename' ])
384
422
385
423
(img1_binary , img2_binary ) = decode_pcapng (path , info )
0 commit comments