yam.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*****************************************************************************/
  2. /*
  3. * yam.h -- YAM radio modem driver.
  4. *
  5. * Copyright (C) 1998 Frederic Rible F1OAT (frible@teaser.fr)
  6. * Adapted from baycom.c driver written by Thomas Sailer (sailer@ife.ee.ethz.ch)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. *
  22. * Please note that the GPL allows you to use the driver, NOT the radio.
  23. * In order to use the radio, you need a license from the communications
  24. * authority of your country.
  25. *
  26. *
  27. */
  28. /*****************************************************************************/
  29. #define SIOCYAMRESERVED (0)
  30. #define SIOCYAMSCFG (1) /* Set configuration */
  31. #define SIOCYAMGCFG (2) /* Get configuration */
  32. #define SIOCYAMSMCS (3) /* Set mcs data */
  33. #define YAM_IOBASE (1 << 0)
  34. #define YAM_IRQ (1 << 1)
  35. #define YAM_BITRATE (1 << 2) /* Bit rate of radio port ->57600 */
  36. #define YAM_MODE (1 << 3) /* 0=simplex 1=duplex 2=duplex+tempo */
  37. #define YAM_HOLDDLY (1 << 4) /* duplex tempo (sec) */
  38. #define YAM_TXDELAY (1 << 5) /* Tx Delay (ms) */
  39. #define YAM_TXTAIL (1 << 6) /* Tx Tail (ms) */
  40. #define YAM_PERSIST (1 << 7) /* Persist (ms) */
  41. #define YAM_SLOTTIME (1 << 8) /* Slottime (ms) */
  42. #define YAM_BAUDRATE (1 << 9) /* Baud rate of rs232 port ->115200 */
  43. #define YAM_MAXBITRATE 57600
  44. #define YAM_MAXBAUDRATE 115200
  45. #define YAM_MAXMODE 2
  46. #define YAM_MAXHOLDDLY 99
  47. #define YAM_MAXTXDELAY 999
  48. #define YAM_MAXTXTAIL 999
  49. #define YAM_MAXPERSIST 255
  50. #define YAM_MAXSLOTTIME 999
  51. #define YAM_FPGA_SIZE 5302
  52. struct yamcfg {
  53. unsigned int mask; /* Mask of commands */
  54. unsigned int iobase; /* IO Base of COM port */
  55. unsigned int irq; /* IRQ of COM port */
  56. unsigned int bitrate; /* Bit rate of radio port */
  57. unsigned int baudrate; /* Baud rate of the RS232 port */
  58. unsigned int txdelay; /* TxDelay */
  59. unsigned int txtail; /* TxTail */
  60. unsigned int persist; /* Persistence */
  61. unsigned int slottime; /* Slottime */
  62. unsigned int mode; /* mode 0 (simp), 1(Dupl), 2(Dupl+delay) */
  63. unsigned int holddly; /* PTT delay in FullDuplex 2 mode */
  64. };
  65. struct yamdrv_ioctl_cfg {
  66. int cmd;
  67. struct yamcfg cfg;
  68. };
  69. struct yamdrv_ioctl_mcs {
  70. int cmd;
  71. int bitrate;
  72. unsigned char bits[YAM_FPGA_SIZE];
  73. };