From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in5.apple.com (mail-out5.apple.com [17.151.62.27]) (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 87CEA21A08D89 for ; Thu, 1 Jun 2017 09:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1496336296; 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=FzKN5/LisgdEsjrmck0AFYXV7FS4H3Tf5I01uu4zXMw=; b=GijpocYF698j5s8DcrqyC0HyVmT3PuCoZqnYAiFM34suLApXhvVFigJKoHCjroWt thJFFesHGqm+9yW9a4vtteORg60nGpJT2+hpl8gKy3PZSwWYoh15RhQVdi+Al3/N Axgpi/zVpLfZZMr4sVao2DyTnkR5p3nPWaIwxHxH8CoYM0r4EzU44Vc5MedAo7O7 L1C9qCarPUQ+X1G087t7bUyu6CdMlC+xNQOfD8c5R/7KQ+EP1Y0dsEUWOgl7naVU FtDoxHEb4LR/7xXDF6fbckt4LHpNBlTg7QNqXaEaFzj8qU4p/FK01YygTekW6QPp DpRajORoz14F0fGRplNp9g==; Received: from relay7.apple.com (relay7.apple.com [17.128.113.101]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in5.apple.com (Apple Secure Mail Relay) with SMTP id 78.13.01595.8A740395; Thu, 1 Jun 2017 09:58:16 -0700 (PDT) X-AuditID: 11973e13-caa429a00000063b-96-593047a8c2ea Received: from nwk-mmpp-sz12.apple.com (nwk-mmpp-sz12.apple.com [17.128.115.204]) by relay7.apple.com (Apple SCV relay) with SMTP id 9A.78.18088.8A740395; Thu, 1 Jun 2017 09:58:16 -0700 (PDT) MIME-version: 1.0 Received: from da0601a-dhcp124.apple.com (da0601a-dhcp124.apple.com [17.226.15.124]) by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0OQV00DPWOH4RN30@nwk-mmpp-sz12.apple.com>; Thu, 01 Jun 2017 09:58:16 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish In-reply-to: Date: Thu, 01 Jun 2017 09:58:16 -0700 Cc: "edk2-devel@lists.01.org" Message-id: <6B16DFE0-54D1-4CBF-AC56-F255013B6FA5@apple.com> References: To: Amit kumar X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRmVeSWpSXmKPExsUi2FCYqrvC3SDSYN4GQ4t9r3cyWew5dJTZ gcnjcc8ZNo/u2f9YApiiuGxSUnMyy1KL9O0SuDIWbWtgLXjCU3Gn9TZLA+NGzi5GTg4JAROJ k63trF2MXBxCAmuYJF4de8kMk5j0cikjROIQo8SjFUvZQBK8AoISPybfY+li5OBgFpCXOHhe FiTMLKAl8f1RKwtE/VomiZen7oINEhYQl3h3ZhOU7SDx72Y7O4jNJqAssWL+BzCbUyBeYn3/ RBYQm0VAVeLo+W52iKHmEjMufGGC2Gsj8fLvOjBbSCBOYtONxWA1IkD1/e1T2CGOlpW4NfsS M8gREgJL2CQeTvvGPIFReBaSu2ch3D0Lyd0LGJlXMQrlJmbm6GbmmeolFhTkpOol5+duYgSF 9nQ74R2Mp1dZHWIU4GBU4uG1UDCIFGJNLCuuzD3EKM3BoiTOe0MeKCSQnliSmp2aWpBaFF9U mpNafIiRiYNTqoEx8N7ZhZkLl2jZXLjFzrhUbvJyBTaNbtWp291f9GxYxMOj+kwiwJ03rWri ip368VEx/Wo3Fht/O8n3QDFfnj1Z2O/aNO8rXJ0vr6mVRx9q6s32c8n4l3Mxb9JMi6TWV9sk S8udFy26LraOVfJg1JQnvDIqGqfrd7xaXvWwaVccl+9em0PS21YosRRnJBpqMRcVJwIAkuln W04CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42IRbCg+o7vC3SDS4M5rXYt9r3cyWew5dJTZ gcnjcc8ZNo/u2f9YApiiuGxSUnMyy1KL9O0SuDIWbWtgLXjCU3Gn9TZLA+NGzi5GTg4JAROJ SS+XMnYxcnEICRxilHi0YikbSIJXQFDix+R7LF2MHBzMAvISB8/LgoSZBbQkvj9qZYGoX8sk 8fLUXWaQhLCAuMS7M5ugbAeJfzfb2UFsNgFliRXzP4DZnALxEuv7J7KA2CwCqhJHz3ezQww1 l5hx4QsTxF4biZd/14HZQgJxEptuLAarEQGq72+fwg5xtKzErdmXmCcwCsxCcuoshFNnITl1 ASPzKkaBotScxEpzvcSCgpxUveT83E2M4FAsTN3B2Ljc6hCjAAejEg/vA1mDSCHWxLLiylxg WHAwK4nwHtEECvGmJFZWpRblxxeV5qQWH2KsArp/IrOUaHI+ME7ySuINTUwMTIyNzYyNzU3M qSKsJM7LwakfKSSQnliSmp2aWpBaBLOciYNTqoHRwflF0PypxzgEJ34uUFTY+K503ndzjvcp qaZup3zsQ1rZvUSV+/fMS1VuDF8b1Wtge8v8odepQ0dVzuYuncgw7eF+85MJs93fPDU0eJG/ cY7RlJ+/Bb+nTnNYqF99E+iGa5PDGU9em7/OOmzSE05xra5SlgwXx9eun3+sKpef3TlVacXX JGclluKMREMt5qLiRADgTejJoAIAAA== Subject: Re: Problem in EFI_BOOT_SERVICES.OpenProtocol() 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, 01 Jun 2017 16:57:15 -0000 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII > On Jun 1, 2017, at 9:46 AM, Amit kumar wrote: > > Hi, > I am trying to open PciIoProtocol and facing some issue. > > below is the code > > EFI_PCI_IO_PROTOCOL *PciIo=NULL; > EFI_STATUS Status; > > Status = gBS->OpenProtocol ( > Controller, > &gEfiPciIoProtocolGuid, > (VOID **) &PciIo, > This->DriverBindingHandle, > Controller, > EFI_OPEN_PROTOCOL_BY_DRIVER > ); > > it returns Status = EFI_ALREADY_STARTED, but PciIo is not NULL. > Is it not supposed to return PciIo as NULL ? > As per UEFI 2.6 Spec Section 6.3 page 182. > Amit, Look at the Status Codes Returned section at the end of that section. Attributes is BY_DRIVER and there is an item on the open list with an attribute of BY_DRIVER whose agent handle is the same as AgentHandle. Attributes is BY_DRIVER|EXCLUSIVE and there is an item on the open list with an attribute of BY_DRIVER|EXCLUSIVE whose agent handle is the same as AgentHandle. Thanks, Andrew Fish > There are a number of reasons that this function call can return an error. If an error is returned, then > AgentHandle, ControllerHandle, and Attributes are not added to the list of agents > consuming the protocol interface specified by Handle and Protocol, and Interface is > returned unmodified. > > Thanks And Regards > Amit > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel