Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Mar 2020 11:15:01 +0000
From:      <Shichun.Ma@dell.com>
To:        <hps@selasky.org>, <freebsd-usb@freebsd.org>
Cc:        <Shunchao.Hu@dell.com>
Subject:   Error bit using of wPortStatus when need usbd_req_warm_reset_port
Message-ID:  <13174e356c0640ab84fd697a1ae28e55@KULX13MDC130.APAC.DELL.COM>

next in thread | raw e-mail | index | archive | help
Dell Customer Communication - Confidential

Hi HPS,
I have a USB 3.0 device (DELL WD19 dock) and may need to "usbd_req_warm_res=
et_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_por=
t 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 specif=
ic */
#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>;




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13174e356c0640ab84fd697a1ae28e55>