Translation - Japanese: タイトル：ハブポートの手動制御 – KBA224206 - Community Translated (JA)
How can a user control the port of a HUB manually?
In general, all the ports of a HUB are controlled by the HUB itself or by the host automatically; that is, the user does not need to take care of the details. However, in some cases, the user needs to control some features of the port manually. This can be done by sending the set feature command (or other HUB class commands) to the HUB.
For example, to set the port indicator of HX2VL, follow these steps:
1. Basic knowledge of USB spec
The following screenshot is extracted from Table 11-15, Hub Class Requests (chapter 11.24.2, Class-specific requests) in the USB 2.0 spec. It shows all the USB hub class requests and the SetPortFeature is highlighted by a red box.
SetPortFeature is one of the USB hub class requests, which sets a value reported in the port status. bmRequestType is 0x23, which shows the direction, type, and target of this class request. bRequest is SET_FEATURE(0x03), which is a USB class request code. wValue is a Feature Selector; there are 16 valid feature selectors for the hub class. Since the objective is to implement the port indicator for the hub, PORT_INDICATOR (0x16) is selected for the hub shown in the red box in the following screenshot, which is extracted from Table 11-17, Hub Class Feature Selectors (Chapter 11.24.2, Class-specific Requests) in the USB2.0 spec.
When the feature selector is PORT_INDICATOR, the most significant byte of the wIndex field is the selector identifying the specific indicator mode, and the least significant byte of the wIndex field points to the selected port. The following screenshot is extracted from Table 11-25, Port Indicator Selector Codes (Chapter 188.8.131.52, Set Port Feature) in the USB2.0 spec, which indicates the port indicator mode and the related value. The default value of the automatic mode is (0). The red box highlights the manual mode and its values.
For example, if the wIndex value is 0x0103, the set port indicator color for port 3 of the hub changes to amber.
Figure 3 Port indicator selector codes
2. Steps to send the command
- In the first step, confirm that the HUB supports the port indicator feature, although this is supported by almost all hubs.
- Connect the HUB to host and ensure it enumerates successfully.
- Open BUS HOUND, find the device, and double-click it to open the windows in which we send the command.
- Send the command below.
- Observe the change in the port indicator.