Release 4.7 drivers/pnp/isapnp/proc.c
/*
* ISA Plug & Play support
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <asm/uaccess.h>
extern struct pnp_protocol isapnp_protocol;
static struct proc_dir_entry *isapnp_proc_bus_dir = NULL;
static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
{
return fixed_size_llseek(file, off, whence, 256);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
adam belay | adam belay | 20 | 68.97% | 1 | 25.00% |
al viro | al viro | 7 | 24.14% | 2 | 50.00% |
arnd bergmann | arnd bergmann | 2 | 6.90% | 1 | 25.00% |
| Total | 29 | 100.00% | 4 | 100.00% |
static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
size_t nbytes, loff_t * ppos)
{
struct pnp_dev *dev = PDE_DATA(file_inode(file));
int pos = *ppos;
int cnt, size = 256;
if (pos >= size)
return 0;
if (nbytes >= size)
nbytes = size;
if (pos + nbytes > size)
nbytes = size - pos;
cnt = nbytes;
if (!access_ok(VERIFY_WRITE, buf, cnt))
return -EINVAL;
isapnp_cfg_begin(dev->card->number, dev->number);
for (; pos < 256 && cnt > 0; pos++, buf++, cnt--) {
unsigned char val;
val = isapnp_read_byte(pos);
__put_user(val, buf);
}
isapnp_cfg_end();
*ppos = pos;
return nbytes;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
adam belay | adam belay | 158 | 95.18% | 1 | 25.00% |
al viro | al viro | 8 | 4.82% | 3 | 75.00% |
| Total | 166 | 100.00% | 4 | 100.00% |
static const struct file_operations isapnp_proc_bus_file_operations = {
.owner = THIS_MODULE,
.llseek = isapnp_proc_bus_lseek,
.read = isapnp_proc_bus_read,
};
static int isapnp_proc_attach_device(struct pnp_dev *dev)
{
struct pnp_card *bus = dev->card;
struct proc_dir_entry *de, *e;
char name[16];
if (!(de = bus->procdir)) {
sprintf(name, "%02x", bus->number);
de = bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir);
if (!de)
return -ENOMEM;
}
sprintf(name, "%02x", dev->number);
e = dev->procent = proc_create_data(name, S_IFREG | S_IRUGO, de,
&isapnp_proc_bus_file_operations, dev);
if (!e)
return -ENOMEM;
proc_set_size(e, 256);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
adam belay | adam belay | 122 | 92.42% | 1 | 33.33% |
denis v. lunev | denis v. lunev | 6 | 4.55% | 1 | 33.33% |
david howells | david howells | 4 | 3.03% | 1 | 33.33% |
| Total | 132 | 100.00% | 3 | 100.00% |
int __init isapnp_proc_init(void)
{
struct pnp_dev *dev;
isapnp_proc_bus_dir = proc_mkdir("bus/isapnp", NULL);
protocol_for_each_dev(&isapnp_protocol, dev) {
isapnp_proc_attach_device(dev);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
adam belay | adam belay | 36 | 94.74% | 2 | 66.67% |
alexey dobriyan | alexey dobriyan | 2 | 5.26% | 1 | 33.33% |
| Total | 38 | 100.00% | 3 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
adam belay | adam belay | 366 | 87.77% | 2 | 13.33% |
al viro | al viro | 15 | 3.60% | 4 | 26.67% |
jaroslav kysela | jaroslav kysela | 12 | 2.88% | 3 | 20.00% |
denis v. lunev | denis v. lunev | 11 | 2.64% | 1 | 6.67% |
david howells | david howells | 4 | 0.96% | 1 | 6.67% |
art haas | art haas | 4 | 0.96% | 1 | 6.67% |
alexey dobriyan | alexey dobriyan | 2 | 0.48% | 1 | 6.67% |
arnd bergmann | arnd bergmann | 2 | 0.48% | 1 | 6.67% |
arjan van de ven | arjan van de ven | 1 | 0.24% | 1 | 6.67% |
| Total | 417 | 100.00% | 15 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.