root/trunk/libffado/src/bebob/bebob_dl_mgr.cpp

Revision 618, 21.1 kB (checked in by ppalmers, 17 years ago)

move serialization routines to libutil such that they can be used for non-AVC stuff too (fireworks EFC)

Line 
1 /*
2  * Copyright (C) 2005-2007 by Daniel Wagner
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #include "bebob_dl_mgr.h"
25 #include "bebob_dl_codes.h"
26 #include "bebob_dl_bcd.h"
27
28 #include "libieee1394/configrom.h"
29 #include "libieee1394/ieee1394service.h"
30
31 #include "libutil/cmd_serialize.h"
32
33 #include <netinet/in.h>
34
35 #include <cstdio>
36
37 namespace BeBoB {
38     enum {
39         AddrRegInfo    = 0xffffc8020000ULL,
40         AddrRegReq     = 0xffffc8021000ULL,
41         AddrRegReqBuf  = 0xffffc8021040ULL,
42         AddrRegResp    = 0xffffc8029000ULL,
43         AddrRegRespBuf = 0xffffc8029040ULL,
44     };
45
46     enum {
47         RegInfoManufactorIdOffset =      0x00,
48         RegInfoProtocolVersionOffset =   0x08,
49         RegInfoBootloaderVersionOffset = 0x0c,
50         RegInfoGUID =                    0x10,
51         RegInfoHardwareModelId =         0x18,
52         RegInfoHardwareRevision =        0x1c,
53         RegInfoSoftwareDate =            0x20,
54         RegInfoSoftwareTime =            0x28,
55         RegInfoSoftwareId =              0x30,
56         RegInfoSoftwareVersion =         0x34,
57         RegInfoBaseAddress =             0x38,
58         RegInfoMaxImageLen =             0x3c,
59         RegInfoBootloaderDate =          0x40,
60         RegInfoBootloaderTime =          0x48,
61         RegInfoDebuggerDate =            0x50,
62         RegInfoDebuggerTime =            0x58,
63         RegInfoDebuggerId =              0x60,
64         RegInfoDebuggerVersion =         0x64
65     };
66
67     enum {
68         MaxRetries = 10,
69     };
70
71     IMPL_DEBUG_MODULE( BootloaderManager, BootloaderManager, DEBUG_LEVEL_NORMAL );
72 }
73
74 BeBoB::BootloaderManager::BootloaderManager(Ieee1394Service& ieee1349service,
75                                             fb_nodeid_t nodeId )
76     : m_ieee1394service( &ieee1349service )
77     , m_protocolVersion( eBPV_Unknown )
78     , m_isAppRunning( false )
79     , m_forceEnabled( false )
80     , m_bStartBootloader( true )
81 {
82     memset( &m_cachedInfoRegs, 0, sizeof( m_cachedInfoRegs ) );
83
84     m_configRom = new ConfigRom( *m_ieee1394service, nodeId );
85     // XXX throw exception if initialize fails!
86     m_configRom->initialize();
87     if ( !cacheInfoRegisters() ) {
88         debugError( "BootloaderManager: could not cache info registers\n" );
89     }
90
91     switch(  m_cachedInfoRegs.m_protocolVersion ) {
92     case 1:
93         m_protocolVersion = eBPV_V1;
94         break;
95     case 3:
96         m_protocolVersion = eBPV_V3;
97         break;
98     default:
99         // exception?
100         break;
101     }
102
103     pthread_mutex_init( &m_mutex, 0 );
104     pthread_cond_init( &m_cond, 0 );
105
106     m_functor = new MemberFunctor0< BeBoB::BootloaderManager*,
107                 void (BeBoB::BootloaderManager::*)() >
108                 ( this, &BeBoB::BootloaderManager::busresetHandler, false );
109     m_ieee1394service->addBusResetHandler( m_functor );
110 }
111
112 BeBoB::BootloaderManager::~BootloaderManager()
113 {
114     m_ieee1394service->remBusResetHandler( m_functor );
115     delete( m_functor );
116
117     delete m_configRom;
118
119     pthread_cond_destroy( &m_cond );
120     pthread_mutex_destroy( &m_mutex );
121 }
122
123 bool
124 BeBoB::BootloaderManager::cacheInfoRegisters()
125 {
126     if ( !m_configRom->updatedNodeId() ) {
127         debugError( "cacheInfoRegisters: did not find device anymore\n" );
128         return false;
129     }
130
131     if ( !m_ieee1394service->read(
132              0xffc0 | m_configRom->getNodeId(),
133              AddrRegInfo,
134              sizeof( m_cachedInfoRegs )/4,
135              reinterpret_cast<fb_quadlet_t*>( &m_cachedInfoRegs ) ) )
136     {
137         return false;
138     }
139
140     if ( m_cachedInfoRegs.m_bootloaderVersion != 0x0 ) {
141         m_isAppRunning = false;
142     } else {
143         m_isAppRunning = true;
144     }
145
146     m_cachedInfoRegs.m_guid = ( m_cachedInfoRegs.m_guid >> 32 )
147                               | ( m_cachedInfoRegs.m_guid << 32 );
148
149     return true;
150 }
151
152 bool
153 BeBoB::BootloaderManager::cacheInfoRegisters( int retries )
154 {
155     for ( int i = 0; i < retries; ++i ) {
156         if ( cacheInfoRegisters() ) {
157             return true;
158         }
159         sleep( 1 );
160     }
161
162     return false;
163 }
164
165 void
166 BeBoB::BootloaderManager::printInfoRegisters()
167 {
168     using namespace std;
169
170     if ( !cacheInfoRegisters() ) {
171         debugError( "Could not read info registers\n" );
172         return;
173     }
174
175     printf( "Info Registers\n" );
176     printf( "\tManufactors Id:\t\t%s\n",
177             makeString( m_cachedInfoRegs.m_manId ).c_str() );
178     printf( "\tProtocol Version:\t0x%08x\n",
179             m_cachedInfoRegs.m_protocolVersion );
180     printf( "\tBootloader Version:\t0x%08x\n",
181             m_cachedInfoRegs.m_bootloaderVersion );
182     printf( "\tGUID:\t\t\t0x%08x%08x\n",
183             ( unsigned int )( m_cachedInfoRegs.m_guid >> 32 ),
184             ( unsigned int )( m_cachedInfoRegs.m_guid & 0xffffffff ) );
185     printf( "\tHardware Model ID:\t0x%08x\n",
186             m_cachedInfoRegs.m_hardwareModelId );
187     printf( "\tHardware Revision:\t0x%08x\n",
188             m_cachedInfoRegs.m_hardwareRevision );
189     if (  m_cachedInfoRegs.m_softwareDate
190           && m_cachedInfoRegs.m_softwareTime )
191     {
192         printf( "\tSoftware Date:\t\t%s, %s\n",
193                 makeDate( m_cachedInfoRegs.m_softwareDate ).c_str(),
194                 makeTime( m_cachedInfoRegs.m_softwareTime ).c_str() );
195     }
196     printf( "\tSoftware Id:\t\t0x%08x\n", m_cachedInfoRegs.m_softwareId );
197     printf( "\tSoftware Version:\t0x%08x\n",
198             m_cachedInfoRegs.m_softwareVersion );
199     printf( "\tBase Address:\t\t0x%08x\n", m_cachedInfoRegs.m_baseAddress );
200     printf( "\tMax. Image Len:\t\t0x%08x\n", m_cachedInfoRegs.m_maxImageLen );
201     if ( m_cachedInfoRegs.m_bootloaderDate
202          && m_cachedInfoRegs.m_bootloaderTime )
203     {
204         printf( "\tBootloader Date:\t%s, %s\n",
205                 makeDate( m_cachedInfoRegs.m_bootloaderDate ).c_str(),
206                 makeTime( m_cachedInfoRegs.m_bootloaderTime ).c_str() );
207     }
208     if ( m_cachedInfoRegs.m_debuggerDate
209          && m_cachedInfoRegs.m_debuggerTime )
210     {
211         printf( "\tDebugger Date:\t\t%s, %s\n",
212                 makeDate( m_cachedInfoRegs.m_debuggerDate ).c_str(),
213                 makeTime( m_cachedInfoRegs.m_debuggerTime ).c_str() );
214     }
215     printf( "\tDebugger Id:\t\t0x%08x\n", m_cachedInfoRegs.m_debuggerId );
216     printf( "\tDebugger Version:\t0x%08x\n",
217             m_cachedInfoRegs.m_debuggerVersion );
218 }
219
220 bool
221 BeBoB::BootloaderManager::downloadFirmware( std::string filename )
222 {
223     using namespace std;
224
225     printf( "parse BCD file\n" );
226     std::auto_ptr<BCD> bcd = std::auto_ptr<BCD>( new BCD( filename ) );
227     if ( !bcd.get() ) {
228         debugError( "downloadFirmware: Could not open or parse BCD '%s'\n",
229                     filename.c_str() );
230         return false;
231     }
232     if ( !bcd->parse() ) {
233         debugError( "downloadFirmware: BCD parsing failed\n" );
234         return false;
235     }
236
237     printf( "check firmware device compatibility... " );
238     if ( !m_forceEnabled ) {
239         if ( !checkDeviceCompatibility( *bcd ) ) {
240             printf( "failed.\n" );
241             return false;
242         }
243         printf( "ok\n" );
244     } else {
245         printf( "forced\n" );
246     }
247
248     if ( m_bStartBootloader ) {
249         printf( "prepare for download (start bootloader)\n" );
250         if ( !startBootloaderCmd() ) {
251             debugError( "downloadFirmware: Could not start bootloader\n" );
252             return false;
253         }
254     }
255
256     printf( "start downloading protocol for application image\n" );
257     if ( !downloadObject( *bcd, eOT_Application ) ) {
258         debugError( "downloadFirmware: Firmware download failed\n" );
259         return false;
260     }
261
262     printf( "start downloading protocol for CnE\n" );
263     if ( !downloadObject( *bcd, eOT_CnE ) ) {
264         debugError( "downloadFirmware: CnE download failed\n" );
265         return false;
266     }
267
268     printf( "setting CnE to factory default settings\n" );
269     if ( !initializeConfigToFactorySettingCmd() ) {
270         debugError( "downloadFirmware: Could not reinitalize CnE\n" );
271         return false;
272     }
273
274     printf( "start application\n" );
275     if ( !startApplicationCmd() ) {
276         debugError( "downloadFirmware: Could not restart application\n" );
277         return false;
278     }
279
280     return true;
281 }
282
283 bool
284 BeBoB::BootloaderManager::downloadCnE( std::string filename )
285 {
286     using namespace std;
287
288     printf( "parse BCD file\n" );
289     std::auto_ptr<BCD> bcd = std::auto_ptr<BCD>( new BCD( filename ) );
290     if ( !bcd.get() ) {
291         debugError( "downloadCnE: Could not open or parse BCD '%s'\n",
292                     filename.c_str() );
293         return false;
294     }
295     if ( !bcd->parse() ) {
296         debugError( "downloadCnE: BCD parsing failed\n" );
297         return false;
298     }
299
300     printf( "check firmware device compatibility... " );
301     if ( !m_forceEnabled ) {
302         if ( !checkDeviceCompatibility( *bcd ) ) {
303             printf( "failed.\n" );
304             return false;
305         }
306         printf( "ok\n" );
307     } else {
308         printf( "forced\n" );
309     }
310
311     if ( m_bStartBootloader ) {
312         printf( "prepare for download (start bootloader)\n" );
313         if ( !startBootloaderCmd() ) {
314             debugError( "downloadCnE: Could not start bootloader\n" );
315             return false;
316         }
317     }
318
319     printf( "start downloading protocol for CnE\n" );
320     if ( !downloadObject( *bcd, eOT_CnE ) ) {
321         debugError( "downloadCnE: CnE download failed\n" );
322         return false;
323     }
324
325     printf( "setting CnE to factory default settings\n" );
326     if ( !initializeConfigToFactorySettingCmd() ) {
327         debugError( "downloadFirmware: Could not reinitalize CnE\n" );
328         return false;
329     }
330
331     printf( "start application\n" );
332     if ( !startApplicationCmd() ) {
333         debugError( "downloadCnE: Could not restart application\n" );
334         return false;
335     }
336
337     return true;
338 }
339
340
341 bool
342 BeBoB::BootloaderManager::downloadObject( BCD& bcd, EObjectType eObject )
343 {
344     using namespace std;
345
346     CommandCodesDownloadStart::EObject eCCDSObject;
347     fb_quadlet_t baseAddress;
348     fb_quadlet_t imageLength;
349     fb_quadlet_t crc;
350     fb_quadlet_t offset;
351
352     switch ( eObject ) {
353     case eOT_Application:
354         eCCDSObject = CommandCodesDownloadStart::eO_Application;
355         baseAddress = bcd.getImageBaseAddress();
356         imageLength = bcd.getImageLength();
357         crc = bcd.getImageCRC();
358         offset = bcd.getImageOffset();
359         break;
360     case eOT_CnE:
361         eCCDSObject = CommandCodesDownloadStart::eO_Config;
362         baseAddress = 0;
363         imageLength = bcd.getCnELength();
364         crc = bcd.getCnECRC();
365         offset = bcd.getCnEOffset();
366         break;
367     default:
368         return false;
369     }
370
371     CommandCodesDownloadStart ccDStart ( m_protocolVersion, eCCDSObject );
372     ccDStart.setDate( bcd.getSoftwareDate() );
373     ccDStart.setTime( bcd.getSoftwareTime() );
374     ccDStart.setId( bcd.getSoftwareId() );
375     ccDStart.setVersion( bcd.getSoftwareVersion() );
376     ccDStart.setBaseAddress( baseAddress );
377     ccDStart.setLength( imageLength );
378     ccDStart.setCRC( crc );
379
380     if ( !writeRequest( ccDStart ) ) {
381         debugError( "downloadObject: start command write request failed\n" );
382         return false;
383     }
384
385     // bootloader erases the flash, have to wait until is ready
386     // to answer our next request
387     printf( "wait until flash ereasing has terminated\n" );
388     sleep( 30 );
389
390     if ( !readResponse( ccDStart ) ) {
391         debugError( "downloadObject: (start) command read request failed\n" );
392         return false;
393     }
394
395     if ( ccDStart.getMaxBlockSize() < 0 ) {
396         debugError( "downloadObject: (start) command reported error %d\n",
397                     ccDStart.getMaxBlockSize() );
398         return false;
399     }
400
401     unsigned int maxBlockSize = m_configRom->getAsyMaxPayload();
402     unsigned int i = 0;
403     fb_quadlet_t address = 0;
404     bool result = true;
405     int totalBytes = imageLength;
406     int downloadedBytes = 0;
407     while ( imageLength > 0 ) {
408         unsigned int blockSize = imageLength > maxBlockSize ?
409                         maxBlockSize  : imageLength;
410
411         fb_byte_t block[blockSize];
412         if ( !bcd.read( offset, block, blockSize ) ) {
413             result = false;
414             break;
415         }
416
417         if ( !get1394Serivce()->write(
418                  0xffc0 | getConfigRom()->getNodeId(),
419                  AddrRegReqBuf,
420                  ( blockSize + 3 ) / 4,
421                  reinterpret_cast<fb_quadlet_t*>( block ) ) )
422         {
423             debugError( "downloadObject: Could not write to node %d\n",
424                         getConfigRom()->getNodeId() );
425             return false;
426         }
427
428         CommandCodesDownloadBlock ccBlock( m_protocolVersion );
429         ccBlock.setSeqNumber( i );
430         ccBlock.setAddress( baseAddress + address );
431         ccBlock.setNumberBytes( blockSize );
432
433         if ( !writeRequest( ccBlock ) ) {
434             debugError( "downloadObject: (block) write request failed" );
435             result = false;
436             break;
437         }
438         usleep( 100 );
439
440         if ( !readResponse( ccBlock ) ) {
441             debugError( "downloadObject: (block) read request failed\n" );
442             result = false;
443             break;
444         }
445
446         if ( i != ccBlock.getRespSeqNumber() ) {
447             debugError( "downloadObject: (block) wrong sequence number "
448                         "reported. %d expected, %d reported\n",
449                         i, ccBlock.getRespSeqNumber() );
450             result = false;
451             break;
452         }
453         if ( ccBlock.getRespErrorCode() != 0 ) {
454             debugError( "downloadObject: (block) failed download with "
455                         "error code 0x%08x\n", ccBlock.getRespErrorCode() );
456             result = false;
457             break;
458         }
459
460         downloadedBytes += blockSize;
461         if ( ( i % 100 ) == 0 ) {
462            printf( "%10d/%d bytes downloaded\n",
463                    downloadedBytes, totalBytes );
464         }
465
466         imageLength -= blockSize;
467         address += blockSize;
468         offset += blockSize;
469         i++;
470     }
471     printf( "%10d/%d bytes downloaded\n",
472             downloadedBytes, totalBytes );
473
474     if ( !result ) {
475         debugError( "downloadObject: seqNumber = %d, "
476                     "address = 0%08x, offset = 0x%08x, "
477                     "restImageLength = 0x%08x\n",
478                     i, address, offset, imageLength );
479     }
480
481     CommandCodesDownloadEnd ccEnd( m_protocolVersion );
482     if ( !writeRequest( ccEnd ) ) {
483         debugError( "downloadObject: (end) command write failed\n" );
484     }
485
486     printf( "wait for transaction completion\n" );
487     sleep( 10 );
488
489     if ( !readResponse( ccEnd ) ) {
490         debugError( "downloadObject: (end) command read failed\n" );
491     }
492
493     if ( result ) {
494         if ( ccEnd.getRespIsValid() ) {
495             if ( ccEnd.getRespCrc32() == crc ) {
496                 debugOutput( DebugModule::eDL_Normal,
497                              "downloadObject: CRC match\n" );
498             } else {
499                 debugError( "downloadObject: CRC mismatch. 0x%08x expected, "
500                             "0x%08x reported",
501                             crc, ccEnd.getRespCrc32() );
502                 result = false;
503             }
504         } else {
505             debugError( "downloadObject: (end) object is not valid\n" );
506             result = false;
507         }
508     }
509     printf( "download protocol successfuly completed\n" );
510     return result;
511 }
512
513 bool
514 BeBoB::BootloaderManager::programGUID( fb_octlet_t guid )
515 {
516     if ( m_bStartBootloader ) {
517         if ( !startBootloaderCmd() ) {
518             debugError( "programGUID: Could not start bootloader\n" );
519             return false;
520         }
521     }
522
523     if ( !programGUIDCmd( guid ) ) {
524         debugError( "programGUID: Could not program guid\n" );
525         return false;
526     }
527
528     if ( !startApplicationCmd() ) {
529         debugError( "Could not restart application\n");
530         return false;
531     }
532
533     return true;
534 }
535
536 void
537 BeBoB::BootloaderManager::busresetHandler()
538 {
539     pthread_cond_signal( &m_cond );
540 }
541
542 void
543 BeBoB::BootloaderManager::waitForBusReset()
544 {
545     pthread_cond_wait( &m_cond, &m_mutex );
546 }
547
548 bool
549 BeBoB::BootloaderManager::writeRequest( CommandCodes& cmd )
550 {
551     unsigned char buf[ ( ( cmd.getMaxSize()+3 )/4 ) * 4 ];
552     memset( buf, 0, sizeof( buf ) );
553
554     Util::BufferSerialize se( buf,  sizeof( buf ) );
555     if ( !cmd.serialize( se ) ) {
556         debugError( "writeRequest: Could not serialize command code %d\n",
557                     cmd.getCommandCode() );
558         return false;
559     }
560
561     if ( !get1394Serivce()->write(
562              0xffc0 | getConfigRom()->getNodeId(),
563              AddrRegReq,
564              sizeof( buf )/4,
565              reinterpret_cast<fb_quadlet_t*>( buf ) ) )
566     {
567         debugError( "writeRequest: Could not ARM write to node %d\n",
568                     getConfigRom()->getNodeId() );
569         return false;
570     }
571
572     return true;
573 }
574
575 bool
576 BeBoB::BootloaderManager::readResponse( CommandCodes& writeRequestCmd )
577 {
578     const size_t buf_length = 0x40;
579     unsigned char raw[buf_length];
580     if ( !get1394Serivce()->read(
581              0xffc0 | getConfigRom()->getNodeId(),
582              AddrRegResp,
583              writeRequestCmd.getRespSizeInQuadlets(),
584              reinterpret_cast<fb_quadlet_t*>( raw ) ) )
585     {
586         return false;
587     }
588
589     Util::BufferDeserialize de( raw, buf_length );
590     if ( !writeRequestCmd.deserialize( de ) ) {
591         debugError( "readResponse: deserialize failed\n" );
592         return false;
593     }
594
595     bool result =
596         writeRequestCmd.getProtocolVersion()
597         == writeRequestCmd.getRespProtocolVersion();
598     result &=
599         writeRequestCmd.getCommandId()
600         == writeRequestCmd.getRespCommandId();
601     result &=
602         writeRequestCmd.getCommandCode()
603         == writeRequestCmd.getRespCommandCode();
604     #ifdef DEBUG
605        if ( !result ) {
606            debugError( "readResponse: protocol version: %d expected, "
607                        " %d reported\n",
608                        writeRequestCmd.getProtocolVersion(),
609                        writeRequestCmd.getRespProtocolVersion() );
610            debugError( "readResponse: command id: %d expected, "
611                        " %d reported\n",
612                        writeRequestCmd.getCommandId(),
613                        writeRequestCmd.getRespCommandId() );
614            debugError( "readResponse: command code: %d expected, "
615                        " %d reported\n",
616                        writeRequestCmd.getCommandCode(),
617                        writeRequestCmd.getRespCommandCode() );
618        }
619     #endif
620     return result;
621 }
622
623 bool
624 BeBoB::BootloaderManager::startBootloaderCmd()
625 {
626     CommandCodesReset cmd( m_protocolVersion,
627                            CommandCodesReset::eSM_Bootloader ) ;
628     if ( !writeRequest( cmd ) ) {
629         debugError( "startBootloaderCmd: writeRequest failed\n" );
630         return false;
631     }
632
633     waitForBusReset();
634     if ( !cacheInfoRegisters( MaxRetries ) ) {
635         debugError( "startBootloaderCmd: Could not read info registers\n" );
636         return false;
637     }
638
639     // wait for bootloader finish startup sequence
640     // there is no way to find out when it has finished
641     sleep( 10 );
642
643     return true;
644 }
645
646 bool
647 BeBoB::BootloaderManager::startApplicationCmd()
648 {
649     CommandCodesGo cmd( m_protocolVersion,
650                            CommandCodesGo::eSM_Application ) ;
651     if ( !writeRequest( cmd ) ) {
652         debugError( "startApplicationCmd: writeRequest failed\n" );
653         return false;
654     }
655
656     return true;
657 }
658
659 bool
660 BeBoB::BootloaderManager::programGUIDCmd( fb_octlet_t guid )
661 {
662     CommandCodesProgramGUID cmd( m_protocolVersion, guid );
663     if ( !writeRequest( cmd ) ) {
664         debugError( "programGUIDCmd: writeRequest failed\n" );
665         return false;
666     }
667
668     sleep( 1 );
669
670     return true;
671 }
672
673 bool
674 BeBoB::BootloaderManager::initializePersParamCmd()
675 {
676     CommandCodesInitializePersParam cmd( m_protocolVersion );
677     if ( !writeRequest( cmd ) ) {
678         debugError( "initializePersParamCmd: writeRequest failed\n" );
679         return false;
680     }
681
682     sleep( 1 );
683
684     return true;
685 }
686
687 bool
688 BeBoB::BootloaderManager::initializeConfigToFactorySettingCmd()
689 {
690     CommandCodesInitializeConfigToFactorySetting cmd( m_protocolVersion );
691     if ( !writeRequest( cmd ) ) {
692         debugError( "initializeConfigToFactorySettingCmd: writeRequest failed\n" );
693         return false;
694     }
695
696     sleep( 5 );
697
698     return true;
699 }
700
701 bool
702 BeBoB::BootloaderManager::checkDeviceCompatibility( BCD& bcd )
703 {
704     fb_quadlet_t vendorOUI = (  m_cachedInfoRegs.m_guid >> 40 );
705
706
707     if ( ( vendorOUI == bcd.getVendorOUI() )
708          && ( m_cachedInfoRegs.m_softwareId == bcd.getSoftwareId() ) )
709     {
710         return true;
711     }
712
713     printf( "vendorOUI = 0x%08x\n", vendorOUI );
714     printf( "BCD vendorOUI = 0x%08x\n", bcd.getVendorOUI() );
715     printf( "software ID = 0x%08x\n", m_cachedInfoRegs.m_softwareId );
716     printf( "BCD software ID = 0x%08x\n", bcd.getSoftwareId() );
717
718     return false;
719 }
Note: See TracBrowser for help on using the browser.