Release 4.7 drivers/staging/comedi/proc.c
  
  
/*
 * /proc interface for comedi
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 1998 David A. Schleef <ds@schleef.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
/*
 * This is some serious bloatware.
 *
 * Taken from Dave A.'s PCL-711 driver, 'cuz I thought it
 * was cool.
 */
#include "comedidev.h"
#include "comedi_internal.h"
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
static int comedi_read(struct seq_file *m, void *v)
{
	int i;
	int devices_q = 0;
	struct comedi_driver *driv;
	seq_printf(m, "comedi version " COMEDI_RELEASE "\nformat string: %s\n",
		   "\"%2d: %-20s %-20s %4d\", i, driver_name, board_name, n_subdevices");
	for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) {
		struct comedi_device *dev = comedi_dev_get_from_minor(i);
		if (!dev)
			continue;
		down_read(&dev->attach_lock);
		if (dev->attached) {
			devices_q = 1;
			seq_printf(m, "%2d: %-20s %-20s %4d\n",
				   i, dev->driver->driver_name,
				   dev->board_name, dev->n_subdevices);
		}
		up_read(&dev->attach_lock);
		comedi_dev_put(dev);
	}
	if (!devices_q)
		seq_puts(m, "no devices\n");
	mutex_lock(&comedi_drivers_list_lock);
	for (driv = comedi_drivers; driv; driv = driv->next) {
		seq_printf(m, "%s:\n", driv->driver_name);
		for (i = 0; i < driv->num_names; i++)
			seq_printf(m, " %s\n",
				   *(char **)((char *)driv->board_name +
					      i * driv->offset));
		if (!driv->num_names)
			seq_printf(m, " %s\n", driv->driver_name);
	}
	mutex_unlock(&comedi_drivers_list_lock);
	return 0;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david a. schleef | david a. schleef | 182 | 75.21% | 1 | 12.50% | 
| ian abbott | ian abbott | 34 | 14.05% | 2 | 25.00% | 
| david howells | david howells | 17 | 7.02% | 1 | 12.50% | 
| h hartley sweeten | h hartley sweeten | 4 | 1.65% | 1 | 12.50% | 
| michael welling | michael welling | 2 | 0.83% | 1 | 12.50% | 
| greg kroah-hartman | greg kroah-hartman | 2 | 0.83% | 1 | 12.50% | 
| bill pemberton | bill pemberton | 1 | 0.41% | 1 | 12.50% | 
 | Total | 242 | 100.00% | 8 | 100.00% | 
/*
 * seq_file wrappers for procfile show routines.
 */
static int comedi_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, comedi_read, NULL);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david howells | david howells | 26 | 100.00% | 1 | 100.00% | 
 | Total | 26 | 100.00% | 1 | 100.00% | 
static const struct file_operations comedi_proc_fops = {
	.open		= comedi_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};
void comedi_proc_init(void)
{
	proc_create("comedi", 0644, NULL, &comedi_proc_fops);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david a. schleef | david a. schleef | 12 | 63.16% | 1 | 25.00% | 
| david howells | david howells | 4 | 21.05% | 1 | 25.00% | 
| al viro | al viro | 2 | 10.53% | 1 | 25.00% | 
| greg kroah-hartman | greg kroah-hartman | 1 | 5.26% | 1 | 25.00% | 
 | Total | 19 | 100.00% | 4 | 100.00% | 
void comedi_proc_cleanup(void)
{
	remove_proc_entry("comedi", NULL);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david a. schleef | david a. schleef | 13 | 92.86% | 1 | 50.00% | 
| greg kroah-hartman | greg kroah-hartman | 1 | 7.14% | 1 | 50.00% | 
 | Total | 14 | 100.00% | 2 | 100.00% | 
Overall Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david a. schleef | david a. schleef | 213 | 61.92% | 1 | 7.69% | 
| david howells | david howells | 76 | 22.09% | 1 | 7.69% | 
| ian abbott | ian abbott | 35 | 10.17% | 3 | 23.08% | 
| greg kroah-hartman | greg kroah-hartman | 8 | 2.33% | 2 | 15.38% | 
| h hartley sweeten | h hartley sweeten | 4 | 1.16% | 1 | 7.69% | 
| michael welling | michael welling | 4 | 1.16% | 2 | 15.38% | 
| al viro | al viro | 3 | 0.87% | 2 | 15.38% | 
| bill pemberton | bill pemberton | 1 | 0.29% | 1 | 7.69% | 
 | Total | 344 | 100.00% | 13 | 100.00% | 
  
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.