Lines Matching refs:dsp
188 dsp_rx_off_member(struct dsp *dsp) in dsp_rx_off_member() argument
195 if (!dsp->features_rx_off) in dsp_rx_off_member()
199 if (!dsp->rx_disabled) in dsp_rx_off_member()
202 else if (dsp->dtmf.software) in dsp_rx_off_member()
205 else if (dsp->echo.software) in dsp_rx_off_member()
208 else if (dsp->conf && dsp->conf->software) in dsp_rx_off_member()
213 if (rx_off == dsp->rx_is_off) in dsp_rx_off_member()
216 if (!dsp->ch.peer) { in dsp_rx_off_member()
224 if (dsp->ch.peer->ctrl(dsp->ch.peer, CONTROL_CHANNEL, &cq)) { in dsp_rx_off_member()
229 dsp->rx_is_off = rx_off; in dsp_rx_off_member()
232 __func__, dsp->name, rx_off); in dsp_rx_off_member()
235 dsp_rx_off(struct dsp *dsp) in dsp_rx_off() argument
243 if (!dsp->conf) { in dsp_rx_off()
244 dsp_rx_off_member(dsp); in dsp_rx_off()
248 list_for_each_entry(member, &dsp->conf->mlist, list) { in dsp_rx_off()
249 dsp_rx_off_member(member->dsp); in dsp_rx_off()
255 dsp_fill_empty(struct dsp *dsp) in dsp_fill_empty() argument
261 if (!dsp->ch.peer) { in dsp_fill_empty()
270 if (dsp->ch.peer->ctrl(dsp->ch.peer, CONTROL_CHANNEL, &cq)) { in dsp_fill_empty()
277 __func__, dsp->name); in dsp_fill_empty()
281 dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) in dsp_control_req() argument
299 if (dsp->hdlc) { in dsp_control_req()
309 dsp->dtmf.treshold = (*(int *)data) * 10000; in dsp_control_req()
311 dsp->dtmf.enable = 1; in dsp_control_req()
313 dsp_dtmf_goertzel_init(dsp); in dsp_control_req()
316 dsp_dtmf_hardware(dsp); in dsp_control_req()
317 dsp_rx_off(dsp); in dsp_control_req()
322 dsp->dtmf.enable = 0; in dsp_control_req()
323 dsp->dtmf.hardware = 0; in dsp_control_req()
324 dsp->dtmf.software = 0; in dsp_control_req()
336 ret = dsp_cmx_conf(dsp, *((u32 *)data)); in dsp_control_req()
338 dsp_rx_off(dsp); in dsp_control_req()
340 dsp_cmx_debug(dsp); in dsp_control_req()
346 ret = dsp_cmx_conf(dsp, 0); in dsp_control_req()
349 dsp_cmx_debug(dsp); in dsp_control_req()
350 dsp_rx_off(dsp); in dsp_control_req()
353 if (dsp->hdlc) { in dsp_control_req()
364 ret = dsp_tone(dsp, *((int *)data)); in dsp_control_req()
366 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
367 dsp_rx_off(dsp); in dsp_control_req()
369 if (!dsp->tone.tone) in dsp_control_req()
373 if (dsp->hdlc) { in dsp_control_req()
379 dsp_tone(dsp, 0); in dsp_control_req()
380 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
381 dsp_rx_off(dsp); in dsp_control_req()
384 dsp->rx_W = 0; in dsp_control_req()
385 dsp->rx_R = 0; in dsp_control_req()
388 if (dsp->hdlc) { in dsp_control_req()
396 dsp->tx_volume = *((int *)data); in dsp_control_req()
399 __func__, dsp->tx_volume); in dsp_control_req()
400 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
401 dsp_dtmf_hardware(dsp); in dsp_control_req()
402 dsp_rx_off(dsp); in dsp_control_req()
405 if (dsp->hdlc) { in dsp_control_req()
413 dsp->rx_volume = *((int *)data); in dsp_control_req()
416 __func__, dsp->tx_volume); in dsp_control_req()
417 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
418 dsp_dtmf_hardware(dsp); in dsp_control_req()
419 dsp_rx_off(dsp); in dsp_control_req()
422 dsp->echo.software = 1; /* soft echo */ in dsp_control_req()
425 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
426 dsp_rx_off(dsp); in dsp_control_req()
428 dsp_cmx_debug(dsp); in dsp_control_req()
431 dsp->echo.software = 0; in dsp_control_req()
432 dsp->echo.hardware = 0; in dsp_control_req()
435 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
436 dsp_rx_off(dsp); in dsp_control_req()
438 dsp_cmx_debug(dsp); in dsp_control_req()
444 dsp->rx_disabled = 0; in dsp_control_req()
445 dsp_rx_off(dsp); in dsp_control_req()
451 dsp->rx_disabled = 1; in dsp_control_req()
452 dsp_rx_off(dsp); in dsp_control_req()
455 if (dsp->hdlc) { in dsp_control_req()
462 dsp->tx_mix = 1; in dsp_control_req()
463 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
464 dsp_rx_off(dsp); in dsp_control_req()
466 dsp_cmx_debug(dsp); in dsp_control_req()
469 if (dsp->hdlc) { in dsp_control_req()
476 dsp->tx_mix = 0; in dsp_control_req()
477 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
478 dsp_rx_off(dsp); in dsp_control_req()
480 dsp_cmx_debug(dsp); in dsp_control_req()
483 dsp->tx_data = 1; in dsp_control_req()
486 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
487 dsp_rx_off(dsp); in dsp_control_req()
489 dsp_cmx_debug(dsp); in dsp_control_req()
492 dsp->tx_data = 0; in dsp_control_req()
495 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
496 dsp_rx_off(dsp); in dsp_control_req()
498 dsp_cmx_debug(dsp); in dsp_control_req()
502 if (dsp->hdlc) { in dsp_control_req()
510 dsp->cmx_delay = (*((int *)data)) << 3; in dsp_control_req()
512 if (dsp->cmx_delay >= (CMX_BUFF_HALF >> 1)) in dsp_control_req()
515 dsp->cmx_delay = (CMX_BUFF_HALF >> 1) - 1; in dsp_control_req()
519 __func__, dsp->cmx_delay); in dsp_control_req()
523 if (dsp->hdlc) { in dsp_control_req()
527 dsp->cmx_delay = 0; in dsp_control_req()
533 if (dsp->hdlc) { in dsp_control_req()
537 dsp->tx_dejitter = 1; in dsp_control_req()
543 if (dsp->hdlc) { in dsp_control_req()
547 dsp->tx_dejitter = 0; in dsp_control_req()
553 if (dsp->hdlc) { in dsp_control_req()
562 dsp->pipeline.inuse = 1; in dsp_control_req()
563 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
564 ret = dsp_pipeline_build(&dsp->pipeline, in dsp_control_req()
566 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
567 dsp_rx_off(dsp); in dsp_control_req()
571 if (dsp->hdlc) { in dsp_control_req()
582 ret = dsp_bf_init(dsp, (u8 *)data, len); in dsp_control_req()
592 if (dsp->up) { in dsp_control_req()
593 if (dsp->up->send(dsp->up, nskb)) in dsp_control_req()
599 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
600 dsp_dtmf_hardware(dsp); in dsp_control_req()
601 dsp_rx_off(dsp); in dsp_control_req()
605 if (dsp->hdlc) { in dsp_control_req()
611 dsp_bf_cleanup(dsp); in dsp_control_req()
612 dsp_cmx_hardware(dsp->conf, dsp); in dsp_control_req()
613 dsp_dtmf_hardware(dsp); in dsp_control_req()
614 dsp_rx_off(dsp); in dsp_control_req()
628 struct dsp *dsp = container_of(ch, struct dsp, ch); in get_features() local
645 dsp->features_rx_off = 1; in get_features()
647 dsp->features_fill_empty = 1; in get_features()
652 *((u_long *)&cq.p1) = (u_long)&dsp->features; in get_features()
660 __func__, dsp->name); in get_features()
666 struct dsp *dsp = container_of(ch, struct dsp, ch); in dsp_function() local
676 dsp->data_pending = 0; in dsp_function()
678 if (dsp->hdlc) { in dsp_function()
680 if (dsp->b_active) in dsp_function()
681 schedule_work(&dsp->workq); in dsp_function()
691 if (dsp->rx_is_off) { in dsp_function()
695 __func__, dsp->name); in dsp_function()
697 if (dsp->hdlc) { in dsp_function()
700 dsp_cmx_hdlc(dsp, skb); in dsp_function()
702 if (dsp->rx_disabled) { in dsp_function()
707 if (dsp->up) in dsp_function()
708 return dsp->up->send(dsp->up, skb); in dsp_function()
715 if (dsp->bf_enable) in dsp_function()
716 dsp_bf_decrypt(dsp, skb->data, skb->len); in dsp_function()
718 if (dsp->pipeline.inuse) in dsp_function()
719 dsp_pipeline_process_rx(&dsp->pipeline, skb->data, in dsp_function()
722 if (dsp->rx_volume) in dsp_function()
723 dsp_change_volume(skb, dsp->rx_volume); in dsp_function()
725 if (dsp->dtmf.software) { in dsp_function()
726 digits = dsp_dtmf_goertzel_decode(dsp, skb->data, in dsp_function()
730 if (dsp->conf && dsp->conf->software) { in dsp_function()
732 dsp_cmx_receive(dsp, skb); in dsp_function()
745 __func__, *digits, dsp->name); in dsp_function()
751 if (dsp->up) { in dsp_function()
752 if (dsp->up->send( in dsp_function()
753 dsp->up, nskb)) in dsp_function()
761 if (dsp->rx_disabled) { in dsp_function()
766 if (dsp->up) in dsp_function()
767 return dsp->up->send(dsp->up, skb); in dsp_function()
773 hh->id, skb->len, dsp->name); in dsp_function()
776 if (!dsp->dtmf.hardware) { in dsp_function()
783 digits = dsp_dtmf_goertzel_decode(dsp, skb->data, in dsp_function()
791 __func__, *digits, dsp->name); in dsp_function()
797 if (dsp->up) { in dsp_function()
798 if (dsp->up->send( in dsp_function()
799 dsp->up, nskb)) in dsp_function()
813 dsp->tx_volume = *((int *)skb->data); in dsp_function()
816 "%d\n", __func__, dsp->tx_volume); in dsp_function()
817 dsp_cmx_hardware(dsp->conf, dsp); in dsp_function()
818 dsp_dtmf_hardware(dsp); in dsp_function()
819 dsp_rx_off(dsp); in dsp_function()
825 "%s\n", __func__, hh->id, dsp->name); in dsp_function()
833 __func__, dsp->name); in dsp_function()
836 dsp->b_active = 1; in dsp_function()
837 dsp->data_pending = 0; in dsp_function()
838 dsp->rx_init = 1; in dsp_function()
840 dsp->rx_W = 0; in dsp_function()
841 dsp->rx_R = 0; in dsp_function()
842 memset(dsp->rx_buff, 0, sizeof(dsp->rx_buff)); in dsp_function()
843 dsp_cmx_hardware(dsp->conf, dsp); in dsp_function()
844 dsp_dtmf_hardware(dsp); in dsp_function()
845 dsp_rx_off(dsp); in dsp_function()
850 dsp->name); in dsp_function()
853 if (dsp->up) in dsp_function()
854 return dsp->up->send(dsp->up, skb); in dsp_function()
860 __func__, dsp->name); in dsp_function()
863 dsp->b_active = 0; in dsp_function()
864 dsp->data_pending = 0; in dsp_function()
865 dsp_cmx_hardware(dsp->conf, dsp); in dsp_function()
866 dsp_rx_off(dsp); in dsp_function()
869 if (dsp->up) in dsp_function()
870 return dsp->up->send(dsp->up, skb); in dsp_function()
879 if (dsp->hdlc) { in dsp_function()
881 if (!dsp->b_active) { in dsp_function()
887 skb_queue_tail(&dsp->sendq, skb); in dsp_function()
888 schedule_work(&dsp->workq); in dsp_function()
893 if (!dsp->tone.tone) { in dsp_function()
895 dsp_cmx_transmit(dsp, skb); in dsp_function()
901 ret = dsp_control_req(dsp, hh, skb); in dsp_function()
908 __func__, dsp->name); in dsp_function()
909 if (dsp->dtmf.hardware || dsp->dtmf.software) in dsp_function()
910 dsp_dtmf_goertzel_init(dsp); in dsp_function()
913 if (dsp->features_fill_empty) in dsp_function()
914 dsp_fill_empty(dsp); in dsp_function()
924 __func__, dsp->name); in dsp_function()
926 dsp->tone.tone = 0; in dsp_function()
927 dsp->tone.hardware = 0; in dsp_function()
928 dsp->tone.software = 0; in dsp_function()
929 if (timer_pending(&dsp->tone.tl)) in dsp_function()
930 del_timer(&dsp->tone.tl); in dsp_function()
931 if (dsp->conf) in dsp_function()
932 dsp_cmx_conf(dsp, 0); /* dsp_cmx_hardware will also be in dsp_function()
934 skb_queue_purge(&dsp->sendq); in dsp_function()
943 __func__, hh->prim, dsp->name); in dsp_function()
954 struct dsp *dsp = container_of(ch, struct dsp, ch); in dsp_ctrl() local
964 if (dsp->ch.peer) in dsp_ctrl()
965 dsp->ch.peer->ctrl(dsp->ch.peer, CLOSE_CHANNEL, NULL); in dsp_ctrl()
971 dsp->b_active = 0; in dsp_ctrl()
974 cancel_work_sync(&dsp->workq); in dsp_ctrl()
976 if (timer_pending(&dsp->tone.tl)) in dsp_ctrl()
977 del_timer(&dsp->tone.tl); in dsp_ctrl()
978 skb_queue_purge(&dsp->sendq); in dsp_ctrl()
981 __func__, dsp->name); in dsp_ctrl()
982 dsp->b_active = 0; in dsp_ctrl()
983 dsp_cmx_conf(dsp, 0); /* dsp_cmx_hardware will also be called in dsp_ctrl()
985 dsp_pipeline_destroy(&dsp->pipeline); in dsp_ctrl()
989 __func__, dsp->name); in dsp_ctrl()
990 list_del(&dsp->list); in dsp_ctrl()
996 vfree(dsp); in dsp_ctrl()
1006 struct dsp *dsp = container_of(work, struct dsp, workq); in dsp_send_bh() local
1010 if (dsp->hdlc && dsp->data_pending) in dsp_send_bh()
1014 while ((skb = skb_dequeue(&dsp->sendq))) { in dsp_send_bh()
1016 if (dsp->data_pending) { in dsp_send_bh()
1019 "no bug!\n", __func__, dsp->name); in dsp_send_bh()
1027 if (dsp->up) { in dsp_send_bh()
1028 if (dsp->up->send(dsp->up, skb)) in dsp_send_bh()
1034 if (dsp->ch.peer) { in dsp_send_bh()
1035 dsp->data_pending = 1; in dsp_send_bh()
1036 if (dsp->ch.recv(dsp->ch.peer, skb)) { in dsp_send_bh()
1038 dsp->data_pending = 0; in dsp_send_bh()
1049 struct dsp *ndsp; in dspcreate()
1055 ndsp = vzalloc(sizeof(struct dsp)); in dspcreate()