x25_asy.h 1.5 KB

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