00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #if !defined(_SPANDSP_PRIVATE_V42_H_)
00027 #define _SPANDSP_PRIVATE_V42_H_
00028
00029
00030 #define V42_DEFAULT_N_400 5
00031
00032 #define V42_DEFAULT_N_401 128
00033
00034 #define V42_MAX_N_401 128
00035
00036 #define V42_DEFAULT_WINDOW_SIZE_K 15
00037
00038 #define V42_MAX_WINDOW_SIZE_K 15
00039
00040
00041 #define V42_INFO_FRAMES (V42_MAX_WINDOW_SIZE_K + 1)
00042
00043 #define V42_CTRL_FRAMES 8
00044
00045 typedef struct
00046 {
00047
00048 uint8_t v42_tx_window_size_k;
00049 uint8_t v42_rx_window_size_k;
00050 uint16_t v42_tx_n401;
00051 uint16_t v42_rx_n401;
00052
00053
00054 uint8_t comp;
00055 int comp_dict_size;
00056 int comp_max_string;
00057 } v42_config_parameters_t;
00058
00059 typedef struct frame_s
00060 {
00061 int len;
00062 uint8_t buf[4 + V42_MAX_N_401];
00063 } v42_frame_t;
00064
00065
00066
00067
00068 typedef struct
00069 {
00070 get_msg_func_t iframe_get;
00071 void *iframe_get_user_data;
00072
00073 put_msg_func_t iframe_put;
00074 void *iframe_put_user_data;
00075
00076 modem_status_func_t status_handler;
00077 void *status_user_data;
00078
00079 hdlc_rx_state_t hdlc_rx;
00080 hdlc_tx_state_t hdlc_tx;
00081
00082
00083 uint8_t tx_window_size_k;
00084 uint8_t rx_window_size_k;
00085 uint16_t tx_n401;
00086 uint16_t rx_n401;
00087
00088 uint8_t cmd_addr;
00089 uint8_t rsp_addr;
00090 uint8_t vs;
00091 uint8_t va;
00092 uint8_t vr;
00093 int state;
00094 int configuring;
00095 int local_busy;
00096 int far_busy;
00097 int rejected;
00098 int retry_count;
00099
00100
00101 int ctrl_put;
00102 int ctrl_get;
00103 v42_frame_t ctrl_buf[V42_CTRL_FRAMES];
00104
00105
00106 int info_put;
00107 int info_get;
00108 int info_acked;
00109 v42_frame_t info_buf[V42_INFO_FRAMES];
00110
00111 void (*packer_process)(v42_state_t *m, int bits);
00112 } lapm_state_t;
00113
00114
00115 typedef struct
00116 {
00117
00118 int rx_negotiation_step;
00119 int rxbits;
00120 int rxstream;
00121 int rxoks;
00122 int odp_seen;
00123 int txbits;
00124 int txstream;
00125 int txadps;
00126 } v42_negotiation_t;
00127
00128
00129
00130
00131
00132 struct v42_state_s
00133 {
00134
00135 int calling_party;
00136
00137
00138 int detect;
00139
00140
00141 int tx_bit_rate;
00142
00143 v42_config_parameters_t config;
00144 v42_negotiation_t neg;
00145 lapm_state_t lapm;
00146
00147 int bit_timer;
00148 void (*bit_timer_func)(v42_state_t *m);
00149
00150
00151 logging_state_t logging;
00152 };
00153
00154 #endif
00155