Root/
Source at commit HEAD created 5 years 6 days ago. By ifabio, Few update to kernelPatcher (Credits to CrazyBirdy) | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2009 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | * Merge into file from module compcept by ErmaC and Marchrius ␊ |
5 | *␊ |
6 | */␊ |
7 | ␊ |
8 | #include "boot.h"␊ |
9 | #include "bootstruct.h"␊ |
10 | #include "pci.h"␊ |
11 | #include "platform.h"␊ |
12 | //#include "convert.h"␊ |
13 | #include "device_inject.h"␊ |
14 | #include "networking.h"␊ |
15 | ␊ |
16 | #define STRINGIFY(x) #x␊ |
17 | #define TOSTRING(x) STRINGIFY(x)␊ |
18 | ␊ |
19 | #define HEADER __FILE__ " [" TOSTRING(__LINE__) "]: "␊ |
20 | ␊ |
21 | #ifndef DEBUG_ETHERNET␊ |
22 | ␉#define DEBUG_ETHERNET 0␊ |
23 | #endif␊ |
24 | ␊ |
25 | #if DEBUG_ETHERNET␊ |
26 | ␉#define DBG(x...)␉printf(x)␊ |
27 | #else␊ |
28 | ␉#define DBG(x...)␊ |
29 | #endif␊ |
30 | ␊ |
31 | #ifndef DEBUG_WLAN␊ |
32 | ␉#define DEBUG_WLAN 0␊ |
33 | #endif␊ |
34 | ␊ |
35 | #if DEBUG_WLAN␊ |
36 | ␉#define DBG(x...)␉printf(x)␊ |
37 | #else␊ |
38 | ␉#define DBG(x...)␊ |
39 | #endif␊ |
40 | ␊ |
41 | uint32_t builtin_set␉= 0;␊ |
42 | uint8_t builtin␉␉= 0;␊ |
43 | extern uint32_t location_number;␊ |
44 | ␊ |
45 | static network_device known_ethernet_cards[] =␊ |
46 | {␊ |
47 | ␉// Realtek␊ |
48 | ␉{ PCI_VENDOR_ID_REALTEK, 0x8129, "8129 Gigabit Ethernet" },␊ |
49 | ␉{ PCI_VENDOR_ID_REALTEK, 0x8136, "RTL8101E/RTL8102E PCI-E Fast Ethernet Controller" },␊ |
50 | ␉{ PCI_VENDOR_ID_REALTEK, 0x8139, "RTL8139/810x Family Fast Ethernet" },␊ |
51 | ␉{ PCI_VENDOR_ID_REALTEK, 0x8167, "8169/8110 Gigabit Ethernet" },␊ |
52 | ␉{ PCI_VENDOR_ID_REALTEK, 0x8168, "RTL8111/8168 PCI-E Gigabit Ethernet" },␊ |
53 | ␉{ PCI_VENDOR_ID_REALTEK, 0x8169, "8169/8110 Gigabit Ethernet" },␊ |
54 | ␊ |
55 | ␉{ 0x1113, 0x1211, "Realtek RTL8139 Family Fast Ethernet" },␊ |
56 | ␉{ 0x1500, 0x1360, "Realtek RTL8139 Family Fast Ethernet" },␊ |
57 | ␉{ 0x4033, 0x1360, "Realtek RTL8139 Family Fast Ethernet" },␊ |
58 | ␉{ 0x1186, 0x1300, "Realtek RTL8139 Family Fast Ethernet" },␊ |
59 | ␉{ 0x1186, 0x1340, "Realtek RTL8139 Family Fast Ethernet" },␊ |
60 | ␉{ 0x13d1, 0xab06, "Realtek RTL8139 Family Fast Ethernet" },␊ |
61 | ␉{ 0x1259, 0xa117, "Realtek RTL8139 Family Fast Ethernet" },␊ |
62 | ␉{ 0x1259, 0xa11e, "Realtek RTL8139 Family Fast Ethernet" },␊ |
63 | ␉{ 0x14ea, 0xab06, "Realtek RTL8139 Family Fast Ethernet" },␊ |
64 | ␉{ 0x14ea, 0xab07, "Realtek RTL8139 Family Fast Ethernet" },␊ |
65 | ␉{ 0x11db, 0x1234, "Realtek RTL8139 Family Fast Ethernet" },␊ |
66 | ␉{ 0x1432, 0x9130, "Realtek RTL8139 Family Fast Ethernet" },␊ |
67 | ␉{ 0x02ac, 0x1012, "Realtek RTL8139 Family Fast Ethernet" },␊ |
68 | ␉{ 0x018a, 0x0106, "Realtek RTL8139 Family Fast Ethernet" },␊ |
69 | ␉{ 0x126c, 0x1211, "Realtek RTL8139 Family Fast Ethernet" },␊ |
70 | ␉{ 0x1743, 0x8139, "Realtek RTL8139 Family Fast Ethernet" },␊ |
71 | ␉{ 0x021b, 0x8139, "Realtek RTL8139 Family Fast Ethernet" },␊ |
72 | ␊ |
73 | ␉// Marvell␊ |
74 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4320, "Yukon Gigabit Adapter 88E8001 Singleport Copper SA" },␊ |
75 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4340, "Yukon Gigabit Adapter 88E8021 Singleport Copper SA" },␊ |
76 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4341, "Yukon Gigabit Adapter 88E8022 Singleport Copper SA" },␊ |
77 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4342, "Yukon Gigabit Adapter 88E8061 Singleport Copper SA" },␊ |
78 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4343, "Yukon Gigabit Adapter 88E8062 Singleport Copper SA" },␊ |
79 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4344, "Yukon Gigabit Adapter 88E8021 Singleport Copper SA" },␊ |
80 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4345, "Yukon Gigabit Adapter 88E8022 Singleport Copper SA" },␊ |
81 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4346, "Yukon Gigabit Adapter 88E8061 Singleport Copper SA" },␊ |
82 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4347, "Yukon Gigabit Adapter 88E8062 Singleport Copper SA" },␊ |
83 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4350, "Yukon Gigabit Adapter 88E8035 Singleport Copper SA" },␊ |
84 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4351, "Yukon Gigabit Adapter 88E8036 Singleport Copper SA" },␊ |
85 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4352, "Yukon Gigabit Adapter 88E8038 Singleport Copper SA" },␊ |
86 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4353, "Yukon Gigabit Adapter 88E8039 Singleport Copper SA" },␊ |
87 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4354, "Yukon Gigabit Adapter 88E8040 Singleport Copper SA" },␊ |
88 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4355, "Yukon Gigabit Adapter 88E8040T Singleport Copper SA" },␊ |
89 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4356, "Yukon Gigabit Adapter 88EC033 Singleport Copper SA" },␊ |
90 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4357, "Yukon Gigabit Adapter 88E8042 Singleport Copper SA" },␊ |
91 | ␉{ PCI_VENDOR_ID_MARVELL, 0x435A, "Yukon Gigabit Adapter 88E8048 Singleport Copper SA" },␊ |
92 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4360, "Yukon Gigabit Adapter 88E8052 Singleport Copper SA" },␊ |
93 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4361, "Yukon Gigabit Adapter 88E8050 Singleport Copper SA" },␊ |
94 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4362, "Yukon Gigabit Adapter 88E8053 Singleport Copper SA" },␊ |
95 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4363, "Yukon Gigabit Adapter 88E8055 Singleport Copper SA" },␊ |
96 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4364, "Yukon Gigabit Adapter 88E8056 Singleport Copper SA" },␊ |
97 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4365, "Yukon Gigabit Adapter 8E8070 Singleport Copper SA" },␊ |
98 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4366, "Yukon Gigabit Adapter 88EC036 Singleport Copper SA" },␊ |
99 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4367, "Yukon Gigabit Adapter 88EC032 Singleport Copper SA" },␊ |
100 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4368, "Yukon Gigabit Adapter 88EC034 Singleport Copper SA" },␊ |
101 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4369, "Yukon Gigabit Adapter 88EC042 Singleport Copper SA" },␊ |
102 | ␉{ PCI_VENDOR_ID_MARVELL, 0x436A, "Yukon Gigabit Adapter 88E8058 Singleport Copper SA" },␊ |
103 | ␉{ PCI_VENDOR_ID_MARVELL, 0x436B, "Yukon Gigabit Adapter 88E8071 Singleport Copper SA" },␊ |
104 | ␉{ PCI_VENDOR_ID_MARVELL, 0x436C, "Yukon Gigabit Adapter 88E8072 Singleport Copper SA" },␊ |
105 | ␉{ PCI_VENDOR_ID_MARVELL, 0x436D, "Yukon Gigabit Adapter 88E8055 Singleport Copper SA" },␊ |
106 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4370, "Yukon Gigabit Adapter 88E8075 Singleport Copper SA" },␊ |
107 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4380, "Yukon Gigabit Adapter 88E8057 Singleport Copper SA" },␊ |
108 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4381, "Yukon Gigabit Adapter 88E8059 Singleport Copper SA" },␊ |
109 | ␉{ PCI_VENDOR_ID_MARVELL, 0x4382, "Yukon Gigabit Adapter 88E8079 Singleport Copper SA" },␊ |
110 | //␉{ PCI_VENDOR_ID_MARVELL, 0x5005, "Belkin F5D5005 Gigabit Desktop Network PCI Card" },␊ |
111 | ␊ |
112 | ␉// Broadcom␊ |
113 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1600, "BCM5752 Gigabit Ethernet PCI Express" },␊ |
114 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1655, "BCM5717 Gigabit Ethernet PCIe" },␊ |
115 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1656, "BCM5718 Gigabit Ethernet PCIe" },␊ |
116 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1657, "BCM5719 Gigabit Ethernet PCIe" },␊ |
117 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1659, "BCM5721 Gigabit Ethernet PCI Express" },␊ |
118 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x165A, "BCM5722 Gigabit Ethernet PCI Express" },␊ |
119 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x166A, "BCM5780 Gigabit Ethernet" },␊ |
120 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1672, "BCM5754M Gigabit Ethernet PCI Express" },␊ |
121 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1673, "BCM5755M Gigabit Ethernet PCI Express" },␊ |
122 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x167A, "BCM5754 Gigabit Ethernet PCI Express" },␊ |
123 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x167B, "BCM5755 Gigabit Ethernet PCI Express" },␊ |
124 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1684, "BCM5764M Gigabit Ethernet PCIe" },␊ |
125 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1691, "BCM57788 Gigabit Ethernet PCIe" },␊ |
126 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1693, "BCM5787M Gigabit Ethernet PCI Express" },␊ |
127 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x169B, "BCM5787 Gigabit Ethernet PCI Express" },␊ |
128 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x16B4, "BCM57765 Gigabit Ethernet PCIe" },␊ |
129 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x16B5, "BCM57785 Gigabit Ethernet PCIe" },␊ |
130 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1712, "BCM5906 Fast Ethernet PCI Express" },␊ |
131 | ␉{ PCI_VENDOR_ID_BROADCOM, 0x1713, "BCM5906M Fast Ethernet PCI Express" },␊ |
132 | ␊ |
133 | ␉// JMicron␊ |
134 | ␉{ PCI_VENDOR_ID_JMICRON, 0x0250, "JMC250 PCI Express Gigabit Ethernet Controller" },␊ |
135 | ␉{ PCI_VENDOR_ID_JMICRON, 0x0260, "JMC260 PCI Express Gigabit Ethernet Controller" },␊ |
136 | ␊ |
137 | ␉// Intel␊ |
138 | ␉{ PCI_VENDOR_ID_INTEL, 0x1000, "82542" },␊ |
139 | ␉{ PCI_VENDOR_ID_INTEL, 0x1029, "8255x" },␊ |
140 | ␉{ PCI_VENDOR_ID_INTEL, 0x1030, "8255x" },␊ |
141 | ␉{ PCI_VENDOR_ID_INTEL, 0x1031, "8255x" },␊ |
142 | ␉{ PCI_VENDOR_ID_INTEL, 0x1032, "8255x" },␊ |
143 | ␉{ PCI_VENDOR_ID_INTEL, 0x1033, "8255x" },␊ |
144 | ␉{ PCI_VENDOR_ID_INTEL, 0x1034, "8255x" },␊ |
145 | ␉{ PCI_VENDOR_ID_INTEL, 0x1038, "8255x" },␊ |
146 | ␉{ PCI_VENDOR_ID_INTEL, 0x1039, "8255x" },␊ |
147 | ␉{ PCI_VENDOR_ID_INTEL, 0x103A, "8255x" },␊ |
148 | ␉{ PCI_VENDOR_ID_INTEL, 0x103B, "8255x" },␊ |
149 | ␉{ PCI_VENDOR_ID_INTEL, 0x103C, "8255x" },␊ |
150 | ␉{ PCI_VENDOR_ID_INTEL, 0x103D, "8255x" },␊ |
151 | ␉{ PCI_VENDOR_ID_INTEL, 0x103E, "8255x" },␊ |
152 | ␉{ PCI_VENDOR_ID_INTEL, 0x1049, "82566MM" },␊ |
153 | ␉{ PCI_VENDOR_ID_INTEL, 0x104A, "82566DM" },␊ |
154 | ␉{ PCI_VENDOR_ID_INTEL, 0x104B, "82574L" },␊ |
155 | ␉{ PCI_VENDOR_ID_INTEL, 0x104C, "82562V" },␊ |
156 | ␉{ PCI_VENDOR_ID_INTEL, 0x104D, "82566MC" },␊ |
157 | ␉{ PCI_VENDOR_ID_INTEL, 0x1050, "82562EZ" },␊ |
158 | ␉{ PCI_VENDOR_ID_INTEL, 0x1051, "82801EB/ER" },␊ |
159 | ␉{ PCI_VENDOR_ID_INTEL, 0x1052, "PRO/100 VE Network Connection" },␊ |
160 | ␉{ PCI_VENDOR_ID_INTEL, 0x1053, "PRO/100 VE Network Connection" },␊ |
161 | ␉{ PCI_VENDOR_ID_INTEL, 0x1054, "PRO/100 VE Network Connection" },␊ |
162 | ␉{ PCI_VENDOR_ID_INTEL, 0x1055, "PRO/100 VE Network Connection" },␊ |
163 | ␉{ PCI_VENDOR_ID_INTEL, 0x1056, "PRO/100 VE Network Connection" },␊ |
164 | ␉{ PCI_VENDOR_ID_INTEL, 0x1057, "PRO/100 VE Network Connection" },␊ |
165 | ␉{ PCI_VENDOR_ID_INTEL, 0x1059, "82551QM" },␊ |
166 | //␉{ PCI_VENDOR_ID_INTEL, 0x105b "82546GB" },␊ |
167 | //␉{ PCI_VENDOR_ID_INTEL, 0x105E, "82546GB" },␊ |
168 | //␉{ PCI_VENDOR_ID_INTEL, 0x105F, "82571EB" },␊ |
169 | ␉{ PCI_VENDOR_ID_INTEL, 0x1060, "82571EB" },␊ |
170 | ␉{ PCI_VENDOR_ID_INTEL, 0x1064, "82562ET/EZ/GT/GZ" },␊ |
171 | ␉{ PCI_VENDOR_ID_INTEL, 0x1065, "82562ET/EZ/GT/GZ" },␊ |
172 | ␉{ PCI_VENDOR_ID_INTEL, 0x1066, "82562 EM/EX/GX" },␊ |
173 | ␉{ PCI_VENDOR_ID_INTEL, 0x1067, "82562 EM/EX/GX" },␊ |
174 | ␉{ PCI_VENDOR_ID_INTEL, 0x1068, "82562ET/EZ/GT/GZ" },␊ |
175 | ␉{ PCI_VENDOR_ID_INTEL, 0x1069, "82562EM/EX/GX" },␊ |
176 | ␉{ PCI_VENDOR_ID_INTEL, 0x106A, "82562G" },␊ |
177 | ␉{ PCI_VENDOR_ID_INTEL, 0x106B, "82562G" },␊ |
178 | ␉{ PCI_VENDOR_ID_INTEL, 0x1075, "82547GI" },␊ |
179 | ␉{ PCI_VENDOR_ID_INTEL, 0x1076, "82541GI" },␊ |
180 | ␉{ PCI_VENDOR_ID_INTEL, 0x1077, "82541GI" },␊ |
181 | ␉{ PCI_VENDOR_ID_INTEL, 0x1078, "82541ER" },␊ |
182 | ␉{ PCI_VENDOR_ID_INTEL, 0x1079, "82546GB" },␊ |
183 | ␉{ PCI_VENDOR_ID_INTEL, 0x107a, "82546GB" },␊ |
184 | ␉{ PCI_VENDOR_ID_INTEL, 0x107b, "82546GB" },␊ |
185 | ␉{ PCI_VENDOR_ID_INTEL, 0x107c, "82541PI" },␊ |
186 | //␉{ PCI_VENDOR_ID_INTEL, 0x107D, "82572EI" },␊ |
187 | //␉{ PCI_VENDOR_ID_INTEL, 0x107E, "82572EI" },␊ |
188 | //␉{ PCI_VENDOR_ID_INTEL, 0x107F, "82572EI Gigabit Ethernet Controller" },␊ |
189 | //␉{ PCI_VENDOR_ID_INTEL, 0x108a, "82546GB Gigabit Ethernet Controller" },␊ |
190 | //␉{ PCI_VENDOR_ID_INTEL, 0x108B, "82573V Gigabit Ethernet Controller (Copper)" },␊ |
191 | //␉{ PCI_VENDOR_ID_INTEL, 0x108C, "82573E Gigabit Ethernet Controller (Copper)" },␊ |
192 | ␉{ PCI_VENDOR_ID_INTEL, 0x1091, "PRO/100 VM Network Connection" },␊ |
193 | ␉{ PCI_VENDOR_ID_INTEL, 0x1092, "PRO/100 VE Network Connection" },␊ |
194 | ␉{ PCI_VENDOR_ID_INTEL, 0x1093, "PRO/100 VM Network Connection" },␊ |
195 | ␉{ PCI_VENDOR_ID_INTEL, 0x1094, "PRO/100 VE Network Connection" },␊ |
196 | ␉{ PCI_VENDOR_ID_INTEL, 0x1095, "PRO/100 VE Network Connection" },␊ |
197 | //␉{ PCI_VENDOR_ID_INTEL, 0x1096, "80003ES2LAN Gigabit Ethernet Controller (Copper)" },␊ |
198 | //␉{ PCI_VENDOR_ID_INTEL, 0x1098, "80003ES2LAN Gigabit Ethernet Controller (Serdes)" },␊ |
199 | //␉{ PCI_VENDOR_ID_INTEL, 0x109A, "82573L Gigabit Ethernet Controller" },␊ |
200 | //␉{ PCI_VENDOR_ID_INTEL, 0x10A4, "82571EB Gigabit Ethernet Controller" },␊ |
201 | //␉{ PCI_VENDOR_ID_INTEL, 0x10A5, "82571EB Gigabit Ethernet Controller (Fiber)" },␊ |
202 | //␉{ PCI_VENDOR_ID_INTEL, 0x10BA, "Intel " },␊ |
203 | //␉{ PCI_VENDOR_ID_INTEL, 0x10BC, "Intel " },␊ |
204 | //␉{ PCI_VENDOR_ID_INTEL, 0x10B9, "Intel " },␊ |
205 | //␉{ PCI_VENDOR_ID_INTEL, 0x10BB, "Intel " },␊ |
206 | //␉{ PCI_VENDOR_ID_INTEL, 0x10BD, "Intel " },␊ |
207 | //␉{ PCI_VENDOR_ID_INTEL, 0x10BF, "Intel " },␊ |
208 | //␉{ PCI_VENDOR_ID_INTEL, 0x10C0, "Intel " },␊ |
209 | //␉{ PCI_VENDOR_ID_INTEL, 0x10C2, "Intel " },␊ |
210 | //␉{ PCI_VENDOR_ID_INTEL, 0x10C3, "Intel " },␊ |
211 | //␉{ PCI_VENDOR_ID_INTEL, 0x10C4, "Intel " },␊ |
212 | //␉{ PCI_VENDOR_ID_INTEL, 0x10C5, "Intel " },␊ |
213 | //␉{ PCI_VENDOR_ID_INTEL, 0x10CB, "Intel " },␊ |
214 | //␉{ PCI_VENDOR_ID_INTEL, 0x10CC, "Intel " },␊ |
215 | //␉{ PCI_VENDOR_ID_INTEL, 0x10CD, "Intel " },␊ |
216 | ␉{ PCI_VENDOR_ID_INTEL, 0x10CE, "82567V-2 Gigabit Network Connection" },␊ |
217 | ␉{ PCI_VENDOR_ID_INTEL, 0x10D3, "82574L Gigabit Network Connection" },␊ |
218 | //␉{ PCI_VENDOR_ID_INTEL, 0x10D5, "Intel " },␊ |
219 | ␉{ PCI_VENDOR_ID_INTEL, 0x10d6, "82575GB Gigabit Network Connection" },␊ |
220 | //␉{ PCI_VENDOR_ID_INTEL, 0x10D9, "Intel " },␊ |
221 | //␉{ PCI_VENDOR_ID_INTEL, 0x10DA, "Intel " },␊ |
222 | //␉{ PCI_VENDOR_ID_INTEL, 0x10DE, "Intel " },␊ |
223 | //␉{ PCI_VENDOR_ID_INTEL, 0x10DF, "Intel " },␊ |
224 | //␉{ PCI_VENDOR_ID_INTEL, 0x10E5, "Intel " },␊ |
225 | //␉{ PCI_VENDOR_ID_INTEL, 0x10EA, "Intel " },␊ |
226 | //␉{ PCI_VENDOR_ID_INTEL, 0x10EB, "Intel " },␊ |
227 | //␉{ PCI_VENDOR_ID_INTEL, 0x10EF, "Intel " },␊ |
228 | //␉{ PCI_VENDOR_ID_INTEL, 0x10F5, "Intel " },␊ |
229 | ␉{ PCI_VENDOR_ID_INTEL, 0x10F6, "82574L" },␊ |
230 | ␉{ PCI_VENDOR_ID_INTEL, 0x10F0, "82578DC Gigabit Network Connection" },␊ |
231 | ␉{ PCI_VENDOR_ID_INTEL, 0x10FE, "82552 10/100 Network Connection" },␊ |
232 | ␉{ PCI_VENDOR_ID_INTEL, 0x1209, "8255xER/82551IT Fast Ethernet Controller" },␊ |
233 | ␉{ PCI_VENDOR_ID_INTEL, 0x1227, "82865 EtherExpress PRO/100A" },␊ |
234 | ␉{ PCI_VENDOR_ID_INTEL, 0x1228, "82556 EtherExpress PRO/100 Smart" },␊ |
235 | ␉{ PCI_VENDOR_ID_INTEL, 0x1229, "82557/8/9/0/1 Ethernet Pro 100" },␊ |
236 | //␉{ PCI_VENDOR_ID_INTEL, 0x1501, "82567V-3 Gigabit Network Connection" },␊ |
237 | ␉{ PCI_VENDOR_ID_INTEL, 0x1502, "82579LM Gigabit Network Connection" },␊ |
238 | ␉{ PCI_VENDOR_ID_INTEL, 0x1503, "82579V Gigabit Network Controller" },␊ |
239 | //␉{ PCI_VENDOR_ID_INTEL, 0x150C, "82583V Gigabit Network Connection" },␊ |
240 | //␉{ PCI_VENDOR_ID_INTEL, 0x1525, "82567V-4 Gigabit Network Connection" },␊ |
241 | ␉{ PCI_VENDOR_ID_INTEL, 0x153A, "Ethernet Connection I217-LM" },␊ |
242 | ␉{ PCI_VENDOR_ID_INTEL, 0x153B, "Ethernet Connection I217-V" },␊ |
243 | ␉{ PCI_VENDOR_ID_INTEL, 0x1559, "Ethernet Connection I218-V" },␊ |
244 | ␉{ PCI_VENDOR_ID_INTEL, 0x155A, "Ethernet Connection I218-LM" },␊ |
245 | ␉{ PCI_VENDOR_ID_INTEL, 0x15A0, "Ethernet Connection (2) I218-LM" },␊ |
246 | ␉{ PCI_VENDOR_ID_INTEL, 0x15A1, "Ethernet Connection (2) I218-V" },␊ |
247 | ␉{ PCI_VENDOR_ID_INTEL, 0x15A2, "Ethernet Connection (3) I218-LM" },␊ |
248 | ␉{ PCI_VENDOR_ID_INTEL, 0x15A3, "Ethernet Connection (3) I218-V" },␊ |
249 | ␉{ PCI_VENDOR_ID_INTEL, 0x2449, "82801BA/BAM/CA/CAM Ethernet Controller" },␊ |
250 | ␉{ PCI_VENDOR_ID_INTEL, 0x2459, "82801E Ethernet Controller" },␊ |
251 | ␉{ PCI_VENDOR_ID_INTEL, 0x245D, "82801E Ethernet Controller" },␊ |
252 | ␉{ PCI_VENDOR_ID_INTEL, 0x27DC, "NM10/ICH7 Family LAN Controller" },␊ |
253 | //␉{ PCI_VENDOR_ID_INTEL, 0x294C, "82566DC-2 Gigabit Network Connection" },␊ |
254 | ␊ |
255 | //␉Atheros (Qualcomm)␊ |
256 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1026, "AR8121/AR8113/AR8114 Ethernet" },␊ |
257 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1062, "AR8132 Fast Ethernet" },␊ |
258 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1063, "AR8131 Gigabit Ethernet" },␊ |
259 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1066, "AR8121/AR8113/AR8114 Ethernet" },␊ |
260 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1067, "L1c Gigabit Ethernet" },␊ |
261 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1073, "AR8151 v1.0 Gigabit 1000" },␊ |
262 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1083, "GbE LAN chip (10/100/1000 Mbit)" },␊ |
263 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1090, "AR8162 Fast Ethernet" },␊ |
264 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x1091, "AR8161 Gigabit Ethernet" },␊ |
265 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x10a0, "QCA8172 Fast Ethernet" },␊ |
266 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x10a1, "QCA8171 Gigabit Ethernet" },␊ |
267 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x2048, "L2 Fast Ethernet" },␊ |
268 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x2060, "AR8152 v1.1 Fast 10/100" },␊ |
269 | ␉{ PCI_VENDOR_ID_QUALCOMM, 0x2062, "AR8152 v2.0 Fast 10/100" }␊ |
270 | };␊ |
271 | #define ETH_DEVICES_LEN (sizeof(known_ethernet_cards) / sizeof(known_ethernet_cards[0]))␊ |
272 | ␊ |
273 | static network_device known_wifi_cards[] =␊ |
274 | {␊ |
275 | ␉// Broadcom␊ |
276 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4312, "BCM4311 802.11a/b/g"},␊ |
277 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4313, "BCM4311 802.11a" },␊ |
278 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4315, "BCM4312 802.11b/g Wireless LAN Controller"},␊ |
279 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4318, "BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller"},␊ |
280 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4319, "BCM4318 [AirForce 54g] 802.11a/b/g PCI Express Transceiver"},␊ |
281 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4320, "BCM4306 802.11b/g Wireless LAN Controller"},␊ |
282 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4321, "BCM4321 802.11a Wireless Network Controller"},␊ |
283 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4322, "BCM4322 802.11bgn Wireless Network Controller"},␊ |
284 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4324, "BCM4309 802.11abg Wireless Network Controller"},␊ |
285 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4325, "BCM4306 802.11bg Wireless Network Controller"},␊ |
286 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4328, "BCM4321 802.11a/b/g/n"},␊ |
287 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4329, "BCM4321 802.11b/g/n"},␊ |
288 | //␉{PCI_VENDOR_ID_BROADCOM, 0x432a, "BCM4321 802.11an Wireless Network Controller"},␊ |
289 | ␉{PCI_VENDOR_ID_BROADCOM, 0x432b, "BCM4322 802.11a/b/g/n Wireless LAN Controller"},␊ |
290 | ␉{PCI_VENDOR_ID_BROADCOM, 0x432c, "BCM4322 802.11b/g/n"},␊ |
291 | ␉{PCI_VENDOR_ID_BROADCOM, 0x432d, "BCM4322 802.11an Wireless Network Controller"},␊ |
292 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4331, "BCM4331 802.11a/b/g/n"},␊ |
293 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4350, "BCM43222 Wireless Network Adapter"},␊ |
294 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4351, "BCM43222 802.11abgn Wireless Network Adapter"},␊ |
295 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4353, "BCM43224 802.11a/b/g/n"},␊ |
296 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4357, "BCM43225 802.11b/g/n"},␊ |
297 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4358, "BCM43227 802.11b/g/n"},␊ |
298 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4359, "BCM43228 802.11a/b/g/n"},␊ |
299 | //␉{PCI_VENDOR_ID_BROADCOM, 0x4360, "BCM4360 802.11ac Wireless Network Adapter"},␊ |
300 | ␉{PCI_VENDOR_ID_BROADCOM, 0x4365, "BCM43142 802.11b/g/n"},␊ |
301 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43a0, "BCM4360 802.11ac Wireless Network Adapter"},␊ |
302 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43a1, "BCM4360 802.11ac Wireless Network Adapter"},␊ |
303 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43a2, "BCM4360 802.11ac Wireless Network Adapter"},␊ |
304 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43a9, "BCM43217 802.11b/g/n"},␊ |
305 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43aa, "BCM43131 802.11b/g/n"},␊ |
306 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43b1, "BCM4352 802.11ac Wireless Network Adapter"},␊ |
307 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43ba, "BCM43602 802.11ac Wireless LAN SoC"},␊ |
308 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43bb, "BCM43602 802.11ac Wireless LAN SoC"},␊ |
309 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43bc, "BCM43602 802.11ac Wireless LAN SoC"},␊ |
310 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43d3, "BCM43567 802.11ac Wireless Network Adapter"},␊ |
311 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43d9, "BCM43570 802.11ac Wireless Network Adapter"},␊ |
312 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43df, "BCM4354 802.11ac Wireless LAN SoC"},␊ |
313 | //␉{PCI_VENDOR_ID_BROADCOM, 0x43ec, "BCM4356 802.11ac Wireless Network Adapter"},␊ |
314 | //␉{PCI_VENDOR_ID_BROADCOM, 0xa8d8, "BCM43224/5 Wireless Network Adapter"},␊ |
315 | ␊ |
316 | ␉// Atheros␊ |
317 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0020, "AR5513 802.11abg Wireless NIC"},␊ |
318 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0023, "AR5416 Wireless Network Adapter"},␊ |
319 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0024, "AR5418 Wireless Network Adapter"},␊ |
320 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0027, "AR9160 Wireless Network Adapter"},␊ |
321 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0029, "AR922X Wireless Network Adapter"},␊ |
322 | ␉{PCI_VENDOR_ID_ATHEROS, 0x002A, "AR928X Wireless Network Adapter"}, // "pci168c,2a"␊ |
323 | ␉{PCI_VENDOR_ID_ATHEROS, 0x002B, "AR9285 Wireless Network Adapter"},␊ |
324 | ␉{PCI_VENDOR_ID_ATHEROS, 0x002C, "AR2427 Wireless Network Adapter"},␊ |
325 | ␉{PCI_VENDOR_ID_ATHEROS, 0x002D, "AR9227 Wireless Network Adapter"},␊ |
326 | ␉{PCI_VENDOR_ID_ATHEROS, 0x002E, "AR9287 Wireless Network Adapter"},␊ |
327 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0030, "AR93xx Wireless Network Adapter"},␊ |
328 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0032, "AR9485 Wireless Network Adapter"},␊ |
329 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0033, "AR9580 Wireless Network Adapter"},␊ |
330 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0034, "AR9462 Wireless Network Adapter"},␊ |
331 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0036, "AR9565 Wireless Network Adapter"},␊ |
332 | ␉{PCI_VENDOR_ID_ATHEROS, 0x0037, "AR9485 Wireless Network Adapter"}␊ |
333 | };␊ |
334 | #define WLAN_DEVICES_LEN (sizeof(known_wifi_cards) / sizeof(known_wifi_cards[0]))␊ |
335 | ␊ |
336 | char *get_ethernet_model(uint32_t vendor_id, uint32_t device_id)␊ |
337 | {␊ |
338 | ␉static char desc[128];␊ |
339 | ␊ |
340 | ␉const char *name_format = NULL;␊ |
341 | ␉int i;␊ |
342 | ␊ |
343 | ␉/* Get format for vendor ID */␊ |
344 | ␉switch ( vendor_id )␊ |
345 | ␉{␊ |
346 | ␉␉case PCI_VENDOR_ID_REALTEK:␊ |
347 | ␉␉␉name_format = "Realteck %s"; break;␊ |
348 | ␊ |
349 | ␉␉case PCI_VENDOR_ID_MARVELL:␊ |
350 | ␉␉␉name_format = "Marvell %s"; break;␊ |
351 | ␊ |
352 | ␉␉case PCI_VENDOR_ID_JMICRON:␊ |
353 | ␉␉␉name_format = "JMicron %s"; break;␊ |
354 | ␊ |
355 | ␉␉case PCI_VENDOR_ID_ATHEROS:␊ |
356 | ␉␉case PCI_VENDOR_ID_QUALCOMM:␊ |
357 | ␉␉␉name_format = "Atheros %s"; break;␊ |
358 | ␊ |
359 | ␉␉case PCI_VENDOR_ID_BROADCOM:␊ |
360 | ␉␉␉name_format = "Broadcom %s"; break;␊ |
361 | ␊ |
362 | ␉␉case PCI_VENDOR_ID_INTEL:␊ |
363 | ␉␉␉name_format = "Intel %s"; break;␊ |
364 | ␊ |
365 | ␉␉default:␊ |
366 | ␉␉␉break;␊ |
367 | ␉}␊ |
368 | ␊ |
369 | ␉for( i = 0 ; i < ETH_DEVICES_LEN; i++ )␊ |
370 | ␉{␊ |
371 | ␉␉if ( ( vendor_id == known_ethernet_cards[i].vendor_id ) && ( device_id == known_ethernet_cards[i].device_id ) )␊ |
372 | ␉␉{␊ |
373 | ␉␉␉snprintf( desc, sizeof(desc), name_format, known_ethernet_cards[i].model );␊ |
374 | ␉␉␉return desc;␊ |
375 | ␉␉}␊ |
376 | ␉}␊ |
377 | ␉// NOT in know table... assign generic␊ |
378 | ␉/* Not in table */␊ |
379 | ␉snprintf( desc, sizeof(desc), name_format, "Ethernet Controller" );␊ |
380 | ␉return desc;␊ |
381 | }␊ |
382 | ␊ |
383 | char *get_wlan_model(uint32_t vendor_id, uint32_t device_id)␊ |
384 | {␊ |
385 | ␊ |
386 | ␉static char desc[128];␊ |
387 | ␊ |
388 | ␉const char *name_format = NULL;␊ |
389 | ␉int i;␊ |
390 | ␊ |
391 | ␉/* Get format for vendor ID */␊ |
392 | ␉switch ( vendor_id )␊ |
393 | ␉{␊ |
394 | ␉␉case PCI_VENDOR_ID_REALTEK:␊ |
395 | ␉␉␉name_format = "Realteck %s"; break;␊ |
396 | ␊ |
397 | ␉␉case PCI_VENDOR_ID_ATHEROS:␊ |
398 | ␉␉case PCI_VENDOR_ID_QUALCOMM:␊ |
399 | ␉␉␉name_format = "Atheros %s"; break;␊ |
400 | ␊ |
401 | ␉␉case PCI_VENDOR_ID_BROADCOM:␊ |
402 | ␉␉␉name_format = "Broadcom %s"; break;␊ |
403 | ␊ |
404 | ␉␉default:␊ |
405 | ␉␉␉break;␊ |
406 | ␉}␊ |
407 | ␊ |
408 | ␉for( i = 0 ; i < WLAN_DEVICES_LEN; i++ )␊ |
409 | ␉{␊ |
410 | ␉␉if ( ( vendor_id == known_wifi_cards[i].vendor_id ) && ( device_id == known_wifi_cards[i].device_id ) )␊ |
411 | ␉␉{␊ |
412 | ␉␉␉snprintf( desc, sizeof(desc), name_format, known_wifi_cards[i].model );␊ |
413 | ␉␉␉return desc;␊ |
414 | ␉␉}␊ |
415 | ␉}␊ |
416 | ␉// NOT in know table... assign generic␊ |
417 | ␉/* Not in table */␊ |
418 | ␉snprintf( desc, sizeof(desc), name_format, "Wireless Controller" );␊ |
419 | ␉return desc;␊ |
420 | }␊ |
421 | ␊ |
422 | void setup_eth_devdrop(pci_dt_t *eth_dev)␊ |
423 | {␊ |
424 | ␉char *devicepath = get_pci_dev_path(eth_dev);␊ |
425 | ␉char *name_model = NULL;␊ |
426 | ␉builtin = 0;␊ |
427 | ␊ |
428 | ␉bool do_eth_devprop = getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->chameleonConfig);␊ |
429 | ␊ |
430 | ␉DevPropDevice *device = (DevPropDevice *)malloc(sizeof(DevPropDevice));␊ |
431 | ␊ |
432 | ␉verbose("\tClass code: [%04X]\n", eth_dev->class_id);␊ |
433 | ␉verbose("\tEthernetBuiltIn = %s\n", do_eth_devprop ? "Yes" : "No");␊ |
434 | ␊ |
435 | ␉if (!string)␊ |
436 | ␉{␊ |
437 | ␉␉string = devprop_create_string();␊ |
438 | ␉␉if (!string)␊ |
439 | ␉␉{␊ |
440 | ␉␉␉return;␊ |
441 | ␉␉}␊ |
442 | ␉}␊ |
443 | ␊ |
444 | ␉device = devprop_add_device(string, devicepath);␊ |
445 | ␉if(device)␊ |
446 | ␉{␊ |
447 | ␉␉name_model = get_ethernet_model(eth_dev->vendor_id, eth_dev->device_id);␊ |
448 | ␊ |
449 | ␉␉if ( do_eth_devprop )␊ |
450 | ␉␉{␊ |
451 | ␉␉␉verbose("\tLocation number: %d\n", location_number);␊ |
452 | ␉␉␉verbose("\tSetting up lan keys\n");␊ |
453 | ␉␉␉if( ( eth_dev->vendor_id != PCI_VENDOR_ID_ATHEROS ) && ( builtin_set == 0 ))␊ |
454 | ␉␉␉{␊ |
455 | ␉␉␉␉builtin_set = 1;␊ |
456 | ␉␉␉␉builtin = 0x01;␊ |
457 | ␉␉␉}␊ |
458 | ␊ |
459 | ␉␉␉devprop_add_value(device, "location", (uint8_t *)&location_number, 1);␊ |
460 | ␊ |
461 | //␉␉␉devprop_add_value(device, "AAPL,slot-name", "Slot-x"␊ |
462 | //␉␉␉devprop_add_value(device, "device-id",␊ |
463 | //␉␉␉devprop_add_value(device, "revision-id",␊ |
464 | //␉␉␉devprop_add_value(device, "subsystem-id",␊ |
465 | //␉␉␉devprop_add_value(device, "subsystem-vendor-id",␊ |
466 | ␊ |
467 | ␉␉␉devprop_add_value(device, "built-in", (uint8_t *)&builtin, 1);␊ |
468 | ␉␉␉devprop_add_value(device, "model", (uint8_t *)name_model, (strlen(name_model) + 1));␊ |
469 | ␉␉␉devprop_add_value(device, "device_type", (uint8_t *)"ethernet", sizeof("Ethernet"));␊ |
470 | ␊ |
471 | ␉␉␉stringdata = (uint8_t *)malloc(sizeof(uint8_t) * string->length);␊ |
472 | ␉␉␉if(stringdata)␊ |
473 | ␉␉␉{␊ |
474 | ␉␉␉␉memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);␊ |
475 | ␉␉␉␉stringlength = string->length;␊ |
476 | ␉␉␉}␊ |
477 | ␊ |
478 | ␉␉}␊ |
479 | ␉}␊ |
480 | ␊ |
481 | ␉verbose("\t%s [%04x:%04x]\n\t%s\n",name_model, eth_dev->vendor_id, eth_dev->device_id, devicepath);␊ |
482 | ␊ |
483 | ␉// location number␊ |
484 | ␉location_number++;␊ |
485 | }␊ |
486 | ␊ |
487 | void setup_wifi_devdrop(pci_dt_t *wlan_dev) // ARPT␊ |
488 | {␊ |
489 | ␉char *devicepath = get_pci_dev_path(wlan_dev);␊ |
490 | ␉char *name_model = NULL;␊ |
491 | ␊ |
492 | ␉builtin = 0;␊ |
493 | ␊ |
494 | ␉bool do_wifi_devprop = getBoolForKey(kEnableWifi, &do_wifi_devprop, &bootInfo->chameleonConfig);␊ |
495 | ␊ |
496 | ␉DevPropDevice *device = (DevPropDevice *)malloc(sizeof(DevPropDevice));␊ |
497 | ␊ |
498 | ␉verbose("\tClass code: [%04X]\n", wlan_dev->class_id);␊ |
499 | ␉verbose("\tEnableWifi = %s\n", do_wifi_devprop ? "Yes" : "No");␊ |
500 | ␊ |
501 | ␉if (!string)␊ |
502 | ␉{␊ |
503 | ␉␉string = devprop_create_string();␊ |
504 | ␉␉if (!string)␊ |
505 | ␉␉{␊ |
506 | ␉␉␉return;␊ |
507 | ␉␉}␊ |
508 | ␉}␊ |
509 | ␊ |
510 | ␉device = devprop_add_device(string, devicepath);␊ |
511 | ␉if(device)␊ |
512 | ␉{␊ |
513 | ␉␉name_model = get_wlan_model(wlan_dev->vendor_id, wlan_dev->device_id);␊ |
514 | ␊ |
515 | ␉␉if ( do_wifi_devprop )␊ |
516 | ␉␉{␊ |
517 | ␉␉␉verbose("\tSetting up wifi keys\n");␊ |
518 | ␉␉␉devprop_add_value(device, "built-in", (uint8_t *)&builtin, 1);␊ |
519 | ␉␉␉devprop_add_value(device, "model", (uint8_t *)name_model, (strlen(name_model) + 1));␊ |
520 | //␉␉␉devprop_add_value(device, "name", (uint8_t *)"AirPort Extreme", sizeof("AirPort Extreme"));␊ |
521 | ␊ |
522 | //␉␉␉devprop_add_value(device, "vendor-id",␊ |
523 | //␉␉␉devprop_add_value(device, "device-id",␊ |
524 | //␉␉␉devprop_add_value(device, "subsystem-id",␊ |
525 | //␉␉␉devprop_add_value(device, "subsystem-vendor-id",␊ |
526 | ␉␉␉// NOTE: I would set the subsystem id and subsystem vendor id here,␊ |
527 | ␉␉␉// however, those values seem to be ovverriden in the boot process.␊ |
528 | ␉␉␉// A better method would be injecting the DTGP dsdt method␊ |
529 | ␉␉␉// and then injecting the subsystem id there.␊ |
530 | ␊ |
531 | ␉␉␉devprop_add_value(device, "device_type", (uint8_t *)"Airport", sizeof("Airport"));␊ |
532 | ␉␉␉devprop_add_value(device, "AAPL,slot-name", (uint8_t *)"Airport", sizeof("Airport"));␊ |
533 | ␊ |
534 | ␉␉␉stringdata = (uint8_t *)malloc(sizeof(uint8_t) *string->length);␊ |
535 | ␉␉␉if(stringdata)␊ |
536 | ␉␉␉{␊ |
537 | ␉␉␉␉memcpy(stringdata, (uint8_t *)devprop_generate_string(string), string->length);␊ |
538 | ␉␉␉␉stringlength = string->length;␊ |
539 | ␉␉␉}␊ |
540 | ␉␉}␊ |
541 | ␉}␊ |
542 | ␊ |
543 | ␉verbose("\t%s [%04x:%04x]\n\t%s\n", name_model, wlan_dev->vendor_id, wlan_dev->device_id, devicepath);␊ |
544 | }␊ |
545 |