# What is the effect of remapping ports on a USB hub

I'm using the USB2517 for a project. It's a seven port hub, and I'm using six of them. I'm working through the config settings, and I'm stumped by the port remap registers. The datasheet gives the following text (page 34 in the datasheet):

Port remap register for ports 1 & 2 When a hub is enumerated by a USB Host Controller, the hub is only permitted to report how many ports it has; the hub is not permitted to select a numerical range or assignment. The Host Controller will number the downstream ports of the hub starting with the number '1', up to the number of ports that the hub recognizes.
The host's port number is referred to as "Logical Port Number" and the physical port on the hub is the “Physical Port Number". When remapping mode is enabled (see PRTMAP_EN in
Register 08h: Configuration Data Byte 3) the hub's downstream port
numbers can be remapped to different logical port numbers (assigned by the host). Note: The OEM must ensure that Contiguous Logical Port Numbers are
used, starting from #1 up to the maximum number of enabled ports; this ensures that the hub's ports are numbered in accordance with the way a Host will communicate with the ports

So, I've got seven ports, DS[1:7]. These are the "Physical Port Numbers". The host enumerates these as a range, which we can call PORT[1:7]. These are the "Logical Port Numbers". By writing to this register, I'm mapping DS[x] to PORT[y], or outwrite [see what I did there?] disabling it

Why would I want to remap my ports, however? What does that gain me over letting the hub automatically handle remapping? Is there some kind of port priority in the USB 2.0 spec that allocates additional bandwidth to lower numbered ports? Is it just in there to keep overcautious engineers up at night?

Edit: The hub is able to automatically remap ports to ensure contiguous logical ports if physical ports in the middle of the range are disabled if PRTMAP_EN (08h:3) is low. Is there anything to be gained by manually remapping them in a different order than the hub would automatically do it?

• My advice: stop what you are doing, and use default power-on configuration. If you want to skip a port in between for routing reasons, simply disable it with dual pull-ups (straps) option, the IC will take care of itself. – Ale..chenski Mar 14 '17 at 3:06
• The default power-on config will work for me, I imagine. I'm interested in knowing what the benefit would be in remapping specific physical ports to specific logical ports, though. Essentially, I'm not understanding why the port remap registers are available to me when the hub is already capable of automatically remapping registers. Extra functionality comes at a premium, so why did they expose this register? What advantage is there to manually remapping over a naive automatic remap? – Jason_L_Bens Mar 14 '17 at 22:56
• Extra configuration doesn't cost much if the VID/PID/ option change is already in place. The register is not "exposed", it was designed in by request of marketing - more features make an impression of better flexibility and dictate better price. But please be aware that there was/is a bug - the pull-down 15k are not configurable, and if you use permanent strapping option to disable a port, it will cost you about 300uA of extra consumption, which might be a concern in low-power embedded applications. – Ale..chenski Mar 14 '17 at 23:19

PRTR12 = 0001_0000 -- physical port 2 = logical port 1, physical port 1 = disabled