Hi Rafael,

Set
Port = 0xFFFF;
before
do {

Regards,
Sergey

On 18.10.2012, at 0:09, Rafael Machado <rafaelrodrigues.mach...@gmail.com> 
wrote:

> Hi everyone.
> I'm having a problem with an sample code I've developed.
> This code should display the ports and Multiports of the Sata hdds that are 
> connected to the board.
> The strange thing is that the HDD device paths are displayed at uefi main 
> screen, but the following code does not return any port.
> Another strange thig is that this code works correctly on a notebook.
> The computer that it doesn't work is a server with 2 sata hdds connected to a 
> backplane that is connected to the sata entries of the motherboard with AHCI 
> mode enabled.
>  
>   Print(L"*****************\n");
>  Print(L"*Ata Device Path*\n", HandleCount);
>  Print(L"*****************\n");
> 
>  Status = gBS->LocateHandleBuffer(ByProtocol,
>          &gEfiAtaPassThruProtocolGuid,
>          NULL,
>          &HandleCount,
>          &HandleBuffer);
> 
> 
>  // Checks if happen some error in the handle localization
>  if (Status == EFI_SUCCESS)
>  {
> 
>   Print(L"gEfiAtaPassThruProtocolGuid HandleCount: %d\n", HandleCount);
> 
>   // Loop to walk in the handles
>   for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex ++)
>   {
>    Print(L"HandleIndex: %d\n", HandleIndex);
> 
>    Status = gBS->OpenProtocol(HandleBuffer[HandleIndex],
>           &gEfiAtaPassThruProtocolGuid,
>           (VOID **) &ataProtocol,
>           ImageHandle,
>           NULL,
>           EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
> 
>    if(EFI_ERROR(Status))
>    {
>     Print(L"Status: %x\n", Status);
>    }
> 
> 
>    do {
>      Status = ataProtocol->GetNextPort(ataProtocol,
>              &Port);
> 
>      if(!EFI_ERROR(Status))
>      {
>       Status = ataProtocol->GetNextDevice(ataProtocol,
>                Port,
>                &PortMultiplierPort);
> 
>       if(!EFI_ERROR(Status))
>       {
>        Print(L"Port: %d\n",Port);
>        Print(L"PortMultiplierPort: %d\n", PortMultiplierPort);
>        Print(L"-----------------------------------\n");
>       }
>      }
> 
>    }while(!EFI_ERROR(Status));
> 
>   }
>  }
>  else
>  {
>   Print(L"Status: %x\n", Status);
>  }
> 
>  
> Any idea ?
> 
> Thanks everyone.
> 
> Rafael R. Machado
> 
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to