Slawomir
2004-02-05 19:02:08 UTC
I am writing an XP driver for a multiport serial PCI card. I am using
mf.sys and VaryingResourceMap to split the card BAR0 memory range
between the serial ports (memory mapped). I can see the ports
enumerated in Device Manager as expected. However, when I get
IRP_MN_START_DEVICE, the CmResourceTypeMemory resource in
pIrpStack->Parameters.StartDevice.AllocatedResourcesTranslated->
List[0].PartialResourceList has u.Memory.Start identical for all
(four) child devices.
The Length member is 80, as expected.
It looks like PnP manager (or mf.sys?) assigns all child devices the
same memory range that is last 80 bytes of the PCI card memory range.
The line in the inf file where I define the Varying Resource Map looks
as follows:
HKR,Child01,VaryingResourceMap,1,00, 00,01,00,00, 80,00,00,00
I understand that this means that I want memory on BAR0 at offset
0x100 bytes of length 0x80 bytes to be assigned to Child01. The full
inf file is included at the end of this post.
When I get IRP_MN_QUERY_RESOURCE_REQUIREMENTS I fill the memory
resource requirement as follows:
descriptor->Type = CmResourceTypeMemory;
descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
descriptor->Flags = CM_RESOURCE_MEMORY_READ_WRITE;
descriptor->u.Memory.Length = SERIAL_REGISTER_SPAN +
SERIAL_STATUS_LENGTH;
//7*0x10 + 1*0x10
descriptor->u.Memory.Alignment = 0x1;
descriptor->u.Memory.MinimumAddress.QuadPart = 0;
descriptor->u.Memory.MaximumAddress.QuadPart = 0xFFFFFFFFFFFFFFFF;
I do not modify this memory requirement when I get
IRP_MN_FILTER_RESOURCE_REQUIREMENTS.
What can I be doing wrong?
Any help is appreciated.
Slawek
Here is the full inf file:
; xrsio.inf
;
; Windows XP driver for MyCompany serial cards
;
; Copyright 2004, MyCompany, Inc.
[Version]
Signature = "$Windows NT$"
Class=Multifunction
ClassGUID={4d36e971-e325-11ce-bfc1-08002be10318}
Provider=%MyCompany%
LayoutFile=layout.inf
CatalogFile=cert.cat
DriverVer= 01/26/2004,1.0.0
[ControlFlags]
ExcludeFromSelect=*
[Manufacturer]
%MyCompany%=MyCompany
[MyCompany]
%POctalDesc%=POctal_Inst,PCI\VEN_124B&DEV_0001&SUBSYS_0308124B
%POctalDesc%=POctal_Inst,PCI\VEN_124B&DEV_0001&SUBSYS_0408124B
[POctal_Inst]
Include = mf.inf
Needs = MFINSTALL.mf
[POctal_Inst.HW]
AddReg=POctal_Inst.RegHW
[POctal_Inst.Services]
Include = mf.inf
Needs = MFINSTALL.mf.Services
[POctal_Inst.RegHW]
HKR,Child00,HardwareID,,MyCompanyXR16C854PORT
HKR,Child00,VaryingResourceMap,1,00, 00,00,00,00, 80,00,00,00
HKR,Child00,ResourceMap,1,06
HKR,Child01,HardwareID,,MyCompanyXR16C854PORT
HKR,Child01,VaryingResourceMap,1,00, 00,01,00,00, 80,00,00,00
HKR,Child01,ResourceMap,1,06
HKR,Child02,HardwareID,,MyCompanyXR16C854PORT
HKR,Child02,VaryingResourceMap,1,00, 00,02,00,00, 80,00,00,00
HKR,Child02,ResourceMap,1,06
HKR,Child03,HardwareID,,MyCompanyXR16C854PORT
HKR,Child03,VaryingResourceMap,1,00, 00,03,00,00, 80,00,00,00
HKR,Child03,ResourceMap,1,06
[Strings]
; *******Localizable Strings*******
MyCompany= "MyCompany, Inc."
Desc_x860= "PETER"
POctalDesc= "P-Octal "
mf.sys and VaryingResourceMap to split the card BAR0 memory range
between the serial ports (memory mapped). I can see the ports
enumerated in Device Manager as expected. However, when I get
IRP_MN_START_DEVICE, the CmResourceTypeMemory resource in
pIrpStack->Parameters.StartDevice.AllocatedResourcesTranslated->
List[0].PartialResourceList has u.Memory.Start identical for all
(four) child devices.
The Length member is 80, as expected.
It looks like PnP manager (or mf.sys?) assigns all child devices the
same memory range that is last 80 bytes of the PCI card memory range.
The line in the inf file where I define the Varying Resource Map looks
as follows:
HKR,Child01,VaryingResourceMap,1,00, 00,01,00,00, 80,00,00,00
I understand that this means that I want memory on BAR0 at offset
0x100 bytes of length 0x80 bytes to be assigned to Child01. The full
inf file is included at the end of this post.
When I get IRP_MN_QUERY_RESOURCE_REQUIREMENTS I fill the memory
resource requirement as follows:
descriptor->Type = CmResourceTypeMemory;
descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
descriptor->Flags = CM_RESOURCE_MEMORY_READ_WRITE;
descriptor->u.Memory.Length = SERIAL_REGISTER_SPAN +
SERIAL_STATUS_LENGTH;
//7*0x10 + 1*0x10
descriptor->u.Memory.Alignment = 0x1;
descriptor->u.Memory.MinimumAddress.QuadPart = 0;
descriptor->u.Memory.MaximumAddress.QuadPart = 0xFFFFFFFFFFFFFFFF;
I do not modify this memory requirement when I get
IRP_MN_FILTER_RESOURCE_REQUIREMENTS.
What can I be doing wrong?
Any help is appreciated.
Slawek
Here is the full inf file:
; xrsio.inf
;
; Windows XP driver for MyCompany serial cards
;
; Copyright 2004, MyCompany, Inc.
[Version]
Signature = "$Windows NT$"
Class=Multifunction
ClassGUID={4d36e971-e325-11ce-bfc1-08002be10318}
Provider=%MyCompany%
LayoutFile=layout.inf
CatalogFile=cert.cat
DriverVer= 01/26/2004,1.0.0
[ControlFlags]
ExcludeFromSelect=*
[Manufacturer]
%MyCompany%=MyCompany
[MyCompany]
%POctalDesc%=POctal_Inst,PCI\VEN_124B&DEV_0001&SUBSYS_0308124B
%POctalDesc%=POctal_Inst,PCI\VEN_124B&DEV_0001&SUBSYS_0408124B
[POctal_Inst]
Include = mf.inf
Needs = MFINSTALL.mf
[POctal_Inst.HW]
AddReg=POctal_Inst.RegHW
[POctal_Inst.Services]
Include = mf.inf
Needs = MFINSTALL.mf.Services
[POctal_Inst.RegHW]
HKR,Child00,HardwareID,,MyCompanyXR16C854PORT
HKR,Child00,VaryingResourceMap,1,00, 00,00,00,00, 80,00,00,00
HKR,Child00,ResourceMap,1,06
HKR,Child01,HardwareID,,MyCompanyXR16C854PORT
HKR,Child01,VaryingResourceMap,1,00, 00,01,00,00, 80,00,00,00
HKR,Child01,ResourceMap,1,06
HKR,Child02,HardwareID,,MyCompanyXR16C854PORT
HKR,Child02,VaryingResourceMap,1,00, 00,02,00,00, 80,00,00,00
HKR,Child02,ResourceMap,1,06
HKR,Child03,HardwareID,,MyCompanyXR16C854PORT
HKR,Child03,VaryingResourceMap,1,00, 00,03,00,00, 80,00,00,00
HKR,Child03,ResourceMap,1,06
[Strings]
; *******Localizable Strings*******
MyCompany= "MyCompany, Inc."
Desc_x860= "PETER"
POctalDesc= "P-Octal "