xref: /linux/include/uapi/linux/hdlcdrv.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * hdlcdrv.h  -- HDLC packet radio network driver.
4607ca46eSDavid Howells  * The Linux soundcard driver for 1200 baud and 9600 baud packet radio
5607ca46eSDavid Howells  * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
6607ca46eSDavid Howells  */
7607ca46eSDavid Howells 
8607ca46eSDavid Howells #ifndef _UAPI_HDLCDRV_H
9607ca46eSDavid Howells #define _UAPI_HDLCDRV_H
10607ca46eSDavid Howells 
11607ca46eSDavid Howells /* -------------------------------------------------------------------- */
12607ca46eSDavid Howells /*
13607ca46eSDavid Howells  * structs for the IOCTL commands
14607ca46eSDavid Howells  */
15607ca46eSDavid Howells 
16607ca46eSDavid Howells struct hdlcdrv_params {
17607ca46eSDavid Howells 	int iobase;
18607ca46eSDavid Howells 	int irq;
19607ca46eSDavid Howells 	int dma;
20607ca46eSDavid Howells 	int dma2;
21607ca46eSDavid Howells 	int seriobase;
22607ca46eSDavid Howells 	int pariobase;
23607ca46eSDavid Howells 	int midiiobase;
24607ca46eSDavid Howells };
25607ca46eSDavid Howells 
26607ca46eSDavid Howells struct hdlcdrv_channel_params {
27607ca46eSDavid Howells 	int tx_delay;  /* the transmitter keyup delay in 10ms units */
28607ca46eSDavid Howells 	int tx_tail;   /* the transmitter keyoff delay in 10ms units */
29607ca46eSDavid Howells 	int slottime;  /* the slottime in 10ms; usually 10 = 100ms */
30607ca46eSDavid Howells 	int ppersist;  /* the p-persistence 0..255 */
31607ca46eSDavid Howells 	int fulldup;   /* some driver do not support full duplex, setting */
32607ca46eSDavid Howells 	               /* this just makes them send even if DCD is on */
33607ca46eSDavid Howells };
34607ca46eSDavid Howells 
35607ca46eSDavid Howells struct hdlcdrv_old_channel_state {
36607ca46eSDavid Howells   	int ptt;
37607ca46eSDavid Howells   	int dcd;
38607ca46eSDavid Howells   	int ptt_keyed;
39607ca46eSDavid Howells };
40607ca46eSDavid Howells 
41607ca46eSDavid Howells struct hdlcdrv_channel_state {
42607ca46eSDavid Howells  	int ptt;
43607ca46eSDavid Howells  	int dcd;
44607ca46eSDavid Howells  	int ptt_keyed;
45607ca46eSDavid Howells  	unsigned long tx_packets;
46607ca46eSDavid Howells  	unsigned long tx_errors;
47607ca46eSDavid Howells  	unsigned long rx_packets;
48607ca46eSDavid Howells  	unsigned long rx_errors;
49607ca46eSDavid Howells };
50607ca46eSDavid Howells 
51607ca46eSDavid Howells struct hdlcdrv_ioctl {
52607ca46eSDavid Howells 	int cmd;
53607ca46eSDavid Howells 	union {
54607ca46eSDavid Howells 		struct hdlcdrv_params mp;
55607ca46eSDavid Howells 		struct hdlcdrv_channel_params cp;
56607ca46eSDavid Howells 		struct hdlcdrv_channel_state cs;
57607ca46eSDavid Howells 		struct hdlcdrv_old_channel_state ocs;
58607ca46eSDavid Howells 		unsigned int calibrate;
59607ca46eSDavid Howells 		unsigned char bits;
60607ca46eSDavid Howells 		char modename[128];
61607ca46eSDavid Howells 		char drivername[32];
62607ca46eSDavid Howells 	} data;
63607ca46eSDavid Howells };
64607ca46eSDavid Howells 
65607ca46eSDavid Howells /* -------------------------------------------------------------------- */
66607ca46eSDavid Howells 
67607ca46eSDavid Howells /*
68607ca46eSDavid Howells  * ioctl values
69607ca46eSDavid Howells  */
70607ca46eSDavid Howells #define HDLCDRVCTL_GETMODEMPAR       0
71607ca46eSDavid Howells #define HDLCDRVCTL_SETMODEMPAR       1
72607ca46eSDavid Howells #define HDLCDRVCTL_MODEMPARMASK      2  /* not handled by hdlcdrv */
73607ca46eSDavid Howells #define HDLCDRVCTL_GETCHANNELPAR    10
74607ca46eSDavid Howells #define HDLCDRVCTL_SETCHANNELPAR    11
75607ca46eSDavid Howells #define HDLCDRVCTL_OLDGETSTAT       20
76607ca46eSDavid Howells #define HDLCDRVCTL_CALIBRATE        21
77607ca46eSDavid Howells #define HDLCDRVCTL_GETSTAT          22
78607ca46eSDavid Howells 
79607ca46eSDavid Howells /*
80607ca46eSDavid Howells  * these are mainly for debugging purposes
81607ca46eSDavid Howells  */
82607ca46eSDavid Howells #define HDLCDRVCTL_GETSAMPLES       30
83607ca46eSDavid Howells #define HDLCDRVCTL_GETBITS          31
84607ca46eSDavid Howells 
85607ca46eSDavid Howells /*
86607ca46eSDavid Howells  * not handled by hdlcdrv, but by its depending drivers
87607ca46eSDavid Howells  */
88607ca46eSDavid Howells #define HDLCDRVCTL_GETMODE          40
89607ca46eSDavid Howells #define HDLCDRVCTL_SETMODE          41
90607ca46eSDavid Howells #define HDLCDRVCTL_MODELIST         42
91607ca46eSDavid Howells #define HDLCDRVCTL_DRIVERNAME       43
92607ca46eSDavid Howells 
93607ca46eSDavid Howells /*
94607ca46eSDavid Howells  * mask of needed modem parameters, returned by HDLCDRVCTL_MODEMPARMASK
95607ca46eSDavid Howells  */
96607ca46eSDavid Howells #define HDLCDRV_PARMASK_IOBASE      (1<<0)
97607ca46eSDavid Howells #define HDLCDRV_PARMASK_IRQ         (1<<1)
98607ca46eSDavid Howells #define HDLCDRV_PARMASK_DMA         (1<<2)
99607ca46eSDavid Howells #define HDLCDRV_PARMASK_DMA2        (1<<3)
100607ca46eSDavid Howells #define HDLCDRV_PARMASK_SERIOBASE   (1<<4)
101607ca46eSDavid Howells #define HDLCDRV_PARMASK_PARIOBASE   (1<<5)
102607ca46eSDavid Howells #define HDLCDRV_PARMASK_MIDIIOBASE  (1<<6)
103607ca46eSDavid Howells 
104607ca46eSDavid Howells /* -------------------------------------------------------------------- */
105607ca46eSDavid Howells 
106607ca46eSDavid Howells 
107607ca46eSDavid Howells /* -------------------------------------------------------------------- */
108607ca46eSDavid Howells 
109607ca46eSDavid Howells #endif /* _UAPI_HDLCDRV_H */
110607ca46eSDavid Howells 
111607ca46eSDavid Howells /* -------------------------------------------------------------------- */
112