Skip to content

Commit af79188

Browse files
Vitalii ChulakYanVugenfirer
authored andcommitted
RHEL-69071: clang-format for Common folder in NetKVM
Signed-off-by: Vitalii Chulak <vitalii@daynix.com>
1 parent bb1139c commit af79188

35 files changed

Lines changed: 4071 additions & 3329 deletions

NetKVM/Common/DebugData.h

100755100644
Lines changed: 88 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -37,121 +37,118 @@
3737

3838
typedef enum class _etagHistoryLogOperation
3939
{
40-
hopPowerOff, // common::PowerOff, 1/0 - entry/exit (none, entry, none, none)
41-
hopPowerOn, // common::PowerOn, 1/0 - entry/exit (none, entry, none, none)
42-
hopSysPause, // ndis6::Pause, 1/0 - entry/completion
43-
hopSysResume, // ndis6::Restart, 1/0 - entry/completion
44-
hopInternalSendPause, // implementation, 1/0 - entry/completion
45-
hopInternalReceivePause, // implementation, 1/0 - entry/completion
46-
hopInternalSendResume, // implementation
47-
hopInternalReceiveResume, // implementation
48-
hopSysReset, // implementation driver, 1/0 - entry/completion
49-
hopHalt, // implementation driver, 1/0 - entry/completion
50-
hopConnectIndication, // implementation
51-
hopDPC, // common::DpcWorkBody (1, none, none, none) (0, left, free buffers, free desc)
52-
hopSend, // implementation, when Send requested (nbl, nof lists, nof bufs, nof bytes) (packet, 1, nof packets, none)
53-
hopSendNBLRequest, // ndis6 implementation (nbl, nof packets, none, none)
54-
hopSendPacketRequest, // not used
55-
hopSendPacketMapped, // implementation, before the packet inserted into queue (nbl, which packet, nof frags, none)
56-
hopSubmittedPacket, // implementation, when the packet submitted (nbl, which packet, result, flags)
57-
hopBufferSent, // implementation, when the packet returned from VirtIO queue (nbl, packet no., free buf, free desc)
58-
hopReceiveStat, // common: RX (none, retrieved, reported, ready rx buffers)
59-
hopBufferReturned, // not used
60-
hopSendComplete, // implementation, when the packet completed
40+
hopPowerOff, // common::PowerOff, 1/0 - entry/exit (none, entry, none, none)
41+
hopPowerOn, // common::PowerOn, 1/0 - entry/exit (none, entry, none, none)
42+
hopSysPause, // ndis6::Pause, 1/0 - entry/completion
43+
hopSysResume, // ndis6::Restart, 1/0 - entry/completion
44+
hopInternalSendPause, // implementation, 1/0 - entry/completion
45+
hopInternalReceivePause, // implementation, 1/0 - entry/completion
46+
hopInternalSendResume, // implementation
47+
hopInternalReceiveResume, // implementation
48+
hopSysReset, // implementation driver, 1/0 - entry/completion
49+
hopHalt, // implementation driver, 1/0 - entry/completion
50+
hopConnectIndication, // implementation
51+
hopDPC, // common::DpcWorkBody (1, none, none, none) (0, left, free buffers, free desc)
52+
hopSend, // implementation, when Send requested (nbl, nof lists, nof bufs, nof bytes) (packet, 1, nof packets, none)
53+
hopSendNBLRequest, // ndis6 implementation (nbl, nof packets, none, none)
54+
hopSendPacketRequest, // not used
55+
hopSendPacketMapped, // implementation, before the packet inserted into queue (nbl, which packet, nof frags, none)
56+
hopSubmittedPacket, // implementation, when the packet submitted (nbl, which packet, result, flags)
57+
hopBufferSent, // implementation, when the packet returned from VirtIO queue (nbl, packet no., free buf, free desc)
58+
hopReceiveStat, // common: RX (none, retrieved, reported, ready rx buffers)
59+
hopBufferReturned, // not used
60+
hopSendComplete, // implementation, when the packet completed
6161
hopTxProcess,
62-
hopPacketReceived, // implementation, when the packet prepared for indication (nbl, length, prio tag, type)
63-
hopOidRequest, // implementation, none, OID, on entry(type, 1), on exit (status, 0), on complete (status, 2)
64-
hopPnpEvent // common, none, event, 0, 0
65-
}eHistoryLogOperation;
62+
hopPacketReceived, // implementation, when the packet prepared for indication (nbl, length, prio tag, type)
63+
hopOidRequest, // implementation, none, OID, on entry(type, 1), on exit (status, 0), on complete (status, 2)
64+
hopPnpEvent // common, none, event, 0, 0
65+
} eHistoryLogOperation;
6666

