Index: /branches/libffado-2.0/support/tools/ffado-diag.in =================================================================== --- /branches/libffado-2.0/support/tools/ffado-diag.in (revision 1665) +++ /branches/libffado-2.0/support/tools/ffado-diag.in (revision 1686) @@ -78,11 +78,17 @@ oldstack_present = check_1394oldstack_present() oldstack_loaded = check_1394oldstack_loaded() + oldstack_active = check_1394oldstack_active() + oldstack_statically_linked = not check_1394oldstack_loaded() and check_1394oldstack_linked() newstack_present = check_1394newstack_present() newstack_loaded = check_1394newstack_loaded() + newstack_active = check_1394newstack_active() + newstack_statically_linked = not check_1394newstack_loaded() and check_1394newstack_linked() print " old 1394 stack present.... " + str(oldstack_present) print " old 1394 stack loaded..... " + str(oldstack_loaded) + print " old 1394 stack active..... " + str(oldstack_active) print " new 1394 stack present.... " + str(newstack_present) print " new 1394 stack loaded..... " + str(newstack_loaded) + print " new 1394 stack active..... " + str(newstack_active) # check /dev/raw1394 node presence @@ -148,20 +154,21 @@ # do the interpretation of the tests print "FireWire kernel drivers:" - ## FIXME: what about in-kernel firewire? (i.e. no modules) - if not oldstack_present: + if (oldstack_loaded or oldstack_statically_linked) and \ + (newstack_loaded or newstack_statically_linked): + help.show('MODULES_BOTH_STACKS_LOADED') + sys.exit(-1) + elif newstack_loaded or newstack_statically_linked: + help.show('MODULES_NEW_STACK_LOADED') + sys.exit(-1) + elif oldstack_statically_linked: + print "[PASS] Kernel drivers statically linked into the kernel." + elif not oldstack_present: help.show('MODULES_OLD_STACK_NOT_INSTALLED') sys.exit(-1) + elif not oldstack_loaded: + help.show('MODULES_OLD_STACK_NOT_LOADED') + sys.exit(-1) else: - if newstack_loaded and oldstack_loaded: - help.show('MODULES_BOTH_STACKS_LOADED') - sys.exit(-1) - elif newstack_loaded: - help.show('MODULES_NEW_STACK_LOADED') - sys.exit(-1) - elif not oldstack_loaded: - help.show('MODULES_OLD_STACK_NOT_LOADED') - sys.exit(-1) - else: - print "[PASS] Kernel modules present and correctly loaded." + print "[PASS] Kernel modules present and correctly loaded." if not devnode_present: Index: /branches/libffado-2.0/support/tools/ffado_diag_helpers.py =================================================================== --- /branches/libffado-2.0/support/tools/ffado_diag_helpers.py (revision 1665) +++ /branches/libffado-2.0/support/tools/ffado_diag_helpers.py (revision 1686) @@ -46,12 +46,11 @@ # modules -def check_for_module_loaded(modulename): - log.info("Checking if module '%s' is loaded... " % modulename) - f = open('/proc/modules') +def check_for_module_loaded(modulename, procfile): + log.info("Checking if module '%s' is present in %s... " % (modulename, procfile)) + f = open(procfile) lines = f.readlines() f.close() for l in lines: - mod = l.split()[0] - if mod == modulename or mod == modulename.replace('-', '_'): + if l.find(modulename) > -1 or l.find(modulename.replace('-', '_')) > -1: log.info(" found") return True @@ -72,38 +71,43 @@ return True +def check_1394oldstack_active(): + return check_for_module_loaded('ohci1394', '/proc/interrupts') + +def check_1394oldstack_linked(): + return os.access('/sys/module/ohci1394', os.F_OK) and \ + os.access('/sys/module/raw1394', os.F_OK) + def check_1394oldstack_loaded(): retval = True - if not check_for_module_loaded('ieee1394'): - retval = False - if not check_for_module_loaded('ohci1394'): - retval = False - if not check_for_module_loaded('raw1394'): - retval = False + for modulename in ('ieee1394', 'ohci1394', 'raw1394'): + if not check_for_module_loaded(modulename, '/proc/modules'): + retval = False return retval def check_1394oldstack_present(): retval = True - if not check_for_module_present('ieee1394'): - retval = False - if not check_for_module_present('ohci1394'): - retval = False - if not check_for_module_present('raw1394'): - retval = False + for modulename in ('ieee1394', 'ohci1394', 'raw1394'): + if not check_for_module_present(modulename): + retval = False return retval + +def check_1394newstack_active(): + return check_for_module_loaded('firewire_ohci', '/proc/interrupts') + +def check_1394newstack_linked(): + return os.access('/sys/module/firewire_ohci', os.F_OK) def check_1394newstack_loaded(): retval = True - if not check_for_module_loaded('firewire-core'): - retval = False - if not check_for_module_loaded('firewire-ohci'): - retval = False + for modulename in ('firewire_core', 'firewire_ohci'): + if not check_for_module_loaded(modulename, '/proc/modules'): + retval = False return retval def check_1394newstack_present(): retval = True - if not check_for_module_present('firewire-core'): - retval = False - if not check_for_module_present('firewire-ohci'): - retval = False + for modulename in ('firewire-core', 'firewire-ohci'): + if not check_for_module_present(modulename): + retval = False return retval