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