X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=FatPkg%2FEnhancedFatDxe%2FFat.c;h=e29c64cb0347333f5668bb67b55e42aaea2e56ed;hp=2080005adc95321806ee03708a3883b4bce5d628;hb=d0def00d33fa5d4a70c427dfc9a36d826b42967d;hpb=b6efb80ad0fe5c3fd89484afd9a057532630b114 diff --git a/FatPkg/EnhancedFatDxe/Fat.c b/FatPkg/EnhancedFatDxe/Fat.c index 2080005adc..e29c64cb03 100644 --- a/FatPkg/EnhancedFatDxe/Fat.c +++ b/FatPkg/EnhancedFatDxe/Fat.c @@ -1,4 +1,5 @@ -/*++ +/** @file + Fat File System driver routines that support EFI driver model. Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available @@ -9,19 +10,21 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ -Module Name: - - Fat.c +#include "Fat.h" -Abstract: +/** - Fat File System driver routines that support EFI driver model + Register Driver Binding protocol for this driver. ---*/ + @param ImageHandle - Handle for the image of this driver. + @param SystemTable - Pointer to the EFI System Table. -#include "Fat.h" + @retval EFI_SUCCESS - Driver loaded. + @return other - Driver not loaded. +**/ EFI_STATUS EFIAPI FatEntryPoint ( @@ -29,12 +32,36 @@ FatEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ); +/** + + Unload function for this image. Uninstall DriverBinding protocol. + + @param ImageHandle - Handle for the image of this driver. + + @retval EFI_SUCCESS - Driver unloaded successfully. + @return other - Driver can not unloaded. + +**/ EFI_STATUS EFIAPI FatUnload ( IN EFI_HANDLE ImageHandle ); +/** + + Test to see if this driver can add a file system to ControllerHandle. + ControllerHandle must support both Disk IO and Block IO protocols. + + @param This - Protocol instance pointer. + @param ControllerHandle - Handle of device to test. + @param RemainingDevicePath - Not used. + + @retval EFI_SUCCESS - This driver supports this device. + @retval EFI_ALREADY_STARTED - This driver is already running on this device. + @return other - This driver does not support this device. + +**/ EFI_STATUS EFIAPI FatDriverBindingSupported ( @@ -43,6 +70,22 @@ FatDriverBindingSupported ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ); +/** + + Start this driver on ControllerHandle by opening a Block IO and Disk IO + protocol, reading Device Path. Add a Simple File System protocol to + ControllerHandle if the media contains a valid file system. + + @param This - Protocol instance pointer. + @param ControllerHandle - Handle of device to bind driver to. + @param RemainingDevicePath - Not used. + + @retval EFI_SUCCESS - This driver is added to DeviceHandle. + @retval EFI_ALREADY_STARTED - This driver is already running on DeviceHandle. + @retval EFI_OUT_OF_RESOURCES - Can not allocate the memory. + @return other - This driver does not support this device. + +**/ EFI_STATUS EFIAPI FatDriverBindingStart ( @@ -51,6 +94,19 @@ FatDriverBindingStart ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ); +/** + + Stop this driver on ControllerHandle. + + @param This - Protocol instance pointer. + @param ControllerHandle - Handle of device to stop driver on. + @param NumberOfChildren - Not used. + @param ChildHandleBuffer - Not used. + + @retval EFI_SUCCESS - This driver is removed DeviceHandle. + @return other - This driver was not removed from this device. + +**/ EFI_STATUS EFIAPI FatDriverBindingStop ( @@ -72,29 +128,23 @@ EFI_DRIVER_BINDING_PROTOCOL gFatDriverBinding = { NULL }; +/** + + Register Driver Binding protocol for this driver. + + @param ImageHandle - Handle for the image of this driver. + @param SystemTable - Pointer to the EFI System Table. + + @retval EFI_SUCCESS - Driver loaded. + @return other - Driver not loaded. + +**/ EFI_STATUS EFIAPI FatEntryPoint ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) -/*++ - -Routine Description: - - Register Driver Binding protocol for this driver. - -Arguments: - - ImageHandle - Handle for the image of this driver. - SystemTable - Pointer to the EFI System Table. - -Returns: - - EFI_SUCCESS - Driver loaded. - other - Driver not loaded. - ---*/ { EFI_STATUS Status; @@ -114,27 +164,21 @@ Returns: return Status; } -EFI_STATUS -EFIAPI -FatUnload ( - IN EFI_HANDLE ImageHandle - ) -/*++ - -Routine Description: +/** Unload function for this image. Uninstall DriverBinding protocol. -Arguments: - - ImageHandle - Handle for the image of this driver. - -Returns: + @param ImageHandle - Handle for the image of this driver. - EFI_SUCCESS - Driver unloaded successfully. - other - Driver can not unloaded. + @retval EFI_SUCCESS - Driver unloaded successfully. + @return other - Driver can not unloaded. ---*/ +**/ +EFI_STATUS +EFIAPI +FatUnload ( + IN EFI_HANDLE ImageHandle + ) { EFI_STATUS Status; EFI_HANDLE *DeviceHandleBuffer; @@ -224,6 +268,20 @@ Returns: return Status; } +/** + + Test to see if this driver can add a file system to ControllerHandle. + ControllerHandle must support both Disk IO and Block IO protocols. + + @param This - Protocol instance pointer. + @param ControllerHandle - Handle of device to test. + @param RemainingDevicePath - Not used. + + @retval EFI_SUCCESS - This driver supports this device. + @retval EFI_ALREADY_STARTED - This driver is already running on this device. + @return other - This driver does not support this device. + +**/ EFI_STATUS EFIAPI FatDriverBindingSupported ( @@ -231,26 +289,6 @@ FatDriverBindingSupported ( IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) -/*++ - -Routine Description: - - Test to see if this driver can add a file system to ControllerHandle. - ControllerHandle must support both Disk IO and Block IO protocols. - -Arguments: - - This - Protocol instance pointer. - ControllerHandle - Handle of device to test. - RemainingDevicePath - Not used. - -Returns: - - EFI_SUCCESS - This driver supports this device. - EFI_ALREADY_STARTED - This driver is already running on this device. - other - This driver does not support this device. - ---*/ { EFI_STATUS Status; EFI_DISK_IO_PROTOCOL *DiskIo; @@ -295,35 +333,29 @@ Returns: return Status; } -EFI_STATUS -EFIAPI -FatDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -/*++ - -Routine Description: +/** Start this driver on ControllerHandle by opening a Block IO and Disk IO protocol, reading Device Path. Add a Simple File System protocol to ControllerHandle if the media contains a valid file system. -Arguments: - - This - Protocol instance pointer. - ControllerHandle - Handle of device to bind driver to. - RemainingDevicePath - Not used. - -Returns: + @param This - Protocol instance pointer. + @param ControllerHandle - Handle of device to bind driver to. + @param RemainingDevicePath - Not used. - EFI_SUCCESS - This driver is added to DeviceHandle. - EFI_ALREADY_STARTED - This driver is already running on DeviceHandle. - EFI_OUT_OF_RESOURCES - Can not allocate the memory. - other - This driver does not support this device. + @retval EFI_SUCCESS - This driver is added to DeviceHandle. + @retval EFI_ALREADY_STARTED - This driver is already running on DeviceHandle. + @retval EFI_OUT_OF_RESOURCES - Can not allocate the memory. + @return other - This driver does not support this device. ---*/ +**/ +EFI_STATUS +EFIAPI +FatDriverBindingStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ) { EFI_STATUS Status; EFI_BLOCK_IO_PROTOCOL *BlockIo; @@ -430,6 +462,19 @@ Exit: return Status; } +/** + + Stop this driver on ControllerHandle. + + @param This - Protocol instance pointer. + @param ControllerHandle - Handle of device to stop driver on. + @param NumberOfChildren - Not used. + @param ChildHandleBuffer - Not used. + + @retval EFI_SUCCESS - This driver is removed DeviceHandle. + @return other - This driver was not removed from this device. + +**/ EFI_STATUS EFIAPI FatDriverBindingStop ( @@ -438,22 +483,6 @@ FatDriverBindingStop ( IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer ) -/*++ - -Routine Description: - Stop this driver on ControllerHandle. - -Arguments: - This - Protocol instance pointer. - ControllerHandle - Handle of device to stop driver on. - NumberOfChildren - Not used. - ChildHandleBuffer - Not used. - -Returns: - EFI_SUCCESS - This driver is removed DeviceHandle. - other - This driver was not removed from this device. - ---*/ { EFI_STATUS Status; EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem;