From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 09877203BEA21 for ; Fri, 4 May 2018 02:21:58 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2018 02:21:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,361,1520924400"; d="scan'208";a="196676115" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 04 May 2018 02:21:57 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 4 May 2018 02:21:57 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 4 May 2018 02:21:57 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.210]) with mapi id 14.03.0319.002; Fri, 4 May 2018 17:21:55 +0800 From: "Zeng, Star" To: Andrew Fish , edk2-devel CC: "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [edk2] Question about connecting USB HID devices. Thread-Index: AQHT4y38XhxSqXj5kk+xBq4G5GunkaQfSqLA Date: Fri, 4 May 2018 09:21:55 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAE72F3@shsmsx102.ccr.corp.intel.com> References: <6D9ACD4E-A5B7-4A91-B4E9-0AE6B3763EA6@apple.com> In-Reply-To: <6D9ACD4E-A5B7-4A91-B4E9-0AE6B3763EA6@apple.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: Question about connecting USB HID devices. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 09:21:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It is about USB short form device path handling? Check https://github.com/t= ianocore/edk2/blob/master/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c#L1368= ? Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Andr= ew Fish Sent: Friday, May 4, 2018 6:28 AM To: edk2-devel Subject: [edk2] Question about connecting USB HID devices. I was looking at this code: https://github.com/tianocore/edk2/blob/master/I= ntelFrameworkModulePkg/Library/GenericBdsLib/BdsConnect.c#L405 Status =3D PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Cl= ass); if (!EFI_ERROR (Status)) { if ((PCI_CLASS_SERIAL =3D=3D Class[2]) && (PCI_CLASS_SERIAL_USB =3D=3D Class[1])) { if (HostControllerPI =3D=3D Class[0] || HostControllerPI =3D=3D= 0xFF) { Status =3D gBS->ConnectController ( HandleArray[Index], NULL, RemainingDevicePath, FALSE ); if (!EFI_ERROR(Status)) { AtLeastOneConnected =3D TRUE; } } } } I'm missing something? This code is doing a non-recursive ConnectController= () on the PCI Handle for the USB HC. I would expect that this call would ca= use the creation of all the USB IO handles, or at least the ones that match= RemainingDevicePath. In this code RemainingDevicePath is a USB Class devic= e path node for HID devices. The main thing I don't understand is why the k= eyboard got connected? I would think after this loop the BDS would need to= loop on the created USB IO Protocols, call UsbGetInterfaceDescriptor() and= do a recursive connect controller on the matching InterfaceClass. It looks= like the USB bus driver may be connecting the console devices? I'm unclear= why that work was not done in the BDS?=20 Thanks, Andrew Fish _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel