How is device removablility indicated in a thunderbolt deviec?

Hi All,

What causes windows to set CM_DEVCAP_REMOVABLE on a PCIe device connected inside a thunderbolt device?

Details:
I’m working on a Thunderbolt 3 dock that has two USB xHCI host controllers with various USB devices inside it. Several of the captive USB devices are showing up in “Devices & Printers” instead of one nice dock device. I know for USB devices the solution to this is to mark the hub ports they are connected to as non-removable. That causes Windows to assign them the same ContainerID as their parents and lets the system know they are all in one physical box. I have already done that for the USB devices and they are grouped properly into two devices, one for each host controller, in Devices & Printers.
When I examined the device tree I found that the xHCI host controllers are marked as removable.

I examined the PCIe capability structures, specifically looking for an equivalent of non-removable port for PCIe. The closest I’ve found are the hot plug related bits in the Sloct Capabilities Register but when I examined the PCI-to-PCI Bridge that is the parent of the xHCI host controller, the hot plug bits aren’t set.

Any information would be much appreciated.

Eric

These two pages may help
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/container-ids-generated-from-a-bus-specific-unique-id

https://docs.microsoft.com/en-us/windows-hardware/drivers/install/container-ids-for-pci-express-devices ?

Bent from my phone


From: xxxxx@lists.osr.com on behalf of xxxxx@yahoo.com
Sent: Thursday, September 21, 2017 11:18:02 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How is device removablility indicated in a thunderbolt deviec?

Hi All,

What causes windows to set CM_DEVCAP_REMOVABLE on a PCIe device connected inside a thunderbolt device?

Details:
I’m working on a Thunderbolt 3 dock that has two USB xHCI host controllers with various USB devices inside it. Several of the captive USB devices are showing up in “Devices & Printers” instead of one nice dock device. I know for USB devices the solution to this is to mark the hub ports they are connected to as non-removable. That causes Windows to assign them the same ContainerID as their parents and lets the system know they are all in one physical box. I have already done that for the USB devices and they are grouped properly into two devices, one for each host controller, in Devices & Printers.
When I examined the device tree I found that the xHCI host controllers are marked as removable.

I examined the PCIe capability structures, specifically looking for an equivalent of non-removable port for PCIe. The closest I’ve found are the hot plug related bits in the Sloct Capabilities Register but when I examined the PCI-to-PCI Bridge that is the parent of the xHCI host controller, the hot plug bits aren’t set.

Any information would be much appreciated.

Eric


NTDEV is sponsored by OSR

Visit the list online at: https:

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

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

Hi Doron,
Those links were very helpful but the behavior doesn’t seem to match what is documented. I went through and checked the Slot Implemented and Hot Plug Capable bits for all the PCI devices in this part of the tree. The PCI-PCI Bridge directly above the xHCI controllers has the Slot Implemented bit set but not the Hot Plug Capable bit yet the xHCI controllers are being marked as removable.

Has there been any change in this area of windows recently? The information I got from our customer said this behavior changed in Win 10 RS3.

Here is a table of the relevant part of the PCI tree. showing which of the two PCI capability bits are set and if the device removable capability flag is set in for the device.

Device PCI B,D,F PCI Cap flags DevMgr Removable?
PCIe Root Port 0,29,0 Slot Imp,HP No
PCI-to-PCI Bridge 6,0,0 - No
PCI-to-PCI Bridge 7,0,0 Slot Imp No
Thunderbolt controlle 8,0,0 - Removable
PCI-to-PCI Bridge 7,1,0 Slot Imp,HP No
PCI-to-PCI Bridge 9,0,0 - No
PCI-to-PCI Bridge 10,0,0 Slot Imp No
xHCI Host #1 11,0,0 - Removable
PCI-to-PCI Bridge 10,1,0 Slot Imp No
PCI-to-PCI Bridge 10,2,0 Slot Imp No
xHCI Host #2 13,0,0 - Removable
PCI-to-PCI Bridge 10,3,0 Slot Imp No
PCI-to-PCI Bridge 10,4,0 Slot Imp,HP No
PCI-to-PCI Bridge 7,2,0 Slot Imp No
PCI-to-PCI Bridge 7,4,0 Slot Imp,HP No