ReactOS 0.4.16-dev-297-gc569aee
res_card.c File Reference
#include "precomp.h"
Include dependency graph for res_card.c:

Go to the source code of this file.

Macros

#define RESOURCE_COUNT   5
 

Functions

VOID DrvCreateCard1 (_In_ PISAPNP_CARD Card)
 
static VOID DrvTestCard1Dev1QueryResources (_In_ PCM_RESOURCE_LIST ResourceList)
 
static VOID DrvTestCard1Dev1QueryResourceRequirements (_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev1Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
static VOID DrvTestCard1Dev2QueryResources (_In_ PCM_RESOURCE_LIST ResourceList)
 
static VOID DrvTestCard1Dev2QueryResourceRequirements (_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev2Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
static VOID DrvTestCard1Dev3QueryResources (_In_ PCM_RESOURCE_LIST ResourceList)
 
static VOID DrvTestCard1Dev3QueryResourceRequirements (_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev3Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
static VOID DrvTestCard1Dev4QueryResources (_In_ PCM_RESOURCE_LIST ResourceList)
 
static VOID DrvTestCard1Dev4QueryResourceRequirements (_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev4Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
static VOID DrvTestCard1Dev5QueryResources (_In_ PCM_RESOURCE_LIST ResourceList)
 
static VOID DrvTestCard1Dev5QueryResourceRequirements (_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev5Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
static VOID DrvTestCard1Dev6QueryResources (_In_ PCM_RESOURCE_LIST ResourceList)
 
static VOID DrvTestCard1Dev6QueryResourceRequirements (_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev6Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 
VOID DrvTestCard1Dev6ConfigurationResult (_In_ PISAPNP_CARD_LOGICAL_DEVICE LogDev)
 
PCM_RESOURCE_LIST DrvTestCard1Dev6CreateConfigurationResources (VOID)
 
VOID DrvTestCard1Dev7Resources (_In_ PCM_RESOURCE_LIST ResourceList, _In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
 

Variables

static UCHAR DrvpTestPnpRom []
 

Macro Definition Documentation

◆ RESOURCE_COUNT

#define RESOURCE_COUNT   5

Function Documentation

◆ DrvCreateCard1()

VOID DrvCreateCard1 ( _In_ PISAPNP_CARD  Card)

Definition at line 226 of file res_card.c.

228{
230
232
233 /* NOTE: Boot resources of the devices should be made from the requirements */
234
235 /* ********************* DEVICE 1 ********************* */
236 LogDev = &Card->LogDev[0];
237
238 /*
239 * Assign some I/O base but don't enable decodes.
240 * The driver will ignore such I/O configuration.
241 */
242 LogDev->Registers[0x60] = 0x03;
243 LogDev->Registers[0x61] = 0x90;
244
245 /* ******************* DEVICE 2, 3, 4 ***************** */
246 LogDev++;
247 LogDev++;
248 LogDev++;
249
250 /* ********************* DEVICE 5 ********************* */
251 LogDev++;
252
253 /* Enable decodes */
254 LogDev->Registers[0x30] = 0x01;
255
256 /* No DMA is active */
257 LogDev->Registers[0x74] = 0x04;
258 LogDev->Registers[0x75] = 0x04;
259
260 /* Memory 32 Base #0 0xD6000 */
261 LogDev->Registers[0x76] = 0x00;
262 LogDev->Registers[0x77] = 0x0D;
263 LogDev->Registers[0x78] = 0x60;
264 LogDev->Registers[0x79] = 0x00;
265 /* Memory 32 Control #0 - enable range length, 8-bit memory */
266 LogDev->Registers[0x7A] = 0x00;
267 /* Memory 32 Range length #0 0xFFFF8000 (32kB) */
268 LogDev->Registers[0x7B] = 0xFF;
269 LogDev->Registers[0x7C] = 0xFF;
270 LogDev->Registers[0x7D] = 0x80;
271 LogDev->Registers[0x7E] = 0x00;
272
273 /* Memory 32 Base #1 0xC8000 */
274 LogDev->Registers[0x80] = 0x00;
275 LogDev->Registers[0x81] = 0x0C;
276 LogDev->Registers[0x82] = 0x80;
277 LogDev->Registers[0x83] = 0x00;
278 /* Memory 32 Control #1 - enable upper limit, 8-bit memory */
279 LogDev->Registers[0x84] = 0x01;
280 /* Memory 32 Limit #1 0xD0000 (0xC8000 + 0x8000 = 0xD0000) */
281 LogDev->Registers[0x85] = 0x00;
282 LogDev->Registers[0x86] = 0x0D;
283 LogDev->Registers[0x87] = 0x00;
284 LogDev->Registers[0x88] = 0x00;
285
286 /* ********************* DEVICE 6 ********************* */
287 LogDev++;
288
289 /* Enable decodes */
290 LogDev->Registers[0x30] = 0x01;
291
292 /* Memory Base #0 0xA0000 */
293 LogDev->Registers[0x40] = 0x0A;
294 LogDev->Registers[0x41] = 0x00;
295 /*
296 * Memory Control #0 - enable upper limit, 8-bit memory.
297 * The resource descriptor is 16-bit,
298 * so we can test the configuration code that touches this register.
299 */
300 LogDev->Registers[0x42] = 0x01;
301 /* Memory Limit #0 0xA4000 (0xA0000 + 0x4000 = 0xA4000) */
302 LogDev->Registers[0x43] = 0x0A;
303 LogDev->Registers[0x44] = 0x40;
304
305 /* Memory Control #1 - enable range length, 8-bit memory */
306 LogDev->Registers[0x4A] = 0x00;
307 /* Memory Base #1 is disabled */
308
309 /* I/O Base 80 */
310 LogDev->Registers[0x60] = 0x00;
311 LogDev->Registers[0x61] = 0x80;
312
313 /* IRQ 5 low-to-high transition */
314 LogDev->Registers[0x70] = 0x05 | 0xF0; // We add some garbage, must be ignored by the driver
315 LogDev->Registers[0x71] = 0x02;
316
317 /* DMA 6 */
318 LogDev->Registers[0x74] = 0x06 | 0xF8; // Ditto
319
320 /* No DMA is active */
321 LogDev->Registers[0x75] = 0x04;
322
323 /* ********************* DEVICE 7 ********************* */
324
325 /* No resources on purpose */
326}
Definition: card.h:28
VOID IsaBusCreateCard(_Inout_ PISAPNP_CARD Card, _In_ PVOID PnpRom, _In_ ULONG RomSize, _In_ ULONG LogicalDevices)
Definition: isabus.c:439
static UCHAR DrvpTestPnpRom[]
Definition: res_card.c:14

Referenced by DrvCreateCards().

◆ DrvTestCard1Dev1QueryResourceRequirements()

static VOID DrvTestCard1Dev1QueryResourceRequirements ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList)
static

Definition at line 360 of file res_card.c.

362{
364 PIO_RESOURCE_LIST AltList;
365
366 ok(ReqList != NULL, "ReqList is NULL\n");
367 if (ReqList == NULL)
368 {
369 skip("No ReqList\n");
370 return;
371 }
373
374 /************************* LIST 0 ************************/
375
376 AltList = &ReqList->List[0];
377 Descriptor = &AltList->Descriptors[0];
378
379 expect_alt_list_header(AltList, 8UL);
380
382 0,
385 2ul,
386 4ul,
387 0x330ull,
388 0x341ull);
389 Descriptor++;
390
392 0,
395 8ul,
396 1ul,
397 0x600ull,
398 0x787ull);
399 Descriptor++;
400
402 0,
405 12ul,
406 1ul,
407 0x16ull,
408 0x21ull);
409 Descriptor++;
410
412 0,
415 5ul,
416 5ul);
417 Descriptor++;
418
419 // NOTE: The native driver returns CM_RESOURCE_INTERRUPT_LATCHED
420 // and CmResourceShareDeviceExclusive for some reason
421#if 0
423 0,
426 2ul,
427 2ul);
428#else
430 0,
433 2ul,
434 2ul);
435#endif
436 Descriptor++;
437
438#if 0
443 3ul,
444 3ul);
445#else
450 3ul,
451 3ul);
452#endif
453 Descriptor++;
454
455#if 0
460 4ul,
461 4ul);
462#else
467 4ul,
468 4ul);
469#endif
470 Descriptor++;
471
473 0,
476 2ul,
477 2ul);
478 Descriptor++;
479
480 /************************* LIST 1 ************************/
481
482 AltList = (PIO_RESOURCE_LIST)(AltList->Descriptors + AltList->Count);
483 Descriptor = &AltList->Descriptors[0];
484
485 expect_alt_list_header(AltList, 6UL);
486
488 0,
491 2ul,
492 4ul,
493 0x330ull,
494 0x341ull);
495 Descriptor++;
496
498 0,
501 0x4000ul,
502 0xFF40ul,
503 0xC8000ull,
504 0xDFFFFull);
505 Descriptor++;
506
507 // NOTE: The native driver returns CM_RESOURCE_MEMORY_24 only for some reason
508#if 0
510 0,
513 0x4000ul,
514 0x10000ul,
515 0xD4000ull,
516 0xDBFFFull);
517#else
519 0,
522 0x4000ul,
523 0x10000ul,
524 0xD4000ull,
525 0xDBFFFull);
526#endif
527 Descriptor++;
528
530 0,
533 0ul,
534 0ul);
535 Descriptor++;
536
541 1ul,
542 1ul);
543 Descriptor++;
544
546 0,
549 2ul,
550 2ul);
551 Descriptor++;
552
553 /*********************************************************/
554
555 ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
556 ok_int(ReqList->ListSize, (ULONG_PTR)Descriptor - (ULONG_PTR)ReqList);
557}
static SIZE_T GetPoolAllocSize(PVOID MemPtr)
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
@ Isa
Definition: hwresource.cpp:138
#define expect_alt_list_header(AltList, ExpectedCount)
Definition: precomp.h:218
#define expect_requirements_list_header(ReqList, ExpectedIface, ExpectedCount)
Definition: precomp.h:210
#define expect_dma_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedMin, ExpectedMax)
Definition: precomp.h:271
#define expect_port_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedAlign, ExpectedMin, ExpectedMax)
Definition: precomp.h:225
#define expect_irq_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedMin, ExpectedMax)
Definition: precomp.h:251
#define expect_mem_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedAlign, ExpectedMin, ExpectedMax)
Definition: precomp.h:291
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109
#define CM_RESOURCE_DMA_8
Definition: cmtypes.h:131
#define CM_RESOURCE_MEMORY_READ_ONLY
Definition: cmtypes.h:121
#define CM_RESOURCE_PORT_16_BIT_DECODE
Definition: cmtypes.h:112
#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE
Definition: cmtypes.h:143
#define CM_RESOURCE_MEMORY_24
Definition: cmtypes.h:125
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
#define CM_RESOURCE_PORT_10_BIT_DECODE
Definition: cmtypes.h:110
IO_RESOURCE_DESCRIPTOR Descriptors[1]
Definition: iotypes.h:2737
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
@ CmResourceShareDeviceExclusive
Definition: cmtypes.h:241
@ CmResourceShareShared
Definition: cmtypes.h:243
@ CmResourceShareUndetermined
Definition: cmtypes.h:240
struct _IO_RESOURCE_LIST * PIO_RESOURCE_LIST
#define IO_RESOURCE_ALTERNATIVE

