diff options
| author | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
|---|---|---|
| committer | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
| commit | 97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch) | |
| tree | 46f3701832d70b420eb0fc0eb93261f9da45db3f /spb/SpbTestTool/sys/internal.h | |
| parent | ef1905bf1e8825bb31120dfb27e0daf3154d859a (diff) | |
Initial publish
Diffstat (limited to 'spb/SpbTestTool/sys/internal.h')
| -rw-r--r-- | spb/SpbTestTool/sys/internal.h | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/spb/SpbTestTool/sys/internal.h b/spb/SpbTestTool/sys/internal.h new file mode 100644 index 00000000..7e40560b --- /dev/null +++ b/spb/SpbTestTool/sys/internal.h @@ -0,0 +1,144 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + internal.h + +Abstract: + + This module contains the common internal type and function + definitions for the SPB peripheral driver. + +Environment: + + kernel-mode only + +Revision History: + +--*/ + +#ifndef _INTERNAL_H_ +#define _INTERNAL_H_ + +#pragma warning(push) +#pragma warning(disable:4512) +#pragma warning(disable:4480) + +#define SPBT_POOL_TAG ((ULONG) 'TBPS') + +///////////////////////////////////////////////// +// +// Common includes. +// +///////////////////////////////////////////////// + +#include <ntddk.h> +#include <wdm.h> +#include <wdf.h> +#include <ntstrsafe.h> + +#include "spb.h" +#include "spbtestioctl.h" + +#define RESHUB_USE_HELPER_ROUTINES +#include "reshub.h" + +#include "trace.h" + +// +// Forward Declarations +// + +typedef struct _DEVICE_CONTEXT DEVICE_CONTEXT, *PDEVICE_CONTEXT; +typedef struct _REQUEST_CONTEXT REQUEST_CONTEXT, *PREQUEST_CONTEXT; + +struct _DEVICE_CONTEXT +{ + // + // Handle back to the WDFDEVICE + // + + WDFDEVICE FxDevice; + + // + // Handle to the sequential SPB queue + // + + WDFQUEUE SpbQueue; + + // + // Connection ID for SPB peripheral + // + + LARGE_INTEGER PeripheralId; + + // + // Interrupt object and wait event + // + + WDFINTERRUPT Interrupt; + KEVENT IsrWaitEvent; + + // + // Setting indicating whether the interrupt should be connected + // + + BOOLEAN ConnectInterrupt; + + // + // SPB controller target + // + + WDFIOTARGET SpbController; + + // + // SPB request object + // + + WDFREQUEST SpbRequest; + + // + // Input memory for request. Valid while request in progress. + // + + WDFMEMORY InputMemory; + + // + // Client request object + // + + WDFREQUEST ClientRequest; + + // + // WaitOnInterrupt request object + // + + WDFREQUEST WaitOnInterruptRequest; +}; + +struct _REQUEST_CONTEXT +{ + // + // Associated framework device object + // + + WDFDEVICE FxDevice; + + // + // Variables to track write length for a sequence request. + // There are needed to complete the client request with + // correct bytesReturned value. + // + + BOOLEAN IsSpbSequenceRequest; + ULONG_PTR SequenceWriteLength; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_CONTEXT, GetDeviceContext); +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(REQUEST_CONTEXT, GetRequestContext); + +#pragma warning(pop) + +#endif // _INTERNAL_H_ |
