/proc/comedi dumps out the device names recognized for each driver
authorDavid Schleef <ds@schleef.org>
Fri, 8 Jun 2001 22:37:08 +0000 (22:37 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 8 Jun 2001 22:37:08 +0000 (22:37 +0000)
comedi/proc.c

index 2f02965890040c87f7bf613addba55d5ba9363f7..c0733449e8ec95cb33c15672882f4173f00632d3 100644 (file)
@@ -54,6 +54,8 @@ int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,voi
 
 #endif
 
+extern comedi_driver *comedi_drivers;
+
 #ifdef LINUX_V20
 int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int unused)
 #else
@@ -63,6 +65,7 @@ int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,voi
        int i;
        int devices_q=0;
        int l=0;
+       comedi_driver *driv;
        
        l+=sprintf(buf+l,
                "comedi version " COMEDI_RELEASE "\n"
@@ -87,6 +90,17 @@ int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,voi
                l+=sprintf(buf+l,"no devices\n");
        }
 
+       for(driv=comedi_drivers;driv;driv=driv->next){
+               l += sprintf(buf+l,"%s:\n",driv->driver_name);
+               for(i=0;i<driv->num_names;i++){
+                       l+=sprintf(buf+l," %s\n",
+                               *(char **)(driv->board_name+i*driv->offset));
+               }
+               if(!driv->num_names){
+                       l+=sprintf(buf+l," %s\n",driv->driver_name);
+               }
+       }
+
        return l;
 }