| 1 | /*****************************************************************************/ |
| 2 | |
| 3 | /* |
| 4 | * hdrvcomm.h -- HDLC driver communications. |
| 5 | * |
| 6 | * Copyright (C) 1996 Thomas Sailer ([email protected]) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
| 21 | * 02110-1301, USA. |
| 22 | * |
| 23 | * Please note that the GPL allows you to use the driver, NOT the radio. |
| 24 | * In order to use the radio, you need a license from the communications |
| 25 | * authority of your country. |
| 26 | * |
| 27 | */ |
| 28 | |
| 29 | /*****************************************************************************/ |
| 30 | |
| 31 | #ifndef _HDRVCOMM_H |
| 32 | #define _HDRVCOMM_H |
| 33 | |
| 34 | #ifdef __cplusplus |
| 35 | extern "C" { |
| 36 | #endif |
| 37 | |
| 38 | /* ---------------------------------------------------------------------- */ |
| 39 | |
| 40 | #include <linux/hdlcdrv.h> |
| 41 | #include "soundmodem.h" |
| 42 | #include <linux/baycom.h> |
| 43 | |
| 44 | /* ---------------------------------------------------------------------- */ |
| 45 | |
| 46 | struct hdrvc_channel_params { |
| 47 | int tx_delay; /* the transmitter keyup delay in 10ms units */ |
| 48 | int tx_tail; /* the transmitter keyoff delay in 10ms units */ |
| 49 | int slottime; /* the slottime in 10ms; usually 10 = 100ms */ |
| 50 | int ppersist; /* the p-persistence 0..255 */ |
| 51 | int fulldup; /* some driver do not support full duplex, setting */ |
| 52 | /* this just makes them send even if DCD is on */ |
| 53 | }; |
| 54 | |
| 55 | struct hdrvc_channel_state { |
| 56 | int ptt; |
| 57 | int dcd; |
| 58 | int ptt_keyed; |
| 59 | unsigned long tx_packets; |
| 60 | unsigned long tx_errors; |
| 61 | unsigned long rx_packets; |
| 62 | unsigned long rx_errors; |
| 63 | }; |
| 64 | |
| 65 | /* ---------------------------------------------------------------------- */ |
| 66 | |
| 67 | /* |
| 68 | * diagnose modes |
| 69 | */ |
| 70 | #define HDRVC_DIAGMODE_OFF 0 |
| 71 | #define HDRVC_DIAGMODE_INPUT 1 |
| 72 | #define HDRVC_DIAGMODE_DEMOD 2 |
| 73 | #define HDRVC_DIAGMODE_CONSTELLATION 3 |
| 74 | |
| 75 | /* |
| 76 | * diagnose flags |
| 77 | */ |
| 78 | #define HDRVC_DIAGFLAG_DCDGATE (1<<0) |
| 79 | |
| 80 | |
| 81 | /* ---------------------------------------------------------------------- */ |
| 82 | |
| 83 | extern int hdrvc_recvpacket(char *pkt, int maxlen); |
| 84 | extern int hdrvc_getfd(void); |
| 85 | extern const char *hdrvc_ifname(void); |
| 86 | extern void hdrvc_args(int *argc, char *argv[], const char *def_if); |
| 87 | extern void hdrvc_init(void); |
| 88 | extern int hdrvc_get_samples(void); |
| 89 | extern int hdrvc_get_bits(void); |
| 90 | extern int hdrvc_get_channel_access_param(struct hdrvc_channel_params *par); |
| 91 | extern int hdrvc_set_channel_access_param(struct hdrvc_channel_params par); |
| 92 | extern int hdrvc_calibrate(int calib); |
| 93 | extern int hdrvc_get_channel_state(struct hdrvc_channel_state *st); |
| 94 | extern unsigned int hdrvc_get_ifflags(void); |
| 95 | extern int hdrvc_diag2(unsigned int mode, unsigned int flags, short *data, unsigned int maxdatalen, |
| 96 | unsigned int *samplesperbit); |
| 97 | extern int hdrvc_get_driver_name(char *buf, int bufsz); |
| 98 | extern int hdrvc_get_mode_name(char *buf, int bufsz); |
| 99 | |
| 100 | extern int hdrvc_hdlcdrv_ioctl(int cmd, struct hdlcdrv_ioctl *par); |
| 101 | extern int hdrvc_sm_ioctl(int cmd, struct sm_ioctl *par); |
| 102 | extern int hdrvc_baycom_ioctl(int cmd, struct baycom_ioctl *par); |
| 103 | extern int hdrvc_diag(struct sm_diag_data *diag); |
| 104 | |
| 105 | /* ---------------------------------------------------------------------- */ |
| 106 | #ifdef __cplusplus |
| 107 | } |
| 108 | #endif |
| 109 | #endif /* _HDRVCOMM_H */ |