From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in21.apple.com (mail-out21.apple.com [17.171.2.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 383422194232C for ; Thu, 6 Apr 2017 04:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1491476967; 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=2LhGEyp84Je1yUaSuxQbFI23fPvPtkE5lTROkrpH5QU=; b=IBfEUsHEelIFZdQiYjPOJetJJzrwuG36Ssk4ESlFLJGNV3CQYSWVlS6afUlfKjAN Asy6Zv9+WJcBiCRrTosj70TFPsuWlHFfkhC4tmvWTAz/MJ+t250tkKJeikMpVUI7 NgdiaxGrunWqW0qJAMb4dCfXhSBKg8uTjngT3kstrOmrOqyV52FptB/3qocUjGrG Td1NbGn58hU9ByOpkc5mS7IyzsgP+taSWW/gg+lYqxDYXBMPalbxagJkZXNSFeBe /wT+twI3wC/e/TnQASh1JHgJSP6xogIzJaO4QAxTvkIllM2QNmoMrjfZqYzD+8As Cnso8ji7iPCo/wenWZAcCg==; Received: from relay8.apple.com (relay8.apple.com [17.128.113.102]) by mail-in21.apple.com (Apple Secure Mail Relay) with SMTP id 5A.D8.24065.5E126E85; Thu, 6 Apr 2017 04:09:27 -0700 (PDT) X-AuditID: 11ab0215-9c3fb70000005e01-e1-58e621e546f7 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by relay8.apple.com (Apple SCV relay) with SMTP id 6D.83.07296.4E126E85; Thu, 6 Apr 2017 04:09:25 -0700 (PDT) MIME-version: 1.0 Received: from [17.153.68.6] (unknown [17.153.68.6]) by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0ONZ00BLJIZLN880@nwk-mmpp-sz09.apple.com>; Thu, 06 Apr 2017 04:09:24 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: Date: Thu, 06 Apr 2017 04:09:22 -0700 In-reply-to: Cc: "edk2-devel@lists.01.org" To: Amit kumar References: X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsUi2FCYpvtc8VmEwaEFIhb7Xu9ksthz6Ciz A5PH454zbB7ds/+xBDBFcdmkpOZklqUW6dslcGVc2LOYtaBTp2Ly5+vsDYxNal2MnBwSAiYS h79cYu5i5OIQEtjPKHHheBsbTOLLp+csEImDjBKP739nBknwCghK/Jh8jwXEZhYIk+iY1swI UdTNJNHSeQEsISwgLvHuzCawBjYBZYkV8z+wQzTbSLy/tZkdosZeYsX+J4wgNouAqsS7pk6w ek6BeImljx8wQSwwl5hx4QuYLQJU098+BaxXSCBOomVTGyvEpbISt2ZDvCAhcIBN4ueV1UwT GIVmITl2FpJjIWwtie+PWoHiHEC2vMTB87IQYU2JZ/c+sUPY2hJP3l1gXcDItopRODcxM0c3 M8/IUC+xoCAnVS85P3cTIygeVjOJ7mCc/8rwEKMAB6MSD28B29MIIdbEsuLK3EOM0hwsSuK8 W0uAQgLpiSWp2ampBalF8UWlOanFhxiZODilGhijOte1z7685pSj+MEkxuLZh/O8Xs+eemLX 4z2rPI8HVzYGbHoof9OxTmfN/P4j3s3u38sXL4mLktyWsGfqpKfuDOLJ35cVTetYL7b3rfKD jrIr9i/OuzzY6VZZNet29ZK6q9O8k0oXcBgKbMm5y+79j3HLZt7tZyy2hj0qPvXl66vyktJF t1lNlViKMxINtZiLihMB5MDZn2gCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHIsWRmVeSWpSXmKPExsUi2FAcoPtU8VmEwfRrYhb7Xu9ksthz6Ciz A5PH454zbB7ds/+xBDBFcdmkpOZklqUW6dslcGVc2LOYtaBTp2Ly5+vsDYxNal2MnBwSAiYS Xz49Z+li5OIQEjjIKPH4/ndmkASvgKDEj8n3WEBsZoEwiY5pzYwQRd1MEi2dF8ASwgLiEu/O bAJrYBNQllgx/wM7RLONxPtbm9khauwlVux/wghiswioSrxr6gSr5xSIl1j6+AETxAJziRkX voDZIkA1/e1TwHqFBOIkWja1sUJcKitxa/Yl5gmM/LOQ3DcLyX0QtpbE90etQHEOIFte4uB5 WYiwpsSze5/YIWxtiSfvLrAuYGRbxShQlJqTWGmhl1hQkJOql5yfu4kRHLyFaTsYm5ZbHWIU 4GBU4uFd8PRJhBBrYllxZe4hRgkOZiUR3j7pZxFCvCmJlVWpRfnxRaU5qcWHGCcyAj05kVlK NDkfGFt5JfGGJiYGJsbGZsbG5ibmtBRWEufdcO9xhJBAemJJanZqakFqEcxRTBycUg2Mi5pu zZzRb9S+mcumhjVeteNP+CeH3sfy17sXCbKl2B94VvFl6s0HEf/XcterWv9O6+k9m3jOrv2J y3G10l3ZicvKn7+rqM/sDLo2580BFS6TTxrTuk9lHb90PkTszozOD4o75SVkFx8rWfTW7ay9 8onvm9/cN4l7X677aesn49deh3ev+fBskRJLcUaioRZzUXEiAC/GLpPRAgAA X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: How to get fs index from controller handle. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 11:09:28 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Apr 6, 2017, at 3:30 AM, Amit kumar wrote: > > Hi, > > I want to get the fs index from the controller handle. > e.g In map command i see my controller is mapped to fs10. > So i there any API i can use in my code to get the fs index( which is 10 as in example) from the controller handle. > Amit, It is important to remember that fs0:, and the other device names are a Shell concept and not an EFI concept. So they only exist in the context of the shell. I took a quick look and I did not see an easy way to do this with the current Shell APIs. In the older Shell you could use this protocol EfiShellEnvironment2 Protocol has a function that converts a EFI_DEVICE_PATH_PROTOCOL (would be on your controller handle) to a CHAR16. Thus you can get the volume name the Shell would display to the user. I don't the index exists as a concept. So EFI_SHELL_ENVIRONMENT2.GetFsName() and EFI_SHELL_ENVIRONMENT2.GetFsDevicepath() are the closest thing I can think of. https://github.com/tianocore/edk2/blob/master/ShellPkg/Include/Protocol/EfiShellEnvironment2.h#L812 The only problem with that is EfiShellEnvironment2 is not produced by the Shell by default. ## This flag is used to control the protocols produced by the shell # If TRUE the shell will produce EFI_SHELL_ENVIRONMENT2 and EFI_SHELL_INTERFACE gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols|FALSE|BOOLEAN|0x00000002 I've use the EFI_SHELL_ENVIRONMENT2 in the past to enable a non Shell application to print out volume names that match the map command of the shell. Hopefully some one knows how to do this in the modern Shell? Thanks, Andrew Fish > Regards > Amit > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel