/* * 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 */ #include #include #include #include #include #include #include #include #include #include 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)); } 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; } 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; } static void * zorro_seq_next(struct seq_file *m, void *v, loff_t *pos) { (*pos)++; return (*pos < zorro_num_autocon) ? pos : NULL; } static void zorro_seq_stop(struct seq_file *m, void *v) { } 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; } 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); } 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; } 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; } device_initcall(zorro_proc_init); t/irda/parameters.h?h=nds-private-remove&id=0e0694ff1a7791274946b7f51bae692da0001a08'>parameters.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-12-26 14:09:28 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-12-26 14:09:28 -0200
commit0e0694ff1a7791274946b7f51bae692da0001a08 (patch)
tree53d28f58d793c151aa870f17d38ddec6ac01ec7a /include/net/irda/parameters.h
parent65390ea01ce678379da32b01f39fcfac4903f256 (diff)
parentc739c0a7c3c2472d7562b8f802cdce44d2597c8b (diff)
Merge branch 'patchwork' into v4l_for_linus
* patchwork: [media] s5k4ecgx: select CRC32 helper [media] dvb: avoid warning in dvb_net [media] v4l: tvp5150: Don't override output pinmuxing at stream on/off time [media] v4l: tvp5150: Fix comment regarding output pin muxing [media] v4l: tvp5150: Reset device at probe time, not in get/set format handlers [media] pctv452e: move buffer to heap, no mutex [media] media/cobalt: use pci_irq_allocate_vectors [media] cec: fix race between configuring and unconfiguring [media] cec: move cec_report_phys_addr into cec_config_thread_func [media] cec: replace cec_report_features by cec_fill_msg_report_features [media] cec: update log_addr[] before finishing configuration [media] cec: CEC_MSG_GIVE_FEATURES should abort for CEC version < 2 [media] cec: when canceling a message, don't overwrite old status info [media] cec: fix report_current_latency [media] smiapp: Make suspend and resume functions __maybe_unused [media] smiapp: Implement power-on and power-off sequences without runtime PM
Diffstat (limited to 'include/net/irda/parameters.h')