#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/export.h>
#include <asm/byteorder.h>
#include <linux/uaccess.h>
proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
return fixed_size_llseek(file, off, whence, sizeof(struct ConfigDev));
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));
if (pos >= sizeof(struct ConfigDev))
if (nbytes >= sizeof(struct ConfigDev))
nbytes = sizeof(struct ConfigDev);
if (pos + nbytes > sizeof(struct ConfigDev))
nbytes = sizeof(struct ConfigDev) - pos;
memset(&cd, 0, sizeof(cd));
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))
static const struct file_operations proc_bus_zorro_operations = {
.llseek = proc_bus_zorro_lseek,
.read = proc_bus_zorro_read,