ioctl.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef __HDLC_IOCTL_H__
  2. #define __HDLC_IOCTL_H__
  3. #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
  4. #define CLOCK_DEFAULT 0 /* Default setting */
  5. #define CLOCK_EXT 1 /* External TX and RX clock - DTE */
  6. #define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
  7. #define CLOCK_TXINT 3 /* Internal TX and external RX clock */
  8. #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
  9. #define ENCODING_DEFAULT 0 /* Default setting */
  10. #define ENCODING_NRZ 1
  11. #define ENCODING_NRZI 2
  12. #define ENCODING_FM_MARK 3
  13. #define ENCODING_FM_SPACE 4
  14. #define ENCODING_MANCHESTER 5
  15. #define PARITY_DEFAULT 0 /* Default setting */
  16. #define PARITY_NONE 1 /* No parity */
  17. #define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
  18. #define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
  19. #define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
  20. #define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
  21. #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
  22. #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
  23. #define LMI_DEFAULT 0 /* Default setting */
  24. #define LMI_NONE 1 /* No LMI, all PVCs are static */
  25. #define LMI_ANSI 2 /* ANSI Annex D */
  26. #define LMI_CCITT 3 /* ITU-T Annex A */
  27. #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
  28. #ifndef __ASSEMBLY__
  29. typedef struct {
  30. unsigned int clock_rate; /* bits per second */
  31. unsigned int clock_type; /* internal, external, TX-internal etc. */
  32. unsigned short loopback;
  33. } sync_serial_settings; /* V.35, V.24, X.21 */
  34. typedef struct {
  35. unsigned int clock_rate; /* bits per second */
  36. unsigned int clock_type; /* internal, external, TX-internal etc. */
  37. unsigned short loopback;
  38. unsigned int slot_map;
  39. } te1_settings; /* T1, E1 */
  40. typedef struct {
  41. unsigned short encoding;
  42. unsigned short parity;
  43. } raw_hdlc_proto;
  44. typedef struct {
  45. unsigned int t391;
  46. unsigned int t392;
  47. unsigned int n391;
  48. unsigned int n392;
  49. unsigned int n393;
  50. unsigned short lmi;
  51. unsigned short dce; /* 1 for DCE (network side) operation */
  52. } fr_proto;
  53. typedef struct {
  54. unsigned int dlci;
  55. } fr_proto_pvc; /* for creating/deleting FR PVCs */
  56. typedef struct {
  57. unsigned int dlci;
  58. char master[IFNAMSIZ]; /* Name of master FRAD device */
  59. }fr_proto_pvc_info; /* for returning PVC information only */
  60. typedef struct {
  61. unsigned int interval;
  62. unsigned int timeout;
  63. } cisco_proto;
  64. /* PPP doesn't need any info now - supply length = 0 to ioctl */
  65. #endif /* __ASSEMBLY__ */
  66. #endif /* __HDLC_IOCTL_H__ */