x25_asy.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _LINUX_X25_ASY_H
  2. #define _LINUX_X25_ASY_H
  3. /* X.25 asy configuration. */
  4. #define SL_NRUNIT 256 /* MAX number of X.25 channels;
  5. This can be overridden with
  6. insmod -ox25_asy_maxdev=nnn */
  7. #define SL_MTU 256
  8. /* X25 async protocol characters. */
  9. #define X25_END 0x7E /* indicates end of frame */
  10. #define X25_ESC 0x7D /* indicates byte stuffing */
  11. #define X25_ESCAPE(x) ((x)^0x20)
  12. #define X25_UNESCAPE(x) ((x)^0x20)
  13. struct x25_asy {
  14. int magic;
  15. /* Various fields. */
  16. spinlock_t lock;
  17. struct tty_struct *tty; /* ptr to TTY structure */
  18. struct net_device *dev; /* easy for intr handling */
  19. /* These are pointers to the malloc()ed frame buffers. */
  20. unsigned char *rbuff; /* receiver buffer */
  21. int rcount; /* received chars counter */
  22. unsigned char *xbuff; /* transmitter buffer */
  23. unsigned char *xhead; /* pointer to next byte to XMIT */
  24. int xleft; /* bytes left in XMIT queue */
  25. int buffsize; /* Max buffers sizes */
  26. unsigned long flags; /* Flag values/ mode etc */
  27. #define SLF_INUSE 0 /* Channel in use */
  28. #define SLF_ESCAPE 1 /* ESC received */
  29. #define SLF_ERROR 2 /* Parity, etc. error */
  30. #define SLF_OUTWAIT 4 /* Waiting for output */
  31. };
  32. #define X25_ASY_MAGIC 0x5303
  33. extern int x25_asy_init(struct net_device *dev);
  34. #endif /* _LINUX_X25_ASY.H */