Referenced by DrvTestCard1Dev1Resources().

◆ DrvTestCard1Dev1QueryResources()

static VOID DrvTestCard1Dev1QueryResources ( _In_ PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 331 of file res_card.c.

333{
335}
#define ok_eq_pointer(value, expected)
Definition: apitest.h:59
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309

Referenced by DrvTestCard1Dev1Resources().

◆ DrvTestCard1Dev1Resources()

VOID DrvTestCard1Dev1Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 560 of file res_card.c.

563{
566}
static VOID DrvTestCard1Dev1QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:360
static VOID DrvTestCard1Dev1QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:331

Referenced by DrvTestResources().

◆ DrvTestCard1Dev2QueryResourceRequirements()

static VOID DrvTestCard1Dev2QueryResourceRequirements ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList)
static

Definition at line 590 of file res_card.c.

592{
594 PIO_RESOURCE_LIST AltList;
595
596 ok(ReqList != NULL, "ReqList is NULL\n");
597 if (ReqList == NULL)
598 {
599 skip("No ReqList\n");
600 return;
601 }
603
604 /************************* LIST 0 ************************/
605
606 AltList = &ReqList->List[0];
607 Descriptor = &AltList->Descriptors[0];
608
609 expect_alt_list_header(AltList, 2UL);
610
612 0,
615 1ul,
616 1ul,
617 0x500ull,
618 0x506ull);
619 Descriptor++;
620
622 0,
625 1ul,
626 1ul,
627 0x600ull,
628 0x607ull);
629 Descriptor++;
630
631 /************************* LIST 1 ************************/
632
633 AltList = (PIO_RESOURCE_LIST)(AltList->Descriptors + AltList->Count);
634 Descriptor = &AltList->Descriptors[0];
635
636 expect_alt_list_header(AltList, 2UL);
637
639 0,
642 1ul,
643 1ul,
644 0x500ull,
645 0x506ull);
646 Descriptor++;
647
649 0,
652 1ul,
653 1ul,
654 0x700ull,
655 0x708ull);
656 Descriptor++;
657}

