1*3f5296f0SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 21da177e4SLinus Torvalds /*****************************************************************************/ 31da177e4SLinus Torvalds 41da177e4SLinus Torvalds /* 51da177e4SLinus Torvalds * yam.h -- YAM radio modem driver. 61da177e4SLinus Torvalds * 71da177e4SLinus Torvalds * Copyright (C) 1998 Frederic Rible F1OAT (frible@teaser.fr) 81da177e4SLinus Torvalds * Adapted from baycom.c driver written by Thomas Sailer (sailer@ife.ee.ethz.ch) 91da177e4SLinus Torvalds * 101da177e4SLinus Torvalds * Please note that the GPL allows you to use the driver, NOT the radio. 111da177e4SLinus Torvalds * In order to use the radio, you need a license from the communications 121da177e4SLinus Torvalds * authority of your country. 131da177e4SLinus Torvalds */ 141da177e4SLinus Torvalds 151da177e4SLinus Torvalds /*****************************************************************************/ 161da177e4SLinus Torvalds 171da177e4SLinus Torvalds #define SIOCYAMRESERVED (0) 181da177e4SLinus Torvalds #define SIOCYAMSCFG (1) /* Set configuration */ 191da177e4SLinus Torvalds #define SIOCYAMGCFG (2) /* Get configuration */ 201da177e4SLinus Torvalds #define SIOCYAMSMCS (3) /* Set mcs data */ 211da177e4SLinus Torvalds 221da177e4SLinus Torvalds #define YAM_IOBASE (1 << 0) 231da177e4SLinus Torvalds #define YAM_IRQ (1 << 1) 241da177e4SLinus Torvalds #define YAM_BITRATE (1 << 2) /* Bit rate of radio port ->57600 */ 251da177e4SLinus Torvalds #define YAM_MODE (1 << 3) /* 0=simplex 1=duplex 2=duplex+tempo */ 261da177e4SLinus Torvalds #define YAM_HOLDDLY (1 << 4) /* duplex tempo (sec) */ 271da177e4SLinus Torvalds #define YAM_TXDELAY (1 << 5) /* Tx Delay (ms) */ 281da177e4SLinus Torvalds #define YAM_TXTAIL (1 << 6) /* Tx Tail (ms) */ 291da177e4SLinus Torvalds #define YAM_PERSIST (1 << 7) /* Persist (ms) */ 301da177e4SLinus Torvalds #define YAM_SLOTTIME (1 << 8) /* Slottime (ms) */ 311da177e4SLinus Torvalds #define YAM_BAUDRATE (1 << 9) /* Baud rate of rs232 port ->115200 */ 321da177e4SLinus Torvalds 331da177e4SLinus Torvalds #define YAM_MAXBITRATE 57600 341da177e4SLinus Torvalds #define YAM_MAXBAUDRATE 115200 351da177e4SLinus Torvalds #define YAM_MAXMODE 2 361da177e4SLinus Torvalds #define YAM_MAXHOLDDLY 99 371da177e4SLinus Torvalds #define YAM_MAXTXDELAY 999 381da177e4SLinus Torvalds #define YAM_MAXTXTAIL 999 391da177e4SLinus Torvalds #define YAM_MAXPERSIST 255 401da177e4SLinus Torvalds #define YAM_MAXSLOTTIME 999 411da177e4SLinus Torvalds 421da177e4SLinus Torvalds #define YAM_FPGA_SIZE 5302 431da177e4SLinus Torvalds 441da177e4SLinus Torvalds struct yamcfg { 451da177e4SLinus Torvalds unsigned int mask; /* Mask of commands */ 461da177e4SLinus Torvalds unsigned int iobase; /* IO Base of COM port */ 471da177e4SLinus Torvalds unsigned int irq; /* IRQ of COM port */ 481da177e4SLinus Torvalds unsigned int bitrate; /* Bit rate of radio port */ 491da177e4SLinus Torvalds unsigned int baudrate; /* Baud rate of the RS232 port */ 501da177e4SLinus Torvalds unsigned int txdelay; /* TxDelay */ 511da177e4SLinus Torvalds unsigned int txtail; /* TxTail */ 521da177e4SLinus Torvalds unsigned int persist; /* Persistence */ 531da177e4SLinus Torvalds unsigned int slottime; /* Slottime */ 541da177e4SLinus Torvalds unsigned int mode; /* mode 0 (simp), 1(Dupl), 2(Dupl+delay) */ 551da177e4SLinus Torvalds unsigned int holddly; /* PTT delay in FullDuplex 2 mode */ 561da177e4SLinus Torvalds }; 571da177e4SLinus Torvalds 581da177e4SLinus Torvalds struct yamdrv_ioctl_cfg { 591da177e4SLinus Torvalds int cmd; 601da177e4SLinus Torvalds struct yamcfg cfg; 611da177e4SLinus Torvalds }; 621da177e4SLinus Torvalds 631da177e4SLinus Torvalds struct yamdrv_ioctl_mcs { 641da177e4SLinus Torvalds int cmd; 659e5f1721SDan Carpenter unsigned int bitrate; 661da177e4SLinus Torvalds unsigned char bits[YAM_FPGA_SIZE]; 671da177e4SLinus Torvalds }; 68