]>
Commit | Line | Data |
---|---|---|
2d21ac55 A |
1 | /* |
2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * The contents of this file constitute Original Code as defined in and | |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
11 | * | |
12 | * This Original Code and all software distributed under the License are | |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the | |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
19 | * | |
20 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* | |
23 | * File: err_iokit.sub | |
24 | * Author: Godfrey van der Linden, Apple Computer, Inc | |
25 | * Date: Sept, 2005 | |
26 | * | |
27 | * error codes for Mach and Unix kernels | |
28 | */ | |
29 | ||
30 | #include <Kernel/IOKit/IOReturn.h> | |
31 | #include <IOKit/usb/USB.h> | |
32 | #include <IOKit/firewire/IOFireWireLib.h> | |
33 | ||
34 | static struct error_sparse_map err_codes_iokit_common_map[] = { | |
35 | err_code_map_entry(kIOReturnInvalid, kIOReturnInvalid ), | |
36 | err_code_map_entry(kIOReturnError, kIOReturnNotFound), | |
37 | }; | |
38 | ||
39 | static const char * err_codes_iokit_common[] = { | |
40 | "(iokit/common) invalid - should never be seen", // 0x001 | |
41 | ||
42 | "(iokit/common) general error", // 0x2bc | |
43 | "(iokit/common) can't allocate memory", // 0x2bd | |
44 | "(iokit/common) resource shortage", // 0x2be | |
45 | "(iokit/common) error during IPC", // 0x2bf | |
46 | "(iokit/common) no such device", // 0x2c0 | |
47 | "(iokit/common) privilege violation", // 0x2c1 | |
48 | "(iokit/common) invalid argument", // 0x2c2 | |
49 | "(iokit/common) device read locked", // 0x2c3 | |
50 | "(iokit/common) device write locked", // 0x2c4 | |
51 | "(iokit/common) exclusive access and device already open", // 0x2c5 | |
52 | "(iokit/common) sent/received messages had different msg_id", // 0x2c6 | |
53 | "(iokit/common) unsupported function", // 0x2c7 | |
54 | "(iokit/common) misc. VM failure", // 0x2c8 | |
55 | "(iokit/common) internal error", // 0x2c9 | |
56 | "(iokit/common) General I/O error", // 0x2ca | |
57 | "(iokit/common) ???", // 0x2cb | |
58 | "(iokit/common) can't acquire lock", // 0x2cc | |
59 | "(iokit/common) device not open", // 0x2cd | |
60 | "(iokit/common) read not supported", // 0x2ce | |
61 | "(iokit/common) write not supported", // 0x2cf | |
62 | "(iokit/common) alignment error", // 0x2d0 | |
63 | "(iokit/common) Media Error", // 0x2d1 | |
64 | "(iokit/common) device(s) still open", // 0x2d2 | |
65 | "(iokit/common) rld failure", // 0x2d3 | |
66 | "(iokit/common) DMA failure", // 0x2d4 | |
67 | "(iokit/common) Device Busy", // 0x2d5 | |
68 | "(iokit/common) I/O Timeout", // 0x2d6 | |
69 | "(iokit/common) device offline", // 0x2d7 | |
70 | "(iokit/common) not ready", // 0x2d8 | |
71 | "(iokit/common) device not attached", // 0x2d9 | |
72 | "(iokit/common) no DMA channels left", // 0x2da | |
73 | "(iokit/common) no space for data", // 0x2db | |
74 | "(iokit/common) ???", // 0x2dc | |
75 | "(iokit/common) port already exists", // 0x2dd | |
76 | "(iokit/common) can't wire down physical memory", // 0x2de | |
77 | "(iokit/common) no interrupt attached", // 0x2df | |
78 | "(iokit/common) no DMA frames enqueued", // 0x2e0 | |
79 | "(iokit/common) oversized msg received on interrupt port", // 0x2e1 | |
80 | "(iokit/common) not permitted", // 0x2e2 | |
81 | "(iokit/common) no power to device", // 0x2e3 | |
82 | "(iokit/common) media not present", // 0x2e4 | |
83 | "(iokit/common) media not formatted", // 0x2e5 | |
84 | "(iokit/common) no such mode", // 0x2e6 | |
85 | "(iokit/common) data underrun", // 0x2e7 | |
86 | "(iokit/common) data overrun", // 0x2e8 | |
87 | "(iokit/common) the device is not working properly!", // 0x2e9 | |
88 | "(iokit/common) a completion routine is required", // 0x2ea | |
89 | "(iokit/common) operation aborted", // 0x2eb | |
90 | "(iokit/common) bus bandwidth would be exceeded", // 0x2ec | |
91 | "(iokit/common) device not responding", // 0x2ed | |
92 | "(iokit/common) isochronous I/O request for distant past!", // 0x2ee | |
93 | "(iokit/common) isochronous I/O request for distant future", // 0x2ef | |
94 | "(iokit/common) data was not found", // 0x2f0 | |
95 | }; | |
96 | ||
97 | static struct error_sparse_map err_codes_iokit_usb_map[] = { | |
98 | err_code_map_entry(kIOUSBCRCErr, kIOUSBDataToggleErr), | |
99 | err_code_map_entry(kIOUSBPIDCheckErr, kIOUSBWrongPIDErr), | |
100 | err_code_map_entry(kIOUSBReserved1Err, kIOUSBLinkErr), | |
101 | err_code_map_entry(kIOUSBDeviceNotHighSpeed, kIOUSBTransactionTimeout), | |
102 | err_code_map_entry(kIOUSBConfigNotFound, kIOUSBEndpointNotFound), | |
103 | err_code_map_entry(kIOUSBNotEnoughPowerErr, kIOUSBUnknownPipeErr), | |
104 | }; | |
105 | ||
106 | // error codes with in 0xe0004000 | |
107 | static const char * err_codes_iokit_usb[] = { | |
108 | "(iokit/usb) USB Controller Error: bad CRC received", // 0x001 | |
109 | "(iokit/usb) USB Controller Error: bitstuffing", // 0x002 | |
110 | "(iokit/usb) USB Controller Error: Bad data toggle", // 0x003 | |
111 | ||
112 | "(iokit/usb) USB Controller Error: PID CRC error", // 0x006 | |
113 | "(iokit/usb) USB Controller Error: Bad or wrong PID", // 0x007 | |
114 | ||
115 | "(iokit/usb) Reserved", // 0x00a | |
116 | "(iokit/usb) Reserved", // 0x00b | |
117 | "(iokit/usb) USB Controller: Buffer Overrun", // 0x00c | |
118 | "(iokit/usb) USB Controller: Buffer Underrun ", // 0x00d | |
119 | "(iokit/usb) Transaction was not sent on the bus", // 0x00e | |
120 | "(iokit/usb) Transaction was not sent on the bus", // 0x00f | |
121 | "(iokit/usb) USB Controller: Link Error", // 0x010 | |
122 | ||
123 | "(iokit/usb) device is not high speed, ehci driver returns error", // 0x049 | |
124 | "(iokit/usb) synchronous usb request on the workloop thread", // 0x04a | |
125 | "(iokit/usb) high speed hub error during split transaction", // 0x04b | |
126 | "(iokit/usb) user land isoch call with unprepared frame-list", // 0x04c | |
127 | "(iokit/usb) user land isoch call with unprepared data buffer", // 0x04d | |
128 | "(iokit/usb) interface ref not recognized", // 0x050 | |
129 | "(iokit/usb) pipe has stalled, error needs to be cleared", // 0x04f | |
130 | "(iokit/usb) transaction has been returned to the caller", // 0x050 | |
131 | "(iokit/usb) transaction timed out", // 0x051 | |
132 | ||
133 | "(iokit/usb) configuration not found", // 0x056 | |
134 | "(iokit/usb) endpoint not found", // 0x057 | |
135 | ||
136 | "(iokit/usb) not enough power for selected configuration", // 0x05d | |
137 | "(iokit/usb) not enough pipes in interface", // 0x05e | |
138 | "(iokit/usb) no async port", // 0x05f | |
139 | "(iokit/usb) too many pipes", // 0x060 | |
140 | "(iokit/usb) pipe ref not recognized", // 0x061 | |
141 | }; | |
142 | ||
143 | static struct error_sparse_map err_codes_iokit_fw_map[] = { | |
144 | err_code_map_entry(kIOConfigNoEntry, kIOFireWireBusReset), | |
145 | err_code_map_entry(kIOFireWireBogusDCLProgram, kIOFireWireCompleting), | |
146 | err_code_map_entry(kIOFWMessageServiceIsRequestingClose, kIOFWMessageTopologyChanged), | |
147 | }; | |
148 | ||
149 | // error codes with in 0xe0008000 | |
150 | static const char * err_codes_iokit_fw[] = { | |
151 | "(iokit/firewire) can't find requested entry in config ROM", // 001 | |
152 | "(iokit/firewire) command pending (internal)", // 002 | |
153 | "(iokit/firewire) DCL callback is final callback (internal)", // 003 | |
154 | "(iokit/firewire) device rom changed, ref is no longer valid", // 004 | |
155 | "(iokit/firewire) kIOFireWireAlreadyRegistered", // 005 | |
156 | "(iokit/firewire) kIOFireWireMultipleTalkers", // 006 | |
157 | "(iokit/firewire) kIOFireWireChannelActive", // 007 | |
158 | "(iokit/firewire) kIOFireWireNoListenerOrTalker", // 008 | |
159 | "(iokit/firewire) kIOFireWireNoChannels", // 009 | |
160 | "(iokit/firewire) requested isoch channel is in use", // 00A | |
161 | "(iokit/firewire) kIOFireWireSeparateBus", // 00B | |
162 | "(iokit/firewire) kIOFireWireBadSelfIDs", // 00C | |
163 | "(iokit/firewire) kIOFireWireLowCableVoltage", // 00D | |
164 | "(iokit/firewire) kIOFireWireInsufficientPower", // 00E | |
165 | "(iokit/firewire) all transaction labels are in use", // 00f | |
166 | "(iokit/firewire) rcode 0, resp_complete", // 010 | |
167 | "(iokit/firewire) rcode 1, reserved", // 011 | |
168 | "(iokit/firewire) rcode 2, reserved", // 012 | |
169 | "(iokit/firewire) rcode 3, reserved", // 013 | |
170 | "(iokit/firewire) rcode 4, resp_conflict_error", // 014 | |
171 | "(iokit/firewire) rcode 5, resp_data_error", // 015 | |
172 | "(iokit/firewire) rcode 6, resp_type_error", // 016 | |
173 | "(iokit/firewire) rcode 7, resp_address_error", // 017 | |
174 | "(iokit/firewire) rcode 8, reserved", // 018 | |
175 | "(iokit/firewire) rcode 9, reserved", // 019 | |
176 | "(iokit/firewire) rcode 10, reserved", // 01a | |
177 | "(iokit/firewire) rcode 11, reserved", // 01b | |
178 | "(iokit/firewire) rcode 12, reserved", // 01c | |
179 | "(iokit/firewire) rcode 13, reserved", // 01d | |
180 | "(iokit/firewire) rcode 14, reserved", // 01e | |
181 | "(iokit/firewire) rcode 15, reserved", // 01f | |
182 | "(iokit/firewire) bus reset occurred, generation does not match", // 020 | |
183 | ||
184 | "(iokit/firewire) DCL program contains an illegal DCL", // 101 | |
185 | "(iokit/firewire) kIOFireWireTalkingAndListening", // 102 | |
186 | "(iokit/firewire) system sleep, DCL program stopped", // 103 | |
187 | "(iokit/firewire) command is actively completing (internal)", // 104 | |
188 | ||
189 | "(iokit/firewire) device offline, please close device object", // 7d0 | |
190 | "(iokit/firewire) more power may be available", // 7d1 | |
191 | "(iokit/firewire) IOFireWire plane in registry updated", // 7d2 | |
192 | }; | |
193 | ||
194 | // error codes with in 0xe0020000 | |
195 | static const char * err_codes_iokit_bluetooth[] = { | |
196 | "(iokit/bluetooth) unknown error", // 000 | |
197 | "(iokit/bluetooth) interrupted operation, hardware reset", // 001 | |
198 | "(iokit/bluetooth) connection to device already exists", // 002 | |
199 | "(iokit/bluetooth) no HCI controller", // 003 | |
200 | "(iokit/bluetooth) changing power states is unsupported", // 004 | |
201 | }; | |
202 | ||
203 | static const struct error_sparse_map err_iokit_sub_map[] = { | |
204 | err_sub_map_entry(sub_iokit_common, sub_iokit_pmu), | |
205 | err_sub_map_entry(sub_iokit_vendor_specific, sub_iokit_reserved) | |
206 | }; | |
207 | ||
208 | #define err_iokit_null_sub { "(iokit/?", 0 } | |
209 | static struct error_subsystem err_iokit_sub[] = | |
210 | { | |
211 | /* 0 */ { | |
212 | "(iokit/common)", // 0xe0000000 | |
213 | errlib_count(err_codes_iokit_common), | |
214 | err_codes_iokit_common, | |
215 | err_codes_iokit_common_map, | |
216 | errlib_count(err_codes_iokit_common_map), | |
217 | }, | |
218 | /* 1 */ { | |
219 | "(iokit/usb)", // 0xe0004000 | |
220 | errlib_count(err_codes_iokit_usb), | |
221 | err_codes_iokit_usb, | |
222 | err_codes_iokit_usb_map, | |
223 | errlib_count(err_codes_iokit_usb_map), | |
224 | }, | |
225 | /* 2 */ { | |
226 | "(iokit/firewire)", // 0xe0008000 | |
227 | errlib_count(err_codes_iokit_fw), | |
228 | err_codes_iokit_fw, | |
229 | err_codes_iokit_fw_map, | |
230 | errlib_count(err_codes_iokit_fw_map), | |
231 | }, | |
232 | /* 3 */ err_iokit_null_sub, // 0xe000c000 | |
233 | /* 4 */ { "(iokit/blkstorage)", 0 }, // 0xe0010000 | |
234 | /* 5 */ { "(iokit/graphics)", 0 }, // 0xe0014000 | |
235 | /* 6 */ err_iokit_null_sub, // 0xe0018000 | |
236 | /* 7 */ err_iokit_null_sub, // 0xe001c000 | |
237 | /* 8 */ { | |
238 | "(iokit/bluetooth)", // 0xe0020000 | |
239 | errlib_count(err_codes_iokit_bluetooth), | |
240 | err_codes_iokit_bluetooth, | |
241 | NULL, 0, | |
242 | }, | |
243 | /* 9 */ { "(iokit/pmu)", 0 }, // 0xe0024000 | |
244 | /* -2 */ { "(iokit/vendor)", 0 }, // 0xe0028000 | |
245 | /* -1 */ { "(iokit/reserved)", 0 }, // 0xe002c000 | |
246 | }; | |
247 | ||
248 | ||
249 | /* vim: set ft=c ts=8 sw=4: */ |