2 * IrNET protocol module : Synchronous PPP over an IrDA socket.
4 * Jean II - HPL `00 - <jt@hpl.hp.com>
6 * This file contains all definitions and declarations necessary for the
7 * PPP part of the IrNET module.
8 * This file is a private header, so other modules don't want to know
15 /***************************** INCLUDES *****************************/
17 #include "irnet.h" /* Module global include */
18 #include <linux/miscdevice.h>
20 /************************ CONSTANTS & MACROS ************************/
22 /* IrNET control channel stuff */
23 #define IRNET_MAX_COMMAND 256 /* Max length of a command line */
25 /* PPP hardcore stuff */
27 /* Bits in rbits (PPP flags in irnet struct) */
28 #define SC_RCV_BITS (SC_RCV_B7_1|SC_RCV_B7_0|SC_RCV_ODDP|SC_RCV_EVNP)
30 /* Bit numbers in busy */
36 /* Queue management */
37 #define PPPSYNC_MAX_RQLEN 32 /* arbitrary */
39 /****************************** TYPES ******************************/
42 /**************************** PROTOTYPES ****************************/
44 /* ----------------------- CONTROL CHANNEL ----------------------- */
46 irnet_ctrl_write(irnet_socket
*,
50 irnet_ctrl_read(irnet_socket
*,
54 static inline unsigned int
55 irnet_ctrl_poll(irnet_socket
*,
58 /* ----------------------- CHARACTER DEVICE ----------------------- */
60 dev_irnet_open(struct inode
*, /* fs callback : open */
62 dev_irnet_close(struct inode
*,
65 dev_irnet_write(struct file
*,
69 dev_irnet_read(struct file
*,
74 dev_irnet_poll(struct file
*,
77 dev_irnet_ioctl(struct file
*,
80 /* ------------------------ PPP INTERFACE ------------------------ */
81 static inline struct sk_buff
*
82 irnet_prepare_skb(irnet_socket
*,
85 ppp_irnet_send(struct ppp_channel
*,
88 ppp_irnet_ioctl(struct ppp_channel
*,
92 /**************************** VARIABLES ****************************/
94 /* Filesystem callbacks (to call us) */
95 static const struct file_operations irnet_device_fops
=
98 .read
= dev_irnet_read
,
99 .write
= dev_irnet_write
,
100 .poll
= dev_irnet_poll
,
101 .unlocked_ioctl
= dev_irnet_ioctl
,
102 .open
= dev_irnet_open
,
103 .release
= dev_irnet_close
,
104 .llseek
= noop_llseek
,
105 /* Also : llseek, readdir, mmap, flush, fsync, fasync, lock, readv, writev */
108 /* Structure so that the misc major (drivers/char/misc.c) take care of us... */
109 static struct miscdevice irnet_misc_device
=
111 .minor
= IRNET_MINOR
,
113 .fops
= &irnet_device_fops
116 #endif /* IRNET_PPP_H */