-
Notifications
You must be signed in to change notification settings - Fork 7
/
pciconfig.cpp
42 lines (38 loc) · 978 Bytes
/
pciconfig.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "precomp.h"
#include "adapter.h"
UINT8 ConfigRead8(_In_ RT_ADAPTER* adapter, UINT32 reg) {
UINT8 val;
adapter->PciConfig.GetBusData(
adapter->PciConfig.Context,
PCI_WHICHSPACE_CONFIG,
&val,
reg,
sizeof(val));
return val;
}
UINT16 ConfigRead16(_In_ RT_ADAPTER* adapter, UINT32 reg) {
UINT16 val;
adapter->PciConfig.GetBusData(
adapter->PciConfig.Context,
PCI_WHICHSPACE_CONFIG,
&val,
reg,
sizeof(val));
return val;
}
void ConfigWrite8(_In_ RT_ADAPTER* adapter, UINT32 reg, UINT8 val) {
adapter->PciConfig.SetBusData(
adapter->PciConfig.Context,
PCI_WHICHSPACE_CONFIG,
&val,
reg,
sizeof(val));
}
void ConfigWrite16(_In_ RT_ADAPTER* adapter, UINT32 reg, UINT16 val) {
adapter->PciConfig.SetBusData(
adapter->PciConfig.Context,
PCI_WHICHSPACE_CONFIG,
&val,
reg,
sizeof(val));
}