Referenced by DrvTestCard1Dev2Resources().

◆ DrvTestCard1Dev2QueryResources()

static VOID DrvTestCard1Dev2QueryResources ( _In_ PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 571 of file res_card.c.

573{
575}

Referenced by DrvTestCard1Dev2Resources().

◆ DrvTestCard1Dev2Resources()

VOID DrvTestCard1Dev2Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 660 of file res_card.c.

663{
666}
static VOID DrvTestCard1Dev2QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:571
static VOID DrvTestCard1Dev2QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:590

Referenced by DrvTestResources().

◆ DrvTestCard1Dev3QueryResourceRequirements()

static VOID DrvTestCard1Dev3QueryResourceRequirements ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList)
static

Definition at line 690 of file res_card.c.

692{
694 PIO_RESOURCE_LIST AltList;
695
696 ok(ReqList != NULL, "ReqList is NULL\n");
697 if (ReqList == NULL)
698 {
699 skip("No ReqList\n");
700 return;
701 }
703
704 /************************* LIST 0 ************************/
705
706 AltList = &ReqList->List[0];
707 Descriptor = &AltList->Descriptors[0];
708
709 expect_alt_list_header(AltList, 2UL);
710
712 0,
715 1ul,
716 1ul,
717 0x600ull,
718 0x607ull);
719 Descriptor++;
720
722 0,
725 1ul,
726 1ul,
727 0x500ull,
728 0x506ull);
729 Descriptor++;
730
731 /************************* LIST 1 ************************/
732
733 AltList = (PIO_RESOURCE_LIST)(AltList->Descriptors + AltList->Count);
734 Descriptor = &AltList->Descriptors[0];
735
736 expect_alt_list_header(AltList, 2UL);
737
739 0,
742 1ul,
743 1ul,
744 0x700ull,
745 0x708ull);
746 Descriptor++;
747
749 0,
752 1ul,
753 1ul,
754 0x500ull,
755 0x506ull);
756 Descriptor++;
757}