6767
// {E51FCE18-B3E7-441e-B18C-D9E9B71616F3}
68-
static const GUID ParaNdis_CrashGuid =
69-
{ 0xe51fce18, 0xb3e7, 0x441e, { 0xb1, 0x8c, 0xd9, 0xe9, 0xb7, 0x16, 0x16, 0xf3 } };
68+
static const GUID ParaNdis_CrashGuid = {0xe51fce18, 0xb3e7, 0x441e, {0xb1, 0x8c, 0xd9, 0xe9, 0xb7, 0x16, 0x16, 0xf3}};
7069

7170
/* This structure is NOT changeable */
7271
typedef struct _tagBugCheckStaticDataHeader
7372
{
74-
USHORT SizeOfPointer;
75-
USHORT StaticDataVersion;
76-
USHORT PerNicDataVersion;
77-
USHORT ulMaxContexts;
78-
LARGE_INTEGER qCrashTime;
79-
UINT64 PerNicData;
80-
UINT64 DataArea;
81-
UINT64 DataAreaSize;
82-
}tBugCheckStaticDataHeader;
73+
USHORT SizeOfPointer;
74+
USHORT StaticDataVersion;
75+
USHORT PerNicDataVersion;
76+
USHORT ulMaxContexts;
77+
LARGE_INTEGER qCrashTime;
78+
UINT64 PerNicData;
79+
UINT64 DataArea;
80+
UINT64 DataAreaSize;
81+
} tBugCheckStaticDataHeader;
8382

8483
/* This structure is NOT changeable */
8584
typedef struct _tagBugCheckDataLocation
8685
{
87-
UINT64 Address;
88-
UINT64 Size;
89-
}tBugCheckDataLocation;
86+
UINT64 Address;
87+
UINT64 Size;
88+
} tBugCheckDataLocation;
9089

91-
#define PARANDIS_DEBUG_STATIC_DATA_VERSION 1
92-
#define PARANDIS_DEBUG_PER_NIC_DATA_VERSION 0
93-
#define PARANDIS_DEBUG_HISTORY_DATA_VERSION 1
94-
#define PARANDIS_DEBUG_PENDING_NBL_ENTRY_VERSION 0
90+
#define PARANDIS_DEBUG_STATIC_DATA_VERSION 1
91+
#define PARANDIS_DEBUG_PER_NIC_DATA_VERSION 0
92+
#define PARANDIS_DEBUG_HISTORY_DATA_VERSION 1
93+
#define PARANDIS_DEBUG_PENDING_NBL_ENTRY_VERSION 0
9594

9695
/* This structure is NOT changeable */
9796
typedef struct _tagBugCheckStaticDataContent_V0
9897
{
99-
ULONG SizeOfHistory;
100-
ULONG SizeOfHistoryEntry;
101-
LONG CurrentHistoryIndex;
102-
ULONG HistoryDataVersion;
103-
ULONG64 HistoryData;
104-
}tBugCheckStaticDataContent_V0;
98+
ULONG SizeOfHistory;
99+
ULONG SizeOfHistoryEntry;
100+
LONG CurrentHistoryIndex;
101+
ULONG HistoryDataVersion;
102+
ULONG64 HistoryData;
103+
} tBugCheckStaticDataContent_V0;
105104

106105
#define PARANDIS_DEBUG_INTERRUPTS
107106

