#include "classp.h"
#include "debug.h"
Go to the source code of this file.
◆ ClasspCompleteIdleRequest()
Definition at line 713 of file clntirp.c.
716{
718
719
720
721
722
723
724
729 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_TIMER,
"ClasspCompleteIdleRequest: Service next idle reqeusts\n"));
731 }
732
733 return;
734}
VOID ClasspServiceIdleRequest(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, BOOLEAN PostToDpc)
LOGICAL ClasspIdleDurationSufficient(IN PCLASS_PRIVATE_FDO_DATA FdoData, OUT LARGE_INTEGER **CurrentTimeIn)
#define TRACE_LEVEL_INFORMATION
Referenced by TransferPktComplete().
◆ ClasspDequeueIdleRequest()
Definition at line 654 of file clntirp.c.
657{
662
664
667
668
669
671
672
673
675
676
677
680 }
683
684
686 }
687
689
690
692}
VOID ClasspStopIdleTimer(PCLASS_PRIVATE_FDO_DATA FdoData)
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define CONTAINING_RECORD(address, type, field)
Referenced by ClasspServiceIdleRequest().
◆ ClasspEnqueueIdleRequest()
Definition at line 576 of file clntirp.c.
580{
587
589
591
592
593
594
595 pCurrentTime = ¤tTime;
597 issueRequest =
FALSE;
598 }
599
600
601
602
603
605 issueRequest =
FALSE;
606 }
607
608
612 }
614
615
619 }
620
622 issueRequest =
FALSE;
623 }
624
625
627
628 if (issueRequest) {
630 }
631
633}
VOID ClasspStartIdleTimer(IN PCLASS_PRIVATE_FDO_DATA FdoData)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
_In_ PDEVICE_OBJECT DeviceObject
Referenced by ClassReadWrite().
◆ ClasspGetIdleTime()
Definition at line 351 of file clntirp.c.
355{
358
359
360
361
362
363
365 (
ULONGLONG)FdoData->LastNonIdleIoTime.QuadPart,
366 &idleTime);
367
369
370
371
373 } else {
374
375
376
377 idleTime = FdoData->IdleInterval;
378 }
379
380 return idleTime;
381}
FORCEINLINE ULONGLONG ClasspTimeDiffToMs(ULONGLONG TimeDiff)
#define NT_SUCCESS(StatCode)
Referenced by ClasspIdleDurationSufficient().
◆ ClasspIdleDurationSufficient()
Definition at line 406 of file clntirp.c.
410{
413
414
415
416
417
418 if (FdoData->ActiveIoCount > 0) {
419 if (CurrentTimeIn !=
NULL) {
420 *CurrentTimeIn =
NULL;
421 }
423 }
424
425
426
427
428
429
432
433 if (CurrentTimeIn !=
NULL) {
434 **CurrentTimeIn = CurrentTime;
435 }
436
437 if (idleInterval >= FdoData->IdleInterval) {
439 }
440
442}
FORCEINLINE LARGE_INTEGER ClasspGetCurrentTime(VOID)
ULONGLONG ClasspGetIdleTime(IN PCLASS_PRIVATE_FDO_DATA FdoData, IN LARGE_INTEGER CurrentTime)
Referenced by ClasspCompleteIdleRequest(), ClasspEnqueueIdleRequest(), and ClasspIdleTimerDpc().
◆ ClasspIdleTimerDpc()
Definition at line 468 of file clntirp.c.
474{
481
485
486 if (fdoExtension ==
NULL) {
488 return;
489 }
490
491 fdoData = fdoExtension->PrivateFdoData;
492
494
495
496
497
499 return;
500 }
501
502
503
504
505
506
507 pCurrentTime = ¤tTime;
509
510
511
512
513
514
518 }
519 return;
520 }
521
522
523
524
525
526
530 &idleTime);
531
533
534
535
537 } else {
538
539
540
542 }
543
544
545
546
549 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_TIMER,
"ClasspIdleTimerDpc: Starvation timer. Send one idle request\n"));
551 }
552 return;
553}
#define UNREFERENCED_PARAMETER(P)
LARGE_INTEGER AntiStarvationStartTime
USHORT StarvationDuration
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
◆ ClasspInitializeIdleTimer()
Definition at line 175 of file clntirp.c.
178{
182 ULONG activeIdleIoMax = 1;
183
187 &idlePrioritySupported);
188
189
190 if (idlePrioritySupported ==
FALSE) {
191
192
193
194
195
196
201 return;
202 }
203
207 &idleInterval);
208
210
211
212
214 }
215
227
231 &activeIdleIoMax);
232
233 activeIdleIoMax =
max(activeIdleIoMax, 1);
235
237
238 return;
239}
#define CLASSP_REG_SUBKEY_NAME
#define CLASSP_REG_IDLE_ACTIVE_MAX
#define CLASSP_REG_IDLE_INTERVAL_NAME
#define CLASS_IDLE_INTERVAL
#define CLASS_STARVATION_INTERVAL
#define CLASS_IDLE_INTERVAL_MIN
#define CLASSP_REG_IDLE_PRIORITY_SUPPORTED
KDEFERRED_ROUTINE ClasspIdleTimerDpc
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
#define KeInitializeSpinLock(sl)
BOOLEAN IdlePrioritySupported
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
◆ ClasspServiceIdleRequest()
◆ ClasspStartIdleTimer()
Definition at line 261 of file clntirp.c.
264{
268
270
272
273 if (!timerStarted) {
274
275
276
277
279
280
281
282
283 mstotimer = (-10) * 1000;
284
285
286
287
289
291 dueTime,
292 FdoData->IdleInterval,
293 &FdoData->IdleDpc);
294 }
295 return;
296}
#define InterlockedCompareExchange
#define Int32x32To64(a, b)
BOOLEAN NTAPI KeSetTimerEx(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN LONG Period, IN PKDPC Dpc OPTIONAL)
Referenced by ClasspEnqueueIdleRequest().
◆ ClasspStopIdleTimer()
Definition at line 316 of file clntirp.c.
319{
321
323
325
326 if (timerStarted) {
328 }
329 return;
330}
BOOLEAN NTAPI KeCancelTimer(IN OUT PKTIMER Timer)
Referenced by ClasspDequeueIdleRequest().
◆ DequeueDeferredClientIrp()
Definition at line 113 of file clntirp.c.
116{
120
121
122
123
124
125
128 }
129 else {
132
136 }
137 else {
139 }
141
142 if (listEntry ==
NULL) {
144 }
145 else {
148
149
151 }
152 }
153
155}
LIST_ENTRY DeferredClientIrpList
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Referenced by TransferPktComplete().
◆ EnqueueDeferredClientIrp()
◆ ClasspIdleTimerDpc
KDEFERRED_ROUTINE ClasspIdleTimerDpc |