This source file includes following definitions.
- ncp_kmalloc
- ncp_kfree_s
1
2
3
4
5
6
7
8 #ifndef _LINUX_NCP_FS_H
9 #define _LINUX_NCP_FS_H
10
11 #include <linux/fs.h>
12 #include <linux/in.h>
13 #include <linux/types.h>
14
15 #include <linux/ncp_mount.h>
16 #include <linux/ncp_fs_sb.h>
17 #include <linux/ncp_fs_i.h>
18
19
20
21
22
23 struct ncp_ioctl_request {
24 unsigned int function;
25 unsigned int size;
26 char *data;
27 };
28
29 struct ncp_fs_info {
30 int version;
31 struct sockaddr_ipx addr;
32 uid_t mounted_uid;
33 int connection;
34 int buffer_size;
35
36
37
38
39 int volume_number;
40 __u32 directory_id;
41 };
42
43 #define NCP_IOC_NCPREQUEST _IOR('n', 1, unsigned char *)
44 #define NCP_IOC_GETMOUNTUID _IOR('u', 1, uid_t)
45 #define NCP_IOC_CONN_LOGGED_IN _IO('l', 1)
46
47 #define NCP_GET_FS_INFO_VERSION (1)
48 #define NCP_IOC_GET_FS_INFO _IOWR('i', 1, unsigned char *)
49
50
51
52
53 #define NCP_PACKET_SIZE 4070
54
55 #define NCP_MAXPATHLEN 255
56 #define NCP_MAXNAMELEN 14
57
58 #define NCP_MSG_COMMAND "/sbin/nwmsg"
59
60 #ifdef __KERNEL__
61
62
63
64
65 #define NCP_READDIR_CACHE_SIZE 64
66
67
68 #define NCP_MAX_RPC_TIMEOUT (60)
69
70
71 #define NCP_SUPER_MAGIC 0x564c
72
73
74 #define NCP_SBP(sb) ((struct ncp_server *)((sb)->u.generic_sbp))
75 #define NCP_INOP(inode) ((struct ncp_inode_info *)((inode)->u.generic_ip))
76
77 #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
78 #define NCP_FINFO(inode) (&(NCP_INOP(inode)->finfo))
79 #define NCP_ISTRUCT(inode) (&(NCP_FINFO(inode)->i))
80
81 #ifdef DEBUG_NCP_MALLOC
82
83 #include <linux/malloc.h>
84
85 extern int ncp_malloced;
86 extern int ncp_current_malloced;
87
88 static inline void *
89 ncp_kmalloc(unsigned int size, int priority)
90 {
91 ncp_malloced += 1;
92 ncp_current_malloced += 1;
93 return kmalloc(size, priority);
94 }
95
96 static inline void
97 ncp_kfree_s(void *obj, int size)
98 {
99 ncp_current_malloced -= 1;
100 kfree_s(obj, size);
101 }
102
103 #else
104
105 #define ncp_kmalloc(s,p) kmalloc(s,p)
106 #define ncp_kfree_s(o,s) kfree_s(o,s)
107
108 #endif
109
110 #if DEBUG_NCP > 0
111 #define DPRINTK(format, args...) printk(format , ## args)
112 #else
113 #define DPRINTK(format, args...)
114 #endif
115
116 #if DEBUG_NCP > 1
117 #define DDPRINTK(format, args...) printk(format , ## args)
118 #else
119 #define DDPRINTK(format, args...)
120 #endif
121
122
123
124 extern struct inode_operations ncp_file_inode_operations;
125 int ncp_make_open(struct inode *i, int right);
126
127
128 extern struct inode_operations ncp_dir_inode_operations;
129 void ncp_free_inode_info(struct ncp_inode_info *i);
130 void ncp_free_all_inodes(struct ncp_server *server);
131 void ncp_init_root(struct ncp_server *server);
132 int ncp_conn_logged_in(struct ncp_server *server);
133 void ncp_init_dir_cache(void);
134 void ncp_invalid_dir_cache(struct inode *ino);
135 struct ncp_inode_info *ncp_find_inode(struct inode *inode);
136 ino_t ncp_info_ino(struct ncp_server *server, struct ncp_inode_info *info);
137 void ncp_free_dir_cache(void);
138 int ncp_date_dos2unix(__u16 time, __u16 date);
139 void ncp_date_unix2dos(int unix_date, __u16 *time, __u16 *date);
140
141
142
143 int ncp_ioctl (struct inode * inode, struct file * filp,
144 unsigned int cmd, unsigned long arg);
145
146
147 struct super_block *ncp_read_super(struct super_block *sb,
148 void *raw_data, int silent);
149 extern int init_ncp_fs(void);
150 void ncp_trigger_message(struct ncp_server *server);
151
152
153 int ncp_request(struct ncp_server *server, int function);
154 int ncp_connect(struct ncp_server *server);
155 int ncp_disconnect(struct ncp_server *server);
156 int ncp_catch_watchdog(struct ncp_server *server);
157 int ncp_dont_catch_watchdog(struct ncp_server *server);
158 int ncp_catch_message(struct ncp_server *server);
159 void ncp_lock_server(struct ncp_server *server);
160 void ncp_unlock_server(struct ncp_server *server);
161
162
163 int ncp_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
164
165 #endif
166
167 #endif