How to read ACPI space method from USB hub driver to build containerID

Hello Experts

My USB controller is PCI enumerated device.

There is requirement in windows w.r.t to BusQueryContainerID implementation. When we get a call to BusQueryContainerID, we need to follow steps specified in the link https://msdn.microsoft.com/en-in/library/windows/hardware/ff546243(v=vs.85).aspx

But i am stuck at the place on how to read the ACPI space methods like _UPC and _PLD method for devices connected to port. Consider the case we have a device connected to PORT5, when i get a call to BusQueryContainerID , how can i read the ACPI code for this specific port ?
sample ACPI code :
Device(PRT5)
{
Name(_ADR,0x0000005)
Name(_UPC, Package(){
0x00, // Port is no connectable
0xFF, // Proprietary connector
0x00000000, // Reserved 0 - must be zero
0x00000000}) // Reserved 1 - must be zero
Device(IUBT)//USB Hub2 BT
{
Name(_ADR,0x00000001)
Name(_STA, 0xF)
Name(_UPC, Package(){
0xFF, // Port is connectable
0xFF, // Proprietary connector
0x00000000, // Reserved 0 - must be zero
0x00000000}) // Reserved 1 - must be zero
Method(_PLD,0,Serialized) {
Name(PLDP, Package() {
Buffer(0x14){
0x82,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x24,0x01,0x00,0x00,//{[77:74]Unknow,[73:72]Left,[70:71]Lower,[69:67]Left,[64]Visiable}
0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF}
})
Return (PLDP)
}
}
Device(UCAM)//USB Hub2 Webcam
{
Name(_ADR,0x0000002)
Name(_STA, 0xF)
Name(_UPC, Package(){
0xFF, // Port is connectable
0xFF, // Proprietary connector
0x00000000, // Reserved 0 - must be zero
0x00000000}) // Reserved 1 - must be zero
Method(_PLD,0,Serialized) {
Name(PLDP, Package() {
Buffer(0x14){
0x82,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x24,0x01,0x00,0x01,//{[77:74]Unknow,[73:72]Left,[70:71]Lower,[69:67]Left,[64]Visiable}
0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF}
})
Return (PLDP)
}

Thanks,
Jagadish

Doesn’t the in box controller stack take care of this?

Get Outlook for Androidhttps:

On Tue, Jul 26, 2016 at 8:02 AM -0700, “xxxxx@gmail.com” > wrote:

Hello Experts

My USB controller is PCI enumerated device.

There is requirement in windows w.r.t to BusQueryContainerID implementation. When we get a call to BusQueryContainerID, we need to follow steps specified in the link https://msdn.microsoft.com/en-in/library/windows/hardware/ff546243(v=vs.85).aspx

But i am stuck at the place on how to read the ACPI space methods like _UPC and _PLD method for devices connected to port. Consider the case we have a device connected to PORT5, when i get a call to BusQueryContainerID , how can i read the ACPI code for this specific port ?
sample ACPI code :
Device(PRT5)
{
Name(_ADR,0x0000005)
Name(_UPC, Package(){
0x00, // Port is no connectable
0xFF, // Proprietary connector
0x00000000, // Reserved 0 - must be zero
0x00000000}) // Reserved 1 - must be zero
Device(IUBT)//USB Hub2 BT
{
Name(_ADR,0x00000001)
Name(_STA, 0xF)
Name(_UPC, Package(){
0xFF, // Port is connectable
0xFF, // Proprietary connector
0x00000000, // Reserved 0 - must be zero
0x00000000}) // Reserved 1 - must be zero
Method(_PLD,0,Serialized) {
Name(PLDP, Package() {
Buffer(0x14){
0x82,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x24,0x01,0x00,0x00,//{[77:74]Unknow,[73:72]Left,[70:71]Lower,[69:67]Left,[64]Visiable}
0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF}
})
Return (PLDP)
}
}
Device(UCAM)//USB Hub2 Webcam
{
Name(_ADR,0x0000002)
Name(_STA, 0xF)
Name(_UPC, Package(){
0xFF, // Port is connectable
0xFF, // Proprietary connector
0x00000000, // Reserved 0 - must be zero
0x00000000}) // Reserved 1 - must be zero
Method(_PLD,0,Serialized) {
Name(PLDP, Package() {
Buffer(0x14){
0x82,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x24,0x01,0x00,0x01,//{[77:74]Unknow,[73:72]Left,[70:71]Lower,[69:67]Left,[64]Visiable}
0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF}
})
Return (PLDP)
}

Thanks,
Jagadish


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:></https:>

Hello Doron,

For In box driver MS driver takes care of it.

But for Windows 7 we use our driver for xHCI controller. So i need to implement this …
So i wanted to know how i must implement this.

regards,
Jagadish Hadimani

xxxxx@gmail.com wrote:

My USB controller is PCI enumerated device.

So, are you writing a host controller driver? Why? The purpose for
host controller specifications (like UHCI, EHCI, XHCI) is that you don’t
have to write a driver. If you follow the spec, the system already
knows how to talk to you.

There is requirement in windows w.r.t to BusQueryContainerID implementation. When we get a call to BusQueryContainerID, we need to follow steps specified in the link https://msdn.microsoft.com/en-in/library/windows/hardware/ff546243(v=vs.85).aspx

You can use IOCTL_ACPI_ENUM_CHILDREN to enumerate the child devices of
your bus. Doesn’t that do what you need?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hello Robert,

No i am not looking for child device list. In windows if we have define a container ID when we get a query for IRP_MN_QUERY_ID with BusQueryContainerID , we need to follow the details as specified in the link below.

https://msdn.microsoft.com/windows/hardware/drivers/install/how-usb-devices-are-assigned-container-ids

but issue is i am not sure how to read the ACPI space from my hub driver ?

regards,
Jagadish Hadimani

And want to add some info from the link

https://msdn.microsoft.com/windows/hardware/drivers/install/how-usb-devices-are-assigned-container-ids

It says:
Note If the operating system determines that the device is internal to the computer, the devnode will inherit the container ID of the parent devnode, which (in this case) is the container ID of the computer itself.

Question: Does this mean from when USB HUB driver receives a query for BusQueryContainerID for a device which is set as internal, the driver just needs to return saying this query is not supported ?

regards,
Jagadish Hadimani

xxxxx@gmail.com wrote:

No i am not looking for child device list. In windows if we have define a container ID when we get a query for IRP_MN_QUERY_ID with BusQueryContainerID , we need to follow the details as specified in the link below.

https://msdn.microsoft.com/windows/hardware/drivers/install/how-usb-devices-are-assigned-container-ids

That doesn’t say you are required to implement exactly that. That’s
documenting what Microsoft’s USB stack happens to do. From PnP’s
perspective, your container ID has to be unique for your container,
possibly inherited from your parent, but PnP doesn’t care what the
content is.

I assume you are writing the whole stack, and not just a hub driver.
I’m not sure it’s possible to write a replacement hub driver. The
interaction between the hub driver and the port driver and the host
controller driver in Microsoft’s stack is not fully documented.

but issue is i am not sure how to read the ACPI space from my hub driver ?

Have you tried it? If your hub is described in the DSDT, then you ought
to be able to send ACPI ioctls down the stack.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.