1
2
3
4
5
6
7
8
9
10
11
12#ifndef IRNET_PPP_H
13#define IRNET_PPP_H
14
15
16
17#include "irnet.h"
18
19
20
21
22#define IRNET_MAJOR 10
23#define IRNET_MINOR 187
24
25
26#define IRNET_MAX_COMMAND 256
27
28
29
30
31#define SC_RCV_BITS (SC_RCV_B7_1|SC_RCV_B7_0|SC_RCV_ODDP|SC_RCV_EVNP)
32
33
34#define XMIT_BUSY 0
35#define RECV_BUSY 1
36#define XMIT_WAKEUP 2
37#define XMIT_FULL 3
38
39
40#define PPPSYNC_MAX_RQLEN 32
41
42
43
44
45
46
47
48static inline ssize_t
49 irnet_ctrl_write(irnet_socket *,
50 const char *,
51 size_t);
52static inline ssize_t
53 irnet_ctrl_read(irnet_socket *,
54 struct file *,
55 char *,
56 size_t);
57static inline unsigned int
58 irnet_ctrl_poll(irnet_socket *,
59 struct file *,
60 poll_table *);
61
62static int
63 dev_irnet_open(struct inode *,
64 struct file *),
65 dev_irnet_close(struct inode *,
66 struct file *);
67static ssize_t
68 dev_irnet_write(struct file *,
69 const char __user *,
70 size_t,
71 loff_t *),
72 dev_irnet_read(struct file *,
73 char __user *,
74 size_t,
75 loff_t *);
76static unsigned int
77 dev_irnet_poll(struct file *,
78 poll_table *);
79static long
80 dev_irnet_ioctl(struct file *,
81 unsigned int,
82 unsigned long);
83
84static inline struct sk_buff *
85 irnet_prepare_skb(irnet_socket *,
86 struct sk_buff *);
87static int
88 ppp_irnet_send(struct ppp_channel *,
89 struct sk_buff *);
90static int
91 ppp_irnet_ioctl(struct ppp_channel *,
92 unsigned int,
93 unsigned long);
94
95
96
97
98static const struct file_operations irnet_device_fops =
99{
100 .owner = THIS_MODULE,
101 .read = dev_irnet_read,
102 .write = dev_irnet_write,
103 .poll = dev_irnet_poll,
104 .unlocked_ioctl = dev_irnet_ioctl,
105 .open = dev_irnet_open,
106 .release = dev_irnet_close,
107 .llseek = noop_llseek,
108
109};
110
111
112static struct miscdevice irnet_misc_device =
113{
114 IRNET_MINOR,
115 "irnet",
116 &irnet_device_fops
117};
118
119#endif
120