Referenced by DrvTestCard1Dev3Resources().

◆ DrvTestCard1Dev3QueryResources()

static VOID DrvTestCard1Dev3QueryResources ( _In_ PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 671 of file res_card.c.

673{
675}

Referenced by DrvTestCard1Dev3Resources().

◆ DrvTestCard1Dev3Resources()

VOID DrvTestCard1Dev3Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 760 of file res_card.c.

763{
766}
static VOID DrvTestCard1Dev3QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:671
static VOID DrvTestCard1Dev3QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:690

Referenced by DrvTestResources().

◆ DrvTestCard1Dev4QueryResourceRequirements()

static VOID DrvTestCard1Dev4QueryResourceRequirements ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList)
static

Definition at line 788 of file res_card.c.

790{
792 PIO_RESOURCE_LIST AltList;
793
794 ok(ReqList != NULL, "ReqList is NULL\n");
795 if (ReqList == NULL)
796 {
797 skip("No ReqList\n");
798 return;
799 }
801
802 /************************* LIST 0 ************************/
803
804 AltList = &ReqList->List[0];
805 Descriptor = &AltList->Descriptors[0];
806
807 expect_alt_list_header(AltList, 1UL);
808
810 0,
813 1ul,
814 1ul,
815 0x600ull,
816 0x607ull);
817 Descriptor++;
818
819 /************************* LIST 1 ************************/
820
821 AltList = (PIO_RESOURCE_LIST)(AltList->Descriptors + AltList->Count);
822 Descriptor = &AltList->Descriptors[0];
823
824 expect_alt_list_header(AltList, 1UL);
825
827 0,
830 1ul,
831 1ul,
832 0x700ull,
833 0x708ull);
834 Descriptor++;
835}

