hdlcdrv.h 2.8 KB

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