3 * Copyright (C) 2010 - 2013 UNISYS CORPORATION
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14 * NON INFRINGEMENT. See the GNU General Public License for more
18 /** @file *********************************************************************
20 * This describes the interfaces necessary for a simple /proc file
21 * implementation for a driver.
23 ******************************************************************************
26 #ifndef __EASYPROC_H__
27 #define __EASYPROC_H__
32 struct easyproc_driver_info {
33 struct proc_dir_entry *ProcDir;
34 struct proc_dir_entry *ProcDriverDir;
35 struct proc_dir_entry *ProcDriverDiagFile;
36 struct proc_dir_entry *ProcDeviceDir;
38 void (*Show_device_info)(struct seq_file *seq, void *p);
39 void (*Show_driver_info)(struct seq_file *seq);
40 void (*Write_device_info)(char *buf, size_t count,
41 loff_t *ppos, void *p);
42 void (*Write_driver_info)(char *buf, size_t count, loff_t *ppos);
45 /* property is a file under /proc/<x>/device/<x>/<property_name> */
46 struct easyproc_device_property_info {
47 char property_name[25];
48 struct proc_dir_entry *procEntry;
49 struct easyproc_driver_info *pdriver;
51 void (*show_device_property_info)(struct seq_file *seq, void *p);
54 struct easyproc_device_info {
55 struct proc_dir_entry *procDevicexDir;
56 struct proc_dir_entry *procDevicexDiagFile;
57 struct easyproc_driver_info *pdriver;
60 /* allow for a number of custom properties for each device: */
61 struct easyproc_device_property_info device_property_info[10];
64 void visor_easyproc_InitDevice(struct easyproc_driver_info *pdriver,
65 struct easyproc_device_info *p, int devno,
67 void visor_easyproc_DeInitDevice(struct easyproc_driver_info *pdriver,
68 struct easyproc_device_info *p, int devno);
69 void visor_easyproc_InitDriver(struct easyproc_driver_info *pdriver,
71 void (*show_driver_info)(struct seq_file *),
72 void (*show_device_info)(struct seq_file *,
74 void visor_easyproc_InitDriverEx(struct easyproc_driver_info *pdriver,
76 void (*show_driver_info)(struct seq_file *),
77 void (*show_device_info)(struct seq_file *,
79 void (*Write_driver_info)(char *buf,
82 void (*Write_device_info)(char *buf,
86 void visor_easyproc_DeInitDriver(struct easyproc_driver_info *pdriver);
87 void visor_easyproc_CreateDeviceProperty(struct easyproc_device_info *p,
88 void (*show_property_info)
89 (struct seq_file *, void *),