Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

740 lines
20 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: acpiutil.c
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "ideport.h"
  11. #ifdef ALLOC_PRAGMA
  12. #pragma alloc_text(NONPAGE, DeviceQueryACPISettings)
  13. #pragma alloc_text(NONPAGE, DeviceQueryACPISettingsCompletionRoutine)
  14. #pragma alloc_text(NONPAGE, DeviceQueryFirmwareBootSettings)
  15. #pragma alloc_text(NONPAGE, DeviceQueryChannelTimingSettings)
  16. #pragma alloc_text(NONPAGE, ChannelSetACPITimingSettings)
  17. #pragma alloc_text(NONPAGE, ChannelSyncSetACPITimingSettingsCompletionRoutine)
  18. #pragma alloc_text(NONPAGE, ChannelSetACPITimingSettings)
  19. #pragma alloc_text(NONPAGE, ChannelSetACPITimingSettingsCompletionRoutine)
  20. #endif // ALLOC_PRAGMA
  21. NTSTATUS
  22. DeviceQueryACPISettings (
  23. IN PDEVICE_EXTENSION_HEADER DoExtension,
  24. IN ULONG ControlMethodName,
  25. OUT PACPI_EVAL_OUTPUT_BUFFER *QueryResult
  26. )
  27. {
  28. PIRP irp;
  29. PIO_STACK_LOCATION irpSp;
  30. IO_STATUS_BLOCK ioStatusBlock;
  31. ACPI_EVAL_INPUT_BUFFER cmInputData;
  32. PACPI_EVAL_OUTPUT_BUFFER cmOutputData;
  33. ULONG cmOutputDataSize;
  34. NTSTATUS status;
  35. KEVENT event;
  36. ULONG retry;
  37. ULONG systemBufferLength;
  38. PDEVICE_OBJECT targetDeviceObject;
  39. DebugPrint((DBG_ACPI,
  40. "ATAPI: ChannelQueryACPISettings for %c%c%c%c\n",
  41. ((PUCHAR)&ControlMethodName)[0],
  42. ((PUCHAR)&ControlMethodName)[1],
  43. ((PUCHAR)&ControlMethodName)[2],
  44. ((PUCHAR)&ControlMethodName)[3]
  45. ));
  46. RtlZeroMemory (
  47. &cmInputData,
  48. sizeof(cmInputData)
  49. );
  50. cmInputData.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE;
  51. cmInputData.MethodNameAsUlong = ControlMethodName;
  52. //
  53. // get the top of our device stack
  54. //
  55. targetDeviceObject = IoGetAttachedDeviceReference(
  56. DoExtension->DeviceObject
  57. );
  58. cmOutputDataSize = sizeof(ACPI_EVAL_OUTPUT_BUFFER);
  59. irp = NULL;
  60. for (retry=0; retry<2; retry++) {
  61. DebugPrint((DBG_ACPI, "ATAPI: _GTM try %x\n", retry));
  62. cmOutputData = ExAllocatePool (
  63. NonPagedPool,
  64. cmOutputDataSize
  65. );
  66. if (cmOutputData == NULL) {
  67. status = STATUS_INSUFFICIENT_RESOURCES;
  68. break;
  69. }
  70. KeInitializeEvent(&event,
  71. NotificationEvent,
  72. FALSE);
  73. irp = IoAllocateIrp(targetDeviceObject->StackSize, FALSE);
  74. if (irp == NULL) {
  75. status = STATUS_INSUFFICIENT_RESOURCES;
  76. break;
  77. }
  78. if (sizeof(cmInputData) > cmOutputDataSize) {
  79. systemBufferLength = sizeof(cmInputData);
  80. } else {
  81. systemBufferLength = cmOutputDataSize;
  82. }
  83. irp->AssociatedIrp.SystemBuffer = ExAllocatePool(
  84. NonPagedPoolCacheAligned,
  85. systemBufferLength
  86. );
  87. if (irp->AssociatedIrp.SystemBuffer == NULL) {
  88. status = STATUS_INSUFFICIENT_RESOURCES;
  89. break;
  90. }
  91. ASSERT ((IOCTL_ACPI_ASYNC_EVAL_METHOD & 0x3) == METHOD_BUFFERED);
  92. irp->Flags = IRP_BUFFERED_IO | IRP_INPUT_OPERATION;
  93. irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
  94. irpSp = IoGetNextIrpStackLocation( irp );
  95. irpSp->MajorFunction = IRP_MJ_DEVICE_CONTROL;
  96. irpSp->Parameters.DeviceIoControl.OutputBufferLength = cmOutputDataSize;
  97. irpSp->Parameters.DeviceIoControl.InputBufferLength = sizeof(cmInputData);
  98. irpSp->Parameters.DeviceIoControl.IoControlCode = IOCTL_ACPI_ASYNC_EVAL_METHOD;
  99. RtlCopyMemory(
  100. irp->AssociatedIrp.SystemBuffer,
  101. &cmInputData,
  102. sizeof(cmInputData)
  103. );
  104. irp->UserBuffer = cmOutputData;
  105. IoSetCompletionRoutine(
  106. irp,
  107. DeviceQueryACPISettingsCompletionRoutine,
  108. &event,
  109. TRUE,
  110. TRUE,
  111. TRUE
  112. );
  113. status = IoCallDriver(targetDeviceObject, irp);
  114. if (status == STATUS_PENDING) {
  115. KeWaitForSingleObject(&event,
  116. Executive,
  117. KernelMode,
  118. FALSE,
  119. NULL);
  120. status = irp->IoStatus.Status;
  121. }
  122. if (NT_SUCCESS(status)) {
  123. //
  124. // should get what we are expecting
  125. //
  126. ASSERT (
  127. cmOutputData->Signature ==
  128. ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE
  129. );
  130. if (cmOutputData->Signature !=
  131. ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE) {
  132. status = STATUS_UNSUCCESSFUL;
  133. }
  134. }
  135. ExFreePool(irp->AssociatedIrp.SystemBuffer);
  136. IoFreeIrp(irp);
  137. irp = NULL;
  138. if (!NT_SUCCESS(status)) {
  139. //
  140. // grab the data length in case we need it
  141. //
  142. cmOutputDataSize = cmOutputData->Length;
  143. ExFreePool(cmOutputData);
  144. cmOutputData = NULL;
  145. if (status == STATUS_BUFFER_OVERFLOW) {
  146. //
  147. // output buffer too small, try again
  148. //
  149. } else {
  150. //
  151. // got some error, no need to retry
  152. //
  153. break;
  154. }
  155. }
  156. }
  157. //
  158. // Clean up
  159. //
  160. ObDereferenceObject (targetDeviceObject);
  161. if (irp) {
  162. if (irp->AssociatedIrp.SystemBuffer) {
  163. ExFreePool(irp->AssociatedIrp.SystemBuffer);
  164. }
  165. IoFreeIrp(irp);
  166. }
  167. //
  168. // returning
  169. //
  170. *QueryResult = cmOutputData;
  171. return status;
  172. } // ChannelQueryACPISettings
  173. NTSTATUS
  174. DeviceQueryACPISettingsCompletionRoutine (
  175. IN PDEVICE_OBJECT DeviceObject,
  176. IN PIRP Irp,
  177. IN PVOID Context
  178. )
  179. {
  180. PKEVENT event = Context;
  181. if (!NT_ERROR(Irp->IoStatus.Status)) {
  182. //
  183. // Copy the information from the system
  184. // buffer to the caller's buffer.
  185. //
  186. RtlCopyMemory(
  187. Irp->UserBuffer,
  188. Irp->AssociatedIrp.SystemBuffer,
  189. Irp->IoStatus.Information
  190. );
  191. }
  192. KeSetEvent(
  193. event,
  194. EVENT_INCREMENT,
  195. FALSE
  196. );
  197. return STATUS_MORE_PROCESSING_REQUIRED;
  198. } // DeviceQueryACPISettingsCompletionRoutine
  199. NTSTATUS
  200. DeviceQueryFirmwareBootSettings (
  201. IN PPDO_EXTENSION PdoExtension,
  202. IN OUT PDEVICE_SETTINGS *IdeBiosSettings
  203. )
  204. {
  205. NTSTATUS status;
  206. PACPI_EVAL_OUTPUT_BUFFER queryResult;
  207. PDEVICE_SETTINGS ideBiosSettings;
  208. ULONG i;
  209. *IdeBiosSettings = NULL;
  210. status = DeviceQueryACPISettings (
  211. (PDEVICE_EXTENSION_HEADER) PdoExtension,
  212. ACPI_METHOD_GET_TASK_FILE,
  213. &queryResult
  214. );
  215. if (NT_SUCCESS(status)) {
  216. if (queryResult->Count != 1) {
  217. ASSERT (queryResult->Count == 1);
  218. status = STATUS_UNSUCCESSFUL;
  219. }
  220. }
  221. if (NT_SUCCESS(status)) {
  222. PACPI_METHOD_ARGUMENT argument;
  223. argument = queryResult->Argument;
  224. //
  225. // looking for buffer type
  226. //
  227. if (argument->Type == ACPI_METHOD_ARGUMENT_BUFFER) {
  228. ULONG numEntries;
  229. ASSERT (!(argument->DataLength % sizeof(ACPI_GTF_IDE_REGISTERS)));
  230. numEntries = argument->DataLength / sizeof(ACPI_GTF_IDE_REGISTERS);
  231. ideBiosSettings = ExAllocatePool (
  232. NonPagedPool,
  233. sizeof(DEVICE_SETTINGS) +
  234. numEntries * sizeof(IDEREGS)
  235. );
  236. if (!ideBiosSettings) {
  237. DebugPrint((DBG_ALWAYS, "ATAPI: ChannelQueryFirmwareBootSettings failed to allocate memory\n"));
  238. status = STATUS_INSUFFICIENT_RESOURCES;
  239. } else {
  240. for (i=0; i<numEntries; i++) {
  241. RtlMoveMemory (
  242. ideBiosSettings->FirmwareSettings + i,
  243. argument->Data + i * sizeof(ACPI_GTF_IDE_REGISTERS),
  244. sizeof(ACPI_GTF_IDE_REGISTERS)
  245. );
  246. ideBiosSettings->FirmwareSettings[i].bReserved = 0;
  247. }
  248. ideBiosSettings->NumEntries = numEntries;
  249. *IdeBiosSettings = ideBiosSettings;
  250. #if DBG
  251. {
  252. ULONG i;
  253. DebugPrint((DBG_ACPI, "ATAPI: _GTF Data:\n"));
  254. for (i=0; i<ideBiosSettings->NumEntries; i++) {
  255. DebugPrint((DBG_ACPI, "\t"));
  256. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bFeaturesReg));
  257. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bSectorCountReg));
  258. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bSectorNumberReg));
  259. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bCylLowReg));
  260. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bCylHighReg));
  261. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bDriveHeadReg));
  262. DebugPrint((DBG_ACPI, " 0x%02x", ideBiosSettings->FirmwareSettings[i].bCommandReg));
  263. DebugPrint((DBG_ACPI, "\n"));
  264. }
  265. }
  266. #endif
  267. }
  268. }
  269. }
  270. //
  271. // clean up
  272. //
  273. if (queryResult) {
  274. ExFreePool (queryResult);
  275. }
  276. return status;
  277. } // ChannelQueryFirmwareBootSettings
  278. NTSTATUS
  279. DeviceQueryChannelTimingSettings (
  280. IN PFDO_EXTENSION FdoExtension,
  281. IN OUT PACPI_IDE_TIMING TimimgSettings
  282. )
  283. {
  284. NTSTATUS status;
  285. PACPI_EVAL_OUTPUT_BUFFER queryResult;
  286. PACPI_IDE_TIMING timimgSettings;
  287. ULONG i;
  288. status = DeviceQueryACPISettings (
  289. (PDEVICE_EXTENSION_HEADER) FdoExtension,
  290. ACPI_METHOD_GET_TIMING,
  291. &queryResult
  292. );
  293. if (NT_SUCCESS(status)) {
  294. if (queryResult->Count != 1) {
  295. ASSERT (queryResult->Count == 1);
  296. status = STATUS_UNSUCCESSFUL;
  297. }
  298. }
  299. if (NT_SUCCESS(status)) {
  300. PACPI_METHOD_ARGUMENT argument;
  301. //
  302. // PIO Speed
  303. //
  304. argument = queryResult->Argument;
  305. ASSERT (argument->Type == ACPI_METHOD_ARGUMENT_BUFFER);
  306. if ((argument->Type == ACPI_METHOD_ARGUMENT_BUFFER) &&
  307. (argument->DataLength >= sizeof (ACPI_IDE_TIMING))) {
  308. RtlCopyMemory (
  309. TimimgSettings,
  310. argument->Data,
  311. sizeof(ACPI_IDE_TIMING)
  312. );
  313. DebugPrint((DBG_ACPI, "ATAPI: _GTM Data:\n"));
  314. for (i=0; i<MAX_IDE_DEVICE; i++) {
  315. DebugPrint((DBG_ACPI, "\tPIO Speed %d: 0x%0x\n", i, TimimgSettings->Speed[i].Pio));
  316. DebugPrint((DBG_ACPI, "\tDMA Speed %d: 0x%0x\n", i, TimimgSettings->Speed[i].Dma));
  317. }
  318. DebugPrint((DBG_ACPI, "\tFlags: 0x%0x\n", TimimgSettings->Flags.AsULong));
  319. //
  320. // The following asserts are bogus. The ACPI spec doesn't say anything about the timing
  321. // information for the slave device in this case
  322. //
  323. //if (!TimimgSettings->Flags.b.IndependentTiming) {
  324. // ASSERT (TimimgSettings->Speed[MAX_IDE_DEVICE - 1].Pio == ACPI_XFER_MODE_NOT_SUPPORT);
  325. // ASSERT (TimimgSettings->Speed[MAX_IDE_DEVICE - 1].Dma == ACPI_XFER_MODE_NOT_SUPPORT);
  326. //}
  327. } else {
  328. status = STATUS_UNSUCCESSFUL;
  329. }
  330. }
  331. if (!NT_SUCCESS(status)) {
  332. for (i=0; i<MAX_IDE_DEVICE; i++) {
  333. TimimgSettings->Speed[i].Pio = ACPI_XFER_MODE_NOT_SUPPORT;
  334. TimimgSettings->Speed[i].Dma = ACPI_XFER_MODE_NOT_SUPPORT;
  335. }
  336. }
  337. //
  338. // clean up
  339. //
  340. if (queryResult) {
  341. ExFreePool (queryResult);
  342. }
  343. return status;
  344. } // DeviceQueryChannelTimingSettings
  345. NTSTATUS
  346. ChannelSyncSetACPITimingSettings (
  347. IN PFDO_EXTENSION FdoExtension,
  348. IN PACPI_IDE_TIMING TimimgSettings,
  349. IN PIDENTIFY_DATA AtaIdentifyData[MAX_IDE_DEVICE]
  350. )
  351. {
  352. SYNC_SET_ACPI_TIMING_CONTEXT context;
  353. NTSTATUS status;
  354. KeInitializeEvent(&context.Event,
  355. NotificationEvent,
  356. FALSE);
  357. status = ChannelSetACPITimingSettings (
  358. FdoExtension,
  359. TimimgSettings,
  360. AtaIdentifyData,
  361. ChannelSyncSetACPITimingSettingsCompletionRoutine,
  362. &context
  363. );
  364. if (status == STATUS_PENDING) {
  365. KeWaitForSingleObject(&context.Event,
  366. Executive,
  367. KernelMode,
  368. FALSE,
  369. NULL);
  370. }
  371. return status = context.IrpStatus;
  372. }
  373. NTSTATUS
  374. ChannelSyncSetACPITimingSettingsCompletionRoutine (
  375. IN PDEVICE_OBJECT DeviceObject,
  376. IN NTSTATUS Status,
  377. IN PVOID Context
  378. )
  379. {
  380. PSYNC_SET_ACPI_TIMING_CONTEXT context = Context;
  381. context->IrpStatus = Status;
  382. KeSetEvent(
  383. &context->Event,
  384. EVENT_INCREMENT,
  385. FALSE
  386. );
  387. return STATUS_MORE_PROCESSING_REQUIRED;
  388. }
  389. NTSTATUS
  390. ChannelSetACPITimingSettings (
  391. IN PFDO_EXTENSION FdoExtension,
  392. IN PACPI_IDE_TIMING TimimgSettings,
  393. IN PIDENTIFY_DATA AtaIdentifyData[MAX_IDE_DEVICE],
  394. IN PSET_ACPI_TIMING_COMPLETION_ROUTINE CallerCompletionRoutine,
  395. IN PVOID CallerContext
  396. )
  397. {
  398. ULONG i;
  399. PIRP irp;
  400. NTSTATUS status;
  401. PDEVICE_OBJECT targetDeviceObject;
  402. PACPI_EVAL_INPUT_BUFFER_COMPLEX cmInputData;
  403. ULONG cmInputDataSize;
  404. PACPI_METHOD_ARGUMENT argument;
  405. PASYNC_SET_ACPI_TIMING_CONTEXT context;
  406. PIO_STACK_LOCATION irpSp;
  407. DebugPrint((DBG_ACPI,
  408. "ATAPI: ChannelSetACPITimingSettings _STM data\n"
  409. ));
  410. for (i=0; i<MAX_IDE_DEVICE; i++) {
  411. DebugPrint((DBG_ACPI, "\tPIO Speed %d: 0x%0x\n", i, TimimgSettings->Speed[i].Pio));
  412. DebugPrint((DBG_ACPI, "\tDMA Speed %d: 0x%0x\n", i, TimimgSettings->Speed[i].Dma));
  413. }
  414. DebugPrint((DBG_ACPI, "\tFlags: 0x%0x\n", TimimgSettings->Flags.AsULong));
  415. cmInputData = NULL;
  416. irp = NULL;
  417. targetDeviceObject = NULL;
  418. //
  419. // get the memory we need
  420. //
  421. cmInputDataSize = sizeof (ACPI_EVAL_INPUT_BUFFER_COMPLEX) +
  422. 3 * sizeof (ACPI_METHOD_ARGUMENT) +
  423. sizeof (ACPI_IDE_TIMING) +
  424. 2 * sizeof (IDENTIFY_DATA);
  425. cmInputData = ExAllocatePool (
  426. NonPagedPool,
  427. cmInputDataSize +
  428. sizeof (ASYNC_SET_ACPI_TIMING_CONTEXT)
  429. );
  430. if (cmInputData == NULL) {
  431. status=STATUS_INSUFFICIENT_RESOURCES;
  432. goto getout;
  433. }
  434. RtlZeroMemory (
  435. cmInputData,
  436. cmInputDataSize +
  437. sizeof (ASYNC_SET_ACPI_TIMING_CONTEXT)
  438. );
  439. context = (PASYNC_SET_ACPI_TIMING_CONTEXT) (((PUCHAR) cmInputData) + cmInputDataSize);
  440. context->FdoExtension = FdoExtension;
  441. context->CallerCompletionRoutine = CallerCompletionRoutine;
  442. context->CallerContext = CallerContext;
  443. cmInputData->Signature = ACPI_EVAL_INPUT_BUFFER_COMPLEX_SIGNATURE;
  444. cmInputData->MethodNameAsUlong = ACPI_METHOD_SET_TIMING;
  445. cmInputData->Size = cmInputDataSize;
  446. cmInputData->ArgumentCount = 3;
  447. //
  448. // first argument
  449. //
  450. argument = cmInputData->Argument;
  451. argument->Type = ACPI_METHOD_ARGUMENT_BUFFER;
  452. argument->DataLength = sizeof(ACPI_IDE_TIMING);
  453. RtlCopyMemory (
  454. argument->Data,
  455. TimimgSettings,
  456. sizeof(ACPI_IDE_TIMING)
  457. );
  458. argument = ACPI_METHOD_NEXT_ARGUMENT(argument);
  459. //
  460. // second argument
  461. //
  462. argument->Type = ACPI_METHOD_ARGUMENT_BUFFER;
  463. if (AtaIdentifyData[0]) {
  464. argument->DataLength = sizeof(IDENTIFY_DATA);
  465. RtlCopyMemory (
  466. argument->Data,
  467. AtaIdentifyData[0],
  468. sizeof(IDENTIFY_DATA)
  469. );
  470. argument = ACPI_METHOD_NEXT_ARGUMENT(argument);
  471. } else {
  472. argument->DataLength = sizeof(IDENTIFY_DATA);
  473. RtlZeroMemory (
  474. argument->Data,
  475. sizeof(IDENTIFY_DATA)
  476. );
  477. argument = ACPI_METHOD_NEXT_ARGUMENT(argument);
  478. }
  479. //
  480. // third argument
  481. //
  482. argument->Type = ACPI_METHOD_ARGUMENT_BUFFER;
  483. if (AtaIdentifyData[1]) {
  484. argument->DataLength = sizeof(IDENTIFY_DATA);
  485. RtlCopyMemory (
  486. argument->Data,
  487. AtaIdentifyData[1],
  488. sizeof(IDENTIFY_DATA)
  489. );
  490. } else {
  491. argument->DataLength = sizeof(IDENTIFY_DATA);
  492. RtlZeroMemory (
  493. argument->Data,
  494. sizeof(IDENTIFY_DATA)
  495. );
  496. }
  497. //
  498. // get the top of our device stack
  499. //
  500. targetDeviceObject = IoGetAttachedDeviceReference(
  501. FdoExtension->DeviceObject
  502. );
  503. irp = IoAllocateIrp(targetDeviceObject->StackSize, FALSE);
  504. if (irp == NULL) {
  505. status = STATUS_INSUFFICIENT_RESOURCES;
  506. goto getout;
  507. }
  508. irp->AssociatedIrp.SystemBuffer = cmInputData;
  509. ASSERT ((IOCTL_ACPI_ASYNC_EVAL_METHOD & 0x3) == METHOD_BUFFERED);
  510. irp->Flags = IRP_BUFFERED_IO | IRP_INPUT_OPERATION;
  511. irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
  512. irpSp = IoGetNextIrpStackLocation( irp );
  513. irpSp->MajorFunction = IRP_MJ_DEVICE_CONTROL;
  514. irpSp->Parameters.DeviceIoControl.OutputBufferLength = 0;
  515. irpSp->Parameters.DeviceIoControl.InputBufferLength = cmInputDataSize;
  516. irpSp->Parameters.DeviceIoControl.IoControlCode = IOCTL_ACPI_ASYNC_EVAL_METHOD;
  517. irp->UserBuffer = NULL;
  518. IoSetCompletionRoutine(
  519. irp,
  520. ChannelSetACPITimingSettingsCompletionRoutine,
  521. context,
  522. TRUE,
  523. TRUE,
  524. TRUE
  525. );
  526. IoCallDriver(targetDeviceObject, irp);
  527. status = STATUS_PENDING;
  528. getout:
  529. //
  530. // Clean up
  531. //
  532. if (targetDeviceObject) {
  533. ObDereferenceObject (targetDeviceObject);
  534. }
  535. if (!NT_SUCCESS(status) && (status != STATUS_PENDING)) {
  536. if (irp) {
  537. IoFreeIrp(irp);
  538. }
  539. if (cmInputData) {
  540. ExFreePool (cmInputData);
  541. }
  542. }
  543. //
  544. // returning
  545. //
  546. return status;
  547. } // ChannelSetACPITimingSettings
  548. NTSTATUS
  549. ChannelSetACPITimingSettingsCompletionRoutine (
  550. IN PDEVICE_OBJECT DeviceObject,
  551. IN PIRP Irp,
  552. IN PVOID Context
  553. )
  554. {
  555. PASYNC_SET_ACPI_TIMING_CONTEXT context = Context;
  556. if (!NT_SUCCESS(Irp->IoStatus.Status)) {
  557. DebugPrint ((DBG_ALWAYS,
  558. "*********************************************\n"
  559. "*********************************************\n"
  560. "** *\n"
  561. "** ACPI Set Timing Failed with status %x *\n"
  562. "** Ignore it for now *\n"
  563. "** *\n"
  564. "*********************************************\n"
  565. "*********************************************\n",
  566. Irp->IoStatus.Status
  567. ));
  568. Irp->IoStatus.Status = STATUS_SUCCESS;
  569. }
  570. (*context->CallerCompletionRoutine) (
  571. DeviceObject,
  572. Irp->IoStatus.Status,
  573. context->CallerContext
  574. );
  575. ExFreePool (Irp->AssociatedIrp.SystemBuffer);
  576. IoFreeIrp(Irp);
  577. return STATUS_MORE_PROCESSING_REQUIRED;
  578. }