/*1* IrNET protocol module : Synchronous PPP over an IrDA socket.2*3* Jean II - HPL `00 - <[email protected]>4*5* This file contains all definitions and declarations necessary for the6* PPP part of the IrNET module.7* This file is a private header, so other modules don't want to know8* what's in there...9*/1011#ifndef IRNET_PPP_H12#define IRNET_PPP_H1314/***************************** INCLUDES *****************************/1516#include "irnet.h" /* Module global include */1718/************************ CONSTANTS & MACROS ************************/1920/* /dev/irnet file constants */21#define IRNET_MAJOR 10 /* Misc range */22#define IRNET_MINOR 187 /* Official allocation */2324/* IrNET control channel stuff */25#define IRNET_MAX_COMMAND 256 /* Max length of a command line */2627/* PPP hardcore stuff */2829/* Bits in rbits (PPP flags in irnet struct) */30#define SC_RCV_BITS (SC_RCV_B7_1|SC_RCV_B7_0|SC_RCV_ODDP|SC_RCV_EVNP)3132/* Bit numbers in busy */33#define XMIT_BUSY 034#define RECV_BUSY 135#define XMIT_WAKEUP 236#define XMIT_FULL 33738/* Queue management */39#define PPPSYNC_MAX_RQLEN 32 /* arbitrary */4041/****************************** TYPES ******************************/424344/**************************** PROTOTYPES ****************************/4546/* ----------------------- CONTROL CHANNEL ----------------------- */47static inline ssize_t48irnet_ctrl_write(irnet_socket *,49const char *,50size_t);51static inline ssize_t52irnet_ctrl_read(irnet_socket *,53struct file *,54char *,55size_t);56static inline unsigned int57irnet_ctrl_poll(irnet_socket *,58struct file *,59poll_table *);60/* ----------------------- CHARACTER DEVICE ----------------------- */61static int62dev_irnet_open(struct inode *, /* fs callback : open */63struct file *),64dev_irnet_close(struct inode *,65struct file *);66static ssize_t67dev_irnet_write(struct file *,68const char __user *,69size_t,70loff_t *),71dev_irnet_read(struct file *,72char __user *,73size_t,74loff_t *);75static unsigned int76dev_irnet_poll(struct file *,77poll_table *);78static long79dev_irnet_ioctl(struct file *,80unsigned int,81unsigned long);82/* ------------------------ PPP INTERFACE ------------------------ */83static inline struct sk_buff *84irnet_prepare_skb(irnet_socket *,85struct sk_buff *);86static int87ppp_irnet_send(struct ppp_channel *,88struct sk_buff *);89static int90ppp_irnet_ioctl(struct ppp_channel *,91unsigned int,92unsigned long);9394/**************************** VARIABLES ****************************/9596/* Filesystem callbacks (to call us) */97static const struct file_operations irnet_device_fops =98{99.owner = THIS_MODULE,100.read = dev_irnet_read,101.write = dev_irnet_write,102.poll = dev_irnet_poll,103.unlocked_ioctl = dev_irnet_ioctl,104.open = dev_irnet_open,105.release = dev_irnet_close,106.llseek = noop_llseek,107/* Also : llseek, readdir, mmap, flush, fsync, fasync, lock, readv, writev */108};109110/* Structure so that the misc major (drivers/char/misc.c) take care of us... */111static struct miscdevice irnet_misc_device =112{113IRNET_MINOR,114"irnet",115&irnet_device_fops116};117118#endif /* IRNET_PPP_H */119120121