This source file includes following definitions.
- proc_net_register
- proc_net_unregister
- proc_scsi_register
- proc_scsi_unregister
1 #ifndef _LINUX_PROC_FS_H
2 #define _LINUX_PROC_FS_H
3
4 #include <linux/fs.h>
5 #include <linux/malloc.h>
6
7
8
9
10
11
12
13
14
15 enum root_directory_inos {
16 PROC_ROOT_INO = 1,
17 PROC_LOADAVG,
18 PROC_UPTIME,
19 PROC_MEMINFO,
20 PROC_KMSG,
21 PROC_VERSION,
22 PROC_CPUINFO,
23 PROC_PCI,
24 PROC_SELF,
25 PROC_NET,
26 PROC_SCSI,
27 PROC_MALLOC,
28 PROC_KCORE,
29 PROC_MODULES,
30 PROC_STAT,
31 PROC_DEVICES,
32 PROC_INTERRUPTS,
33 PROC_FILESYSTEMS,
34 PROC_KSYMS,
35 PROC_DMA,
36 PROC_IOPORTS,
37 PROC_APM,
38 #ifdef __SMP_PROF__
39 PROC_SMP_PROF,
40 #endif
41 PROC_PROFILE,
42 PROC_CMDLINE,
43 PROC_SYS,
44 PROC_MTAB
45 };
46
47 enum pid_directory_inos {
48 PROC_PID_INO = 2,
49 PROC_PID_STATUS,
50 PROC_PID_MEM,
51 PROC_PID_CWD,
52 PROC_PID_ROOT,
53 PROC_PID_EXE,
54 PROC_PID_FD,
55 PROC_PID_ENVIRON,
56 PROC_PID_CMDLINE,
57 PROC_PID_STAT,
58 PROC_PID_STATM,
59 PROC_PID_MAPS
60 };
61
62 enum pid_subdirectory_inos {
63 PROC_PID_FD_DIR = 1
64 };
65
66 enum net_directory_inos {
67 PROC_NET_UNIX = 128,
68 PROC_NET_ARP,
69 PROC_NET_ROUTE,
70 PROC_NET_DEV,
71 PROC_NET_RAW,
72 PROC_NET_TCP,
73 PROC_NET_UDP,
74 PROC_NET_SNMP,
75 PROC_NET_RARP,
76 PROC_NET_IGMP,
77 PROC_NET_IPMR_VIF,
78 PROC_NET_IPMR_MFC,
79 PROC_NET_IPFWFWD,
80 PROC_NET_IPFWIN,
81 PROC_NET_IPFWOUT,
82 PROC_NET_IPACCT,
83 PROC_NET_IPMSQHST,
84 PROC_NET_WAVELAN,
85 PROC_NET_IPX_INTERFACE,
86 PROC_NET_IPX_ROUTE,
87 PROC_NET_IPX,
88 PROC_NET_ATALK,
89 PROC_NET_AT_ROUTE,
90 PROC_NET_ATIF,
91 PROC_NET_AX25_ROUTE,
92 PROC_NET_AX25,
93 PROC_NET_AX25_CALLS,
94 PROC_NET_NR_NODES,
95 PROC_NET_NR_NEIGH,
96 PROC_NET_NR,
97 PROC_NET_SOCKSTAT,
98 PROC_NET_RTCACHE,
99 PROC_NET_AX25_BPQETHER,
100 PROC_NET_ALIAS_TYPES,
101 PROC_NET_ALIASES,
102 PROC_NET_LAST
103 };
104
105 enum scsi_directory_inos {
106 PROC_SCSI_SCSI = 256,
107 PROC_SCSI_ADVANSYS,
108 PROC_SCSI_EATA,
109 PROC_SCSI_EATA_PIO,
110 PROC_SCSI_AHA152X,
111 PROC_SCSI_AHA1542,
112 PROC_SCSI_AHA1740,
113 PROC_SCSI_AIC7XXX,
114 PROC_SCSI_BUSLOGIC,
115 PROC_SCSI_U14_34F,
116 PROC_SCSI_FDOMAIN,
117 PROC_SCSI_GENERIC_NCR5380,
118 PROC_SCSI_IN2000,
119 PROC_SCSI_PAS16,
120 PROC_SCSI_QLOGIC,
121 PROC_SCSI_SEAGATE,
122 PROC_SCSI_T128,
123 PROC_SCSI_NCR53C7xx,
124 PROC_SCSI_ULTRASTOR,
125 PROC_SCSI_7000FASST,
126 PROC_SCSI_EATA2X,
127 PROC_SCSI_AM53C974,
128 PROC_SCSI_SSC,
129 PROC_SCSI_NCR53C406A,
130 PROC_SCSI_SCSI_DEBUG,
131 PROC_SCSI_NOT_PRESENT,
132 PROC_SCSI_FILE,
133 PROC_SCSI_LAST = (PROC_SCSI_FILE + 16)
134 };
135
136
137
138 #define PROC_DYNAMIC_FIRST 4096
139 #define PROC_NDYNAMIC 4096
140
141 #define PROC_SUPER_MAGIC 0x9fa0
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158 struct proc_dir_entry {
159 unsigned short low_ino;
160 unsigned short namelen;
161 const char *name;
162 mode_t mode;
163 nlink_t nlink;
164 uid_t uid;
165 gid_t gid;
166 unsigned long size;
167 struct inode_operations * ops;
168 int (*get_info)(char *, char **, off_t, int, int);
169 void (*fill_inode)(struct inode *);
170 struct proc_dir_entry *next, *parent, *subdir;
171 void *data;
172 };
173
174 extern int (* dispatch_scsi_info_ptr) (int ino, char *buffer, char **start,
175 off_t offset, int length, int inout);
176
177 extern struct proc_dir_entry proc_root;
178 extern struct proc_dir_entry proc_net;
179 extern struct proc_dir_entry proc_scsi;
180 extern struct proc_dir_entry proc_sys;
181 extern struct proc_dir_entry proc_pid;
182 extern struct proc_dir_entry proc_pid_fd;
183
184 extern struct inode_operations proc_scsi_inode_operations;
185
186 extern void proc_root_init(void);
187 extern void proc_base_init(void);
188 extern void proc_net_init(void);
189
190 extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
191 extern int proc_register_dynamic(struct proc_dir_entry *,
192 struct proc_dir_entry *);
193 extern int proc_unregister(struct proc_dir_entry *, int);
194
195 static inline int proc_net_register(struct proc_dir_entry * x)
196 {
197 return proc_register(&proc_net, x);
198 }
199
200 static inline int proc_net_unregister(int x)
201 {
202 return proc_unregister(&proc_net, x);
203 }
204
205 static inline int proc_scsi_register(struct proc_dir_entry *driver,
206 struct proc_dir_entry *x)
207 {
208 x->ops = &proc_scsi_inode_operations;
209 if(x->low_ino < PROC_SCSI_FILE){
210 return(proc_register(&proc_scsi, x));
211 }else{
212 return(proc_register(driver, x));
213 }
214 }
215
216 static inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x)
217 {
218 extern void scsi_init_free(char *ptr, unsigned int size);
219
220 if(x <= PROC_SCSI_FILE)
221 return(proc_unregister(&proc_scsi, x));
222 else {
223 struct proc_dir_entry **p = &driver->subdir, *dp;
224 int ret;
225
226 while ((dp = *p) != NULL) {
227 if (dp->low_ino == x)
228 break;
229 p = &dp->next;
230 }
231 ret = proc_unregister(driver, x);
232 scsi_init_free((char *) dp, sizeof(struct proc_dir_entry) + 4);
233 return(ret);
234 }
235 }
236
237 extern struct super_block *proc_read_super(struct super_block *,void *,int);
238 extern int init_proc_fs(void);
239 extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *);
240 extern void proc_statfs(struct super_block *, struct statfs *, int);
241 extern void proc_read_inode(struct inode *);
242 extern void proc_write_inode(struct inode *);
243 extern int proc_match(int, const char *, struct proc_dir_entry *);
244
245
246
247
248
249
250
251
252 extern int proc_readdir(struct inode *, struct file *, void *, filldir_t);
253 extern int proc_lookup(struct inode *, const char *, int, struct inode **);
254
255 extern struct inode_operations proc_dir_inode_operations;
256 extern struct inode_operations proc_net_inode_operations;
257 extern struct inode_operations proc_netdir_inode_operations;
258 extern struct inode_operations proc_scsi_inode_operations;
259 extern struct inode_operations proc_mem_inode_operations;
260 extern struct inode_operations proc_sys_inode_operations;
261 extern struct inode_operations proc_array_inode_operations;
262 extern struct inode_operations proc_arraylong_inode_operations;
263 extern struct inode_operations proc_kcore_inode_operations;
264 extern struct inode_operations proc_profile_inode_operations;
265 extern struct inode_operations proc_kmsg_inode_operations;
266 extern struct inode_operations proc_link_inode_operations;
267 extern struct inode_operations proc_fd_inode_operations;
268
269 #endif