Release 4.12 drivers/zorro/proc.c
  
  
  
/*
 *      Procfs interface for the Zorro bus.
 *
 *      Copyright (C) 1998-2003 Geert Uytterhoeven
 *
 *      Heavily based on the procfs interface for the PCI bus, which is
 *
 *      Copyright (C) 1997, 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
 */
#include <linux/types.h>
#include <linux/zorro.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/export.h>
#include <asm/byteorder.h>
#include <linux/uaccess.h>
#include <asm/amigahw.h>
#include <asm/setup.h>
static loff_t
proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
{
	return fixed_size_llseek(file, off, whence, sizeof(struct ConfigDev));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Linus Torvalds (pre-git) | 24 | 72.73% | 1 | 25.00% | 
| Al Viro | 7 | 21.21% | 2 | 50.00% | 
| Geert Uytterhoeven | 2 | 6.06% | 1 | 25.00% | 
| Total | 33 | 100.00% | 4 | 100.00% | 
static ssize_t
proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
{
	struct zorro_dev *z = PDE_DATA(file_inode(file));
	struct ConfigDev cd;
	loff_t pos = *ppos;
	if (pos >= sizeof(struct ConfigDev))
		return 0;
	if (nbytes >= sizeof(struct ConfigDev))
		nbytes = sizeof(struct ConfigDev);
	if (pos + nbytes > sizeof(struct ConfigDev))
		nbytes = sizeof(struct ConfigDev) - pos;
	/* Construct a ConfigDev */
	memset(&cd, 0, sizeof(cd));
	cd.cd_Rom = z->rom;
	cd.cd_SlotAddr = cpu_to_be16(z->slotaddr);
	cd.cd_SlotSize = cpu_to_be16(z->slotsize);
	cd.cd_BoardAddr = cpu_to_be32(zorro_resource_start(z));
	cd.cd_BoardSize = cpu_to_be32(zorro_resource_len(z));
	if (copy_to_user(buf, (void *)&cd + pos, nbytes))
		return -EFAULT;
	*ppos += nbytes;
	return nbytes;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Linus Torvalds (pre-git) | 158 | 80.20% | 2 | 20.00% | 
| Geert Uytterhoeven | 19 | 9.64% | 3 | 30.00% | 
| Andrew Morton | 11 | 5.58% | 1 | 10.00% | 
| Al Viro | 9 | 4.57% | 4 | 40.00% | 
| Total | 197 | 100.00% | 10 | 100.00% | 
static const struct file_operations proc_bus_zorro_operations = {
	.owner		= THIS_MODULE,
	.llseek		= proc_bus_zorro_lseek,
	.read		= proc_bus_zorro_read,
};
static void * zorro_seq_start(struct seq_file *m, loff_t *pos)
{
	return (*pos < zorro_num_autocon) ? pos : NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Alexey Dobriyan | 23 | 82.14% | 1 | 33.33% | 
| Linus Torvalds (pre-git) | 5 | 17.86% | 2 | 66.67% | 
| Total | 28 | 100.00% | 3 | 100.00% | 
static void * zorro_seq_next(struct seq_file *m, void *v, loff_t *pos)
{
	(*pos)++;
	return (*pos < zorro_num_autocon) ? pos : NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Alexey Dobriyan | 35 | 92.11% | 1 | 50.00% | 
| Linus Torvalds (pre-git) | 3 | 7.89% | 1 | 50.00% | 
| Total | 38 | 100.00% | 2 | 100.00% | 
static void zorro_seq_stop(struct seq_file *m, void *v)
{
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Alexey Dobriyan | 13 | 92.86% | 1 | 50.00% | 
| Linus Torvalds (pre-git) | 1 | 7.14% | 1 | 50.00% | 
| Total | 14 | 100.00% | 2 | 100.00% | 
static int zorro_seq_show(struct seq_file *m, void *v)
{
	unsigned int slot = *(loff_t *)v;
	struct zorro_dev *z = &zorro_autocon[slot];
	seq_printf(m, "%02x\t%08x\t%08lx\t%08lx\t%02x\n", slot, z->id,
		   (unsigned long)zorro_resource_start(z),
		   (unsigned long)zorro_resource_len(z),
		   z->rom.er_Type);
	return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Linus Torvalds (pre-git) | 33 | 42.86% | 2 | 33.33% | 
| Alexey Dobriyan | 23 | 29.87% | 1 | 16.67% | 
| Andrew Morton | 11 | 14.29% | 1 | 16.67% | 
| Geert Uytterhoeven | 10 | 12.99% | 2 | 33.33% | 
| Total | 77 | 100.00% | 6 | 100.00% | 
static const struct seq_operations zorro_devices_seq_ops = {
	.start = zorro_seq_start,
	.next  = zorro_seq_next,
	.stop  = zorro_seq_stop,
	.show  = zorro_seq_show,
};
static int zorro_devices_proc_open(struct inode *inode, struct file *file)
{
	return seq_open(file, &zorro_devices_seq_ops);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Alexey Dobriyan | 22 | 88.00% | 1 | 50.00% | 
| Linus Torvalds (pre-git) | 3 | 12.00% | 1 | 50.00% | 
| Total | 25 | 100.00% | 2 | 100.00% | 
static const struct file_operations zorro_devices_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= zorro_devices_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= seq_release,
};
static struct proc_dir_entry *proc_bus_zorro_dir;
static int __init zorro_proc_attach_device(unsigned int slot)
{
	struct proc_dir_entry *entry;
	char name[4];
	sprintf(name, "%02x", slot);
	entry = proc_create_data(name, 0, proc_bus_zorro_dir,
				 &proc_bus_zorro_operations,
				 &zorro_autocon[slot]);
	if (!entry)
		return -ENOMEM;
	proc_set_size(entry, sizeof(struct zorro_dev));
	return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Linus Torvalds (pre-git) | 58 | 78.38% | 4 | 57.14% | 
| Denis V. Lunev | 10 | 13.51% | 1 | 14.29% | 
| David Howells | 4 | 5.41% | 1 | 14.29% | 
| Geert Uytterhoeven | 2 | 2.70% | 1 | 14.29% | 
| Total | 74 | 100.00% | 7 | 100.00% | 
static int __init zorro_proc_init(void)
{
	unsigned int slot;
	if (MACH_IS_AMIGA && AMIGAHW_PRESENT(ZORRO)) {
		proc_bus_zorro_dir = proc_mkdir("bus/zorro", NULL);
		proc_create("devices", 0, proc_bus_zorro_dir,
			    &zorro_devices_proc_fops);
		for (slot = 0; slot < zorro_num_autocon; slot++)
			zorro_proc_attach_device(slot);
	}
	return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Linus Torvalds (pre-git) | 59 | 89.39% | 5 | 62.50% | 
| Alexey Dobriyan | 5 | 7.58% | 2 | 25.00% | 
| Geert Uytterhoeven | 2 | 3.03% | 1 | 12.50% | 
| Total | 66 | 100.00% | 8 | 100.00% | 
device_initcall(zorro_proc_init);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Linus Torvalds (pre-git) | 391 | 57.67% | 8 | 26.67% | 
| Alexey Dobriyan | 181 | 26.70% | 2 | 6.67% | 
| Geert Uytterhoeven | 38 | 5.60% | 6 | 20.00% | 
| Andrew Morton | 22 | 3.24% | 1 | 3.33% | 
| Al Viro | 16 | 2.36% | 5 | 16.67% | 
| Denis V. Lunev | 15 | 2.21% | 1 | 3.33% | 
| Art Haas | 4 | 0.59% | 1 | 3.33% | 
| David Howells | 4 | 0.59% | 1 | 3.33% | 
| Paul Gortmaker | 3 | 0.44% | 1 | 3.33% | 
| Arjan van de Ven | 1 | 0.15% | 1 | 3.33% | 
| Linus Torvalds | 1 | 0.15% | 1 | 3.33% | 
| Robert P. J. Day | 1 | 0.15% | 1 | 3.33% | 
| Adrian Bunk | 1 | 0.15% | 1 | 3.33% | 
| Total | 678 | 100.00% | 30 | 100.00% | 
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.