108107
#ifdef PARANDIS_DEBUG_INTERRUPTS
109-
# define PARANDIS_STORE_LAST_INTERRUPT_TIMESTAMP(p) \
110-
NdisGetCurrentSystemTime(&(p)->LastInterruptTimeStamp)
111-
# define PARANDIS_GET_LAST_INTERRUPT_TIMESTAMP(p) \
112-
(p)->LastInterruptTimeStamp.QuadPart
108+
#define PARANDIS_STORE_LAST_INTERRUPT_TIMESTAMP(p) NdisGetCurrentSystemTime(&(p)->LastInterruptTimeStamp)
109+
#define PARANDIS_GET_LAST_INTERRUPT_TIMESTAMP(p) (p)->LastInterruptTimeStamp.QuadPart
113110
#else
114-
# define PARANDIS_STORE_LAST_INTERRUPT_TIMESTAMP(p)
115-
# define PARANDIS_GET_LAST_INTERRUPT_TIMESTAMP(p) (0)
111+
#define PARANDIS_STORE_LAST_INTERRUPT_TIMESTAMP(p)
112+
#define PARANDIS_GET_LAST_INTERRUPT_TIMESTAMP(p) (0)
116113
#endif
117114

118115
typedef struct _tagBugCheckPerNicDataContent_V0
119116
{
120-
UINT64 Context;
121-
LARGE_INTEGER LastInterruptTimeStamp;
122-
LARGE_INTEGER LastTxCompletionTimeStamp;
123-
ULONG nofReadyTxBuffers;
124-
}tBugCheckPerNicDataContent_V0;
117+
UINT64 Context;
118+
LARGE_INTEGER LastInterruptTimeStamp;
119+
LARGE_INTEGER LastTxCompletionTimeStamp;
120+
ULONG nofReadyTxBuffers;
121+
} tBugCheckPerNicDataContent_V0;
125122

126123
typedef struct _tagBugCheckHistoryDataEntry_V0
127124
{
128-
LARGE_INTEGER TimeStamp;
129-
UINT64 Context;
130-
UINT64 pParam1;
131-
ULONG operation;
132-
ULONG lParam2;
133-
ULONG lParam3;
134-
ULONG lParam4;
135-
}tBugCheckHistoryDataEntry_V0;
125+
LARGE_INTEGER TimeStamp;
126+
UINT64 Context;
127+
UINT64 pParam1;
128+
ULONG operation;
129+
ULONG lParam2;
130+
ULONG lParam3;
131+
ULONG lParam4;
132+
} tBugCheckHistoryDataEntry_V0;
136133

137134
typedef struct _tagBugCheckHistoryDataEntry_V1
138135
{
139-
LARGE_INTEGER TimeStamp;
140-
UINT64 Context;
141-
ULONG uIRQL;
142-
ULONG uProcessor;
143-
UINT64 pParam1;
144-
ULONG operation;
145-
ULONG lParam2;
146-
ULONG lParam3;
147-
ULONG lParam4;
148-
}tBugCheckHistoryDataEntry_V1;
136+
LARGE_INTEGER TimeStamp;
137+
UINT64 Context;
138+
ULONG uIRQL;
139+
ULONG uProcessor;
140+
UINT64 pParam1;
141+
ULONG operation;
142+
ULONG lParam2;
143+
ULONG lParam3;
144+
ULONG lParam4;
145+
} tBugCheckHistoryDataEntry_V1;
149146

150147
typedef struct _tagPendingNBlEntry_V0
151148
{
152-
UINT64 NBL;
153-
LARGE_INTEGER TimeStamp;
154-
}tPendingNBlEntry_V0;
149+
UINT64 NBL;
150+
LARGE_INTEGER TimeStamp;
151+
} tPendingNBlEntry_V0;
155152

156153
#if (PARANDIS_DEBUG_PENDING_NBL_ENTRY_VERSION == 0)
157154
typedef tPendingNBlEntry_V0 tPendingNBlEntry;
@@ -162,11 +159,11 @@ typedef tPendingNBlEntry_V1 tPendingNBlEntry;
162159
typedef struct _tagBugCheckStaticDataContent_V1
163160
{
164161
tBugCheckStaticDataContent_V0 StaticDataV0;
165-
ULONG64 PendingNblData;
166-
ULONG MaxPendingNbl;
167-
USHORT PendingNblEntryVersion;
168-
USHORT fNBLOverflow;
169-
}tBugCheckStaticDataContent_V1;
162+
ULONG64 PendingNblData;
163+
ULONG MaxPendingNbl;
164+
USHORT PendingNblEntryVersion;
165+
USHORT fNBLOverflow;
166+
} tBugCheckStaticDataContent_V1;
170167

171168
#if (PARANDIS_DEBUG_STATIC_DATA_VERSION == 0)
172169
typedef tBugCheckStaticDataContent_V0 tBugCheckStaticDataContent;
@@ -186,12 +183,11 @@ typedef tBugCheckHistoryDataEntry_V1 tBugCheckHistoryDataEntry;
186183

187184
typedef struct _tagBugCheckPerNicDataContent_V1
188185
{
189-
UINT64 Context;
190-
LARGE_INTEGER LastInterruptTimeStamp;
191-
LARGE_INTEGER LastTxCompletionTimeStamp;
192-
ULONG nofReadyTxBuffers;
193-
}tBugCheckPerNicDataContent_V1;
194-
186+
UINT64 Context;
187+
LARGE_INTEGER LastInterruptTimeStamp;
188+
LARGE_INTEGER LastTxCompletionTimeStamp;
189+
ULONG nofReadyTxBuffers;
190+
} tBugCheckPerNicDataContent_V1;
195191

196192
#if (PARANDIS_DEBUG_HEADER_VERSION == 1)
197193
typedef tBugCheckStaticDataContent_V1 tBugCheckStaticDataContent;
@@ -203,6 +199,4 @@ typedef tBugCheckPerNicDataContent_V1 tBugCheckPerNicDataContent;
203199

204200
// etc
205201

206-
207-
208202
#endif

NetKVM/Common/ParaNdis-AbstractPath.h

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
class CParaNdisAbstractPath
66
{
7-
public:
7+
public:
88
#if NDIS_SUPPORT_NDIS620
99
CParaNdisAbstractPath()
1010
{
1111
memset(&DPCAffinity, 0, sizeof(DPCAffinity));
1212
}
1313
#else
14-
CParaNdisAbstractPath() : DPCTargetProcessor(0) {}
14+
CParaNdisAbstractPath() : DPCTargetProcessor(0)
15+
{
16+
}
1517
#endif
1618

17-
bool WasInterruptReported()
19+
bool WasInterruptReported()
1820
{
1921
return m_interruptReported;
2022
}
@@ -24,15 +26,18 @@ class CParaNdisAbstractPath
2426
m_interruptReported = false;
2527
}
2628

27-
void ReportInterrupt() {
29+
void ReportInterrupt()
30+
{
2831
m_interruptReported = true;
2932
}
3033

31-
UINT getMessageIndex() {
34+
UINT getMessageIndex()
35+
{
3236
return m_messageIndex;
3337
}
3438

35-
UINT getQueueIndex() {
39+
UINT getQueueIndex()
40+
{
3641
return m_queueIndex;
3742
}
3843

@@ -70,7 +75,7 @@ class CParaNdisAbstractPath
7075

7176
virtual bool FireDPC(ULONG messageId) = 0;
7277

73-
protected:
78+
protected:
7479
PPARANDIS_ADAPTER m_Context;
7580
CVirtQueue *m_pVirtQueue;
7681
LARGE_INTEGER m_LastInterruptTimeStamp;
@@ -80,10 +85,11 @@ class CParaNdisAbstractPath
8085
bool m_interruptReported;
8186
};
8287

83-
84-
template <class VQ> class CParaNdisTemplatePath : public CParaNdisAbstractPath, public CObserver<SMNotifications>{
85-
public:
86-
CParaNdisTemplatePath() : m_ObserverAdded(false) {
88+
template <class VQ> class CParaNdisTemplatePath : public CParaNdisAbstractPath, public CObserver<SMNotifications>
89+
{
90+
public:
91+
CParaNdisTemplatePath() : m_ObserverAdded(false)
92+
{
8793
m_pVirtQueue = &m_VirtQueue;
8894
}
8995

@@ -93,7 +99,8 @@ template <class VQ> class CParaNdisTemplatePath : public CParaNdisAbstractPath,
9399
return true;
94100
}
95101

96-
~CParaNdisTemplatePath() {
102+
~CParaNdisTemplatePath()
103+
{
97104
if (m_ObserverAdded)
98105
{
99106
m_Context->m_StateMachine.Remove(this);
@@ -106,10 +113,9 @@ template <class VQ> class CParaNdisTemplatePath : public CParaNdisAbstractPath,
106113
m_VirtQueue.Shutdown();
107114
}
108115

109-
static BOOLEAN _Function_class_(MINIPORT_SYNCHRONIZE_INTERRUPT)
110-
RestartQueueSynchronously(PVOID ctx)
116+
static BOOLEAN _Function_class_(MINIPORT_SYNCHRONIZE_INTERRUPT) RestartQueueSynchronously(PVOID ctx)
111117
{
112-
auto This = static_cast<CParaNdisTemplatePath<VQ>*>(ctx);
118+
auto This = static_cast<CParaNdisTemplatePath<VQ> *>(ctx);
113119
return !This->m_VirtQueue.Restart();
114120
}
115121

@@ -134,7 +140,7 @@ template <class VQ> class CParaNdisTemplatePath : public CParaNdisAbstractPath,
134140
#if PARANDIS_SUPPORT_POLL
135141
if (m_Context->bPollModeEnabled)
136142
{
137-
//rx index is 2*n, tx index is 2*n+1
143+
// rx index is 2*n, tx index is 2*n+1
138144
ParaNdisPollNotify(m_Context, m_queueIndex / 2, (m_queueIndex % 2) ? "TX" : "RX");
139145
return TRUE;
140146
}
@@ -149,7 +155,8 @@ template <class VQ> class CParaNdisTemplatePath : public CParaNdisAbstractPath,
149155
#endif
150156
return FALSE;
151157
}
152-
protected:
158+
159+
protected:
153160
CNdisSpinLock m_Lock;
154161
bool m_ObserverAdded;
155162
VQ m_VirtQueue;

NetKVM/Common/ParaNdis-CX.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,27 @@
33
#include "ndis56common.h"
44
#include "ParaNdis-AbstractPath.h"
55

6-
class CParaNdisCX : public CParaNdisTemplatePath<CVirtQueue>, public CPlacementAllocatable {
7-
public:
6+
class CParaNdisCX : public CParaNdisTemplatePath<CVirtQueue>, public CPlacementAllocatable
7+
{
8+
public:
89
CParaNdisCX(PPARANDIS_ADAPTER Context);
910
~CParaNdisCX();
1011

1112
bool Create(UINT DeviceQueueIndex);
1213

1314
virtual NDIS_STATUS SetupMessageIndex(u16 vector);
1415

15-
BOOLEAN CParaNdisCX::SendControlMessage(
16-
UCHAR cls,
17-
UCHAR cmd,
18-
PVOID buffer1,
19-
ULONG size1,
20-
PVOID buffer2,
21-
ULONG size2,
22-
int levelIfOK
23-
);
16+
BOOLEAN CParaNdisCX::SendControlMessage(UCHAR cls,
17+
UCHAR cmd,
18+
PVOID buffer1,
19+
ULONG size1,
20+
PVOID buffer2,
21+
ULONG size2,
22+
int levelIfOK);
2423

2524
bool FireDPC(ULONG messageId) override;
2625
KDPC m_DPC;
2726

28-
protected:
27+
protected:
2928
tCompletePhysicalAddress m_ControlData;
3029
};

0 commit comments

Comments
 (0)