Lines Matching refs:dsp

159 dsp_cmx_debug(struct dsp *dsp)  in dsp_cmx_debug()  argument
163 struct dsp *odsp; in dsp_cmx_debug()
172 if (dsp == odsp) in dsp_cmx_debug()
184 member->dsp->name, member->dsp->pcm_slot_tx, in dsp_cmx_debug()
185 member->dsp->pcm_bank_tx, member->dsp->pcm_slot_rx, in dsp_cmx_debug()
186 member->dsp->pcm_bank_rx, member->dsp->hfc_conf, in dsp_cmx_debug()
187 member->dsp->tx_data, member->dsp->rx_is_off, in dsp_cmx_debug()
188 (member->dsp == dsp) ? " *this*" : ""); in dsp_cmx_debug()
220 dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf) in dsp_cmx_add_conf_member() argument
224 if (!conf || !dsp) { in dsp_cmx_add_conf_member()
228 if (dsp->member) { in dsp_cmx_add_conf_member()
234 if (dsp->conf) { in dsp_cmx_add_conf_member()
245 member->dsp = dsp; in dsp_cmx_add_conf_member()
247 memset(dsp->rx_buff, dsp_silence, sizeof(dsp->rx_buff)); in dsp_cmx_add_conf_member()
248 dsp->rx_init = 1; /* rx_W and rx_R will be adjusted on first frame */ in dsp_cmx_add_conf_member()
249 dsp->rx_W = 0; in dsp_cmx_add_conf_member()
250 dsp->rx_R = 0; in dsp_cmx_add_conf_member()
254 dsp->conf = conf; in dsp_cmx_add_conf_member()
255 dsp->member = member; in dsp_cmx_add_conf_member()
265 dsp_cmx_del_conf_member(struct dsp *dsp) in dsp_cmx_del_conf_member() argument
269 if (!dsp) { in dsp_cmx_del_conf_member()
275 if (!dsp->conf) { in dsp_cmx_del_conf_member()
281 if (list_empty(&dsp->conf->mlist)) { in dsp_cmx_del_conf_member()
288 list_for_each_entry(member, &dsp->conf->mlist, list) { in dsp_cmx_del_conf_member()
289 if (member->dsp == dsp) { in dsp_cmx_del_conf_member()
291 dsp->conf = NULL; in dsp_cmx_del_conf_member()
292 dsp->member = NULL; in dsp_cmx_del_conf_member()
361 dsp_cmx_hw_message(struct dsp *dsp, u32 message, u32 param1, u32 param2, in dsp_cmx_hw_message() argument
370 if (dsp->ch.peer) in dsp_cmx_hw_message()
371 dsp->ch.peer->ctrl(dsp->ch.peer, CONTROL_CHANNEL, &cq); in dsp_cmx_hw_message()
384 dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp) in dsp_cmx_hardware() argument
387 struct dsp *finddsp; in dsp_cmx_hardware()
396 if (!dsp) in dsp_cmx_hardware()
400 __func__, dsp->name); in dsp_cmx_hardware()
403 if (dsp->hfc_conf >= 0) { in dsp_cmx_hardware()
408 dsp->name, dsp->hfc_conf); in dsp_cmx_hardware()
409 dsp_cmx_hw_message(dsp, MISDN_CTRL_HFC_CONF_SPLIT, in dsp_cmx_hardware()
411 dsp->hfc_conf = -1; in dsp_cmx_hardware()
414 if (dsp->features.pcm_banks < 1) in dsp_cmx_hardware()
416 if (!dsp->echo.software && !dsp->echo.hardware) { in dsp_cmx_hardware()
418 if (dsp->pcm_slot_tx >= 0 || dsp->pcm_slot_rx >= 0) { in dsp_cmx_hardware()
423 __func__, dsp->name, in dsp_cmx_hardware()
424 dsp->pcm_slot_tx, dsp->pcm_slot_rx); in dsp_cmx_hardware()
425 dsp_cmx_hw_message(dsp, MISDN_CTRL_HFC_PCM_DISC, in dsp_cmx_hardware()
427 dsp->pcm_slot_tx = -1; in dsp_cmx_hardware()
428 dsp->pcm_bank_tx = -1; in dsp_cmx_hardware()
429 dsp->pcm_slot_rx = -1; in dsp_cmx_hardware()
430 dsp->pcm_bank_rx = -1; in dsp_cmx_hardware()
435 dsp->echo.software = dsp->tx_data; in dsp_cmx_hardware()
436 dsp->echo.hardware = 0; in dsp_cmx_hardware()
438 if (dsp->pcm_slot_tx >= 0 && dsp->pcm_slot_rx < 0 && in dsp_cmx_hardware()
439 dsp->pcm_bank_tx == 2 && dsp->pcm_bank_rx == 2) { in dsp_cmx_hardware()
440 dsp->echo.hardware = 1; in dsp_cmx_hardware()
444 if (dsp->pcm_slot_tx >= 0) { in dsp_cmx_hardware()
445 dsp->pcm_slot_rx = dsp->pcm_slot_tx; in dsp_cmx_hardware()
446 dsp->pcm_bank_tx = 2; /* 2 means loop */ in dsp_cmx_hardware()
447 dsp->pcm_bank_rx = 2; in dsp_cmx_hardware()
451 __func__, dsp->name, in dsp_cmx_hardware()
452 dsp->pcm_slot_tx); in dsp_cmx_hardware()
453 dsp_cmx_hw_message(dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
454 dsp->pcm_slot_tx, 2, dsp->pcm_slot_rx, 2); in dsp_cmx_hardware()
455 dsp->echo.hardware = 1; in dsp_cmx_hardware()
459 dsp->pcm_slot_tx = -1; in dsp_cmx_hardware()
460 dsp->pcm_slot_rx = -1; in dsp_cmx_hardware()
463 if (finddsp->features.pcm_id == dsp->features.pcm_id) { in dsp_cmx_hardware()
473 ii = dsp->features.pcm_slots; in dsp_cmx_hardware()
485 dsp->echo.software = 1; in dsp_cmx_hardware()
489 dsp->pcm_slot_tx = i; in dsp_cmx_hardware()
490 dsp->pcm_slot_rx = i; in dsp_cmx_hardware()
491 dsp->pcm_bank_tx = 2; /* loop */ in dsp_cmx_hardware()
492 dsp->pcm_bank_rx = 2; in dsp_cmx_hardware()
496 __func__, dsp->name, dsp->pcm_slot_tx); in dsp_cmx_hardware()
497 dsp_cmx_hw_message(dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
498 dsp->pcm_slot_tx, 2, dsp->pcm_slot_rx, 2); in dsp_cmx_hardware()
499 dsp->echo.hardware = 1; in dsp_cmx_hardware()
514 same_hfc = member->dsp->features.hfc_id; in dsp_cmx_hardware()
515 same_pcm = member->dsp->features.pcm_id; in dsp_cmx_hardware()
519 if (member->dsp->tx_mix) { in dsp_cmx_hardware()
524 member->dsp->name); in dsp_cmx_hardware()
527 dsp = member->dsp; in dsp_cmx_hardware()
529 if (dsp->hfc_conf >= 0) { in dsp_cmx_hardware()
536 dsp->name, in dsp_cmx_hardware()
537 dsp->hfc_conf); in dsp_cmx_hardware()
538 dsp_cmx_hw_message(dsp, in dsp_cmx_hardware()
541 dsp->hfc_conf = -1; in dsp_cmx_hardware()
544 if (dsp->pcm_slot_tx >= 0 || in dsp_cmx_hardware()
545 dsp->pcm_slot_rx >= 0) { in dsp_cmx_hardware()
552 dsp->name, in dsp_cmx_hardware()
553 dsp->pcm_slot_tx, in dsp_cmx_hardware()
554 dsp->pcm_slot_rx); in dsp_cmx_hardware()
555 dsp_cmx_hw_message(dsp, in dsp_cmx_hardware()
558 dsp->pcm_slot_tx = -1; in dsp_cmx_hardware()
559 dsp->pcm_bank_tx = -1; in dsp_cmx_hardware()
560 dsp->pcm_slot_rx = -1; in dsp_cmx_hardware()
561 dsp->pcm_bank_rx = -1; in dsp_cmx_hardware()
569 if (member->dsp->echo.hardware || member->dsp->echo.software) { in dsp_cmx_hardware()
574 member->dsp->name); in dsp_cmx_hardware()
578 if (member->dsp->tx_mix) { in dsp_cmx_hardware()
583 __func__, member->dsp->name); in dsp_cmx_hardware()
587 if (member->dsp->tx_volume) { in dsp_cmx_hardware()
592 __func__, member->dsp->name); in dsp_cmx_hardware()
595 if (member->dsp->rx_volume) { in dsp_cmx_hardware()
600 __func__, member->dsp->name); in dsp_cmx_hardware()
604 if (member->dsp->tx_data) { in dsp_cmx_hardware()
608 __func__, member->dsp->name); in dsp_cmx_hardware()
612 if (member->dsp->pipeline.inuse) { in dsp_cmx_hardware()
617 member->dsp->name); in dsp_cmx_hardware()
621 if (member->dsp->bf_enable) { in dsp_cmx_hardware()
625 __func__, member->dsp->name); in dsp_cmx_hardware()
629 if (member->dsp->features.pcm_id < 0) { in dsp_cmx_hardware()
634 __func__, member->dsp->name); in dsp_cmx_hardware()
638 if (member->dsp->features.pcm_id != same_pcm) { in dsp_cmx_hardware()
644 __func__, member->dsp->name); in dsp_cmx_hardware()
648 if (same_hfc != member->dsp->features.hfc_id) in dsp_cmx_hardware()
651 if (current_conf < 0 && member->dsp->hfc_conf >= 0) in dsp_cmx_hardware()
652 current_conf = member->dsp->hfc_conf; in dsp_cmx_hardware()
654 if (member->dsp->hfc_conf < 0) in dsp_cmx_hardware()
674 dsp = member->dsp; in dsp_cmx_hardware()
691 if (member->dsp->hfc_conf >= 0) { in dsp_cmx_hardware()
696 __func__, member->dsp->name, in dsp_cmx_hardware()
697 member->dsp->hfc_conf); in dsp_cmx_hardware()
698 dsp_cmx_hw_message(member->dsp, in dsp_cmx_hardware()
700 member->dsp->hfc_conf = -1; in dsp_cmx_hardware()
702 if (nextm->dsp->hfc_conf >= 0) { in dsp_cmx_hardware()
707 __func__, nextm->dsp->name, in dsp_cmx_hardware()
708 nextm->dsp->hfc_conf); in dsp_cmx_hardware()
709 dsp_cmx_hw_message(nextm->dsp, in dsp_cmx_hardware()
711 nextm->dsp->hfc_conf = -1; in dsp_cmx_hardware()
714 if (member->dsp->features.pcm_banks > 1 && in dsp_cmx_hardware()
715 nextm->dsp->features.pcm_banks > 1 && in dsp_cmx_hardware()
716 member->dsp->features.hfc_id != in dsp_cmx_hardware()
717 nextm->dsp->features.hfc_id) { in dsp_cmx_hardware()
719 if (member->dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
720 member->dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
721 nextm->dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
722 nextm->dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
723 nextm->dsp->pcm_slot_tx == in dsp_cmx_hardware()
724 member->dsp->pcm_slot_rx && in dsp_cmx_hardware()
725 nextm->dsp->pcm_slot_rx == in dsp_cmx_hardware()
726 member->dsp->pcm_slot_tx && in dsp_cmx_hardware()
727 nextm->dsp->pcm_slot_tx == in dsp_cmx_hardware()
728 member->dsp->pcm_slot_tx && in dsp_cmx_hardware()
729 member->dsp->pcm_bank_tx != in dsp_cmx_hardware()
730 member->dsp->pcm_bank_rx && in dsp_cmx_hardware()
731 nextm->dsp->pcm_bank_tx != in dsp_cmx_hardware()
732 nextm->dsp->pcm_bank_rx) { in dsp_cmx_hardware()
740 member->dsp->name, in dsp_cmx_hardware()
741 nextm->dsp->name, in dsp_cmx_hardware()
742 member->dsp->pcm_slot_tx, in dsp_cmx_hardware()
743 member->dsp->pcm_bank_tx, in dsp_cmx_hardware()
744 member->dsp->pcm_bank_rx); in dsp_cmx_hardware()
751 list_for_each_entry(dsp, &dsp_ilist, list) { in dsp_cmx_hardware()
752 if (dsp != member->dsp && in dsp_cmx_hardware()
753 dsp != nextm->dsp && in dsp_cmx_hardware()
754 member->dsp->features.pcm_id == in dsp_cmx_hardware()
755 dsp->features.pcm_id) { in dsp_cmx_hardware()
756 if (dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
757 dsp->pcm_slot_rx < in dsp_cmx_hardware()
759 freeslots[dsp->pcm_slot_rx] = 0; in dsp_cmx_hardware()
760 if (dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
761 dsp->pcm_slot_tx < in dsp_cmx_hardware()
763 freeslots[dsp->pcm_slot_tx] = 0; in dsp_cmx_hardware()
767 ii = member->dsp->features.pcm_slots; in dsp_cmx_hardware()
778 member->dsp->name, in dsp_cmx_hardware()
779 nextm->dsp->name); in dsp_cmx_hardware()
784 member->dsp->pcm_slot_tx = i; in dsp_cmx_hardware()
785 member->dsp->pcm_slot_rx = i; in dsp_cmx_hardware()
786 nextm->dsp->pcm_slot_tx = i; in dsp_cmx_hardware()
787 nextm->dsp->pcm_slot_rx = i; in dsp_cmx_hardware()
788 member->dsp->pcm_bank_rx = 0; in dsp_cmx_hardware()
789 member->dsp->pcm_bank_tx = 1; in dsp_cmx_hardware()
790 nextm->dsp->pcm_bank_rx = 1; in dsp_cmx_hardware()
791 nextm->dsp->pcm_bank_tx = 0; in dsp_cmx_hardware()
798 member->dsp->name, in dsp_cmx_hardware()
799 nextm->dsp->name, in dsp_cmx_hardware()
800 member->dsp->pcm_slot_tx); in dsp_cmx_hardware()
801 dsp_cmx_hw_message(member->dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
802 member->dsp->pcm_slot_tx, member->dsp->pcm_bank_tx, in dsp_cmx_hardware()
803 member->dsp->pcm_slot_rx, member->dsp->pcm_bank_rx); in dsp_cmx_hardware()
804 dsp_cmx_hw_message(nextm->dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
805 nextm->dsp->pcm_slot_tx, nextm->dsp->pcm_bank_tx, in dsp_cmx_hardware()
806 nextm->dsp->pcm_slot_rx, nextm->dsp->pcm_bank_rx); in dsp_cmx_hardware()
813 if (member->dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
814 member->dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
815 nextm->dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
816 nextm->dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
817 nextm->dsp->pcm_slot_tx == in dsp_cmx_hardware()
818 member->dsp->pcm_slot_rx && in dsp_cmx_hardware()
819 nextm->dsp->pcm_slot_rx == in dsp_cmx_hardware()
820 member->dsp->pcm_slot_tx && in dsp_cmx_hardware()
821 member->dsp->pcm_slot_tx != in dsp_cmx_hardware()
822 member->dsp->pcm_slot_rx && in dsp_cmx_hardware()
823 member->dsp->pcm_bank_tx == 0 && in dsp_cmx_hardware()
824 member->dsp->pcm_bank_rx == 0 && in dsp_cmx_hardware()
825 nextm->dsp->pcm_bank_tx == 0 && in dsp_cmx_hardware()
826 nextm->dsp->pcm_bank_rx == 0) { in dsp_cmx_hardware()
833 member->dsp->name, in dsp_cmx_hardware()
834 nextm->dsp->name, in dsp_cmx_hardware()
835 member->dsp->pcm_slot_tx, in dsp_cmx_hardware()
836 member->dsp->pcm_slot_rx); in dsp_cmx_hardware()
843 list_for_each_entry(dsp, &dsp_ilist, list) { in dsp_cmx_hardware()
844 if (dsp != member->dsp && in dsp_cmx_hardware()
845 dsp != nextm->dsp && in dsp_cmx_hardware()
846 member->dsp->features.pcm_id == in dsp_cmx_hardware()
847 dsp->features.pcm_id) { in dsp_cmx_hardware()
848 if (dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
849 dsp->pcm_slot_rx < in dsp_cmx_hardware()
851 freeslots[dsp->pcm_slot_rx] = 0; in dsp_cmx_hardware()
852 if (dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
853 dsp->pcm_slot_tx < in dsp_cmx_hardware()
855 freeslots[dsp->pcm_slot_tx] = 0; in dsp_cmx_hardware()
859 ii = member->dsp->features.pcm_slots; in dsp_cmx_hardware()
870 member->dsp->name, in dsp_cmx_hardware()
871 nextm->dsp->name); in dsp_cmx_hardware()
887 member->dsp->name, in dsp_cmx_hardware()
888 nextm->dsp->name); in dsp_cmx_hardware()
893 member->dsp->pcm_slot_tx = i1; in dsp_cmx_hardware()
894 member->dsp->pcm_slot_rx = i2; in dsp_cmx_hardware()
895 nextm->dsp->pcm_slot_tx = i2; in dsp_cmx_hardware()
896 nextm->dsp->pcm_slot_rx = i1; in dsp_cmx_hardware()
897 member->dsp->pcm_bank_rx = 0; in dsp_cmx_hardware()
898 member->dsp->pcm_bank_tx = 0; in dsp_cmx_hardware()
899 nextm->dsp->pcm_bank_rx = 0; in dsp_cmx_hardware()
900 nextm->dsp->pcm_bank_tx = 0; in dsp_cmx_hardware()
907 member->dsp->name, in dsp_cmx_hardware()
908 nextm->dsp->name, in dsp_cmx_hardware()
909 member->dsp->pcm_slot_tx, in dsp_cmx_hardware()
910 member->dsp->pcm_slot_rx); in dsp_cmx_hardware()
911 dsp_cmx_hw_message(member->dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
912 member->dsp->pcm_slot_tx, member->dsp->pcm_bank_tx, in dsp_cmx_hardware()
913 member->dsp->pcm_slot_rx, member->dsp->pcm_bank_rx); in dsp_cmx_hardware()
914 dsp_cmx_hw_message(nextm->dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
915 nextm->dsp->pcm_slot_tx, nextm->dsp->pcm_bank_tx, in dsp_cmx_hardware()
916 nextm->dsp->pcm_slot_rx, nextm->dsp->pcm_bank_rx); in dsp_cmx_hardware()
956 if (!member->dsp->features.hfc_conf) in dsp_cmx_hardware()
959 if (member->dsp->hdlc) in dsp_cmx_hardware()
962 if (member->dsp->hfc_conf == current_conf) in dsp_cmx_hardware()
966 list_for_each_entry(dsp, &dsp_ilist, list) { in dsp_cmx_hardware()
972 dsp != member->dsp && in dsp_cmx_hardware()
974 member->dsp->features.pcm_id == in dsp_cmx_hardware()
975 dsp->features.pcm_id) { in dsp_cmx_hardware()
977 if (dsp->pcm_slot_tx >= 0 && in dsp_cmx_hardware()
978 dsp->pcm_slot_tx < in dsp_cmx_hardware()
980 freeslots[dsp->pcm_slot_tx] = 0; in dsp_cmx_hardware()
981 if (dsp->pcm_slot_rx >= 0 && in dsp_cmx_hardware()
982 dsp->pcm_slot_rx < in dsp_cmx_hardware()
984 freeslots[dsp->pcm_slot_rx] = 0; in dsp_cmx_hardware()
988 ii = member->dsp->features.pcm_slots; in dsp_cmx_hardware()
1007 member->dsp->name, current_conf, i); in dsp_cmx_hardware()
1009 member->dsp->pcm_slot_tx = i; in dsp_cmx_hardware()
1010 member->dsp->pcm_slot_rx = i; in dsp_cmx_hardware()
1011 member->dsp->pcm_bank_tx = 2; /* loop */ in dsp_cmx_hardware()
1012 member->dsp->pcm_bank_rx = 2; in dsp_cmx_hardware()
1013 member->dsp->hfc_conf = current_conf; in dsp_cmx_hardware()
1014 dsp_cmx_hw_message(member->dsp, MISDN_CTRL_HFC_PCM_CONN, in dsp_cmx_hardware()
1016 dsp_cmx_hw_message(member->dsp, in dsp_cmx_hardware()
1028 list_for_each_entry(dsp, &dsp_ilist, list) { in dsp_cmx_hardware()
1030 if (dsp->features.hfc_id == same_hfc && in dsp_cmx_hardware()
1032 dsp->hfc_conf >= 0 && in dsp_cmx_hardware()
1034 dsp->hfc_conf < 8) in dsp_cmx_hardware()
1035 freeunits[dsp->hfc_conf] = 0; in dsp_cmx_hardware()
1064 dsp_cmx_conf(struct dsp *dsp, u32 conf_id) in dsp_cmx_conf() argument
1071 if (dsp->conf_id == conf_id) in dsp_cmx_conf()
1075 if (dsp->conf_id) { in dsp_cmx_conf()
1078 dsp->conf->id); in dsp_cmx_conf()
1080 conf = dsp->conf; in dsp_cmx_conf()
1081 err = dsp_cmx_del_conf_member(dsp); in dsp_cmx_conf()
1084 dsp->conf_id = 0; in dsp_cmx_conf()
1087 dsp_cmx_hardware(NULL, dsp); in dsp_cmx_conf()
1123 if (dsp->hdlc && !member->dsp->hdlc) { in dsp_cmx_conf()
1129 if (!dsp->hdlc && member->dsp->hdlc) { in dsp_cmx_conf()
1137 err = dsp_cmx_add_conf_member(dsp, conf); in dsp_cmx_conf()
1140 dsp->conf_id = conf_id; in dsp_cmx_conf()
1148 dsp_cmx_hardware(NULL, dsp); in dsp_cmx_conf()
1161 showdelay(struct dsp *dsp, int samples, int delay) in showdelay() argument
1173 printk(KERN_DEBUG "DELAY (%s) %3d >%s\n", dsp->name, delay, in showdelay()
1182 dsp_cmx_receive(struct dsp *dsp, struct sk_buff *skb) in dsp_cmx_receive() argument
1206 if (dsp->rx_init) { in dsp_cmx_receive()
1207 dsp->rx_init = 0; in dsp_cmx_receive()
1208 if (dsp->features.unordered) { in dsp_cmx_receive()
1209 dsp->rx_R = (hh->id & CMX_BUFF_MASK); in dsp_cmx_receive()
1210 if (dsp->cmx_delay) in dsp_cmx_receive()
1211 dsp->rx_W = (dsp->rx_R + dsp->cmx_delay) in dsp_cmx_receive()
1214 dsp->rx_W = (dsp->rx_R + (dsp_poll >> 1)) in dsp_cmx_receive()
1217 dsp->rx_R = 0; in dsp_cmx_receive()
1218 if (dsp->cmx_delay) in dsp_cmx_receive()
1219 dsp->rx_W = dsp->cmx_delay; in dsp_cmx_receive()
1221 dsp->rx_W = dsp_poll >> 1; in dsp_cmx_receive()
1225 if (dsp->features.unordered) { in dsp_cmx_receive()
1226 dsp->rx_W = (hh->id & CMX_BUFF_MASK); in dsp_cmx_receive()
1233 if (((dsp->rx_W-dsp->rx_R) & CMX_BUFF_MASK) >= CMX_BUFF_HALF) { in dsp_cmx_receive()
1238 "(inst %s)\n", (u_long)dsp, dsp->name); in dsp_cmx_receive()
1240 if (dsp->features.unordered) { in dsp_cmx_receive()
1241 dsp->rx_R = (hh->id & CMX_BUFF_MASK); in dsp_cmx_receive()
1242 if (dsp->cmx_delay) in dsp_cmx_receive()
1243 dsp->rx_W = (dsp->rx_R + dsp->cmx_delay) in dsp_cmx_receive()
1246 dsp->rx_W = (dsp->rx_R + (dsp_poll >> 1)) in dsp_cmx_receive()
1249 dsp->rx_R = 0; in dsp_cmx_receive()
1250 if (dsp->cmx_delay) in dsp_cmx_receive()
1251 dsp->rx_W = dsp->cmx_delay; in dsp_cmx_receive()
1253 dsp->rx_W = dsp_poll >> 1; in dsp_cmx_receive()
1255 memset(dsp->rx_buff, dsp_silence, sizeof(dsp->rx_buff)); in dsp_cmx_receive()
1258 if (dsp->cmx_delay) in dsp_cmx_receive()
1259 if (((dsp->rx_W - dsp->rx_R) & CMX_BUFF_MASK) >= in dsp_cmx_receive()
1260 (dsp->cmx_delay << 1)) { in dsp_cmx_receive()
1266 (u_long)dsp, dsp->name); in dsp_cmx_receive()
1268 if (dsp->features.unordered) { in dsp_cmx_receive()
1269 dsp->rx_R = (hh->id & CMX_BUFF_MASK); in dsp_cmx_receive()
1270 dsp->rx_W = (dsp->rx_R + dsp->cmx_delay) in dsp_cmx_receive()
1273 dsp->rx_R = 0; in dsp_cmx_receive()
1274 dsp->rx_W = dsp->cmx_delay; in dsp_cmx_receive()
1276 memset(dsp->rx_buff, dsp_silence, sizeof(dsp->rx_buff)); in dsp_cmx_receive()
1283 (u_long)dsp, dsp->rx_R, dsp->rx_W, len, dsp->name); in dsp_cmx_receive()
1288 d = dsp->rx_buff; in dsp_cmx_receive()
1289 w = dsp->rx_W; in dsp_cmx_receive()
1298 dsp->rx_W = ((dsp->rx_W + len) & CMX_BUFF_MASK); in dsp_cmx_receive()
1300 showdelay(dsp, len, (dsp->rx_W-dsp->rx_R) & CMX_BUFF_MASK); in dsp_cmx_receive()
1309 dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members) argument
1311 struct dsp_conf *conf = dsp->conf;
1312 struct dsp *member, *other;
1322 if (!dsp->b_active) { /* if not active */
1323 dsp->last_tx = 0;
1326 if (((dsp->conf && dsp->conf->hardware) || /* hardware conf */
1327 dsp->echo.hardware) && /* OR hardware echo */
1328 dsp->tx_R == dsp->tx_W && /* AND no tx-data */
1329 !(dsp->tone.tone && dsp->tone.software)) { /* AND not soft tones */
1330 if (!dsp->tx_data) { /* no tx_data for user space required */
1331 dsp->last_tx = 0;
1334 if (dsp->conf && dsp->conf->software && dsp->conf->hardware)
1336 if (dsp->echo.software && dsp->echo.hardware)
1343 members, dsp->name, conf, dsp->rx_R, dsp->rx_W);
1347 if (dsp->cmx_delay && !dsp->last_tx) {
1364 dsp->last_tx = 1;
1367 member = dsp;
1368 p = dsp->tx_buff; /* transmit data */
1369 q = dsp->rx_buff; /* received data */
1371 t = dsp->tx_R; /* tx-pointers */
1372 tt = dsp->tx_W;
1373 r = dsp->rx_R; /* rx-pointers */
1383 if (dsp->tone.tone && dsp->tone.software) {
1385 dsp_tone_copy(dsp, d, len);
1386 dsp->tx_R = 0; /* clear tx buffer */
1387 dsp->tx_W = 0;
1391 if (!dsp->tx_mix && t != tt) {
1407 dsp->tx_R = t;
1421 if (!dsp->echo.software) {
1450 dsp->tx_R = t;
1461 struct dsp_conf_member, list))->dsp;
1464 struct dsp_conf_member, list))->dsp;
1471 if (!dsp->echo.software) {
1511 dsp->tx_R = t;
1516 if (!dsp->echo.software) {
1571 dsp->tx_R = t;
1579 if (dsp->tx_data) {
1584 skb_queue_tail(&dsp->sendq, nskb);
1585 schedule_work(&dsp->workq);
1600 skb_queue_tail(&dsp->sendq, txskb);
1607 if (dsp->tx_volume)
1608 dsp_change_volume(nskb, dsp->tx_volume);
1610 if (dsp->pipeline.inuse)
1611 dsp_pipeline_process_tx(&dsp->pipeline, nskb->data,
1614 if (dsp->bf_enable)
1615 dsp_bf_encrypt(dsp, nskb->data, nskb->len);
1617 skb_queue_tail(&dsp->sendq, nskb);
1618 schedule_work(&dsp->workq);
1632 struct dsp *dsp; local
1668 list_for_each_entry(dsp, &dsp_ilist, list) {
1669 if (dsp->hdlc)
1671 conf = dsp->conf;
1686 dsp_cmx_send_member(dsp, length, mixbuffer, members);
1707 if (member->dsp->hdlc)
1712 dsp = member->dsp;
1715 q = dsp->rx_buff;
1716 r = dsp->rx_R;
1728 dsp_cmx_send_member(member->dsp, length,
1735 list_for_each_entry(dsp, &dsp_ilist, list) {
1736 if (dsp->hdlc)
1738 p = dsp->rx_buff;
1739 q = dsp->tx_buff;
1740 r = dsp->rx_R;
1742 if (!dsp->rx_is_off) {
1750 dsp->rx_R = r; /* write incremented read pointer */
1754 delay = (dsp->rx_W-dsp->rx_R) & CMX_BUFF_MASK;
1758 if (delay < dsp->rx_delay[0])
1759 dsp->rx_delay[0] = delay;
1761 delay = (dsp->tx_W-dsp->tx_R) & CMX_BUFF_MASK;
1765 if (delay < dsp->tx_delay[0])
1766 dsp->tx_delay[0] = delay;
1769 delay = dsp->rx_delay[0];
1772 if (delay > dsp->rx_delay[i])
1773 delay = dsp->rx_delay[i];
1781 if (delay > dsp_poll && !dsp->cmx_delay) {
1787 dsp->name);
1788 r = dsp->rx_R;
1797 dsp->rx_R = r;
1801 delay = dsp->tx_delay[0];
1804 if (delay > dsp->tx_delay[i])
1805 delay = dsp->tx_delay[i];
1812 if (delay > dsp_poll && dsp->tx_dejitter) {
1818 dsp->name);
1819 r = dsp->tx_R;
1828 dsp->tx_R = r;
1834 dsp->rx_delay[i] = dsp->rx_delay[i - 1];
1835 dsp->tx_delay[i] = dsp->tx_delay[i - 1];
1838 dsp->tx_delay[0] = CMX_BUFF_HALF; /* (infinite) delay */
1839 dsp->rx_delay[0] = CMX_BUFF_HALF; /* (infinite) delay */
1860 dsp_cmx_transmit(struct dsp *dsp, struct sk_buff *skb) argument
1870 w = dsp->tx_W;
1871 ww = dsp->tx_R;
1872 p = dsp->tx_buff;
1886 dsp->tx_W = ww;
1891 (u_long)dsp, (ww - w) & CMX_BUFF_MASK, w, ww, dsp->name);
1916 dsp_cmx_hdlc(struct dsp *dsp, struct sk_buff *skb) argument
1923 if (!dsp->b_active)
1931 if (!dsp->conf) {
1933 if (dsp->echo.software) {
1939 skb_queue_tail(&dsp->sendq, nskb);
1940 schedule_work(&dsp->workq);
1946 if (dsp->conf->hardware)
1948 list_for_each_entry(member, &dsp->conf->mlist, list) {
1949 if (dsp->echo.software || member->dsp != dsp) {
1955 skb_queue_tail(&member->dsp->sendq, nskb);
1956 schedule_work(&member->dsp->workq);