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