~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/linux/ppp_channel.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _PPP_CHANNEL_H_
  2 #define _PPP_CHANNEL_H_
  3 /*
  4  * Definitions for the interface between the generic PPP code
  5  * and a PPP channel.
  6  *
  7  * A PPP channel provides a way for the generic PPP code to send
  8  * and receive packets over some sort of communications medium.
  9  * Packets are stored in sk_buffs and have the 2-byte PPP protocol
 10  * number at the start, but not the address and control bytes.
 11  *
 12  * Copyright 1999 Paul Mackerras.
 13  *
 14  *  This program is free software; you can redistribute it and/or
 15  *  modify it under the terms of the GNU General Public License
 16  *  as published by the Free Software Foundation; either version
 17  *  2 of the License, or (at your option) any later version.
 18  *
 19  * ==FILEVERSION 20000322==
 20  */
 21 
 22 #include <linux/list.h>
 23 #include <linux/skbuff.h>
 24 #include <linux/poll.h>
 25 #include <asm/atomic.h>
 26 
 27 struct ppp_channel;
 28 
 29 struct ppp_channel_ops {
 30         /* Send a packet (or multilink fragment) on this channel.
 31            Returns 1 if it was accepted, 0 if not. */
 32         int     (*start_xmit)(struct ppp_channel *, struct sk_buff *);
 33         /* Handle an ioctl call that has come in via /dev/ppp. */
 34         int     (*ioctl)(struct ppp_channel *, unsigned int, unsigned long);
 35         
 36 };
 37 
 38 struct ppp_channel {
 39         void            *private;       /* channel private data */
 40         struct ppp_channel_ops *ops;    /* operations for this channel */
 41         int             mtu;            /* max transmit packet size */
 42         int             hdrlen;         /* amount of headroom channel needs */
 43         void            *ppp;           /* opaque to channel */
 44         /* the following are not used at present */
 45         int             speed;          /* transfer rate (bytes/second) */
 46         int             latency;        /* overhead time in milliseconds */
 47 };
 48 
 49 #ifdef __KERNEL__
 50 /* Called by the channel when it can send some more data. */
 51 extern void ppp_output_wakeup(struct ppp_channel *);
 52 
 53 /* Called by the channel to process a received PPP packet.
 54    The packet should have just the 2-byte PPP protocol header. */
 55 extern void ppp_input(struct ppp_channel *, struct sk_buff *);
 56 
 57 /* Called by the channel when an input error occurs, indicating
 58    that we may have missed a packet. */
 59 extern void ppp_input_error(struct ppp_channel *, int code);
 60 
 61 /* Attach a channel to a given PPP unit. */
 62 extern int ppp_register_channel(struct ppp_channel *);
 63 
 64 /* Detach a channel from its PPP unit (e.g. on hangup). */
 65 extern void ppp_unregister_channel(struct ppp_channel *);
 66 
 67 /* Get the channel number for a channel */
 68 extern int ppp_channel_index(struct ppp_channel *);
 69 
 70 /* Get the unit number associated with a channel, or -1 if none */
 71 extern int ppp_unit_number(struct ppp_channel *);
 72 
 73 /*
 74  * SMP locking notes:
 75  * The channel code must ensure that when it calls ppp_unregister_channel,
 76  * nothing is executing in any of the procedures above, for that
 77  * channel.  The generic layer will ensure that nothing is executing
 78  * in the start_xmit and ioctl routines for the channel by the time
 79  * that ppp_unregister_channel returns.
 80  */
 81 
 82 /* The following are temporary compatibility stuff */
 83 ssize_t ppp_channel_read(struct ppp_channel *chan, struct file *file,
 84                          char *buf, size_t count);
 85 ssize_t ppp_channel_write(struct ppp_channel *chan, const char *buf,
 86                           size_t count);
 87 unsigned int ppp_channel_poll(struct ppp_channel *chan, struct file *file,
 88                               poll_table *wait);
 89 int ppp_channel_ioctl(struct ppp_channel *chan, unsigned int cmd,
 90                       unsigned long arg);
 91 
 92 #endif /* __KERNEL__ */
 93 #endif
 94 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.