hdlcdrv.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * hdlcdrv.h -- HDLC packet radio network driver.
  4. * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
  5. * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
  6. */
  7. #ifndef _UAPI_HDLCDRV_H
  8. #define _UAPI_HDLCDRV_H
  9. /* -------------------------------------------------------------------- */
  10. /*
  11. * structs for the IOCTL commands
  12. */
  13. struct hdlcdrv_params {
  14. int iobase;
  15. int irq;
  16. int dma;
  17. int dma2;
  18. int seriobase;
  19. int pariobase;
  20. int midiiobase;
  21. };
  22. struct hdlcdrv_channel_params {
  23. int tx_delay; /* the transmitter keyup delay in 10ms units */
  24. int tx_tail; /* the transmitter keyoff delay in 10ms units */
  25. int slottime; /* the slottime in 10ms; usually 10 = 100ms */
  26. int ppersist; /* the p-persistence 0..255 */
  27. int fulldup; /* some driver do not support full duplex, setting */
  28. /* this just makes them send even if DCD is on */
  29. };
  30. struct hdlcdrv_old_channel_state {
  31. int ptt;
  32. int dcd;
  33. int ptt_keyed;
  34. };
  35. struct hdlcdrv_channel_state {
  36. int ptt;
  37. int dcd;
  38. int ptt_keyed;
  39. unsigned long tx_packets;
  40. unsigned long tx_errors;
  41. unsigned long rx_packets;
  42. unsigned long rx_errors;
  43. };
  44. struct hdlcdrv_ioctl {
  45. int cmd;
  46. union {
  47. struct hdlcdrv_params mp;
  48. struct hdlcdrv_channel_params cp;
  49. struct hdlcdrv_channel_state cs;
  50. struct hdlcdrv_old_channel_state ocs;
  51. unsigned int calibrate;
  52. unsigned char bits;
  53. char modename[128];
  54. char drivername[32];
  55. } data;
  56. };
  57. /* -------------------------------------------------------------------- */
  58. /*
  59. * ioctl values
  60. */
  61. #define HDLCDRVCTL_GETMODEMPAR 0
  62. #define HDLCDRVCTL_SETMODEMPAR 1
  63. #define HDLCDRVCTL_MODEMPARMASK 2 /* not handled by hdlcdrv */
  64. #define HDLCDRVCTL_GETCHANNELPAR 10
  65. #define HDLCDRVCTL_SETCHANNELPAR 11
  66. #define HDLCDRVCTL_OLDGETSTAT 20
  67. #define HDLCDRVCTL_CALIBRATE 21
  68. #define HDLCDRVCTL_GETSTAT 22
  69. /*
  70. * these are mainly for debugging purposes
  71. */
  72. #define HDLCDRVCTL_GETSAMPLES 30
  73. #define HDLCDRVCTL_GETBITS 31
  74. /*
  75. * not handled by hdlcdrv, but by its depending drivers
  76. */
  77. #define HDLCDRVCTL_GETMODE 40
  78. #define HDLCDRVCTL_SETMODE 41
  79. #define HDLCDRVCTL_MODELIST 42
  80. #define HDLCDRVCTL_DRIVERNAME 43
  81. /*
  82. * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
  83. */
  84. #define HDLCDRV_PARMASK_IOBASE (1<<0)
  85. #define HDLCDRV_PARMASK_IRQ (1<<1)
  86. #define HDLCDRV_PARMASK_DMA (1<<2)
  87. #define HDLCDRV_PARMASK_DMA2 (1<<3)
  88. #define HDLCDRV_PARMASK_SERIOBASE (1<<4)
  89. #define HDLCDRV_PARMASK_PARIOBASE (1<<5)
  90. #define HDLCDRV_PARMASK_MIDIIOBASE (1<<6)
  91. /* -------------------------------------------------------------------- */
  92. /* -------------------------------------------------------------------- */
  93. #endif /* _UAPI_HDLCDRV_H */
  94. /* -------------------------------------------------------------------- */