equal
deleted
inserted
replaced
60 VA_START(list,aFmt); |
60 VA_START(list,aFmt); |
61 Kern::AppendFormat(aBuf,aFmt,list); |
61 Kern::AppendFormat(aBuf,aFmt,list); |
62 } |
62 } |
63 #endif |
63 #endif |
64 |
64 |
65 _LIT(KTestDmaLddName, "TestDmaV2"); |
65 _LIT(KTestDmaLddNameSim, "TestDmaV2Sim"); |
|
66 _LIT(KTestDmaLddNameHw, "TestDmaV2"); |
|
67 #ifdef __DMASIM__ |
|
68 const TPtrC KTestDmaLddName = KTestDmaLddNameSim(); |
|
69 #else |
|
70 const TPtrC KTestDmaLddName = KTestDmaLddNameHw(); |
|
71 #endif |
66 |
72 |
67 inline TVersion TestDmaLddVersion() { return TVersion(1, 0, 1); } |
73 inline TVersion TestDmaLddVersion() { return TVersion(1, 0, 1); } |
68 |
74 |
69 TInt Log2(TInt aNum); |
75 TInt Log2(TInt aNum); |
70 |
76 |
442 TInt ChannelResume(TUint aDriverCookie) |
448 TInt ChannelResume(TUint aDriverCookie) |
443 { |
449 { |
444 return DoControl(EResumeChannel, reinterpret_cast<TAny*>(aDriverCookie)); |
450 return DoControl(EResumeChannel, reinterpret_cast<TAny*>(aDriverCookie)); |
445 } |
451 } |
446 |
452 |
|
453 TInt ChannelLinking(TUint aDriverCookie) |
|
454 { |
|
455 return DoControl(ELinkChannel, reinterpret_cast<TAny*>(aDriverCookie)); |
|
456 } |
|
457 |
|
458 TInt ChannelUnLinking(TUint aDriverCookie) |
|
459 { |
|
460 return DoControl(EUnlinkChannel, reinterpret_cast<TAny*>(aDriverCookie)); |
|
461 } |
|
462 |
447 TInt ChannelCaps(TUint aDriverCookie, SDmacCaps& aChannelCaps) |
463 TInt ChannelCaps(TUint aDriverCookie, SDmacCaps& aChannelCaps) |
448 { |
464 { |
449 TDmacTestCaps caps; |
465 TDmacTestCaps caps; |
450 TInt r = ChannelCaps(aDriverCookie, caps); |
466 TInt r = ChannelCaps(aDriverCookie, caps); |
451 aChannelCaps = caps; |
467 aChannelCaps = caps; |
458 return DoControl(EChannelCaps, reinterpret_cast<TAny*>(aDriverCookie), &package); |
474 return DoControl(EChannelCaps, reinterpret_cast<TAny*>(aDriverCookie), &package); |
459 } |
475 } |
460 |
476 |
461 TInt Open() |
477 TInt Open() |
462 { |
478 { |
463 return DoCreate(KTestDmaLddName,TestDmaLddVersion(), 0, NULL, NULL, EOwnerThread); |
479 TInt r = KErrNone; |
464 } |
480 r = DoCreate(KTestDmaLddNameHw,TestDmaLddVersion(), 0, NULL, NULL, EOwnerThread); |
465 |
481 RDebug::Printf("RDmaSession::Open returned %d", r); |
|
482 return r; |
|
483 } |
|
484 |
|
485 TInt OpenSim() |
|
486 { |
|
487 return DoCreate(KTestDmaLddNameSim,TestDmaLddVersion(), 0, NULL, NULL, EOwnerThread); |
|
488 } |
466 |
489 |
467 TInt RequestCreateOld(TUint aChannelCookie, TUint& aRequestCookie, TUint aMaxTransferSize=0) |
490 TInt RequestCreateOld(TUint aChannelCookie, TUint& aRequestCookie, TUint aMaxTransferSize=0) |
468 { |
491 { |
469 return DoRequestCreate(aChannelCookie, EFalse, aMaxTransferSize, aRequestCookie); |
492 return DoRequestCreate(aChannelCookie, EFalse, aMaxTransferSize, aRequestCookie); |
470 } |
493 } |
481 } |
504 } |
482 |
505 |
483 TInt RequestFragmentCount(TUint aRequestCookie) |
506 TInt RequestFragmentCount(TUint aRequestCookie) |
484 { |
507 { |
485 return DoControl(EFragmentCount, reinterpret_cast<TAny*>(aRequestCookie)); |
508 return DoControl(EFragmentCount, reinterpret_cast<TAny*>(aRequestCookie)); |
|
509 } |
|
510 |
|
511 TInt RequestEnableDstElementCounting(TUint aRequestCookie) |
|
512 { |
|
513 return DoControl(EEnableDstElementCounting, reinterpret_cast<TAny*>(aRequestCookie)); |
|
514 } |
|
515 |
|
516 TInt RequestEnableSrcElementCounting(TUint aRequestCookie) |
|
517 { |
|
518 return DoControl(EEnableSrcElementCounting, reinterpret_cast<TAny*>(aRequestCookie)); |
|
519 } |
|
520 |
|
521 TInt RequestDisableDstElementCounting(TUint aRequestCookie) |
|
522 { |
|
523 return DoControl(EDisableDstElementCounting, reinterpret_cast<TAny*>(aRequestCookie)); |
|
524 } |
|
525 |
|
526 TInt RequestDisableSrcElementCounting(TUint aRequestCookie) |
|
527 { |
|
528 return DoControl(EDisableSrcElementCounting, reinterpret_cast<TAny*>(aRequestCookie)); |
|
529 } |
|
530 |
|
531 TInt RequestTotalNumDstElementsTransferred(TUint aRequestCookie) |
|
532 { |
|
533 return DoControl(ETotalNumDstElementsTransferred, reinterpret_cast<TAny*>(aRequestCookie)); |
|
534 } |
|
535 |
|
536 TInt RequestTotalNumSrcElementsTransferred(TUint aRequestCookie) |
|
537 { |
|
538 return DoControl(ETotalNumSrcElementsTransferred, reinterpret_cast<TAny*>(aRequestCookie)); |
486 } |
539 } |
487 |
540 |
488 /** |
541 /** |
489 Will fragment a DMA request using the legacy API |
542 Will fragment a DMA request using the legacy API |
490 */ |
543 */ |
569 TInt OpenSharedChunk(RChunk& aChunk) |
622 TInt OpenSharedChunk(RChunk& aChunk) |
570 { |
623 { |
571 TUint chunkHandle = DoControl(EOpenSharedChunk); |
624 TUint chunkHandle = DoControl(EOpenSharedChunk); |
572 return aChunk.SetReturnedHandle(chunkHandle); |
625 return aChunk.SetReturnedHandle(chunkHandle); |
573 } |
626 } |
574 |
627 |
575 TInt GetTestInfo(TDmaV2TestInfo& aInfo) |
628 TInt GetTestInfo(TDmaV2TestInfo& aInfo) |
576 { |
629 { |
577 TPckg<TDmaV2TestInfo> package(aInfo); |
630 TPckg<TDmaV2TestInfo> package(aInfo); |
578 return DoControl(EGetTestInfo, &package); |
631 return DoControl(EGetTestInfo, &package); |
579 } |
632 } |
580 |
633 |
581 static void SelfTest(); |
634 static void SelfTest(TBool aSimulatedDmac); |
582 |
635 |
583 static void ApiTest(); |
636 static void ApiTest(); |
584 #endif // __KERNEL_MODE__ |
637 #endif // __KERNEL_MODE__ |
585 |
638 |
586 private: |
639 private: |
587 |
640 |
589 { |
642 { |
590 TRequestCreateArgs args(aChannelCookie, aNewStyle, aMaxTransferSize); |
643 TRequestCreateArgs args(aChannelCookie, aNewStyle, aMaxTransferSize); |
591 TPckgC<TRequestCreateArgs> package(args); |
644 TPckgC<TRequestCreateArgs> package(args); |
592 return DoControl(ERequestOpen, &package, &aRequestCookie); |
645 return DoControl(ERequestOpen, &package, &aRequestCookie); |
593 } |
646 } |
594 |
647 |
595 |
|
596 struct TRequestCreateArgs |
648 struct TRequestCreateArgs |
597 { |
649 { |
598 TRequestCreateArgs(TUint aChannelCookie, TBool aNewStyle, TUint aMaxFragmentSize) |
650 TRequestCreateArgs(TUint aChannelCookie, TBool aNewStyle, TUint aMaxFragmentSize) |
599 :iChannelCookie(aChannelCookie), iNewStyle(aNewStyle), iMaxFragmentSize(aMaxFragmentSize) |
651 :iChannelCookie(aChannelCookie), iNewStyle(aNewStyle), iMaxFragmentSize(aMaxFragmentSize) |
600 {} |
652 {} |
662 EGetTestInfo, |
714 EGetTestInfo, |
663 EIsQueueEmpty, |
715 EIsQueueEmpty, |
664 EIsOpened, |
716 EIsOpened, |
665 EIsrRedoRequest, |
717 EIsrRedoRequest, |
666 ECancelAllChannel, |
718 ECancelAllChannel, |
667 EQueueRequestWithReque |
719 EQueueRequestWithReque, |
|
720 ELinkChannel, |
|
721 EUnlinkChannel, |
|
722 EEnableDstElementCounting, |
|
723 EEnableSrcElementCounting, |
|
724 EDisableDstElementCounting, |
|
725 EDisableSrcElementCounting, |
|
726 ETotalNumDstElementsTransferred, |
|
727 ETotalNumSrcElementsTransferred, |
668 }; |
728 }; |
669 }; |
729 }; |
670 #endif // __D_DMA2_H__ |
730 #endif // __D_DMA2_H__ |