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