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