From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.171.2.32; helo=mail-in22.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in22.apple.com (mail-out22.apple.com [17.171.2.32]) (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 1AC72203BEA32 for ; Thu, 3 May 2018 15:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1525386469; x=2389300069; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=brAkRYNs9Rhq4zQxlO+SRbGdDITcBWam13sgFcmoaBI=; b=kH5PA3DZfqlraw4Je1GnVXurd35ocM8/xwbw1dDiawL5k1gNr3SoE9RhBjLzyHmq 63kj5re7JUULfX8iRHiDelEEucoShAnjz+cEcTs+xWt9Lv0TgKrK3/jWPXYCCOVO k3wmwJU/3wRoQPsFVVYjxmVJgbkktpBcAfFUN4+pUTs9rCXBBdPnL/0BREsZJiJK gzRL/G9/SIrUO7xddYdcSf8nZThL9epr3eOWVbBUW5u0aUSnG9U0BfPsA7hPvgyn sflSlHAikzur9h6TL1LR/YR7+k3Rb6Cfh5dkIr+r8bzjlCsxi7pDVXe2K1cOuxk/ AMHLw+/XMFANrqcM34YGUg==; Received: from relay27.apple.com (relay27.apple.com [17.171.128.108]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in22.apple.com (Apple Secure Mail Relay) with SMTP id 5B.0B.11907.5EC8BEA5; Thu, 3 May 2018 15:27:49 -0700 (PDT) X-AuditID: 11ab0216-df5ff70000002e83-1d-5aeb8ce5f474 Received: from ma1-mmpp-sz11.apple.com (ma1-mmpp-sz11.apple.com [17.171.128.33]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by relay27.apple.com (Apple SCV relay) with SMTP id 04.1D.09132.4EC8BEA5; Thu, 3 May 2018 15:27:48 -0700 (PDT) MIME-version: 1.0 Received: from [17.234.166.68] by ma1-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) with ESMTPSA id <0P8600EFJBQ9G910@ma1-mmpp-sz11.apple.com> for edk2-devel@lists.01.org; Thu, 03 May 2018 15:27:48 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <6D9ACD4E-A5B7-4A91-B4E9-0AE6B3763EA6@apple.com> Date: Thu, 03 May 2018 15:27:44 -0700 To: edk2-devel X-Mailer: Apple Mail (2.3445.6.18) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBLMWRmVeSWpSXmKPExsUiuLohR/dpz+sog5X/mSz2HDrK7MDo0T37 H0sAYxSXTUpqTmZZapG+XQJXxqfO36wFt1czVkxs7WVtYHwzmbGLkYNDQsBEYltzTRcjF4eQ wHomiWWXe5m7GDnB4mfnHmaBSGwASqy6CpbgFRCU+DH5HguIzSwQJvFoyQ8miKKJTBIfDyxi AkkIC4hLvDuzCayBTUBZYsX8D+wQcWOJ/t+z2CAG2Ug03noKZrMIqErMewpRIyKgIbG1uxXq CiWJ/7uOMIMskBB4ySqxddoBlgmM/LOQHDILySEQtpbE90etQHEOIFte4uB5WYiwpsSze5/Y IWxtiSfvLrAuYGRbxSicm5iZo5uZZ2Skl1hQkJOql5yfu4kRHLRMYjsY7702PMQowMGoxMMr 4PA6Sog1say4MvcQozQHi5I47ye2R1FCAumJJanZqakFqUXxRaU5qcWHGJk4OKUaGO3Eyva7 96v81ZqmJfbR991VRt5T05ae2rKfbaa+9bu/KRu9vFv02U1dHpsWbz366bE3/+V221/zO7I2 nNO3mCb8sNvSrv64QPiCt5HMXRyMb4/mMd17ttaapU3Sum2miY7oxkmWy3xfuKSrRd8pbfFc fGOG1R4b7pq9n48/vaz+3O9M8MRHbkosxRmJhlrMRcWJAMSnuaU7AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDLMWRmVeSWpSXmKPExsUiuLpBUfdJz+sogxdLrS32HDrK7MDo0T37 H0sAYxSXTUpqTmZZapG+XQJXxqfO36wFt1czVkxs7WVtYHwzmbGLkZNDQsBE4uzcwyxdjFwc QgIbmCSWrbrKDJLgFRCU+DH5HguIzSwQJvFoyQ8miKKJTBIfDyxiAkkIC4hLvDuzCayBTUBZ YsX8D+wQcWOJ/t+z2CAG2Ug03noKZrMIqErMewpRIyKgIbG1u5UZ4golif+7jjBPYOSZhWT3 LCS7IWwtie+PWoHiHEC2vMTB87IQYU2JZ/c+sUPY2hJP3l1gXcDItopRsCg1J7HSyFwvsaAg J1UvOT93EyMkzHJ2MN65aXaIUYCDUYmHd4ft6ygh1sSy4srcQ4wSHMxKIrwxSkAh3pTEyqrU ovz4otKc1OJDjNIcLErivD8LHkYJCaQnlqRmp6YWpBbBZJk4OKUaGGfmbE/seSP5Ytq991/L BOwfHs/dOuWJw7S7BYenmrqWPNy0Nkay9Ahn1NRLpTcivCddKlwTYBHVdbOiuSgi3SIneu0e oeOuNr55fP1/31Y2CW12eJGw43aDTan50VkTMu7or5mv75WzleW+3umvKptn18qdmvtlcqxm h5Lt14mbtyYqLmIq/qDEUpyRaKjFXFScCAAYpgXVLwIAAA== X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: 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: Thu, 03 May 2018 22:27:50 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT I was looking at this code: https://github.com/tianocore/edk2/blob/master/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConnect.c#L405 Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); if (!EFI_ERROR (Status)) { if ((PCI_CLASS_SERIAL == Class[2]) && (PCI_CLASS_SERIAL_USB == Class[1])) { if (HostControllerPI == Class[0] || HostControllerPI == 0xFF) { Status = gBS->ConnectController ( HandleArray[Index], NULL, RemainingDevicePath, FALSE ); if (!EFI_ERROR(Status)) { AtLeastOneConnected = 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 cause the creation of all the USB IO handles, or at least the ones that match RemainingDevicePath. In this code RemainingDevicePath is a USB Class device path node for HID devices. The main thing I don't understand is why the keyboard 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? Thanks, Andrew Fish