1 /*
2 * ncp_fs_sb.h
3 *
4 * Copyright (C) 1995, 1996 by Volker Lendecke
5 *
6 */
7
8 #ifndef _NCP_FS_SB
9 #define _NCP_FS_SB
10
11 #include <linux/ncp_mount.h>
12 #include <linux/types.h>
13
14 #ifdef __KERNEL__
15
16 #define NCP_DEFAULT_BUFSIZE 1024
17
18 struct ncp_server {
19
20 struct ncp_mount_data m; /* Nearly all of the mount data is of
21 interest for us later, so we store
22 it completely. */
23
24 struct file *ncp_filp; /* File pointer to ncp socket */
25 struct file *wdog_filp; /* File pointer to wdog socket */
26 struct file *msg_filp; /* File pointer to message socket */
27 void *data_ready; /* The wdog socket gets a new
28 data_ready callback. We store the
29 old one for checking purposes and
30 to reset it on unmounting. */
31
32 u8 sequence;
33 u8 task;
34 u16 connection; /* Remote connection number */
35
36 u8 completion; /* Status message from server */
37 u8 conn_status; /* Bit 4 = 1 ==> Server going down, no
38 requests allowed anymore.
39 Bit 0 = 1 ==> Server is down. */
40
41 int buffer_size; /* Negotiated bufsize */
42
43 int reply_size; /* Size of last reply */
44
45 int packet_size;
46 unsigned char *packet; /* Here we prepare requests and
47 receive replies */
48
49 int lock; /* To prevent mismatch in protocols. */
50 struct wait_queue *wait;
51
52 int current_size; /* for packet preparation */
53 int has_subfunction;
54 int ncp_reply_size;
55
56 struct ncp_inode_info root;
57 char root_path; /* '\0' */
58 };
59
60 static inline int
61 ncp_conn_valid(struct ncp_server *server)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
62 {
63 return ((server->conn_status & 0x11) == 0);
64 }
65
66 static inline void
67 ncp_invalidate_conn(struct ncp_server *server)
/* ![[previous]](../icons/left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
68 {
69 server->conn_status |= 0x01;
70 }
71
72 #endif /* __KERNEL__ */
73
74 #endif