Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * |
| 3 | * Module Name: rsmisc - Miscellaneous resource descriptors |
| 4 | * |
| 5 | ******************************************************************************/ |
| 6 | |
| 7 | /* |
| 8 | * Copyright (C) 2000 - 2005, R. Byron Moore |
| 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> |
| 45 | #include <acpi/acresrc.h> |
| 46 | |
| 47 | #define _COMPONENT ACPI_RESOURCES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 48 | ACPI_MODULE_NAME("rsmisc") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
| 50 | /******************************************************************************* |
| 51 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 52 | * FUNCTION: acpi_rs_generic_register_resource |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | * |
| 54 | * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte |
| 55 | * stream |
| 56 | * bytes_consumed - Pointer to where the number of bytes |
| 57 | * consumed the byte_stream_buffer is |
| 58 | * returned |
| 59 | * output_buffer - Pointer to the return data buffer |
| 60 | * structure_size - Pointer to where the number of bytes |
| 61 | * in the return data struct is returned |
| 62 | * |
| 63 | * RETURN: Status |
| 64 | * |
| 65 | * DESCRIPTION: Take the resource byte stream and fill out the appropriate |
| 66 | * structure pointed to by the output_buffer. Return the |
| 67 | * number of bytes consumed from the byte stream. |
| 68 | * |
| 69 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | acpi_status |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 71 | acpi_rs_generic_register_resource(u8 * byte_stream_buffer, |
| 72 | acpi_size * bytes_consumed, |
| 73 | u8 ** output_buffer, |
| 74 | acpi_size * structure_size) |
| 75 | { |
| 76 | u8 *buffer = byte_stream_buffer; |
| 77 | struct acpi_resource *output_struct = (void *)*output_buffer; |
| 78 | u16 temp16; |
| 79 | u8 temp8; |
| 80 | acpi_size struct_size = |
| 81 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_generic_reg); |
| 82 | |
| 83 | ACPI_FUNCTION_TRACE("rs_generic_register_resource"); |
| 84 | |
| 85 | /* Byte 0 is the Descriptor Type */ |
| 86 | |
| 87 | buffer += 1; |
| 88 | |
| 89 | /* Get the Descriptor Length field (Bytes 1-2) */ |
| 90 | |
| 91 | ACPI_MOVE_16_TO_16(&temp16, buffer); |
| 92 | buffer += 2; |
| 93 | |
| 94 | /* Validate the descriptor length */ |
| 95 | |
| 96 | if (temp16 != 12) { |
| 97 | return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH); |
| 98 | } |
| 99 | |
| 100 | /* The number of bytes consumed is fixed (12 + 3) */ |
| 101 | |
| 102 | *bytes_consumed = 15; |
| 103 | |
| 104 | /* Fill out the structure */ |
| 105 | |
| 106 | output_struct->type = ACPI_RSTYPE_GENERIC_REG; |
| 107 | |
| 108 | /* Get space_id (Byte 3) */ |
| 109 | |
| 110 | temp8 = *buffer; |
| 111 | output_struct->data.generic_reg.space_id = temp8; |
| 112 | buffer += 1; |
| 113 | |
| 114 | /* Get register_bit_width (Byte 4) */ |
| 115 | |
| 116 | temp8 = *buffer; |
| 117 | output_struct->data.generic_reg.bit_width = temp8; |
| 118 | buffer += 1; |
| 119 | |
| 120 | /* Get register_bit_offset (Byte 5) */ |
| 121 | |
| 122 | temp8 = *buffer; |
| 123 | output_struct->data.generic_reg.bit_offset = temp8; |
| 124 | buffer += 1; |
| 125 | |
| 126 | /* Get address_size (Byte 6) */ |
| 127 | |
| 128 | temp8 = *buffer; |
| 129 | output_struct->data.generic_reg.address_size = temp8; |
| 130 | buffer += 1; |
| 131 | |
| 132 | /* Get register_address (Bytes 7-14) */ |
| 133 | |
| 134 | ACPI_MOVE_64_TO_64(&output_struct->data.generic_reg.address, buffer); |
| 135 | |
| 136 | /* Set the Length parameter */ |
| 137 | |
| 138 | output_struct->length = (u32) struct_size; |
| 139 | |
| 140 | /* Return the final size of the structure */ |
| 141 | |
| 142 | *structure_size = struct_size; |
| 143 | return_ACPI_STATUS(AE_OK); |
| 144 | } |
| 145 | |
| 146 | /******************************************************************************* |
| 147 | * |
| 148 | * FUNCTION: acpi_rs_generic_register_stream |
| 149 | * |
| 150 | * PARAMETERS: Resource - Pointer to the resource linked list |
| 151 | * output_buffer - Pointer to the user's return buffer |
| 152 | * bytes_consumed - Pointer to where the number of bytes |
| 153 | * used in the output_buffer is returned |
| 154 | * |
| 155 | * RETURN: Status |
| 156 | * |
| 157 | * DESCRIPTION: Take the linked list resource structure and fills in the |
| 158 | * the appropriate bytes in a byte stream |
| 159 | * |
| 160 | ******************************************************************************/ |
| 161 | |
| 162 | acpi_status |
| 163 | acpi_rs_generic_register_stream(struct acpi_resource *resource, |
| 164 | u8 ** output_buffer, acpi_size * bytes_consumed) |
| 165 | { |
| 166 | u8 *buffer = *output_buffer; |
| 167 | u16 temp16; |
| 168 | |
| 169 | ACPI_FUNCTION_TRACE("rs_generic_register_stream"); |
| 170 | |
| 171 | /* Set the Descriptor Type (Byte 0) */ |
| 172 | |
| 173 | *buffer = ACPI_RDESC_TYPE_GENERIC_REGISTER; |
| 174 | buffer += 1; |
| 175 | |
| 176 | /* Set the Descriptor Length (Bytes 1-2) */ |
| 177 | |
| 178 | temp16 = 12; |
| 179 | ACPI_MOVE_16_TO_16(buffer, &temp16); |
| 180 | buffer += 2; |
| 181 | |
| 182 | /* Set space_id (Byte 3) */ |
| 183 | |
| 184 | *buffer = (u8) resource->data.generic_reg.space_id; |
| 185 | buffer += 1; |
| 186 | |
| 187 | /* Set register_bit_width (Byte 4) */ |
| 188 | |
| 189 | *buffer = (u8) resource->data.generic_reg.bit_width; |
| 190 | buffer += 1; |
| 191 | |
| 192 | /* Set register_bit_offset (Byte 5) */ |
| 193 | |
| 194 | *buffer = (u8) resource->data.generic_reg.bit_offset; |
| 195 | buffer += 1; |
| 196 | |
| 197 | /* Set address_size (Byte 6) */ |
| 198 | |
| 199 | *buffer = (u8) resource->data.generic_reg.address_size; |
| 200 | buffer += 1; |
| 201 | |
| 202 | /* Set register_address (Bytes 7-14) */ |
| 203 | |
| 204 | ACPI_MOVE_64_TO_64(buffer, &resource->data.generic_reg.address); |
| 205 | buffer += 8; |
| 206 | |
| 207 | /* Return the number of bytes consumed in this operation */ |
| 208 | |
| 209 | *bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer); |
| 210 | return_ACPI_STATUS(AE_OK); |
| 211 | } |
| 212 | |
| 213 | /******************************************************************************* |
| 214 | * |
| 215 | * FUNCTION: acpi_rs_end_tag_resource |
| 216 | * |
| 217 | * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte |
| 218 | * stream |
| 219 | * bytes_consumed - Pointer to where the number of bytes |
| 220 | * consumed the byte_stream_buffer is |
| 221 | * returned |
| 222 | * output_buffer - Pointer to the return data buffer |
| 223 | * structure_size - Pointer to where the number of bytes |
| 224 | * in the return data struct is returned |
| 225 | * |
| 226 | * RETURN: Status |
| 227 | * |
| 228 | * DESCRIPTION: Take the resource byte stream and fill out the appropriate |
| 229 | * structure pointed to by the output_buffer. Return the |
| 230 | * number of bytes consumed from the byte stream. |
| 231 | * |
| 232 | ******************************************************************************/ |
| 233 | |
| 234 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 235 | acpi_rs_end_tag_resource(u8 * byte_stream_buffer, |
| 236 | acpi_size * bytes_consumed, |
| 237 | u8 ** output_buffer, acpi_size * structure_size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 239 | struct acpi_resource *output_struct = (void *)*output_buffer; |
| 240 | acpi_size struct_size = ACPI_RESOURCE_LENGTH; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 242 | ACPI_FUNCTION_TRACE("rs_end_tag_resource"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 244 | /* The number of bytes consumed is static */ |
| 245 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | *bytes_consumed = 2; |
| 247 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 248 | /* Fill out the structure */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 249 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 250 | output_struct->type = ACPI_RSTYPE_END_TAG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 252 | /* Set the Length parameter */ |
| 253 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | output_struct->length = 0; |
| 255 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 256 | /* Return the final size of the structure */ |
| 257 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | *structure_size = struct_size; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 259 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | } |
| 261 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | /******************************************************************************* |
| 263 | * |
| 264 | * FUNCTION: acpi_rs_end_tag_stream |
| 265 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 266 | * PARAMETERS: Resource - Pointer to the resource linked list |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | * output_buffer - Pointer to the user's return buffer |
| 268 | * bytes_consumed - Pointer to where the number of bytes |
| 269 | * used in the output_buffer is returned |
| 270 | * |
| 271 | * RETURN: Status |
| 272 | * |
| 273 | * DESCRIPTION: Take the linked list resource structure and fills in the |
| 274 | * the appropriate bytes in a byte stream |
| 275 | * |
| 276 | ******************************************************************************/ |
| 277 | |
| 278 | acpi_status |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 279 | acpi_rs_end_tag_stream(struct acpi_resource *resource, |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 280 | u8 ** output_buffer, acpi_size * bytes_consumed) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 281 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 282 | u8 *buffer = *output_buffer; |
| 283 | u8 temp8 = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 285 | ACPI_FUNCTION_TRACE("rs_end_tag_stream"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 287 | /* The Descriptor Type field is static */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 288 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 289 | *buffer = ACPI_RDESC_TYPE_END_TAG | 0x01; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | buffer += 1; |
| 291 | |
| 292 | /* |
| 293 | * Set the Checksum - zero means that the resource data is treated as if |
| 294 | * the checksum operation succeeded (ACPI Spec 1.0b Section 6.4.2.8) |
| 295 | */ |
| 296 | temp8 = 0; |
| 297 | |
| 298 | *buffer = temp8; |
| 299 | buffer += 1; |
| 300 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 301 | /* Return the number of bytes consumed in this operation */ |
| 302 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 303 | *bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer); |
| 304 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | } |
| 306 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | /******************************************************************************* |
| 308 | * |
| 309 | * FUNCTION: acpi_rs_vendor_resource |
| 310 | * |
| 311 | * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte |
| 312 | * stream |
| 313 | * bytes_consumed - Pointer to where the number of bytes |
| 314 | * consumed the byte_stream_buffer is |
| 315 | * returned |
| 316 | * output_buffer - Pointer to the return data buffer |
| 317 | * structure_size - Pointer to where the number of bytes |
| 318 | * in the return data struct is returned |
| 319 | * |
| 320 | * RETURN: Status |
| 321 | * |
| 322 | * DESCRIPTION: Take the resource byte stream and fill out the appropriate |
| 323 | * structure pointed to by the output_buffer. Return the |
| 324 | * number of bytes consumed from the byte stream. |
| 325 | * |
| 326 | ******************************************************************************/ |
| 327 | |
| 328 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 329 | acpi_rs_vendor_resource(u8 * byte_stream_buffer, |
| 330 | acpi_size * bytes_consumed, |
| 331 | u8 ** output_buffer, acpi_size * structure_size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 333 | u8 *buffer = byte_stream_buffer; |
| 334 | struct acpi_resource *output_struct = (void *)*output_buffer; |
| 335 | u16 temp16 = 0; |
| 336 | u8 temp8 = 0; |
| 337 | u8 index; |
| 338 | acpi_size struct_size = |
| 339 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 341 | ACPI_FUNCTION_TRACE("rs_vendor_resource"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 342 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 343 | /* Dereference the Descriptor to find if this is a large or small item. */ |
| 344 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | temp8 = *buffer; |
| 346 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 347 | if (temp8 & ACPI_RDESC_TYPE_LARGE) { |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 348 | /* Large Item, point to the length field */ |
| 349 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | buffer += 1; |
| 351 | |
| 352 | /* Dereference */ |
| 353 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 354 | ACPI_MOVE_16_TO_16(&temp16, buffer); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | |
| 356 | /* Calculate bytes consumed */ |
| 357 | |
| 358 | *bytes_consumed = (acpi_size) temp16 + 3; |
| 359 | |
| 360 | /* Point to the first vendor byte */ |
| 361 | |
| 362 | buffer += 2; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 363 | } else { |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 364 | /* Small Item, dereference the size */ |
| 365 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 366 | temp16 = (u8) (*buffer & 0x07); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | |
| 368 | /* Calculate bytes consumed */ |
| 369 | |
| 370 | *bytes_consumed = (acpi_size) temp16 + 1; |
| 371 | |
| 372 | /* Point to the first vendor byte */ |
| 373 | |
| 374 | buffer += 1; |
| 375 | } |
| 376 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 377 | output_struct->type = ACPI_RSTYPE_VENDOR; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | output_struct->data.vendor_specific.length = temp16; |
| 379 | |
| 380 | for (index = 0; index < temp16; index++) { |
| 381 | output_struct->data.vendor_specific.reserved[index] = *buffer; |
| 382 | buffer += 1; |
| 383 | } |
| 384 | |
| 385 | /* |
| 386 | * In order for the struct_size to fall on a 32-bit boundary, |
| 387 | * calculate the length of the vendor string and expand the |
| 388 | * struct_size to the next 32-bit boundary. |
| 389 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 390 | struct_size += ACPI_ROUND_UP_to_32_bITS(temp16); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 391 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 392 | /* Set the Length parameter */ |
| 393 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | output_struct->length = (u32) struct_size; |
| 395 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 396 | /* Return the final size of the structure */ |
| 397 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | *structure_size = struct_size; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 399 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 400 | } |
| 401 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 402 | /******************************************************************************* |
| 403 | * |
| 404 | * FUNCTION: acpi_rs_vendor_stream |
| 405 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 406 | * PARAMETERS: Resource - Pointer to the resource linked list |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | * output_buffer - Pointer to the user's return buffer |
| 408 | * bytes_consumed - Pointer to where the number of bytes |
| 409 | * used in the output_buffer is returned |
| 410 | * |
| 411 | * RETURN: Status |
| 412 | * |
| 413 | * DESCRIPTION: Take the linked list resource structure and fills in the |
| 414 | * the appropriate bytes in a byte stream |
| 415 | * |
| 416 | ******************************************************************************/ |
| 417 | |
| 418 | acpi_status |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 419 | acpi_rs_vendor_stream(struct acpi_resource *resource, |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 420 | u8 ** output_buffer, acpi_size * bytes_consumed) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 422 | u8 *buffer = *output_buffer; |
| 423 | u16 temp16 = 0; |
| 424 | u8 temp8 = 0; |
| 425 | u8 index; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 426 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 427 | ACPI_FUNCTION_TRACE("rs_vendor_stream"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 429 | /* Dereference the length to find if this is a large or small item. */ |
| 430 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 431 | if (resource->data.vendor_specific.length > 7) { |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 432 | /* Large Item, Set the descriptor field and length bytes */ |
| 433 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 434 | *buffer = ACPI_RDESC_TYPE_LARGE_VENDOR; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | buffer += 1; |
| 436 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 437 | temp16 = (u16) resource->data.vendor_specific.length; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 439 | ACPI_MOVE_16_TO_16(buffer, &temp16); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | buffer += 2; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 441 | } else { |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 442 | /* Small Item, Set the descriptor field */ |
| 443 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 444 | temp8 = ACPI_RDESC_TYPE_SMALL_VENDOR; |
| 445 | temp8 |= (u8) resource->data.vendor_specific.length; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | |
| 447 | *buffer = temp8; |
| 448 | buffer += 1; |
| 449 | } |
| 450 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 451 | /* Loop through all of the Vendor Specific fields */ |
| 452 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 453 | for (index = 0; index < resource->data.vendor_specific.length; index++) { |
| 454 | temp8 = resource->data.vendor_specific.reserved[index]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | |
| 456 | *buffer = temp8; |
| 457 | buffer += 1; |
| 458 | } |
| 459 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 460 | /* Return the number of bytes consumed in this operation */ |
| 461 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 462 | *bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer); |
| 463 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 464 | } |
| 465 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 466 | /******************************************************************************* |
| 467 | * |
| 468 | * FUNCTION: acpi_rs_start_depend_fns_resource |
| 469 | * |
| 470 | * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte |
| 471 | * stream |
| 472 | * bytes_consumed - Pointer to where the number of bytes |
| 473 | * consumed the byte_stream_buffer is |
| 474 | * returned |
| 475 | * output_buffer - Pointer to the return data buffer |
| 476 | * structure_size - Pointer to where the number of bytes |
| 477 | * in the return data struct is returned |
| 478 | * |
| 479 | * RETURN: Status |
| 480 | * |
| 481 | * DESCRIPTION: Take the resource byte stream and fill out the appropriate |
| 482 | * structure pointed to by the output_buffer. Return the |
| 483 | * number of bytes consumed from the byte stream. |
| 484 | * |
| 485 | ******************************************************************************/ |
| 486 | |
| 487 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 488 | acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, |
| 489 | acpi_size * bytes_consumed, |
| 490 | u8 ** output_buffer, |
| 491 | acpi_size * structure_size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 492 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 493 | u8 *buffer = byte_stream_buffer; |
| 494 | struct acpi_resource *output_struct = (void *)*output_buffer; |
| 495 | u8 temp8 = 0; |
| 496 | acpi_size struct_size = |
| 497 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_start_dpf); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 499 | ACPI_FUNCTION_TRACE("rs_start_depend_fns_resource"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 500 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 501 | /* The number of bytes consumed are found in the descriptor (Bits:0-1) */ |
| 502 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | temp8 = *buffer; |
| 504 | |
| 505 | *bytes_consumed = (temp8 & 0x01) + 1; |
| 506 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 507 | output_struct->type = ACPI_RSTYPE_START_DPF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 509 | /* Point to Byte 1 if it is used */ |
| 510 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 511 | if (2 == *bytes_consumed) { |
| 512 | buffer += 1; |
| 513 | temp8 = *buffer; |
| 514 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 515 | /* Check Compatibility priority */ |
| 516 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 517 | output_struct->data.start_dpf.compatibility_priority = |
| 518 | temp8 & 0x03; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 519 | |
| 520 | if (3 == output_struct->data.start_dpf.compatibility_priority) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 521 | return_ACPI_STATUS(AE_AML_BAD_RESOURCE_VALUE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | } |
| 523 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 524 | /* Check Performance/Robustness preference */ |
| 525 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 526 | output_struct->data.start_dpf.performance_robustness = |
| 527 | (temp8 >> 2) & 0x03; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 528 | |
| 529 | if (3 == output_struct->data.start_dpf.performance_robustness) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 530 | return_ACPI_STATUS(AE_AML_BAD_RESOURCE_VALUE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 531 | } |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 532 | } else { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | output_struct->data.start_dpf.compatibility_priority = |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 534 | ACPI_ACCEPTABLE_CONFIGURATION; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 535 | |
| 536 | output_struct->data.start_dpf.performance_robustness = |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 537 | ACPI_ACCEPTABLE_CONFIGURATION; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 538 | } |
| 539 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 540 | /* Set the Length parameter */ |
| 541 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 542 | output_struct->length = (u32) struct_size; |
| 543 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 544 | /* Return the final size of the structure */ |
| 545 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | *structure_size = struct_size; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 547 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 548 | } |
| 549 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 550 | /******************************************************************************* |
| 551 | * |
| 552 | * FUNCTION: acpi_rs_end_depend_fns_resource |
| 553 | * |
| 554 | * PARAMETERS: byte_stream_buffer - Pointer to the resource input byte |
| 555 | * stream |
| 556 | * bytes_consumed - Pointer to where the number of bytes |
| 557 | * consumed the byte_stream_buffer is |
| 558 | * returned |
| 559 | * output_buffer - Pointer to the return data buffer |
| 560 | * structure_size - Pointer to where the number of bytes |
| 561 | * in the return data struct is returned |
| 562 | * |
| 563 | * RETURN: Status |
| 564 | * |
| 565 | * DESCRIPTION: Take the resource byte stream and fill out the appropriate |
| 566 | * structure pointed to by the output_buffer. Return the |
| 567 | * number of bytes consumed from the byte stream. |
| 568 | * |
| 569 | ******************************************************************************/ |
| 570 | |
| 571 | acpi_status |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 572 | acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, |
| 573 | acpi_size * bytes_consumed, |
| 574 | u8 ** output_buffer, acpi_size * structure_size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 576 | struct acpi_resource *output_struct = (void *)*output_buffer; |
| 577 | acpi_size struct_size = ACPI_RESOURCE_LENGTH; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 578 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 579 | ACPI_FUNCTION_TRACE("rs_end_depend_fns_resource"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 580 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 581 | /* The number of bytes consumed is static */ |
| 582 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 583 | *bytes_consumed = 1; |
| 584 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 585 | /* Fill out the structure */ |
| 586 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 587 | output_struct->type = ACPI_RSTYPE_END_DPF; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 588 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 589 | /* Set the Length parameter */ |
| 590 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 591 | output_struct->length = (u32) struct_size; |
| 592 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 593 | /* Return the final size of the structure */ |
| 594 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 595 | *structure_size = struct_size; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 596 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 597 | } |
| 598 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 599 | /******************************************************************************* |
| 600 | * |
| 601 | * FUNCTION: acpi_rs_start_depend_fns_stream |
| 602 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 603 | * PARAMETERS: Resource - Pointer to the resource linked list |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 604 | * output_buffer - Pointer to the user's return buffer |
| 605 | * bytes_consumed - u32 pointer that is filled with |
| 606 | * the number of bytes of the |
| 607 | * output_buffer used |
| 608 | * |
| 609 | * RETURN: Status |
| 610 | * |
| 611 | * DESCRIPTION: Take the linked list resource structure and fills in the |
| 612 | * the appropriate bytes in a byte stream |
| 613 | * |
| 614 | ******************************************************************************/ |
| 615 | |
| 616 | acpi_status |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 617 | acpi_rs_start_depend_fns_stream(struct acpi_resource *resource, |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 618 | u8 ** output_buffer, acpi_size * bytes_consumed) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 619 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 620 | u8 *buffer = *output_buffer; |
| 621 | u8 temp8 = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 622 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 623 | ACPI_FUNCTION_TRACE("rs_start_depend_fns_stream"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 624 | |
| 625 | /* |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 626 | * The descriptor type field is set based upon whether a byte is needed |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 627 | * to contain Priority data. |
| 628 | */ |
| 629 | if (ACPI_ACCEPTABLE_CONFIGURATION == |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 630 | resource->data.start_dpf.compatibility_priority && |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 631 | ACPI_ACCEPTABLE_CONFIGURATION == |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 632 | resource->data.start_dpf.performance_robustness) { |
| 633 | *buffer = ACPI_RDESC_TYPE_START_DEPENDENT; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 634 | } else { |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 635 | *buffer = ACPI_RDESC_TYPE_START_DEPENDENT | 0x01; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 636 | buffer += 1; |
| 637 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 638 | /* Set the Priority Byte Definition */ |
| 639 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 640 | temp8 = 0; |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 641 | temp8 = (u8) ((resource->data.start_dpf.performance_robustness & |
| 642 | 0x03) << 2); |
| 643 | temp8 |= (resource->data.start_dpf.compatibility_priority & |
| 644 | 0x03); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 645 | *buffer = temp8; |
| 646 | } |
| 647 | |
| 648 | buffer += 1; |
| 649 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 650 | /* Return the number of bytes consumed in this operation */ |
| 651 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 652 | *bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer); |
| 653 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 654 | } |
| 655 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 656 | /******************************************************************************* |
| 657 | * |
| 658 | * FUNCTION: acpi_rs_end_depend_fns_stream |
| 659 | * |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 660 | * PARAMETERS: Resource - Pointer to the resource linked list |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 661 | * output_buffer - Pointer to the user's return buffer |
| 662 | * bytes_consumed - Pointer to where the number of bytes |
| 663 | * used in the output_buffer is returned |
| 664 | * |
| 665 | * RETURN: Status |
| 666 | * |
| 667 | * DESCRIPTION: Take the linked list resource structure and fills in the |
| 668 | * the appropriate bytes in a byte stream |
| 669 | * |
| 670 | ******************************************************************************/ |
| 671 | |
| 672 | acpi_status |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 673 | acpi_rs_end_depend_fns_stream(struct acpi_resource *resource, |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 674 | u8 ** output_buffer, acpi_size * bytes_consumed) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 675 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 676 | u8 *buffer = *output_buffer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 677 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 678 | ACPI_FUNCTION_TRACE("rs_end_depend_fns_stream"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 679 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 680 | /* The Descriptor Type field is static */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 681 | |
Robert Moore | bda663d | 2005-09-16 16:51:15 -0400 | [diff] [blame] | 682 | *buffer = ACPI_RDESC_TYPE_END_DEPENDENT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 683 | buffer += 1; |
| 684 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 685 | /* Return the number of bytes consumed in this operation */ |
| 686 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 687 | *bytes_consumed = ACPI_PTR_DIFF(buffer, *output_buffer); |
| 688 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 689 | } |