[CDROM_NEW] Import Microsoft CDROM class driver from GitHub
[reactos.git] / drivers / storage / class / cdrom_new / mmc.h
1 /*++
2
3 Copyright (C) Microsoft Corporation. All rights reserved.
4
5 Module Name:
6
7 mmc.h
8
9 Abstract:
10
11 Functions for MMC area.
12
13 Author:
14
15 Environment:
16
17 kernel mode only
18
19 Notes:
20
21
22 Revision History:
23
24 --*/
25
26 #ifndef __MMC_H__
27 #define __MMC_H__
28
29 _IRQL_requires_max_(APC_LEVEL)
30 VOID
31 DeviceDeallocateMmcResources(
32 _In_ WDFDEVICE Device
33 );
34
35 _IRQL_requires_max_(PASSIVE_LEVEL)
36 NTSTATUS
37 DeviceAllocateMmcResources(
38 _In_ WDFDEVICE Device
39 );
40
41 _IRQL_requires_max_(PASSIVE_LEVEL)
42 NTSTATUS
43 DeviceUpdateMmcCapabilities(
44 _In_ WDFDEVICE Device
45 );
46
47 _IRQL_requires_max_(PASSIVE_LEVEL)
48 NTSTATUS
49 DeviceGetConfigurationWithAlloc(
50 _In_ WDFDEVICE Device,
51 _Outptr_result_bytebuffer_all_(*BytesReturned)
52 PGET_CONFIGURATION_HEADER * Buffer,
53 _Out_ PULONG BytesReturned,
54 FEATURE_NUMBER const StartingFeature,
55 ULONG const RequestedType
56 );
57
58 _IRQL_requires_max_(PASSIVE_LEVEL)
59 NTSTATUS
60 DeviceGetConfiguration(
61 _In_ WDFDEVICE Device,
62 _Out_writes_bytes_to_(BufferSize, *ValidBytes)
63 PGET_CONFIGURATION_HEADER Buffer,
64 _In_ ULONG const BufferSize,
65 _Out_ PULONG ValidBytes,
66 _In_ FEATURE_NUMBER const StartingFeature,
67 _In_ ULONG const RequestedType
68 );
69
70 _IRQL_requires_max_(APC_LEVEL)
71 VOID
72 DeviceUpdateMmcWriteCapability(
73 _In_reads_bytes_(BufferSize)
74 PGET_CONFIGURATION_HEADER Buffer,
75 ULONG const BufferSize,
76 BOOLEAN const CurrentOnly, // TRUE == can drive write now, FALSE == can drive ever write
77 _Out_ PBOOLEAN Writable,
78 _Out_ PFEATURE_NUMBER ValidationSchema,
79 _Out_ PULONG BlockingFactor
80 );
81
82 _IRQL_requires_max_(APC_LEVEL)
83 PVOID
84 MmcDataFindFeaturePage(
85 _In_reads_bytes_(Length)
86 PGET_CONFIGURATION_HEADER FeatureBuffer,
87 ULONG const Length,
88 FEATURE_NUMBER const Feature
89 );
90
91 _IRQL_requires_max_(APC_LEVEL)
92 VOID
93 MmcDataFindProfileInProfiles(
94 _In_ FEATURE_DATA_PROFILE_LIST const* ProfileHeader,
95 _In_ FEATURE_PROFILE_TYPE const ProfileToFind,
96 _In_ BOOLEAN const CurrentOnly,
97 _Out_ PBOOLEAN Found
98 );
99
100 _IRQL_requires_max_(APC_LEVEL)
101 _Ret_range_(-1,MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS)
102 LONGLONG
103 DeviceRetryTimeGuessBasedOnProfile(
104 FEATURE_PROFILE_TYPE const Profile
105 );
106
107 _IRQL_requires_max_(APC_LEVEL)
108 _Ret_range_(-1,MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS)
109 LONGLONG
110 DeviceRetryTimeDetectionBasedOnModePage2A(
111 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
112 );
113
114 _IRQL_requires_max_(APC_LEVEL)
115 _Ret_range_(-1,MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS)
116 LONGLONG
117 DeviceRetryTimeDetectionBasedOnGetPerformance(
118 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
119 _In_ BOOLEAN UseLegacyNominalPerformance
120 );
121
122 #endif // __MMC_H__