Error bit using of wPortStatus when need usbd_req_warm_reset_port
Shichun.Ma at dell.com
Shichun.Ma at dell.com
Sun Mar 8 11:15:13 UTC 2020
Dell Customer Communication - Confidential
Hi HPS,
I have a USB 3.0 device (DELL WD19 dock) and may need to "usbd_req_warm_reset_port" to make it enumerate successfully.
I realized that there is bug in bit using of wPortStatus.
Link info need 4 bits and they take bit 5 to bit 9, while UPS_PORT_POWER takes bit 9.
So this will give wrong link state info in function uhub_suspend_resume_port when it check if need usbd_req_warm_reset_port.
Please review and kindly suggest how to fix this issue.
struct usb_port_status {
uWord wPortStatus;
#define UPS_CURRENT_CONNECT_STATUS 0x0001
#define UPS_PORT_ENABLED 0x0002
#define UPS_SUSPEND 0x0004
#define UPS_OVERCURRENT_INDICATOR 0x0008
#define UPS_RESET 0x0010
#define UPS_PORT_L1 0x0020 /* USB 2.0 only */
/* The link-state bits are valid for Super-Speed USB HUBs */
#define UPS_PORT_LINK_STATE_GET(x) (((x) >> 5) & 0xF)
#define UPS_PORT_LINK_STATE_SET(x) (((x) & 0xF) << 5)
#define UPS_PORT_LS_U0 0x00
#define UPS_PORT_LS_U1 0x01
#define UPS_PORT_LS_U2 0x02
#define UPS_PORT_LS_U3 0x03
#define UPS_PORT_LS_SS_DIS 0x04
#define UPS_PORT_LS_RX_DET 0x05
#define UPS_PORT_LS_SS_INA 0x06
#define UPS_PORT_LS_POLL 0x07
#define UPS_PORT_LS_RECOVER 0x08
#define UPS_PORT_LS_HOT_RST 0x09
#define UPS_PORT_LS_COMP_MODE 0x0A
#define UPS_PORT_LS_LOOPBACK 0x0B
#define UPS_PORT_LS_RESUME 0x0F
#define UPS_PORT_POWER 0x0100
#define UPS_PORT_POWER_SS 0x0200 /* super-speed only */
#define UPS_LOW_SPEED 0x0200
#define UPS_HIGH_SPEED 0x0400
#define UPS_OTHER_SPEED 0x0600 /* currently FreeBSD specific */
#define UPS_PORT_TEST 0x0800
#define UPS_PORT_INDICATOR 0x1000
Regards,
Horse Ma (Shichun Ma)
Software Engineer
Dell | Cloud client-computing - Wyse
office +86 10 82862579, Mobile +86 13241851528
See our products at www.dell.com/wyse<http://www.dell.com/wyse>
More information about the freebsd-usb
mailing list