OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [ncp_fs.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 *  ncp_fs.h
3
 *
4
 *  Copyright (C) 1995, 1996 by Volker Lendecke
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
 * ioctl commands
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
        __kernel_uid_t  mounted_uid;
33
        int    connection;      /* Connection number the server assigned us */
34
        int    buffer_size;     /* The negotiated buffer size, to be
35
                                   used for read/write requests! */
36
 
37
        int    volume_number;
38
        __u32  directory_id;
39
};
40
 
41
struct ncp_sign_init
42
{
43
        char sign_root[8];
44
        char sign_last[16];
45
};
46
 
47
struct ncp_lock_ioctl
48
{
49
#define NCP_LOCK_LOG    0
50
#define NCP_LOCK_SH     1
51
#define NCP_LOCK_EX     2
52
#define NCP_LOCK_CLEAR  256
53
        int             cmd;
54
        int             origin;
55
        unsigned int    offset;
56
        unsigned int    length;
57
#define NCP_LOCK_DEFAULT_TIMEOUT        18
58
#define NCP_LOCK_MAX_TIMEOUT            180
59
        int             timeout;
60
};
61
 
62
struct ncp_setroot_ioctl
63
{
64
        int             volNumber;
65
        int             namespace;
66
        __u32           dirEntNum;
67
};
68
 
69
#define NCP_IOC_NCPREQUEST              _IOR('n', 1, struct ncp_ioctl_request)
70
#define NCP_IOC_GETMOUNTUID             _IOW('n', 2, __kernel_uid_t)
71
#define NCP_IOC_GETMOUNTUID_INT         _IOW('n', 2, unsigned int)
72
#define NCP_IOC_CONN_LOGGED_IN          _IO('n', 3)
73
 
74
#define NCP_GET_FS_INFO_VERSION (1)
75
#define NCP_IOC_GET_FS_INFO             _IOWR('n', 4, struct ncp_fs_info)
76
 
77
#define NCP_IOC_SIGN_INIT               _IOR('n', 5, struct ncp_sign_init)
78
#define NCP_IOC_SIGN_WANTED             _IOR('n', 6, int)
79
#define NCP_IOC_SET_SIGN_WANTED         _IOW('n', 6, int)
80
 
81
#define NCP_IOC_LOCKUNLOCK              _IOR('n', 7, struct ncp_lock_ioctl)
82
 
83
#define NCP_IOC_GETROOT                 _IOW('n', 8, struct ncp_setroot_ioctl)
84
#define NCP_IOC_SETROOT                 _IOR('n', 8, struct ncp_setroot_ioctl)
85
/*
86
 * The packet size to allocate. One page should be enough.
87
 */
88
#define NCP_PACKET_SIZE 4070
89
 
90
#define NCP_MAXPATHLEN 255
91
#define NCP_MAXNAMELEN 14
92
 
93
#define NCP_MSG_COMMAND "/sbin/nwmsg"
94
 
95
#ifdef __KERNEL__
96
 
97
/* The readdir cache size controls how many directory entries are
98
 * cached.
99
 */
100
#define NCP_READDIR_CACHE_SIZE        64
101
 
102
 
103
#define NCP_MAX_RPC_TIMEOUT (6*HZ)
104
 
105
/* Guess, what 0x564c is :-) */
106
#define NCP_SUPER_MAGIC  0x564c
107
 
108
 
109
#define NCP_SBP(sb)          ((struct ncp_server *)((sb)->u.generic_sbp))
110
#define NCP_INOP(inode)      ((struct ncp_inode_info *)((inode)->u.generic_ip))
111
 
112
#define NCP_SERVER(inode)    NCP_SBP((inode)->i_sb)
113
#define NCP_FINFO(inode)     (&(NCP_INOP(inode)->finfo))
114
#define NCP_ISTRUCT(inode)   (&(NCP_FINFO(inode)->i))
115
 
116
#ifdef DEBUG_NCP_MALLOC
117
 
118
#include <linux/malloc.h>
119
 
120
extern int ncp_malloced;
121
extern int ncp_current_malloced;
122
 
123
static inline void *
124
ncp_kmalloc(unsigned int size, int priority)
125
{
126
        ncp_malloced += 1;
127
        ncp_current_malloced += 1;
128
        return kmalloc(size, priority);
129
}
130
 
131
static inline void
132
ncp_kfree_s(void *obj, int size)
133
{
134
        ncp_current_malloced -= 1;
135
        kfree_s(obj, size);
136
}
137
 
138
#else /* DEBUG_NCP_MALLOC */
139
 
140
#define ncp_kmalloc(s,p) kmalloc(s,p)
141
#define ncp_kfree_s(o,s) kfree_s(o,s)
142
 
143
#endif /* DEBUG_NCP_MALLOC */
144
 
145
#if DEBUG_NCP > 0
146
#define DPRINTK(format, args...) printk(format , ## args)
147
#else
148
#define DPRINTK(format, args...)
149
#endif
150
 
151
#if DEBUG_NCP > 1
152
#define DDPRINTK(format, args...) printk(format , ## args)
153
#else
154
#define DDPRINTK(format, args...)
155
#endif
156
 
157
 
158
/* linux/fs/ncpfs/file.c */
159
extern struct inode_operations ncp_file_inode_operations;
160
int ncp_make_open(struct inode *i, int right);
161
 
162
/* linux/fs/ncpfs/dir.c */
163
extern struct inode_operations ncp_dir_inode_operations;
164
void ncp_free_inode_info(struct ncp_inode_info *i);
165
void ncp_free_all_inodes(struct ncp_server *server);
166
void ncp_init_root(struct ncp_server *server);
167
int  ncp_conn_logged_in(struct ncp_server *server);
168
void ncp_init_dir_cache(void);
169
void ncp_invalid_dir_cache(struct inode *ino);
170
struct ncp_inode_info *ncp_find_inode(struct inode *inode);
171
ino_t ncp_info_ino(struct ncp_server *server, struct ncp_inode_info *info);
172
void ncp_free_dir_cache(void);
173
int  ncp_date_dos2unix(__u16 time, __u16 date);
174
void ncp_date_unix2dos(int unix_date, __u16 *time, __u16 *date);
175
 
176
 
177
/* linux/fs/ncpfs/ioctl.c */
178
int ncp_ioctl (struct inode * inode, struct file * filp,
179
               unsigned int cmd, unsigned long arg);
180
 
181
/* linux/fs/ncpfs/inode.c */
182
int ncp_notify_change(struct inode *inode, struct iattr *attr);
183
struct super_block *ncp_read_super(struct super_block *sb,
184
                                   void *raw_data, int silent);
185
extern int init_ncp_fs(void);
186
void ncp_trigger_message(struct ncp_server *server);
187
 
188
/* linux/fs/ncpfs/sock.c */
189
int ncp_request(struct ncp_server *server, int function);
190
int ncp_connect(struct ncp_server *server);
191
int ncp_disconnect(struct ncp_server *server);
192
int ncp_catch_watchdog(struct ncp_server *server);
193
int ncp_dont_catch_watchdog(struct ncp_server *server);
194
int ncp_catch_message(struct ncp_server *server);
195
void ncp_lock_server(struct ncp_server *server);
196
void ncp_unlock_server(struct ncp_server *server);
197
 
198
/* linux/fs/ncpfs/mmap.c */
199
int ncp_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
200
 
201
#endif /* __KERNEL__ */
202
 
203
#endif /* _LINUX_NCP_FS_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.