Updated it to only run the (unreliable) do_test_for_insn_bits() if the
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Sep 2008 14:49:35 +0000 (14:49 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Sep 2008 14:49:35 +0000 (14:49 +0000)
information was not available in the subdevice info.

lib/filler.c

index 98e6280b50a8d15c9572277a919eab70ee600efd..994e648d44bb98a97cc8d0679240d6e33deed639 100644 (file)
@@ -143,10 +143,23 @@ int get_subdevices(comedi_t *it)
                }
 
                r[i].has_cmd = do_test_for_cmd(it,i);
-               if(it->has_insnlist_ioctl){
-                       r[i].has_insn_bits = do_test_for_insn_bits(it,i);
-               }else{
+               switch(s[i].insn_bits_support)
+               {
+               case COMEDI_UNKNOWN_SUPPORT:
+                       if(it->has_insnlist_ioctl){
+                               r[i].has_insn_bits = do_test_for_insn_bits(it,i);
+                       }else{
+                               r[i].has_insn_bits = 0;
+                       }
+                       break;
+               case COMEDI_SUPPORTED:
+                       r[i].has_insn_bits = 1;
+                       break;
+               case COMEDI_UNSUPPORTED:
                        r[i].has_insn_bits = 0;
+                       break;
+               default:
+                       assert(0);
                }
        }