Lines Matching refs:plci
62 static void group_optimization(DIVA_CAPI_ADAPTER *a, PLCI *plci);
86 static void SendSSExtInd(APPL *, PLCI *plci, dword Id, byte **parms);
88 static void VSwitchReqInd(PLCI *plci, dword Id, byte **parms);
119 static void add_s(PLCI *plci, byte code, API_PARSE *p);
120 static void add_ss(PLCI *plci, byte code, API_PARSE *p);
121 static void add_ie(PLCI *plci, byte code, byte *p, word p_length);
126 static word add_modem_b23(PLCI *plci, API_PARSE *bp_parms);
143 static void channel_flow_control_remove(PLCI *plci);
144 static void channel_x_off(PLCI *plci, byte ch, byte flag);
145 static void channel_x_on(PLCI *plci, byte ch);
146 static void channel_request_xon(PLCI *plci, byte ch);
147 static void channel_xmit_xon(PLCI *plci);
148 static int channel_can_xon(PLCI *plci, byte ch);
149 static void channel_xmit_extended_xon(PLCI *plci);
151 static byte SendMultiIE(PLCI *plci, dword Id, byte **parms, byte ie_type, dword info_mask, byte set…
155 static void VoiceChannelOff(PLCI *plci);
156 static void adv_voice_write_coefs(PLCI *plci, word write_command);
157 static void adv_voice_clear_config(PLCI *plci);
159 static word get_b1_facilities(PLCI *plci, byte b1_resource);
160 static byte add_b1_facilities(PLCI *plci, byte b1_resource, word b1_facilities);
161 static void adjust_b1_facilities(PLCI *plci, byte new_b1_resource, word new_b1_facilities);
162 static word adjust_b_process(dword Id, PLCI *plci, byte Rc);
163 static void adjust_b1_resource(dword Id, PLCI *plci, API_SAVE *bp_msg, word b1_facilities, word int…
164 static void adjust_b_restore(dword Id, PLCI *plci, byte Rc);
165 static void reset_b3_command(dword Id, PLCI *plci, byte Rc);
166 static void select_b_command(dword Id, PLCI *plci, byte Rc);
167 static void fax_connect_ack_command(dword Id, PLCI *plci, byte Rc);
168 static void fax_edata_ack_command(dword Id, PLCI *plci, byte Rc);
169 static void fax_connect_info_command(dword Id, PLCI *plci, byte Rc);
170 static void fax_adjust_b23_command(dword Id, PLCI *plci, byte Rc);
171 static void fax_disconnect_command(dword Id, PLCI *plci, byte Rc);
172 static void hold_save_command(dword Id, PLCI *plci, byte Rc);
173 static void retrieve_restore_command(dword Id, PLCI *plci, byte Rc);
174 static void init_b1_config(PLCI *plci);
175 static void clear_b1_config(PLCI *plci);
177 static void dtmf_command(dword Id, PLCI *plci, byte Rc);
178 static byte dtmf_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, API_P…
179 static void dtmf_confirmation(dword Id, PLCI *plci);
180 static void dtmf_indication(dword Id, PLCI *plci, byte *msg, word length);
181 static void dtmf_parameter_write(PLCI *plci);
184 static void mixer_set_bchannel_id_esc(PLCI *plci, byte bchannel_id);
185 static void mixer_set_bchannel_id(PLCI *plci, byte *chi);
186 static void mixer_clear_config(PLCI *plci);
187 static void mixer_notify_update(PLCI *plci, byte others);
188 static void mixer_command(dword Id, PLCI *plci, byte Rc);
189 static byte mixer_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, API_…
190 static void mixer_indication_coefs_set(dword Id, PLCI *plci);
191 static void mixer_indication_xconnect_from(dword Id, PLCI *plci, byte *msg, word length);
192 static void mixer_indication_xconnect_to(dword Id, PLCI *plci, byte *msg, word length);
193 static void mixer_remove(PLCI *plci);
196 static void ec_command(dword Id, PLCI *plci, byte Rc);
197 static byte ec_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, API_PAR…
198 static void ec_indication(dword Id, PLCI *plci, byte *msg, word length);
201 static void rtp_connect_b3_req_command(dword Id, PLCI *plci, byte Rc);
202 static void rtp_connect_b3_res_command(dword Id, PLCI *plci, byte Rc);
205 static int diva_get_dma_descriptor(PLCI *plci, dword *dma_magic);
206 static void diva_free_dma_descriptor(PLCI *plci, int nr);
378 PLCI *plci; in api_put() local
400 plci = NULL; in api_put()
401 if ((msg->header.plci != 0) && (msg->header.plci <= a->max_plci) && !a->adapter_disabled) in api_put()
403 dbug(1, dprintf("plci=%x", msg->header.plci)); in api_put()
404 plci = &a->plci[msg->header.plci - 1]; in api_put()
406 if (plci->Id in api_put()
407 && (plci->appl in api_put()
408 || (plci->State == INC_CON_PENDING) in api_put()
409 || (plci->State == INC_CON_ALERT) in api_put()
413 || ((ncci < MAX_NCCI + 1) && (a->ncci_plci[ncci] == plci->Id)))) in api_put()
415 i = plci->msg_in_read_pos; in api_put()
416 j = plci->msg_in_write_pos; in api_put()
427 n = (((CAPI_MSG *)(plci->msg_in_queue))->header.length + MSG_IN_OVERHEAD + 3) & 0xfffc; in api_put()
438 msg->header.length, plci->msg_in_write_pos, in api_put()
439 plci->msg_in_read_pos, plci->msg_in_wrap_pos, i)); in api_put()
444 if ((((byte *) msg) < ((byte *)(plci->msg_in_queue))) in api_put()
445 || (((byte *) msg) >= ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) in api_put()
447 if (plci->msg_in_write_pos != plci->msg_in_read_pos) in api_put()
460 k = plci->msg_in_read_pos; in api_put()
461 while (k != plci->msg_in_write_pos) in api_put()
463 if (k == plci->msg_in_wrap_pos) in api_put()
465 if ((((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[k]))->header.command == _DATA_B3_R) in api_put()
466 && (((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[k]))->header.ncci == ncci)) in api_put()
469 if (((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[k]))->info.data_b3_req.Flags & 0x0004) in api_put()
473 k += (((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[k]))->header.length + in api_put()
484 if (plci->req_in || plci->internal_command) in api_put()
486 if ((((byte *) msg) >= ((byte *)(plci->msg_in_queue))) in api_put()
487 && (((byte *) msg) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) in api_put()
498 if (plci->req_in || plci->internal_command) in api_put()
502 plci->command = msg->header.command; in api_put()
503 plci->number = msg->header.number; in api_put()
509 msg->header.command, plci->req_in, plci->internal_command, in api_put()
510 msg->header.length, plci->msg_in_write_pos, in api_put()
511 plci->msg_in_read_pos, plci->msg_in_wrap_pos, i)); in api_put()
513 plci->msg_in_wrap_pos = plci->msg_in_write_pos; in api_put()
514 m = (CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[j]); in api_put()
516 ((byte *)(plci->msg_in_queue))[j++] = ((byte *) msg)[i]; in api_put()
526 *((APPL **)(&((byte *)(plci->msg_in_queue))[j])) = appl; in api_put()
527 plci->msg_in_write_pos = j + MSG_IN_OVERHEAD; in api_put()
533 plci = NULL; in api_put()
553 if (plci) plci->command = 0; in api_put()
561 plci, in api_put()
565 channel_xmit_extended_xon(plci); in api_put()
567 if (c == 1) send_req(plci); in api_put()
568 if (c == 2 && plci) plci->req_in = plci->req_in_start = plci->req_out = 0; in api_put()
569 if (plci && !plci->req_in) plci->command = 0; in api_put()
676 if (adapter[i].plci[j].Sig.Id) plci_remove(&adapter[i].plci[j]); in api_remove_start()
686 if (adapter[i].plci[j].Sig.Id) return 1; in api_remove_start()
700 static void init_internal_command_queue(PLCI *plci) in init_internal_command_queue() argument
707 plci->internal_command = 0; in init_internal_command_queue()
709 plci->internal_command_queue[i] = NULL; in init_internal_command_queue()
713 static void start_internal_command(dword Id, PLCI *plci, t_std_internal_command command_function) in start_internal_command() argument
720 if (plci->internal_command == 0) in start_internal_command()
722 plci->internal_command_queue[0] = command_function; in start_internal_command()
723 (*command_function)(Id, plci, OK); in start_internal_command()
728 while (plci->internal_command_queue[i] != NULL) in start_internal_command()
730 plci->internal_command_queue[i] = command_function; in start_internal_command()
735 static void next_internal_command(dword Id, PLCI *plci) in next_internal_command() argument
742 plci->internal_command = 0; in next_internal_command()
743 plci->internal_command_queue[0] = NULL; in next_internal_command()
744 while (plci->internal_command_queue[1] != NULL) in next_internal_command()
747 plci->internal_command_queue[i] = plci->internal_command_queue[i + 1]; in next_internal_command()
748 plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = NULL; in next_internal_command()
749 (*(plci->internal_command_queue[0]))(Id, plci, OK); in next_internal_command()
750 if (plci->internal_command != 0) in next_internal_command()
752 plci->internal_command_queue[0] = NULL; in next_internal_command()
763 static word get_ncci(PLCI *plci, byte ch, word force_ncci) in get_ncci() argument
768 a = plci->adapter; in get_ncci()
820 a->ncci_plci[ncci] = plci->Id; in get_ncci()
822 if (!plci->ncci_ring_list) in get_ncci()
823 plci->ncci_ring_list = ncci; in get_ncci()
825 a->ncci_next[ncci] = a->ncci_next[plci->ncci_ring_list]; in get_ncci()
826 a->ncci_next[plci->ncci_ring_list] = (byte) ncci; in get_ncci()
837 static void ncci_free_receive_buffers(PLCI *plci, word ncci) in ncci_free_receive_buffers() argument
844 a = plci->adapter; in ncci_free_receive_buffers()
845 Id = (((dword) ncci) << 16) | (((word)(plci->Id)) << 8) | a->Id; in ncci_free_receive_buffers()
848 if (a->ncci_plci[ncci] == plci->Id) in ncci_free_receive_buffers()
850 if (!plci->appl) in ncci_free_receive_buffers()
858 appl = plci->appl; in ncci_free_receive_buffers()
863 && (((byte)(appl->DataFlags[i] >> 8)) == plci->Id)) in ncci_free_receive_buffers()
875 if (a->ncci_plci[ncci] == plci->Id) in ncci_free_receive_buffers()
877 if (!plci->appl) in ncci_free_receive_buffers()
885 appl = plci->appl; in ncci_free_receive_buffers()
890 && (((byte)(appl->DataFlags[i] >> 8)) == plci->Id)) in ncci_free_receive_buffers()
902 static void cleanup_ncci_data(PLCI *plci, word ncci) in cleanup_ncci_data() argument
906 if (ncci && (plci->adapter->ncci_plci[ncci] == plci->Id)) in cleanup_ncci_data()
908 ncci_ptr = &(plci->adapter->ncci[ncci]); in cleanup_ncci_data()
909 if (plci->appl) in cleanup_ncci_data()
913 if (!plci->data_sent || (ncci_ptr->DBuffer[ncci_ptr->data_out].P != plci->data_sent_ptr)) in cleanup_ncci_data()
914 TransmitBufferFree(plci->appl, ncci_ptr->DBuffer[ncci_ptr->data_out].P); in cleanup_ncci_data()
929 static void ncci_remove(PLCI *plci, word ncci, byte preserve_ncci) in ncci_remove() argument
935 a = plci->adapter; in ncci_remove()
936 Id = (((dword) ncci) << 16) | (((word)(plci->Id)) << 8) | a->Id; in ncci_remove()
938 ncci_free_receive_buffers(plci, ncci); in ncci_remove()
941 if (a->ncci_plci[ncci] != plci->Id) in ncci_remove()
949 cleanup_ncci_data(plci, ncci); in ncci_remove()
958 i = plci->ncci_ring_list; in ncci_remove()
959 while ((i != 0) && (a->ncci_next[i] != plci->ncci_ring_list) && (a->ncci_next[i] != ncci)) in ncci_remove()
964 plci->ncci_ring_list = 0; in ncci_remove()
965 else if (plci->ncci_ring_list == ncci) in ncci_remove()
966 plci->ncci_ring_list = i; in ncci_remove()
977 if (a->ncci_plci[ncci] == plci->Id) in ncci_remove()
979 cleanup_ncci_data(plci, ncci); in ncci_remove()
993 plci->ncci_ring_list = 0; in ncci_remove()
1002 static void plci_free_msg_in_queue(PLCI *plci) in plci_free_msg_in_queue() argument
1006 if (plci->appl) in plci_free_msg_in_queue()
1008 i = plci->msg_in_read_pos; in plci_free_msg_in_queue()
1009 while (i != plci->msg_in_write_pos) in plci_free_msg_in_queue()
1011 if (i == plci->msg_in_wrap_pos) in plci_free_msg_in_queue()
1013 if (((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[i]))->header.command == _DATA_B3_R) in plci_free_msg_in_queue()
1016 TransmitBufferFree(plci->appl, in plci_free_msg_in_queue()
1017 (byte *)(long)(((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[i]))->info.data_b3_req.Data)); in plci_free_msg_in_queue()
1021 i += (((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[i]))->header.length + in plci_free_msg_in_queue()
1026 plci->msg_in_write_pos = MSG_IN_QUEUE_SIZE; in plci_free_msg_in_queue()
1027 plci->msg_in_read_pos = MSG_IN_QUEUE_SIZE; in plci_free_msg_in_queue()
1028 plci->msg_in_wrap_pos = MSG_IN_QUEUE_SIZE; in plci_free_msg_in_queue()
1032 static void plci_remove(PLCI *plci) in plci_remove() argument
1035 if (!plci) { in plci_remove()
1039 init_internal_command_queue(plci); in plci_remove()
1040 dbug(1, dprintf("plci_remove(%x,tel=%x)", plci->Id, plci->tel)); in plci_remove()
1041 if (plci_remove_check(plci)) in plci_remove()
1045 if (plci->Sig.Id == 0xff) in plci_remove()
1047 dbug(1, dprintf("D-channel X.25 plci->NL.Id:%0x", plci->NL.Id)); in plci_remove()
1048 if (plci->NL.Id && !plci->nl_remove_id) in plci_remove()
1050 nl_req_ncci(plci, REMOVE, 0); in plci_remove()
1051 send_req(plci); in plci_remove()
1056 if (!plci->sig_remove_id in plci_remove()
1057 && (plci->Sig.Id in plci_remove()
1058 || (plci->req_in != plci->req_out) in plci_remove()
1059 || (plci->nl_req || plci->sig_req))) in plci_remove()
1061 sig_req(plci, HANGUP, 0); in plci_remove()
1062 send_req(plci); in plci_remove()
1065 ncci_remove(plci, 0, false); in plci_remove()
1066 plci_free_msg_in_queue(plci); in plci_remove()
1068 plci->channels = 0; in plci_remove()
1069 plci->appl = NULL; in plci_remove()
1070 if ((plci->State == INC_CON_PENDING) || (plci->State == INC_CON_ALERT)) in plci_remove()
1071 plci->State = OUTG_DIS_PENDING; in plci_remove()
1079 PLCI *plci, APPL *appl, API_PARSE *parms) in connect_req() argument
1115 plci = &a->plci[i - 1]; in connect_req()
1116 plci->appl = appl; in connect_req()
1117 plci->call_dir = CALL_DIR_OUT | CALL_DIR_ORIGINATE; in connect_req()
1121 if (AdvCodecSupport(a, plci, appl, 0)) in connect_req()
1123 plci->Id = 0; in connect_req()
1197 plci->b_channel = (byte)channel; /* not correct for ETSI ch 17..31 */ in connect_req()
1198 add_p(plci, LLI, lli); in connect_req()
1199 add_p(plci, ESC, esc_chi); in connect_req()
1200 plci->State = LOCAL_CONNECT; in connect_req()
1201 if (!dir) plci->call_dir |= CALL_DIR_FORCE_OUTG_NL; /* dir 0=DTE, 1=DCE */ in connect_req()
1210 plci->command = _CONNECT_R; in connect_req()
1211 plci->number = Number; in connect_req()
1218 if (noCh) Info = add_b1(plci, &parms[5], 2, 0); /* no resource */ in connect_req()
1219 else Info = add_b1(plci, &parms[5], ch, 0); in connect_req()
1220 add_s(plci, OAD, &parms[2]); in connect_req()
1221 add_s(plci, OSA, &parms[4]); in connect_req()
1222 add_s(plci, BC, &parms[6]); in connect_req()
1223 add_s(plci, LLC, &parms[7]); in connect_req()
1224 add_s(plci, HLC, &parms[8]); in connect_req()
1228 add_p(plci, LLI, "\x01\x01"); in connect_req()
1231 add_p(plci, BC, cip_bc[GET_WORD(parms[0].info)][a->u_law]); in connect_req()
1232 add_p(plci, HLC, cip_hlc[GET_WORD(parms[0].info)]); in connect_req()
1234 add_p(plci, UID, "\x06\x43\x61\x70\x69\x32\x30"); in connect_req()
1235 sig_req(plci, ASSIGN, DSIG_ID); in connect_req()
1240 plci->Sig.Id = 0xff; in connect_req()
1245 Info = add_b23(plci, &parms[5]); in connect_req()
1247 if (!(plci->tel && !plci->adv_nl))nl_req_ncci(plci, ASSIGN, 0); in connect_req()
1255 if (plci->spoofed_msg == SPOOFING_REQUIRED) in connect_req()
1257 api_save_msg(parms, "wsssssssss", &plci->saved_msg); in connect_req()
1258 plci->spoofed_msg = CALL_REQ; in connect_req()
1259 plci->internal_command = BLOCK_PLCI; in connect_req()
1260 plci->command = 0; in connect_req()
1262 send_req(plci); in connect_req()
1265 if (ch == 4)add_p(plci, CHI, p_chi); in connect_req()
1266 add_s(plci, CPN, &parms[1]); in connect_req()
1267 add_s(plci, DSA, &parms[3]); in connect_req()
1268 if (noCh) add_p(plci, ESC, "\x02\x18\xfd"); /* D-channel, no B-L3 */ in connect_req()
1269 add_ai(plci, &parms[9]); in connect_req()
1270 if (!dir)sig_req(plci, CALL_REQ, 0); in connect_req()
1273 plci->command = PERM_LIST_REQ; in connect_req()
1274 plci->appl = appl; in connect_req()
1275 sig_req(plci, LISTEN_REQ, 0); in connect_req()
1276 send_req(plci); in connect_req()
1280 send_req(plci); in connect_req()
1283 plci->Id = 0; in connect_req()
1295 PLCI *plci, APPL *appl, API_PARSE *parms) in connect_res() argument
1305 if (!plci) { in connect_res()
1310 dbug(1, dprintf("connect_res(State=0x%x)", plci->State)); in connect_res()
1329 if (plci->State == INC_CON_CONNECTED_ALERT) in connect_res()
1335 add_p(plci, LLI, "\x01\x01"); in connect_res()
1337 add_s(plci, CONN_NR, &parms[2]); in connect_res()
1338 add_s(plci, LLC, &parms[4]); in connect_res()
1339 add_ai(plci, &parms[5]); in connect_res()
1340 plci->State = INC_CON_ACCEPT; in connect_res()
1341 sig_req(plci, CALL_RES, 0); in connect_res()
1344 else if (plci->State == INC_CON_PENDING || plci->State == INC_CON_ALERT) { in connect_res()
1345 __clear_bit(appl->Id - 1, plci->c_ind_mask_table); in connect_res()
1346 dbug(1, dprintf("c_ind_mask =%*pb", MAX_APPL, plci->c_ind_mask_table)); in connect_res()
1351 if (bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) in connect_res()
1356 add_p(plci, ESC, esc_t); in connect_res()
1357 add_ai(plci, &parms[5]); in connect_res()
1358 sig_req(plci, REJECT, 0); in connect_res()
1362 add_ai(plci, &parms[5]); in connect_res()
1363 sig_req(plci, HANGUP, 0); in connect_res()
1368 add_p(plci, ESC, esc_t); in connect_res()
1369 add_ai(plci, &parms[5]); in connect_res()
1370 sig_req(plci, REJECT, 0); in connect_res()
1372 plci->appl = appl; in connect_res()
1380 plci->appl = appl; in connect_res()
1382 if (AdvCodecSupport(a, plci, appl, 0)) { in connect_res()
1384 sig_req(plci, HANGUP, 0); in connect_res()
1387 if (plci->tel == ADV_VOICE && a->AdvCodecPLCI) in connect_res()
1389 Info = add_b23(plci, &parms[1]); in connect_res()
1393 sig_req(plci, HANGUP, 0); in connect_res()
1396 if (plci->adv_nl) in connect_res()
1398 nl_req_ncci(plci, ASSIGN, 0); in connect_res()
1404 plci->tel = 0; in connect_res()
1407 Info = add_b23(plci, &parms[1]); in connect_res()
1411 sig_req(plci, HANGUP, 0); in connect_res()
1415 nl_req_ncci(plci, ASSIGN, 0); in connect_res()
1418 if (plci->spoofed_msg == SPOOFING_REQUIRED) in connect_res()
1420 api_save_msg(parms, "wsssss", &plci->saved_msg); in connect_res()
1421 plci->spoofed_msg = CALL_RES; in connect_res()
1422 plci->internal_command = BLOCK_PLCI; in connect_res()
1423 plci->command = 0; in connect_res()
1428 add_b1(plci, &parms[1], ch, plci->B1_facilities); in connect_res()
1432 add_p(plci, LLI, "\x01\x01"); in connect_res()
1434 add_s(plci, CONN_NR, &parms[2]); in connect_res()
1435 add_s(plci, LLC, &parms[4]); in connect_res()
1436 add_ai(plci, &parms[5]); in connect_res()
1437 plci->State = INC_CON_ACCEPT; in connect_res()
1438 sig_req(plci, CALL_RES, 0); in connect_res()
1441 for_each_set_bit(i, plci->c_ind_mask_table, max_appl) in connect_res()
1449 PLCI *plci, APPL *appl, API_PARSE *msg) in connect_a_res() argument
1456 PLCI *plci, APPL *appl, API_PARSE *msg) in disconnect_req() argument
1465 if (plci) in disconnect_req()
1467 if (plci->State == INC_CON_PENDING || plci->State == INC_CON_ALERT) in disconnect_req()
1469 __clear_bit(appl->Id - 1, plci->c_ind_mask_table); in disconnect_req()
1470 plci->appl = appl; in disconnect_req()
1471 for_each_set_bit(i, plci->c_ind_mask_table, max_appl) in disconnect_req()
1473 plci->State = OUTG_DIS_PENDING; in disconnect_req()
1475 if (plci->Sig.Id && plci->appl) in disconnect_req()
1478 if (plci->Sig.Id != 0xff) in disconnect_req()
1480 if (plci->State != INC_DIS_PENDING) in disconnect_req()
1482 add_ai(plci, &msg[0]); in disconnect_req()
1483 sig_req(plci, HANGUP, 0); in disconnect_req()
1484 plci->State = OUTG_DIS_PENDING; in disconnect_req()
1490 if (plci->NL.Id && !plci->nl_remove_id) in disconnect_req()
1492 mixer_remove(plci); in disconnect_req()
1493 nl_req_ncci(plci, REMOVE, 0); in disconnect_req()
1496 plci->State = INC_DIS_PENDING; in disconnect_req()
1509 PLCI *plci, APPL *appl, API_PARSE *msg) in disconnect_res() argument
1512 if (plci) in disconnect_res()
1516 __clear_bit(appl->Id - 1, plci->c_ind_mask_table); in disconnect_res()
1517 ncci_free_receive_buffers(plci, 0); in disconnect_res()
1518 if (plci_remove_check(plci)) in disconnect_res()
1522 if (plci->State == INC_DIS_PENDING in disconnect_res()
1523 || plci->State == SUSPENDING) { in disconnect_res()
1524 if (bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) { in disconnect_res()
1525 if (plci->State != SUSPENDING) plci->State = IDLE; in disconnect_res()
1526 dbug(1, dprintf("chs=%d", plci->channels)); in disconnect_res()
1527 if (!plci->channels) { in disconnect_res()
1528 plci_remove(plci); in disconnect_res()
1537 PLCI *plci, APPL *appl, API_PARSE *parms) in listen_req() argument
1587 PLCI *plci, APPL *appl, API_PARSE *msg) in info_req() argument
1610 if (!Info && plci) in info_req()
1612 rc_plci = plci; in info_req()
1613 if (!ai_parms[3].length && plci->State && (msg[0].length || ai_parms[1].length)) in info_req()
1617 add_s(plci, CPN, &msg[0]); in info_req()
1618 add_s(plci, KEY, &ai_parms[1]); in info_req()
1619 sig_req(plci, INFO_REQ, 0); in info_req()
1620 send_req(plci); in info_req()
1624 if (plci->State && ai_parms[2].length) in info_req()
1628 add_s(plci, UUI, &ai_parms[2]); in info_req()
1629 sig_req(plci, USER_DATA, 0); in info_req()
1631 else if (plci->State && ai_parms[3].length) in info_req()
1635 add_s(plci, CPN, &msg[0]); in info_req()
1636 add_ai(plci, &msg[1]); in info_req()
1637 sig_req(plci, FACILITY_REQ, 0); in info_req()
1650 rc_plci = &a->plci[i - 1]; in info_req()
1697 PLCI *plci, APPL *appl, API_PARSE *msg) in info_res() argument
1704 PLCI *plci, APPL *appl, API_PARSE *msg) in alert_req() argument
1713 if (plci) { in alert_req()
1715 if (plci->State != INC_CON_ALERT) { in alert_req()
1717 if (plci->State == INC_CON_PENDING) { in alert_req()
1719 plci->State = INC_CON_ALERT; in alert_req()
1720 add_ai(plci, &msg[0]); in alert_req()
1721 sig_req(plci, CALL_ALERT, 0); in alert_req()
1735 PLCI *plci, APPL *appl, API_PARSE *msg) in facility_req() argument
1772 Info = AdvCodecSupport(a, plci, appl, HOOK_SUPPORT); in facility_req()
1789 rplci = &a->plci[i - 1]; in facility_req()
1830 rplci = &a->plci[i - 1]; in facility_req()
1850 if (plci && plci->State && plci->SuppState == IDLE) in facility_req()
1852 plci->SuppState = HOLD_REQUEST; in facility_req()
1853 plci->command = C_HOLD_REQ; in facility_req()
1854 add_s(plci, CAI, &ss_parms[1]); in facility_req()
1855 sig_req(plci, CALL_HOLD, 0); in facility_req()
1856 send_req(plci); in facility_req()
1862 if (plci && plci->State && plci->SuppState == CALL_HELD) in facility_req()
1866 if (AdvCodecSupport(a, plci, appl, 0)) in facility_req()
1872 else plci->tel = 0; in facility_req()
1874 plci->SuppState = RETRIEVE_REQUEST; in facility_req()
1875 plci->command = C_RETRIEVE_REQ; in facility_req()
1876 if (plci->spoofed_msg == SPOOFING_REQUIRED) in facility_req()
1878 plci->spoofed_msg = CALL_RETRIEVE; in facility_req()
1879 plci->internal_command = BLOCK_PLCI; in facility_req()
1880 plci->command = 0; in facility_req()
1886 sig_req(plci, CALL_RETRIEVE, 0); in facility_req()
1887 send_req(plci); in facility_req()
1903 if (plci && plci->State) in facility_req()
1905 add_s(plci, CAI, &ss_parms[2]); in facility_req()
1906 plci->command = SUSPEND_REQ; in facility_req()
1907 sig_req(plci, SUSPEND, 0); in facility_req()
1908 plci->State = SUSPENDING; in facility_req()
1909 send_req(plci); in facility_req()
1920 rplci = &a->plci[i - 1]; in facility_req()
1973 if (plci && plci->State && ((plci->SuppState == IDLE) || (plci->SuppState == CALL_HELD))) in facility_req()
1982 plci->ptyState = (byte)SSreq; in facility_req()
1983 plci->command = 0; in facility_req()
1989 plci->internal_command = CONF_BEGIN_REQ_PEND; in facility_req()
1993 plci->internal_command = CONF_DROP_REQ_PEND; in facility_req()
1997 plci->internal_command = CONF_ISOLATE_REQ_PEND; in facility_req()
2001 plci->internal_command = CONF_REATTACH_REQ_PEND; in facility_req()
2005 add_p(plci, CAI, cai); in facility_req()
2006 sig_req(plci, S_SERVICE, 0); in facility_req()
2007 send_req(plci); in facility_req()
2045 if (!plci) in facility_req()
2061 rplci = plci; in facility_req()
2076 if (relatedadapter->plci[i].Id == (byte)relatedPLCIvalue) in facility_req()
2078 rplci = &relatedadapter->plci[i]; in facility_req()
2086 rplci = plci; in facility_req()
2108 plci->command = 0; in facility_req()
2109 rplci->relatedPTYPLCI = plci; in facility_req()
2110 plci->relatedPTYPLCI = rplci; in facility_req()
2120 plci->vswitchstate = 0; in facility_req()
2121 plci->vsprot = 0; in facility_req()
2122 plci->vsprotdialect = 0; in facility_req()
2136 if (plci != rplci) /* explicit invocation */ in facility_req()
2139 cai[2] = plci->Sig.Id; in facility_req()
2167 if (!plci) in facility_req()
2174 plci->command = 0; in facility_req()
2175 plci->internal_command = CD_REQ_PEND; in facility_req()
2179 add_p(plci, CAI, cai); in facility_req()
2180 add_p(plci, CPN, ss_parms[3].info); in facility_req()
2181 sig_req(plci, S_SERVICE, 0); in facility_req()
2182 send_req(plci); in facility_req()
2196 rplci = &a->plci[i - 1]; in facility_req()
2268 rplci = &a->plci[i - 1]; in facility_req()
2351 if (!plci) in facility_req()
2355 rplci = &a->plci[i - 1]; in facility_req()
2371 rplci = plci; in facility_req()
2403 if (!plci) in facility_req()
2407 rplci = &a->plci[i - 1]; in facility_req()
2423 rplci = plci; in facility_req()
2451 return (dtmf_request(Id, Number, a, plci, appl, msg)); in facility_req()
2456 return (mixer_request(Id, Number, a, plci, appl, msg)); in facility_req()
2462 return (ec_request(Id, Number, a, plci, appl, msg)); in facility_req()
2466 return (ec_request(Id, Number, a, plci, appl, msg)); in facility_req()
2486 PLCI *plci, APPL *appl, API_PARSE *msg) in facility_res() argument
2493 PLCI *plci, APPL *appl, API_PARSE *parms) in connect_b3_req() argument
2508 if (plci) in connect_b3_req()
2510 if ((plci->State == IDLE) || (plci->State == OUTG_DIS_PENDING) in connect_b3_req()
2511 || (plci->State == INC_DIS_PENDING) || (plci->SuppState != IDLE)) in connect_b3_req()
2522 if (!plci->NL.Id in connect_b3_req()
2523 …|| (((plci->B3_prot != B3_T90NL) && (plci->B3_prot != B3_ISO8208) && (plci->B3_prot != B3_X25_DCE)) in connect_b3_req()
2524 && ((plci->channels != 0) in connect_b3_req()
2525 …|| (((plci->B2_prot != B2_SDLC) && (plci->B2_prot != B2_LAPD) && (plci->B2_prot != B2_LAPD_FREE_SA… in connect_b3_req()
2526 && ((plci->call_dir & CALL_DIR_ANSWER) && !(plci->call_dir & CALL_DIR_FORCE_OUTG_NL)))))) in connect_b3_req()
2529 plci->channels, plci->NL.Id, plci->call_dir, plci->SuppState)); in connect_b3_req()
2538 plci->requested_options_conn = 0; in connect_b3_req()
2542 if (plci->B3_prot == 2 || plci->B3_prot == 3) in connect_b3_req()
2551 add_d(plci, 2, pvc); in connect_b3_req()
2557 add_d(plci, (word)(ncpi->length - 3), &ncpi->info[4]); in connect_b3_req()
2561 else if (plci->B3_prot == 5) in connect_b3_req()
2563 if (plci->NL.Id && !plci->nl_remove_id) in connect_b3_req()
2565 fax_control_bits = GET_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low); in connect_b3_req()
2566 fax_feature_bits = GET_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->feature_bits_low); in connect_b3_req()
2575 … if ((w & 0x0001) != ((word)(((T30_INFO *)(plci->fax_connect_info_buffer))->resolution & 0x0001))) in connect_b3_req()
2577 ((T30_INFO *)(plci->fax_connect_info_buffer))->resolution = in connect_b3_req()
2578 …(byte)((((T30_INFO *)(plci->fax_connect_info_buffer))->resolution & ~T30_RESOLUTION_R8_0770_OR_200… in connect_b3_req()
2593 if (((byte) w) != ((T30_INFO *)(plci->fax_connect_info_buffer))->data_format) in connect_b3_req()
2595 ((T30_INFO *)(plci->fax_connect_info_buffer))->data_format = (byte) w; in connect_b3_req()
2602 plci->requested_options_conn |= (1L << PRIVATE_FAX_SUB_SEP_PWD); in connect_b3_req()
2607 plci->requested_options_conn |= (1L << PRIVATE_FAX_NONSTANDARD); in connect_b3_req()
2611 …if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[appl->Id … in connect_b3_req()
2618 …if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[appl->Id … in connect_b3_req()
2628 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = (byte) w; in connect_b3_req()
2630 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1 + i]; in connect_b3_req()
2631 ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; in connect_b3_req()
2636 plci->fax_connect_info_buffer[len++] = (byte) w; in connect_b3_req()
2638 plci->fax_connect_info_buffer[len++] = fax_parms[5].info[1 + i]; in connect_b3_req()
2642 plci->fax_connect_info_buffer[len++] = (byte) w; in connect_b3_req()
2644 plci->fax_connect_info_buffer[len++] = fax_parms[6].info[1 + i]; in connect_b3_req()
2645 …if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[appl->Id … in connect_b3_req()
2651 plci->fax_connect_info_buffer[len++] = 0; in connect_b3_req()
2656 plci->nsf_control_bits = GET_WORD(&fax_parms[7].info[2]); in connect_b3_req()
2657 plci->fax_connect_info_buffer[len++] = (byte)(fax_parms[7].length); in connect_b3_req()
2659 plci->fax_connect_info_buffer[len++] = fax_parms[7].info[1 + i]; in connect_b3_req()
2671 … if (fax_control_bits != GET_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low)) in connect_b3_req()
2673 PUT_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low, fax_control_bits); in connect_b3_req()
2679 plci->fax_connect_info_length = len; in connect_b3_req()
2684 start_internal_command(Id, plci, fax_connect_info_command); in connect_b3_req()
2689 start_internal_command(Id, plci, fax_adjust_b23_command); in connect_b3_req()
2700 else if (plci->B3_prot == B3_RTP) in connect_b3_req()
2702 plci->internal_req_buffer[0] = ncpi->length + 1; in connect_b3_req()
2703 plci->internal_req_buffer[1] = UDATA_REQUEST_RTP_RECONFIGURE; in connect_b3_req()
2705 plci->internal_req_buffer[2 + w] = ncpi->info[1 + w]; in connect_b3_req()
2706 start_internal_command(Id, plci, rtp_connect_b3_req_command); in connect_b3_req()
2712 nl_req_ncci(plci, req, 0); in connect_b3_req()
2728 PLCI *plci, APPL *appl, API_PARSE *parms) in connect_b3_res() argument
2745 if (plci && ncci) { in connect_b3_res()
2750 channel_request_xon(plci, a->ncci_ch[ncci]); in connect_b3_res()
2751 channel_xmit_xon(plci); in connect_b3_res()
2752 cleanup_ncci_data(plci, ncci); in connect_b3_res()
2753 nl_req_ncci(plci, N_DISC, (byte)ncci); in connect_b3_res()
2760 if ((plci->B3_prot == 4) || (plci->B3_prot == 5) || (plci->B3_prot == 7)) in connect_b3_res()
2763 …if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->app… in connect_b3_res()
2766 if (((plci->B3_prot == 4) || (plci->B3_prot == 5)) in connect_b3_res()
2767 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) in connect_b3_res()
2768 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)) in connect_b3_res()
2771 if (plci->fax_connect_info_length < len) in connect_b3_res()
2773 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; in connect_b3_res()
2774 ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; in connect_b3_res()
2782 if (plci->fax_connect_info_length <= len) in connect_b3_res()
2783 plci->fax_connect_info_buffer[len] = 0; in connect_b3_res()
2784 len += 1 + plci->fax_connect_info_buffer[len]; in connect_b3_res()
2785 if (plci->fax_connect_info_length <= len) in connect_b3_res()
2786 plci->fax_connect_info_buffer[len] = 0; in connect_b3_res()
2787 len += 1 + plci->fax_connect_info_buffer[len]; in connect_b3_res()
2789 plci->nsf_control_bits = GET_WORD(&fax_parms[7].info[2]); in connect_b3_res()
2790 plci->fax_connect_info_buffer[len++] = (byte)(fax_parms[7].length); in connect_b3_res()
2792 plci->fax_connect_info_buffer[len++] = fax_parms[7].info[1 + i]; in connect_b3_res()
2794 plci->fax_connect_info_length = len; in connect_b3_res()
2795 ((T30_INFO *)(plci->fax_connect_info_buffer))->code = 0; in connect_b3_res()
2796 start_internal_command(Id, plci, fax_connect_ack_command); in connect_b3_res()
2801 nl_req_ncci(plci, req, (byte)ncci); in connect_b3_res()
2802 if ((plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in connect_b3_res()
2803 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in connect_b3_res()
2805 if (plci->B3_prot == 4) in connect_b3_res()
2808 sendf(appl, _CONNECT_B3_ACTIVE_I, Id, 0, "S", plci->ncpi_buffer); in connect_b3_res()
2809 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in connect_b3_res()
2813 else if (plci->B3_prot == B3_RTP) in connect_b3_res()
2815 plci->internal_req_buffer[0] = ncpi->length + 1; in connect_b3_res()
2816 plci->internal_req_buffer[1] = UDATA_REQUEST_RTP_RECONFIGURE; in connect_b3_res()
2818 plci->internal_req_buffer[2 + w] = ncpi->info[1+w]; in connect_b3_res()
2819 start_internal_command(Id, plci, rtp_connect_b3_res_command); in connect_b3_res()
2827 add_d(plci, (word)(ncpi->length - 3), &ncpi->info[4]); in connect_b3_res()
2829 nl_req_ncci(plci, req, (byte)ncci); in connect_b3_res()
2831 if (plci->adjust_b_restore) in connect_b3_res()
2833 plci->adjust_b_restore = false; in connect_b3_res()
2834 start_internal_command(Id, plci, adjust_b_restore); in connect_b3_res()
2844 PLCI *plci, APPL *appl, API_PARSE *parms) in connect_b3_a_res() argument
2851 if (plci && ncci && (plci->State != IDLE) && (plci->State != INC_DIS_PENDING) in connect_b3_a_res()
2852 && (plci->State != OUTG_DIS_PENDING)) in connect_b3_a_res()
2856 if (plci->State != INC_CON_CONNECTED_ALERT) plci->State = CONNECTED; in connect_b3_a_res()
2857 channel_request_xon(plci, a->ncci_ch[ncci]); in connect_b3_a_res()
2858 channel_xmit_xon(plci); in connect_b3_a_res()
2865 PLCI *plci, APPL *appl, API_PARSE *parms) in disconnect_b3_req() argument
2875 if (plci && ncci) in disconnect_b3_req()
2884 channel_request_xon(plci, a->ncci_ch[ncci]); in disconnect_b3_req()
2885 channel_xmit_xon(plci); in disconnect_b3_req()
2888 && ((plci->B3_prot == B3_TRANSPARENT) in disconnect_b3_req()
2889 || (plci->B3_prot == B3_T30) in disconnect_b3_req()
2890 || (plci->B3_prot == B3_T30_WITH_EXTENSIONS))) in disconnect_b3_req()
2892 plci->send_disc = (byte)ncci; in disconnect_b3_req()
2893 plci->command = 0; in disconnect_b3_req()
2898 cleanup_ncci_data(plci, ncci); in disconnect_b3_req()
2900 if (plci->B3_prot == 2 || plci->B3_prot == 3) in disconnect_b3_req()
2905 add_d(plci, (word)(ncpi->length - 3), (byte *)&(ncpi->info[4])); in disconnect_b3_req()
2908 nl_req_ncci(plci, N_DISC, (byte)ncci); in disconnect_b3_req()
2922 PLCI *plci, APPL *appl, API_PARSE *parms) in disconnect_b3_res() argument
2929 if (plci && ncci) { in disconnect_b3_res()
2930 plci->requested_options_conn = 0; in disconnect_b3_res()
2931 plci->fax_connect_info_length = 0; in disconnect_b3_res()
2932 plci->ncpi_state = 0x00; in disconnect_b3_res()
2933 …if (((plci->B3_prot != B3_T90NL) && (plci->B3_prot != B3_ISO8208) && (plci->B3_prot != B3_X25_DCE)) in disconnect_b3_res()
2934 && ((plci->B2_prot != B2_LAPD) && (plci->B2_prot != B2_LAPD_FREE_SAPI_SEL))) in disconnect_b3_res()
2936 plci->call_dir |= CALL_DIR_FORCE_OUTG_NL; in disconnect_b3_res()
2938 for (i = 0; i < MAX_CHANNELS_PER_PLCI && plci->inc_dis_ncci_table[i] != (byte)ncci; i++); in disconnect_b3_res()
2940 if (plci->channels)plci->channels--; in disconnect_b3_res()
2941 …for (; i < MAX_CHANNELS_PER_PLCI - 1; i++) plci->inc_dis_ncci_table[i] = plci->inc_dis_ncci_table[… in disconnect_b3_res()
2942 plci->inc_dis_ncci_table[MAX_CHANNELS_PER_PLCI - 1] = 0; in disconnect_b3_res()
2944 ncci_free_receive_buffers(plci, ncci); in disconnect_b3_res()
2946 if ((plci->State == IDLE || plci->State == SUSPENDING) && !plci->channels) { in disconnect_b3_res()
2947 if (plci->State == SUSPENDING) { in disconnect_b3_res()
2948 sendf(plci->appl, in disconnect_b3_res()
2953 sendf(plci->appl, _DISCONNECT_I, Id & 0xffffL, 0, "w", 0); in disconnect_b3_res()
2955 plci_remove(plci); in disconnect_b3_res()
2956 plci->State = IDLE; in disconnect_b3_res()
2962 && ((plci->B3_prot == 4) || (plci->B3_prot == 5)) in disconnect_b3_res()
2965 ncci_free_receive_buffers(plci, ncci); in disconnect_b3_res()
2967 nl_req_ncci(plci, N_EDATA, (byte)ncci); in disconnect_b3_res()
2969 plci->adapter->ncci_state[ncci] = IDLE; in disconnect_b3_res()
2970 start_internal_command(Id, plci, fax_disconnect_command); in disconnect_b3_res()
2979 PLCI *plci, APPL *appl, API_PARSE *parms) in data_b3_req() argument
2991 dbug(1, dprintf("ncci=0x%x, plci=0x%x", ncci, plci)); in data_b3_req()
2993 if (plci && ncci) in data_b3_req()
3006 if ((((byte *)(parms[0].info)) >= ((byte *)(plci->msg_in_queue))) in data_b3_req()
3007 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) in data_b3_req()
3031 send_data(plci); in data_b3_req()
3037 if (plci) in data_b3_req()
3039 if ((((byte *)(parms[0].info)) >= ((byte *)(plci->msg_in_queue))) in data_b3_req()
3040 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) in data_b3_req()
3057 PLCI *plci, APPL *appl, API_PARSE *parms) in data_b3_res() argument
3066 if (plci && ncci) { in data_b3_res()
3072 (byte)(appl->DataFlags[n] >> 8) == plci->Id) { in data_b3_res()
3076 if (channel_can_xon(plci, a->ncci_ch[ncci])) { in data_b3_res()
3077 channel_request_xon(plci, a->ncci_ch[ncci]); in data_b3_res()
3079 channel_xmit_xon(plci); in data_b3_res()
3082 nl_req_ncci(plci, N_DATA_ACK, (byte)ncci); in data_b3_res()
3091 PLCI *plci, APPL *appl, API_PARSE *parms) in reset_b3_req() argument
3100 if (plci && ncci) in reset_b3_req()
3103 switch (plci->B3_prot) in reset_b3_req()
3109 nl_req_ncci(plci, N_RESET, (byte)ncci); in reset_b3_req()
3110 send_req(plci); in reset_b3_req()
3117 start_internal_command(Id, plci, reset_b3_command); in reset_b3_req()
3133 PLCI *plci, APPL *appl, API_PARSE *parms) in reset_b3_res() argument
3140 if (plci && ncci) { in reset_b3_res()
3141 switch (plci->B3_prot) in reset_b3_res()
3148 nl_req_ncci(plci, N_RESET_ACK, (byte)ncci); in reset_b3_res()
3158 PLCI *plci, APPL *appl, API_PARSE *parms) in connect_b3_t90_a_res() argument
3167 if (plci && ncci) { in connect_b3_t90_a_res()
3181 add_d(plci, (word)(ncpi->length - 3), &ncpi->info[4]); in connect_b3_t90_a_res()
3184 nl_req_ncci(plci, req, (byte)ncci); in connect_b3_t90_a_res()
3193 PLCI *plci, APPL *appl, API_PARSE *msg) in select_b_req() argument
3200 if (!plci || !msg) in select_b_req()
3207 msg->length, plci->Id, plci->tel, plci->NL.Id, plci->appl, plci->SuppState)); in select_b_req()
3208 dbug(1, dprintf("PlciState=0x%x", plci->State)); in select_b_req()
3212 if ((plci->State == IDLE) || (plci->State == OUTG_DIS_PENDING) || (plci->State == INC_DIS_PENDING) in select_b_req()
3213 || (plci->SuppState != IDLE) || plci->channels || plci->nl_remove_id) in select_b_req()
3224 …if ((plci->State == INC_CON_PENDING) || (plci->State == INC_CON_ALERT)) /* send alert tone inband … in select_b_req()
3231 plci->State = INC_CON_CONNECTED_ALERT; in select_b_req()
3232 plci->appl = appl; in select_b_req()
3233 __clear_bit(appl->Id - 1, plci->c_ind_mask_table); in select_b_req()
3234 dbug(1, dprintf("c_ind_mask =%*pb", MAX_APPL, plci->c_ind_mask_table)); in select_b_req()
3236 for_each_set_bit(i, plci->c_ind_mask_table, max_appl) in select_b_req()
3240 api_save_msg(msg, "s", &plci->saved_msg); in select_b_req()
3241 tel = plci->tel; in select_b_req()
3262 if (AdvCodecSupport(a, plci, appl, 0)) in select_b_req()
3267 else if (plci->spoofed_msg == SPOOFING_REQUIRED) /* wait until codec is active */ in select_b_req()
3269 plci->spoofed_msg = AWAITING_SELECT_B; in select_b_req()
3270 plci->internal_command = BLOCK_PLCI; /* lock other commands */ in select_b_req()
3271 plci->command = 0; in select_b_req()
3284 CodecIdCheck(a, plci); in select_b_req()
3285 plci->tel = 0; in select_b_req()
3286 plci->adv_nl = 0; in select_b_req()
3297 if (plci->call_dir & CALL_DIR_OUT) in select_b_req()
3298 plci->call_dir = CALL_DIR_OUT | CALL_DIR_ORIGINATE; in select_b_req()
3299 else if (plci->call_dir & CALL_DIR_IN) in select_b_req()
3300 plci->call_dir = CALL_DIR_IN | CALL_DIR_ANSWER; in select_b_req()
3301 start_internal_command(Id, plci, select_b_command); in select_b_req()
3311 PLCI *plci, APPL *appl, API_PARSE *parms) in manufacturer_req() argument
3350 plci = &a->plci[i - 1]; in manufacturer_req()
3351 plci->appl = appl; in manufacturer_req()
3352 plci->command = _MANUFACTURER_R; in manufacturer_req()
3353 plci->m_command = command; in manufacturer_req()
3354 plci->number = Number; in manufacturer_req()
3355 plci->State = LOCAL_CONNECT; in manufacturer_req()
3356 Id = (((word)plci->Id << 8) | plci->adapter->Id | 0x80); in manufacturer_req()
3362 plci->call_dir = CALL_DIR_OUT | CALL_DIR_ORIGINATE; in manufacturer_req()
3366 Info = add_b1(plci, &m_parms[3], 0, 0); in manufacturer_req()
3369 add_p(plci, CAI, codec_cai); in manufacturer_req()
3374 if (AdvCodecSupport(a, plci, appl, 0)) { in manufacturer_req()
3378 Info = add_b1(plci, &null_parms, 0, B1_FACILITY_LOCAL); in manufacturer_req()
3384 plci->State = LOCAL_CONNECT; in manufacturer_req()
3385 plci->manufacturer = true; in manufacturer_req()
3386 plci->command = _MANUFACTURER_R; in manufacturer_req()
3387 plci->m_command = command; in manufacturer_req()
3388 plci->number = Number; in manufacturer_req()
3392 add_p(plci, LLI, lli); in manufacturer_req()
3393 add_p(plci, CHI, chi); in manufacturer_req()
3394 add_p(plci, UID, "\x06\x43\x61\x70\x69\x32\x30"); in manufacturer_req()
3395 sig_req(plci, ASSIGN, DSIG_ID); in manufacturer_req()
3399 Info = add_b23(plci, &m_parms[3]); in manufacturer_req()
3402 nl_req_ncci(plci, ASSIGN, 0); in manufacturer_req()
3403 send_req(plci); in manufacturer_req()
3408 dbug(1, dprintf("dir=0x%x,spoof=0x%x", dir, plci->spoofed_msg)); in manufacturer_req()
3409 if (plci->spoofed_msg == SPOOFING_REQUIRED) in manufacturer_req()
3411 api_save_msg(m_parms, "wbbs", &plci->saved_msg); in manufacturer_req()
3412 plci->spoofed_msg = AWAITING_MANUF_CON; in manufacturer_req()
3413 plci->internal_command = BLOCK_PLCI; /* reject other req meanwhile */ in manufacturer_req()
3414 plci->command = 0; in manufacturer_req()
3415 send_req(plci); in manufacturer_req()
3419 sig_req(plci, CALL_REQ, 0); in manufacturer_req()
3422 sig_req(plci, LISTEN_REQ, 0); in manufacturer_req()
3424 send_req(plci); in manufacturer_req()
3442 if (!plci) in manufacturer_req()
3452 plci->command = _MANUFACTURER_R; in manufacturer_req()
3453 plci->m_command = command; in manufacturer_req()
3454 plci->number = Number; in manufacturer_req()
3457 plci->b_channel = getChannel(&m_parms[1]); in manufacturer_req()
3458 mixer_set_bchannel_id_esc(plci, plci->b_channel); in manufacturer_req()
3459 if (plci->spoofed_msg == SPOOFING_REQUIRED) in manufacturer_req()
3461 plci->spoofed_msg = CALL_REQ | AWAITING_MANUF_CON; in manufacturer_req()
3462 plci->internal_command = BLOCK_PLCI; /* reject other req meanwhile */ in manufacturer_req()
3463 plci->command = 0; in manufacturer_req()
3469 plci->cr_enquiry = true; in manufacturer_req()
3471 add_ss(plci, FTY, &m_parms[1]); in manufacturer_req()
3472 sig_req(plci, req, 0); in manufacturer_req()
3473 send_req(plci); in manufacturer_req()
3476 if (plci->NL.Id && !plci->nl_remove_id) in manufacturer_req()
3478 if (plci->channels) in manufacturer_req()
3482 if ((a->ncci_plci[ncci] == plci->Id) && (a->ncci_state[ncci] == CONNECTED)) in manufacturer_req()
3485 cleanup_ncci_data(plci, ncci); in manufacturer_req()
3486 nl_req_ncci(plci, N_DISC, (byte)ncci); in manufacturer_req()
3490 mixer_remove(plci); in manufacturer_req()
3491 nl_req_ncci(plci, REMOVE, 0); in manufacturer_req()
3492 send_req(plci); in manufacturer_req()
3499 if (!plci) in manufacturer_req()
3505 plci->command = _MANUFACTURER_R; in manufacturer_req()
3506 plci->number = Number; in manufacturer_req()
3507 add_ss(plci, FTY, m); in manufacturer_req()
3508 sig_req(plci, SIG_CTRL, 0); in manufacturer_req()
3509 send_req(plci); in manufacturer_req()
3516 if (!plci) in manufacturer_req()
3522 plci->command = _MANUFACTURER_R; in manufacturer_req()
3523 plci->number = Number; in manufacturer_req()
3524 add_ss(plci, FTY, m); in manufacturer_req()
3525 sig_req(plci, DSP_CTRL, 0); in manufacturer_req()
3526 send_req(plci); in manufacturer_req()
3548 if (plci in manufacturer_req()
3555 if ((plci->tel != ADV_VOICE) || (plci != a->AdvSignalPLCI)) in manufacturer_req()
3567 if (plci->B1_facilities & B1_FACILITY_VOICE) in manufacturer_req()
3568 adv_voice_write_coefs(plci, ADV_VOICE_WRITE_UPDATE); in manufacturer_req()
3579 plci->dtmf_parameter_length = m->info[2] - 1; in manufacturer_req()
3580 if (plci->dtmf_parameter_length > m->length - 3) in manufacturer_req()
3581 plci->dtmf_parameter_length = (byte)(m->length - 3); in manufacturer_req()
3582 if (plci->dtmf_parameter_length > DTMF_PARAMETER_BUFFER_SIZE) in manufacturer_req()
3583 plci->dtmf_parameter_length = DTMF_PARAMETER_BUFFER_SIZE; in manufacturer_req()
3584 for (i = 0; i < plci->dtmf_parameter_length; i++) in manufacturer_req()
3585 plci->dtmf_parameter_buffer[i] = m->info[4 + i]; in manufacturer_req()
3586 if (plci->B1_facilities & B1_FACILITY_DTMFR) in manufacturer_req()
3587 dtmf_parameter_write(plci); in manufacturer_req()
3592 v_plci = plci; in manufacturer_req()
3640 PLCI *plci, APPL *appl, API_PARSE *msg) in manufacturer_res() argument
3664 if (!plci) in manufacturer_res()
3666 if (((plci->B3_prot != 4) && (plci->B3_prot != 5)) in manufacturer_res()
3667 || !(plci->ncpi_state & NCPI_NEGOTIATE_B3_SENT)) in manufacturer_res()
3679 if (plci->fax_connect_info_length < len) in manufacturer_res()
3681 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; in manufacturer_res()
3682 ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; in manufacturer_res()
3690 if (plci->fax_connect_info_length <= len) in manufacturer_res()
3691 plci->fax_connect_info_buffer[len] = 0; in manufacturer_res()
3692 len += 1 + plci->fax_connect_info_buffer[len]; in manufacturer_res()
3693 if (plci->fax_connect_info_length <= len) in manufacturer_res()
3694 plci->fax_connect_info_buffer[len] = 0; in manufacturer_res()
3695 len += 1 + plci->fax_connect_info_buffer[len]; in manufacturer_res()
3697 plci->nsf_control_bits = GET_WORD(&fax_parms[7].info[2]); in manufacturer_res()
3698 plci->fax_connect_info_buffer[len++] = (byte)(fax_parms[7].length); in manufacturer_res()
3700 plci->fax_connect_info_buffer[len++] = fax_parms[7].info[1 + i]; in manufacturer_res()
3702 plci->fax_connect_info_length = len; in manufacturer_res()
3703 plci->fax_edata_ack_length = plci->fax_connect_info_length; in manufacturer_res()
3704 start_internal_command(Id, plci, fax_edata_ack_command); in manufacturer_res()
3719 PLCI *plci; in callback() local
3732 plci = &(a->plci[e->user[1]]); in callback()
3761 channel_flow_control_remove(plci); in callback()
3764 if (a->FlowControlIdTable[i] == plci->nl_remove_id) in callback()
3767 plci->nl_remove_id = 0; in callback()
3768 if (plci->rx_dma_descriptor > 0) { in callback()
3769 diva_free_dma_descriptor(plci, plci->rx_dma_descriptor - 1); in callback()
3770 plci->rx_dma_descriptor = 0; in callback()
3779 a->ch_flow_plci[ch] = plci->Id; in callback()
3780 plci->nl_req = 0; in callback()
3799 plci->nl_req = 0; in callback()
3802 plci->nl_req = 0; in callback()
3804 if (plci->nl_req) in callback()
3805 control_rc(plci, 0, rc, ch, 0, true); in callback()
3810 channel_x_on(plci, ch); in callback()
3811 if (plci->internal_command) in callback()
3812 control_rc(plci, req, rc, ch, 0, true); in callback()
3816 if (plci->nl_global_req) in callback()
3818 global_req = plci->nl_global_req; in callback()
3819 plci->nl_global_req = 0; in callback()
3822 if (plci->rx_dma_descriptor > 0) { in callback()
3823 diva_free_dma_descriptor(plci, plci->rx_dma_descriptor - 1); in callback()
3824 plci->rx_dma_descriptor = 0; in callback()
3827 channel_xmit_xon(plci); in callback()
3828 control_rc(plci, 0, rc, ch, global_req, true); in callback()
3830 else if (plci->data_sent) in callback()
3832 channel_xmit_xon(plci); in callback()
3833 plci->data_sent = false; in callback()
3834 plci->NL.XNum = 1; in callback()
3835 data_rc(plci, ch); in callback()
3836 if (plci->internal_command) in callback()
3837 control_rc(plci, req, rc, ch, 0, true); in callback()
3841 channel_xmit_xon(plci); in callback()
3842 control_rc(plci, req, rc, ch, 0, true); in callback()
3861 plci->sig_remove_id = 0; in callback()
3863 plci->sig_req = 0; in callback()
3864 if (plci->sig_global_req) in callback()
3866 global_req = plci->sig_global_req; in callback()
3867 plci->sig_global_req = 0; in callback()
3870 channel_xmit_xon(plci); in callback()
3871 control_rc(plci, 0, rc, ch, global_req, false); in callback()
3875 channel_xmit_xon(plci); in callback()
3876 control_rc(plci, req, rc, ch, 0, false); in callback()
3885 channel_xmit_xon(plci); in callback()
3890 channel_xmit_xon(plci); in callback()
3897 (a->ch_flow_plci[Ch] == plci->Id)) { in callback()
3903 nl_ind(plci); in callback()
3905 (a->ch_flow_plci[Ch] == plci->Id) && in callback()
3911 sig_ind(plci); in callback()
3918 while (!plci->req_in in callback()
3919 && !plci->internal_command in callback()
3920 && (plci->msg_in_write_pos != plci->msg_in_read_pos)) in callback()
3922 j = (plci->msg_in_read_pos == plci->msg_in_wrap_pos) ? 0 : plci->msg_in_read_pos; in callback()
3924 i = (((CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[j]))->header.length + 3) & 0xfffc; in callback()
3926 m = (CAPI_MSG *)(&((byte *)(plci->msg_in_queue))[j]); in callback()
3927 appl = *((APPL **)(&((byte *)(plci->msg_in_queue))[j + i])); in callback()
3929 m->header.command, plci->msg_in_write_pos, plci->msg_in_read_pos, plci->msg_in_wrap_pos)); in callback()
3930 if (plci->msg_in_read_pos == plci->msg_in_wrap_pos) in callback()
3932 plci->msg_in_wrap_pos = MSG_IN_QUEUE_SIZE; in callback()
3933 plci->msg_in_read_pos = i + MSG_IN_OVERHEAD; in callback()
3937 plci->msg_in_read_pos = j + i + MSG_IN_OVERHEAD; in callback()
3939 if (plci->msg_in_read_pos == plci->msg_in_write_pos) in callback()
3941 plci->msg_in_write_pos = MSG_IN_QUEUE_SIZE; in callback()
3942 plci->msg_in_read_pos = MSG_IN_QUEUE_SIZE; in callback()
3944 else if (plci->msg_in_read_pos == plci->msg_in_wrap_pos) in callback()
3946 plci->msg_in_read_pos = MSG_IN_QUEUE_SIZE; in callback()
3947 plci->msg_in_wrap_pos = MSG_IN_QUEUE_SIZE; in callback()
3960 if (plci->li_notify_update) in callback()
3962 plci->li_notify_update = false; in callback()
3963 mixer_notify_update(plci, false); in callback()
3967 send_data(plci); in callback()
3968 send_req(plci); in callback()
3972 static void control_rc(PLCI *plci, byte req, byte rc, byte ch, byte global_req, in control_rc() argument
3987 if (!plci) { in control_rc()
3991 dbug(1, dprintf("req0_in/out=%d/%d", plci->req_in, plci->req_out)); in control_rc()
3992 if (plci->req_in != plci->req_out) in control_rc()
4001 plci->req_in = plci->req_in_start = plci->req_out = 0; in control_rc()
4004 appl = plci->appl; in control_rc()
4005 a = plci->adapter; in control_rc()
4009 Id = (((dword)(ncci ? ncci : ch)) << 16) | ((word)plci->Id << 8) | a->Id; in control_rc()
4010 if (plci->tel && plci->SuppState != CALL_HELD) Id |= EXT_CONTROLLER; in control_rc()
4011 Number = plci->number; in control_rc()
4012 …ntity=0x%x, command=0x%x, int_command=0x%x", Id, plci->Id, plci->tel, plci->Sig.Id, plci->command,… in control_rc()
4013 dbug(1, dprintf("channels=0x%x", plci->channels)); in control_rc()
4014 if (plci_remove_check(plci)) in control_rc()
4018 sig_req(plci, HANGUP, 0); in control_rc()
4019 sig_req(plci, REMOVE, 0); in control_rc()
4020 send_req(plci); in control_rc()
4022 if (plci->command) in control_rc()
4024 switch (plci->command) in control_rc()
4031 plci->SuppState = IDLE; in control_rc()
4042 plci->SuppState = CALL_HELD; in control_rc()
4056 if (plci->State == INC_DIS_PENDING) in control_rc()
4058 if (plci->Sig.Id != 0xff) in control_rc()
4065 plci_remove(plci); in control_rc()
4066 plci->State = IDLE; in control_rc()
4069 if (plci->State != LOCAL_CONNECT) plci->State = OUTG_CON_PENDING; in control_rc()
4078 plci_remove(plci); in control_rc()
4079 plci->State = IDLE; in control_rc()
4083 sendf(plci->appl, _CONNECT_ACTIVE_I, Id, 0, "sss", "", "", ""); in control_rc()
4084 plci->State = INC_ACT_PENDING; in control_rc()
4089 if (plci->State != INC_DIS_PENDING) in control_rc()
4090 plci->State = INC_CON_ACCEPT; in control_rc()
4094 if (plci->State == INC_DIS_PENDING) in control_rc()
4096 if (plci->Sig.Id != 0xff) in control_rc()
4098 plci->State = OUTG_DIS_PENDING; in control_rc()
4115 ncci = get_ncci(plci, ch, 0); in control_rc()
4117 plci->channels++; in control_rc()
4149 sendf(plci->appl, _CONNECT_R | CONFIRM, Id, Number, "w", Info); in control_rc()
4150 plci_remove(plci); in control_rc()
4153 sendf(plci->appl, _CONNECT_R | CONFIRM, Id, Number, "w", Info); in control_rc()
4159 plci->command = 0; in control_rc()
4161 else if (plci->internal_command) in control_rc()
4163 switch (plci->internal_command) in control_rc()
4173 plci_remove(plci); in control_rc()
4184 plci_remove(plci); in control_rc()
4194 switch (plci->internal_command) in control_rc()
4223 if (!plci->appl) break; in control_rc()
4232 sendf(plci->appl, _FACILITY_R | CONFIRM, Id & 0x7, in control_rc()
4233 plci->number, "wws", Info, (word)3, SSparms); in control_rc()
4234 if (Info) plci_remove(plci); in control_rc()
4239 if (!plci->relatedPTYPLCI) break; in control_rc()
4240 rplci = plci->relatedPTYPLCI; in control_rc()
4241 SSparms[1] = plci->ptyState; in control_rc()
4247 plci->relatedPTYPLCI = NULL; in control_rc()
4248 plci->ptyState = 0; in control_rc()
4253 plci->number, in control_rc()
4260 if (!plci->relatedPTYPLCI) break; in control_rc()
4261 rplci = plci->relatedPTYPLCI; in control_rc()
4268 plci->relatedPTYPLCI = NULL; in control_rc()
4269 plci->ptyState = 0; in control_rc()
4274 plci->number, in control_rc()
4284 plci_remove(plci); /* after codec init, internal codec commands pending */ in control_rc()
4294 plci_remove(plci); /* after codec init, internal codec commands pending */ in control_rc()
4303 plci->internal_command = PERM_COD_CONN_PEND; in control_rc()
4309 sig_req(plci, CALL_REQ, 0); in control_rc()
4310 send_req(plci); in control_rc()
4311 plci->internal_command = PERM_COD_CALL; in control_rc()
4327 plci_remove(plci); in control_rc()
4341 plci_remove(plci); in control_rc()
4346 if (plci->channels) in control_rc()
4351 cleanup_ncci_data(plci, ncci); in control_rc()
4352 nl_req_ncci(plci, N_DISC, (byte)ncci); in control_rc()
4359 if (plci->State == INC_DIS_PENDING) in control_rc()
4361 sig_req(plci, CALL_REQ, 0); in control_rc()
4362 send_req(plci); in control_rc()
4363 plci->State = OUTG_CON_PENDING; in control_rc()
4390 if (plci->internal_command == MWI_ACTIVATE_REQ_PEND) in control_rc()
4396 if (plci->cr_enquiry) in control_rc()
4398 sendf(plci->appl, in control_rc()
4401 plci->number, in control_rc()
4403 if (rc != OK) plci_remove(plci); in control_rc()
4407 sendf(plci->appl, in control_rc()
4410 plci->number, in control_rc()
4422 if ((plci->internal_command == CONF_ADD_REQ_PEND) && (!plci->relatedPTYPLCI)) break; in control_rc()
4423 rplci = plci; in control_rc()
4425 switch (plci->internal_command) in control_rc()
4432 rplci = plci->relatedPTYPLCI; in control_rc()
4452 plci->relatedPTYPLCI = NULL; in control_rc()
4453 plci->ptyState = 0; in control_rc()
4458 plci->number, in control_rc()
4465 if (plci->relatedPTYPLCI) in control_rc()
4467 plci->relatedPTYPLCI->vswitchstate = 0; in control_rc()
4468 plci->relatedPTYPLCI->vsprot = 0; in control_rc()
4469 plci->relatedPTYPLCI->vsprotdialect = 0; in control_rc()
4471 plci->vswitchstate = 0; in control_rc()
4472 plci->vsprot = 0; in control_rc()
4473 plci->vsprotdialect = 0; in control_rc()
4477 if (plci->relatedPTYPLCI && in control_rc()
4478 plci->vswitchstate == 1 && in control_rc()
4479 plci->relatedPTYPLCI->vswitchstate == 3) /* join complete */ in control_rc()
4480 plci->vswitchstate = 3; in control_rc()
4490 plci->appl->CDEnable = 0; in control_rc()
4492 sendf(plci->appl, _FACILITY_R | CONFIRM, Id, in control_rc()
4493 plci->number, "wws", Info, (word)3, SSparms); in control_rc()
4499 ncci = get_ncci(plci, ch, 0); in control_rc()
4501 plci->channels++; in control_rc()
4507 if (plci->internal_command_queue[0]) in control_rc()
4509 (*(plci->internal_command_queue[0]))(Id, plci, rc); in control_rc()
4510 if (plci->internal_command) in control_rc()
4515 next_internal_command(Id, plci); in control_rc()
4520 Id = ((word)plci->Id << 8) | plci->adapter->Id; in control_rc()
4521 if (plci->tel) Id |= EXT_CONTROLLER; in control_rc()
4523 switch (plci->internal_command) in control_rc()
4537 plci->internal_command = 0; in control_rc()
4538 sig_req(plci, REMOVE, 0); in control_rc()
4539 send_req(plci); in control_rc()
4558 plci->number, "wws", Info, (word)3, SSparms); in control_rc()
4563 plci->internal_command = 0; in control_rc()
4570 plci->internal_command = PERM_COD_CONN_PEND; in control_rc()
4576 plci->internal_command = 0; in control_rc()
4578 plci->internal_command = PERM_COD_CALL; in control_rc()
4579 sig_req(plci, CALL_REQ, 0); in control_rc()
4580 send_req(plci); in control_rc()
4586 plci->internal_command = 0; in control_rc()
4587 dbug(1, dprintf("ListenCheck, new SIG_ID = 0x%x", plci->Sig.Id)); in control_rc()
4588 add_p(plci, ESC, "\x02\x18\x00"); /* support call waiting */ in control_rc()
4589 sig_req(plci, INDICATE_REQ, 0); in control_rc()
4590 send_req(plci); in control_rc()
4596 plci_remove(plci); in control_rc()
4597 plci->State = IDLE; in control_rc()
4606 sig_req(plci, LAW_REQ, 0); in control_rc()
4607 send_req(plci); in control_rc()
4614 plci->internal_command = 0; in control_rc()
4623 plci->internal_command = 0; in control_rc()
4629 plci->internal_command = 0; in control_rc()
4630 sig_req(plci, REMOVE, 0); in control_rc()
4631 send_req(plci); in control_rc()
4636 plci_remove_check(plci); in control_rc()
4640 static void data_rc(PLCI *plci, byte ch) in data_rc() argument
4648 if (plci->appl) in data_rc()
4650 TransmitBufferFree(plci->appl, plci->data_sent_ptr); in data_rc()
4651 a = plci->adapter; in data_rc()
4653 if (ncci && (a->ncci_plci[ncci] == plci->Id)) in data_rc()
4662 Id = (((dword)ncci) << 16) | ((word)plci->Id << 8) | a->Id; in data_rc()
4663 if (plci->tel) Id |= EXT_CONTROLLER; in data_rc()
4664 sendf(plci->appl, _DATA_B3_R | CONFIRM, Id, data->Number, in data_rc()
4676 static void data_ack(PLCI *plci, byte ch) in data_ack() argument
4683 a = plci->adapter; in data_ack()
4688 if (a->ncci_state[ncci] && (a->ncci_plci[ncci] == plci->Id)) in data_ack()
4690 Id = (((dword)ncci) << 16) | ((word)plci->Id << 8) | a->Id; in data_ack()
4691 if (plci->tel) Id |= EXT_CONTROLLER; in data_ack()
4692 sendf(plci->appl, _DATA_B3_R | CONFIRM, Id, ncci_ptr->DataAck[ncci_ptr->data_ack_out].Number, in data_ack()
4702 static void sig_ind(PLCI *plci) in sig_ind() argument
4765 a = plci->adapter; in sig_ind()
4766 Id = ((word)plci->Id << 8) | a->Id; in sig_ind()
4769 if (plci->sig_remove_id) in sig_ind()
4771 plci->Sig.RNR = 2; /* discard */ in sig_ind()
4775 if (plci->tel && plci->SuppState != CALL_HELD) Id |= EXT_CONTROLLER; in sig_ind()
4777 Id, plci->Id, plci->tel, plci->State, plci->channels, plci->hangup_flow_ctrl_timer)); in sig_ind()
4778 if (plci->Sig.Ind == CALL_HOLD_ACK && plci->channels) in sig_ind()
4780 plci->Sig.RNR = 1; in sig_ind()
4783 if (plci->Sig.Ind == HANGUP && plci->channels) in sig_ind()
4785 plci->Sig.RNR = 1; in sig_ind()
4786 plci->hangup_flow_ctrl_timer++; in sig_ind()
4788 if (plci->hangup_flow_ctrl_timer == 100) in sig_ind()
4791 plci->Sig.RNR = 0; in sig_ind()
4792 plci->hangup_flow_ctrl_timer = 0; in sig_ind()
4795 if (a->ncci_plci[ncci] == plci->Id) in sig_ind()
4797 cleanup_ncci_data(plci, ncci); in sig_ind()
4798 if (plci->channels)plci->channels--; in sig_ind()
4799 if (plci->appl) in sig_ind()
4800 sendf(plci->appl, _DISCONNECT_B3_I, (((dword) ncci) << 16) | Id, 0, "ws", 0, ""); in sig_ind()
4803 if (plci->appl) in sig_ind()
4804 sendf(plci->appl, _DISCONNECT_I, Id, 0, "w", 0); in sig_ind()
4805 plci_remove(plci); in sig_ind()
4806 plci->State = IDLE; in sig_ind()
4814 IndParse(plci, multi_fac_id, multi_fac_parms, MAX_MULTI_IE); in sig_ind()
4815 IndParse(plci, multi_pi_id, multi_pi_parms, MAX_MULTI_IE); in sig_ind()
4816 IndParse(plci, multi_ssext_id, multi_ssext_parms, MAX_MULTI_IE); in sig_ind()
4818 IndParse(plci, multi_vswitch_id, multi_vswitch_parms, MAX_MULTI_IE); in sig_ind()
4820 IndParse(plci, parms_id, parms, 0); in sig_ind()
4821 IndParse(plci, multi_CiPN_id, multi_CiPN_parms, MAX_MULTI_IE); in sig_ind()
4827 if (esc_cr[0] && plci) in sig_ind()
4829 if (plci->cr_enquiry && plci->appl) in sig_ind()
4831 plci->cr_enquiry = false; in sig_ind()
4841 sendf(plci->appl, in sig_ind()
4845 "dwbbbbSbS", _DI_MANU_ID, plci->m_command, in sig_ind()
4846 …2 + 1 + 1 + esc_cr[0] + 1 + 1 + esc_law[0], plci->Sig.Ind, 1 + 1 + esc_cr[0] + 1 + 1 + esc_law[0],… in sig_ind()
4869 if (plci == a->automatic_lawPLCI) { in sig_ind()
4870 plci->internal_command = 0; in sig_ind()
4871 sig_req(plci, REMOVE, 0); in sig_ind()
4872 send_req(plci); in sig_ind()
4961 if (plci != a->AdvCodecPLCI) in sig_ind()
4963 force_mt_info = SendMultiIE(plci, Id, multi_fac_parms, FTY, 0x20, 0); in sig_ind()
4964 force_mt_info |= SendMultiIE(plci, Id, multi_pi_parms, PI, 0x210, 0); in sig_ind()
4965 SendSSExtInd(NULL, plci, Id, multi_ssext_parms); in sig_ind()
4966 SendInfo(plci, Id, parms, force_mt_info); in sig_ind()
4968 VSwitchReqInd(plci, Id, multi_vswitch_parms); in sig_ind()
4973 if (esc_chi[0] && plci && !plci->SuppState) { in sig_ind()
4974 plci->b_channel = esc_chi[esc_chi[0]]&0x1f; in sig_ind()
4975 mixer_set_bchannel_id_esc(plci, plci->b_channel); in sig_ind()
4976 dbug(1, dprintf("storeChannel=0x%x", plci->b_channel)); in sig_ind()
4977 if (plci->tel == ADV_VOICE && plci->appl) { in sig_ind()
4982 if (plci->appl) plci->appl->Number++; in sig_ind()
4984 switch (plci->Sig.Ind) { in sig_ind()
4988 if (!plci->appl) break; in sig_ind()
4999 sendf(plci->appl, _FACILITY_R | CONFIRM, Id & 0x7, plci->number, "wws", 0, 3, CF_Ind); in sig_ind()
5000 plci_remove(plci); in sig_ind()
5012 if (!plci->relatedPTYPLCI) break; in sig_ind()
5013 tplci = plci->relatedPTYPLCI; in sig_ind()
5020 plci->vswitchstate = 0; in sig_ind()
5021 plci->relatedPTYPLCI->vswitchstate = 0; in sig_ind()
5036 plci->relatedPTYPLCI = NULL; in sig_ind()
5037 plci->ptyState = 0; in sig_ind()
5070 if (!plci->appl) break; in sig_ind()
5126 PUT_DWORD(&Interr_Err_Ind[6], plci->appl->S_Handle); in sig_ind()
5127 sendf(plci->appl, _FACILITY_I, Id & 0x7, 0, "ws", 3, Interr_Err_Ind); in sig_ind()
5128 plci_remove(plci); in sig_ind()
5147 if (plci->cr_enquiry) in sig_ind()
5149 sendf(plci->appl, _FACILITY_I, Id & 0xf, 0, "ws", 3, SS_Ind); in sig_ind()
5150 plci_remove(plci); in sig_ind()
5154 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, SS_Ind); in sig_ind()
5168 plci->ptyState = 0; in sig_ind()
5174 plci->ptyState = CONNECTED; in sig_ind()
5180 plci->ptyState = CONNECTED; in sig_ind()
5186 plci->ptyState = CONNECTED; in sig_ind()
5190 plci->relatedPTYPLCI = NULL; in sig_ind()
5191 tplci = plci->relatedPTYPLCI; in sig_ind()
5193 plci->ptyState = CONNECTED; in sig_ind()
5208 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, CONF_Ind); in sig_ind()
5222 if (!plci->relatedPTYPLCI) break; in sig_ind()
5223 tplci = plci->relatedPTYPLCI; in sig_ind()
5230 if (plci->vswitchstate != 3) in sig_ind()
5233 plci->ptyState = IDLE; in sig_ind()
5234 plci->relatedPTYPLCI = NULL; in sig_ind()
5235 plci->ptyState = 0; in sig_ind()
5247 switch (plci->ptyState) in sig_ind()
5250 plci->ptyState = CONNECTED; in sig_ind()
5255 plci->ptyState = IDLE; in sig_ind()
5256 plci->relatedPTYPLCI = NULL; in sig_ind()
5257 plci->ptyState = 0; in sig_ind()
5280 if (!plci->appl) break; in sig_ind()
5282 PUT_DWORD(&CF_Ind[6], plci->appl->S_Handle); in sig_ind()
5283 sendf(plci->appl, _FACILITY_I, Id & 0x7, 0, "ws", 3, CF_Ind); in sig_ind()
5284 plci_remove(plci); in sig_ind()
5294 if (!plci->appl) break; in sig_ind()
5326 PUT_DWORD(&pty_cai[6], plci->appl->S_Handle); in sig_ind()
5327 sendf(plci->appl, _FACILITY_I, Id & 0x7, 0, "wS", 3, pty_cai); in sig_ind()
5328 plci_remove(plci); in sig_ind()
5338 if (plci->cr_enquiry) in sig_ind()
5340 sendf(plci->appl, _FACILITY_I, Id & 0xf, 0, "ws", 3, SS_Ind); in sig_ind()
5341 plci_remove(plci); in sig_ind()
5345 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, SS_Ind); in sig_ind()
5354 if (plci->appl && (a->Notification_Mask[plci->appl->Id - 1] & SMASK_MWI)) in sig_ind()
5356 if (plci->internal_command == GET_MWI_STATE) /* result on Message Waiting Listen */ in sig_ind()
5358 sendf(plci->appl, _FACILITY_I, Id & 0xf, 0, "wS", 3, &pty_cai[2]); in sig_ind()
5359 plci_remove(plci); in sig_ind()
5362 else sendf(plci->appl, _FACILITY_I, Id, 0, "wS", 3, &pty_cai[2]); in sig_ind()
5390 add_p(plci, CAI, facility); in sig_ind()
5391 add_p(plci, ESC, multi_ssext_parms[0]); /* remembered parameter -> only one possible */ in sig_ind()
5392 sig_req(plci, S_SERVICE, 0); in sig_ind()
5393 send_req(plci); in sig_ind()
5394 plci->command = 0; in sig_ind()
5395 next_internal_command(Id, plci); in sig_ind()
5438 tplci = plci->relatedPTYPLCI; in sig_ind()
5449 plci->ptyState = CONNECTED; in sig_ind()
5450 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, CONF_Ind); in sig_ind()
5476 if (plci->appl && (a->Notification_Mask[plci->appl->Id - 1] & SMASK_CCBS)) in sig_ind()
5478 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, CONF_Ind); in sig_ind()
5502 if (plci->SuppState == HOLD_REQUEST) in sig_ind()
5504 plci->SuppState = IDLE; in sig_ind()
5505 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, SS_Ind); in sig_ind()
5510 if (plci->SuppState == HOLD_REQUEST) in sig_ind()
5512 plci->SuppState = CALL_HELD; in sig_ind()
5513 CodecIdCheck(a, plci); in sig_ind()
5514 start_internal_command(Id, plci, hold_save_command); in sig_ind()
5531 if (plci->SuppState == RETRIEVE_REQUEST) in sig_ind()
5533 plci->SuppState = CALL_HELD; in sig_ind()
5534 CodecIdCheck(a, plci); in sig_ind()
5535 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, SS_Ind); in sig_ind()
5541 if (plci->SuppState == RETRIEVE_REQUEST) in sig_ind()
5543 plci->SuppState = IDLE; in sig_ind()
5544 plci->call_dir |= CALL_DIR_FORCE_OUTG_NL; in sig_ind()
5545 plci->b_channel = esc_chi[esc_chi[0]]&0x1f; in sig_ind()
5546 if (plci->tel) in sig_ind()
5548 mixer_set_bchannel_id_esc(plci, plci->b_channel); in sig_ind()
5549 dbug(1, dprintf("RetrChannel=0x%x", plci->b_channel)); in sig_ind()
5551 if (plci->B2_prot == B2_TRANSPARENT && plci->B3_prot == B3_TRANSPARENT) in sig_ind()
5554 start_internal_command(Id, plci, retrieve_restore_command); in sig_ind()
5557 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", 3, SS_Ind); in sig_ind()
5560 start_internal_command(Id, plci, retrieve_restore_command); in sig_ind()
5565 if (plci->State != LISTENING) { in sig_ind()
5566 sig_req(plci, HANGUP, 0); in sig_ind()
5567 send_req(plci); in sig_ind()
5573 bitmap_zero(plci->c_ind_mask_table, MAX_APPL); in sig_ind()
5576 group_optimization(a, plci); in sig_ind()
5577 for_each_set_bit(i, plci->group_optimization_mask_table, max_appl) { in sig_ind()
5582 __set_bit(i, plci->c_ind_mask_table); in sig_ind()
5583 dbug(1, dprintf("c_ind_mask =%*pb", MAX_APPL, plci->c_ind_mask_table)); in sig_ind()
5584 plci->State = INC_CON_PENDING; in sig_ind()
5585 plci->call_dir = (plci->call_dir & ~(CALL_DIR_OUT | CALL_DIR_ORIGINATE)) | in sig_ind()
5588 plci->b_channel = esc_chi[esc_chi[0]] & 0x1f; in sig_ind()
5589 mixer_set_bchannel_id_esc(plci, plci->b_channel); in sig_ind()
5595 plci->tel = ADV_VOICE; in sig_ind()
5597 plci->tel = CODEC; in sig_ind()
5598 if (plci->tel) Id |= EXT_CONTROLLER; in sig_ind()
5599 a->codec_listen[i] = plci; in sig_ind()
5619 plci, in sig_ind()
5623 plci, in sig_ind()
5626 SendMultiIE(plci, Id, multi_pi_parms, PI, 0x210, true)); in sig_ind()
5629 dbug(1, dprintf("c_ind_mask =%*pb", MAX_APPL, plci->c_ind_mask_table)); in sig_ind()
5631 if (bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) { in sig_ind()
5632 sig_req(plci, HANGUP, 0); in sig_ind()
5633 send_req(plci); in sig_ind()
5634 plci->State = IDLE; in sig_ind()
5636 plci->notifiedcall = 0; in sig_ind()
5642 plci->notifiedcall = 1; in sig_ind()
5648 if (plci->State == ADVANCED_VOICE_SIG || plci->State == ADVANCED_VOICE_NOSIG) in sig_ind()
5650 if (plci->internal_command == PERM_COD_CONN_PEND) in sig_ind()
5652 if (plci->State == ADVANCED_VOICE_NOSIG) in sig_ind()
5742 next_internal_command(Id, plci); in sig_ind()
5746 plci->internal_command = PERM_COD_HOOK; in sig_ind()
5747 add_p(plci, FTY, "\x01\x09"); /* Get Hook State*/ in sig_ind()
5748 sig_req(plci, TEL_CTRL, 0); in sig_ind()
5749 send_req(plci); in sig_ind()
5752 else if (plci->command != _MANUFACTURER_R /* old style permanent connect */ in sig_ind()
5753 && plci->State != INC_ACT_PENDING) in sig_ind()
5755 mixer_set_bchannel_id_esc(plci, plci->b_channel); in sig_ind()
5756 …if (plci->tel == ADV_VOICE && plci->SuppState == IDLE) /* with permanent codec switch on immediate… in sig_ind()
5758 chi[2] = plci->b_channel; in sig_ind()
5761 sendf(plci->appl, _CONNECT_ACTIVE_I, Id, 0, "Sss", parms[21], "", ""); in sig_ind()
5762 plci->State = INC_ACT_PENDING; in sig_ind()
5768 if (plci->State == ADVANCED_VOICE_SIG && ie[0]) { in sig_ind()
5772 if (plci->internal_command == PERM_COD_HOOK) in sig_ind()
5775 plci->hook_state = ie[1]; in sig_ind()
5776 next_internal_command(Id, plci); in sig_ind()
5781 if (((plci->hook_state) & 0xf0) == 0x80) in sig_ind()
5786 plci->hook_state = ie[1]&0x91; in sig_ind()
5804 a->AdvSignalPLCI = &a->plci[i - 1]; in sig_ind()
5840 if (plci->internal_command == PERM_COD_HOOK) in sig_ind()
5843 plci->hook_state = ie[1] & 0x91; in sig_ind()
5844 next_internal_command(Id, plci); in sig_ind()
5849 if (((plci->hook_state) & 0xf0) == 0x90) break; in sig_ind()
5850 plci->hook_state = ie[1] & 0x91; in sig_ind()
5855 if (plci->tel) Id |= EXT_CONTROLLER; in sig_ind()
5872 __clear_bit(plci->appl->Id - 1, plci->c_ind_mask_table); in sig_ind()
5874 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", (word)3, resume_cau); in sig_ind()
5878 bitmap_zero(plci->c_ind_mask_table, MAX_APPL); in sig_ind()
5880 if (plci->NL.Id && !plci->nl_remove_id) { in sig_ind()
5881 mixer_remove(plci); in sig_ind()
5882 nl_req_ncci(plci, REMOVE, 0); in sig_ind()
5884 if (!plci->sig_remove_id) { in sig_ind()
5885 plci->internal_command = 0; in sig_ind()
5886 sig_req(plci, REMOVE, 0); in sig_ind()
5888 send_req(plci); in sig_ind()
5889 if (!plci->channels) { in sig_ind()
5890 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", (word)3, "\x05\x04\x00\x02\x00\x00"); in sig_ind()
5891 sendf(plci->appl, _DISCONNECT_I, Id, 0, "w", 0); in sig_ind()
5899 plci->hangup_flow_ctrl_timer = 0; in sig_ind()
5900 if (plci->manufacturer && plci->State == LOCAL_CONNECT) break; in sig_ind()
5913 if (plci->State == INC_CON_PENDING || plci->State == INC_CON_ALERT) in sig_ind()
5915 for_each_set_bit(i, plci->c_ind_mask_table, max_appl) in sig_ind()
5920 bitmap_zero(plci->c_ind_mask_table, MAX_APPL); in sig_ind()
5922 if (!plci->appl) in sig_ind()
5924 if (plci->State == LISTENING) in sig_ind()
5926 plci->notifiedcall = 0; in sig_ind()
5929 plci->State = INC_DIS_PENDING; in sig_ind()
5930 if (bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) in sig_ind()
5932 plci->State = IDLE; in sig_ind()
5933 if (plci->NL.Id && !plci->nl_remove_id) in sig_ind()
5935 mixer_remove(plci); in sig_ind()
5936 nl_req_ncci(plci, REMOVE, 0); in sig_ind()
5938 if (!plci->sig_remove_id) in sig_ind()
5940 plci->internal_command = 0; in sig_ind()
5941 sig_req(plci, REMOVE, 0); in sig_ind()
5943 send_req(plci); in sig_ind()
5951 if (plci->State != IDLE && plci->State != INC_DIS_PENDING) in sig_ind()
5953 if (plci->State == RESUMING) in sig_ind()
5956 sendf(plci->appl, _FACILITY_I, Id, 0, "ws", (word)3, resume_cau); in sig_ind()
5958 plci->State = INC_DIS_PENDING; in sig_ind()
5959 sendf(plci->appl, _DISCONNECT_I, Id, 0, "w", i); in sig_ind()
5965 SendSSExtInd(NULL, plci, Id, multi_ssext_parms); in sig_ind()
5969 VSwitchReqInd(plci, Id, multi_vswitch_parms); in sig_ind()
5972 if (plci->relatedPTYPLCI && in sig_ind()
5973 plci->vswitchstate == 3 && in sig_ind()
5974 plci->relatedPTYPLCI->vswitchstate == 3 && in sig_ind()
5977 add_p(plci->relatedPTYPLCI, SMSG, parms[MAXPARMSIDS - 1]); in sig_ind()
5978 sig_req(plci->relatedPTYPLCI, VSWITCH_REQ, 0); in sig_ind()
5979 send_req(plci->relatedPTYPLCI); in sig_ind()
5981 else VSwitchReqInd(plci, Id, multi_vswitch_parms); in sig_ind()
5988 static void SendSetupInfo(APPL *appl, PLCI *plci, dword Id, byte **parms, byte Info_Sent_Flag) in SendSetupInfo() argument
6021 mixer_set_bchannel_id(plci, Info_Element); in SendSetupInfo()
6054 if (plci->adapter->Info_Mask[appl->Id - 1] & Info_Mask) { in SendSetupInfo()
6062 static void SendInfo(PLCI *plci, dword Id, byte **parms, byte iesent) in SendInfo() argument
6078 !plci->appl in SendInfo()
6079 && !plci->State in SendInfo()
6080 && plci->Sig.Ind != NCR_FACILITY in SendInfo()
6149 mixer_set_bchannel_id(plci, Info_Element); in SendInfo()
6193 if (plci->Sig.Ind == NCR_FACILITY) /* check controller broadcast */ in SendInfo()
6200 && plci->adapter->Info_Mask[appl->Id - 1] & Info_Mask) in SendInfo()
6208 else if (!plci->appl) in SendInfo()
6216 for_each_set_bit(j, plci->c_ind_mask_table, max_appl) { in SendInfo()
6224 && plci->adapter->Info_Mask[plci->appl->Id - 1] & Info_Mask) in SendInfo()
6228 sendf(plci->appl, _INFO_I, Id, 0, "wS", Info_Number, Info_Element); in SendInfo()
6234 static byte SendMultiIE(PLCI *plci, dword Id, byte **parms, byte ie_type, in SendMultiIE() argument
6247 !plci->appl in SendMultiIE()
6248 && !plci->State in SendMultiIE()
6249 && plci->Sig.Ind != NCR_FACILITY in SendMultiIE()
6265 dbug(1, dprintf("[Ind0x%x]:IE=0x%x", plci->Sig.Ind, ie_type)); in SendMultiIE()
6270 if (plci->Sig.Ind == NCR_FACILITY) /* check controller broadcast */ in SendMultiIE()
6277 && plci->adapter->Info_Mask[appl->Id - 1] & Info_Mask) in SendMultiIE()
6285 else if (!plci->appl && Info_Number) in SendMultiIE()
6287 for_each_set_bit(j, plci->c_ind_mask_table, max_appl) { in SendMultiIE()
6294 && plci->adapter->Info_Mask[plci->appl->Id - 1] & Info_Mask) in SendMultiIE()
6298 sendf(plci->appl, _INFO_I, Id, 0, "wS", Info_Number, Info_Element); in SendMultiIE()
6304 static void SendSSExtInd(APPL *appl, PLCI *plci, dword Id, byte **parms) in SendSSExtInd() argument
6316 plci in SendSSExtInd()
6317 && plci->State in SendSSExtInd()
6318 && plci->Sig.Ind != NCR_FACILITY in SendSSExtInd()
6336 else if (plci->appl) in SendSSExtInd()
6339 sendf(plci->appl, _MANUFACTURER_I, in SendSSExtInd()
6350 static void nl_ind(PLCI *plci) in nl_ind() argument
6431 ch = plci->NL.IndCh; in nl_ind()
6432 a = plci->adapter; in nl_ind()
6434 Id = (((dword)(ncci ? ncci : ch)) << 16) | (((word) plci->Id) << 8) | a->Id; in nl_ind()
6435 if (plci->tel) Id |= EXT_CONTROLLER; in nl_ind()
6436 APPLptr = plci->appl; in nl_ind()
6438 plci->NL.Id, Id, plci->Id, plci->tel, plci->State, ch, plci->channels, plci->NL.Ind & 0x0f)); in nl_ind()
6442 if (plci->nl_remove_id) in nl_ind()
6444 plci->NL.RNR = 2; /* discard */ in nl_ind()
6448 if ((plci->NL.Ind & 0x0f) == N_CONNECT) in nl_ind()
6450 if (plci->State == INC_DIS_PENDING in nl_ind()
6451 || plci->State == OUTG_DIS_PENDING in nl_ind()
6452 || plci->State == IDLE) in nl_ind()
6454 plci->NL.RNR = 2; /* discard */ in nl_ind()
6458 if (plci->State < INC_ACT_PENDING) in nl_ind()
6460 plci->NL.RNR = 1; /* flow control */ in nl_ind()
6461 channel_x_off(plci, ch, N_XON_CONNECT_IND); in nl_ind()
6469 plci->NL.RNR = 2; in nl_ind()
6473 if (((plci->NL.Ind & 0x0f) == N_UDATA) in nl_ind()
6474 && (((plci->B2_prot != B2_SDLC) && ((plci->B1_resource == 17) || (plci->B1_resource == 18))) in nl_ind()
6475 || (plci->B2_prot == 7) in nl_ind()
6476 || (plci->B3_prot == 7))) in nl_ind()
6478 plci->ncpi_buffer[0] = 0; in nl_ind()
6480 ncpi_state = plci->ncpi_state; in nl_ind()
6481 if (plci->NL.complete == 1) in nl_ind()
6483 byte *data = &plci->NL.RBuffer->P[0]; in nl_ind()
6485 if ((plci->NL.RBuffer->length >= 12) in nl_ind()
6493 plci->ncpi_state |= NCPI_MDM_DCD_ON_RECEIVED; in nl_ind()
6495 plci->ncpi_state |= NCPI_MDM_CTS_ON_RECEIVED; in nl_ind()
6505 PUT_WORD(&(plci->ncpi_buffer[1]), (word)(GET_DWORD(data) & 0x0000FFFF)); in nl_ind()
6523 PUT_WORD(&(plci->ncpi_buffer[3]), ncpi_opt); in nl_ind()
6524 plci->ncpi_buffer[0] = 4; in nl_ind()
6526 …plci->ncpi_state |= NCPI_VALID_CONNECT_B3_IND | NCPI_VALID_CONNECT_B3_ACT | NCPI_VALID_DISC_B3_IND; in nl_ind()
6529 if (plci->B3_prot == 7) in nl_ind()
6532 && (plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in nl_ind()
6533 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in nl_ind()
6536 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6537 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in nl_ind()
6541 …if (!((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_t… in nl_ind()
6547 plci->NL.RNR = 2; in nl_ind()
6552 if (plci->NL.complete == 2) in nl_ind()
6554 if (((plci->NL.Ind & 0x0f) == N_UDATA) in nl_ind()
6555 && !(udata_forwarding_table[plci->RData[0].P[0] >> 5] & (1L << (plci->RData[0].P[0] & 0x1f)))) in nl_ind()
6557 switch (plci->RData[0].P[0]) in nl_ind()
6561 if (plci->dtmf_rec_active & DTMF_LISTEN_ACTIVE_FLAG) in nl_ind()
6562 sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, "ws", SELECTOR_DTMF, "\x01X"); in nl_ind()
6565 if (plci->dtmf_rec_active & DTMF_LISTEN_ACTIVE_FLAG) in nl_ind()
6566 sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, "ws", SELECTOR_DTMF, "\x01Y"); in nl_ind()
6569 dtmf_indication(Id, plci, plci->RData[0].P, plci->RData[0].PLength); in nl_ind()
6572 dtmf_confirmation(Id, plci); in nl_ind()
6577 …capidtmf_recv_process_block(&(plci->capidtmf_state), plci->RData[0].P + 1, (word)(plci->RData[0].P… in nl_ind()
6578 i = capidtmf_indication(&(plci->capidtmf_state), dtmf_code_buffer + 1); in nl_ind()
6582 dtmf_indication(Id, plci, dtmf_code_buffer, (word)(i + 1)); in nl_ind()
6588 mixer_indication_coefs_set(Id, plci); in nl_ind()
6591 mixer_indication_xconnect_from(Id, plci, plci->RData[0].P, plci->RData[0].PLength); in nl_ind()
6594 mixer_indication_xconnect_to(Id, plci, plci->RData[0].P, plci->RData[0].PLength); in nl_ind()
6599 ec_indication(Id, plci, plci->RData[0].P, plci->RData[0].PLength); in nl_ind()
6610 if ((plci->RData[0].PLength != 0) in nl_ind()
6611 && ((plci->B2_prot == B2_V120_ASYNC) in nl_ind()
6612 || (plci->B2_prot == B2_V120_ASYNC_V42BIS) in nl_ind()
6613 || (plci->B2_prot == B2_V120_BIT_TRANSPARENT))) in nl_ind()
6616 sendf(plci->appl, _DATA_B3_I, Id, 0, in nl_ind()
6618 plci->RData[1].P, in nl_ind()
6619 (plci->NL.RNum < 2) ? 0 : plci->RData[1].PLength, in nl_ind()
6620 plci->RNum, in nl_ind()
6621 plci->RFlags); in nl_ind()
6627 sendf(plci->appl, _DATA_B3_I, Id, 0, in nl_ind()
6629 plci->RData[0].P, in nl_ind()
6630 plci->RData[0].PLength, in nl_ind()
6631 plci->RNum, in nl_ind()
6632 plci->RFlags); in nl_ind()
6640 if ((plci->NL.Ind & 0x0f) == N_CONNECT || in nl_ind()
6641 (plci->NL.Ind & 0x0f) == N_CONNECT_ACK || in nl_ind()
6642 (plci->NL.Ind & 0x0f) == N_DISC || in nl_ind()
6643 (plci->NL.Ind & 0x0f) == N_EDATA || in nl_ind()
6644 (plci->NL.Ind & 0x0f) == N_DISC_ACK) in nl_ind()
6647 plci->ncpi_buffer[0] = 0; in nl_ind()
6648 switch (plci->B3_prot) { in nl_ind()
6654 for (i = 0; i < plci->NL.RLength; i++) plci->ncpi_buffer[4 + i] = plci->NL.RBuffer->P[i]; in nl_ind()
6655 plci->ncpi_buffer[0] = (byte)(i + 3); in nl_ind()
6656 plci->ncpi_buffer[1] = (byte)(plci->NL.Ind & N_D_BIT ? 1 : 0); in nl_ind()
6657 plci->ncpi_buffer[2] = 0; in nl_ind()
6658 plci->ncpi_buffer[3] = 0; in nl_ind()
6662 if (plci->NL.RLength >= sizeof(T30_INFO)) in nl_ind()
6664 dbug(1, dprintf("FaxStatus %04x", ((T30_INFO *)plci->NL.RBuffer->P)->code)); in nl_ind()
6666 PUT_WORD(&(plci->ncpi_buffer[1]), ((T30_INFO *)plci->NL.RBuffer->P)->rate_div_2400 * 2400); in nl_ind()
6667 fax_feature_bits = GET_WORD(&((T30_INFO *)plci->NL.RBuffer->P)->feature_bits_low); in nl_ind()
6668 …i = (((T30_INFO *)plci->NL.RBuffer->P)->resolution & T30_RESOLUTION_R8_0770_OR_200) ? 0x0001 : 0x0… in nl_ind()
6669 if (plci->B3_prot == 5) in nl_ind()
6683 PUT_WORD(&(plci->ncpi_buffer[3]), i); in nl_ind()
6684 PUT_WORD(&(plci->ncpi_buffer[5]), ((T30_INFO *)plci->NL.RBuffer->P)->data_format); in nl_ind()
6685 plci->ncpi_buffer[7] = ((T30_INFO *)plci->NL.RBuffer->P)->pages_low; in nl_ind()
6686 plci->ncpi_buffer[8] = ((T30_INFO *)plci->NL.RBuffer->P)->pages_high; in nl_ind()
6687 plci->ncpi_buffer[len] = 0; in nl_ind()
6688 if (((T30_INFO *)plci->NL.RBuffer->P)->station_id_len) in nl_ind()
6690 plci->ncpi_buffer[len] = 20; in nl_ind()
6692 plci->ncpi_buffer[++len] = ((T30_INFO *)plci->NL.RBuffer->P)->station_id[i]; in nl_ind()
6694 if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK)) in nl_ind()
6696 if (((T30_INFO *)plci->NL.RBuffer->P)->code < ARRAY_SIZE(fax_info)) in nl_ind()
6697 info = fax_info[((T30_INFO *)plci->NL.RBuffer->P)->code]; in nl_ind()
6702 …if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->app… in nl_ind()
6705 …i = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + ((T30_INFO *)plci->NL.RBuffer->P)… in nl_ind()
6706 while (i < plci->NL.RBuffer->length) in nl_ind()
6707 plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++]; in nl_ind()
6710 plci->ncpi_buffer[0] = len; in nl_ind()
6711 fax_feature_bits = GET_WORD(&((T30_INFO *)plci->NL.RBuffer->P)->feature_bits_low); in nl_ind()
6712 PUT_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->feature_bits_low, fax_feature_bits); in nl_ind()
6714 plci->ncpi_state |= NCPI_VALID_CONNECT_B3_IND; in nl_ind()
6715 if (((plci->NL.Ind & 0x0f) == N_CONNECT_ACK) in nl_ind()
6716 || (((plci->NL.Ind & 0x0f) == N_CONNECT) in nl_ind()
6718 || (((plci->NL.Ind & 0x0f) == N_EDATA) in nl_ind()
6719 && ((((T30_INFO *)plci->NL.RBuffer->P)->code == EDATA_T30_TRAIN_OK) in nl_ind()
6720 || (((T30_INFO *)plci->NL.RBuffer->P)->code == EDATA_T30_DIS) in nl_ind()
6721 || (((T30_INFO *)plci->NL.RBuffer->P)->code == EDATA_T30_DTC)))) in nl_ind()
6723 plci->ncpi_state |= NCPI_VALID_CONNECT_B3_ACT; in nl_ind()
6725 if (((plci->NL.Ind & 0x0f) == N_DISC) in nl_ind()
6726 || ((plci->NL.Ind & 0x0f) == N_DISC_ACK) in nl_ind()
6727 || (((plci->NL.Ind & 0x0f) == N_EDATA) in nl_ind()
6728 && (((T30_INFO *)plci->NL.RBuffer->P)->code == EDATA_T30_EOP_CAPI))) in nl_ind()
6730 plci->ncpi_state |= NCPI_VALID_CONNECT_B3_ACT | NCPI_VALID_DISC_B3_IND; in nl_ind()
6736 if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK)) in nl_ind()
6738 if (plci->NL.RLength != 0) in nl_ind()
6740 info = rtp_info[plci->NL.RBuffer->P[0]]; in nl_ind()
6741 plci->ncpi_buffer[0] = plci->NL.RLength - 1; in nl_ind()
6742 for (i = 1; i < plci->NL.RLength; i++) in nl_ind()
6743 plci->ncpi_buffer[i] = plci->NL.RBuffer->P[i]; in nl_ind()
6749 plci->NL.RNR = 2; in nl_ind()
6751 switch (plci->NL.Ind & 0x0f) { in nl_ind()
6753 if ((plci->B3_prot == 4) || (plci->B3_prot == 5)) in nl_ind()
6756 ((T30_INFO *)plci->NL.RBuffer->P)->code)); in nl_ind()
6757 …fax_send_edata_ack = (((T30_INFO *)(plci->fax_connect_info_buffer))->operating_mode == T30_OPERATI… in nl_ind()
6759 if ((plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) in nl_ind()
6760 …&& (plci->nsf_control_bits & (T30_NSF_CONTROL_BIT_NEGOTIATE_IND | T30_NSF_CONTROL_BIT_NEGOTIATE_RE… in nl_ind()
6761 && (((T30_INFO *)plci->NL.RBuffer->P)->code == EDATA_T30_DIS) in nl_ind()
6763 && (plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in nl_ind()
6764 && !(plci->ncpi_state & NCPI_NEGOTIATE_B3_SENT)) in nl_ind()
6766 ((T30_INFO *)(plci->fax_connect_info_buffer))->code = ((T30_INFO *)plci->NL.RBuffer->P)->code; in nl_ind()
6767 sendf(plci->appl, _MANUFACTURER_I, Id, 0, "dwbS", _DI_MANU_ID, _DI_NEGOTIATE_B3, in nl_ind()
6768 (byte)(plci->ncpi_buffer[0] + 1), plci->ncpi_buffer); in nl_ind()
6769 plci->ncpi_state |= NCPI_NEGOTIATE_B3_SENT; in nl_ind()
6770 if (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP) in nl_ind()
6776 switch (((T30_INFO *)plci->NL.RBuffer->P)->code) in nl_ind()
6780 …&& !(GET_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low) & T30_CONTROL_BIT_RE… in nl_ind()
6781 && (plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in nl_ind()
6782 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in nl_ind()
6785 if (plci->B3_prot == 4) in nl_ind()
6786 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "s", ""); in nl_ind()
6788 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6789 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in nl_ind()
6795 && (plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in nl_ind()
6796 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in nl_ind()
6798 if (plci->B3_prot == 4) in nl_ind()
6799 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "s", ""); in nl_ind()
6801 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6802 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in nl_ind()
6809 sendf(plci->appl, _DISCONNECT_B3_I, Id, 0, "wS", GOOD, plci->ncpi_buffer); in nl_ind()
6811 plci->ncpi_state = 0; in nl_ind()
6819 switch (((T30_INFO *)plci->NL.RBuffer->P)->code) in nl_ind()
6823 && (plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in nl_ind()
6824 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in nl_ind()
6826 if (plci->B3_prot == 4) in nl_ind()
6827 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "s", ""); in nl_ind()
6829 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6830 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in nl_ind()
6837 ((T30_INFO *)(plci->fax_connect_info_buffer))->code = ((T30_INFO *)plci->NL.RBuffer->P)->code; in nl_ind()
6838 plci->fax_edata_ack_length = 1; in nl_ind()
6839 start_internal_command(Id, plci, fax_edata_ack_command); in nl_ind()
6850 ncci = get_ncci(plci, ch, 0); in nl_ind()
6854 ch, a->ncci_state[ncci], a->ncci_plci[ncci], plci->Id, plci->State)); in nl_ind()
6858 plci->channels++; in nl_ind()
6859 else if (plci->B3_prot == 1) in nl_ind()
6863 if (plci->B3_prot == 4) in nl_ind()
6864 sendf(plci->appl, msg, Id, 0, "s", ""); in nl_ind()
6866 sendf(plci->appl, msg, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6870 if (plci->internal_command_queue[0] in nl_ind()
6871 && ((plci->adjust_b_state == ADJUST_B_CONNECT_2) in nl_ind()
6872 || (plci->adjust_b_state == ADJUST_B_CONNECT_3) in nl_ind()
6873 || (plci->adjust_b_state == ADJUST_B_CONNECT_4))) in nl_ind()
6875 (*(plci->internal_command_queue[0]))(Id, plci, 0); in nl_ind()
6876 if (!plci->internal_command) in nl_ind()
6877 next_internal_command(Id, plci); in nl_ind()
6881 if (plci->B3_prot == 1) in nl_ind()
6886 sendf(plci->appl, msg, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6888 else if ((plci->B3_prot == 4) || (plci->B3_prot == 5) || (plci->B3_prot == 7)) in nl_ind()
6891 && (plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in nl_ind()
6892 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in nl_ind()
6895 if (plci->B3_prot == 4) in nl_ind()
6896 sendf(plci->appl, msg, Id, 0, "s", ""); in nl_ind()
6898 sendf(plci->appl, msg, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6899 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in nl_ind()
6905 sendf(plci->appl, msg, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6907 if (plci->adjust_b_restore) in nl_ind()
6909 plci->adjust_b_restore = false; in nl_ind()
6910 start_internal_command(Id, plci, adjust_b_restore); in nl_ind()
6915 if (plci->internal_command_queue[0] in nl_ind()
6916 && ((plci->internal_command == FAX_DISCONNECT_COMMAND_1) in nl_ind()
6917 || (plci->internal_command == FAX_DISCONNECT_COMMAND_2) in nl_ind()
6918 || (plci->internal_command == FAX_DISCONNECT_COMMAND_3))) in nl_ind()
6920 (*(plci->internal_command_queue[0]))(Id, plci, 0); in nl_ind()
6921 if (!plci->internal_command) in nl_ind()
6922 next_internal_command(Id, plci); in nl_ind()
6925 ncci_remove(plci, ncci, false); in nl_ind()
6931 for (i = 0; plci->inc_dis_ncci_table[i]; i++); in nl_ind()
6932 plci->inc_dis_ncci_table[i] = (byte) ncci; in nl_ind()
6935 if (!plci->channels in nl_ind()
6936 && (plci->B1_resource == 16) in nl_ind()
6937 && (plci->State <= CONNECTED)) in nl_ind()
6940 i = ((T30_INFO *)plci->fax_connect_info_buffer)->rate_div_2400 * 2400; in nl_ind()
6941 PUT_WORD(&plci->ncpi_buffer[1], i); in nl_ind()
6942 PUT_WORD(&plci->ncpi_buffer[3], 0); in nl_ind()
6943 i = ((T30_INFO *)plci->fax_connect_info_buffer)->data_format; in nl_ind()
6944 PUT_WORD(&plci->ncpi_buffer[5], i); in nl_ind()
6945 PUT_WORD(&plci->ncpi_buffer[7], 0); in nl_ind()
6946 plci->ncpi_buffer[len] = 0; in nl_ind()
6947 plci->ncpi_buffer[0] = len; in nl_ind()
6948 if (plci->B3_prot == 4) in nl_ind()
6949 sendf(plci->appl, _CONNECT_B3_I, Id, 0, "s", ""); in nl_ind()
6953 …if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->app… in nl_ind()
6956 plci->ncpi_buffer[++len] = 0; in nl_ind()
6957 plci->ncpi_buffer[++len] = 0; in nl_ind()
6958 plci->ncpi_buffer[++len] = 0; in nl_ind()
6959 plci->ncpi_buffer[0] = len; in nl_ind()
6962 sendf(plci->appl, _CONNECT_B3_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
6964 sendf(plci->appl, _DISCONNECT_B3_I, Id, 0, "wS", info, plci->ncpi_buffer); in nl_ind()
6965 plci->ncpi_state = 0; in nl_ind()
6966 sig_req(plci, HANGUP, 0); in nl_ind()
6967 send_req(plci); in nl_ind()
6968 plci->State = OUTG_DIS_PENDING; in nl_ind()
6972 && ((plci->B3_prot == 4) || (plci->B3_prot == 5)) in nl_ind()
6977 if (plci->channels) in nl_ind()
6978 plci->channels--; in nl_ind()
6979 if ((plci->State == IDLE || plci->State == SUSPENDING) && !plci->channels) { in nl_ind()
6980 if (plci->State == SUSPENDING) { in nl_ind()
6981 sendf(plci->appl, in nl_ind()
6986 sendf(plci->appl, _DISCONNECT_I, Id & 0xffffL, 0, "w", 0); in nl_ind()
6988 plci_remove(plci); in nl_ind()
6989 plci->State = IDLE; in nl_ind()
6993 else if (plci->channels) in nl_ind()
6995 sendf(plci->appl, _DISCONNECT_B3_I, Id, 0, "wS", info, plci->ncpi_buffer); in nl_ind()
6996 plci->ncpi_state = 0; in nl_ind()
6998 …&& ((plci->B3_prot != B3_T90NL) && (plci->B3_prot != B3_ISO8208) && (plci->B3_prot != B3_X25_DCE))) in nl_ind()
7000 sig_req(plci, HANGUP, 0); in nl_ind()
7001 send_req(plci); in nl_ind()
7002 plci->State = OUTG_DIS_PENDING; in nl_ind()
7008 sendf(plci->appl, _RESET_B3_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
7012 sendf(plci->appl, _RESET_B3_I, Id, 0, "S", plci->ncpi_buffer); in nl_ind()
7016 …if (!(udata_forwarding_table[plci->NL.RBuffer->P[0] >> 5] & (1L << (plci->NL.RBuffer->P[0] & 0x1f)… in nl_ind()
7018 plci->RData[0].P = plci->internal_ind_buffer + (-((int)(long)(plci->internal_ind_buffer)) & 3); in nl_ind()
7019 plci->RData[0].PLength = INTERNAL_IND_BUFFER_SIZE; in nl_ind()
7020 plci->NL.R = plci->RData; in nl_ind()
7021 plci->NL.RNum = 1; in nl_ind()
7027 if (((a->ncci_state[ncci] != CONNECTED) && (plci->B2_prot == 1)) /* transparent */ in nl_ind()
7031 plci->NL.RNR = 2; in nl_ind()
7039 plci->NL.RNR = 1; /* flow control */ in nl_ind()
7040 channel_x_off(plci, ch, 0); in nl_ind()
7060 plci->NL.RNR = 1; in nl_ind()
7064 plci->NL.RNR = 2; in nl_ind()
7067 channel_x_off(plci, ch, 0); in nl_ind()
7076 plci->RData[0].P = ReceiveBufferGet(APPLptr, Num); in nl_ind()
7077 if (!plci->RData[0].P) { in nl_ind()
7078 plci->NL.RNR = 1; in nl_ind()
7079 channel_x_off(plci, ch, 0); in nl_ind()
7084 APPLptr->DataFlags[Num] = (plci->Id << 8) | (plci->NL.Ind >> 4); in nl_ind()
7087 plci->RNum = Num; in nl_ind()
7088 plci->RFlags = plci->NL.Ind >> 4; in nl_ind()
7089 plci->RData[0].PLength = APPLptr->MaxDataLength; in nl_ind()
7090 plci->NL.R = plci->RData; in nl_ind()
7091 if ((plci->NL.RLength != 0) in nl_ind()
7092 && ((plci->B2_prot == B2_V120_ASYNC) in nl_ind()
7093 || (plci->B2_prot == B2_V120_ASYNC_V42BIS) in nl_ind()
7094 || (plci->B2_prot == B2_V120_BIT_TRANSPARENT))) in nl_ind()
7096 plci->RData[1].P = plci->RData[0].P; in nl_ind()
7097 plci->RData[1].PLength = plci->RData[0].PLength; in nl_ind()
7098 plci->RData[0].P = v120_header_buffer + (-((unsigned long)v120_header_buffer) & 3); in nl_ind()
7099 if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1)) in nl_ind()
7100 plci->RData[0].PLength = 1; in nl_ind()
7102 plci->RData[0].PLength = 2; in nl_ind()
7103 if (plci->NL.RBuffer->P[0] & V120_HEADER_BREAK_BIT) in nl_ind()
7104 plci->RFlags |= 0x0010; in nl_ind()
7105 if (plci->NL.RBuffer->P[0] & (V120_HEADER_C1_BIT | V120_HEADER_C2_BIT)) in nl_ind()
7106 plci->RFlags |= 0x8000; in nl_ind()
7107 plci->NL.RNum = 2; in nl_ind()
7111 if ((plci->NL.Ind & 0x0f) == N_UDATA) in nl_ind()
7112 plci->RFlags |= 0x0010; in nl_ind()
7114 else if ((plci->B3_prot == B3_RTP) && ((plci->NL.Ind & 0x0f) == N_BDATA)) in nl_ind()
7115 plci->RFlags |= 0x0001; in nl_ind()
7117 plci->NL.RNum = 1; in nl_ind()
7121 data_ack(plci, ch); in nl_ind()
7124 plci->NL.RNR = 2; in nl_ind()
7136 PLCI *plci; in get_plci() local
7138 for (i = 0; i < a->max_plci && a->plci[i].Id; i++); in get_plci()
7143 plci = &a->plci[i]; in get_plci()
7144 plci->Id = (byte)(i + 1); in get_plci()
7146 plci->Sig.Id = 0; in get_plci()
7147 plci->NL.Id = 0; in get_plci()
7148 plci->sig_req = 0; in get_plci()
7149 plci->nl_req = 0; in get_plci()
7151 plci->appl = NULL; in get_plci()
7152 plci->relatedPTYPLCI = NULL; in get_plci()
7153 plci->State = IDLE; in get_plci()
7154 plci->SuppState = IDLE; in get_plci()
7155 plci->channels = 0; in get_plci()
7156 plci->tel = 0; in get_plci()
7157 plci->B1_resource = 0; in get_plci()
7158 plci->B2_prot = 0; in get_plci()
7159 plci->B3_prot = 0; in get_plci()
7161 plci->command = 0; in get_plci()
7162 plci->m_command = 0; in get_plci()
7163 init_internal_command_queue(plci); in get_plci()
7164 plci->number = 0; in get_plci()
7165 plci->req_in_start = 0; in get_plci()
7166 plci->req_in = 0; in get_plci()
7167 plci->req_out = 0; in get_plci()
7168 plci->msg_in_write_pos = MSG_IN_QUEUE_SIZE; in get_plci()
7169 plci->msg_in_read_pos = MSG_IN_QUEUE_SIZE; in get_plci()
7170 plci->msg_in_wrap_pos = MSG_IN_QUEUE_SIZE; in get_plci()
7172 plci->data_sent = false; in get_plci()
7173 plci->send_disc = 0; in get_plci()
7174 plci->sig_global_req = 0; in get_plci()
7175 plci->sig_remove_id = 0; in get_plci()
7176 plci->nl_global_req = 0; in get_plci()
7177 plci->nl_remove_id = 0; in get_plci()
7178 plci->adv_nl = 0; in get_plci()
7179 plci->manufacturer = false; in get_plci()
7180 plci->call_dir = CALL_DIR_OUT | CALL_DIR_ORIGINATE; in get_plci()
7181 plci->spoofed_msg = 0; in get_plci()
7182 plci->ptyState = 0; in get_plci()
7183 plci->cr_enquiry = false; in get_plci()
7184 plci->hangup_flow_ctrl_timer = 0; in get_plci()
7186 plci->ncci_ring_list = 0; in get_plci()
7187 for (j = 0; j < MAX_CHANNELS_PER_PLCI; j++) plci->inc_dis_ncci_table[j] = 0; in get_plci()
7188 bitmap_zero(plci->c_ind_mask_table, MAX_APPL); in get_plci()
7189 bitmap_fill(plci->group_optimization_mask_table, MAX_APPL); in get_plci()
7190 plci->fax_connect_info_length = 0; in get_plci()
7191 plci->nsf_control_bits = 0; in get_plci()
7192 plci->ncpi_state = 0x00; in get_plci()
7193 plci->ncpi_buffer[0] = 0; in get_plci()
7195 plci->requested_options_conn = 0; in get_plci()
7196 plci->requested_options = 0; in get_plci()
7197 plci->notifiedcall = 0; in get_plci()
7198 plci->vswitchstate = 0; in get_plci()
7199 plci->vsprot = 0; in get_plci()
7200 plci->vsprotdialect = 0; in get_plci()
7201 init_b1_config(plci); in get_plci()
7202 dbug(1, dprintf("get_plci(%x)", plci->Id)); in get_plci()
7210 static void add_p(PLCI *plci, byte code, byte *p) in add_p() argument
7216 add_ie(plci, code, p, p_length); in add_p()
7222 static void add_s(PLCI *plci, byte code, API_PARSE *p) in add_s() argument
7224 if (p) add_ie(plci, code, p->info, (word)p->length); in add_s()
7230 static void add_ss(PLCI *plci, byte code, API_PARSE *p) in add_ss() argument
7238 add_ie(plci, p->info[i - 1], (byte *)&(p->info[i]), (word)p->info[i]); in add_ss()
7265 static void add_ie(PLCI *plci, byte code, byte *p, word p_length) in add_ie() argument
7271 if (plci->req_in == plci->req_in_start) { in add_ie()
7272 plci->req_in += 2; in add_ie()
7275 plci->req_in--; in add_ie()
7277 plci->RBuffer[plci->req_in++] = code; in add_ie()
7280 plci->RBuffer[plci->req_in++] = (byte)p_length; in add_ie()
7281 for (i = 0; i < p_length; i++) plci->RBuffer[plci->req_in++] = p[1 + i]; in add_ie()
7284 plci->RBuffer[plci->req_in++] = 0; in add_ie()
7291 static void add_d(PLCI *plci, word length, byte *p) in add_d() argument
7295 if (plci->req_in == plci->req_in_start) { in add_d()
7296 plci->req_in += 2; in add_d()
7299 plci->req_in--; in add_d()
7301 for (i = 0; i < length; i++) plci->RBuffer[plci->req_in++] = p[i]; in add_d()
7309 static void add_ai(PLCI *plci, API_PARSE *ai) in add_ai() argument
7321 add_s(plci, KEY, &ai_parms[1]); in add_ai()
7322 add_s(plci, UUI, &ai_parms[2]); in add_ai()
7323 add_ss(plci, FTY, &ai_parms[3]); in add_ai()
7330 static word add_b1(PLCI *plci, API_PARSE *bp, word b_channel_info, in add_b1() argument
7350 api_save_msg(bp, "s", &plci->B_protocol); in add_b1()
7353 plci->B1_resource = 0; in add_b1()
7354 adjust_b1_facilities(plci, plci->B1_resource, b1_facilities); in add_b1()
7355 add_p(plci, CAI, "\x01\x00"); in add_b1()
7360 if (plci->tel == CODEC_PERMANENT) return 0; in add_b1()
7361 else if (plci->tel == CODEC) { in add_b1()
7362 plci->B1_resource = 1; in add_b1()
7363 adjust_b1_facilities(plci, plci->B1_resource, b1_facilities); in add_b1()
7364 add_p(plci, CAI, "\x01\x01"); in add_b1()
7368 else if (plci->tel == ADV_VOICE) { in add_b1()
7369 plci->B1_resource = add_b1_facilities(plci, 9, (word)(b1_facilities | B1_FACILITY_VOICE)); in add_b1()
7370 adjust_b1_facilities(plci, plci->B1_resource, (word)(b1_facilities | B1_FACILITY_VOICE)); in add_b1()
7371 voice_cai[1] = plci->B1_resource; in add_b1()
7372 PUT_WORD(&voice_cai[5], plci->appl->MaxDataLength); in add_b1()
7373 add_p(plci, CAI, voice_cai); in add_b1()
7377 plci->call_dir &= ~(CALL_DIR_ORIGINATE | CALL_DIR_ANSWER); in add_b1()
7378 if (plci->call_dir & CALL_DIR_OUT) in add_b1()
7379 plci->call_dir |= CALL_DIR_ORIGINATE; in add_b1()
7380 else if (plci->call_dir & CALL_DIR_IN) in add_b1()
7381 plci->call_dir |= CALL_DIR_ANSWER; in add_b1()
7384 plci->B1_resource = 0x5; in add_b1()
7385 adjust_b1_facilities(plci, plci->B1_resource, b1_facilities); in add_b1()
7386 add_p(plci, CAI, "\x01\x05"); in add_b1()
7416 plci->call_dir = (plci->call_dir & ~CALL_DIR_ANSWER) | CALL_DIR_ORIGINATE; in add_b1()
7419 plci->call_dir = (plci->call_dir & ~CALL_DIR_ORIGINATE) | CALL_DIR_ANSWER; in add_b1()
7423 dbug(1, dprintf("call_dir=%04x", plci->call_dir)); in add_b1()
7427 && (plci->adapter->man_profile.private_options & (1L << PRIVATE_RTP))) in add_b1()
7429 plci->B1_resource = add_b1_facilities(plci, 31, (word)(b1_facilities & ~B1_FACILITY_VOICE)); in add_b1()
7430 adjust_b1_facilities(plci, plci->B1_resource, (word)(b1_facilities & ~B1_FACILITY_VOICE)); in add_b1()
7431 cai[1] = plci->B1_resource; in add_b1()
7435 PUT_WORD(&cai[5], plci->appl->MaxDataLength); in add_b1()
7439 add_p(plci, CAI, cai); in add_b1()
7445 && (plci->adapter->man_profile.private_options & (1L << PRIVATE_PIAFS))) in add_b1()
7447 …plci->B1_resource = add_b1_facilities(plci, 35/* PIAFS HARDWARE FACILITY */, (word)(b1_facilities … in add_b1()
7448 adjust_b1_facilities(plci, plci->B1_resource, (word)(b1_facilities & ~B1_FACILITY_VOICE)); in add_b1()
7449 cai[1] = plci->B1_resource; in add_b1()
7453 PUT_WORD(&cai[5], plci->appl->MaxDataLength); in add_b1()
7455 add_p(plci, CAI, cai); in add_b1()
7461 || (!((1L << GET_WORD(bp_parms[0].info)) & plci->adapter->profile.B1_Protocols) in add_b1()
7463 || !((1L << B1_HDLC) & plci->adapter->profile.B1_Protocols) in add_b1()
7468 plci->B1_resource = add_b1_facilities(plci, resource[GET_WORD(bp_parms[0].info)], in add_b1()
7470 adjust_b1_facilities(plci, plci->B1_resource, (word)(b1_facilities & ~B1_FACILITY_VOICE)); in add_b1()
7472 cai[1] = plci->B1_resource; in add_b1()
7553 if (((plci->call_dir & CALL_DIR_ORIGINATE) != 0) ^ ((plci->call_dir & CALL_DIR_OUT) != 0)) in add_b1()
7599 if ((plci->adapter->man_profile.private_options & (1L << PRIVATE_V18)) in add_b1()
7602 plci->requested_options |= 1L << PRIVATE_V18; in add_b1()
7605 plci->requested_options |= 1L << PRIVATE_VOWN; in add_b1()
7607 …if ((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_tab… in add_b1()
7783 PUT_WORD(&cai[5], plci->appl->MaxDataLength); in add_b1()
7787 add_p(plci, CAI, cai); in add_b1()
7795 static word add_b23(PLCI *plci, API_PARSE *bp) in add_b23() argument
7825 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL) in add_b23()
7827 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_OOB_CHANNEL) in add_b23()
7832 if (plci->rx_dma_descriptor <= 0) { in add_b23()
7833 plci->rx_dma_descriptor = diva_get_dma_descriptor(plci, &plci->rx_dma_magic); in add_b23()
7834 if (plci->rx_dma_descriptor >= 0) in add_b23()
7835 plci->rx_dma_descriptor++; in add_b23()
7837 if (plci->rx_dma_descriptor > 0) { in add_b23()
7840 lli[2] = (byte)(plci->rx_dma_descriptor - 1); in add_b23()
7841 lli[3] = (byte)plci->rx_dma_magic; in add_b23()
7842 lli[4] = (byte)(plci->rx_dma_magic >> 8); in add_b23()
7843 lli[5] = (byte)(plci->rx_dma_magic >> 16); in add_b23()
7844 lli[6] = (byte)(plci->rx_dma_magic >> 24); in add_b23()
7848 if (DIVA_CAPI_SUPPORTS_NO_CANCEL(plci->adapter)) { in add_b23()
7853 api_save_msg(bp, "s", &plci->B_protocol); in add_b23()
7855 if (!bp->length && plci->tel) in add_b23()
7857 plci->adv_nl = true; in add_b23()
7859 add_p(plci, LLI, lli); in add_b23()
7860 plci->B2_prot = 1 /*XPARENT*/; in add_b23()
7861 plci->B3_prot = 0 /*XPARENT*/; in add_b23()
7864 add_p(plci, LLC, llc); in add_b23()
7866 PUT_WORD(&dlc[1], plci->appl->MaxDataLength); in add_b23()
7867 add_p(plci, DLC, dlc); in add_b23()
7874 add_p(plci, LLI, lli); in add_b23()
7875 plci->B2_prot = 0 /*X.75 */; in add_b23()
7876 plci->B3_prot = 0 /*XPARENT*/; in add_b23()
7879 add_p(plci, LLC, llc); in add_b23()
7881 PUT_WORD(&dlc[1], plci->appl->MaxDataLength); in add_b23()
7882 add_p(plci, DLC, dlc); in add_b23()
7903 if (plci->tel == ADV_VOICE) /* transparent B on advanced voice */ in add_b23()
7907 plci->adv_nl = true; in add_b23()
7909 else if (plci->tel) return _B2_NOT_SUPPORTED; in add_b23()
7914 && (plci->adapter->man_profile.private_options & (1L << PRIVATE_RTP))) in add_b23()
7916 add_p(plci, LLI, lli); in add_b23()
7917 plci->B2_prot = (byte) GET_WORD(bp_parms[1].info); in add_b23()
7918 plci->B3_prot = (byte) GET_WORD(bp_parms[2].info); in add_b23()
7919 llc[1] = (plci->call_dir & (CALL_DIR_ORIGINATE | CALL_DIR_FORCE_OUTG_NL)) ? 14 : 13; in add_b23()
7921 add_p(plci, LLC, llc); in add_b23()
7923 PUT_WORD(&dlc[1], plci->appl->MaxDataLength); in add_b23()
7933 add_p(plci, DLC, dlc); in add_b23()
7937 add_p(plci, NLC, nlc); in add_b23()
7944 || (!((1L << GET_WORD(bp_parms[1].info)) & plci->adapter->profile.B2_Protocols) in add_b23()
7946 || !(plci->adapter->man_profile.private_options & (1L << PRIVATE_PIAFS))))) in add_b23()
7952 || !((1L << GET_WORD(bp_parms[2].info)) & plci->adapter->profile.B3_Protocols)) in add_b23()
7961 return (add_modem_b23(plci, bp_parms)); in add_b23()
7964 add_p(plci, LLI, lli); in add_b23()
7966 plci->B2_prot = (byte)GET_WORD(bp_parms[1].info); in add_b23()
7967 plci->B3_prot = (byte)GET_WORD(bp_parms[2].info); in add_b23()
7968 if (plci->B2_prot == 12) SAPI = 0; /* default SAPI D-channel */ in add_b23()
7979 plci->call_dir = (plci->call_dir & ~CALL_DIR_ANSWER) | CALL_DIR_ORIGINATE; in add_b23()
7982 plci->call_dir = (plci->call_dir & ~CALL_DIR_ORIGINATE) | CALL_DIR_ANSWER; in add_b23()
7986 dbug(1, dprintf("call_dir=%04x", plci->call_dir)); in add_b23()
7989 if (plci->B2_prot == B2_PIAFS) in add_b23()
7994 llc[1] = (plci->call_dir & (CALL_DIR_ORIGINATE | CALL_DIR_FORCE_OUTG_NL)) ? in add_b23()
7999 add_p(plci, LLC, llc); in add_b23()
8002 PUT_WORD(&dlc[1], plci->appl->MaxDataLength + in add_b23()
8007 if (plci->B3_prot == 4 in add_b23()
8008 || plci->B3_prot == 5) in add_b23()
8012 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_FAX_PAPER_FORMATS) in add_b23()
8025 if (plci->B3_prot != B3_TRANSPARENT) in add_b23()
8032 PUT_WORD(&dlc[1], plci->appl->MaxDataLength); in add_b23()
8069 add_p(plci, DLC, dlc); in add_b23()
8075 if (plci->B3_prot != B3_TRANSPARENT) in add_b23()
8142 if ((b2_config->length >= 2) && (plci->B2_prot == 12)) in add_b23()
8206 add_p(plci, DLC, dlc); in add_b23()
8211 if (plci->B3_prot == 4 in add_b23()
8212 || plci->B3_prot == 5) in add_b23()
8220 …((plci->B3_prot == 4) && (((byte)(GET_WORD((byte *)b3_config_parms[1].info))) != 5))) ? T30_RESOLU… in add_b23()
8225 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_FAX_PAPER_FORMATS) in add_b23()
8228 …if ((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_tab… in add_b23()
8241 if (plci->B3_prot == 5) in add_b23()
8251 if (plci->fax_connect_info_length != 0) in add_b23()
8253 ((T30_INFO *)&nlc[1])->resolution = ((T30_INFO *)plci->fax_connect_info_buffer)->resolution; in add_b23()
8254 ((T30_INFO *)&nlc[1])->data_format = ((T30_INFO *)plci->fax_connect_info_buffer)->data_format; in add_b23()
8255 …((T30_INFO *)&nlc[1])->recording_properties = ((T30_INFO *)plci->fax_connect_info_buffer)->recordi… in add_b23()
8256 fax_control_bits |= GET_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low) & in add_b23()
8309 plci->nsf_control_bits = 0; in add_b23()
8310 if (plci->B3_prot == 5) in add_b23()
8312 if ((plci->adapter->man_profile.private_options & (1L << PRIVATE_FAX_SUB_SEP_PWD)) in add_b23()
8315 plci->requested_options |= 1L << PRIVATE_FAX_SUB_SEP_PWD; in add_b23()
8317 if ((plci->adapter->man_profile.private_options & (1L << PRIVATE_FAX_NONSTANDARD)) in add_b23()
8320 plci->requested_options |= 1L << PRIVATE_FAX_NONSTANDARD; in add_b23()
8322 …if ((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_tab… in add_b23()
8325 …if ((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_tab… in add_b23()
8334 if (pos < plci->fax_connect_info_length) in add_b23()
8336 for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) in add_b23()
8337 nlc[++len] = plci->fax_connect_info_buffer[pos++]; in add_b23()
8341 if (pos < plci->fax_connect_info_length) in add_b23()
8343 for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) in add_b23()
8344 nlc[++len] = plci->fax_connect_info_buffer[pos++]; in add_b23()
8348 …if ((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_tab… in add_b23()
8351 if ((pos < plci->fax_connect_info_length) && (plci->fax_connect_info_buffer[pos] != 0)) in add_b23()
8353 … if ((plci->fax_connect_info_buffer[pos] >= 3) && (plci->fax_connect_info_buffer[pos + 1] >= 2)) in add_b23()
8354 plci->nsf_control_bits = GET_WORD(&plci->fax_connect_info_buffer[pos + 2]); in add_b23()
8355 for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) in add_b23()
8356 nlc[++len] = plci->fax_connect_info_buffer[pos++]; in add_b23()
8368 plci->nsf_control_bits = GET_WORD(&b3_config_parms[4].info[2]); in add_b23()
8376 if ((plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) in add_b23()
8377 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)) in add_b23()
8387 plci->fax_connect_info_buffer[i] = nlc[1 + i]; in add_b23()
8388 ((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0; in add_b23()
8391 plci->fax_connect_info_buffer[len++] = nlc[++i]; in add_b23()
8392 plci->fax_connect_info_length = len; in add_b23()
8410 if (plci->B3_prot == 4 in add_b23()
8411 || plci->B3_prot == 5 /*T.30 - FAX*/) return _B3_PARM_NOT_SUPPORTED; in add_b23()
8413 add_p(plci, NLC, nlc); in add_b23()
8432 static word add_modem_b23(PLCI *plci, API_PARSE *bp_parms) in add_modem_b23() argument
8457 plci->B2_prot = (byte) GET_WORD(bp_parms[1].info); in add_modem_b23()
8458 plci->B3_prot = (byte) GET_WORD(bp_parms[2].info); in add_modem_b23()
8475 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL) in add_modem_b23()
8477 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_OOB_CHANNEL) in add_modem_b23()
8482 if (plci->rx_dma_descriptor <= 0) { in add_modem_b23()
8483 plci->rx_dma_descriptor = diva_get_dma_descriptor(plci, &plci->rx_dma_magic); in add_modem_b23()
8484 if (plci->rx_dma_descriptor >= 0) in add_modem_b23()
8485 plci->rx_dma_descriptor++; in add_modem_b23()
8487 if (plci->rx_dma_descriptor > 0) { in add_modem_b23()
8490 lli[2] = (byte)(plci->rx_dma_descriptor - 1); in add_modem_b23()
8491 lli[3] = (byte)plci->rx_dma_magic; in add_modem_b23()
8492 lli[4] = (byte)(plci->rx_dma_magic >> 8); in add_modem_b23()
8493 lli[5] = (byte)(plci->rx_dma_magic >> 16); in add_modem_b23()
8494 lli[6] = (byte)(plci->rx_dma_magic >> 24); in add_modem_b23()
8498 if (DIVA_CAPI_SUPPORTS_NO_CANCEL(plci->adapter)) { in add_modem_b23()
8502 llc[1] = (plci->call_dir & (CALL_DIR_ORIGINATE | CALL_DIR_FORCE_OUTG_NL)) ? in add_modem_b23()
8505 add_p(plci, LLI, lli); in add_modem_b23()
8506 add_p(plci, LLC, llc); in add_modem_b23()
8508 PUT_WORD(&dlc[i], plci->appl->MaxDataLength); in add_modem_b23()
8560 add_p(plci, DLC, dlc); in add_modem_b23()
8569 static void sig_req(PLCI *plci, byte req, byte Id) in sig_req() argument
8571 if (!plci) return; in sig_req()
8572 if (plci->adapter->adapter_disabled) return; in sig_req()
8575 plci->sig_remove_id = plci->Sig.Id; in sig_req()
8576 if (plci->req_in == plci->req_in_start) { in sig_req()
8577 plci->req_in += 2; in sig_req()
8578 plci->RBuffer[plci->req_in++] = 0; in sig_req()
8580 PUT_WORD(&plci->RBuffer[plci->req_in_start], plci->req_in-plci->req_in_start - 2); in sig_req()
8581 plci->RBuffer[plci->req_in++] = Id; /* sig/nl flag */ in sig_req()
8582 plci->RBuffer[plci->req_in++] = req; /* request */ in sig_req()
8583 plci->RBuffer[plci->req_in++] = 0; /* channel */ in sig_req()
8584 plci->req_in_start = plci->req_in; in sig_req()
8591 static void nl_req_ncci(PLCI *plci, byte req, byte ncci) in nl_req_ncci() argument
8593 if (!plci) return; in nl_req_ncci()
8594 if (plci->adapter->adapter_disabled) return; in nl_req_ncci()
8595 dbug(1, dprintf("nl_req %02x %02x %02x", plci->Id, req, ncci)); in nl_req_ncci()
8598 plci->nl_remove_id = plci->NL.Id; in nl_req_ncci()
8599 ncci_remove(plci, 0, (byte)(ncci != 0)); in nl_req_ncci()
8602 if (plci->req_in == plci->req_in_start) { in nl_req_ncci()
8603 plci->req_in += 2; in nl_req_ncci()
8604 plci->RBuffer[plci->req_in++] = 0; in nl_req_ncci()
8606 PUT_WORD(&plci->RBuffer[plci->req_in_start], plci->req_in-plci->req_in_start - 2); in nl_req_ncci()
8607 plci->RBuffer[plci->req_in++] = 1; /* sig/nl flag */ in nl_req_ncci()
8608 plci->RBuffer[plci->req_in++] = req; /* request */ in nl_req_ncci()
8609 plci->RBuffer[plci->req_in++] = plci->adapter->ncci_ch[ncci]; /* channel */ in nl_req_ncci()
8610 plci->req_in_start = plci->req_in; in nl_req_ncci()
8613 static void send_req(PLCI *plci) in send_req() argument
8619 if (!plci) return; in send_req()
8620 if (plci->adapter->adapter_disabled) return; in send_req()
8621 channel_xmit_xon(plci); in send_req()
8624 if (plci->req_in == plci->req_out) return; in send_req()
8625 dbug(1, dprintf("send_req(in=%d,out=%d)", plci->req_in, plci->req_out)); in send_req()
8627 if (plci->nl_req || plci->sig_req) return; in send_req()
8629 l = GET_WORD(&plci->RBuffer[plci->req_out]); in send_req()
8630 plci->req_out += 2; in send_req()
8631 plci->XData[0].P = &plci->RBuffer[plci->req_out]; in send_req()
8632 plci->req_out += l; in send_req()
8633 if (plci->RBuffer[plci->req_out] == 1) in send_req()
8635 e = &plci->NL; in send_req()
8636 plci->req_out++; in send_req()
8637 e->Req = plci->nl_req = plci->RBuffer[plci->req_out++]; in send_req()
8638 e->ReqCh = plci->RBuffer[plci->req_out++]; in send_req()
8642 plci->RBuffer[plci->req_out - 4] = CAI; in send_req()
8643 plci->RBuffer[plci->req_out - 3] = 1; in send_req()
8644 plci->RBuffer[plci->req_out - 2] = (plci->Sig.Id == 0xff) ? 0 : plci->Sig.Id; in send_req()
8645 plci->RBuffer[plci->req_out - 1] = 0; in send_req()
8647 plci->nl_global_req = plci->nl_req; in send_req()
8649 dbug(1, dprintf("%x:NLREQ(%x:%x:%x)", plci->adapter->Id, e->Id, e->Req, e->ReqCh)); in send_req()
8653 e = &plci->Sig; in send_req()
8654 if (plci->RBuffer[plci->req_out]) in send_req()
8655 e->Id = plci->RBuffer[plci->req_out]; in send_req()
8656 plci->req_out++; in send_req()
8657 e->Req = plci->sig_req = plci->RBuffer[plci->req_out++]; in send_req()
8658 e->ReqCh = plci->RBuffer[plci->req_out++]; in send_req()
8660 plci->sig_global_req = plci->sig_req; in send_req()
8661 dbug(1, dprintf("%x:SIGREQ(%x:%x:%x)", plci->adapter->Id, e->Id, e->Req, e->ReqCh)); in send_req()
8663 plci->XData[0].PLength = l; in send_req()
8664 e->X = plci->XData; in send_req()
8665 plci->adapter->request(e); in send_req()
8669 static void send_data(PLCI *plci) in send_data() argument
8676 if (!plci->nl_req && plci->ncci_ring_list) in send_data()
8678 a = plci->adapter; in send_data()
8679 ncci = plci->ncci_ring_list; in send_data()
8691 || (plci->send_disc == ncci)) in send_data()
8694 if ((plci->B2_prot == B2_V120_ASYNC) in send_data()
8695 || (plci->B2_prot == B2_V120_ASYNC_V42BIS) in send_data()
8696 || (plci->B2_prot == B2_V120_BIT_TRANSPARENT)) in send_data()
8698 plci->NData[1].P = TransmitBufferGet(plci->appl, data->P); in send_data()
8699 plci->NData[1].PLength = data->Length; in send_data()
8701 plci->NData[0].P = v120_break_header; in send_data()
8703 plci->NData[0].P = v120_default_header; in send_data()
8704 plci->NData[0].PLength = 1; in send_data()
8705 plci->NL.XNum = 2; in send_data()
8706 plci->NL.Req = plci->nl_req = (byte)((data->Flags & 0x07) << 4 | N_DATA); in send_data()
8710 plci->NData[0].P = TransmitBufferGet(plci->appl, data->P); in send_data()
8711 plci->NData[0].PLength = data->Length; in send_data()
8713 plci->NL.Req = plci->nl_req = (byte)N_UDATA; in send_data()
8715 else if ((plci->B3_prot == B3_RTP) && (data->Flags & 0x01)) in send_data()
8716 plci->NL.Req = plci->nl_req = (byte)N_BDATA; in send_data()
8719 plci->NL.Req = plci->nl_req = (byte)((data->Flags & 0x07) << 4 | N_DATA); in send_data()
8721 plci->NL.X = plci->NData; in send_data()
8722 plci->NL.ReqCh = a->ncci_ch[ncci]; in send_data()
8723 dbug(1, dprintf("%x:DREQ(%x:%x)", a->Id, plci->NL.Id, plci->NL.Req)); in send_data()
8724 plci->data_sent = true; in send_data()
8725 plci->data_sent_ptr = data->P; in send_data()
8726 a->request(&plci->NL); in send_data()
8729 cleanup_ncci_data(plci, ncci); in send_data()
8732 else if (plci->send_disc == ncci) in send_data()
8735 plci->NData[0].PLength = 0; in send_data()
8736 plci->NL.ReqCh = a->ncci_ch[ncci]; in send_data()
8737 plci->NL.Req = plci->nl_req = N_DISC; in send_data()
8738 a->request(&plci->NL); in send_data()
8739 plci->command = _DISCONNECT_B3_R; in send_data()
8740 plci->send_disc = 0; in send_data()
8743 } while (!plci->nl_req && (ncci != plci->ncci_ring_list)); in send_data()
8744 plci->ncci_ring_list = ncci; in send_data()
8751 PLCI *plci; in listen_check() local
8759 plci = &(a->plci[i]); in listen_check()
8760 if (plci->notifiedcall) activnotifiedcalls++; in listen_check()
8767 plci = &a->plci[j - 1]; in listen_check()
8768 plci->State = LISTENING; in listen_check()
8770 add_p(plci, OAD, "\x01\xfd"); in listen_check()
8772 add_p(plci, KEY, "\x04\x43\x41\x32\x30"); in listen_check()
8774 add_p(plci, CAI, "\x01\xc0"); in listen_check()
8775 add_p(plci, UID, "\x06\x43\x61\x70\x69\x32\x30"); in listen_check()
8776 add_p(plci, LLI, "\x01\xc4"); /* support Dummy CR FAC + MWI + SpoofNotify */ in listen_check()
8777 add_p(plci, SHIFT | 6, NULL); in listen_check()
8778 add_p(plci, SIN, "\x02\x00\x00"); in listen_check()
8779 plci->internal_command = LISTEN_SIG_ASSIGN_PEND; /* do indicate_req if OK */ in listen_check()
8780 sig_req(plci, ASSIGN, DSIG_ID); in listen_check()
8781 send_req(plci); in listen_check()
8791 static void IndParse(PLCI *plci, const word *parms_id, byte **parms, byte multiIEsize) in IndParse() argument
8805 in = plci->Sig.RBuffer->P; in IndParse()
8815 while (ploc < plci->Sig.RBuffer->length - 1) { in IndParse()
8953 static void SetVoiceChannel(PLCI *plci, byte *chi, DIVA_CAPI_ADAPTER *a) in SetVoiceChannel() argument
8961 add_p(plci, FTY, "\x02\x01\x07"); /* B On, default on 1 */ in SetVoiceChannel()
8962 add_p(plci, ESC, voice_chi); /* Channel */ in SetVoiceChannel()
8963 sig_req(plci, TEL_CTRL, 0); in SetVoiceChannel()
8964 send_req(plci); in SetVoiceChannel()
8971 static void VoiceChannelOff(PLCI *plci) in VoiceChannelOff() argument
8974 add_p(plci, FTY, "\x02\x01\x08"); /* B Off */ in VoiceChannelOff()
8975 sig_req(plci, TEL_CTRL, 0); in VoiceChannelOff()
8976 send_req(plci); in VoiceChannelOff()
8977 if (plci->adapter->AdvSignalPLCI) in VoiceChannelOff()
8979 adv_voice_clear_config(plci->adapter->AdvSignalPLCI); in VoiceChannelOff()
8984 static word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, in AdvCodecSupport() argument
9005 if (plci != NULL) in AdvCodecSupport()
9007 a->AdvSignalPLCI = plci; in AdvCodecSupport()
9008 plci->tel = ADV_VOICE; in AdvCodecSupport()
9014 splci = &a->plci[j - 1]; in AdvCodecSupport()
9024 if (plci) in AdvCodecSupport()
9026 plci->spoofed_msg = SPOOFING_REQUIRED; in AdvCodecSupport()
9030 if (plci != NULL) in AdvCodecSupport()
9032 a->AdvSignalPLCI = plci; in AdvCodecSupport()
9033 plci->tel = ADV_VOICE; in AdvCodecSupport()
9056 if (plci != NULL) plci->tel = CODEC; in AdvCodecSupport()
9063 splci = &a->plci[j - 1]; in AdvCodecSupport()
9081 static void CodecIdCheck(DIVA_CAPI_ADAPTER *a, PLCI *plci) in CodecIdCheck() argument
9086 if (a->AdvSignalPLCI == plci) in CodecIdCheck()
9185 splci = &a->plci[j - 1]; in AutomaticLaw()
9202 PLCI *plci; in CapiRelease() local
9234 plci = &a->plci[j]; in CapiRelease()
9235 if (plci->Id) /* if plci owns no application */ in CapiRelease()
9237 if (plci->State == INC_CON_PENDING in CapiRelease()
9238 || plci->State == INC_CON_ALERT) in CapiRelease()
9240 if (test_bit(Id - 1, plci->c_ind_mask_table)) in CapiRelease()
9242 __clear_bit(Id - 1, plci->c_ind_mask_table); in CapiRelease()
9243 if (bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) in CapiRelease()
9245 sig_req(plci, HANGUP, 0); in CapiRelease()
9246 send_req(plci); in CapiRelease()
9247 plci->State = OUTG_DIS_PENDING; in CapiRelease()
9251 if (test_bit(Id - 1, plci->c_ind_mask_table)) in CapiRelease()
9253 __clear_bit(Id - 1, plci->c_ind_mask_table); in CapiRelease()
9254 if (bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) in CapiRelease()
9256 if (!plci->appl) in CapiRelease()
9258 plci_remove(plci); in CapiRelease()
9259 plci->State = IDLE; in CapiRelease()
9263 if (plci->appl == this) in CapiRelease()
9265 plci->appl = NULL; in CapiRelease()
9266 plci_remove(plci); in CapiRelease()
9267 plci->State = IDLE; in CapiRelease()
9279 plci = &a->plci[j - 1]; in CapiRelease()
9280 plci->command = 0; in CapiRelease()
9281 add_p(plci, OAD, "\x01\xfd"); in CapiRelease()
9282 add_p(plci, CAI, "\x01\x80"); in CapiRelease()
9283 add_p(plci, UID, "\x06\x43\x61\x70\x69\x32\x30"); in CapiRelease()
9284 add_p(plci, SHIFT | 6, NULL); in CapiRelease()
9285 add_p(plci, SIN, "\x02\x00\x00"); in CapiRelease()
9286 plci->internal_command = REM_L1_SIG_ASSIGN_PEND; in CapiRelease()
9287 sig_req(plci, ASSIGN, DSIG_ID); in CapiRelease()
9288 add_p(plci, FTY, "\x02\xff\x06"); /* l1 down */ in CapiRelease()
9289 sig_req(plci, SIG_CTRL, 0); in CapiRelease()
9290 send_req(plci); in CapiRelease()
9316 static word plci_remove_check(PLCI *plci) in plci_remove_check() argument
9318 if (!plci) return true; in plci_remove_check()
9319 if (!plci->NL.Id && bitmap_empty(plci->c_ind_mask_table, MAX_APPL)) in plci_remove_check()
9321 if (plci->Sig.Id == 0xff) in plci_remove_check()
9322 plci->Sig.Id = 0; in plci_remove_check()
9323 if (!plci->Sig.Id) in plci_remove_check()
9325 dbug(1, dprintf("plci_remove_complete(%x)", plci->Id)); in plci_remove_check()
9326 dbug(1, dprintf("tel=0x%x,Sig=0x%x", plci->tel, plci->Sig.Id)); in plci_remove_check()
9327 if (plci->Id) in plci_remove_check()
9329 CodecIdCheck(plci->adapter, plci); in plci_remove_check()
9330 clear_b1_config(plci); in plci_remove_check()
9331 ncci_remove(plci, 0, false); in plci_remove_check()
9332 plci_free_msg_in_queue(plci); in plci_remove_check()
9333 channel_flow_control_remove(plci); in plci_remove_check()
9334 plci->Id = 0; in plci_remove_check()
9335 plci->State = IDLE; in plci_remove_check()
9336 plci->channels = 0; in plci_remove_check()
9337 plci->appl = NULL; in plci_remove_check()
9338 plci->notifiedcall = 0; in plci_remove_check()
9340 listen_check(plci->adapter); in plci_remove_check()
9350 static byte plci_nl_busy(PLCI *plci) in plci_nl_busy() argument
9353 return (plci->nl_req in plci_nl_busy()
9354 || (plci->ncci_ring_list in plci_nl_busy()
9355 && plci->adapter->ncci_ch[plci->ncci_ring_list] in plci_nl_busy()
9356 …&& (plci->adapter->ch_flow_control[plci->adapter->ncci_ch[plci->ncci_ring_list]] & N_OK_FC_PENDING… in plci_nl_busy()
9452 static void dtmf_enable_receiver(PLCI *plci, byte enable_mask) in dtmf_enable_receiver() argument
9457 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in dtmf_enable_receiver()
9462 min_digit_duration = (plci->dtmf_rec_pulse_ms == 0) ? 40 : plci->dtmf_rec_pulse_ms; in dtmf_enable_receiver()
9463 min_gap_duration = (plci->dtmf_rec_pause_ms == 0) ? 40 : plci->dtmf_rec_pause_ms; in dtmf_enable_receiver()
9464 plci->internal_req_buffer[0] = DTMF_UDATA_REQUEST_ENABLE_RECEIVER; in dtmf_enable_receiver()
9465 PUT_WORD(&plci->internal_req_buffer[1], min_digit_duration); in dtmf_enable_receiver()
9466 PUT_WORD(&plci->internal_req_buffer[3], min_gap_duration); in dtmf_enable_receiver()
9467 plci->NData[0].PLength = 5; in dtmf_enable_receiver()
9469 PUT_WORD(&plci->internal_req_buffer[5], INTERNAL_IND_BUFFER_SIZE); in dtmf_enable_receiver()
9470 plci->NData[0].PLength += 2; in dtmf_enable_receiver()
9471 capidtmf_recv_enable(&(plci->capidtmf_state), min_digit_duration, min_gap_duration); in dtmf_enable_receiver()
9476 plci->internal_req_buffer[0] = DTMF_UDATA_REQUEST_DISABLE_RECEIVER; in dtmf_enable_receiver()
9477 plci->NData[0].PLength = 1; in dtmf_enable_receiver()
9479 capidtmf_recv_disable(&(plci->capidtmf_state)); in dtmf_enable_receiver()
9482 plci->NData[0].P = plci->internal_req_buffer; in dtmf_enable_receiver()
9483 plci->NL.X = plci->NData; in dtmf_enable_receiver()
9484 plci->NL.ReqCh = 0; in dtmf_enable_receiver()
9485 plci->NL.Req = plci->nl_req = (byte) N_UDATA; in dtmf_enable_receiver()
9486 plci->adapter->request(&plci->NL); in dtmf_enable_receiver()
9490 static void dtmf_send_digits(PLCI *plci, byte *digit_buffer, word digit_count) in dtmf_send_digits() argument
9495 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in dtmf_send_digits()
9498 plci->internal_req_buffer[0] = DTMF_UDATA_REQUEST_SEND_DIGITS; in dtmf_send_digits()
9499 w = (plci->dtmf_send_pulse_ms == 0) ? 40 : plci->dtmf_send_pulse_ms; in dtmf_send_digits()
9500 PUT_WORD(&plci->internal_req_buffer[1], w); in dtmf_send_digits()
9501 w = (plci->dtmf_send_pause_ms == 0) ? 40 : plci->dtmf_send_pause_ms; in dtmf_send_digits()
9502 PUT_WORD(&plci->internal_req_buffer[3], w); in dtmf_send_digits()
9511 plci->internal_req_buffer[5 + i] = (w < DTMF_DIGIT_MAP_ENTRIES) ? in dtmf_send_digits()
9514 plci->NData[0].PLength = 5 + digit_count; in dtmf_send_digits()
9515 plci->NData[0].P = plci->internal_req_buffer; in dtmf_send_digits()
9516 plci->NL.X = plci->NData; in dtmf_send_digits()
9517 plci->NL.ReqCh = 0; in dtmf_send_digits()
9518 plci->NL.Req = plci->nl_req = (byte) N_UDATA; in dtmf_send_digits()
9519 plci->adapter->request(&plci->NL); in dtmf_send_digits()
9523 static void dtmf_rec_clear_config(PLCI *plci) in dtmf_rec_clear_config() argument
9527 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in dtmf_rec_clear_config()
9530 plci->dtmf_rec_active = 0; in dtmf_rec_clear_config()
9531 plci->dtmf_rec_pulse_ms = 0; in dtmf_rec_clear_config()
9532 plci->dtmf_rec_pause_ms = 0; in dtmf_rec_clear_config()
9534 capidtmf_init(&(plci->capidtmf_state), plci->adapter->u_law); in dtmf_rec_clear_config()
9539 static void dtmf_send_clear_config(PLCI *plci) in dtmf_send_clear_config() argument
9543 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in dtmf_send_clear_config()
9546 plci->dtmf_send_requests = 0; in dtmf_send_clear_config()
9547 plci->dtmf_send_pulse_ms = 0; in dtmf_send_clear_config()
9548 plci->dtmf_send_pause_ms = 0; in dtmf_send_clear_config()
9552 static void dtmf_prepare_switch(dword Id, PLCI *plci) in dtmf_prepare_switch() argument
9558 while (plci->dtmf_send_requests != 0) in dtmf_prepare_switch()
9559 dtmf_confirmation(Id, plci); in dtmf_prepare_switch()
9563 static word dtmf_save_config(dword Id, PLCI *plci, byte Rc) in dtmf_save_config() argument
9567 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in dtmf_save_config()
9573 static word dtmf_restore_config(dword Id, PLCI *plci, byte Rc) in dtmf_restore_config() argument
9578 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in dtmf_restore_config()
9581 if (plci->B1_facilities & B1_FACILITY_DTMFR) in dtmf_restore_config()
9583 switch (plci->adjust_b_state) in dtmf_restore_config()
9586 plci->internal_command = plci->adjust_b_command; in dtmf_restore_config()
9587 if (plci_nl_busy(plci)) in dtmf_restore_config()
9589 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_1; in dtmf_restore_config()
9592 dtmf_enable_receiver(plci, plci->dtmf_rec_active); in dtmf_restore_config()
9593 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_2; in dtmf_restore_config()
9610 static void dtmf_command(dword Id, PLCI *plci, byte Rc) in dtmf_command() argument
9617 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command, in dtmf_command()
9618 plci->dtmf_cmd, plci->dtmf_rec_pulse_ms, plci->dtmf_rec_pause_ms, in dtmf_command()
9619 plci->dtmf_send_pulse_ms, plci->dtmf_send_pause_ms)); in dtmf_command()
9624 internal_command = plci->internal_command; in dtmf_command()
9625 plci->internal_command = 0; in dtmf_command()
9627 switch (plci->dtmf_cmd) in dtmf_command()
9639 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | in dtmf_command()
9643 if (adjust_b_process(Id, plci, Rc) != GOOD) in dtmf_command()
9650 if (plci->internal_command) in dtmf_command()
9654 if (plci_nl_busy(plci)) in dtmf_command()
9656 plci->internal_command = DTMF_COMMAND_2; in dtmf_command()
9659 plci->internal_command = DTMF_COMMAND_3; in dtmf_command()
9660 dtmf_enable_receiver(plci, (byte)(plci->dtmf_rec_active | mask)); in dtmf_command()
9671 plci->tone_last_indication_code = DTMF_SIGNAL_NO_TONE; in dtmf_command()
9673 plci->dtmf_rec_active |= mask; in dtmf_command()
9688 plci->dtmf_rec_active &= ~mask; in dtmf_command()
9689 if (plci->dtmf_rec_active) in dtmf_command()
9715 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities & in dtmf_command()
9719 if (adjust_b_process(Id, plci, Rc) != GOOD) in dtmf_command()
9726 if (plci->internal_command) in dtmf_command()
9742 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | in dtmf_command()
9743 … ((plci->dtmf_parameter_length != 0) ? B1_FACILITY_DTMFX | B1_FACILITY_DTMFR : B1_FACILITY_DTMFX)), in dtmf_command()
9747 if (adjust_b_process(Id, plci, Rc) != GOOD) in dtmf_command()
9754 if (plci->internal_command) in dtmf_command()
9758 if (plci_nl_busy(plci)) in dtmf_command()
9760 plci->internal_command = DTMF_COMMAND_2; in dtmf_command()
9763 plci->dtmf_msg_number_queue[(plci->dtmf_send_requests)++] = plci->number; in dtmf_command()
9764 plci->internal_command = DTMF_COMMAND_3; in dtmf_command()
9765 dtmf_send_digits(plci, &plci->saved_msg.parms[3].info[1], plci->saved_msg.parms[3].length); in dtmf_command()
9772 if (plci->dtmf_send_requests != 0) in dtmf_command()
9773 (plci->dtmf_send_requests)--; in dtmf_command()
9781 sendf(plci->appl, _FACILITY_R | CONFIRM, Id & 0xffffL, plci->number, in dtmf_command()
9786 static byte dtmf_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, API… in dtmf_request() argument
9848 else if (plci == NULL) in dtmf_request()
9856 if (!plci->State in dtmf_request()
9857 || !plci->NL.Id || plci->nl_remove_id) in dtmf_request()
9865 plci->command = 0; in dtmf_request()
9866 plci->dtmf_cmd = GET_WORD(dtmf_parms[0].info); in dtmf_request()
9868 switch (plci->dtmf_cmd) in dtmf_request()
9877 …if (!((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_t… in dtmf_request()
9901 plci->dtmf_rec_pulse_ms = 0; in dtmf_request()
9902 plci->dtmf_rec_pause_ms = 0; in dtmf_request()
9906 plci->dtmf_rec_pulse_ms = GET_WORD(dtmf_parms[1].info); in dtmf_request()
9907 plci->dtmf_rec_pause_ms = GET_WORD(dtmf_parms[2].info); in dtmf_request()
9910 start_internal_command(Id, plci, dtmf_command); in dtmf_request()
9918 …if (!((plci->requested_options_conn | plci->requested_options | plci->adapter->requested_options_t… in dtmf_request()
9938 plci->dtmf_send_pulse_ms = GET_WORD(dtmf_parms[1].info); in dtmf_request()
9939 plci->dtmf_send_pause_ms = GET_WORD(dtmf_parms[2].info); in dtmf_request()
9961 if (plci->dtmf_send_requests >= ARRAY_SIZE(plci->dtmf_msg_number_queue)) in dtmf_request()
9968 api_save_msg(dtmf_parms, "wwws", &plci->saved_msg); in dtmf_request()
9969 start_internal_command(Id, plci, dtmf_command); in dtmf_request()
9974 UnMapId(Id), (char *)(FILE_), __LINE__, plci->dtmf_cmd)); in dtmf_request()
9985 static void dtmf_confirmation(dword Id, PLCI *plci) in dtmf_confirmation() argument
9995 if (plci->dtmf_send_requests != 0) in dtmf_confirmation()
9997 sendf(plci->appl, _FACILITY_R | CONFIRM, Id & 0xffffL, plci->dtmf_msg_number_queue[0], in dtmf_confirmation()
9999 (plci->dtmf_send_requests)--; in dtmf_confirmation()
10000 for (i = 0; i < plci->dtmf_send_requests; i++) in dtmf_confirmation()
10001 plci->dtmf_msg_number_queue[i] = plci->dtmf_msg_number_queue[i + 1]; in dtmf_confirmation()
10006 static void dtmf_indication(dword Id, PLCI *plci, byte *msg, word length) in dtmf_indication() argument
10019 || ((dtmf_digit_map[j].listen_mask & plci->dtmf_rec_active) == 0))) in dtmf_indication()
10027 && (plci->tone_last_indication_code == DTMF_SIGNAL_NO_TONE) in dtmf_indication()
10039 plci->tone_last_indication_code = dtmf_digit_map[j].character; in dtmf_indication()
10047 sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, "wS", SELECTOR_DTMF, msg); in dtmf_indication()
10056 static void dtmf_parameter_write(PLCI *plci) in dtmf_parameter_write() argument
10062 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in dtmf_parameter_write()
10065 parameter_buffer[0] = plci->dtmf_parameter_length + 1; in dtmf_parameter_write()
10067 for (i = 0; i < plci->dtmf_parameter_length; i++) in dtmf_parameter_write()
10068 parameter_buffer[2 + i] = plci->dtmf_parameter_buffer[i]; in dtmf_parameter_write()
10069 add_p(plci, FTY, parameter_buffer); in dtmf_parameter_write()
10070 sig_req(plci, TEL_CTRL, 0); in dtmf_parameter_write()
10071 send_req(plci); in dtmf_parameter_write()
10075 static void dtmf_parameter_clear_config(PLCI *plci) in dtmf_parameter_clear_config() argument
10079 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in dtmf_parameter_clear_config()
10082 plci->dtmf_parameter_length = 0; in dtmf_parameter_clear_config()
10086 static void dtmf_parameter_prepare_switch(dword Id, PLCI *plci) in dtmf_parameter_prepare_switch() argument
10095 static word dtmf_parameter_save_config(dword Id, PLCI *plci, byte Rc) in dtmf_parameter_save_config() argument
10099 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in dtmf_parameter_save_config()
10105 static word dtmf_parameter_restore_config(dword Id, PLCI *plci, byte Rc) in dtmf_parameter_restore_config() argument
10110 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in dtmf_parameter_restore_config()
10113 if ((plci->B1_facilities & B1_FACILITY_DTMFR) in dtmf_parameter_restore_config()
10114 && (plci->dtmf_parameter_length != 0)) in dtmf_parameter_restore_config()
10116 switch (plci->adjust_b_state) in dtmf_parameter_restore_config()
10119 plci->internal_command = plci->adjust_b_command; in dtmf_parameter_restore_config()
10120 if (plci->sig_req) in dtmf_parameter_restore_config()
10122 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_PARAMETER_1; in dtmf_parameter_restore_config()
10125 dtmf_parameter_write(plci); in dtmf_parameter_restore_config()
10126 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_PARAMETER_2; in dtmf_parameter_restore_config()
10261 static void mixer_set_bchannel_id_esc(PLCI *plci, byte bchannel_id) in mixer_set_bchannel_id_esc() argument
10267 a = plci->adapter; in mixer_set_bchannel_id_esc()
10268 old_id = plci->li_bchannel_id; in mixer_set_bchannel_id_esc()
10271 if ((old_id != 0) && (li_config_table[a->li_base + (old_id - 1)].plci == plci)) in mixer_set_bchannel_id_esc()
10272 li_config_table[a->li_base + (old_id - 1)].plci = NULL; in mixer_set_bchannel_id_esc()
10273 plci->li_bchannel_id = (bchannel_id & 0x1f) + 1; in mixer_set_bchannel_id_esc()
10274 if (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == NULL) in mixer_set_bchannel_id_esc()
10275 li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci = plci; in mixer_set_bchannel_id_esc()
10281 if ((old_id != 0) && (li_config_table[a->li_base + (old_id - 1)].plci == plci)) in mixer_set_bchannel_id_esc()
10282 li_config_table[a->li_base + (old_id - 1)].plci = NULL; in mixer_set_bchannel_id_esc()
10283 plci->li_bchannel_id = bchannel_id & 0x03; in mixer_set_bchannel_id_esc()
10284 …if ((a->AdvSignalPLCI != NULL) && (a->AdvSignalPLCI != plci) && (a->AdvSignalPLCI->tel == ADV_VOIC… in mixer_set_bchannel_id_esc()
10287 if (li_config_table[a->li_base + (2 - plci->li_bchannel_id)].plci == NULL) in mixer_set_bchannel_id_esc()
10290 && (li_config_table[a->li_base + (splci->li_bchannel_id - 1)].plci == splci)) in mixer_set_bchannel_id_esc()
10292 li_config_table[a->li_base + (splci->li_bchannel_id - 1)].plci = NULL; in mixer_set_bchannel_id_esc()
10294 splci->li_bchannel_id = 3 - plci->li_bchannel_id; in mixer_set_bchannel_id_esc()
10295 li_config_table[a->li_base + (2 - plci->li_bchannel_id)].plci = splci; in mixer_set_bchannel_id_esc()
10301 if (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == NULL) in mixer_set_bchannel_id_esc()
10302 li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci = plci; in mixer_set_bchannel_id_esc()
10305 if ((old_id == 0) && (plci->li_bchannel_id != 0) in mixer_set_bchannel_id_esc()
10306 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_set_bchannel_id_esc()
10308 mixer_clear_config(plci); in mixer_set_bchannel_id_esc()
10311 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_set_bchannel_id_esc()
10312 (char *)(FILE_), __LINE__, bchannel_id, plci->li_bchannel_id)); in mixer_set_bchannel_id_esc()
10316 static void mixer_set_bchannel_id(PLCI *plci, byte *chi) in mixer_set_bchannel_id() argument
10322 a = plci->adapter; in mixer_set_bchannel_id()
10323 old_id = plci->li_bchannel_id; in mixer_set_bchannel_id()
10329 if ((old_id != 0) && (li_config_table[a->li_base + (old_id - 1)].plci == plci)) in mixer_set_bchannel_id()
10330 li_config_table[a->li_base + (old_id - 1)].plci = NULL; in mixer_set_bchannel_id()
10331 plci->li_bchannel_id = (ch & 0x1f) + 1; in mixer_set_bchannel_id()
10332 if (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == NULL) in mixer_set_bchannel_id()
10333 li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci = plci; in mixer_set_bchannel_id()
10339 if ((old_id != 0) && (li_config_table[a->li_base + (old_id - 1)].plci == plci)) in mixer_set_bchannel_id()
10340 li_config_table[a->li_base + (old_id - 1)].plci = NULL; in mixer_set_bchannel_id()
10341 plci->li_bchannel_id = ch & 0x1f; in mixer_set_bchannel_id()
10342 …if ((a->AdvSignalPLCI != NULL) && (a->AdvSignalPLCI != plci) && (a->AdvSignalPLCI->tel == ADV_VOIC… in mixer_set_bchannel_id()
10345 if (li_config_table[a->li_base + (2 - plci->li_bchannel_id)].plci == NULL) in mixer_set_bchannel_id()
10348 && (li_config_table[a->li_base + (splci->li_bchannel_id - 1)].plci == splci)) in mixer_set_bchannel_id()
10350 li_config_table[a->li_base + (splci->li_bchannel_id - 1)].plci = NULL; in mixer_set_bchannel_id()
10352 splci->li_bchannel_id = 3 - plci->li_bchannel_id; in mixer_set_bchannel_id()
10353 li_config_table[a->li_base + (2 - plci->li_bchannel_id)].plci = splci; in mixer_set_bchannel_id()
10359 if (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == NULL) in mixer_set_bchannel_id()
10360 li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci = plci; in mixer_set_bchannel_id()
10364 if ((old_id == 0) && (plci->li_bchannel_id != 0) in mixer_set_bchannel_id()
10365 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_set_bchannel_id()
10367 mixer_clear_config(plci); in mixer_set_bchannel_id()
10370 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_set_bchannel_id()
10371 (char *)(FILE_), __LINE__, ch, plci->li_bchannel_id)); in mixer_set_bchannel_id()
10733 static void xconnect_query_addresses(PLCI *plci) in xconnect_query_addresses() argument
10740 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in xconnect_query_addresses()
10743 a = plci->adapter; in xconnect_query_addresses()
10744 if (a->li_pri && ((plci->li_bchannel_id == 0) in xconnect_query_addresses()
10745 || (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci != plci))) in xconnect_query_addresses()
10748 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in xconnect_query_addresses()
10752 p = plci->internal_req_buffer; in xconnect_query_addresses()
10753 ch = (a->li_pri) ? plci->li_bchannel_id - 1 : 0; in xconnect_query_addresses()
10761 plci->NData[0].P = plci->internal_req_buffer; in xconnect_query_addresses()
10762 plci->NData[0].PLength = p - plci->internal_req_buffer; in xconnect_query_addresses()
10763 plci->NL.X = plci->NData; in xconnect_query_addresses()
10764 plci->NL.ReqCh = 0; in xconnect_query_addresses()
10765 plci->NL.Req = plci->nl_req = (byte) N_UDATA; in xconnect_query_addresses()
10766 plci->adapter->request(&plci->NL); in xconnect_query_addresses()
10770 static void xconnect_write_coefs(PLCI *plci, word internal_command) in xconnect_write_coefs() argument
10774 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in xconnect_write_coefs()
10777 plci->li_write_command = internal_command; in xconnect_write_coefs()
10778 plci->li_write_channel = 0; in xconnect_write_coefs()
10782 static byte xconnect_write_coefs_process(dword Id, PLCI *plci, byte Rc) in xconnect_write_coefs_process() argument
10792 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->li_write_channel)); in xconnect_write_coefs_process()
10794 a = plci->adapter; in xconnect_write_coefs_process()
10795 if ((plci->li_bchannel_id == 0) in xconnect_write_coefs_process()
10796 || (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci != plci)) in xconnect_write_coefs_process()
10802 i = a->li_base + (plci->li_bchannel_id - 1); in xconnect_write_coefs_process()
10803 j = plci->li_write_channel; in xconnect_write_coefs_process()
10804 p = plci->internal_req_buffer; in xconnect_write_coefs_process()
10851 plci->internal_command = plci->li_write_command; in xconnect_write_coefs_process()
10852 if (plci_nl_busy(plci)) in xconnect_write_coefs_process()
10854 to_ch = (a->li_pri) ? plci->li_bchannel_id - 1 : 0; in xconnect_write_coefs_process()
10903 && ((p - plci->internal_req_buffer) + 16 < INTERNAL_REQ_BUFFER_SIZE)); in xconnect_write_coefs_process()
10928 && ((p - plci->internal_req_buffer) + 16 < INTERNAL_REQ_BUFFER_SIZE)); in xconnect_write_coefs_process()
10932 plci->internal_command = plci->li_write_command; in xconnect_write_coefs_process()
10933 if (plci_nl_busy(plci)) in xconnect_write_coefs_process()
10950 if ((plci->tel == ADV_VOICE) && (plci == a->AdvSignalPLCI) in xconnect_write_coefs_process()
10963 if (plci->li_bchannel_id == 2) in xconnect_write_coefs_process()
10994 w = (plci == a->AdvSignalPLCI) ? n : mixer_swapped_index_bri[n]; in xconnect_write_coefs_process()
11009 plci->internal_command = plci->li_write_command; in xconnect_write_coefs_process()
11010 if (plci_nl_busy(plci)) in xconnect_write_coefs_process()
11026 *(p++) = (byte)((plci->li_bchannel_id - 1) | mixer_write_prog_pri[n].line_flags); in xconnect_write_coefs_process()
11038 …*(p++) = (byte)((plci->li_bchannel_id - 1) | MIXER_COEF_LINE_ROW_FLAG | mixer_write_prog_pri[n].li… in xconnect_write_coefs_process()
11056 if ((plci->tel == ADV_VOICE) && (plci == a->AdvSignalPLCI) in xconnect_write_coefs_process()
11069 if (plci->li_bchannel_id == 2) in xconnect_write_coefs_process()
11095 w = (plci == a->AdvSignalPLCI) ? n : mixer_swapped_index_bri[n]; in xconnect_write_coefs_process()
11106 plci->li_write_channel = j; in xconnect_write_coefs_process()
11107 if (p != plci->internal_req_buffer) in xconnect_write_coefs_process()
11109 plci->NData[0].P = plci->internal_req_buffer; in xconnect_write_coefs_process()
11110 plci->NData[0].PLength = p - plci->internal_req_buffer; in xconnect_write_coefs_process()
11111 plci->NL.X = plci->NData; in xconnect_write_coefs_process()
11112 plci->NL.ReqCh = 0; in xconnect_write_coefs_process()
11113 plci->NL.Req = plci->nl_req = (byte) N_UDATA; in xconnect_write_coefs_process()
11114 plci->adapter->request(&plci->NL); in xconnect_write_coefs_process()
11120 static void mixer_notify_update(PLCI *plci, byte others) in mixer_notify_update() argument
11128 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_notify_update()
11131 a = plci->adapter; in mixer_notify_update()
11135 plci->li_notify_update = true; in mixer_notify_update()
11142 while ((i < li_total_channels) && (li_config_table[i].plci == NULL)) in mixer_notify_update()
11145 notify_plci = li_config_table[i++].plci; in mixer_notify_update()
11149 if ((plci->li_bchannel_id != 0) in mixer_notify_update()
11150 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_notify_update()
11152 notify_plci = plci; in mixer_notify_update()
11167 ((CAPI_MSG *) msg)->header.plci = notify_plci->Id; in mixer_notify_update()
11180 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_notify_update()
11189 plci->li_notify_update = false; in mixer_notify_update()
11194 static void mixer_clear_config(PLCI *plci) in mixer_clear_config() argument
11200 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_clear_config()
11203 plci->li_notify_update = false; in mixer_clear_config()
11204 plci->li_plci_b_write_pos = 0; in mixer_clear_config()
11205 plci->li_plci_b_read_pos = 0; in mixer_clear_config()
11206 plci->li_plci_b_req_pos = 0; in mixer_clear_config()
11207 a = plci->adapter; in mixer_clear_config()
11208 if ((plci->li_bchannel_id != 0) in mixer_clear_config()
11209 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_clear_config()
11211 i = a->li_base + (plci->li_bchannel_id - 1); in mixer_clear_config()
11225 if ((plci->tel == ADV_VOICE) && (plci == a->AdvSignalPLCI)) in mixer_clear_config()
11227 i = a->li_base + MIXER_IC_CHANNEL_BASE + (plci->li_bchannel_id - 1); in mixer_clear_config()
11240 i = a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id); in mixer_clear_config()
11258 static void mixer_prepare_switch(dword Id, PLCI *plci) in mixer_prepare_switch() argument
11266 mixer_indication_coefs_set(Id, plci); in mixer_prepare_switch()
11267 } while (plci->li_plci_b_read_pos != plci->li_plci_b_req_pos); in mixer_prepare_switch()
11271 static word mixer_save_config(dword Id, PLCI *plci, byte Rc) in mixer_save_config() argument
11277 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in mixer_save_config()
11279 a = plci->adapter; in mixer_save_config()
11280 if ((plci->li_bchannel_id != 0) in mixer_save_config()
11281 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_save_config()
11283 i = a->li_base + (plci->li_bchannel_id - 1); in mixer_save_config()
11296 static word mixer_restore_config(dword Id, PLCI *plci, byte Rc) in mixer_restore_config() argument
11302 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in mixer_restore_config()
11305 a = plci->adapter; in mixer_restore_config()
11306 if ((plci->B1_facilities & B1_FACILITY_MIXER) in mixer_restore_config()
11307 && (plci->li_bchannel_id != 0) in mixer_restore_config()
11308 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_restore_config()
11310 switch (plci->adjust_b_state) in mixer_restore_config()
11315 plci->internal_command = plci->adjust_b_command; in mixer_restore_config()
11316 if (plci_nl_busy(plci)) in mixer_restore_config()
11318 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_1; in mixer_restore_config()
11321 xconnect_query_addresses(plci); in mixer_restore_config()
11322 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_2; in mixer_restore_config()
11325 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_5; in mixer_restore_config()
11340 if (plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_2) in mixer_restore_config()
11341 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_3; in mixer_restore_config()
11342 else if (plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_4) in mixer_restore_config()
11343 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_5; in mixer_restore_config()
11347 if (plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_2) in mixer_restore_config()
11348 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_4; in mixer_restore_config()
11349 else if (plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_3) in mixer_restore_config()
11350 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_5; in mixer_restore_config()
11352 if (plci->adjust_b_state != ADJUST_B_RESTORE_MIXER_5) in mixer_restore_config()
11354 plci->internal_command = plci->adjust_b_command; in mixer_restore_config()
11359 xconnect_write_coefs(plci, plci->adjust_b_command); in mixer_restore_config()
11360 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_6; in mixer_restore_config()
11364 if (!xconnect_write_coefs_process(Id, plci, Rc)) in mixer_restore_config()
11371 if (plci->internal_command) in mixer_restore_config()
11373 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_7; in mixer_restore_config()
11382 static void mixer_command(dword Id, PLCI *plci, byte Rc) in mixer_command() argument
11388 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command, in mixer_command()
11389 plci->li_cmd)); in mixer_command()
11391 a = plci->adapter; in mixer_command()
11392 internal_command = plci->internal_command; in mixer_command()
11393 plci->internal_command = 0; in mixer_command()
11394 switch (plci->li_cmd) in mixer_command()
11402 if (plci->li_channel_bits & LI_CHANNEL_INVOLVED) in mixer_command()
11404 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | in mixer_command()
11409 if (plci->li_channel_bits & LI_CHANNEL_INVOLVED) in mixer_command()
11411 if (adjust_b_process(Id, plci, Rc) != GOOD) in mixer_command()
11417 if (plci->internal_command) in mixer_command()
11420 plci->li_plci_b_req_pos = plci->li_plci_b_write_pos; in mixer_command()
11421 if ((plci->li_channel_bits & LI_CHANNEL_INVOLVED) in mixer_command()
11422 || ((get_b1_facilities(plci, plci->B1_resource) & B1_FACILITY_MIXER) in mixer_command()
11423 && (add_b1_facilities(plci, plci->B1_resource, (word)(plci->B1_facilities & in mixer_command()
11424 ~B1_FACILITY_MIXER)) == plci->B1_resource))) in mixer_command()
11426 xconnect_write_coefs(plci, MIXER_COMMAND_2); in mixer_command()
11432 mixer_indication_coefs_set(Id, plci); in mixer_command()
11433 } while (plci->li_plci_b_read_pos != plci->li_plci_b_req_pos); in mixer_command()
11437 if ((plci->li_channel_bits & LI_CHANNEL_INVOLVED) in mixer_command()
11438 || ((get_b1_facilities(plci, plci->B1_resource) & B1_FACILITY_MIXER) in mixer_command()
11439 && (add_b1_facilities(plci, plci->B1_resource, (word)(plci->B1_facilities & in mixer_command()
11440 ~B1_FACILITY_MIXER)) == plci->B1_resource))) in mixer_command()
11442 if (!xconnect_write_coefs_process(Id, plci, Rc)) in mixer_command()
11446 if (plci->li_plci_b_write_pos != plci->li_plci_b_req_pos) in mixer_command()
11450 plci->li_plci_b_write_pos = (plci->li_plci_b_write_pos == 0) ? in mixer_command()
11451 LI_PLCI_B_QUEUE_ENTRIES - 1 : plci->li_plci_b_write_pos - 1; in mixer_command()
11452 i = (plci->li_plci_b_write_pos == 0) ? in mixer_command()
11453 LI_PLCI_B_QUEUE_ENTRIES - 1 : plci->li_plci_b_write_pos - 1; in mixer_command()
11454 } while ((plci->li_plci_b_write_pos != plci->li_plci_b_req_pos) in mixer_command()
11455 && !(plci->li_plci_b_queue[i] & LI_PLCI_B_LAST_FLAG)); in mixer_command()
11459 if (plci->internal_command) in mixer_command()
11462 if (!(plci->li_channel_bits & LI_CHANNEL_INVOLVED)) in mixer_command()
11464 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities & in mixer_command()
11469 if (!(plci->li_channel_bits & LI_CHANNEL_INVOLVED)) in mixer_command()
11471 if (adjust_b_process(Id, plci, Rc) != GOOD) in mixer_command()
11477 if (plci->internal_command) in mixer_command()
11484 if ((plci->li_bchannel_id == 0) in mixer_command()
11485 || (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci != plci)) in mixer_command()
11488 UnMapId(Id), (char *)(FILE_), __LINE__, (int)(plci->li_bchannel_id))); in mixer_command()
11492 i = a->li_base + (plci->li_bchannel_id - 1); in mixer_command()
11493 li_config_table[i].curchnl = plci->li_channel_bits; in mixer_command()
11494 if (!a->li_pri && (plci->tel == ADV_VOICE) && (plci == a->AdvSignalPLCI)) in mixer_command()
11496 i = a->li_base + MIXER_IC_CHANNEL_BASE + (plci->li_bchannel_id - 1); in mixer_command()
11497 li_config_table[i].curchnl = plci->li_channel_bits; in mixer_command()
11500 i = a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id); in mixer_command()
11501 li_config_table[i].curchnl = plci->li_channel_bits; in mixer_command()
11508 static void li_update_connect(dword Id, DIVA_CAPI_ADAPTER *a, PLCI *plci, in li_update_connect() argument
11516 plci_b = &(a_b->plci[((plci_b_id >> 8) & 0xff) - 1]); in li_update_connect()
11517 ch_a = a->li_base + (plci->li_bchannel_id - 1); in li_update_connect()
11518 if (!a->li_pri && (plci->tel == ADV_VOICE) in li_update_connect()
11519 && (plci == a->AdvSignalPLCI) && (Id & EXT_CONTROLLER)) in li_update_connect()
11523 a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id) : ch_a_v; in li_update_connect()
11651 static void li2_update_connect(dword Id, DIVA_CAPI_ADAPTER *a, PLCI *plci, in li2_update_connect() argument
11659 plci_b = &(a_b->plci[((plci_b_id >> 8) & 0xff) - 1]); in li2_update_connect()
11660 ch_a = a->li_base + (plci->li_bchannel_id - 1); in li2_update_connect()
11661 if (!a->li_pri && (plci->tel == ADV_VOICE) in li2_update_connect()
11662 && (plci == a->AdvSignalPLCI) && (Id & EXT_CONTROLLER)) in li2_update_connect()
11666 a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id) : ch_a_v; in li2_update_connect()
11759 static word li_check_main_plci(dword Id, PLCI *plci) in li_check_main_plci() argument
11761 if (plci == NULL) in li_check_main_plci()
11767 if (!plci->State in li_check_main_plci()
11768 || !plci->NL.Id || plci->nl_remove_id in li_check_main_plci()
11769 || (plci->li_bchannel_id == 0)) in li_check_main_plci()
11775 li_config_table[plci->adapter->li_base + (plci->li_bchannel_id - 1)].plci = plci; in li_check_main_plci()
11780 static PLCI *li_check_plci_b(dword Id, PLCI *plci, in li_check_plci_b() argument
11786 if (((plci->li_plci_b_read_pos > plci_b_write_pos) ? plci->li_plci_b_read_pos : in li_check_plci_b()
11787 LI_PLCI_B_QUEUE_ENTRIES + plci->li_plci_b_read_pos) - plci_b_write_pos - 1 < 2) in li_check_plci_b()
11810 plci_b = &(adapter[ctlr_b - 1].plci[((plci_b_id >> 8) & 0xff) - 1]); in li_check_plci_b()
11820 li_config_table[plci_b->adapter->li_base + (plci_b->li_bchannel_id - 1)].plci = plci_b; in li_check_plci_b()
11822 ((byte)(UnMapController(plci->adapter->Id) & ~EXT_CONTROLLER)) in li_check_plci_b()
11823 && (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XCONNECT) in li_check_plci_b()
11843 static PLCI *li2_check_plci_b(dword Id, PLCI *plci, in li2_check_plci_b() argument
11849 if (((plci->li_plci_b_read_pos > plci_b_write_pos) ? plci->li_plci_b_read_pos : in li2_check_plci_b()
11850 LI_PLCI_B_QUEUE_ENTRIES + plci->li_plci_b_read_pos) - plci_b_write_pos - 1 < 2) in li2_check_plci_b()
11873 plci_b = &(adapter[ctlr_b - 1].plci[((plci_b_id >> 8) & 0xff) - 1]); in li2_check_plci_b()
11877 || (li_config_table[plci_b->adapter->li_base + (plci_b->li_bchannel_id - 1)].plci != plci_b)) in li2_check_plci_b()
11885 ((byte)(UnMapController(plci->adapter->Id) & ~EXT_CONTROLLER)) in li2_check_plci_b()
11886 && (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XCONNECT) in li2_check_plci_b()
11906 static byte mixer_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, AP… in mixer_request() argument
12032 Info = li_check_main_plci(Id, plci); in mixer_request()
12039 result = plci->saved_msg.info; in mixer_request()
12042 plci_b_write_pos = plci->li_plci_b_write_pos; in mixer_request()
12043 plci_b = li_check_plci_b(Id, plci, plci_b_id, plci_b_write_pos, &result[8]); in mixer_request()
12046 li_update_connect(Id, a, plci, plci_b_id, true, li_flags); in mixer_request()
12047 plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_LAST_FLAG; in mixer_request()
12049 plci->li_plci_b_write_pos = plci_b_write_pos; in mixer_request()
12062 Info = li_check_main_plci(Id, plci); in mixer_request()
12069 result = plci->saved_msg.info; in mixer_request()
12072 plci_b_write_pos = plci->li_plci_b_write_pos; in mixer_request()
12075 li2_update_connect(Id, a, plci, UnMapId(Id), true, li_flags); in mixer_request()
12108 plci_b = li2_check_plci_b(Id, plci, plci_b_id, plci_b_write_pos, &result[result_pos - 2]); in mixer_request()
12111 li2_update_connect(Id, a, plci, plci_b_id, true, li_flags); in mixer_request()
12112 plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | in mixer_request()
12124 if ((plci_b_write_pos == plci->li_plci_b_read_pos) in mixer_request()
12125 || (plci->li_plci_b_queue[i] & LI_PLCI_B_LAST_FLAG)) in mixer_request()
12127 plci->li_plci_b_queue[plci_b_write_pos] = LI_PLCI_B_SKIP_FLAG | LI_PLCI_B_LAST_FLAG; in mixer_request()
12131 plci->li_plci_b_queue[i] |= LI_PLCI_B_LAST_FLAG; in mixer_request()
12132 plci->li_plci_b_write_pos = plci_b_write_pos; in mixer_request()
12135 plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel; in mixer_request()
12136 mixer_notify_update(plci, true); in mixer_request()
12139 plci->command = 0; in mixer_request()
12140 plci->li_cmd = GET_WORD(li_parms[0].info); in mixer_request()
12141 start_internal_command(Id, plci, mixer_command); in mixer_request()
12156 Info = li_check_main_plci(Id, plci); in mixer_request()
12163 result = plci->saved_msg.info; in mixer_request()
12166 plci_b_write_pos = plci->li_plci_b_write_pos; in mixer_request()
12167 plci_b = li_check_plci_b(Id, plci, plci_b_id, plci_b_write_pos, &result[8]); in mixer_request()
12170 li_update_connect(Id, a, plci, plci_b_id, false, 0); in mixer_request()
12171 plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG | LI_PLCI_B_LAST_FLAG; in mixer_request()
12173 plci->li_plci_b_write_pos = plci_b_write_pos; in mixer_request()
12185 Info = li_check_main_plci(Id, plci); in mixer_request()
12192 result = plci->saved_msg.info; in mixer_request()
12195 plci_b_write_pos = plci->li_plci_b_write_pos; in mixer_request()
12229 plci_b = li2_check_plci_b(Id, plci, plci_b_id, plci_b_write_pos, &result[result_pos - 2]); in mixer_request()
12232 li2_update_connect(Id, a, plci, plci_b_id, false, 0); in mixer_request()
12233 plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG; in mixer_request()
12243 if ((plci_b_write_pos == plci->li_plci_b_read_pos) in mixer_request()
12244 || (plci->li_plci_b_queue[i] & LI_PLCI_B_LAST_FLAG)) in mixer_request()
12246 plci->li_plci_b_queue[plci_b_write_pos] = LI_PLCI_B_SKIP_FLAG | LI_PLCI_B_LAST_FLAG; in mixer_request()
12250 plci->li_plci_b_queue[i] |= LI_PLCI_B_LAST_FLAG; in mixer_request()
12251 plci->li_plci_b_write_pos = plci_b_write_pos; in mixer_request()
12254 plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel; in mixer_request()
12255 mixer_notify_update(plci, true); in mixer_request()
12258 plci->command = 0; in mixer_request()
12259 plci->li_cmd = GET_WORD(li_parms[0].info); in mixer_request()
12260 start_internal_command(Id, plci, mixer_command); in mixer_request()
12264 if (!plci || !plci->State in mixer_request()
12265 || !plci->NL.Id || plci->nl_remove_id in mixer_request()
12266 || (plci->li_bchannel_id == 0) in mixer_request()
12267 || (li_config_table[plci->adapter->li_base + (plci->li_bchannel_id - 1)].plci != plci)) in mixer_request()
12273 plci_b_write_pos = plci->li_plci_b_write_pos; in mixer_request()
12274 if (((plci->li_plci_b_read_pos > plci_b_write_pos) ? plci->li_plci_b_read_pos : in mixer_request()
12275 LI_PLCI_B_QUEUE_ENTRIES + plci->li_plci_b_read_pos) - plci_b_write_pos - 1 < 2) in mixer_request()
12282 if ((plci_b_write_pos == plci->li_plci_b_read_pos) in mixer_request()
12283 || (plci->li_plci_b_queue[i] & LI_PLCI_B_LAST_FLAG)) in mixer_request()
12285 plci->li_plci_b_queue[plci_b_write_pos] = LI_PLCI_B_SKIP_FLAG | LI_PLCI_B_LAST_FLAG; in mixer_request()
12289 plci->li_plci_b_queue[i] |= LI_PLCI_B_LAST_FLAG; in mixer_request()
12290 plci->li_plci_b_write_pos = plci_b_write_pos; in mixer_request()
12291 plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel; in mixer_request()
12292 plci->command = 0; in mixer_request()
12293 plci->li_cmd = GET_WORD(li_parms[0].info); in mixer_request()
12294 start_internal_command(Id, plci, mixer_command); in mixer_request()
12309 static void mixer_indication_coefs_set(dword Id, PLCI *plci) in mixer_indication_coefs_set() argument
12317 if (plci->li_plci_b_read_pos != plci->li_plci_b_req_pos) in mixer_indication_coefs_set()
12321 d = plci->li_plci_b_queue[plci->li_plci_b_read_pos]; in mixer_indication_coefs_set()
12324 if (plci->appl->appl_flags & APPL_FLAG_OLD_LI_SPEC) in mixer_indication_coefs_set()
12359 sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, in mixer_indication_coefs_set()
12362 plci->li_plci_b_read_pos = (plci->li_plci_b_read_pos == LI_PLCI_B_QUEUE_ENTRIES - 1) ? in mixer_indication_coefs_set()
12363 0 : plci->li_plci_b_read_pos + 1; in mixer_indication_coefs_set()
12364 } while (!(d & LI_PLCI_B_LAST_FLAG) && (plci->li_plci_b_read_pos != plci->li_plci_b_req_pos)); in mixer_indication_coefs_set()
12369 static void mixer_indication_xconnect_from(dword Id, PLCI *plci, byte *msg, word length) in mixer_indication_xconnect_from() argument
12378 a = plci->adapter; in mixer_indication_xconnect_from()
12387 if (!a->li_pri && (plci->li_bchannel_id == 2)) in mixer_indication_xconnect_from()
12399 if (plci->internal_command_queue[0] in mixer_indication_xconnect_from()
12400 && ((plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_2) in mixer_indication_xconnect_from()
12401 || (plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_3) in mixer_indication_xconnect_from()
12402 || (plci->adjust_b_state == ADJUST_B_RESTORE_MIXER_4))) in mixer_indication_xconnect_from()
12404 (*(plci->internal_command_queue[0]))(Id, plci, 0); in mixer_indication_xconnect_from()
12405 if (!plci->internal_command) in mixer_indication_xconnect_from()
12406 next_internal_command(Id, plci); in mixer_indication_xconnect_from()
12408 mixer_notify_update(plci, true); in mixer_indication_xconnect_from()
12412 static void mixer_indication_xconnect_to(dword Id, PLCI *plci, byte *msg, word length) in mixer_indication_xconnect_to() argument
12421 static byte mixer_notify_source_removed(PLCI *plci, dword plci_b_id) in mixer_notify_source_removed() argument
12425 plci_b_write_pos = plci->li_plci_b_write_pos; in mixer_notify_source_removed()
12426 if (((plci->li_plci_b_read_pos > plci_b_write_pos) ? plci->li_plci_b_read_pos : in mixer_notify_source_removed()
12427 LI_PLCI_B_QUEUE_ENTRIES + plci->li_plci_b_read_pos) - plci_b_write_pos - 1 < 1) in mixer_notify_source_removed()
12430 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_notify_source_removed()
12434 plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG; in mixer_notify_source_removed()
12436 plci->li_plci_b_write_pos = plci_b_write_pos; in mixer_notify_source_removed()
12441 static void mixer_remove(PLCI *plci) in mixer_remove() argument
12449 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in mixer_remove()
12452 a = plci->adapter; in mixer_remove()
12453 plci_b_id = (plci->Id << 8) | UnMapController(plci->adapter->Id); in mixer_remove()
12456 if ((plci->li_bchannel_id != 0) in mixer_remove()
12457 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in mixer_remove()
12459 i = a->li_base + (plci->li_bchannel_id - 1); in mixer_remove()
12467 notify_plci = li_config_table[j].plci; in mixer_remove()
12469 && (notify_plci != plci) in mixer_remove()
12479 mixer_clear_config(plci); in mixer_remove()
12481 mixer_notify_update(plci, true); in mixer_remove()
12483 li_config_table[i].plci = NULL; in mixer_remove()
12484 plci->li_bchannel_id = 0; in mixer_remove()
12495 static void ec_write_parameters(PLCI *plci) in ec_write_parameters() argument
12501 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in ec_write_parameters()
12506 PUT_WORD(¶meter_buffer[2], plci->ec_idi_options); in ec_write_parameters()
12507 plci->ec_idi_options &= ~LEC_RESET_COEFFICIENTS; in ec_write_parameters()
12508 w = (plci->ec_tail_length == 0) ? 128 : plci->ec_tail_length; in ec_write_parameters()
12510 add_p(plci, FTY, parameter_buffer); in ec_write_parameters()
12511 sig_req(plci, TEL_CTRL, 0); in ec_write_parameters()
12512 send_req(plci); in ec_write_parameters()
12516 static void ec_clear_config(PLCI *plci) in ec_clear_config() argument
12520 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in ec_clear_config()
12523 plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER | in ec_clear_config()
12525 plci->ec_tail_length = 0; in ec_clear_config()
12529 static void ec_prepare_switch(dword Id, PLCI *plci) in ec_prepare_switch() argument
12538 static word ec_save_config(dword Id, PLCI *plci, byte Rc) in ec_save_config() argument
12542 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in ec_save_config()
12548 static word ec_restore_config(dword Id, PLCI *plci, byte Rc) in ec_restore_config() argument
12553 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in ec_restore_config()
12556 if (plci->B1_facilities & B1_FACILITY_EC) in ec_restore_config()
12558 switch (plci->adjust_b_state) in ec_restore_config()
12561 plci->internal_command = plci->adjust_b_command; in ec_restore_config()
12562 if (plci->sig_req) in ec_restore_config()
12564 plci->adjust_b_state = ADJUST_B_RESTORE_EC_1; in ec_restore_config()
12567 ec_write_parameters(plci); in ec_restore_config()
12568 plci->adjust_b_state = ADJUST_B_RESTORE_EC_2; in ec_restore_config()
12585 static void ec_command(dword Id, PLCI *plci, byte Rc) in ec_command() argument
12591 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command, in ec_command()
12592 plci->ec_cmd, plci->ec_idi_options, plci->ec_tail_length)); in ec_command()
12595 if (plci->appl->appl_flags & APPL_FLAG_PRIV_EC_SPEC) in ec_command()
12603 PUT_WORD(&result[1], plci->ec_cmd); in ec_command()
12607 internal_command = plci->internal_command; in ec_command()
12608 plci->internal_command = 0; in ec_command()
12609 switch (plci->ec_cmd) in ec_command()
12618 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities | in ec_command()
12622 if (adjust_b_process(Id, plci, Rc) != GOOD) in ec_command()
12629 if (plci->internal_command) in ec_command()
12633 if (plci->sig_req) in ec_command()
12635 plci->internal_command = EC_COMMAND_2; in ec_command()
12638 plci->internal_command = EC_COMMAND_3; in ec_command()
12639 ec_write_parameters(plci); in ec_command()
12658 if (plci->B1_facilities & B1_FACILITY_EC) in ec_command()
12660 if (plci->sig_req) in ec_command()
12662 plci->internal_command = EC_COMMAND_1; in ec_command()
12665 plci->internal_command = EC_COMMAND_2; in ec_command()
12666 ec_write_parameters(plci); in ec_command()
12679 adjust_b1_resource(Id, plci, NULL, (word)(plci->B1_facilities & in ec_command()
12683 if (adjust_b_process(Id, plci, Rc) != GOOD) in ec_command()
12690 if (plci->internal_command) in ec_command()
12696 sendf(plci->appl, _FACILITY_R | CONFIRM, Id & 0xffffL, plci->number, in ec_command()
12697 "wws", Info, (plci->appl->appl_flags & APPL_FLAG_PRIV_EC_SPEC) ? in ec_command()
12702 static byte ec_request(dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, API_P… in ec_request() argument
12732 if (plci == NULL) in ec_request()
12738 else if (!plci->State || !plci->NL.Id || plci->nl_remove_id) in ec_request()
12746 plci->command = 0; in ec_request()
12747 plci->ec_cmd = GET_WORD(ec_parms[0].info); in ec_request()
12748 plci->ec_idi_options &= ~(LEC_MANUAL_DISABLE | LEC_RESET_COEFFICIENTS); in ec_request()
12754 plci->ec_idi_options &= ~(LEC_ENABLE_NONLINEAR_PROCESSING | in ec_request()
12757 plci->ec_idi_options |= LEC_ENABLE_NONLINEAR_PROCESSING; in ec_request()
12759 plci->ec_idi_options |= LEC_ENABLE_2100HZ_DETECTOR; in ec_request()
12761 plci->ec_idi_options |= LEC_REQUIRE_2100HZ_REVERSALS; in ec_request()
12764 plci->ec_tail_length = GET_WORD(&ec_parms[0].info[4]); in ec_request()
12767 switch (plci->ec_cmd) in ec_request()
12770 plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS; in ec_request()
12771 start_internal_command(Id, plci, ec_command); in ec_request()
12775 plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER | in ec_request()
12778 start_internal_command(Id, plci, ec_command); in ec_request()
12782 plci->ec_idi_options |= LEC_FREEZE_COEFFICIENTS; in ec_request()
12783 start_internal_command(Id, plci, ec_command); in ec_request()
12787 plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS; in ec_request()
12788 start_internal_command(Id, plci, ec_command); in ec_request()
12792 plci->ec_idi_options |= LEC_RESET_COEFFICIENTS; in ec_request()
12793 start_internal_command(Id, plci, ec_command); in ec_request()
12798 UnMapId(Id), (char *)(FILE_), __LINE__, plci->ec_cmd)); in ec_request()
12824 else if (plci == NULL) in ec_request()
12830 else if (!plci->State || !plci->NL.Id || plci->nl_remove_id) in ec_request()
12838 plci->command = 0; in ec_request()
12839 plci->ec_cmd = GET_WORD(ec_parms[0].info); in ec_request()
12840 plci->ec_idi_options &= ~(LEC_MANUAL_DISABLE | LEC_RESET_COEFFICIENTS); in ec_request()
12842 PUT_WORD(&result[1], plci->ec_cmd); in ec_request()
12845 plci->ec_idi_options &= ~(LEC_ENABLE_NONLINEAR_PROCESSING | in ec_request()
12847 plci->ec_tail_length = 0; in ec_request()
12852 plci->ec_idi_options |= LEC_ENABLE_NONLINEAR_PROCESSING; in ec_request()
12854 plci->ec_idi_options |= LEC_ENABLE_2100HZ_DETECTOR; in ec_request()
12856 plci->ec_idi_options |= LEC_REQUIRE_2100HZ_REVERSALS; in ec_request()
12859 plci->ec_tail_length = GET_WORD(&ec_parms[1].info[3]); in ec_request()
12862 switch (plci->ec_cmd) in ec_request()
12865 plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS; in ec_request()
12866 start_internal_command(Id, plci, ec_command); in ec_request()
12870 plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER | in ec_request()
12873 start_internal_command(Id, plci, ec_command); in ec_request()
12878 UnMapId(Id), (char *)(FILE_), __LINE__, plci->ec_cmd)); in ec_request()
12892 static void ec_indication(dword Id, PLCI *plci, byte *msg, word length) in ec_indication() argument
12899 if (!(plci->ec_idi_options & LEC_MANUAL_DISABLE)) in ec_indication()
12901 if (plci->appl->appl_flags & APPL_FLAG_PRIV_EC_SPEC) in ec_indication()
12937 …sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, "ws", (plci->appl->appl_flags & APPL_FLAG_PRIV_EC_… in ec_indication()
12948 static void adv_voice_write_coefs(PLCI *plci, word write_command) in adv_voice_write_coefs() argument
12960 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in adv_voice_write_coefs()
12963 a = plci->adapter; in adv_voice_write_coefs()
12980 if (!a->li_pri && (plci->li_bchannel_id == 0)) in adv_voice_write_coefs()
12982 if ((li_config_table[a->li_base].plci == NULL) && (li_config_table[a->li_base + 1].plci != NULL)) in adv_voice_write_coefs()
12984 plci->li_bchannel_id = 1; in adv_voice_write_coefs()
12985 li_config_table[a->li_base].plci = plci; in adv_voice_write_coefs()
12987 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in adv_voice_write_coefs()
12988 (char *)(FILE_), __LINE__, plci->li_bchannel_id)); in adv_voice_write_coefs()
12990 …else if ((li_config_table[a->li_base].plci != NULL) && (li_config_table[a->li_base + 1].plci == NU… in adv_voice_write_coefs()
12992 plci->li_bchannel_id = 2; in adv_voice_write_coefs()
12993 li_config_table[a->li_base + 1].plci = plci; in adv_voice_write_coefs()
12995 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in adv_voice_write_coefs()
12996 (char *)(FILE_), __LINE__, plci->li_bchannel_id)); in adv_voice_write_coefs()
12999 if (!a->li_pri && (plci->li_bchannel_id != 0) in adv_voice_write_coefs()
13000 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in adv_voice_write_coefs()
13002 i = a->li_base + (plci->li_bchannel_id - 1); in adv_voice_write_coefs()
13006 j = a->li_base + MIXER_IC_CHANNEL_BASE + (plci->li_bchannel_id - 1); in adv_voice_write_coefs()
13007 k = a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id); in adv_voice_write_coefs()
13008 if (!(plci->B1_facilities & B1_FACILITY_MIXER)) in adv_voice_write_coefs()
13033 k = a->li_base + MIXER_IC_CHANNEL_BASE + (plci->li_bchannel_id - 1); in adv_voice_write_coefs()
13041 k = a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id); in adv_voice_write_coefs()
13051 if (plci->B1_facilities & B1_FACILITY_MIXER) in adv_voice_write_coefs()
13064 ch_map[j] = (byte)(j + (plci->li_bchannel_id - 1)); in adv_voice_write_coefs()
13065 ch_map[j + 1] = (byte)(j + (2 - plci->li_bchannel_id)); in adv_voice_write_coefs()
13097 add_p(plci, FTY, coef_buffer); in adv_voice_write_coefs()
13098 sig_req(plci, TEL_CTRL, 0); in adv_voice_write_coefs()
13099 send_req(plci); in adv_voice_write_coefs()
13103 static void adv_voice_clear_config(PLCI *plci) in adv_voice_clear_config() argument
13111 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in adv_voice_clear_config()
13114 a = plci->adapter; in adv_voice_clear_config()
13115 if ((plci->tel == ADV_VOICE) && (plci == a->AdvSignalPLCI)) in adv_voice_clear_config()
13119 if (!a->li_pri && (plci->li_bchannel_id != 0) in adv_voice_clear_config()
13120 && (li_config_table[a->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in adv_voice_clear_config()
13122 i = a->li_base + (plci->li_bchannel_id - 1); in adv_voice_clear_config()
13134 i = a->li_base + MIXER_IC_CHANNEL_BASE + (plci->li_bchannel_id - 1); in adv_voice_clear_config()
13147 i = a->li_base + MIXER_IC_CHANNEL_BASE + (2 - plci->li_bchannel_id); in adv_voice_clear_config()
13165 static void adv_voice_prepare_switch(dword Id, PLCI *plci) in adv_voice_prepare_switch() argument
13174 static word adv_voice_save_config(dword Id, PLCI *plci, byte Rc) in adv_voice_save_config() argument
13178 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in adv_voice_save_config()
13184 static word adv_voice_restore_config(dword Id, PLCI *plci, byte Rc) in adv_voice_restore_config() argument
13190 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in adv_voice_restore_config()
13193 a = plci->adapter; in adv_voice_restore_config()
13194 if ((plci->B1_facilities & B1_FACILITY_VOICE) in adv_voice_restore_config()
13195 && (plci->tel == ADV_VOICE) && (plci == a->AdvSignalPLCI)) in adv_voice_restore_config()
13197 switch (plci->adjust_b_state) in adv_voice_restore_config()
13200 plci->internal_command = plci->adjust_b_command; in adv_voice_restore_config()
13201 if (plci->sig_req) in adv_voice_restore_config()
13203 plci->adjust_b_state = ADJUST_B_RESTORE_VOICE_1; in adv_voice_restore_config()
13206 adv_voice_write_coefs(plci, ADV_VOICE_WRITE_UPDATE); in adv_voice_restore_config()
13207 plci->adjust_b_state = ADJUST_B_RESTORE_VOICE_2; in adv_voice_restore_config()
13274 static word get_b1_facilities(PLCI *plci, byte b1_resource) in get_b1_facilities() argument
13282 if (!(((plci->requested_options_conn | plci->requested_options) & (1L << PRIVATE_DTMF_TONE)) in get_b1_facilities()
13283 …|| (plci->appl && (plci->adapter->requested_options_table[plci->appl->Id - 1] & (1L << PRIVATE_DTM… in get_b1_facilities()
13286 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_SOFTDTMF_SEND) in get_b1_facilities()
13288 if (plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_SOFTDTMF_RECEIVE) in get_b1_facilities()
13294 if (plci->adapter->manufacturer_features & (MANUFACTURER_FEATURE_V18 | MANUFACTURER_FEATURE_VOWN)) in get_b1_facilities()
13306 static byte add_b1_facilities(PLCI *plci, byte b1_resource, word b1_facilities) in add_b1_facilities() argument
13351 && (((plci->requested_options_conn | plci->requested_options) & (1L << PRIVATE_DTMF_TONE)) in add_b1_facilities()
13352 …|| (plci->appl && (plci->adapter->requested_options_table[plci->appl->Id - 1] & (1L << PRIVATE_DTM… in add_b1_facilities()
13362 else if (((plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_HARDDTMF) in add_b1_facilities()
13363 && !(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_SOFTDTMF_RECEIVE)) in add_b1_facilities()
13366 || !(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_SOFTDTMF_RECEIVE))) in add_b1_facilities()
13369 || !(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_SOFTDTMF_SEND)))) in add_b1_facilities()
13404 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in add_b1_facilities()
13406 b1_resource, b1_facilities, b, get_b1_facilities(plci, b))); in add_b1_facilities()
13411 static void adjust_b1_facilities(PLCI *plci, byte new_b1_resource, word new_b1_facilities) in adjust_b1_facilities() argument
13416 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in adjust_b1_facilities()
13418 new_b1_facilities & get_b1_facilities(plci, new_b1_resource))); in adjust_b1_facilities()
13420 new_b1_facilities &= get_b1_facilities(plci, new_b1_resource); in adjust_b1_facilities()
13421 removed_facilities = plci->B1_facilities & ~new_b1_facilities; in adjust_b1_facilities()
13424 ec_clear_config(plci); in adjust_b1_facilities()
13429 dtmf_rec_clear_config(plci); in adjust_b1_facilities()
13430 dtmf_parameter_clear_config(plci); in adjust_b1_facilities()
13433 dtmf_send_clear_config(plci); in adjust_b1_facilities()
13437 mixer_clear_config(plci); in adjust_b1_facilities()
13440 adv_voice_clear_config(plci); in adjust_b1_facilities()
13441 plci->B1_facilities = new_b1_facilities; in adjust_b1_facilities()
13445 static void adjust_b_clear(PLCI *plci) in adjust_b_clear() argument
13449 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in adjust_b_clear()
13452 plci->adjust_b_restore = false; in adjust_b_clear()
13456 static word adjust_b_process(dword Id, PLCI *plci, byte Rc) in adjust_b_process() argument
13464 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->adjust_b_state)); in adjust_b_process()
13467 switch (plci->adjust_b_state) in adjust_b_process()
13470 if ((plci->adjust_b_parms_msg == NULL) in adjust_b_process()
13471 && (plci->adjust_b_mode & ADJUST_B_MODE_SWITCH_L1) in adjust_b_process()
13472 && ((plci->adjust_b_mode & ~(ADJUST_B_MODE_SAVE | ADJUST_B_MODE_SWITCH_L1 | in adjust_b_process()
13475 b1_resource = (plci->adjust_b_mode == ADJUST_B_MODE_NO_RESOURCE) ? in adjust_b_process()
13476 0 : add_b1_facilities(plci, plci->B1_resource, plci->adjust_b_facilities); in adjust_b_process()
13477 if (b1_resource == plci->B1_resource) in adjust_b_process()
13479 adjust_b1_facilities(plci, b1_resource, plci->adjust_b_facilities); in adjust_b_process()
13482 if (plci->adjust_b_facilities & ~get_b1_facilities(plci, b1_resource)) in adjust_b_process()
13486 plci->B1_resource, b1_resource, plci->adjust_b_facilities)); in adjust_b_process()
13491 if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) in adjust_b_process()
13494 mixer_prepare_switch(Id, plci); in adjust_b_process()
13497 dtmf_prepare_switch(Id, plci); in adjust_b_process()
13498 dtmf_parameter_prepare_switch(Id, plci); in adjust_b_process()
13501 ec_prepare_switch(Id, plci); in adjust_b_process()
13503 adv_voice_prepare_switch(Id, plci); in adjust_b_process()
13505 plci->adjust_b_state = ADJUST_B_SAVE_MIXER_1; in adjust_b_process()
13509 if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) in adjust_b_process()
13512 Info = mixer_save_config(Id, plci, Rc); in adjust_b_process()
13513 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13517 plci->adjust_b_state = ADJUST_B_SAVE_DTMF_1; in adjust_b_process()
13521 if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) in adjust_b_process()
13524 Info = dtmf_save_config(Id, plci, Rc); in adjust_b_process()
13525 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13529 plci->adjust_b_state = ADJUST_B_REMOVE_L23_1; in adjust_b_process()
13532 if ((plci->adjust_b_mode & ADJUST_B_MODE_REMOVE_L23) in adjust_b_process()
13533 && plci->NL.Id && !plci->nl_remove_id) in adjust_b_process()
13535 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13536 if (plci->adjust_b_ncci != 0) in adjust_b_process()
13538 ncci_ptr = &(plci->adapter->ncci[plci->adjust_b_ncci]); in adjust_b_process()
13541 plci->data_sent_ptr = ncci_ptr->DBuffer[ncci_ptr->data_out].P; in adjust_b_process()
13542 data_rc(plci, plci->adapter->ncci_ch[plci->adjust_b_ncci]); in adjust_b_process()
13545 data_ack(plci, plci->adapter->ncci_ch[plci->adjust_b_ncci]); in adjust_b_process()
13547 nl_req_ncci(plci, REMOVE, in adjust_b_process()
13548 (byte)((plci->adjust_b_mode & ADJUST_B_MODE_CONNECT) ? plci->adjust_b_ncci : 0)); in adjust_b_process()
13549 send_req(plci); in adjust_b_process()
13550 plci->adjust_b_state = ADJUST_B_REMOVE_L23_2; in adjust_b_process()
13553 plci->adjust_b_state = ADJUST_B_REMOVE_L23_2; in adjust_b_process()
13564 if (plci->adjust_b_mode & ADJUST_B_MODE_REMOVE_L23) in adjust_b_process()
13566 if (plci_nl_busy(plci)) in adjust_b_process()
13568 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13572 plci->adjust_b_state = ADJUST_B_SAVE_EC_1; in adjust_b_process()
13576 if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) in adjust_b_process()
13579 Info = ec_save_config(Id, plci, Rc); in adjust_b_process()
13580 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13584 plci->adjust_b_state = ADJUST_B_SAVE_DTMF_PARAMETER_1; in adjust_b_process()
13588 if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) in adjust_b_process()
13591 Info = dtmf_parameter_save_config(Id, plci, Rc); in adjust_b_process()
13592 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13596 plci->adjust_b_state = ADJUST_B_SAVE_VOICE_1; in adjust_b_process()
13600 if (plci->adjust_b_mode & ADJUST_B_MODE_SAVE) in adjust_b_process()
13602 Info = adv_voice_save_config(Id, plci, Rc); in adjust_b_process()
13603 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13606 plci->adjust_b_state = ADJUST_B_SWITCH_L1_1; in adjust_b_process()
13609 if (plci->adjust_b_mode & ADJUST_B_MODE_SWITCH_L1) in adjust_b_process()
13611 if (plci->sig_req) in adjust_b_process()
13613 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13616 if (plci->adjust_b_parms_msg != NULL) in adjust_b_process()
13617 api_load_msg(plci->adjust_b_parms_msg, bp); in adjust_b_process()
13619 api_load_msg(&plci->B_protocol, bp); in adjust_b_process()
13620 Info = add_b1(plci, bp, in adjust_b_process()
13621 (word)((plci->adjust_b_mode & ADJUST_B_MODE_NO_RESOURCE) ? 2 : 0), in adjust_b_process()
13622 plci->adjust_b_facilities); in adjust_b_process()
13627 plci->B1_resource, plci->adjust_b_facilities)); in adjust_b_process()
13630 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13631 sig_req(plci, RESOURCES, 0); in adjust_b_process()
13632 send_req(plci); in adjust_b_process()
13633 plci->adjust_b_state = ADJUST_B_SWITCH_L1_2; in adjust_b_process()
13636 plci->adjust_b_state = ADJUST_B_SWITCH_L1_2; in adjust_b_process()
13644 Rc, plci->B1_resource, plci->adjust_b_facilities)); in adjust_b_process()
13648 plci->adjust_b_state = ADJUST_B_RESTORE_VOICE_1; in adjust_b_process()
13653 if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) in adjust_b_process()
13655 Info = adv_voice_restore_config(Id, plci, Rc); in adjust_b_process()
13656 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13659 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_PARAMETER_1; in adjust_b_process()
13664 if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) in adjust_b_process()
13667 Info = dtmf_parameter_restore_config(Id, plci, Rc); in adjust_b_process()
13668 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13672 plci->adjust_b_state = ADJUST_B_RESTORE_EC_1; in adjust_b_process()
13677 if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) in adjust_b_process()
13680 Info = ec_restore_config(Id, plci, Rc); in adjust_b_process()
13681 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13685 plci->adjust_b_state = ADJUST_B_ASSIGN_L23_1; in adjust_b_process()
13688 if (plci->adjust_b_mode & ADJUST_B_MODE_ASSIGN_L23) in adjust_b_process()
13690 if (plci_nl_busy(plci)) in adjust_b_process()
13692 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13695 if (plci->adjust_b_mode & ADJUST_B_MODE_CONNECT) in adjust_b_process()
13696 plci->call_dir |= CALL_DIR_FORCE_OUTG_NL; in adjust_b_process()
13697 if (plci->adjust_b_parms_msg != NULL) in adjust_b_process()
13698 api_load_msg(plci->adjust_b_parms_msg, bp); in adjust_b_process()
13700 api_load_msg(&plci->B_protocol, bp); in adjust_b_process()
13701 Info = add_b23(plci, bp); in adjust_b_process()
13708 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13709 nl_req_ncci(plci, ASSIGN, 0); in adjust_b_process()
13710 send_req(plci); in adjust_b_process()
13711 plci->adjust_b_state = ADJUST_B_ASSIGN_L23_2; in adjust_b_process()
13714 plci->adjust_b_state = ADJUST_B_ASSIGN_L23_2; in adjust_b_process()
13725 if (plci->adjust_b_mode & ADJUST_B_MODE_ASSIGN_L23) in adjust_b_process()
13729 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13733 if (plci->adjust_b_mode & ADJUST_B_MODE_USER_CONNECT) in adjust_b_process()
13735 plci->adjust_b_restore = true; in adjust_b_process()
13738 plci->adjust_b_state = ADJUST_B_CONNECT_1; in adjust_b_process()
13741 if (plci->adjust_b_mode & ADJUST_B_MODE_CONNECT) in adjust_b_process()
13743 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13744 if (plci_nl_busy(plci)) in adjust_b_process()
13746 nl_req_ncci(plci, N_CONNECT, 0); in adjust_b_process()
13747 send_req(plci); in adjust_b_process()
13748 plci->adjust_b_state = ADJUST_B_CONNECT_2; in adjust_b_process()
13751 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_1; in adjust_b_process()
13766 if (plci->adjust_b_mode & ADJUST_B_MODE_CONNECT) in adjust_b_process()
13768 get_ncci(plci, (byte)(Id >> 16), plci->adjust_b_ncci); in adjust_b_process()
13769 Id = (Id & 0xffff) | (((dword)(plci->adjust_b_ncci)) << 16); in adjust_b_process()
13771 if (plci->adjust_b_state == ADJUST_B_CONNECT_2) in adjust_b_process()
13772 plci->adjust_b_state = ADJUST_B_CONNECT_3; in adjust_b_process()
13773 else if (plci->adjust_b_state == ADJUST_B_CONNECT_4) in adjust_b_process()
13774 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_1; in adjust_b_process()
13778 if (plci->adjust_b_state == ADJUST_B_CONNECT_2) in adjust_b_process()
13779 plci->adjust_b_state = ADJUST_B_CONNECT_4; in adjust_b_process()
13780 else if (plci->adjust_b_state == ADJUST_B_CONNECT_3) in adjust_b_process()
13781 plci->adjust_b_state = ADJUST_B_RESTORE_DTMF_1; in adjust_b_process()
13783 if (plci->adjust_b_state != ADJUST_B_RESTORE_DTMF_1) in adjust_b_process()
13785 plci->internal_command = plci->adjust_b_command; in adjust_b_process()
13792 if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) in adjust_b_process()
13795 Info = dtmf_restore_config(Id, plci, Rc); in adjust_b_process()
13796 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13800 plci->adjust_b_state = ADJUST_B_RESTORE_MIXER_1; in adjust_b_process()
13810 if (plci->adjust_b_mode & ADJUST_B_MODE_RESTORE) in adjust_b_process()
13813 Info = mixer_restore_config(Id, plci, Rc); in adjust_b_process()
13814 if ((Info != GOOD) || plci->internal_command) in adjust_b_process()
13818 plci->adjust_b_state = ADJUST_B_END; in adjust_b_process()
13826 static void adjust_b1_resource(dword Id, PLCI *plci, API_SAVE *bp_msg, word b1_facilities, word i… in adjust_b1_resource() argument
13831 plci->B1_resource, b1_facilities)); in adjust_b1_resource()
13833 plci->adjust_b_parms_msg = bp_msg; in adjust_b1_resource()
13834 plci->adjust_b_facilities = b1_facilities; in adjust_b1_resource()
13835 plci->adjust_b_command = internal_command; in adjust_b1_resource()
13836 plci->adjust_b_ncci = (word)(Id >> 16); in adjust_b1_resource()
13837 if ((bp_msg == NULL) && (plci->B1_resource == 0)) in adjust_b1_resource()
13838 plci->adjust_b_mode = ADJUST_B_MODE_SAVE | ADJUST_B_MODE_NO_RESOURCE | ADJUST_B_MODE_SWITCH_L1; in adjust_b1_resource()
13840 plci->adjust_b_mode = ADJUST_B_MODE_SAVE | ADJUST_B_MODE_SWITCH_L1 | ADJUST_B_MODE_RESTORE; in adjust_b1_resource()
13841 plci->adjust_b_state = ADJUST_B_START; in adjust_b1_resource()
13844 plci->B1_resource, b1_facilities)); in adjust_b1_resource()
13848 static void adjust_b_restore(dword Id, PLCI *plci, byte Rc) in adjust_b_restore() argument
13853 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in adjust_b_restore()
13855 internal_command = plci->internal_command; in adjust_b_restore()
13856 plci->internal_command = 0; in adjust_b_restore()
13860 plci->command = 0; in adjust_b_restore()
13861 if (plci->req_in != 0) in adjust_b_restore()
13863 plci->internal_command = ADJUST_B_RESTORE_1; in adjust_b_restore()
13874 plci->adjust_b_parms_msg = NULL; in adjust_b_restore()
13875 plci->adjust_b_facilities = plci->B1_facilities; in adjust_b_restore()
13876 plci->adjust_b_command = ADJUST_B_RESTORE_2; in adjust_b_restore()
13877 plci->adjust_b_ncci = (word)(Id >> 16); in adjust_b_restore()
13878 plci->adjust_b_mode = ADJUST_B_MODE_RESTORE; in adjust_b_restore()
13879 plci->adjust_b_state = ADJUST_B_START; in adjust_b_restore()
13884 if (adjust_b_process(Id, plci, Rc) != GOOD) in adjust_b_restore()
13889 if (plci->internal_command) in adjust_b_restore()
13896 static void reset_b3_command(dword Id, PLCI *plci, byte Rc) in reset_b3_command() argument
13902 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in reset_b3_command()
13905 internal_command = plci->internal_command; in reset_b3_command()
13906 plci->internal_command = 0; in reset_b3_command()
13910 plci->command = 0; in reset_b3_command()
13911 plci->adjust_b_parms_msg = NULL; in reset_b3_command()
13912 plci->adjust_b_facilities = plci->B1_facilities; in reset_b3_command()
13913 plci->adjust_b_command = RESET_B3_COMMAND_1; in reset_b3_command()
13914 plci->adjust_b_ncci = (word)(Id >> 16); in reset_b3_command()
13915 plci->adjust_b_mode = ADJUST_B_MODE_REMOVE_L23 | ADJUST_B_MODE_ASSIGN_L23 | ADJUST_B_MODE_CONNECT; in reset_b3_command()
13916 plci->adjust_b_state = ADJUST_B_START; in reset_b3_command()
13921 Info = adjust_b_process(Id, plci, Rc); in reset_b3_command()
13928 if (plci->internal_command) in reset_b3_command()
13933 sendf(plci->appl, _RESET_B3_I, Id, 0, "s", ""); in reset_b3_command()
13937 static void select_b_command(dword Id, PLCI *plci, byte Rc) in select_b_command() argument
13944 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in select_b_command()
13947 internal_command = plci->internal_command; in select_b_command()
13948 plci->internal_command = 0; in select_b_command()
13952 plci->command = 0; in select_b_command()
13953 plci->adjust_b_parms_msg = &plci->saved_msg; in select_b_command()
13954 if ((plci->tel == ADV_VOICE) && (plci == plci->adapter->AdvSignalPLCI)) in select_b_command()
13955 plci->adjust_b_facilities = plci->B1_facilities | B1_FACILITY_VOICE; in select_b_command()
13957 plci->adjust_b_facilities = plci->B1_facilities & ~B1_FACILITY_VOICE; in select_b_command()
13958 plci->adjust_b_command = SELECT_B_COMMAND_1; in select_b_command()
13959 plci->adjust_b_ncci = (word)(Id >> 16); in select_b_command()
13960 if (plci->saved_msg.parms[0].length == 0) in select_b_command()
13962 plci->adjust_b_mode = ADJUST_B_MODE_SAVE | ADJUST_B_MODE_REMOVE_L23 | ADJUST_B_MODE_SWITCH_L1 | in select_b_command()
13967 plci->adjust_b_mode = ADJUST_B_MODE_SAVE | ADJUST_B_MODE_REMOVE_L23 | ADJUST_B_MODE_SWITCH_L1 | in select_b_command()
13970 plci->adjust_b_state = ADJUST_B_START; in select_b_command()
13975 Info = adjust_b_process(Id, plci, Rc); in select_b_command()
13982 if (plci->internal_command) in select_b_command()
13984 if (plci->tel == ADV_VOICE) in select_b_command()
13988 esc_chi[2] = plci->b_channel; in select_b_command()
13989 SetVoiceChannel(plci->adapter->AdvCodecPLCI, esc_chi, plci->adapter); in select_b_command()
13993 sendf(plci->appl, _SELECT_B_REQ | CONFIRM, Id, plci->number, "w", Info); in select_b_command()
13997 static void fax_connect_ack_command(dword Id, PLCI *plci, byte Rc) in fax_connect_ack_command() argument
14002 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in fax_connect_ack_command()
14004 internal_command = plci->internal_command; in fax_connect_ack_command()
14005 plci->internal_command = 0; in fax_connect_ack_command()
14009 plci->command = 0; /* fall through */ in fax_connect_ack_command()
14011 if (plci_nl_busy(plci)) in fax_connect_ack_command()
14013 plci->internal_command = FAX_CONNECT_ACK_COMMAND_1; in fax_connect_ack_command()
14016 plci->internal_command = FAX_CONNECT_ACK_COMMAND_2; in fax_connect_ack_command()
14017 plci->NData[0].P = plci->fax_connect_info_buffer; in fax_connect_ack_command()
14018 plci->NData[0].PLength = plci->fax_connect_info_length; in fax_connect_ack_command()
14019 plci->NL.X = plci->NData; in fax_connect_ack_command()
14020 plci->NL.ReqCh = 0; in fax_connect_ack_command()
14021 plci->NL.Req = plci->nl_req = (byte) N_CONNECT_ACK; in fax_connect_ack_command()
14022 plci->adapter->request(&plci->NL); in fax_connect_ack_command()
14032 if ((plci->ncpi_state & NCPI_VALID_CONNECT_B3_ACT) in fax_connect_ack_command()
14033 && !(plci->ncpi_state & NCPI_CONNECT_B3_ACT_SENT)) in fax_connect_ack_command()
14035 if (plci->B3_prot == 4) in fax_connect_ack_command()
14036 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "s", ""); in fax_connect_ack_command()
14038 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "S", plci->ncpi_buffer); in fax_connect_ack_command()
14039 plci->ncpi_state |= NCPI_CONNECT_B3_ACT_SENT; in fax_connect_ack_command()
14044 static void fax_edata_ack_command(dword Id, PLCI *plci, byte Rc) in fax_edata_ack_command() argument
14049 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in fax_edata_ack_command()
14051 internal_command = plci->internal_command; in fax_edata_ack_command()
14052 plci->internal_command = 0; in fax_edata_ack_command()
14056 plci->command = 0; in fax_edata_ack_command()
14059 if (plci_nl_busy(plci)) in fax_edata_ack_command()
14061 plci->internal_command = FAX_EDATA_ACK_COMMAND_1; in fax_edata_ack_command()
14064 plci->internal_command = FAX_EDATA_ACK_COMMAND_2; in fax_edata_ack_command()
14065 plci->NData[0].P = plci->fax_connect_info_buffer; in fax_edata_ack_command()
14066 plci->NData[0].PLength = plci->fax_edata_ack_length; in fax_edata_ack_command()
14067 plci->NL.X = plci->NData; in fax_edata_ack_command()
14068 plci->NL.ReqCh = 0; in fax_edata_ack_command()
14069 plci->NL.Req = plci->nl_req = (byte) N_EDATA; in fax_edata_ack_command()
14070 plci->adapter->request(&plci->NL); in fax_edata_ack_command()
14083 static void fax_connect_info_command(dword Id, PLCI *plci, byte Rc) in fax_connect_info_command() argument
14089 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in fax_connect_info_command()
14092 internal_command = plci->internal_command; in fax_connect_info_command()
14093 plci->internal_command = 0; in fax_connect_info_command()
14097 plci->command = 0; /* fall through */ in fax_connect_info_command()
14099 if (plci_nl_busy(plci)) in fax_connect_info_command()
14101 plci->internal_command = FAX_CONNECT_INFO_COMMAND_1; in fax_connect_info_command()
14104 plci->internal_command = FAX_CONNECT_INFO_COMMAND_2; in fax_connect_info_command()
14105 plci->NData[0].P = plci->fax_connect_info_buffer; in fax_connect_info_command()
14106 plci->NData[0].PLength = plci->fax_connect_info_length; in fax_connect_info_command()
14107 plci->NL.X = plci->NData; in fax_connect_info_command()
14108 plci->NL.ReqCh = 0; in fax_connect_info_command()
14109 plci->NL.Req = plci->nl_req = (byte) N_EDATA; in fax_connect_info_command()
14110 plci->adapter->request(&plci->NL); in fax_connect_info_command()
14120 if (plci_nl_busy(plci)) in fax_connect_info_command()
14122 plci->internal_command = FAX_CONNECT_INFO_COMMAND_2; in fax_connect_info_command()
14125 plci->command = _CONNECT_B3_R; in fax_connect_info_command()
14126 nl_req_ncci(plci, N_CONNECT, 0); in fax_connect_info_command()
14127 send_req(plci); in fax_connect_info_command()
14130 sendf(plci->appl, _CONNECT_B3_R | CONFIRM, Id, plci->number, "w", Info); in fax_connect_info_command()
14134 static void fax_adjust_b23_command(dword Id, PLCI *plci, byte Rc) in fax_adjust_b23_command() argument
14140 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in fax_adjust_b23_command()
14143 internal_command = plci->internal_command; in fax_adjust_b23_command()
14144 plci->internal_command = 0; in fax_adjust_b23_command()
14148 plci->command = 0; in fax_adjust_b23_command()
14149 plci->adjust_b_parms_msg = NULL; in fax_adjust_b23_command()
14150 plci->adjust_b_facilities = plci->B1_facilities; in fax_adjust_b23_command()
14151 plci->adjust_b_command = FAX_ADJUST_B23_COMMAND_1; in fax_adjust_b23_command()
14152 plci->adjust_b_ncci = (word)(Id >> 16); in fax_adjust_b23_command()
14153 plci->adjust_b_mode = ADJUST_B_MODE_REMOVE_L23 | ADJUST_B_MODE_ASSIGN_L23; in fax_adjust_b23_command()
14154 plci->adjust_b_state = ADJUST_B_START; in fax_adjust_b23_command()
14159 Info = adjust_b_process(Id, plci, Rc); in fax_adjust_b23_command()
14166 if (plci->internal_command) in fax_adjust_b23_command()
14170 if (plci_nl_busy(plci)) in fax_adjust_b23_command()
14172 plci->internal_command = FAX_ADJUST_B23_COMMAND_2; in fax_adjust_b23_command()
14175 plci->command = _CONNECT_B3_R; in fax_adjust_b23_command()
14176 nl_req_ncci(plci, N_CONNECT, 0); in fax_adjust_b23_command()
14177 send_req(plci); in fax_adjust_b23_command()
14180 sendf(plci->appl, _CONNECT_B3_R | CONFIRM, Id, plci->number, "w", Info); in fax_adjust_b23_command()
14184 static void fax_disconnect_command(dword Id, PLCI *plci, byte Rc) in fax_disconnect_command() argument
14189 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in fax_disconnect_command()
14191 internal_command = plci->internal_command; in fax_disconnect_command()
14192 plci->internal_command = 0; in fax_disconnect_command()
14196 plci->command = 0; in fax_disconnect_command()
14197 plci->internal_command = FAX_DISCONNECT_COMMAND_1; in fax_disconnect_command()
14213 plci->internal_command = FAX_DISCONNECT_COMMAND_2; in fax_disconnect_command()
14219 plci->internal_command = FAX_DISCONNECT_COMMAND_3; in fax_disconnect_command()
14227 static void rtp_connect_b3_req_command(dword Id, PLCI *plci, byte Rc) in rtp_connect_b3_req_command() argument
14233 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in rtp_connect_b3_req_command()
14236 internal_command = plci->internal_command; in rtp_connect_b3_req_command()
14237 plci->internal_command = 0; in rtp_connect_b3_req_command()
14241 plci->command = 0; /* fall through */ in rtp_connect_b3_req_command()
14243 if (plci_nl_busy(plci)) in rtp_connect_b3_req_command()
14245 plci->internal_command = RTP_CONNECT_B3_REQ_COMMAND_1; in rtp_connect_b3_req_command()
14248 plci->internal_command = RTP_CONNECT_B3_REQ_COMMAND_2; in rtp_connect_b3_req_command()
14249 nl_req_ncci(plci, N_CONNECT, 0); in rtp_connect_b3_req_command()
14250 send_req(plci); in rtp_connect_b3_req_command()
14260 if (plci_nl_busy(plci)) in rtp_connect_b3_req_command()
14262 plci->internal_command = RTP_CONNECT_B3_REQ_COMMAND_2; in rtp_connect_b3_req_command()
14265 plci->internal_command = RTP_CONNECT_B3_REQ_COMMAND_3; in rtp_connect_b3_req_command()
14266 plci->NData[0].PLength = plci->internal_req_buffer[0]; in rtp_connect_b3_req_command()
14267 plci->NData[0].P = plci->internal_req_buffer + 1; in rtp_connect_b3_req_command()
14268 plci->NL.X = plci->NData; in rtp_connect_b3_req_command()
14269 plci->NL.ReqCh = 0; in rtp_connect_b3_req_command()
14270 plci->NL.Req = plci->nl_req = (byte) N_UDATA; in rtp_connect_b3_req_command()
14271 plci->adapter->request(&plci->NL); in rtp_connect_b3_req_command()
14276 sendf(plci->appl, _CONNECT_B3_R | CONFIRM, Id, plci->number, "w", Info); in rtp_connect_b3_req_command()
14280 static void rtp_connect_b3_res_command(dword Id, PLCI *plci, byte Rc) in rtp_connect_b3_res_command() argument
14285 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in rtp_connect_b3_res_command()
14287 internal_command = plci->internal_command; in rtp_connect_b3_res_command()
14288 plci->internal_command = 0; in rtp_connect_b3_res_command()
14292 plci->command = 0; /* fall through */ in rtp_connect_b3_res_command()
14294 if (plci_nl_busy(plci)) in rtp_connect_b3_res_command()
14296 plci->internal_command = RTP_CONNECT_B3_RES_COMMAND_1; in rtp_connect_b3_res_command()
14299 plci->internal_command = RTP_CONNECT_B3_RES_COMMAND_2; in rtp_connect_b3_res_command()
14300 nl_req_ncci(plci, N_CONNECT_ACK, (byte)(Id >> 16)); in rtp_connect_b3_res_command()
14301 send_req(plci); in rtp_connect_b3_res_command()
14310 if (plci_nl_busy(plci)) in rtp_connect_b3_res_command()
14312 plci->internal_command = RTP_CONNECT_B3_RES_COMMAND_2; in rtp_connect_b3_res_command()
14315 sendf(plci->appl, _CONNECT_B3_ACTIVE_I, Id, 0, "s", ""); in rtp_connect_b3_res_command()
14316 plci->internal_command = RTP_CONNECT_B3_RES_COMMAND_3; in rtp_connect_b3_res_command()
14317 plci->NData[0].PLength = plci->internal_req_buffer[0]; in rtp_connect_b3_res_command()
14318 plci->NData[0].P = plci->internal_req_buffer + 1; in rtp_connect_b3_res_command()
14319 plci->NL.X = plci->NData; in rtp_connect_b3_res_command()
14320 plci->NL.ReqCh = 0; in rtp_connect_b3_res_command()
14321 plci->NL.Req = plci->nl_req = (byte) N_UDATA; in rtp_connect_b3_res_command()
14322 plci->adapter->request(&plci->NL); in rtp_connect_b3_res_command()
14331 static void hold_save_command(dword Id, PLCI *plci, byte Rc) in hold_save_command() argument
14338 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in hold_save_command()
14341 internal_command = plci->internal_command; in hold_save_command()
14342 plci->internal_command = 0; in hold_save_command()
14346 if (!plci->NL.Id) in hold_save_command()
14348 plci->command = 0; in hold_save_command()
14349 plci->adjust_b_parms_msg = NULL; in hold_save_command()
14350 plci->adjust_b_facilities = plci->B1_facilities; in hold_save_command()
14351 plci->adjust_b_command = HOLD_SAVE_COMMAND_1; in hold_save_command()
14352 plci->adjust_b_ncci = (word)(Id >> 16); in hold_save_command()
14353 plci->adjust_b_mode = ADJUST_B_MODE_SAVE | ADJUST_B_MODE_REMOVE_L23; in hold_save_command()
14354 plci->adjust_b_state = ADJUST_B_START; in hold_save_command()
14359 Info = adjust_b_process(Id, plci, Rc); in hold_save_command()
14366 if (plci->internal_command) in hold_save_command()
14369 sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, "ws", 3, SS_Ind); in hold_save_command()
14373 static void retrieve_restore_command(dword Id, PLCI *plci, byte Rc) in retrieve_restore_command() argument
14380 UnMapId(Id), (char *)(FILE_), __LINE__, Rc, plci->internal_command)); in retrieve_restore_command()
14383 internal_command = plci->internal_command; in retrieve_restore_command()
14384 plci->internal_command = 0; in retrieve_restore_command()
14388 plci->command = 0; in retrieve_restore_command()
14389 plci->adjust_b_parms_msg = NULL; in retrieve_restore_command()
14390 plci->adjust_b_facilities = plci->B1_facilities; in retrieve_restore_command()
14391 plci->adjust_b_command = RETRIEVE_RESTORE_COMMAND_1; in retrieve_restore_command()
14392 plci->adjust_b_ncci = (word)(Id >> 16); in retrieve_restore_command()
14393 …plci->adjust_b_mode = ADJUST_B_MODE_ASSIGN_L23 | ADJUST_B_MODE_USER_CONNECT | ADJUST_B_MODE_RESTOR… in retrieve_restore_command()
14394 plci->adjust_b_state = ADJUST_B_START; in retrieve_restore_command()
14399 Info = adjust_b_process(Id, plci, Rc); in retrieve_restore_command()
14406 if (plci->internal_command) in retrieve_restore_command()
14409 sendf(plci->appl, _FACILITY_I, Id & 0xffffL, 0, "ws", 3, SS_Ind); in retrieve_restore_command()
14413 static void init_b1_config(PLCI *plci) in init_b1_config() argument
14417 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in init_b1_config()
14420 plci->B1_resource = 0; in init_b1_config()
14421 plci->B1_facilities = 0; in init_b1_config()
14423 plci->li_bchannel_id = 0; in init_b1_config()
14424 mixer_clear_config(plci); in init_b1_config()
14427 ec_clear_config(plci); in init_b1_config()
14430 dtmf_rec_clear_config(plci); in init_b1_config()
14431 dtmf_send_clear_config(plci); in init_b1_config()
14432 dtmf_parameter_clear_config(plci); in init_b1_config()
14434 adv_voice_clear_config(plci); in init_b1_config()
14435 adjust_b_clear(plci); in init_b1_config()
14439 static void clear_b1_config(PLCI *plci) in clear_b1_config() argument
14443 (dword)((plci->Id << 8) | UnMapController(plci->adapter->Id)), in clear_b1_config()
14446 adv_voice_clear_config(plci); in clear_b1_config()
14447 adjust_b_clear(plci); in clear_b1_config()
14449 ec_clear_config(plci); in clear_b1_config()
14452 dtmf_rec_clear_config(plci); in clear_b1_config()
14453 dtmf_send_clear_config(plci); in clear_b1_config()
14454 dtmf_parameter_clear_config(plci); in clear_b1_config()
14457 if ((plci->li_bchannel_id != 0) in clear_b1_config()
14458 && (li_config_table[plci->adapter->li_base + (plci->li_bchannel_id - 1)].plci == plci)) in clear_b1_config()
14460 mixer_clear_config(plci); in clear_b1_config()
14461 li_config_table[plci->adapter->li_base + (plci->li_bchannel_id - 1)].plci = NULL; in clear_b1_config()
14462 plci->li_bchannel_id = 0; in clear_b1_config()
14465 plci->B1_resource = 0; in clear_b1_config()
14466 plci->B1_facilities = 0; in clear_b1_config()
14473 static void channel_flow_control_remove(PLCI *plci) { in channel_flow_control_remove() argument
14474 DIVA_CAPI_ADAPTER *a = plci->adapter; in channel_flow_control_remove()
14477 if (a->ch_flow_plci[i] == plci->Id) { in channel_flow_control_remove()
14484 static void channel_x_on(PLCI *plci, byte ch) { in channel_x_on() argument
14485 DIVA_CAPI_ADAPTER *a = plci->adapter; in channel_x_on()
14491 static void channel_x_off(PLCI *plci, byte ch, byte flag) { in channel_x_off() argument
14492 DIVA_CAPI_ADAPTER *a = plci->adapter; in channel_x_off()
14495 a->ch_flow_plci[ch] = plci->Id; in channel_x_off()
14500 static void channel_request_xon(PLCI *plci, byte ch) { in channel_request_xon() argument
14501 DIVA_CAPI_ADAPTER *a = plci->adapter; in channel_request_xon()
14510 static void channel_xmit_extended_xon(PLCI *plci) { in channel_xmit_extended_xon() argument
14515 if ((!plci) || (!plci->Id) || ((a = plci->adapter) == NULL)) { in channel_xmit_extended_xon()
14522 (plci->Id == a->ch_flow_plci[i])) { in channel_xmit_extended_xon()
14523 channel_request_xon(plci, (byte)i); in channel_xmit_extended_xon()
14529 channel_xmit_xon(plci); in channel_xmit_extended_xon()
14536 static int find_channel_with_pending_x_on(DIVA_CAPI_ADAPTER *a, PLCI *plci) { in find_channel_with_pending_x_on() argument
14540 if (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL)) { in find_channel_with_pending_x_on()
14549 (plci->Id == a->ch_flow_plci[i])) { in find_channel_with_pending_x_on()
14557 (plci->Id == a->ch_flow_plci[i])) { in find_channel_with_pending_x_on()
14566 static void channel_xmit_xon(PLCI *plci) { in channel_xmit_xon() argument
14567 DIVA_CAPI_ADAPTER *a = plci->adapter; in channel_xmit_xon()
14570 if (plci->nl_req || !plci->NL.Id || plci->nl_remove_id) { in channel_xmit_xon()
14573 if ((ch = (byte)find_channel_with_pending_x_on(a, plci)) == 0) { in channel_xmit_xon()
14579 plci->NL.Req = plci->nl_req = (byte)N_XON; in channel_xmit_xon()
14580 plci->NL.ReqCh = ch; in channel_xmit_xon()
14581 plci->NL.X = plci->NData; in channel_xmit_xon()
14582 plci->NL.XNum = 1; in channel_xmit_xon()
14583 plci->NData[0].P = &plci->RBuffer[0]; in channel_xmit_xon()
14584 plci->NData[0].PLength = 0; in channel_xmit_xon()
14586 plci->adapter->request(&plci->NL); in channel_xmit_xon()
14589 static int channel_can_xon(PLCI *plci, byte ch) { in channel_can_xon() argument
14597 APPLptr = plci->appl; in channel_can_xon()
14598 a = plci->adapter; in channel_can_xon()
14638 static void group_optimization(DIVA_CAPI_ADAPTER *a, PLCI *plci) in group_optimization() argument
14647 bitmap_fill(plci->group_optimization_mask_table, MAX_APPL); in group_optimization()
14680 if (a->plci[k].Id) in group_optimization()
14682 auxplci = &a->plci[k]; in group_optimization()
14687 } else if (test_bit(i, plci->c_ind_mask_table)) { in group_optimization()
14738 __clear_bit(j, plci->group_optimization_mask_table); in group_optimization()
14746 __clear_bit(i, plci->group_optimization_mask_table); in group_optimization()
14759 PLCI *plci; in CapiRegister() local
14782 plci = &a->plci[j - 1]; in CapiRegister()
14783 plci->command = 0; in CapiRegister()
14784 add_p(plci, OAD, "\x01\xfd"); in CapiRegister()
14785 add_p(plci, CAI, "\x01\x80"); in CapiRegister()
14786 add_p(plci, UID, "\x06\x43\x61\x70\x69\x32\x30"); in CapiRegister()
14787 add_p(plci, SHIFT | 6, NULL); in CapiRegister()
14788 add_p(plci, SIN, "\x02\x00\x00"); in CapiRegister()
14789 plci->internal_command = START_L1_SIG_ASSIGN_PEND; in CapiRegister()
14790 sig_req(plci, ASSIGN, DSIG_ID); in CapiRegister()
14791 add_p(plci, FTY, "\x02\xff\x07"); /* l1 start */ in CapiRegister()
14792 sig_req(plci, SIG_CTRL, 0); in CapiRegister()
14793 send_req(plci); in CapiRegister()
14806 static void VSwitchReqInd(PLCI *plci, dword Id, byte **parms) in VSwitchReqInd() argument
14818 if (!plci || in VSwitchReqInd()
14819 !plci->appl || in VSwitchReqInd()
14820 !plci->State || in VSwitchReqInd()
14821 plci->Sig.Ind == NCR_FACILITY in VSwitchReqInd()
14837 if (!plci->relatedPTYPLCI || in VSwitchReqInd()
14838 (plci->ptyState != S_ECT && plci->relatedPTYPLCI->ptyState != S_ECT)) in VSwitchReqInd()
14849 plci->vswitchstate = parms[i][9]; in VSwitchReqInd()
14855 plci->vswitchstate = parms[i][9]; in VSwitchReqInd()
14863 plci->vsprot = parms[i][10]; /* protocol */ in VSwitchReqInd()
14864 plci->vsprotdialect = parms[i][11]; /* protocoldialect */ in VSwitchReqInd()
14869 plci->relatedPTYPLCI->command = 0; in VSwitchReqInd()
14870 plci->relatedPTYPLCI->internal_command = VSWITCH_REQ_PEND; in VSwitchReqInd()
14871 add_p(plci->relatedPTYPLCI, ESC, &parms[i][0]); in VSwitchReqInd()
14872 sig_req(plci->relatedPTYPLCI, VSWITCH_REQ, 0); in VSwitchReqInd()
14873 send_req(plci->relatedPTYPLCI); in VSwitchReqInd()
14877 if (plci->relatedPTYPLCI && in VSwitchReqInd()
14878 plci->vswitchstate == 3 && in VSwitchReqInd()
14879 plci->relatedPTYPLCI->vswitchstate == 3) in VSwitchReqInd()
14881 add_p(plci->relatedPTYPLCI, ESC, &parms[i][0]); in VSwitchReqInd()
14882 sig_req(plci->relatedPTYPLCI, VSWITCH_REQ, 0); in VSwitchReqInd()
14883 send_req(plci->relatedPTYPLCI); in VSwitchReqInd()
14894 static int diva_get_dma_descriptor(PLCI *plci, dword *dma_magic) { in diva_get_dma_descriptor() argument
14910 e.user[0] = plci->adapter->Id - 1; in diva_get_dma_descriptor()
14911 plci->adapter->request((ENTITY *)pReq); in diva_get_dma_descriptor()
14918 plci->adapter->Id, in diva_get_dma_descriptor()
14928 static void diva_free_dma_descriptor(PLCI *plci, int nr) { in diva_free_dma_descriptor() argument
14944 e.user[0] = plci->adapter->Id - 1; in diva_free_dma_descriptor()
14945 plci->adapter->request((ENTITY *)pReq); in diva_free_dma_descriptor()