Referenced by DrvTestCard1Dev4Resources().

◆ DrvTestCard1Dev4QueryResources()

static VOID DrvTestCard1Dev4QueryResources ( _In_ PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 771 of file res_card.c.

773{
775}

Referenced by DrvTestCard1Dev4Resources().

◆ DrvTestCard1Dev4Resources()

VOID DrvTestCard1Dev4Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 838 of file res_card.c.

841{
844}
static VOID DrvTestCard1Dev4QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:771
static VOID DrvTestCard1Dev4QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:788

Referenced by DrvTestResources().

◆ DrvTestCard1Dev5QueryResourceRequirements()

static VOID DrvTestCard1Dev5QueryResourceRequirements ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList)
static

Definition at line 904 of file res_card.c.

906{
908 PIO_RESOURCE_LIST AltList;
909 ULONG Count;
910
911 ok(ReqList != NULL, "ReqList is NULL\n");
912 if (ReqList == NULL)
913 {
914 skip("No ReqList\n");
915 return;
916 }
918
919 /************************* LIST 0 ************************/
920
921 AltList = &ReqList->List[0];
922 Descriptor = &AltList->Descriptors[0];
923
925 Count = 3;
926 else
927 Count = 2;
929
930 /* TODO: Should we support this? */
932 {
935 0,
937 0x2000ul,
938 0ul,
939 0ul);
940 Descriptor++;
941 }
942
944 0,
947 0x8000ul,
948 0x100ul,
949 0xD0000ull,
950 0xE7FFFull);
951 Descriptor++;
952
954 0,
957 0x8000ul,
958 0x1ul,
959 0xC8000ull,
960 0xCFFFFull);
961 Descriptor++;
962
963 /*********************************************************/
964
965 ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
966 ok_int(ReqList->ListSize, (ULONG_PTR)Descriptor - (ULONG_PTR)ReqList);
967}
#define CmResourceTypeConfigData
Definition: hwresource.cpp:130
#define expect_cfg_req(Desc, ExpectedOption, ExpectedFlags, ExpectedShare, ExpectedPriority, ExpectedRes1, ExpectedRes2)
Definition: precomp.h:317
int Count
Definition: noreturn.cpp:7
uint32_t ULONG
Definition: typedefs.h:59
#define IO_RESOURCE_PREFERRED

Referenced by DrvTestCard1Dev5Resources().

◆ DrvTestCard1Dev5QueryResources()

static VOID DrvTestCard1Dev5QueryResources ( _In_ PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 854 of file res_card.c.

856{
858
859 ok(ResourceList != NULL, "ResourceList is NULL\n");
860 if (ResourceList == NULL)
861 {
862 skip("No ResourceList\n");
863 return;
864 }
866
867 Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[0];
868
872 0x8000ul,
873 0xD6000ull);
874 Descriptor++;
875
879 0x8000ul,
880 0xC8000ull);
881 Descriptor++;
882
883 /*********************************************************/
884
886}
#define ok_eq_size(value, expected)
Definition: apitest.h:69
#define expect_resource_list_header(ResourceList, ExpectedIface, ExpectedCount)
Definition: precomp.h:201
#define expect_mem_res(Desc, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedStart)
Definition: precomp.h:394

Referenced by DrvTestCard1Dev5Resources().

◆ DrvTestCard1Dev5Resources()

