mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 12:55:43 +00:00
Required changes to meet community coding style.
svn path=/branches/GSoC_2016/AHCI/; revision=71500
This commit is contained in:
parent
a60737f997
commit
c62ab931ac
3 changed files with 292 additions and 260 deletions
|
@ -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"
|
#include "storahci.h"
|
||||||
|
|
||||||
BOOLEAN AhciAdapterReset(
|
BOOLEAN AhciAdapterReset(
|
||||||
__in PAHCI_ADAPTER_EXTENSION adapterExtension
|
__in PAHCI_ADAPTER_EXTENSION adapterExtension
|
||||||
);
|
);
|
||||||
|
|
||||||
ULONG AhciFindAdapter(
|
/**
|
||||||
IN PVOID DeviceExtension,
|
* @name AhciFindAdapter
|
||||||
__in PVOID HwContext,
|
* @implemented
|
||||||
__in PVOID BusInformation,
|
*
|
||||||
__in IN PVOID ArgumentString,
|
|
||||||
__inout PPORT_CONFIGURATION_INFORMATION ConfigInfo,
|
|
||||||
__in PBOOLEAN Reserved3
|
|
||||||
)
|
|
||||||
{
|
|
||||||
/* Description :
|
|
||||||
* The HwStorFindAdapter routine uses the supplied configuration to determine whether a specific
|
* 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.
|
* HBA is supported and, if it is, to return configuration information about that adapter.
|
||||||
*
|
*
|
||||||
* Refernce:
|
|
||||||
* 10.1 Platform Communication
|
* 10.1 Platform Communication
|
||||||
* http://www.intel.in/content/dam/www/public/us/en/documents/technical-specifications/serial-ata-ahci-spec-rev1_2.pdf
|
* 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
|
* 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.
|
* 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
|
* SP_RETURN_NOT_FOUND
|
||||||
* Indicates that no supported HBA was found for the supplied configuration information.
|
* 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 ghc;
|
||||||
ULONG portCount, portImplemented;
|
ULONG portCount, portImplemented;
|
||||||
ULONG pci_cfg_len;
|
ULONG pci_cfg_len;
|
||||||
|
@ -144,16 +161,23 @@ ULONG AhciFindAdapter(
|
||||||
return SP_RETURN_FOUND;
|
return SP_RETURN_FOUND;
|
||||||
}// -- AhciFindAdapter();
|
}// -- 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(
|
ULONG DriverEntry(
|
||||||
IN PVOID DriverObject,
|
IN PVOID DriverObject,
|
||||||
IN PVOID RegistryPath
|
IN PVOID RegistryPath
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Description :
|
|
||||||
* Initial Entrypoint for storahci miniport driver
|
|
||||||
*/
|
|
||||||
|
|
||||||
HW_INITIALIZATION_DATA hwInitializationData;
|
HW_INITIALIZATION_DATA hwInitializationData;
|
||||||
ULONG i, status;
|
ULONG i, status;
|
||||||
|
|
||||||
|
@ -193,11 +217,10 @@ ULONG DriverEntry(
|
||||||
return status;
|
return status;
|
||||||
}// -- DriverEntry();
|
}// -- DriverEntry();
|
||||||
|
|
||||||
BOOLEAN AhciAdapterReset(
|
/**
|
||||||
PAHCI_ADAPTER_EXTENSION adapterExtension
|
* @name AhciAdapterReset
|
||||||
)
|
* @implemented
|
||||||
{
|
*
|
||||||
/*
|
|
||||||
* 10.4.3 HBA Reset
|
* 10.4.3 HBA Reset
|
||||||
* If the HBA becomes unusable for multiple ports, and a software reset or port reset does not correct the
|
* 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
|
* 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.
|
* 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
|
* 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.
|
* 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;
|
ULONG ghc, ticks;
|
||||||
PAHCI_MEMORY_REGISTERS abar = NULL;
|
PAHCI_MEMORY_REGISTERS abar = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue