@@ -248,15 +248,15 @@ union VSEC {
248
248
template <class MatchFunc , class ProcessFunc >
249
249
void processDVSEC (MatchFunc matchFunc, ProcessFunc processFunc)
250
250
{
251
- forAllIntelDevices ([&](const uint32 group, const uint32 bus, const uint32 device, const uint32 function, const uint32 /* device_id */ )
251
+ forAllIntelDevices ([&](const uint32 group, const uint32 bus, const uint32 device, const uint32 function, const uint32 device_id)
252
252
{
253
- // std::cerr << "Intel device scan. found " << std::hex << group << ":" << bus << ":" << device << ":" << function << " " << device_id << std::dec ;
253
+ DBG ( 2 , " Intel device scan.found " , std::hex , group , " :" , bus , " : " , device , " : " , function , " " , device_id) ;
254
254
uint32 status{0 };
255
255
PciHandleType h (group, bus, device, function);
256
256
h.read32 (4 , &status); // read status
257
257
if (status & 0x100000 ) // has capability list
258
258
{
259
- // std::cerr << "Intel device scan. found "<< std::hex << group << ":" << bus << ":" << device << ":" << function << " " << device_id << " with capability list\n" << std::dec ;
259
+ DBG ( 2 , " Intel device scan. found " , std::hex , group , " :" , bus , " :" , device , " :" , function , " " , device_id , " with capability list" ) ;
260
260
VSEC header;
261
261
uint64 offset = 0x100 ;
262
262
do
@@ -269,11 +269,10 @@ void processDVSEC(MatchFunc matchFunc, ProcessFunc processFunc)
269
269
{
270
270
return ;
271
271
}
272
- // std::cerr << "offset 0x" << std::hex << offset << " header.fields.cap_id: 0x" << header.fields.cap_id << std::dec << "\n";
273
- // std::cerr << ".. found entryID: 0x" << std::hex << header.fields.entryID << std::dec << "\n";
272
+ DBG (2 , " offset 0x" , std::hex , offset , " cap_id: 0x" , header.fields .cap_id , " vsec_id: 0x" , header.fields .vsec_id , " entryID: 0x" , std::hex , header.fields .entryID , std::dec);
274
273
if (matchFunc (header))
275
274
{
276
- // std::cerr << ".... found match\n" ;
275
+ DBG ( 2 , " .... found match" ) ;
277
276
auto barOffset = 0x10 + header.fields .tBIR * 4 ;
278
277
uint32 bar = 0 ;
279
278
if (h.read32 (barOffset, &bar) == sizeof (uint32) && bar != 0 ) // read bar
@@ -290,6 +289,7 @@ void processDVSEC(MatchFunc matchFunc, ProcessFunc processFunc)
290
289
offset = header.fields .cap_next & ~3 ;
291
290
if (lastOffset == offset) // the offset did not change
292
291
{
292
+ DBG (2 , " lastOffset == offset " , lastOffset , " ==" , offset);
293
293
return ; // deadlock protection
294
294
}
295
295
} while (1 );
0 commit comments