VOID DrvTestCard1Dev5Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 970 of file res_card.c.

973{
976}
static VOID DrvTestCard1Dev5QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:904
static VOID DrvTestCard1Dev5QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:854

Referenced by DrvTestResources().

◆ DrvTestCard1Dev6ConfigurationResult()

VOID DrvTestCard1Dev6ConfigurationResult ( _In_ PISAPNP_CARD_LOGICAL_DEVICE  LogDev)

Definition at line 1171 of file res_card.c.

1173{
1174 ULONG i, Offset;
1175
1176 /* Memory Base #0 = 0xA2000 */
1177 ok_eq_int(LogDev->Registers[0x40], 0x0A);
1178 ok_eq_int(LogDev->Registers[0x41], 0x20);
1179 /* Memory Control #0 = upper limit enabled, 16-bit memory */
1180 ok_eq_int(LogDev->Registers[0x42], 0x03);
1181 /* Memory Upper limit #0 = 0xA3000 (0xA2000 + 0x1000) */
1182 ok_eq_int(LogDev->Registers[0x43], 0x0A);
1183 ok_eq_int(LogDev->Registers[0x44], 0x30);
1184
1185 /* Memory Base #1 = 0x89000 */
1186 ok_eq_int(LogDev->Registers[0x48], 0x08);
1187 ok_eq_int(LogDev->Registers[0x49], 0x90);
1188 /* Memory Control #1 = range length enabled, 8-bit memory */
1189 ok_eq_int(LogDev->Registers[0x4A], 0x00);
1190 /* Memory Upper limit #1 = 0xFFFF00 (0x100) */
1191 ok_eq_int(LogDev->Registers[0x4B], 0xFF);
1192 ok_eq_int(LogDev->Registers[0x4C], 0xFF);
1193
1194 /* Memory #2-3 should be disabled */
1195 for (i = 2; i < 4; ++i)
1196 {
1197 Offset = 0x40 + i * 8;
1198
1199 /* Memory Base */
1200 ok_eq_int(LogDev->Registers[Offset ], 0x00);
1201 ok_eq_int(LogDev->Registers[Offset + 1], 0x00);
1202 /* Memory Control */
1203 ok_eq_int(LogDev->Registers[Offset + 2], 0x00);
1204 /* Memory Upper limit or range length */
1205 ok_eq_int(LogDev->Registers[Offset + 3], 0x00);
1206 ok_eq_int(LogDev->Registers[Offset + 4], 0x00);
1207 }
1208
1209 /* Memory 32 #0-3 should be disabled */
1210 for (i = 0; i < 4; ++i)
1211 {
1212 if (i == 0)
1213 Offset = 0x76;
1214 else
1215 Offset = 0x70 + i * 16;
1216
1217 /* Memory 32 Base */
1218 ok_eq_int(LogDev->Registers[Offset ], 0x00);
1219 ok_eq_int(LogDev->Registers[Offset + 1], 0x00);
1220 ok_eq_int(LogDev->Registers[Offset + 2], 0x00);
1221 ok_eq_int(LogDev->Registers[Offset + 3], 0x00);
1222 /* Memory 32 Control */
1223 ok_eq_int(LogDev->Registers[Offset + 4], 0x00);
1224 /* Memory 32 Upper limit or range length */
1225 ok_eq_int(LogDev->Registers[Offset + 5], 0x00);
1226 ok_eq_int(LogDev->Registers[Offset + 6], 0x00);
1227 ok_eq_int(LogDev->Registers[Offset + 7], 0x00);
1228 ok_eq_int(LogDev->Registers[Offset + 8], 0x00);
1229 }
1230
1231 /* I/O Base #0 = 0x80 */
1232 ok_eq_int(LogDev->Registers[0x60], 0x00);
1233 ok_eq_int(LogDev->Registers[0x61], 0x80);
1234
1235 /* I/O Base #1-6 should be disabled */
1236 for (i = 1; i < 6; ++i)
1237 {
1238 Offset = 0x60 + i * 2;
1239
1240 ok_eq_int(LogDev->Registers[Offset ], 0x00);
1241 ok_eq_int(LogDev->Registers[Offset + 1], 0x00);
1242 }
1243
1244 /* IRQ select #0 = IRQ 5 low-to-high transition */
1245 ok_eq_int(LogDev->Registers[0x70], 0x05);
1246 ok_eq_int(LogDev->Registers[0x71], 0x02);
1247
1248 /* IRQ select #1 should be disabled */
1249 ok_eq_int(LogDev->Registers[0x72], 0x00);
1250 ok_eq_int(LogDev->Registers[0x73], 0x00);
1251
1252 /* DMA select #0 = DMA 6 */
1253 ok_eq_int(LogDev->Registers[0x74], 0x06);
1254
1255 /* DMA select #1 = No DMA is active */
1256 ok_eq_int(LogDev->Registers[0x75], 0x04);
1257}
#define ok_eq_int(value, expected)
Definition: apitest.h:60
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101

