From owner-freebsd-usb@freebsd.org Sun Mar 8 11:15:13 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 772E2265F1B for ; Sun, 8 Mar 2020 11:15:13 +0000 (UTC) (envelope-from Shichun.Ma@dell.com) Received: from mx0a-00154904.pphosted.com (mx0a-00154904.pphosted.com [148.163.133.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48ZzKT6Yvkz46dS for ; Sun, 8 Mar 2020 11:15:09 +0000 (UTC) (envelope-from Shichun.Ma@dell.com) Received: from pps.filterd (m0170393.ppops.net [127.0.0.1]) by mx0a-00154904.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 028BDCwx003933 for ; Sun, 8 Mar 2020 07:15:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dell.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=smtpout1; bh=X+WJQ+I147pl7KVTBdfoWCUOKs5SAJdB7B7seGpT/Lw=; b=v2XP4vLoyzwZKXXS7otsFpmyMPlAGriFtbD06eLyTac2vhSlSldjC39WcfO48hhskqJG VOx4pu49AId/YHniYS0MqasBF7jWIcZW5g8OWFCspFdUTgFWIcf3aUc3XakxVBc5GHDG cZOAj+Yeju2nFD0Lr28dCmLY3cgZsexJjGkZGbGGRwFJHNbR4PZU3tW3qWYLw1TnhL14 YGeIYl6jI4sZrJ9VKAodbJhvuLzrjjL45qK8AOJWbB6uxX7ZBQA8fPHu8rUEID4Q7o6U cM0z3T1dSszcI/MYa5SljtpRCaCAzRrBZPfs5TlKosbY/VMfbFbbX5kqUYxKl5/OD8nO Xg== Received: from mx0b-00154901.pphosted.com (mx0a-00154901.pphosted.com [67.231.149.39]) by mx0a-00154904.pphosted.com with ESMTP id 2ym7tradtg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 08 Mar 2020 07:15:07 -0400 Received: from pps.filterd (m0090350.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 028B5dfH132711 for ; Sun, 8 Mar 2020 07:15:07 -0400 Received: from ausc60ps301.us.dell.com (ausc60ps301.us.dell.com [143.166.148.206]) by mx0b-00154901.pphosted.com with ESMTP id 2ym85tawcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 08 Mar 2020 07:15:06 -0400 X-LoopCount0: from 10.166.137.66 X-PREM-Routing: D-Outbound X-IronPort-AV: E=Sophos;i="5.60,349,1549951200"; d="scan'208,217";a="1416829827" From: To: , CC: Subject: Error bit using of wPortStatus when need usbd_req_warm_reset_port Thread-Topic: Error bit using of wPortStatus when need usbd_req_warm_reset_port Thread-Index: AdX1OsB0WutiOWAtTBOATA/PSV/V7Q== Date: Sun, 8 Mar 2020 11:15:01 +0000 Message-ID: <13174e356c0640ab84fd697a1ae28e55@KULX13MDC130.APAC.DELL.COM> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_Enabled=True; MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_Owner=Shichun_Ma@Dell.com; MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_SetDate=2020-03-08T11:14:51.8668749Z; MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_Name=Customer Communication; MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_Application=Microsoft Azure Information Protection; MSIP_Label_a17f17c0-b23c-493d-99ab-b037779ecd33_Extended_MSFT_Method=Manual; aiplabel=Customer Communication x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [125.252.73.115] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-08_03:2020-03-06, 2020-03-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=711 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 impostorscore=0 phishscore=0 malwarescore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003080086 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 mlxlogscore=854 spamscore=0 adultscore=0 impostorscore=0 suspectscore=0 clxscore=1011 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003080087 X-Rspamd-Queue-Id: 48ZzKT6Yvkz46dS X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dell.com header.s=smtpout1 header.b=v2XP4vLo; dmarc=pass (policy=none) header.from=dell.com; spf=pass (mx1.freebsd.org: domain of Shichun.Ma@dell.com designates 148.163.133.20 as permitted sender) smtp.mailfrom=Shichun.Ma@dell.com X-Spamd-Result: default: False [-7.57 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.963,0]; R_DKIM_ALLOW(-0.20)[dell.com:s=smtpout1]; HAS_XOIP(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_FIVE(0.00)[5]; R_SPF_ALLOW(-0.20)[+ip4:148.163.133.20]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_DN_NONE(0.00)[]; DWL_DNSWL_LOW(-1.00)[dell.com.dwl.dnswl.org : 127.0.9.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[dell.com:+]; DMARC_POLICY_ALLOW(-0.50)[dell.com,none]; FROM_NO_DN(0.00)[]; IP_SCORE(-0.50)[ip: (-0.08), ipnet: 148.163.133.0/24(-0.03), asn: 26211(-2.36), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[20.133.163.148.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:26211, ipnet:148.163.133.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[dell.com:d:+,dell.com:s:+] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2020 11:15:13 -0000 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