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