Referenced by DrvTestResources().

◆ DrvTestCard1Dev6CreateConfigurationResources()

PCM_RESOURCE_LIST DrvTestCard1Dev6CreateConfigurationResources ( VOID  )

Definition at line 1260 of file res_card.c.

1261{
1264 ULONG ListSize;
1265
1266#define RESOURCE_COUNT 5
1267 /*
1268 * Make the following resources from the requirements:
1269 *
1270 * FullList Count 1
1271 * List #0 Iface 1 Bus #0 Ver.1 Rev.1 Count 5
1272 * [1:11] MEM: 0:A2000 Len 1000
1273 * [1:11] MEM: 0:89000 Len 100
1274 * [0:0] DMA: Channel 6 Port 0 Res 0
1275 * [1:1] INT: Lev 5 Vec 3F Aff FFFFFFFF
1276 * [1:5] IO: Start 0:80, Len 8
1277 */
1278 ListSize = FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList.PartialDescriptors) +
1279 sizeof(*Descriptor) * RESOURCE_COUNT;
1280
1282 if (ResourceList == NULL)
1283 return NULL;
1284 ResourceList->Count = 1;
1285 ResourceList->List[0].InterfaceType = Isa;
1286 ResourceList->List[0].BusNumber = 0;
1287 ResourceList->List[0].PartialResourceList.Version = 1;
1288 ResourceList->List[0].PartialResourceList.Revision = 1;
1289 ResourceList->List[0].PartialResourceList.Count = RESOURCE_COUNT;
1290
1291 Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[0];
1292
1294 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1296 Descriptor->u.Memory.Start.LowPart = 0xA2000;
1297 Descriptor->u.Memory.Length = 0x1000;
1298 ++Descriptor;
1299
1301 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1303 Descriptor->u.Memory.Start.LowPart = 0x89000;
1304 Descriptor->u.Memory.Length = 0x100;
1305 ++Descriptor;
1306
1308 Descriptor->ShareDisposition = CmResourceShareUndetermined;
1310 Descriptor->u.Dma.Channel = 6;
1311 ++Descriptor;
1312
1314 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1316 Descriptor->u.Interrupt.Level = 5;
1317 Descriptor->u.Interrupt.Vector = 0x3F;
1318 Descriptor->u.Interrupt.Affinity = (KAFFINITY)-1;
1319 ++Descriptor;
1320
1322 Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1324 Descriptor->u.Memory.Start.LowPart = 0x80;
1325 Descriptor->u.Memory.Length = 8;
1326
1327 return ResourceList;
1328}
#define GetProcessHeap()
Definition: compat.h:736
ULONG_PTR KAFFINITY
Definition: compat.h:85
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
#define CmResourceTypeDma
Definition: hwresource.cpp:126
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define RESOURCE_COUNT
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by DrvTestResources().

◆ DrvTestCard1Dev6QueryResourceRequirements()

static VOID DrvTestCard1Dev6QueryResourceRequirements ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList)
static

Definition at line 1058 of file res_card.c.

