Device Presence Check - Using Acpi - Intel 82801EB Programmer's Reference Manual

Serial ata controller
Table of Contents

Advertisement

R
// At this point, iAllStatus will contain:
// 0 ==> no devices present
// 1 ==> master device present
// 2 ==> slave device present
// -1 ==> Not supported or unknown (P-ATA)
//
return( iAllStatus); // done
A.4
Device Presence Check – Using ACPI
//
// The following sample code (for Windows WDM drivers) can be used to execute a
// control method that will return the status of the SATA port(s) associated with
// a SATA channel. It also illustrates how to execute an ACPI control method that
// returns the connection status for a logical channel. This code assumes that a
// PDO (Physical Device Object) exists for both the logical primary and secondary
// channels. WDM device drivers can only execute control methods associated with
// their corresponding _ADR object in ACPI namespace (of which there is a direct
// relationship between the _ADR object and the PDO).
// This sample driver code uses the ACPI sample code illustrated
// in A.5 ACPI Control Method (GSPS).
//
// Function Protos
NTSTATUS SATA_CheckPortStatus( IN PDEVICE_OBJECT pDO, PDWORD pdwStatus);
NTSTATUS SendIRP( IN PDEVICE_OBJECT Pdo, IN ULONG Ioctl, IN PVOID InputBuffer,
VOID ProcessConnectStatus( DWORD dwPortStatus);
{
.
.
.
NT_STATUS status;
DWORD dwPortStatus;
Status = SATA_CheckPortStatus( pDO, &dwPortStatus);
if( !NT_SUCCESS( status))
ProcessConnectStatus( dwPortStatus); // TODO – implementation specific
SATA Programmer's Reference Manual
IN ULONG InputSize, IN PACPI_EVAL_OUTPUT_BUFFER OutputBuffer,
IN ULONG OutputSize);
//
// Not an ACPI OS or control method not supported. Set the
// status to indicate that port status is unknown
//
dwPortStatus = -1;
Theory of Operation
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

82801erIch5Ich5r

Table of Contents