Required changes to meet community coding style.

svn path=/branches/GSoC_2016/AHCI/; revision=71500
This commit is contained in:
Aman Priyadarshi 2016-06-02 14:43:56 +00:00
parent a60737f997
commit c62ab931ac
3 changed files with 292 additions and 260 deletions

View file

@ -1,27 +1,34 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GNU GPLv2 only as published by the Free Software Foundation
* PURPOSE: To Implement AHCI Miniport driver targeting storport NT 5.2
* PROGRAMMERS: Aman Priyadarshi (aman.eureka@gmail.com)
*/
#include "storahci.h"
BOOLEAN AhciAdapterReset(
__in PAHCI_ADAPTER_EXTENSION adapterExtension
);
ULONG AhciFindAdapter(
IN PVOID DeviceExtension,
__in PVOID HwContext,
__in PVOID BusInformation,
__in IN PVOID ArgumentString,
__inout PPORT_CONFIGURATION_INFORMATION ConfigInfo,
__in PBOOLEAN Reserved3
)
{
/* Description :
/**
* @name AhciFindAdapter
* @implemented
*
* The HwStorFindAdapter routine uses the supplied configuration to determine whether a specific
* HBA is supported and, if it is, to return configuration information about that adapter.
*
* Refernce:
* 10.1 Platform Communication
* http://www.intel.in/content/dam/www/public/us/en/documents/technical-specifications/serial-ata-ahci-spec-rev1_2.pdf
* @param DeviceExtension
* @param HwContext
* @param BusInformation
* @param ArgumentString
* @param ConfigInfo
* @param Reserved3
*
* Return Value:
* @return
* SP_RETURN_FOUND
* Indicates that a supported HBA was found and that the HBA-relevant configuration information was successfully determined and set in the PORT_CONFIGURATION_INFORMATION structure.
*
@ -33,8 +40,18 @@ ULONG AhciFindAdapter(
*
* SP_RETURN_NOT_FOUND
* Indicates that no supported HBA was found for the supplied configuration information.
*
* @remarks Called by Storport.
*/
ULONG AhciFindAdapter(
IN PVOID DeviceExtension,
__in PVOID HwContext,
__in PVOID BusInformation,
__in IN PVOID ArgumentString,
__inout PPORT_CONFIGURATION_INFORMATION ConfigInfo,
__in PBOOLEAN Reserved3
)
{
ULONG ghc;
ULONG portCount, portImplemented;
ULONG pci_cfg_len;
@ -144,16 +161,23 @@ ULONG AhciFindAdapter(
return SP_RETURN_FOUND;
}// -- AhciFindAdapter();
/**
* @name DriverEntry
* @implemented
*
* Initial Entrypoint for storahci miniport driver
*
* @param DriverObject
* @param RegistryPath
*
* @return
* NT_STATUS in case of driver loaded successfully.
*/
ULONG DriverEntry(
IN PVOID DriverObject,
IN PVOID RegistryPath
)
{
/*
* Description :
* Initial Entrypoint for storahci miniport driver
*/
HW_INITIALIZATION_DATA hwInitializationData;
ULONG i, status;
@ -193,11 +217,10 @@ ULONG DriverEntry(
return status;
}// -- DriverEntry();
BOOLEAN AhciAdapterReset(
PAHCI_ADAPTER_EXTENSION adapterExtension
)
{
/*
/**
* @name AhciAdapterReset
* @implemented
*
* 10.4.3 HBA Reset
* If the HBA becomes unusable for multiple ports, and a software reset or port reset does not correct the
* problem, software may reset the entire HBA by setting GHC.HR to 1. When software sets the GHC.HR
@ -207,7 +230,16 @@ BOOLEAN AhciAdapterReset(
* the HBA reset has completed.
* If the HBA has not cleared GHC.HR to 0 within 1 second of software setting GHC.HR to 1, the HBA is in
* a hung or locked state.
*
* @param adapterExtension
*
* @return
* TRUE in case AHCI Controller RESTARTED successfully. i.e GHC.HR == 0
*/
BOOLEAN AhciAdapterReset(
PAHCI_ADAPTER_EXTENSION adapterExtension
)
{
ULONG ghc, ticks;
PAHCI_MEMORY_REGISTERS abar = NULL;