Chameleon

Chameleon Commit Details

Date:2015-05-22 22:50:25 (8 years 10 months ago)
Author:ErmaC
Commit:2697
Parents: 2696
Message:Merge latest changes from Enoch branch.
Changes:
M/trunk/i386/libsaio/hda.h
M/trunk/i386/libsaio/gma.c
M/trunk/i386/boot2/boot.c
M/trunk/i386/libsaio/dram_controllers.c
M/trunk/i386/libsaio/nvidia.c
M/trunk/i386/boot2/boot.h
M/trunk/CHANGES
M/trunk/i386/libsaio/ati.c
M/trunk/i386/libsaio/stringTable.c
M/trunk/i386/libsaio/convert.c
M/trunk/i386/libsaio/biosfn.c
M/trunk/i386/libsaio/saio_types.h
M/trunk/i386/libsaio/platform.c
M/trunk/i386/libsaio/convert.h
M/trunk/i386/libsaio/networking.c
M/trunk/i386/libsaio/cpu.c
M/trunk/i386/libsaio/platform.h
M/trunk/i386/libsaio/fake_efi.c
M/trunk/i386/libsaio/pci_setup.c
M/trunk/i386/libsaio/device_inject.c
M/trunk/i386/libsaio/misc.c
M/trunk/i386/libsaio/smbios.c
M/trunk/i386/libsaio/cpu.h
M/trunk/i386/libsaio/hda.c
M/trunk/i386/libsaio/xml.c

File differences

trunk/i386/libsaio/xml.c
2727
2828
2929
30
31
32
33
34
35
36
37
38
39
3040
3141
3242
#include "sl.h"
#include "xml.h"
#ifndef DEBUG_XML
#define DEBUG_XML 0
#endif
#if DEBUG_XML
#define DBG(x...)printf(x)
#else
#define DBG(x...)
#endif
string_ref *ref_strings = NULL;
/// TODO: remove below
trunk/i386/libsaio/networking.c
99
1010
1111
12
1213
1314
1415
......
3940
4041
4142
42
43
43
4444
4545
4646
47
4847
49
50
51
52
53
54
48
49
50
51
52
53
5554
5655
5756
......
7271
7372
7473
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
111110
112111
113112
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
133132
134133
135
136
134
135
137136
138137
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
203202
204203
205204
......
214213
215214
216215
217
218
216
217
219218
220
219
221220
222221
223222
......
227226
228227
229228
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
255254
256255
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
256
257
258
259
260
261
262
263
264
265
266
267
268
269
272270
271
273272
274
275
276
277
278
279
280
281
282
283273
284274
285275
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
325315
326316
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
343333
334
344335
336
337
338
345339
346
347
348
349
340
341
342
343
344
350345
346
347
351348
352
353
354
355
356
349
350
357351
358
359
360
361
352
353
362354
363
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
364372
365
373
374
366375
376
377
378
379
380
381
367382
368
369
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
370406
371
407
408
372409
373
410
411
412
413
414
374415
416
417
418
419
375420
376421
377422
378423
379
380
424
425
426
381427
428
429
382430
383431
384
432
433
385434
386435
387436
......
395444
396445
397446
398
399447
400448
401
402
403
449
450
451
452
453
454
455
456
457
404458
405
406
407
408
409
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
410478
411479
480
481
482
483
484
412485
413486
414487
415488
416
417
418
419489
490
420491
421
492
422493
494
495
496
497
498
499
500
423501
424502
425503
......
428506
429507
430508
431
509
432510
433511
434512
435
436
437
438
513
439514
440
441
515
442516
443
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
444536
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
537
538
460539
461540
462541
463
464542
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
543
484544
#include "bootstruct.h"
#include "pci.h"
#include "platform.h"
//#include "convert.h"
#include "device_inject.h"
#include "networking.h"
uint32_t builtin_set= 0;
uint8_t builtin= 0;
extern uint32_t devices_number;
//extern uint32_t onboard_number;
extern uint32_t location_number;
static network_device known_ethernet_cards[] =
{
// Realtek
{ PCI_VENDOR_ID_REALTEK, 0x8129, "Realtek 8129 Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8136, "Realtek RTL8101E/RTL8102E PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_REALTEK, 0x8139, "Realtek RTL8139/810x Family Fast Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8167, "Realtek 8169/8110 Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8168, "Realtek RTL8111/8168 PCI-E Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8169, "Realtek 8169/8110 Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8129, "8129 Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8136, "RTL8101E/RTL8102E PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_REALTEK, 0x8139, "RTL8139/810x Family Fast Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8167, "8169/8110 Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8168, "RTL8111/8168 PCI-E Gigabit Ethernet" },
{ PCI_VENDOR_ID_REALTEK, 0x8169, "8169/8110 Gigabit Ethernet" },
{ 0x1113, 0x1211, "Realtek RTL8139 Family Fast Ethernet" },
{ 0x1500, 0x1360, "Realtek RTL8139 Family Fast Ethernet" },
{ 0x021b, 0x8139, "Realtek RTL8139 Family Fast Ethernet" },
// Marvell
{ PCI_VENDOR_ID_MARVELL, 0x4320, "Marvell 88E8001 Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4340, "Marvell 88E8021 PCI-X IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4341, "Marvell 88E8022 PCI-X IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4342, "Marvell 88E8061 PCI-E IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4343, "Marvell 88E8062 PCI-E IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4344, "Marvell 88E8021 PCI-X IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4345, "Marvell 88E8022 PCI-X IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4346, "Marvell 88E8061 PCI-E IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4347, "Marvell 88E8062 PCI-E IPMI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4350, "Marvell 88E8035 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4351, "Marvell 88E8036 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4352, "Marvell 88E8038 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4353, "Marvell 88E8039 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4354, "Marvell 88E8040 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4355, "Marvell 88E8040T PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4356, "Marvell 88EC033 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4357, "Marvell 88E8042 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x435A, "Marvell 88E8048 PCI-E Fast Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4360, "Marvell 88E8052 PCI-E ASF Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4361, "Marvell 88E8050 PCI-E ASF Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4362, "Marvell 88E8053 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4363, "Marvell 88E8055 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4364, "Marvell 88E8056 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4365, "Marvell 8E8070 based Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4366, "Marvell 88EC036 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4367, "Marvell 88EC032 Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4368, "Marvell 88EC034 Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4369, "Marvell 88EC042 Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x436A, "Marvell 88E8058 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x436B, "Marvell 88E8071 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x436C, "Marvell 88E8072 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x436D, "Marvell 88E8055 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4370, "Marvell 88E8075 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4380, "Marvell 88E8057 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4381, "Marvell 88E8059 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4382, "Marvell 88E8079 PCI-E Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x4320, "Yukon Gigabit Adapter 88E8001 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4340, "Yukon Gigabit Adapter 88E8021 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4341, "Yukon Gigabit Adapter 88E8022 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4342, "Yukon Gigabit Adapter 88E8061 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4343, "Yukon Gigabit Adapter 88E8062 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4344, "Yukon Gigabit Adapter 88E8021 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4345, "Yukon Gigabit Adapter 88E8022 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4346, "Yukon Gigabit Adapter 88E8061 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4347, "Yukon Gigabit Adapter 88E8062 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4350, "Yukon Gigabit Adapter 88E8035 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4351, "Yukon Gigabit Adapter 88E8036 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4352, "Yukon Gigabit Adapter 88E8038 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4353, "Yukon Gigabit Adapter 88E8039 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4354, "Yukon Gigabit Adapter 88E8040 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4355, "Yukon Gigabit Adapter 88E8040T Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4356, "Yukon Gigabit Adapter 88EC033 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4357, "Yukon Gigabit Adapter 88E8042 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x435A, "Yukon Gigabit Adapter 88E8048 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4360, "Yukon Gigabit Adapter 88E8052 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4361, "Yukon Gigabit Adapter 88E8050 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4362, "Yukon Gigabit Adapter 88E8053 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4363, "Yukon Gigabit Adapter 88E8055 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4364, "Yukon Gigabit Adapter 88E8056 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4365, "Yukon Gigabit Adapter 8E8070 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4366, "Yukon Gigabit Adapter 88EC036 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4367, "Yukon Gigabit Adapter 88EC032 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4368, "Yukon Gigabit Adapter 88EC034 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4369, "Yukon Gigabit Adapter 88EC042 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x436A, "Yukon Gigabit Adapter 88E8058 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x436B, "Yukon Gigabit Adapter 88E8071 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x436C, "Yukon Gigabit Adapter 88E8072 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x436D, "Yukon Gigabit Adapter 88E8055 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4370, "Yukon Gigabit Adapter 88E8075 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4380, "Yukon Gigabit Adapter 88E8057 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4381, "Yukon Gigabit Adapter 88E8059 Singleport Copper SA" },
{ PCI_VENDOR_ID_MARVELL, 0x4382, "Yukon Gigabit Adapter 88E8079 Singleport Copper SA" },
//{ PCI_VENDOR_ID_MARVELL, 0x5005, "Belkin F5D5005 Gigabit Desktop Network PCI Card" },
// Broadcom
{ PCI_VENDOR_ID_BROADCOM, 0x1600, "Broadcom BCM5752 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1655, "Broadcom BCM5717 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1656, "Broadcom BCM5718 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1657, "Broadcom BCM5719 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1659, "Broadcom BCM5721 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x165A, "Broadcom BCM5722 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x166A, "Broadcom BCM5780 Gigabit Ethernet" },
{ PCI_VENDOR_ID_BROADCOM, 0x1672, "Broadcom BCM5754M Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1673, "Broadcom BCM5755M Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x167A, "Broadcom BCM5754 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x167B, "Broadcom BCM5755 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1684, "Broadcom BCM5764M Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1691, "Broadcom BCM57788 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1693, "Broadcom BCM5787M Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x169B, "Broadcom BCM5787 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x16B4, "Broadcom BCM57765 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x16B5, "Broadcom BCM57785 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1712, "Broadcom BCM5906 Fast Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1713, "Broadcom BCM5906M Fast Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1600, "BCM5752 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1655, "BCM5717 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1656, "BCM5718 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1657, "BCM5719 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1659, "BCM5721 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x165A, "BCM5722 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x166A, "BCM5780 Gigabit Ethernet" },
{ PCI_VENDOR_ID_BROADCOM, 0x1672, "BCM5754M Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1673, "BCM5755M Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x167A, "BCM5754 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x167B, "BCM5755 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1684, "BCM5764M Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1691, "BCM57788 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1693, "BCM5787M Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x169B, "BCM5787 Gigabit Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x16B4, "BCM57765 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x16B5, "BCM57785 Gigabit Ethernet PCIe" },
{ PCI_VENDOR_ID_BROADCOM, 0x1712, "BCM5906 Fast Ethernet PCI Express" },
{ PCI_VENDOR_ID_BROADCOM, 0x1713, "BCM5906M Fast Ethernet PCI Express" },
// JMicron
{ PCI_VENDOR_ID_JMICRON, 0x0250, "JMicron JMC250 PCI Express Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_JMICRON, 0x0260, "JMicron JMC260 PCI Express Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_JMICRON, 0x0250, "JMC250 PCI Express Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_JMICRON, 0x0260, "JMC260 PCI Express Gigabit Ethernet Controller" },
// Intel
//{ PCI_VENDOR_ID_INTEL, 0x1000, "Intel 82542 Gigabit Ethernet Controller (Fiber)" },
{ PCI_VENDOR_ID_INTEL, 0x1029, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1030, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1031, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1032, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1033, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1034, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1038, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x1039, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x103A, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x103B, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x103C, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x103D, "Intel 8255x Ethernet" },
{ PCI_VENDOR_ID_INTEL, 0x103E, "Intel 8255x Ethernet" },
//{ PCI_VENDOR_ID_INTEL, 0x1049, "Intel 82566MM Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x104A, "Intel 82566DM Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x104B, "Intel 82566DC Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x104C, "Intel 82562V 10/100 Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x104D, "Intel 82566MC Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1050, "Intel 82562EZ 10/100 Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1051, "Intel 82801EB/ER (ICH5/ICH5R) integrated LAN Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1052, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1053, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1054, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1055, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1056, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1057, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1059, "Intel 82551QM Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x105b "Intel 82546GB Gigabit Ethernet Controller (Copper)" },
//{ PCI_VENDOR_ID_INTEL, 0x105E, "Intel 82546GB Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x105F, "Intel 82571EB Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1060, "Intel 82571EB Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1064, "Intel 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1065, "Intel 82562ET/EZ/GT/GZ - PRO/100 VE Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1066, "Intel 82562 EM/EX/GX - PRO/100 VM (LOM) Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1067, "Intel 82562 EM/EX/GX - PRO/100 VM Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1068, "Intel 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller Mobile" },
{ PCI_VENDOR_ID_INTEL, 0x1069, "Intel 82562EM/EX/GX - PRO/100 VM (LOM) Ethernet Controller Mobile" },
{ PCI_VENDOR_ID_INTEL, 0x106A, "Intel 82562G - PRO/100 VE (LOM) Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x106B, "Intel 82562G - PRO/100 VE Ethernet Controller Mobile" },
{ PCI_VENDOR_ID_INTEL, 0x1075, "82547GI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1076, "82541GI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1077, "82541GI Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1078, "82541ER Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1079, "82546GB Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x107a, "82546GB Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x107b, "82546GB Gigabit Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x107c, "82541PI Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x107D, "Intel 82572EI Gigabit Ethernet Controller (Copper)" },
//{ PCI_VENDOR_ID_INTEL, 0x107E, "Intel 82572EI Gigabit Ethernet Controller (Fiber)" },
//{ PCI_VENDOR_ID_INTEL, 0x107F, "Intel 82572EI Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x108a, "Intel 82546GB Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x108B, "Intel 82573V Gigabit Ethernet Controller (Copper)" },
//{ PCI_VENDOR_ID_INTEL, 0x108C, "Intel 82573E Gigabit Ethernet Controller (Copper)" },
{ PCI_VENDOR_ID_INTEL, 0x1091, "Intel PRO/100 VM Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1092, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1093, "Intel PRO/100 VM Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1094, "Intel PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1095, "Intel PRO/100 VE Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x1096, "Intel 80003ES2LAN Gigabit Ethernet Controller (Copper)" },
//{ PCI_VENDOR_ID_INTEL, 0x1098, "Intel 80003ES2LAN Gigabit Ethernet Controller (Serdes)" },
//{ PCI_VENDOR_ID_INTEL, 0x109A, "Intel 82573L Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x10A4, "Intel 82571EB Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x10A5, "Intel 82571EB Gigabit Ethernet Controller (Fiber)" },
{ PCI_VENDOR_ID_INTEL, 0x1000, "82542" },
{ PCI_VENDOR_ID_INTEL, 0x1029, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1030, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1031, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1032, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1033, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1034, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1038, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1039, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x103A, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x103B, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x103C, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x103D, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x103E, "8255x" },
{ PCI_VENDOR_ID_INTEL, 0x1049, "82566MM" },
{ PCI_VENDOR_ID_INTEL, 0x104A, "82566DM" },
{ PCI_VENDOR_ID_INTEL, 0x104B, "82574L" },
{ PCI_VENDOR_ID_INTEL, 0x104C, "82562V" },
{ PCI_VENDOR_ID_INTEL, 0x104D, "82566MC" },
{ PCI_VENDOR_ID_INTEL, 0x1050, "82562EZ" },
{ PCI_VENDOR_ID_INTEL, 0x1051, "82801EB/ER" },
{ PCI_VENDOR_ID_INTEL, 0x1052, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1053, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1054, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1055, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1056, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1057, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1059, "82551QM" },
//{ PCI_VENDOR_ID_INTEL, 0x105b "82546GB" },
//{ PCI_VENDOR_ID_INTEL, 0x105E, "82546GB" },
//{ PCI_VENDOR_ID_INTEL, 0x105F, "82571EB" },
{ PCI_VENDOR_ID_INTEL, 0x1060, "82571EB" },
{ PCI_VENDOR_ID_INTEL, 0x1064, "82562ET/EZ/GT/GZ" },
{ PCI_VENDOR_ID_INTEL, 0x1065, "82562ET/EZ/GT/GZ" },
{ PCI_VENDOR_ID_INTEL, 0x1066, "82562 EM/EX/GX" },
{ PCI_VENDOR_ID_INTEL, 0x1067, "82562 EM/EX/GX" },
{ PCI_VENDOR_ID_INTEL, 0x1068, "82562ET/EZ/GT/GZ" },
{ PCI_VENDOR_ID_INTEL, 0x1069, "82562EM/EX/GX" },
{ PCI_VENDOR_ID_INTEL, 0x106A, "82562G" },
{ PCI_VENDOR_ID_INTEL, 0x106B, "82562G" },
{ PCI_VENDOR_ID_INTEL, 0x1075, "82547GI" },
{ PCI_VENDOR_ID_INTEL, 0x1076, "82541GI" },
{ PCI_VENDOR_ID_INTEL, 0x1077, "82541GI" },
{ PCI_VENDOR_ID_INTEL, 0x1078, "82541ER" },
{ PCI_VENDOR_ID_INTEL, 0x1079, "82546GB" },
{ PCI_VENDOR_ID_INTEL, 0x107a, "82546GB" },
{ PCI_VENDOR_ID_INTEL, 0x107b, "82546GB" },
{ PCI_VENDOR_ID_INTEL, 0x107c, "82541PI" },
//{ PCI_VENDOR_ID_INTEL, 0x107D, "82572EI" },
//{ PCI_VENDOR_ID_INTEL, 0x107E, "82572EI" },
//{ PCI_VENDOR_ID_INTEL, 0x107F, "82572EI Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x108a, "82546GB Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x108B, "82573V Gigabit Ethernet Controller (Copper)" },
//{ PCI_VENDOR_ID_INTEL, 0x108C, "82573E Gigabit Ethernet Controller (Copper)" },
{ PCI_VENDOR_ID_INTEL, 0x1091, "PRO/100 VM Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1092, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1093, "PRO/100 VM Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1094, "PRO/100 VE Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1095, "PRO/100 VE Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x1096, "80003ES2LAN Gigabit Ethernet Controller (Copper)" },
//{ PCI_VENDOR_ID_INTEL, 0x1098, "80003ES2LAN Gigabit Ethernet Controller (Serdes)" },
//{ PCI_VENDOR_ID_INTEL, 0x109A, "82573L Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x10A4, "82571EB Gigabit Ethernet Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x10A5, "82571EB Gigabit Ethernet Controller (Fiber)" },
//{ PCI_VENDOR_ID_INTEL, 0x10BA, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10BC, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10B9, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10CB, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10CC, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10CD, "Intel " },
{ PCI_VENDOR_ID_INTEL, 0x10CE, "Intel 82567V-2 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10D3, "Intel 82574L Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10CE, "82567V-2 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10D3, "82574L Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x10D5, "Intel " },
{ PCI_VENDOR_ID_INTEL, 0x10d6, "Intel 82575GB Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10d6, "82575GB Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x10D9, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10DA, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10DE, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10EB, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10EF, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10F5, "Intel " },
//{ PCI_VENDOR_ID_INTEL, 0x10F6, "Intel " },
{ PCI_VENDOR_ID_INTEL, 0x10F0, "Intel 82578DC Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10FE, "Intel 82552 10/100 Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1209, "Intel 8255xER/82551IT Fast Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1227, "Intel 82865 EtherExpress PRO/100A" },
{ PCI_VENDOR_ID_INTEL, 0x1228, "Intel 82556 EtherExpress PRO/100 Smart" },
{ PCI_VENDOR_ID_INTEL, 0x1229, "Intel 82557/8/9/0/1 Ethernet Pro 100" },
//{ PCI_VENDOR_ID_INTEL, 0x1501, "Intel 82567V-3 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1502, "Intel 82579LM Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1503, "Intel 82579V Gigabit Network Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x150C, "Intel 82583V Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x1525, "Intel 82567V-4 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x153A, "Intel Ethernet Connection I217-LM" },
{ PCI_VENDOR_ID_INTEL, 0x153B, "Intel Ethernet Connection I217-V" },
{ PCI_VENDOR_ID_INTEL, 0x1559, "Intel Ethernet Connection I218-V" },
{ PCI_VENDOR_ID_INTEL, 0x155A, "Intel Ethernet Connection I218-LM" },
{ PCI_VENDOR_ID_INTEL, 0x15A0, "Intel Ethernet Connection (2) I218-LM" },
{ PCI_VENDOR_ID_INTEL, 0x15A1, "Intel Ethernet Connection (2) I218-V" },
{ PCI_VENDOR_ID_INTEL, 0x15A2, "Intel Ethernet Connection (3) I218-LM" },
{ PCI_VENDOR_ID_INTEL, 0x15A3, "Intel Ethernet Connection (3) I218-V" },
{ PCI_VENDOR_ID_INTEL, 0x2449, "Intel 82801BA/BAM/CA/CAM Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x2459, "Intel 82801E Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x245D, "Intel 82801E Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x27DC, "Intel NM10/ICH7 Family LAN Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x294C, "Intel 82566DC-2 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10F6, "82574L" },
{ PCI_VENDOR_ID_INTEL, 0x10F0, "82578DC Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x10FE, "82552 10/100 Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1209, "8255xER/82551IT Fast Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x1227, "82865 EtherExpress PRO/100A" },
{ PCI_VENDOR_ID_INTEL, 0x1228, "82556 EtherExpress PRO/100 Smart" },
{ PCI_VENDOR_ID_INTEL, 0x1229, "82557/8/9/0/1 Ethernet Pro 100" },
//{ PCI_VENDOR_ID_INTEL, 0x1501, "82567V-3 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1502, "82579LM Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x1503, "82579V Gigabit Network Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x150C, "82583V Gigabit Network Connection" },
//{ PCI_VENDOR_ID_INTEL, 0x1525, "82567V-4 Gigabit Network Connection" },
{ PCI_VENDOR_ID_INTEL, 0x153A, "Ethernet Connection I217-LM" },
{ PCI_VENDOR_ID_INTEL, 0x153B, "Ethernet Connection I217-V" },
{ PCI_VENDOR_ID_INTEL, 0x1559, "Ethernet Connection I218-V" },
{ PCI_VENDOR_ID_INTEL, 0x155A, "Ethernet Connection I218-LM" },
{ PCI_VENDOR_ID_INTEL, 0x15A0, "Ethernet Connection (2) I218-LM" },
{ PCI_VENDOR_ID_INTEL, 0x15A1, "Ethernet Connection (2) I218-V" },
{ PCI_VENDOR_ID_INTEL, 0x15A2, "Ethernet Connection (3) I218-LM" },
{ PCI_VENDOR_ID_INTEL, 0x15A3, "Ethernet Connection (3) I218-V" },
{ PCI_VENDOR_ID_INTEL, 0x2449, "82801BA/BAM/CA/CAM Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x2459, "82801E Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x245D, "82801E Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x27DC, "NM10/ICH7 Family LAN Controller" },
//{ PCI_VENDOR_ID_INTEL, 0x294C, "82566DC-2 Gigabit Network Connection" },
//Atheros (Qualcomm)
{ PCI_VENDOR_ID_QUALCOMM, 0x1026, "Atheros AR8121/AR8113/AR8114 Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1062, "Atheros AR8132 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1063, "Atheros AR8131 Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1066, "Atheros AR8121/AR8113/AR8114 Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1067, "Atheros L1c Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1073, "Atheros AR8151 v1.0 Gigabit 1000" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1083, "Atheros GbE LAN chip (10/100/1000 Mbit)" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1090, "Atheros AR8162 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1091, "Atheros AR8161 Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x10a0, "Atheros QCA8172 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x10a1, "Atheros QCA8171 Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x2048, "Atheros L2 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x2060, "Atheros AR8152 v1.1 Fast 10/100" },
{ PCI_VENDOR_ID_QUALCOMM, 0x2062, "Atheros AR8152 v2.0 Fast 10/100" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1026, "AR8121/AR8113/AR8114 Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1062, "AR8132 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1063, "AR8131 Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1066, "AR8121/AR8113/AR8114 Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1067, "L1c Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1073, "AR8151 v1.0 Gigabit 1000" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1083, "GbE LAN chip (10/100/1000 Mbit)" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1090, "AR8162 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x1091, "AR8161 Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x10a0, "QCA8172 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x10a1, "QCA8171 Gigabit Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x2048, "L2 Fast Ethernet" },
{ PCI_VENDOR_ID_QUALCOMM, 0x2060, "AR8152 v1.1 Fast 10/100" },
{ PCI_VENDOR_ID_QUALCOMM, 0x2062, "AR8152 v2.0 Fast 10/100" }
};
#define ETH_DEVICES_LEN (sizeof(known_ethernet_cards) / sizeof(known_ethernet_cards[0]))
static network_device generic_ethernet_cards[] =
{
{ 0x0000, 0x0000, "Generic Ethernet Controller" },
{ PCI_VENDOR_ID_REALTEK, 0x0000, "Realtek Ethernet Controller" },
{ PCI_VENDOR_ID_MARVELL, 0x0000, "Marvell Ethernet Controller" },
{ PCI_VENDOR_ID_QUALCOMM, 0x0000, "Atheros Ethernet Controller" },
{ PCI_VENDOR_ID_INTEL, 0x0000, "Intel(R) Ethernet Controller" },
};
static network_device known_wifi_cards[] =
{
// Broadcom
{PCI_VENDOR_ID_BROADCOM, 0x4312, "Broadcom BCM4311 802.11a/b/g"},
//{PCI_VENDOR_ID_BROADCOM, 0x4313, "Broadcom BCM4311 802.11a" },
{PCI_VENDOR_ID_BROADCOM, 0x4315, "Broadcom BCM4312 802.11b/g Wireless LAN Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4318, "Broadcom BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x4319, "Broadcom BCM4318 [AirForce 54g] 802.11a/b/g PCI Express Transceiver"},
//{PCI_VENDOR_ID_BROADCOM, 0x4320, "Broadcom BCM4306 802.11b/g Wireless LAN Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4321, "Broadcom BCM4321 802.11a Wireless Network Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4322, "Broadcom BCM4322 802.11bgn Wireless Network Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4324, "Broadcom BCM4309 802.11abg Wireless Network Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4325, "Broadcom BCM4306 802.11bg Wireless Network Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4328, "Broadcom BCM4321 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4329, "Broadcom BCM4321 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x432a, "Broadcom BCM4321 802.11an Wireless Network Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x432b, "Broadcom BCM4322 802.11a/b/g/n Wireless LAN Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x432c, "Broadcom BCM4322 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x432d, "Broadcom BCM4322 802.11an Wireless Network Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x4331, "Broadcom BCM4331 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4350, "Broadcom BCM43222 Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x4351, "Broadcom BCM43222 802.11abgn Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x4353, "Broadcom BCM43224 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4357, "Broadcom BCM43225 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4358, "Broadcom BCM43227 802.11b/g/n"},
{PCI_VENDOR_ID_BROADCOM, 0x4359, "Broadcom BCM43228 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4360, "Broadcom BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x4365, "Broadcom BCM43142 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a0, "Broadcom BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a1, "Broadcom BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a2, "Broadcom BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a9, "Broadcom BCM43217 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x43aa, "Broadcom BCM43131 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x43b1, "Broadcom BCM4352 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43ba, "Broadcom BCM43602 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43bb, "Broadcom BCM43602 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43bc, "Broadcom BCM43602 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43d3, "Broadcom BCM43567 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43d9, "Broadcom BCM43570 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43df, "Broadcom BCM4354 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43ec, "Broadcom BCM4356 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0xa8d8, "Broadcom BCM43224/5 Wireless Network Adapter"},
{PCI_VENDOR_ID_BROADCOM, 0x4312, "BCM4311 802.11a/b/g"},
//{PCI_VENDOR_ID_BROADCOM, 0x4313, "BCM4311 802.11a" },
{PCI_VENDOR_ID_BROADCOM, 0x4315, "BCM4312 802.11b/g Wireless LAN Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4318, "BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x4319, "BCM4318 [AirForce 54g] 802.11a/b/g PCI Express Transceiver"},
{PCI_VENDOR_ID_BROADCOM, 0x4320, "BCM4306 802.11b/g Wireless LAN Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4321, "BCM4321 802.11a Wireless Network Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4322, "BCM4322 802.11bgn Wireless Network Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x4324, "BCM4309 802.11abg Wireless Network Controller"},
//{PCI_VENDOR_ID_BROADCOM, 0x4325, "BCM4306 802.11bg Wireless Network Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x4328, "BCM4321 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4329, "BCM4321 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x432a, "BCM4321 802.11an Wireless Network Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x432b, "BCM4322 802.11a/b/g/n Wireless LAN Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x432c, "BCM4322 802.11b/g/n"},
{PCI_VENDOR_ID_BROADCOM, 0x432d, "BCM4322 802.11an Wireless Network Controller"},
{PCI_VENDOR_ID_BROADCOM, 0x4331, "BCM4331 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4350, "BCM43222 Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x4351, "BCM43222 802.11abgn Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x4353, "BCM43224 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4357, "BCM43225 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4358, "BCM43227 802.11b/g/n"},
{PCI_VENDOR_ID_BROADCOM, 0x4359, "BCM43228 802.11a/b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x4360, "BCM4360 802.11ac Wireless Network Adapter"},
{PCI_VENDOR_ID_BROADCOM, 0x4365, "BCM43142 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a0, "BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a1, "BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a2, "BCM4360 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43a9, "BCM43217 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x43aa, "BCM43131 802.11b/g/n"},
//{PCI_VENDOR_ID_BROADCOM, 0x43b1, "BCM4352 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43ba, "BCM43602 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43bb, "BCM43602 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43bc, "BCM43602 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43d3, "BCM43567 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43d9, "BCM43570 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0x43df, "BCM4354 802.11ac Wireless LAN SoC"},
//{PCI_VENDOR_ID_BROADCOM, 0x43ec, "BCM4356 802.11ac Wireless Network Adapter"},
//{PCI_VENDOR_ID_BROADCOM, 0xa8d8, "BCM43224/5 Wireless Network Adapter"},
// Atheros
{PCI_VENDOR_ID_ATHEROS, 0x0020, "Atheros AR5513 802.11abg Wireless NIC"},
{PCI_VENDOR_ID_ATHEROS, 0x0023, "Atheros AR5416 Wireless Network Adapter [AR5008 802.11(a)bgn]"},
{PCI_VENDOR_ID_ATHEROS, 0x0024, "Atheros AR5418 Wireless Network Adapter [AR5008E 802.11(a)bgn]"},
{PCI_VENDOR_ID_ATHEROS, 0x0027, "Atheros AR9160 Wireless Network Adapter [AR9001 802.11(a)bgn]"},
{PCI_VENDOR_ID_ATHEROS, 0x0029, "Atheros AR922X Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x002A, "Atheros AR928X Wireless Network Adapter"}, // "pci168c,2a"
{PCI_VENDOR_ID_ATHEROS, 0x002B, "Atheros AR9285 Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x002c, "Atheros AR2427 802.11bg Wireless Network Adapter (PCI-Express)"},
//{PCI_VENDOR_ID_ATHEROS, 0x002d, "Atheros AR9227 Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x002e, "Atheros AR9287 Wireless Network Adapter (PCI-Express)"},
//{PCI_VENDOR_ID_ATHEROS, 0x0030, "Atheros AR93xx Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x0032, "Atheros AR9485 Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x0033, "Atheros AR9580 Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x0034, "Atheros AR9462 Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x0036, "Atheros QCA9565 / AR9565 Wireless Network Adapter"},
//{PCI_VENDOR_ID_ATHEROS, 0x0037, "Atheros AR9485 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0020, "AR5513 802.11abg Wireless NIC"},
{PCI_VENDOR_ID_ATHEROS, 0x0023, "AR5416 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0024, "AR5418 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0027, "AR9160 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0029, "AR922X Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x002A, "AR928X Wireless Network Adapter"}, // "pci168c,2a"
{PCI_VENDOR_ID_ATHEROS, 0x002B, "AR9285 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x002C, "AR2427 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x002D, "AR9227 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x002E, "AR9287 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0030, "AR93xx Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0032, "AR9485 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0033, "AR9580 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0034, "AR9462 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0036, "AR9565 Wireless Network Adapter"},
{PCI_VENDOR_ID_ATHEROS, 0x0037, "AR9485 Wireless Network Adapter"}
};
#define WLAN_DEVICES_LEN (sizeof(known_wifi_cards) / sizeof(known_wifi_cards[0]))
char *get_ethernet_model(uint32_t vendor_id, uint32_t device_id)
{
static char desc[128];
int devprop_add_network_template(DevPropDevice *device, uint16_t vendor_id)
{
builtin = 0;
if(device)
const char *name_format = NULL;
int i;
/* Get format for vendor ID */
switch ( vendor_id )
{
case PCI_VENDOR_ID_REALTEK:
name_format = "Realteck %s"; break;
if((vendor_id != PCI_VENDOR_ID_ATHEROS ) && ( builtin_set == 0 ))
{
builtin_set = 1;
builtin = 0x01;
}
case PCI_VENDOR_ID_MARVELL:
name_format = "Marvell %s"; break;
if(!devprop_add_value(device, "built-in", (uint8_t *)&builtin, 1))
{
return 0;
}
case PCI_VENDOR_ID_JMICRON:
name_format = "JMicron %s"; break;
if(!devprop_add_value(device, "device_type", (uint8_t *)"ethernet", sizeof("ethernet")))
case PCI_VENDOR_ID_ATHEROS:
case PCI_VENDOR_ID_QUALCOMM:
name_format = "Atheros %s"; break;
case PCI_VENDOR_ID_BROADCOM:
name_format = "Broadcom %s"; break;
case PCI_VENDOR_ID_INTEL:
name_format = "Intel %s"; break;
default:
break;
}
for( i = 0 ; i < ETH_DEVICES_LEN; i++ )
{
if ( ( vendor_id == known_ethernet_cards[i].vendor_id ) && ( device_id == known_ethernet_cards[i].device_id ) )
{
return 0;
snprintf( desc, sizeof(desc), name_format, known_ethernet_cards[i].model );
return desc;
}
}
// NOT in know table... assign generic
/* Not in table */
snprintf( desc, sizeof(desc), name_format, "Ethernet Controller" );
return desc;
}
devices_number++;
return 1;
char *get_wlan_model(uint32_t vendor_id, uint32_t device_id)
{
static char desc[128];
const char *name_format = NULL;
int i;
/* Get format for vendor ID */
switch ( vendor_id )
{
case PCI_VENDOR_ID_REALTEK:
name_format = "Realteck %s"; break;
case PCI_VENDOR_ID_ATHEROS:
case PCI_VENDOR_ID_QUALCOMM:
name_format = "Atheros %s"; break;
case PCI_VENDOR_ID_BROADCOM:
name_format = "Broadcom %s"; break;
default:
break;
}
else
for( i = 0 ; i < WLAN_DEVICES_LEN; i++ )
{
return 0;
if ( ( vendor_id == known_wifi_cards[i].vendor_id ) && ( device_id == known_wifi_cards[i].device_id ) )
{
snprintf( desc, sizeof(desc), name_format, known_wifi_cards[i].model );
return desc;
}
}
// NOT in know table... assign generic
/* Not in table */
snprintf( desc, sizeof(desc), name_format, "Wireless Controller" );
return desc;
}
void setup_eth_devdrop(pci_dt_t *eth_dev)
{
char *devicepath= get_pci_dev_path(eth_dev);
char *name_model= NULL;
char *devicepath = get_pci_dev_path(eth_dev);
char *name_model = NULL;
builtin = 0;
bool do_eth_devprop = getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->chameleonConfig);
DevPropDevice *device = (DevPropDevice *)malloc(sizeof(DevPropDevice));
verbose("LAN Controller [%04x:%04x] :: %s\n", eth_dev->vendor_id, eth_dev->device_id, devicepath);
verbose("\tClass code: [%04X]\n", eth_dev->class_id);
verbose("\tEthernetBuiltIn = %s\n", do_eth_devprop ? "Yes" : "No");
if (!string)
{
device = devprop_add_device(string, devicepath);
if(device)
{
verbose("Setting up lan keys\n");
name_model = get_ethernet_model(eth_dev->vendor_id, eth_dev->device_id);
devprop_add_network_template(device, eth_dev->vendor_id);
devprop_add_value(device, "model", (uint8_t *)name_model, (strlen(name_model) + 1));
devprop_add_value(device, "device_type", (uint8_t *)"ethernet", sizeof("ethernet"));
if ( do_eth_devprop )
{
verbose("\tLocation number: %d\n", location_number);
verbose("\tSetting up lan keys\n");
if( ( eth_dev->vendor_id != PCI_VENDOR_ID_ATHEROS ) && ( builtin_set == 0 ))
{
builtin_set = 1;
builtin = 0x01;
}
stringdata = (uint8_t*)malloc(sizeof(uint8_t) * string->length);
if(stringdata)
{
memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);
stringlength = string->length;
devprop_add_value(device, "location", (uint8_t *)&location_number, 1);
//devprop_add_value(device, "AAPL,slot-name", "Slot-x"
//devprop_add_value(device, "device-id",
//devprop_add_value(device, "revision-id",
//devprop_add_value(device, "subsystem-id",
//devprop_add_value(device, "subsystem-vendor-id",
devprop_add_value(device, "built-in", (uint8_t *)&builtin, 1);
devprop_add_value(device, "model", (uint8_t *)name_model, (strlen(name_model) + 1));
devprop_add_value(device, "device_type", (uint8_t *)"ethernet", sizeof("Ethernet"));
stringdata = (uint8_t *)malloc(sizeof(uint8_t) * string->length);
if(stringdata)
{
memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);
stringlength = string->length;
}
}
}
verbose("\t%s [%04x:%04x]\n\t%s\n",name_model, eth_dev->vendor_id, eth_dev->device_id, devicepath);
// location number
location_number++;
}
void setup_wifi_devdrop(pci_dt_t *wlan_dev) // ARPT
{
char tmp[16];
builtin = 0;
DevPropDevice *device ;
char *devicepath = get_pci_dev_path(wlan_dev);
char *name_model = NULL;
verbose("Wifi Controller [%04x:%04x]\n", wlan_dev->vendor_id, wlan_dev->device_id);
builtin = 0;
bool do_wifi_devprop = getBoolForKey(kEnableWifi, &do_wifi_devprop, &bootInfo->chameleonConfig);
DevPropDevice *device = (DevPropDevice *)malloc(sizeof(DevPropDevice));
verbose("\tClass code: [%04X]\n", wlan_dev->class_id);
verbose("\tEnableWifi = %s\n", do_wifi_devprop ? "Yes" : "No");
if (!string)
{
string = devprop_create_string();
return;
}
}
device = devprop_add_device(string, devicepath);
if(device)
{
snprintf(tmp, sizeof(tmp),"Airport");
devprop_add_value(device, "AAPL,slot-name", (uint8_t *) tmp, strlen(tmp) + 1);
devprop_add_value(device, "device_type", (uint8_t *) tmp, strlen(tmp) + 1);
devprop_add_value(device, "built-in", (uint8_t *)&builtin, 1);
name_model = get_wlan_model(wlan_dev->vendor_id, wlan_dev->device_id);
unsigned int i = 0;
for( ; i < sizeof(known_wifi_cards) / sizeof(known_wifi_cards[0]); i++)
if ( do_wifi_devprop )
{
if(wlan_dev->vendor_id == known_wifi_cards[i].vendor_id && wlan_dev->device_id == known_wifi_cards[i].device_id)
verbose("\tSetting up wifi keys\n");
devprop_add_value(device, "built-in", (uint8_t *)&builtin, 1);
devprop_add_value(device, "model", (uint8_t *)name_model, (strlen(name_model) + 1));
//devprop_add_value(device, "name", (uint8_t *)"AirPort Extreme", sizeof("AirPort Extreme"));
//devprop_add_value(device, "vendor-id",
//devprop_add_value(device, "device-id",
//devprop_add_value(device, "subsystem-id",
//devprop_add_value(device, "subsystem-vendor-id",
// NOTE: I would set the subsystem id and subsystem vendor id here,
// however, those values seem to be ovverriden in the boot process.
// A better method would be injecting the DTGP dsdt method
// and then injecting the subsystem id there.
devprop_add_value(device, "device_type", (uint8_t *)"Airport", sizeof("Airport"));
devprop_add_value(device, "AAPL,slot-name", (uint8_t *)"Airport", sizeof("Airport"));
stringdata = (uint8_t *)malloc(sizeof(uint8_t) *string->length);
if(stringdata)
{
verbose("Setting up wifi keys\n");
devprop_add_value(device, "model", (uint8_t *)known_wifi_cards[i].model, (strlen(known_wifi_cards[i].model) + 1));
// NOTE: I would set the subsystem id and subsystem vendor id here,
// however, those values seem to be ovverriden in the boot process.
// A better method would be injecting the DTGP dsdt method
// and then injecting the subsystem id there.
stringdata = (uint8_t *)malloc(sizeof(uint8_t) *string->length);
if(stringdata)
{
memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);
stringlength = string->length;
}
return;
memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);
stringlength = string->length;
}
}
}
}
char *get_ethernet_model(uint32_t vendor_id, uint32_t device_id)
{
int i = 0;
for( ; i < sizeof(known_ethernet_cards) / sizeof(known_ethernet_cards[0]); i++)
{
if(vendor_id == known_ethernet_cards[i].vendor_id && device_id == known_ethernet_cards[i].device_id)
{
return known_ethernet_cards[i].model;
}
}
i = 0;
for ( ; i < sizeof(generic_ethernet_cards) / sizeof(generic_ethernet_cards[0]); i++)
{
if (vendor_id == generic_ethernet_cards[i].vendor_id)
{
return generic_ethernet_cards[i].model;
}
}
return generic_ethernet_cards[0].model;
verbose("\t%s [%04x:%04x]\n\t%s\n", name_model, wlan_dev->vendor_id, wlan_dev->device_id, devicepath);
}
trunk/i386/libsaio/gma.c
462462
463463
464464
465
465
466466
467467
468468
model = get_gma_controller_name(device_id, vendor_id);
verbose("\tClass code: [%04x]\n", gma_dev->class_id);
verbose("\tClass code: [%04X]\n", gma_dev->class_id);
verbose("\t%s [%04x:%04x] (rev %02x)\nSubsystem: [%04x:%04x] :: %s\n",
model, gma_dev->vendor_id, gma_dev->device_id, gma_dev->revision_id, gma_dev->subsys_id.subsys.vendor_id, gma_dev->subsys_id.subsys.device_id, devicepath);
trunk/i386/libsaio/device_inject.c
2323
2424
2525
26
26
27
28
2729
2830
2931
#define DBG(x...)msglog(x)
#endif
uint32_tdevices_number= 1;
uint32_tdevices_number= 1; // nvidia.c
uint32_tlocation_number= 1; // networking.c
DevPropString*string= NULL;
uint8_t*stringdata= NULL;
uint32_tstringlength= 0;
trunk/i386/libsaio/hda.c
178178
179179
180180
181
181182
182183
183184
......
659660
660661
661662
662
663
663664
664665
665666
{ HDA_NVIDIA_GK106,"GK106" /*, 0, ? */ },
{ HDA_NVIDIA_GK107,"GK107" /*, 0, ? */ },
{ HDA_NVIDIA_GK104,"GK104" /*, 0, ? */ },
//1002 Advanced Micro Devices [AMD] nee ATI Technologies Inc
{ HDA_ATI_SB450,"SB4x0" /*, 0, 0 */ },
{ HDA_ATI_SB600,"SB600" /*, 0, 0 */ },
uint16_tcontroller_device_id = hda_dev->device_id;
const char*value;
verbose("\tClass code: [%04x]\n", hda_dev->class_id);
verbose("\tClass code: [%04X]\n", hda_dev->class_id);
devicepath = get_pci_dev_path(hda_dev);
controller_name = get_hda_controller_name(controller_device_id, controller_vendor_id);
trunk/i386/libsaio/hda.h
7777
7878
7979
80
81
82
80
81
82
8383
8484
8585
......
441441
442442
443443
444
444445
445446
446447
struct hdacc_codecs;
typedef struct
{
uint32_t cid;
uint16_t revid;
char *name;
uint32_t id;
uint32_t rev;
const char *name;
} hdacc_codecs;
*/
#define HDA_CODEC_ALC882 HDA_CODEC_CONSTRUCT(REALTEK, 0x0882)
#define HDA_CODEC_ALC883 HDA_CODEC_CONSTRUCT(REALTEK, 0x0883)
#define HDA_CODEC_ALC885 HDA_CODEC_CONSTRUCT(REALTEK, 0x0885)
#define HDA_CODEC_ALC886 HDA_CODEC_CONSTRUCT(REALTEK, 0x0886)
#define HDA_CODEC_ALC887 HDA_CODEC_CONSTRUCT(REALTEK, 0x0887)
#define HDA_CODEC_ALC888 HDA_CODEC_CONSTRUCT(REALTEK, 0x0888)
#define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889)
trunk/i386/libsaio/dram_controllers.c
490490
491491
492492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514493
515494
516495
{ 0, 0, "",NULL, NULL, NULL },
// Intel
//{ 0x8086, 0x0100, "2rd Gen Core processor",NULL, NULL, NULL },
//{ 0x8086, 0x0104, "2rd Gen Core processor",NULL, NULL, NULL },
//{ 0x8086, 0x010C, "Xeon E3-1200/2rd Gen Core processor",NULL, NULL, NULL },
//{ 0x8086, 0x0150, "Xeon E3-1200 v2/3rd Gen Core processor",NULL, NULL, NULL },
//{ 0x8086, 0x0154, "3rd Gen Core processor",NULL, NULL, NULL },
//{ 0x8086, 0x0158, "Xeon E3-1200 v2/Ivy Bridge",NULL, NULL, NULL },
//{ 0x8086, 0x015C, "Xeon E3-1200 v2/3rd Gen Core processor",NULL, NULL, NULL },
//{ 0x8086, 0x0BF0, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF1, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF2, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF3, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF4, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF5, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF6, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0BF7, "Atom Processor D2xxx/N2xxx",NULL, NULL, NULL },
//{ 0x8086, 0x0C00, "Haswell",NULL, NULL, NULL },
//{ 0x8086, 0x0C04, "Haswell",NULL, NULL, NULL },
//{ 0x8086, 0x0C08, "Haswell",NULL, NULL, NULL },
{ 0x8086, 0x7190, "VMWare",NULL, NULL, NULL },
{ 0x8086, 0x1A30, "82845 845 [Brookdale]",NULL, NULL, NULL },
trunk/i386/libsaio/nvidia.c
21132113
21142114
21152115
2116
2116
21172117
21182118
21192119
// get card type
nvCardType = (REG32(0) >> 20) & 0x1ff;
verbose("\tClass code: [%04x]\n", nvda_dev->class_id);
verbose("\tClass code: [%04X]\n", nvda_dev->class_id);
model = get_nvidia_model(((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id));
trunk/i386/libsaio/ati.c
25012501
25022502
25032503
2504
2504
25052505
25062506
25072507
{
char *devicepath;
verbose("\tClass code: [%04x]\n", ati_dev->class_id );
verbose("\tClass code: [%04X]\n", ati_dev->class_id );
if (!init_card(ati_dev))
{
trunk/i386/libsaio/platform.c
4040
4141
4242
43
43
44
4445
4546
4647
4748
4849
4950
50
51
52
53
5154
5255
5356
void scan_mem()
{
static bool done = false;
if (done) {
if (done)
{
return;
}
/* our code only works on Intel chipsets so make sure here */
if (pci_config_read16(PCIADDR(0, 0x00, 0), 0x00) != 0x8086) {
bootInfo->memDetect = false;
} else {
}
else
{
bootInfo->memDetect = true;
}
/* manually */
trunk/i386/libsaio/cpu.c
486486
487487
488488
489
490489
491490
492491
......
505504
506505
507506
507
508
509
510
508511
509512
510513
case CPUID_MODEL_SANDYBRIDGE:
case CPUID_MODEL_IVYBRIDGE:
case CPUID_MODEL_HASWELL_U5:
case CPUID_MODEL_ATOM_3700:
case CPUID_MODEL_HASWELL:
case CPUID_MODEL_HASWELL_SVR:
//case CPUID_MODEL_HASWELL_H:
p->CPU.NoCores= (uint32_t)bitfield((uint32_t)msr, 19, 16);
p->CPU.NoThreads= (uint32_t)bitfield((uint32_t)msr, 15, 0);
break;
case CPUID_MODEL_ATOM_3700:
p->CPU.NoCores= 4;
p->CPU.NoThreads= 4;
break;
}
if (p->CPU.NoCores == 0)
trunk/i386/libsaio/platform.h
396396
397397
398398
399
400399
400
401401
402402
403403
uint32_tLogicalPerPackage;
uint32_tSignature;// Processor Signature
uint32_tStepping;// Stepping
//uint16_tType;// Type
uint32_tModel;// Model
//uint32_tType;// Processor Type
uint32_tExtModel;// Extended Model
uint32_tFamily;// Family
uint32_tExtFamily;// Extended Family
trunk/i386/libsaio/pci_setup.c
7272
7373
7474
75
7576
7677
7778
7879
7980
8081
82
8183
8284
8385
......
149151
150152
151153
152
154
153155
154156
155157
DBG("Setup ETHERNET %s enabled\n", do_eth_devprop? "is":"is not");
verbose("[ ETHERNET DEVICE INFO ]\n");
setup_eth_devdrop(current);
verbose("\n");
break; // PCI_CLASS_NETWORK_ETHERNET
case PCI_CLASS_NETWORK_OTHER:
DBG("Setup WIRELESS %s enabled\n", do_wifi_devprop? "is":"is not");
verbose("[ WIRELESS DEVICE INFO ]\n");
setup_wifi_devdrop(current);
verbose("\n");
break; // PCI_CLASS_NETWORK_OTHER
case PCI_CLASS_DISPLAY_VGA:
case PCI_CLASS_SERIAL_FIREWIRE:
DBG("FireWire\n");
verbose("[ FIREWIRE DEVICE INFO ]\n");
verbose("\tClass code: [%04x]\n\tFireWire device [%04x:%04x]-[%04x:%04x]\n\t%s\n",
verbose("\tClass code: [%04X]\n\tFireWire device [%04x:%04x]-[%04x:%04x]\n\t%s\n",
current->class_id,current->vendor_id, current->device_id,
current->subsys_id.subsys.vendor_id,
current->subsys_id.subsys.device_id, devicepath);
trunk/i386/libsaio/cpu.h
283283
284284
285285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
286309
return result;
}
/*
* Timing Functions
*/
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
static inline void CpuPause(void)
{
__asm__ volatile ("rep; nop");
}
static inline uint32_t DivU64x32(uint64_t dividend, uint32_t divisor)
{
__asm__ volatile ("divl %1" : "+A"(dividend) : "r"(divisor));
return (uint32_t) dividend;
}
static inline uint64_t MultU32x32(uint32_t multiplicand, uint32_t multiplier)
{
uint64_t result;
__asm__ volatile ("mull %2" : "=A"(result) : "a"(multiplicand), "r"(multiplier));
return result;
}
#endif /* !__LIBSAIO_CPU_H */
trunk/i386/libsaio/smbios.c
12761276
12771277
12781278
1279
12791280
12801281
12811282
1282
1283
12831284
12841285
12851286
{
uint8_t *ptr = (uint8_t *)neweps->dmi.tableAddress;
SMBStructHeader *structHeader = (SMBStructHeader *)ptr;
uint8_t *ret = NULL;
int i, isZero, isOnes;
uint8_t fixedUUID[UUID_LEN] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF};
const char *sysId = getStringForKey(kSMBSystemInformationUUIDKey, SMBPlist); // try to get user's uuid from smbios.plist
uint8_t *ret = (uint8_t *)getUUIDFromString(sysId); // convert user's uuid from string
ret = (uint8_t *)getUUIDFromString(sysId); // convert user's uuid from string
for (;(structHeader->type != kSMBTypeSystemInformation);) // find System Information Table (Type 1) in patched SMBIOS
{
trunk/i386/libsaio/stringTable.c
102102
103103
104104
105
105
106106
107107
108108
......
156156
157157
158158
159
160
161
162
159163
160164
161165
......
175179
176180
177181
178
179
182
183
184
185
186
180187
181188
182189
......
224231
225232
226233
227
234
235
228236
237
238
239
240
229241
230242
231243
......
263275
264276
265277
278
279
280
281
266282
267283
268284
......
302318
303319
304320
305
321
322
306323
307324
308325
......
315332
316333
317334
318
335
336
319337
320338
321339
322340
323
341
324342
325343
326344
......
374392
375393
376394
377
378
379
395
396
397
398
399
400
380401
381402
382403
383404
384405
385
386
406
407
408
409
387410
388411
389412
390413
391414
392415
393
416
417
394418
395419
396420
......
399423
400424
401425
402
403426
404427
405428
......
414437
415438
416439
417
418
419
440
441
442
443
444
445
420446
421447
422448
423449
424450
425
451
452
426453
427454
428455
429456
430457
431
432
458
459
460
461
433462
434463
435464
436465
437466
438467
439
468
469
440470
441471
442472
443473
444
474
475
445476
446477
447478
448
479
480
481
449482
450483
451484
......
486519
487520
488521
489
522
523
490524
491525
492526
......
496530
497531
498532
499
500
533
534
535
536
501537
502538
503539
504540
505
541
542
506543
507544
508545
509
546
547
510548
511549
512550
513
551
552
514553
515554
516555
......
527566
528567
529568
530
531
569
570
571
572
532573
533574
534575
535576
536577
537578
538
579
580
539581
540582
541583
......
555597
556598
557599
558
600
559601
560602
603
604
561605
562606
563
607
608
609
610
611
564612
565
613
614
566615
567
616
617
568618
569619
570620
571621
572622
573
623
624
574625
575626
576
627
628
577629
578630
579631
......
738790
739791
740792
793
794
741795
742796
743797
744798
745799
746800
747
801
802
748803
749
804
805
750806
751
807
808
809
752810
753
754
755
756
811
812
813
814
815
816
817
757818
758819
759
820
760821
761
822
762823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
763838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
764897
765898
766899
tab = (char *)table;
buf = (char *)malloc(len + 3);
sprintf(buf, "\"%s\"", key);
snprintf(buf, len + 3,"\"%s\"", key);
len = strlen(buf);
while(*tab) {
}
bufsize = end - begin + 1;
newstr = malloc(bufsize);
if (!newstr)
{
return 0;
}
strlcpy(newstr, begin, bufsize);
*list = end;
*size = newsize;
if (*table == '\\') {
table += 2;
ret += 1 + (compress ? 0 : 1);
} else {
if (*table == '\"') {
}
else
{
if (*table == '\"')
{
return ret;
}
ret++;
char *newstr, *p;
int size;
if (getValueForConfigTableKey(config, key, &val, &size)) {
if (getValueForConfigTableKey(config, key, &val, &size))
{
newstr = (char *)malloc(size+1);
if (!newstr)
{
return 0;
}
for (p = newstr; size; size--, p++, val++) {
if ((*p = *val) == '\\') {
switch (*++val) {
if (getValueForKey(key, &val, &size, config) && size) {
newstr = (char *)malloc(size + 1);
if (!newstr)
{
return 0;
}
strlcpy(newstr, val, size + 1);
return newstr;
} else {
while (*line) {
/* look for keyword or argument */
while (isspace(*line)) {
while (isspace(*line))
{
line++;
}
value = line;
value_len = 0;
}
if ((strlen(match) == key_len) && strncmp(match, key, key_len) == 0) {
if ((strlen(match) == key_len) && strncmp(match, key, key_len) == 0)
{
// create a new string
char* newstr = malloc(value_len + 1);
strncpy(newstr, value, value_len);
newstr[value_len] = 0;
*matchval = newstr;
*len = value_len;
retval = true;
int size, sum;
bool negative = false;
if (getValueForKey(key, &val, &size, config)) {
if (size) {
if (*val == '-') {
if (getValueForKey(key, &val, &size, config))
{
if (size)
{
if (*val == '-')
{
negative = true;
val++;
size--;
}
for (sum = 0; size > 0; size--) {
if (*val < '0' || *val > '9') {
for (sum = 0; size > 0; size--)
{
if (*val < '0' || *val > '9')
{
return false;
}
sum = (sum * 10) + (*val++ - '0');
}
if (negative) {
if (negative)
{
sum = -sum;
}
*value = sum;
}
return false;
}
/*
*
*/
bool negative = false;
bool percentage = false;
if (getValueForKey(key, &val, &size, config)) {
if ( size ) {
if (*val == '-') {
if (getValueForKey(key, &val, &size, config))
{
if ( size )
{
if (*val == '-')
{
negative = true;
val++;
size--;
}
if (val[size-1] == '%') {
if (val[size-1] == '%')
{
percentage = true;
size--;
}
// convert string to integer
for (sum = 0; size > 0; size--) {
if (*val < '0' || *val > '9') {
for (sum = 0; size > 0; size--)
{
if (*val < '0' || *val > '9')
{
return false;
}
sum = (sum * 10) + (*val++ - '0');
}
if (percentage) {
if (percentage)
{
sum = ( dimension_max * sum ) / 100;
}
// calculate offset from opposite origin
if (negative) {
if (negative)
{
sum = ( ( dimension_max - object_size ) - sum );
}
} else {
}
else
{
// null value calculate center
sum = ( dimension_max - object_size ) / 2;
int overrideSize;
bool override, ret;
if (getValueForBootKey(bootArgs->CommandLine, key, val, size)) {
if (getValueForBootKey(bootArgs->CommandLine, key, val, size))
{
return true;
}
// and prefer its values with the exceptions for
// "Kernel"="mach_kernel" and "Kernel Flags"="".
if (config->canOverride) {
if (getValueForConfigTableKey(&bootInfo->chameleonConfig, key, &overrideVal, &overrideSize)) {
if (config->canOverride)
{
if (getValueForConfigTableKey(&bootInfo->chameleonConfig, key, &overrideVal, &overrideSize))
{
override = true;
// NOTE: Values are defined by apple as being in com.apple.Boot.plist
// kHelperRootUUIDKey, kKernelArchKey, kMKextCacheKey, kKernelCacheKey, kKernelNameKey, kKernelFlagsKey
if (ret && (strcmp(key, kKernelNameKey) == 0) && (overrideSize == 0)) {
if (ret && (strcmp(key, kKernelNameKey) == 0) && (overrideSize == 0))
{
override = false;
}
if (ret && (strcmp(key, kKernelFlagsKey) == 0) && (overrideSize == 0)) {
if (ret && (strcmp(key, kKernelFlagsKey) == 0) && (overrideSize == 0))
{
override = false;
}
if (override) {
if (override)
{
*val = overrideVal;
*size = overrideSize;
ret = true;
{
char *p2 = p1, tmp;
while (*p1 != '\0') {
while (*p2 != '\0' && *p2 != '\n') {
while (*p1 != '\0')
{
while (*p2 != '\0' && *p2 != '\n')
{
p2++;
}
tmp = *p2;
*p2 = '\0';
printf("%s\n", p1);
*p2 = tmp;
if (tmp == '\0') {
if (tmp == '\0')
{
break;
}
p1 = ++p2;
int ParseXMLFile( char *buffer, TagPtr *dict )
{
long length, pos;
TagPtr tag;
TagPtr tag = 0;
pos = 0;
char *configBuffer;
length = strlen(buffer) + 1;
configBuffer = malloc(strlen(buffer)+1);
strcpy(configBuffer, buffer);
if (!configBuffer)
{
return -1;
}
strlcpy(configBuffer, buffer, length );
while (1) {
while (1)
{
length = XMLParseNextTag(configBuffer + pos, &tag);
if (length == -1) {
if (length == -1)
{
break;
}
pos += length;
if (tag == 0) {
if (tag == 0)
{
continue;
}
if (tag->type == kTagTypeDict) {
if (tag->type == kTagTypeDict)
{
break;
}
*/
int loadHelperConfig(config_file_t *config)
{
int rfd, pfd, sfd, count, ret=-1, fixedsize;
char *dirspec[] = {
"/com.apple.boot.P/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"/com.apple.boot.R/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"/com.apple.boot.S/Library/Preferences/SystemConfiguration/com.apple.Boot.plist"
};
int i, fd, count, ret=-1;
// This is a simple rock - paper scissors algo. R beats S, P beats R, S beats P
// If all three, S is used for now. This should be changed to something else (say, timestamp?)
for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++)
pfd = open(dirspec[0], 0);
if(pfd >= 0)// com.apple.boot.P exists
{
if ((fd = open(dirspec[i], 0)) >= 0)
sfd = open(dirspec[2], 0); // com.apple.boot.S takes precidence if it also exists
if(sfd >= 0)
{
// read file
count = read(fd, config->plist, IO_CONFIG_DATA_SIZE);
close(fd);
// Use sfd
fixedsize = MIN(file_size(sfd),IO_CONFIG_DATA_SIZE);
count = read(sfd, config->plist, fixedsize);
close(sfd);
close(pfd);
if (count != fixedsize) return -1;
// build xml dictionary
ParseXMLFile(config->plist, &config->dictionary);
sysConfigValid = true;
sysConfigValid = true;
ret=0;
break;
}
else
{
// used pfd
fixedsize = MIN(file_size(pfd),IO_CONFIG_DATA_SIZE);
count = read(pfd, config->plist, fixedsize);
close(pfd);
if (count != fixedsize) return -1;
// build xml dictionary
ParseXMLFile(config->plist, &config->dictionary);
sysConfigValid = true;
ret = 0;
}
}
else
{
rfd = open(dirspec[1], 0); // com.apple.boot.R exists
if(rfd >= 0)
{
pfd = open(dirspec[2], 0); // com.apple.boot.P takes recidence if it exists
if(pfd >= 0)
{
// use sfd
fixedsize = MIN(file_size(pfd),IO_CONFIG_DATA_SIZE);
count = read(pfd, config->plist, fixedsize);
close(pfd);
close(rfd);
if (count != fixedsize) return -1;
// build xml dictionary
ParseXMLFile(config->plist, &config->dictionary);
sysConfigValid = true;
ret = 0;
}
else
{
// use rfd
fixedsize = MIN(file_size(rfd),IO_CONFIG_DATA_SIZE);
count = read(rfd, config->plist, fixedsize);
close(rfd);
if (count != fixedsize) return -1;
// build xml dictionary
ParseXMLFile(config->plist, &config->dictionary);
sysConfigValid = true;
ret = 0;
}
}
else
{
sfd = open(dirspec[2], 0); // com.apple.boot.S exists, but nothing else does
if(sfd >= 0)
{
// use sfd
fixedsize = MIN(file_size(sfd),IO_CONFIG_DATA_SIZE);
count = read(sfd, config->plist, fixedsize);
close(sfd);
if (count != fixedsize) return -1;
// build xml dictionary
ParseXMLFile(config->plist, &config->dictionary);
sysConfigValid = true;
ret = 0;
}
}
}
return ret;
}
trunk/i386/libsaio/biosfn.c
4545
4646
4747
48
48
4949
5050
51
51
5252
5353
5454
......
136136
137137
138138
139
139
140140
141141
142142
......
207207
208208
209209
210
210
211211
212212
213213
......
279279
280280
281281
282
282
283283
284284
285285
#ifndef DEBUG_MEMRANGE
#define DEBUG_MEMRANGE 0
#define MEMRANGE 0
#endif
#if DEBUG_MEMRANGE
#if MEMRANGE
#define DBG(x...)printf(x)
#else
#define DBG(x...)msglog(x)
#endif
}
#if DEBUG_MEMRANGE
#if MEMRANGE
static unsigned long rerangeMemoryMap(unsigned long count);
static unsigned long rerangeMemoryMap(unsigned long count)
MemoryRange *range = (MemoryRange *)BIOS_ADDR;
unsigned longcount = 0;
#if DEBUG_MEMRANGE
#if MEMRANGE
unsigned longrerangedCount;
#endif
unsigned long longconMemSize = 0;
*conMemSizePtr = conMemSize / 1024; // size in KB
*extMemSizePtr = extMemSize / 1024; // size in KB
#if DEBUG_MEMRANGE
#if MEMRANGE
rerangedCount = rerangeMemoryMap(count);
range += rerangedCount - count;
#endif
trunk/i386/libsaio/convert.c
1111
1212
1313
14
14
1515
1616
1717
......
197197
198198
199199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/* ======================================================= */
/** Transform a 16 bytes hexadecimal value UUID to a string */
const char *getStringFromUUID(const EFI_CHAR8 *eUUID)
const char *getStringFromUUID(const uint8_t *eUUID)
{
static char msg[UUID_LEN*2 + 8] = "";
if (!eUUID) return "";
}
/* ======================================================= */
// FIXME: can't use my original code here,
// Ironically, trying to reuse convertHexStr2Binary() would RESET the system!
/*
static EFI_CHAR8 *getUUIDFromString2(const char * szInUUID)
{
char szUUID[UUID_LEN+1], *p=szUUID;
int size=0;
void* ret;
if (!szInUUID || strlen(szInUUID)<UUID_LEN) return (EFI_CHAR8*) 0;
while(*szInUUID) if (*szInUUID!='-') *p++=*szInUUID++; else szInUUID++;
*p='\0';
ret = convertHexStr2Binary(szUUID, &size);
if (!ret || size!=UUID_LEN)
{
verbose("UUID: cannot convert string <%s> to valid UUID.\n", szUUID);
return (EFI_CHAR8*) 0;
}
return (EFI_CHAR8 *) ret; // new allocated buffer containing the converted string to bin
}
*/
trunk/i386/libsaio/saio_types.h
103103
104104
105105
106
106
107107
108108
109109
......
122122
123123
124124
125
125
126126
127127
128128
unsigned char dev_path[16];
unsigned char reserved3;
unsigned char checksum;
} params;
} params __attribute__((packed));
struct drive_dpte
{
unsigned short reserved;
unsigned char revision;
unsigned char checksum;
} dpte;
} dpte __attribute__((packed));
} __attribute__((packed));
typedef struct boot_drive_info boot_drive_info_t;
trunk/i386/libsaio/convert.h
1111
1212
1313
14
14
1515
1616
1717
#define UUID_LEN16
const char*getStringFromUUID(const EFI_CHAR8* uuid);
const char*getStringFromUUID(const uint8_t *uuid);
EFI_CHAR8*getUUIDFromString(const char *source);
void*convertHexStr2Binary(const char *hexStr, int *outLength);
uint32_tascii_hex_to_int(char *buff);
trunk/i386/libsaio/fake_efi.c
2222
2323
2424
25
26
27
28
2529
2630
2731
......
732736
733737
734738
735
736
739
740
737741
738
742
739743
740744
741
742
745
743746
744
745
747
748
746749
747750
748751
......
759762
760763
761764
765
766
767
768
769
770
771
772
762773
763774
764
775
765776
766777
767778
......
806817
807818
808819
809
820
810821
822
823
824
825
826
827
828
829
830
831
832
833
834
811835
812836
813837
......
818842
819843
820844
821
845
822846
823847
824848
#define DEBUG_EFI 0
#endif
#ifndef RANDOMSEED
#define RANDOMSEED 0
#endif
#if DEBUG_EFI
#define DBG(x...)printf(x)
#else
stop("setupChosenNode: Couldn't get '/chosen' node");
}
int length = strlen(gBootUUIDString);
if (length)
// Only accept a UUID with the correct length.
if (strlen(gBootUUIDString) == 36)
{
DT__AddProperty(chosenNode, "boot-uuid", length + 1, gBootUUIDString);
DT__AddProperty(chosenNode, "boot-uuid", 37, gBootUUIDString);
}
length = strlen(bootArgs->CommandLine);
DT__AddProperty(chosenNode, "boot-args", length + 1, bootArgs->CommandLine);
DT__AddProperty(chosenNode, "boot-args", sizeof(bootArgs->CommandLine), (EFI_UINT8 *)bootArgs->CommandLine);
length = strlen(bootInfo->bootFile);
DT__AddProperty(chosenNode, "boot-file", length + 1, bootInfo->bootFile);
// Adding the default kernel name (mach_kernel) for kextcache.
DT__AddProperty(chosenNode, "boot-file", sizeof(bootInfo->bootFile), bootInfo->bootFile);
//DT__AddProperty(chosenNode, "boot-device-path", bootDPsize, gBootDP);
//
UInt8 index = 0;
EFI_UINT16 PMTimerValue = 0;
#if RANDOMSEED
EFI_UINT32 randomValue, tempValue, cpuTick;
EFI_UINT32 ecx, esi, edi = 0;
EFI_UINT32 rcx, rdx, rsi, rdi;
randomValue = tempValue = ecx = esi = edi = 0;// xor%ecx,%ecx
cpuTick = rcx = rdx = rsi = rdi = 0;
#else
EFI_UINT32 randomValue = 0, cpuTick = 0;
EFI_UINT32 ecx = 0, edx = 0, esi = 0, edi = 0;
#endif
// LEAF_1 - Feature Information (Function 01h).
if (Platform.CPU.CPUID[CPUID_1][2] & 0x40000000)// Checking ecx:bit-30
{
continue;// jb0x17e55(retry)
}
cpuTick = (EFI_UINT32) getCPUTick();// callq0x121a7
cpuTick = (EFI_UINT32) getCPUTick();// callq0x121a7
//printf("value: 0x%x\n", getCPUTick());
#if RANDOMSEED
rcx = (cpuTick >> 8);// mov%rax,%rcx
// shr$0x8,%rcx
rdx = (cpuTick >> 0x10);// mov%rax,%rdx
// shr$0x10,%rdx
rdi = rsi;// mov%rsi,%rdi
rdi = (rdi ^ cpuTick);// xor%rax,%rdi
rdi = (rdi ^ rcx);// xor%rcx,%rdi
rdi = (rdi ^ rdx);// xor%rdx,%rdi
seedBuffer[index] = (rdi & 0xff);// mov%dil,(%r15,%r12,1)
#else
ecx = (cpuTick >> 8);// mov%rax,%rcx
// shr$0x8,%rcx
edx = (cpuTick >> 0x10);// mov%rax,%rdx
edi = (edi ^ edx);// xor%rdx,%rdi
seedBuffer[index] = (edi & 0xff);// mov%dil,(%r15,%r12,1)
#endif
edi = (edi & 0x2f);// and$0x2f,%edi
edi = (edi + esi);// add%esi,%edi
index++;// incr12
trunk/i386/libsaio/misc.c
4646
4747
4848
49
5049
5150
5251
......
108107
109108
110109
111
112110
113111
114112
#include "libsaio.h"
//#if UNUSED
/*
* keyboard controller (8042) I/O port addresses
*/
/* wait until done */
flushKeyboardInputBuffer();
}
//#endif /* UNUSED */
//==========================================================================
// Return the platform name for this hardware.
trunk/i386/boot2/boot.c
644644
645645
646646
647
647
648
648649
649650
650651
}
}
if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig)) {
if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig))
{
if (strncmp(val, "i386", sizeof("i386") ) == 0)
{
archCpuType = CPU_TYPE_I386;
trunk/i386/boot2/boot.h
8585
8686
8787
88
88
8989
9090
9191
#define kScanSingleDriveKey"Scan Single Drive"
#define kInstantMenuKey"Instant Menu"
#define kDefaultKernel"mach_kernel"
#define kOSXKernel"kernel"// Yosemite
#define kOSXKernel"kernel"// Yosemite+
#define kGUIKey"GUI"
#define kBootBannerKey"Boot Banner"
#define kShowInfoKey"ShowInfo"// gui.c
trunk/CHANGES
1
12
23
34
- cparm : Rock - Paper - Scissors algo
- Bronya : Improve support for AMD CPU.
- Bungo : Added "machine-signature"
- Zenith432 : Protect timing code in scan_cpu() from interrupts, use bios for sleep()

Archive Download the corresponding diff file

Revision: 2697