Theory of Operation
R
SATA Programmer’s Reference Manual
31
Appendix A – Coding Examples
A.1
Enabling/Disabling SATA Ports from a WDM Driver
.
.
.
//
// Function Proto for Reading and Writing to device configuration space
//
NTSTATUS ReadWriteConfigSpace( PDEVICE_OBJECT pDO, BOOLEAN fRead, PVOID pBuf,
ULONG Offset, ULONG Length);
//
//
// This example illustrates how a WDM driver could read/write the
PCS.PxE
bits for
// enabling or disabling the SATA port(s).
//
// This example assumes direct access to the SATA PCI Configuration space
//
//
// Disable the ports. For simplicity, we don’t do any status checking
//
BYTE val = 0; // to disable both ports
ReadWriteConfigSpace( pDO, TRUE, &val, 0x92, sizeof( val));
.
.
.
//
// Enable the ports. For simplicity, we don’t do any status checking
//
BYTE val = 3; // to enable both ports
ReadWriteConfigSpace( pDO, FALSE, &val, 0x92, sizeof( val));
.
.
.
//
// Enable only port 0. For simplicity, we don’t do any status
// checking
//
BYTE val;
Summary of Contents for 82801EB
Page 6: ...R 6 SATA Programmer s Reference Manual This page is intentionally left blank...
Page 8: ...Introduction R 8 SATA Programmer s Reference Manual This page is intentionally left blank...
Page 10: ...Conventions R 10 SATA Programmer s Reference Manual This page is intentionally left blank...
Page 59: ...Theory of Operation R SATA Programmer s Reference Manual 59...