1060{
1062 PIO_RESOURCE_LIST AltList;
1063 ULONG Count;
1064
1065 ok(ReqList != NULL, "ReqList is NULL\n");
1066 if (ReqList == NULL)
1067 {
1068 skip("No ReqList\n");
1069 return;
1070 }
1071 expect_requirements_list_header(ReqList, Isa, 1UL);
1072
1073 /************************* LIST 0 ************************/
1074
1075 AltList = &ReqList->List[0];
1076 Descriptor = &AltList->Descriptors[0];
1077
1079 Count = 6;
1080 else
1081 Count = 5;
1082 expect_alt_list_header(AltList, Count);
1083
1084 /* TODO: Should we support this? */
1086 {
1089 0,
1091 0x2000ul,
1092 0ul,
1093 0ul);
1094 Descriptor++;
1095 }
1096
1098 0,
1101 0x1000ul,
1102 0x4ul,
1103 0xA0000ull,
1104 0xA4FFFull);
1105 Descriptor++;
1106
1107 // NOTE: The native driver returns CM_RESOURCE_MEMORY_24 only for some reason
1108#if 0
1110 0,
1113 0x100ul,
1114 0x4ul,
1115 0x80000ull,
1116 0x900FFull);
1117#else
1119 0,
1122 0x100ul,
1123 0x4ul,
1124 0x80000ull,
1125 0x900FFull);
1126#endif
1127 Descriptor++;
1128
1130 0,
1133 6ul,
1134 6ul);
1135 Descriptor++;
1136
1138 0,
1141 5ul,
1142 5ul);
1143 Descriptor++;
1144
1146 0,
1149 8ul,
1150 1ul,
1151 0x80ull,
1152 0x87ull);
1153 Descriptor++;
1154
1155 /*********************************************************/
1156
1157 ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
1158 ok_int(ReqList->ListSize, (ULONG_PTR)Descriptor - (ULONG_PTR)ReqList);
1159}

Referenced by DrvTestCard1Dev6Resources().

◆ DrvTestCard1Dev6QueryResources()

static VOID DrvTestCard1Dev6QueryResources ( _In_ PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 988 of file res_card.c.

990{
992
993 ok(ResourceList != NULL, "ResourceList is NULL\n");
994 if (ResourceList == NULL)
995 {
996 skip("No ResourceList\n");
997 return;
998 }
1000
1001 Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[0];
1002
1006 8ul,
1007 0x80ull);
1008 Descriptor++;
1009
1013 5ul,
1014 5ul,
1015 (KAFFINITY)-1);
1016 Descriptor++;
1017
1019 0,
1021 6ul);
1022 Descriptor++;
1023
1027 0x4000ul,
1028 0xA0000ull);
1029 Descriptor++;
1030
1031 /*********************************************************/
1032
1034}
#define expect_irq_res(Desc, ExpectedFlags, ExpectedShare, ExpectedLevel, ExpectedVector, ExpectedAffinity)
Definition: precomp.h:357
#define expect_port_res(Desc, ExpectedFlags, ExpectedShare, ExpectedLength, ExpectedStart)
Definition: precomp.h:340
#define expect_dma_res(Desc, ExpectedFlags, ExpectedShare, ExpectedChannel)
Definition: precomp.h:375

Referenced by DrvTestCard1Dev6Resources().

◆ DrvTestCard1Dev6Resources()

VOID DrvTestCard1Dev6Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 1162 of file res_card.c.

1165{
1168}
static VOID DrvTestCard1Dev6QueryResources(_In_ PCM_RESOURCE_LIST ResourceList)
Definition: res_card.c:988
static VOID DrvTestCard1Dev6QueryResourceRequirements(_In_ PIO_RESOURCE_REQUIREMENTS_LIST ReqList)
Definition: res_card.c:1058

Referenced by DrvTestResources().

◆ DrvTestCard1Dev7Resources()

VOID DrvTestCard1Dev7Resources ( _In_ PCM_RESOURCE_LIST  ResourceList,
_In_ PIO_RESOURCE_REQUIREMENTS_LIST  ReqList 
)

Definition at line 1331 of file res_card.c.

1334{
1335 /* No resources */
1337 ok_eq_pointer(ReqList, NULL);
1338}

Referenced by DrvTestResources().

Variable Documentation

◆ DrvpTestPnpRom

UCHAR DrvpTestPnpRom[]
static

Definition at line 14 of file res_card.c.

Referenced by DrvCreateCard1().