VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103777
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c

    r58459 r58466  
    189189
    190190  //
    191   // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as 
     191  // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as
    192192  // EFI PassThru Protocol. From priority perspective, ExtPassThru Protocol is firstly
    193193  // tried to open on host controller handle. If fails, then PassThru Protocol is tried instead.
     
    218218             This->DriverBindingHandle,
    219219             Controller
    220              );     
     220             );
    221221      return EFI_SUCCESS;
    222222    } else {
     
    233233             This->DriverBindingHandle,
    234234             Controller
    235              );     
     235             );
    236236      if (!EFI_ERROR(Status)) {
    237237        return EFI_SUCCESS;
     
    241241
    242242  //
    243   // Come here in 2 condition: 
     243  // Come here in 2 condition:
    244244  // 1. ExtPassThru doesn't exist.
    245245  // 2. ExtPassThru exists but RemainingDevicePath is invalid.
     
    253253                  EFI_OPEN_PROTOCOL_BY_DRIVER
    254254                  );
    255  
     255
    256256  if (Status == EFI_ALREADY_STARTED) {
    257257    return EFI_SUCCESS;
    258258  }
    259  
     259
    260260  if (EFI_ERROR (Status)) {
    261261    return Status;
    262262  }
    263  
     263
    264264  //
    265265  // Test RemainingDevicePath is valid or not.
     
    268268    Status = PassThru->GetTargetLun (PassThru, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun);
    269269  }
    270  
     270
    271271  gBS->CloseProtocol (
    272272         Controller,
     
    326326  ExtScsiSupport  = FALSE;
    327327  PassThruStatus  = EFI_SUCCESS;
    328  
     328
    329329  TargetId = &ScsiTargetId.ScsiId.ExtScsi[0];
    330330  SetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
    331  
     331
    332332  DevicePathStatus = gBS->OpenProtocol (
    333333                            Controller,
     
    349349    (EFI_IO_BUS_SCSI | EFI_IOB_PC_INIT),
    350350    ParentDevicePath
    351     ); 
    352 
    353   //
    354   // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as 
     351    );
     352
     353  //
     354  // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as
    355355  // EFI PassThru Protocol. From priority perspective, ExtPassThru Protocol is firstly
    356356  // tried to open on host controller handle. If fails, then PassThru Protocol is tried instead.
     
    387387               Controller
    388388               );
    389       } 
     389      }
    390390      return Status;
    391     } 
     391    }
    392392  } else {
    393393    //
    394     // Succeed to open ExtPassThru Protocol, and meanwhile open PassThru Protocol 
    395     // with BY_DRIVER if it is also present on the handle. The intent is to prevent 
     394    // Succeed to open ExtPassThru Protocol, and meanwhile open PassThru Protocol
     395    // with BY_DRIVER if it is also present on the handle. The intent is to prevent
    396396    // another SCSI Bus Driver to work on the same host handle.
    397397    //
     
    406406                            );
    407407  }
    408    
     408
    409409  if (Status != EFI_ALREADY_STARTED) {
    410410    //
     
    424424      ScsiBusDev->ExtScsiInterface = ExtScsiInterface;
    425425    } else {
    426       ScsiBusDev->ScsiInterface    = ScsiInterface;   
     426      ScsiBusDev->ScsiInterface    = ScsiInterface;
    427427    }
    428428
     
    431431    // retrieved on this controller handle. With ScsiBusDev, we can know which PassThru
    432432    // Protocol is present on the handle, UEFI ExtPassThru Protocol or EFI PassThru Protocol.
    433     // 
     433    //
    434434    Status = gBS->InstallProtocolInterface (
    435435                    &Controller,
     
    473473  if (RemainingDevicePath == NULL) {
    474474    //
    475     // If RemainingDevicePath is NULL, 
     475    // If RemainingDevicePath is NULL,
    476476    // must enumerate all SCSI devices anyway
    477477    //
     
    479479  } else if (!IsDevicePathEnd (RemainingDevicePath)) {
    480480    //
    481     // If RemainingDevicePath isn't the End of Device Path Node, 
     481    // If RemainingDevicePath isn't the End of Device Path Node,
    482482    // only scan the specified device by RemainingDevicePath
    483483    //
    484484    if (ScsiBusDev->ExtScsiSupport) {
    485       Status = ScsiBusDev->ExtScsiInterface->GetTargetLun (ScsiBusDev->ExtScsiInterface, RemainingDevicePath, &TargetId, &Lun); 
     485      Status = ScsiBusDev->ExtScsiInterface->GetTargetLun (ScsiBusDev->ExtScsiInterface, RemainingDevicePath, &TargetId, &Lun);
    486486    } else {
    487487      Status = ScsiBusDev->ScsiInterface->GetTargetLun (ScsiBusDev->ScsiInterface, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun);
     
    495495    // If RemainingDevicePath is the End of Device Path Node,
    496496    // skip enumerate any device and return EFI_SUCESSS
    497     // 
     497    //
    498498    ScanOtherPuns = FALSE;
    499499  }
     
    540540
    541541ErrorExit:
    542  
     542
    543543  if (ScsiBusDev != NULL) {
    544544    FreePool (ScsiBusDev);
    545545  }
    546  
     546
    547547  if (ExtScsiSupport) {
    548548    gBS->CloseProtocol (
     
    579579  calling restrictions. If any other agent wishes to call Stop() it must also
    580580  follow these calling restrictions.
    581  
     581
    582582  @param  This              Protocol instance pointer.
    583583  @param  ControllerHandle  Handle of device to stop driver on
     
    651651      //
    652652      // When Start() succeeds to open ExtPassThru, it always tries to open PassThru BY_DRIVER.
    653       // Its intent is to prevent another SCSI Bus Driver from woking on the same host handle. 
     653      // Its intent is to prevent another SCSI Bus Driver from woking on the same host handle.
    654654      // So Stop() needs to try to close PassThru if present here.
    655655      //
     
    764764  @param  This          Protocol instance pointer.
    765765  @param  DeviceType    A pointer to the device type information retrieved from
    766                         the SCSI Controller. 
     766                        the SCSI Controller.
    767767
    768768  @retval EFI_SUCCESS             Retrieves the device type information successfully.
    769769  @retval EFI_INVALID_PARAMETER   The DeviceType is NULL.
    770  
     770
    771771**/
    772772EFI_STATUS
     
    834834  @retval  EFI_UNSUPPORTED   The bus reset operation is not supported by the
    835835                             SCSI Host Controller.
    836   @retval  EFI_TIMEOUT       A timeout occurred while attempting to reset 
     836  @retval  EFI_TIMEOUT       A timeout occurred while attempting to reset
    837837                             the SCSI bus.
    838838**/
     
    894894    ScsiIoDevice->ScsiBusDeviceData->DevicePath
    895895    );
    896  
     896
    897897  CopyMem (Target,&ScsiIoDevice->Pun, TARGET_MAX_BYTES);
    898898
     
    918918
    919919  @param  This            Protocol instance pointer.
    920   @param  CommandPacket   The SCSI request packet to send to the SCSI 
     920  @param  CommandPacket   The SCSI request packet to send to the SCSI
    921921                          Controller specified by the device handle.
    922922  @param  Event           If the SCSI bus where the SCSI device is attached
    923                           does not support non-blocking I/O, then Event is 
    924                           ignored, and blocking I/O is performed. 
     923                          does not support non-blocking I/O, then Event is
     924                          ignored, and blocking I/O is performed.
    925925                          If Event is NULL, then blocking I/O is performed.
    926                           If Event is not NULL and non-blocking I/O is 
     926                          If Event is not NULL and non-blocking I/O is
    927927                          supported, then non-blocking I/O is performed,
    928928                          and Event will be signaled when the SCSI Request
    929929                          Packet completes.
    930930
    931   @retval EFI_SUCCESS         The SCSI Request Packet was sent by the host 
    932                               successfully, and TransferLength bytes were 
    933                               transferred to/from DataBuffer.See 
    934                               HostAdapterStatus, TargetStatus, 
     931  @retval EFI_SUCCESS         The SCSI Request Packet was sent by the host
     932                              successfully, and TransferLength bytes were
     933                              transferred to/from DataBuffer.See
     934                              HostAdapterStatus, TargetStatus,
    935935                              SenseDataLength, and SenseData in that order
    936936                              for additional status information.
    937   @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, 
     937  @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
    938938                              but the entire DataBuffer could not be transferred.
    939939                              The actual number of bytes transferred is returned
    940                               in TransferLength. See HostAdapterStatus, 
    941                               TargetStatus, SenseDataLength, and SenseData in 
     940                              in TransferLength. See HostAdapterStatus,
     941                              TargetStatus, SenseDataLength, and SenseData in
    942942                              that order for additional status information.
    943   @retval EFI_NOT_READY       The SCSI Request Packet could not be sent because 
    944                               there are too many SCSI Command Packets already 
     943  @retval EFI_NOT_READY       The SCSI Request Packet could not be sent because
     944                              there are too many SCSI Command Packets already
    945945                              queued.The caller may retry again later.
    946   @retval EFI_DEVICE_ERROR    A device error occurred while attempting to send 
    947                               the SCSI Request Packet. See HostAdapterStatus, 
    948                               TargetStatus, SenseDataLength, and SenseData in 
     946  @retval EFI_DEVICE_ERROR    A device error occurred while attempting to send
     947                              the SCSI Request Packet. See HostAdapterStatus,
     948                              TargetStatus, SenseDataLength, and SenseData in
    949949                              that order for additional status information.
    950   @retval EFI_INVALID_PARAMETER  The contents of CommandPacket are invalid. 
    951                                  The SCSI Request Packet was not sent, so no 
     950  @retval EFI_INVALID_PARAMETER  The contents of CommandPacket are invalid.
     951                                 The SCSI Request Packet was not sent, so no
    952952                                 additional status information is available.
    953953  @retval EFI_UNSUPPORTED     The command described by the SCSI Request Packet
    954                               is not supported by the SCSI initiator(i.e., SCSI 
     954                              is not supported by the SCSI initiator(i.e., SCSI
    955955                              Host Controller). The SCSI Request Packet was not
    956                               sent, so no additional status information is 
     956                              sent, so no additional status information is
    957957                              available.
    958   @retval EFI_TIMEOUT         A timeout occurred while waiting for the SCSI 
     958  @retval EFI_TIMEOUT         A timeout occurred while waiting for the SCSI
    959959                              Request Packet to execute. See HostAdapterStatus,
    960                               TargetStatus, SenseDataLength, and SenseData in 
     960                              TargetStatus, SenseDataLength, and SenseData in
    961961                              that order for additional status information.
    962962**/
     
    974974  EFI_EVENT                                   PacketEvent;
    975975  EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *ExtRequestPacket;
    976   SCSI_EVENT_DATA                             EventData;                                     
     976  SCSI_EVENT_DATA                             EventData;
    977977
    978978  PacketEvent = NULL;
    979  
     979
    980980  if (Packet == NULL) {
    981981    return EFI_INVALID_PARAMETER;
     
    12301230
    12311231ErrorExit:
    1232  
     1232
    12331233  //
    12341234  // The memory space for ScsiDevicePath is allocated in
     
    13051305    if (!EFI_ERROR (Status)) {
    13061306      break;
    1307     } else if ((Status == EFI_BAD_BUFFER_SIZE) || 
     1307    } else if ((Status == EFI_BAD_BUFFER_SIZE) ||
    13081308               (Status == EFI_INVALID_PARAMETER) ||
    13091309               (Status == EFI_UNSUPPORTED)) {
     
    13171317    goto Done;
    13181318  }
    1319  
     1319
    13201320  //
    13211321  // Retrieved inquiry data successfully
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h

    r58459 r58466  
    4242typedef union {
    4343  UINT32  Scsi;
    44   UINT8   ExtScsi[4];   
     44  UINT8   ExtScsi[4];
    4545} SCSI_ID;
    4646
     
    8080  UINTN                                 Signature;
    8181  EFI_SCSI_BUS_PROTOCOL                 BusIdentify;
    82   BOOLEAN                               ExtScsiSupport; 
     82  BOOLEAN                               ExtScsiSupport;
    8383  EFI_SCSI_PASS_THRU_PROTOCOL           *ScsiInterface;
    8484  EFI_EXT_SCSI_PASS_THRU_PROTOCOL       *ExtScsiInterface;
     
    9393  EFI_SCSI_IO_PROTOCOL               ScsiIo;
    9494  EFI_DEVICE_PATH_PROTOCOL           *DevicePath;
    95   BOOLEAN                            ExtScsiSupport; 
     95  BOOLEAN                            ExtScsiSupport;
    9696  EFI_SCSI_PASS_THRU_PROTOCOL        *ScsiPassThru;
    9797  EFI_EXT_SCSI_PASS_THRU_PROTOCOL    *ExtScsiPassThru;
     
    175175  calling restrictions. If any other agent wishes to call Stop() it must also
    176176  follow these calling restrictions.
    177  
     177
    178178  @param  This              Protocol instance pointer.
    179179  @param  ControllerHandle  Handle of device to stop driver on
     
    328328  @param  This          Protocol instance pointer.
    329329  @param  DeviceType    A pointer to the device type information retrieved from
    330                         the SCSI Controller. 
     330                        the SCSI Controller.
    331331
    332332  @retval EFI_SUCCESS             Retrieves the device type information successfully.
    333333  @retval EFI_INVALID_PARAMETER   The DeviceType is NULL.
    334  
     334
    335335**/
    336336EFI_STATUS
     
    371371  @retval  EFI_UNSUPPORTED   The bus reset operation is not supported by the
    372372                             SCSI Host Controller.
    373   @retval  EFI_TIMEOUT       A timeout occurred while attempting to reset 
     373  @retval  EFI_TIMEOUT       A timeout occurred while attempting to reset
    374374                             the SCSI bus.
    375375**/
     
    401401
    402402  @param  This            Protocol instance pointer.
    403   @param  CommandPacket   The SCSI request packet to send to the SCSI 
     403  @param  CommandPacket   The SCSI request packet to send to the SCSI
    404404                          Controller specified by the device handle.
    405405  @param  Event           If the SCSI bus where the SCSI device is attached
    406                           does not support non-blocking I/O, then Event is 
    407                           ignored, and blocking I/O is performed. 
     406                          does not support non-blocking I/O, then Event is
     407                          ignored, and blocking I/O is performed.
    408408                          If Event is NULL, then blocking I/O is performed.
    409                           If Event is not NULL and non-blocking I/O is 
     409                          If Event is not NULL and non-blocking I/O is
    410410                          supported, then non-blocking I/O is performed,
    411411                          and Event will be signaled when the SCSI Request
    412412                          Packet completes.
    413413
    414   @retval EFI_SUCCESS         The SCSI Request Packet was sent by the host 
    415                               successfully, and TransferLength bytes were 
    416                               transferred to/from DataBuffer.See 
    417                               HostAdapterStatus, TargetStatus, 
     414  @retval EFI_SUCCESS         The SCSI Request Packet was sent by the host
     415                              successfully, and TransferLength bytes were
     416                              transferred to/from DataBuffer.See
     417                              HostAdapterStatus, TargetStatus,
    418418                              SenseDataLength, and SenseData in that order
    419419                              for additional status information.
    420   @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, 
     420  @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
    421421                              but the entire DataBuffer could not be transferred.
    422422                              The actual number of bytes transferred is returned
    423                               in TransferLength. See HostAdapterStatus, 
    424                               TargetStatus, SenseDataLength, and SenseData in 
     423                              in TransferLength. See HostAdapterStatus,
     424                              TargetStatus, SenseDataLength, and SenseData in
    425425                              that order for additional status information.
    426   @retval EFI_NOT_READY       The SCSI Request Packet could not be sent because 
    427                               there are too many SCSI Command Packets already 
     426  @retval EFI_NOT_READY       The SCSI Request Packet could not be sent because
     427                              there are too many SCSI Command Packets already
    428428                              queued.The caller may retry again later.
    429   @retval EFI_DEVICE_ERROR    A device error occurred while attempting to send 
    430                               the SCSI Request Packet. See HostAdapterStatus, 
    431                               TargetStatus, SenseDataLength, and SenseData in 
     429  @retval EFI_DEVICE_ERROR    A device error occurred while attempting to send
     430                              the SCSI Request Packet. See HostAdapterStatus,
     431                              TargetStatus, SenseDataLength, and SenseData in
    432432                              that order for additional status information.
    433   @retval EFI_INVALID_PARAMETER  The contents of CommandPacket are invalid. 
    434                                  The SCSI Request Packet was not sent, so no 
     433  @retval EFI_INVALID_PARAMETER  The contents of CommandPacket are invalid.
     434                                 The SCSI Request Packet was not sent, so no
    435435                                 additional status information is available.
    436436  @retval EFI_UNSUPPORTED     The command described by the SCSI Request Packet
    437                               is not supported by the SCSI initiator(i.e., SCSI 
     437                              is not supported by the SCSI initiator(i.e., SCSI
    438438                              Host Controller). The SCSI Request Packet was not
    439                               sent, so no additional status information is 
     439                              sent, so no additional status information is
    440440                              available.
    441   @retval EFI_TIMEOUT         A timeout occurred while waiting for the SCSI 
     441  @retval EFI_TIMEOUT         A timeout occurred while waiting for the SCSI
    442442                              Request Packet to execute. See HostAdapterStatus,
    443                               TargetStatus, SenseDataLength, and SenseData in 
     443                              TargetStatus, SenseDataLength, and SenseData in
    444444                              that order for additional status information.
    445445**/
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf

    r58459 r58466  
    33#  Note that the driver will install the Device Path Protocol and SCSI I/O Protocol on
    44#  these handles.
    5 # 
     5#
    66#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    77#  This program and the accompanying materials
     
    99#  which accompanies this distribution.  The full text of the license may be found at
    1010#  http://opensource.org/licenses/bsd-license.php
    11 # 
     11#
    1212#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1313#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    14 # 
     14#
    1515##
    1616
     
    3030#  VALID_ARCHITECTURES              =  IA32 X64 IPF EBC
    3131#
    32 #  DRIVER_BINDING                =  gSCSIBusDriverBinding                       
     32#  DRIVER_BINDING                =  gSCSIBusDriverBinding
    3333#  COMPONENT_NAME                =  gScsiBusComponentName
    3434#  COMPONENT_NAME2               =  gScsiBusComponentName2
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c

    r48674 r58466  
    184184    return EFI_UNSUPPORTED;
    185185  }
    186  
     186
    187187  //
    188188  // Make sure this driver is currently managing ControllerHandle
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c

    r58459 r58466  
    8080  The user code starts with this function.
    8181
    82   @param  ImageHandle    The firmware allocated handle for the EFI image. 
     82  @param  ImageHandle    The firmware allocated handle for the EFI image.
    8383  @param  SystemTable    A pointer to the EFI System Table.
    84  
     84
    8585  @retval EFI_SUCCESS       The entry point is executed successfully.
    8686  @retval other             Some error occurs when executing this entry point.
     
    331331        return EFI_SUCCESS;
    332332      }
    333     } 
     333    }
    334334  }
    335335
     
    343343         );
    344344  return Status;
    345  
     345
    346346}
    347347
     
    355355  calling restrictions. If any other agent wishes to call Stop() it must
    356356  also follow these calling restrictions.
    357  
     357
    358358  @param  This              Protocol instance pointer.
    359359  @param  ControllerHandle  Handle of device to stop driver on
     
    731731  @param  ScsiDiskDevice    The pointer of SCSI_DISK_DEV
    732732  @param  MustReadCapacity  The flag about reading device capacity
    733   @param  MediaChange       The pointer of flag indicates if media has changed 
     733  @param  MediaChange       The pointer of flag indicates if media has changed
    734734
    735735  @retval EFI_DEVICE_ERROR  Indicates that error occurs
     
    866866          break;
    867867        }
    868       } else {   
     868      } else {
    869869        Retry++;
    870870        if (!NeedRetry || (Retry >= MaxRetry)) {
     
    10331033                     );
    10341034          if (!EFI_ERROR (Status)) {
    1035             ScsiDiskDevice->BlkIo.Media->OptimalTransferLengthGranularity = 
     1035            ScsiDiskDevice->BlkIo.Media->OptimalTransferLengthGranularity =
    10361036              (BlockLimits->OptimalTransferLengthGranularity2 << 8) |
    10371037               BlockLimits->OptimalTransferLengthGranularity1;
     
    10521052    *NeedRetry = TRUE;
    10531053    return EFI_DEVICE_ERROR;
    1054  
     1054
    10551055  } else if ((Status == EFI_INVALID_PARAMETER) || (Status == EFI_UNSUPPORTED)) {
    10561056    *NeedRetry = FALSE;
     
    10881088    return EFI_DEVICE_ERROR;
    10891089  }
    1090  
     1090
    10911091  //
    10921092  // if goes here, meant ScsiInquiryCommand() failed.
     
    12441244  @param  ScsiDiskDevice     The pointer of SCSI_DISK_DEV
    12451245  @param  SenseData          The pointer of EFI_SCSI_SENSE_DATA
    1246   @param  NumberOfSenseKeys  The number of sense key 
     1246  @param  NumberOfSenseKeys  The number of sense key
    12471247  @param  Action             The pointer of action which indicates what is need to do next
    12481248
     
    13851385
    13861386  //
    1387   // submit Read Capacity(10) Command. If it returns capacity of FFFFFFFFh, 
     1387  // submit Read Capacity(10) Command. If it returns capacity of FFFFFFFFh,
    13881388  // 16 byte command should be used to access large hard disk >2TB
    13891389  //
     
    14491449   // (EFI_TIMEOUT, EFI_DEVICE_ERROR, EFI_WARN_BUFFER_TOO_SMALL)
    14501450   //
    1451  
     1451
    14521452   Status = CheckHostAdapterStatus (HostAdapterStatus);
    14531453   if ((Status == EFI_TIMEOUT) || (Status == EFI_NOT_READY)) {
    14541454     *NeedRetry = TRUE;
    14551455     return EFI_DEVICE_ERROR;
    1456  
     1456
    14571457   } else if (Status == EFI_DEVICE_ERROR) {
    14581458    //
     
    14771477    return EFI_DEVICE_ERROR;
    14781478  }
    1479  
     1479
    14801480  //
    14811481  // if goes here, meant ScsiReadCapacityCommand() failed.
     
    15571557
    15581558  @retval EFI_NOT_READY       Device is NOT ready.
    1559   @retval EFI_DEVICE_ERROR 
     1559  @retval EFI_DEVICE_ERROR
    15601560  @retval EFI_SUCCESS
    15611561
     
    16501650     if ((Status == EFI_SUCCESS) || (Status == EFI_WARN_BUFFER_TOO_SMALL)) {
    16511651        FallStatus = EFI_SUCCESS;
    1652  
     1652
    16531653     } else if ((Status == EFI_TIMEOUT) || (Status == EFI_NOT_READY)) {
    16541654       *NeedRetry  = TRUE;
    16551655       FallStatus  = EFI_DEVICE_ERROR;
    1656  
     1656
    16571657     } else if ((Status == EFI_INVALID_PARAMETER) || (Status == EFI_UNSUPPORTED)) {
    16581658       *NeedRetry  = FALSE;
    16591659       FallStatus  = EFI_DEVICE_ERROR;
    1660  
     1660
    16611661     } else if (Status == EFI_DEVICE_ERROR) {
    16621662        if (AskResetIfError) {
    16631663          ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo);
    16641664        }
    1665  
     1665
    16661666        FallStatus = EFI_DEVICE_ERROR;
    16671667    }
     
    16851685    // skip the loop.
    16861686    //
    1687     if ((PtrSenseData->Sense_Key == EFI_SCSI_SK_NO_SENSE) || 
     1687    if ((PtrSenseData->Sense_Key == EFI_SCSI_SK_NO_SENSE) ||
    16881688        (*NumberOfSenseKeys == ScsiDiskDevice->SenseDataNumber)) {
    16891689      SenseReq = FALSE;
     
    17191719                                              (Capacity10->LastLba1 << 8)  |
    17201720                                               Capacity10->LastLba0;
    1721  
     1721
    17221722    ScsiDiskDevice->BlkIo.Media->BlockSize = (Capacity10->BlockSize3 << 24) |
    1723                                              (Capacity10->BlockSize2 << 16) | 
     1723                                             (Capacity10->BlockSize2 << 16) |
    17241724                                             (Capacity10->BlockSize1 << 8)  |
    17251725                                              Capacity10->BlockSize0;
     
    17381738
    17391739    ScsiDiskDevice->BlkIo.Media->BlockSize = (Capacity16->BlockSize3 << 24) |
    1740                                              (Capacity16->BlockSize2 << 16) | 
     1740                                             (Capacity16->BlockSize2 << 16) |
    17411741                                             (Capacity16->BlockSize1 << 8)  |
    17421742                                              Capacity16->BlockSize0;
     
    18011801  BlocksRemaining   = NumberOfBlocks;
    18021802  BlockSize         = ScsiDiskDevice->BlkIo.Media->BlockSize;
    1803  
     1803
    18041804  //
    18051805  // limit the data bytes that can be transferred by one Read(10) or Read(16) Command
     
    20252025                  Lba,
    20262026                  SectorCount
    2027                   );         
     2027                  );
    20282028        }
    20292029      if (!EFI_ERROR (Status)) {
     
    26952695
    26962696  for (Index = 0; Index < SenseCounts; Index++) {
    2697    
     2697
    26982698    //
    26992699    // Sense Key is EFI_SCSI_SK_HARDWARE_ERROR (0x4)
     
    27722772
    27732773  for (Index = 0; Index < SenseCounts; Index++) {
    2774    
     2774
    27752775    //
    27762776    // Sense Key is EFI_SCSI_SK_UNIT_ATTENTION (0x6)
     
    27932793  @param  SenseData    The pointer of EFI_SCSI_SENSE_DATA
    27942794  @param  SenseCounts  The number of sense key
    2795   @param  RetryLater   The flag means if need a retry 
     2795  @param  RetryLater   The flag means if need a retry
    27962796
    27972797  @retval TRUE  Drive is ready.
     
    28882888
    28892889  for (Index = 0; Index < SenseCounts; Index++) {
    2890    
     2890
    28912891    //
    28922892    // Sense Key is SK_NO_SENSE (0x0)
     
    29352935/**
    29362936  Determine if Block Io should be produced.
    2937  
     2937
    29382938
    29392939  @param  ChildHandle  Child Handle to retrieve Parent information.
    2940  
     2940
    29412941  @retval  TRUE    Should produce Block Io.
    29422942  @retval  FALSE   Should not produce Block Io.
    29432943
    2944 **/ 
     2944**/
    29452945BOOLEAN
    29462946DetermineInstallBlockIo (
    29472947  IN  EFI_HANDLE      ChildHandle
    2948   ) 
     2948  )
    29492949{
    29502950  EFI_SCSI_PASS_THRU_PROTOCOL           *ScsiPassThru;
     
    29722972    }
    29732973  }
    2974  
     2974
    29752975  return FALSE;
    29762976}
     
    29812981  ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
    29822982  If the ControllerHandle is found, then the protocol specified by ProtocolGuid
    2983   will be opened on it. 
    2984  
     2983  will be opened on it.
     2984
    29852985
    29862986  @param  ProtocolGuid   ProtocolGuid pointer.
    29872987  @param  ChildHandle    Child Handle to retrieve Parent information.
    2988  
    2989 **/ 
     2988
     2989**/
    29902990VOID *
    29912991EFIAPI
     
    29932993  IN  EFI_GUID                          *ProtocolGuid,
    29942994  IN  EFI_HANDLE                        ChildHandle
    2995   ) 
     2995  )
    29962996{
    29972997  UINTN                                 Index;
    29982998  UINTN                                 HandleCount;
    2999   VOID                                  *Interface; 
     2999  VOID                                  *Interface;
    30003000  EFI_STATUS                            Status;
    30013001  EFI_HANDLE                            *HandleBuffer;
     
    30173017
    30183018  //
    3019   // Iterate to find who is parent handle that is opened with ProtocolGuid by ChildHandle 
     3019  // Iterate to find who is parent handle that is opened with ProtocolGuid by ChildHandle
    30203020  //
    30213021  for (Index = 0; Index < HandleCount; Index++) {
     
    30323032  gBS->FreePool (HandleBuffer);
    30333033  return NULL;
    3034 } 
     3034}
    30353035
    30363036/**
    30373037  Provides inquiry information for the controller type.
    3038  
     3038
    30393039  This function is used by the IDE bus driver to get inquiry data.  Data format
    30403040  of Identify data is defined by the Interface GUID.
     
    30453045
    30463046  @retval EFI_SUCCESS            The command was accepted without any errors.
    3047   @retval EFI_NOT_FOUND          Device does not support this data class 
    3048   @retval EFI_DEVICE_ERROR       Error reading InquiryData from device 
    3049   @retval EFI_BUFFER_TOO_SMALL   InquiryDataSize not big enough 
     3047  @retval EFI_NOT_FOUND          Device does not support this data class
     3048  @retval EFI_DEVICE_ERROR       Error reading InquiryData from device
     3049  @retval EFI_BUFFER_TOO_SMALL   InquiryDataSize not big enough
    30503050
    30513051**/
     
    30793079  of Identify data is defined by the Interface GUID.
    30803080
    3081   @param[in]      This              Pointer to the EFI_DISK_INFO_PROTOCOL 
     3081  @param[in]      This              Pointer to the EFI_DISK_INFO_PROTOCOL
    30823082                                    instance.
    30833083  @param[in, out] IdentifyData      Pointer to a buffer for the identify data.
     
    30863086
    30873087  @retval EFI_SUCCESS            The command was accepted without any errors.
    3088   @retval EFI_NOT_FOUND          Device does not support this data class 
    3089   @retval EFI_DEVICE_ERROR       Error reading IdentifyData from device 
    3090   @retval EFI_BUFFER_TOO_SMALL   IdentifyDataSize not big enough 
     3088  @retval EFI_NOT_FOUND          Device does not support this data class
     3089  @retval EFI_DEVICE_ERROR       Error reading IdentifyData from device
     3090  @retval EFI_BUFFER_TOO_SMALL   IdentifyDataSize not big enough
    30913091
    30923092**/
     
    31043104  if (CompareGuid (&This->Interface, &gEfiDiskInfoScsiInterfaceGuid) || CompareGuid (&This->Interface, &gEfiDiskInfoUfsInterfaceGuid)) {
    31053105    //
    3106     // Physical SCSI bus does not support this data class. 
     3106    // Physical SCSI bus does not support this data class.
    31073107    //
    31083108    return EFI_NOT_FOUND;
     
    31223122/**
    31233123  Provides sense data information for the controller type.
    3124  
    3125   This function is used by the IDE bus driver to get sense data. 
     3124
     3125  This function is used by the IDE bus driver to get sense data.
    31263126  Data format of Sense data is defined by the Interface GUID.
    31273127
     
    31533153  This function is used by the IDE bus driver to get controller information.
    31543154
    3155   @param[in]  This         Pointer to the EFI_DISK_INFO_PROTOCOL instance. 
     3155  @param[in]  This         Pointer to the EFI_DISK_INFO_PROTOCOL instance.
    31563156  @param[out] IdeChannel   Pointer to the Ide Channel number.  Primary or secondary.
    31573157  @param[out] IdeDevice    Pointer to the Ide Device number.  Master or slave.
     
    31943194
    31953195  @param  ScsiDiskDevice  The pointer of SCSI_DISK_DEV
    3196  
     3196
    31973197  @retval EFI_SUCCESS     The ATAPI device identify data were retrieved successfully.
    31983198  @retval others          Some error occurred during the identification that ATAPI device.
    31993199
    3200 **/ 
     3200**/
    32013201EFI_STATUS
    32023202AtapiIdentifyDevice (
     
    32343234  @param  ScsiDiskDevice  The pointer of SCSI_DISK_DEV.
    32353235  @param  ChildHandle     Child handle to install DiskInfo protocol.
    3236  
    3237 **/ 
     3236
     3237**/
    32383238VOID
    32393239InitializeInstallDiskInfo (
     
    32513251  Status = gBS->HandleProtocol (ChildHandle, &gEfiDevicePathProtocolGuid, (VOID **) &DevicePathNode);
    32523252  //
    3253   // Device Path protocol must be installed on the device handle. 
     3253  // Device Path protocol must be installed on the device handle.
    32543254  //
    32553255  ASSERT_EFI_ERROR (Status);
     
    32833283            ScsiDiskDevice->Device = AtapiDevicePath->SlaveMaster;
    32843284            //
    3285             // Update the DiskInfo.Interface to IDE interface GUID for the physical ATAPI device. 
     3285            // Update the DiskInfo.Interface to IDE interface GUID for the physical ATAPI device.
    32863286            //
    32873287            CopyGuid (&ScsiDiskDevice->DiskInfo.Interface, &gEfiDiskInfoIdeInterfaceGuid);
     
    32943294            ScsiDiskDevice->Device = SataDevicePath->PortMultiplierPortNumber;
    32953295            //
    3296             // Update the DiskInfo.Interface to AHCI interface GUID for the physical AHCI device. 
     3296            // Update the DiskInfo.Interface to AHCI interface GUID for the physical AHCI device.
    32973297            //
    32983298            CopyGuid (&ScsiDiskDevice->DiskInfo.Interface, &gEfiDiskInfoAhciInterfaceGuid);
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h

    r58459 r58466  
    7171  UINT32                    Device;
    7272  ATAPI_IDENTIFY_DATA       IdentifyData;
    73  
     73
    7474  //
    7575  // The flag indicates if 16-byte command can be used
     
    167167  calling restrictions. If any other agent wishes to call Stop() it must
    168168  also follow these calling restrictions.
    169  
     169
    170170  @param  This              Protocol instance pointer.
    171171  @param  ControllerHandle  Handle of device to stop driver on
     
    413413/**
    414414  Provides inquiry information for the controller type.
    415  
     415
    416416  This function is used by the IDE bus driver to get inquiry data.  Data format
    417417  of Identify data is defined by the Interface GUID.
     
    422422
    423423  @retval EFI_SUCCESS            The command was accepted without any errors.
    424   @retval EFI_NOT_FOUND          Device does not support this data class 
    425   @retval EFI_DEVICE_ERROR       Error reading InquiryData from device 
    426   @retval EFI_BUFFER_TOO_SMALL   InquiryDataSize not big enough 
     424  @retval EFI_NOT_FOUND          Device does not support this data class
     425  @retval EFI_DEVICE_ERROR       Error reading InquiryData from device
     426  @retval EFI_BUFFER_TOO_SMALL   InquiryDataSize not big enough
    427427
    428428**/
     
    442442  of Identify data is defined by the Interface GUID.
    443443
    444   @param[in]     This               Pointer to the EFI_DISK_INFO_PROTOCOL 
     444  @param[in]     This               Pointer to the EFI_DISK_INFO_PROTOCOL
    445445                                    instance.
    446446  @param[in, out] IdentifyData      Pointer to a buffer for the identify data.
     
    449449
    450450  @retval EFI_SUCCESS            The command was accepted without any errors.
    451   @retval EFI_NOT_FOUND          Device does not support this data class 
    452   @retval EFI_DEVICE_ERROR       Error reading IdentifyData from device 
    453   @retval EFI_BUFFER_TOO_SMALL   IdentifyDataSize not big enough 
     451  @retval EFI_NOT_FOUND          Device does not support this data class
     452  @retval EFI_DEVICE_ERROR       Error reading IdentifyData from device
     453  @retval EFI_BUFFER_TOO_SMALL   IdentifyDataSize not big enough
    454454
    455455**/
     
    465465/**
    466466  Provides sense data information for the controller type.
    467  
    468   This function is used by the IDE bus driver to get sense data. 
     467
     468  This function is used by the IDE bus driver to get sense data.
    469469  Data format of Sense data is defined by the Interface GUID.
    470470
     
    492492  This function is used by the IDE bus driver to get controller information.
    493493
    494   @param[in]  This         Pointer to the EFI_DISK_INFO_PROTOCOL instance. 
     494  @param[in]  This         Pointer to the EFI_DISK_INFO_PROTOCOL instance.
    495495  @param[out] IdeChannel   Pointer to the Ide Channel number.  Primary or secondary.
    496496  @param[out] IdeDevice    Pointer to the Ide Device number.  Master or slave.
     
    514514  @param  ScsiDiskDevice    The pointer of SCSI_DISK_DEV
    515515  @param  MustReadCapacity  The flag about reading device capacity
    516   @param  MediaChange       The pointer of flag indicates if media has changed 
     516  @param  MediaChange       The pointer of flag indicates if media has changed
    517517
    518518  @retval EFI_DEVICE_ERROR  Indicates that error occurs
     
    557557  @param  ScsiDiskDevice     The pointer of SCSI_DISK_DEV
    558558  @param  SenseData          The pointer of EFI_SCSI_SENSE_DATA
    559   @param  NumberOfSenseKeys  The number of sense key 
     559  @param  NumberOfSenseKeys  The number of sense key
    560560  @param  Action             The pointer of action which indicates what is need to do next
    561561
     
    616616
    617617  @retval EFI_NOT_READY       Device is NOT ready.
    618   @retval EFI_DEVICE_ERROR 
     618  @retval EFI_DEVICE_ERROR
    619619  @retval EFI_SUCCESS
    620620
     
    790790  IN     UINT32                SectorCount
    791791  );
    792  
     792
    793793/**
    794794  Submit Write(16) Command.
     
    814814  IN     UINT64                StartLba,
    815815  IN     UINT32                SectorCount
    816   ); 
     816  );
    817817
    818818/**
     
    913913  @param  SenseData    The pointer of EFI_SCSI_SENSE_DATA
    914914  @param  SenseCounts  The number of sense key
    915   @param  RetryLater   The flag means if need a retry 
     915  @param  RetryLater   The flag means if need a retry
    916916
    917917  @retval TRUE  Drive is ready.
     
    955955/**
    956956  Determine if Block Io should be produced.
    957  
     957
    958958
    959959  @param  ChildHandle  Child Handle to retrieve Parent information.
    960  
     960
    961961  @retval  TRUE    Should produce Block Io.
    962962  @retval  FALSE   Should not produce Block Io.
    963963
    964 **/ 
     964**/
    965965BOOLEAN
    966966DetermineInstallBlockIo (
     
    978978  @param  ScsiDiskDevice  The pointer of SCSI_DISK_DEV.
    979979  @param  ChildHandle     Child handle to install DiskInfo protocol.
    980  
    981 **/ 
     980
     981**/
    982982VOID
    983983InitializeInstallDiskInfo (
    984984  IN  SCSI_DISK_DEV   *ScsiDiskDevice,
    985985  IN  EFI_HANDLE      ChildHandle
    986   ); 
     986  );
    987987
    988988/**
     
    991991  ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
    992992  If the ControllerHandle is found, then the protocol specified by ProtocolGuid
    993   will be opened on it. 
    994  
     993  will be opened on it.
     994
    995995
    996996  @param  ProtocolGuid   ProtocolGuid pointer.
    997997  @param  ChildHandle    Child Handle to retrieve Parent information.
    998  
    999 **/ 
     998
     999**/
    10001000VOID *
    10011001EFIAPI
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf

    r58459 r58466  
    22#  The Scsi Disk driver is used to retrieve the media info in the attached SCSI disk.
    33#  It detects the SCSI disk media and installs Block I/O Protocol on the device handle.
    4 # 
     4#
    55#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    66#  This program and the accompanying materials
     
    88#  which accompanies this distribution.  The full text of the license may be found at
    99#  http://opensource.org/licenses/bsd-license.php
    10 # 
     10#
    1111#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    13 # 
     13#
    1414##
    1515
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette