Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * hdlcdrv.h  -- HDLC packet radio network driver.
0004  * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
0005  * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
0006  */
0007 
0008 #ifndef _UAPI_HDLCDRV_H
0009 #define _UAPI_HDLCDRV_H
0010 
0011 /* -------------------------------------------------------------------- */
0012 /*
0013  * structs for the IOCTL commands
0014  */
0015 
0016 struct hdlcdrv_params {
0017     int iobase;
0018     int irq;
0019     int dma;
0020     int dma2;
0021     int seriobase;
0022     int pariobase;
0023     int midiiobase;
0024 };  
0025 
0026 struct hdlcdrv_channel_params {
0027     int tx_delay;  /* the transmitter keyup delay in 10ms units */
0028     int tx_tail;   /* the transmitter keyoff delay in 10ms units */
0029     int slottime;  /* the slottime in 10ms; usually 10 = 100ms */
0030     int ppersist;  /* the p-persistence 0..255 */
0031     int fulldup;   /* some driver do not support full duplex, setting */
0032                    /* this just makes them send even if DCD is on */
0033 };  
0034 
0035 struct hdlcdrv_old_channel_state {
0036     int ptt;
0037     int dcd;
0038     int ptt_keyed;
0039 };
0040 
0041 struct hdlcdrv_channel_state {
0042     int ptt;
0043     int dcd;
0044     int ptt_keyed;
0045     unsigned long tx_packets;
0046     unsigned long tx_errors;
0047     unsigned long rx_packets;
0048     unsigned long rx_errors;
0049 };
0050 
0051 struct hdlcdrv_ioctl {
0052     int cmd;
0053     union {
0054         struct hdlcdrv_params mp;
0055         struct hdlcdrv_channel_params cp;
0056         struct hdlcdrv_channel_state cs;
0057         struct hdlcdrv_old_channel_state ocs;
0058         unsigned int calibrate;
0059         unsigned char bits;
0060         char modename[128];
0061         char drivername[32];
0062     } data;
0063 };
0064 
0065 /* -------------------------------------------------------------------- */
0066 
0067 /*
0068  * ioctl values
0069  */
0070 #define HDLCDRVCTL_GETMODEMPAR       0
0071 #define HDLCDRVCTL_SETMODEMPAR       1
0072 #define HDLCDRVCTL_MODEMPARMASK      2  /* not handled by hdlcdrv */
0073 #define HDLCDRVCTL_GETCHANNELPAR    10
0074 #define HDLCDRVCTL_SETCHANNELPAR    11
0075 #define HDLCDRVCTL_OLDGETSTAT       20
0076 #define HDLCDRVCTL_CALIBRATE        21
0077 #define HDLCDRVCTL_GETSTAT          22
0078 
0079 /*
0080  * these are mainly for debugging purposes
0081  */
0082 #define HDLCDRVCTL_GETSAMPLES       30
0083 #define HDLCDRVCTL_GETBITS          31
0084 
0085 /*
0086  * not handled by hdlcdrv, but by its depending drivers
0087  */
0088 #define HDLCDRVCTL_GETMODE          40
0089 #define HDLCDRVCTL_SETMODE          41
0090 #define HDLCDRVCTL_MODELIST         42
0091 #define HDLCDRVCTL_DRIVERNAME       43
0092 
0093 /*
0094  * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
0095  */
0096 #define HDLCDRV_PARMASK_IOBASE      (1<<0)
0097 #define HDLCDRV_PARMASK_IRQ         (1<<1)
0098 #define HDLCDRV_PARMASK_DMA         (1<<2)
0099 #define HDLCDRV_PARMASK_DMA2        (1<<3)
0100 #define HDLCDRV_PARMASK_SERIOBASE   (1<<4)
0101 #define HDLCDRV_PARMASK_PARIOBASE   (1<<5)
0102 #define HDLCDRV_PARMASK_MIDIIOBASE  (1<<6)
0103 
0104 /* -------------------------------------------------------------------- */
0105 
0106 
0107 /* -------------------------------------------------------------------- */
0108 
0109 #endif /* _UAPI_HDLCDRV_H */
0110 
0111 /* -------------------------------------------------------------------- */