├── README.md ├── bcm63xx-ast-chan ├── LICENSE ├── asterisk-1.8-chan-bcm63xx-phone │ └── Makefile ├── asterisk-11-chan-bcm63xx-phone │ └── Makefile ├── asterisk-13-chan-bcm63xx-phone │ └── Makefile ├── bcm63xx-ast-chan.project ├── configs │ └── bcm63xx_phone.conf.sample └── src │ ├── callerid.c │ ├── callerid.h │ ├── chan_bcm63xx_phone.c │ ├── logger.h │ ├── tone_generation.c │ └── tone_generation.h ├── bcm63xx-phone-test ├── LICENSE ├── Makefile ├── bcm63xx-phone-debug.project ├── bcm63xx-phone-test.project ├── bcm63xx-phone-user.project ├── fake_kernel │ ├── fake_kernel.c │ ├── inc │ │ ├── extern │ │ │ ├── linux │ │ │ │ ├── atomic.h │ │ │ │ ├── barrier.h │ │ │ │ ├── bitops.h │ │ │ │ ├── clk.h │ │ │ │ ├── delay.h │ │ │ │ ├── dma-mapping.h │ │ │ │ ├── errno.h │ │ │ │ ├── file.h │ │ │ │ ├── jiffies.h │ │ │ │ ├── kernel.h │ │ │ │ ├── list.h │ │ │ │ ├── log2.h │ │ │ │ ├── mm.h │ │ │ │ ├── module.h │ │ │ │ ├── mutex.h │ │ │ │ ├── poll.h │ │ │ │ ├── sched.h │ │ │ │ ├── slab.h │ │ │ │ ├── spinlock.h │ │ │ │ ├── stddef.h │ │ │ │ ├── timer.h │ │ │ │ ├── uaccess.h │ │ │ │ ├── wait.h │ │ │ │ └── workqueue.h │ │ │ └── oslec.h │ │ ├── fake_kernel.h │ │ ├── fake_kernel_compile.h │ │ └── workqueue_internal.h │ ├── jiffies.c │ ├── mutex.c │ ├── timer.c │ ├── wait.c │ └── workqueue.c └── src │ ├── debug.c │ ├── demo-thanks.h │ ├── echo │ ├── echo.c │ ├── echo.h │ └── fir.h │ ├── main.c │ └── user.c ├── bcm63xx-phone ├── LICENSE ├── bcm63xx-phone-dahdi │ └── Makefile ├── bcm63xx-phone │ └── Makefile ├── patches │ ├── 14.07 │ │ └── 000-disable-spi-bcm63xx-module.patch │ ├── 15.05 │ │ └── 000-disable-spi-bcm63xx-module.patch │ ├── 17.01 │ │ ├── 000-disable-spi-bcm63xx-module.patch │ │ └── 001-add-fn-to-spi-bcm63xx-for-quick-transfer.patch │ └── 18.06 │ │ ├── 000-disable-spi-bcm63xx-module.patch │ │ └── 001-add-fn-to-spi-bcm63xx-for-quick-transfer.patch └── src │ ├── Makefile.src │ ├── board │ └── board.c │ ├── common.c │ ├── debug.c │ ├── extern │ └── zarlink │ │ ├── 2.24.0.lite │ │ ├── api_lib │ │ │ ├── common │ │ │ │ ├── vp_api_common.c │ │ │ │ ├── vp_api_config.c │ │ │ │ ├── vp_api_control.c │ │ │ │ ├── vp_api_init.c │ │ │ │ ├── vp_api_query.c │ │ │ │ ├── vp_api_test.c │ │ │ │ ├── vp_debug.c │ │ │ │ ├── vp_dtmf_detect.c │ │ │ │ ├── vp_pulse_decode.c │ │ │ │ └── vp_timer_queue.c │ │ │ ├── includes │ │ │ │ ├── vp580_api.h │ │ │ │ ├── vp790_api.h │ │ │ │ ├── vp880_api.h │ │ │ │ ├── vp886_api.h │ │ │ │ ├── vp890_api.h │ │ │ │ ├── vp_CSLAC_types.h │ │ │ │ ├── vp_adaptive_ringing.h │ │ │ │ ├── vp_api.h │ │ │ │ ├── vp_api_cfg.h │ │ │ │ ├── vp_api_cfg_int.h │ │ │ │ ├── vp_api_common.h │ │ │ │ ├── vp_api_dev_term.h │ │ │ │ ├── vp_api_event.h │ │ │ │ ├── vp_api_fxo_params.h │ │ │ │ ├── vp_api_int.h │ │ │ │ ├── vp_api_option.h │ │ │ │ ├── vp_api_test.h │ │ │ │ ├── vp_api_timer.h │ │ │ │ ├── vp_debug.h │ │ │ │ ├── vp_debug_colors.h │ │ │ │ ├── vp_debug_masks.h │ │ │ │ ├── vp_dtmf_detect.h │ │ │ │ ├── vp_pulse_decode.h │ │ │ │ └── vp_timer_queue.h │ │ │ ├── vp580_api │ │ │ │ ├── vp580_api_int.h │ │ │ │ ├── vp580_control.c │ │ │ │ ├── vp580_init.c │ │ │ │ └── vp580_query.c │ │ │ ├── vp790_api │ │ │ │ ├── vp790_api_int.h │ │ │ │ ├── vp790_control.c │ │ │ │ ├── vp790_init.c │ │ │ │ └── vp790_query.c │ │ │ ├── vp880_api │ │ │ │ ├── vp880_abs_calibration.c │ │ │ │ ├── vp880_api_int.h │ │ │ │ ├── vp880_calibration_common.c │ │ │ │ ├── vp880_control_common.c │ │ │ │ ├── vp880_fxo_control.c │ │ │ │ ├── vp880_fxs_control.c │ │ │ │ ├── vp880_init.c │ │ │ │ ├── vp880_linestate_control.c │ │ │ │ ├── vp880_lp_control.c │ │ │ │ ├── vp880_query.c │ │ │ │ └── vp880_tracker_calibration.c │ │ │ ├── vp886_api │ │ │ │ ├── vp886_adaptive_ringing.c │ │ │ │ ├── vp886_api_int.h │ │ │ │ ├── vp886_calibration_common.c │ │ │ │ ├── vp886_common.c │ │ │ │ ├── vp886_control.c │ │ │ │ ├── vp886_events.c │ │ │ │ ├── vp886_init.c │ │ │ │ ├── vp886_query.c │ │ │ │ ├── vp886_registers.h │ │ │ │ ├── vp886_slac.c │ │ │ │ └── vp886_timers.c │ │ │ └── vp890_api │ │ │ │ ├── vp890_apiCal.c │ │ │ │ ├── vp890_api_int.h │ │ │ │ ├── vp890_common.c │ │ │ │ ├── vp890_config.c │ │ │ │ ├── vp890_control.c │ │ │ │ ├── vp890_fxo_control.c │ │ │ │ ├── vp890_fxs_control.c │ │ │ │ ├── vp890_init.c │ │ │ │ ├── vp890_lp_control.c │ │ │ │ └── vp890_query.c │ │ ├── apps │ │ │ ├── VE880_initialization │ │ │ │ ├── VE880_ABS_profiles.c │ │ │ │ ├── VE880_ABS_profiles.h │ │ │ │ ├── VE880_FB_profiles.c │ │ │ │ ├── VE880_FB_profiles.h │ │ │ │ ├── VE880_IB_profiles.c │ │ │ │ ├── VE880_IB_profiles.h │ │ │ │ └── VE880_initialization.c │ │ │ ├── VE880_line_test │ │ │ │ ├── VE880_ABS_profiles.c │ │ │ │ ├── VE880_ABS_profiles.h │ │ │ │ ├── VE880_FB_profiles.c │ │ │ │ ├── VE880_FB_profiles.h │ │ │ │ ├── VE880_IB_profiles.c │ │ │ │ ├── VE880_IB_profiles.h │ │ │ │ └── VE880_line_test.c │ │ │ ├── VE890_initialization_1FXS │ │ │ │ ├── Le71HR8927G_100V_IB_Profile.c │ │ │ │ ├── Le71HR8927G_100V_IB_Profile.h │ │ │ │ └── VE890_initialization.c │ │ │ ├── VE890_initialization_1FXS_1FXO │ │ │ │ ├── Le71HR8923_profiles.c │ │ │ │ ├── Le71HR8923_profiles.h │ │ │ │ └── VE890_initialization.c │ │ │ ├── ZL880_initialization │ │ │ │ ├── ZL880_initialization.c │ │ │ │ ├── ZLR88621L_ABS_profiles.c │ │ │ │ ├── ZLR88621L_ABS_profiles.h │ │ │ │ ├── ZLR88721L_FB_profiles.c │ │ │ │ ├── ZLR88721L_FB_profiles.h │ │ │ │ ├── ZLR88722L_IB_profiles.c │ │ │ │ └── ZLR88722L_IB_profiles.h │ │ │ ├── ZL880_line_test │ │ │ │ ├── ZL880_line_test.c │ │ │ │ ├── ZLR88621L_ABS_profiles.c │ │ │ │ ├── ZLR88621L_ABS_profiles.h │ │ │ │ ├── ZLR88721L_FB_profiles.c │ │ │ │ ├── ZLR88721L_FB_profiles.h │ │ │ │ ├── ZLR88722L_IB_profiles.c │ │ │ │ └── ZLR88722L_IB_profiles.h │ │ │ └── common │ │ │ │ ├── sdk_qs_board.c │ │ │ │ ├── sdk_qs_board.h │ │ │ │ ├── sdk_qs_pin_ctrl.c │ │ │ │ ├── sdk_qs_pin_ctrl.h │ │ │ │ ├── sdk_qs_utils.c │ │ │ │ └── sdk_qs_utils.h │ │ ├── arch │ │ │ ├── examples │ │ │ │ ├── hbi_hal.h │ │ │ │ ├── mpi_hal.h │ │ │ │ ├── sys_service.c │ │ │ │ ├── sys_service.h │ │ │ │ ├── vp_api_profile_type.h │ │ │ │ ├── vp_api_types.h │ │ │ │ ├── vp_hal.c │ │ │ │ └── vp_hal.h │ │ │ └── ztap │ │ │ │ ├── kernel │ │ │ │ ├── hbi_hal.h │ │ │ │ ├── mpi_hal.h │ │ │ │ ├── sys_service.c │ │ │ │ ├── sys_service.h │ │ │ │ ├── vp_api_profile_type.h │ │ │ │ ├── vp_api_types.h │ │ │ │ ├── vp_firmware.c │ │ │ │ ├── vp_firmware.h │ │ │ │ ├── vp_hal.c │ │ │ │ └── vp_hal.h │ │ │ │ └── userspace │ │ │ │ ├── hbi_hal.h │ │ │ │ ├── mpi_hal.h │ │ │ │ ├── sys_service.c │ │ │ │ ├── sys_service.h │ │ │ │ ├── vp_api_profile_type.h │ │ │ │ ├── vp_api_types.h │ │ │ │ ├── vp_hal.c │ │ │ │ └── vp_hal.h │ │ ├── coefficient_sets │ │ │ ├── VE880 │ │ │ │ ├── VE880_ABS100V_PCM │ │ │ │ │ ├── VE880_ABS100V_LITE_NB_PCM.vpw │ │ │ │ │ └── VE880_ABS100V_LITE_WB_PCM.vpw │ │ │ │ ├── VE880_ABS100V_ZSI │ │ │ │ │ ├── VE880_ABS100V_LITE_NB_ZSI.vpw │ │ │ │ │ └── VE880_ABS100V_LITE_WB_ZSI.vpw │ │ │ │ ├── VE880_Tracker_FB100V_PCM │ │ │ │ │ ├── VE880_Tracker_FB100V_LITE_NB_PCM.vpw │ │ │ │ │ └── VE880_Tracker_FB100V_LITE_WB_PCM.vpw │ │ │ │ ├── VE880_Tracker_FB100V_ZSI │ │ │ │ │ ├── VE880_Tracker_FB100V_LITE_NB_ZSI.vpw │ │ │ │ │ └── VE880_Tracker_FB100V_LITE_WB_ZSI.vpw │ │ │ │ ├── VE880_Tracker_FB150V_PCM │ │ │ │ │ ├── VE880_Tracker_FB150V_LITE_NB_PCM.vpw │ │ │ │ │ └── VE880_Tracker_FB150V_LITE_WB_PCM.vpw │ │ │ │ ├── VE880_Tracker_FB150V_ZSI │ │ │ │ │ ├── VE880_Tracker_FB150V_LITE_NB_ZSI.vpw │ │ │ │ │ └── VE880_Tracker_FB150V_LITE_WB_ZSI.vpw │ │ │ │ ├── VE880_Tracker_IB100V_PCM │ │ │ │ │ ├── VE880_Tracker_IB100V_LITE_NB_PCM.vpw │ │ │ │ │ └── VE880_Tracker_IB100V_LITE_WB_PCM.vpw │ │ │ │ ├── VE880_Tracker_IB100V_ZSI │ │ │ │ │ ├── VE880_Tracker_IB100V_LITE_NB_ZSI.vpw │ │ │ │ │ └── VE880_Tracker_IB100V_LITE_WB_ZSI.vpw │ │ │ │ ├── VE880_Tracker_IB150V_PCM │ │ │ │ │ ├── VE880_Tracker_IB150V_LITE_NB_PCM.vpw │ │ │ │ │ └── VE880_Tracker_IB150V_LITE_WB_PCM.vpw │ │ │ │ └── VE880_Tracker_IB150V_ZSI │ │ │ │ │ ├── VE880_Tracker_IB150V_LITE_NB_ZSI.vpw │ │ │ │ │ └── VE880_Tracker_IB150V_LITE_WB_ZSI.vpw │ │ │ ├── VE890 │ │ │ │ ├── VE8901 │ │ │ │ │ └── VE8901_LITE_NB.vpw │ │ │ │ ├── VE8910HV_FB150V │ │ │ │ │ ├── VE8910HV_FB150V_LITE_NB.vpw │ │ │ │ │ └── VE8910HV_FB150V_LITE_WB.vpw │ │ │ │ ├── VE8910HV_IB150V │ │ │ │ │ ├── VE8910HV_IB150V_LITE_NB.vpw │ │ │ │ │ └── VE8910HV_IB150V_LITE_WB.vpw │ │ │ │ ├── VE8910_BB100V │ │ │ │ │ ├── VE8910_BB100V_LITE_NB.vpw │ │ │ │ │ └── VE8910_BB100V_LITE_WB.vpw │ │ │ │ ├── VE8910_FB100V │ │ │ │ │ ├── VE8910_FB100V_LITE_NB.vpw │ │ │ │ │ └── VE8910_FB100V_LITE_WB.vpw │ │ │ │ ├── VE8910_IB100V │ │ │ │ │ ├── VE8910_IB100V_LITE_NB.vpw │ │ │ │ │ └── VE8910_IB100V_LITE_WB.vpw │ │ │ │ ├── VE8911HV_FB150V │ │ │ │ │ ├── VE8911HV_FB150V_LITE_NB.vpw │ │ │ │ │ └── VE8911HV_FB150V_LITE_WB.vpw │ │ │ │ ├── VE8911HV_IB150V │ │ │ │ │ ├── VE8911HV_IB150V_LITE_NB.vpw │ │ │ │ │ └── VE8911HV_IB150V_LITE_WB.vpw │ │ │ │ ├── VE8911_BB100V │ │ │ │ │ ├── VE8911_BB100V_LITE_NB.vpw │ │ │ │ │ └── VE8911_BB100V_LITE_WB.vpw │ │ │ │ ├── VE8911_FB100V │ │ │ │ │ ├── VE8911_FB100V_LITE_NB.vpw │ │ │ │ │ └── VE8911_FB100V_LITE_WB.vpw │ │ │ │ └── VE8911_IB100V │ │ │ │ │ ├── VE8911_IB100V_LITE_NB.vpw │ │ │ │ │ └── VE8911_IB100V_LITE_WB.vpw │ │ │ ├── ZL880 │ │ │ │ ├── ZLR88621_ABS │ │ │ │ │ ├── ZLR88621H_SM2_LITE.vpw │ │ │ │ │ └── ZLR88621L_SM2_LITE.vpw │ │ │ │ ├── ZLR88721_Tracker_FB │ │ │ │ │ ├── ZLR88721H_SM2_LITE.vpw │ │ │ │ │ └── ZLR88721L_SM2_LITE.vpw │ │ │ │ ├── ZLR88722_Tracker_IB │ │ │ │ │ └── ZLR88722L_SM2_LITE.vpw │ │ │ │ ├── ZLR88821_Shared_Tracker │ │ │ │ │ └── ZLR88821_SM2_LITE.vpw │ │ │ │ └── ZLR88822_BB_ABS │ │ │ │ │ └── ZLR88822_SM2_LITE.vpw │ │ │ └── miSLIC │ │ │ │ ├── ZLR96621_ABS │ │ │ │ └── ZLR96621L_SM2_LITE.vpw │ │ │ │ ├── ZLR96622_BB_ABS │ │ │ │ └── ZLR96622_SM2_LITE.vpw │ │ │ │ ├── ZLR96721_Tracker_FB │ │ │ │ └── ZLR96721H_SM2_LITE.vpw │ │ │ │ └── ZLR96722_Tracker_IB │ │ │ │ └── ZLR96722L_SM2_LITE.vpw │ │ ├── documents │ │ │ ├── VP_API_II_An_Applications_Perspective_Rev1.pdf │ │ │ ├── VP_Api_CSLAC_Rev20.pdf │ │ │ └── VP_Api_ZL880-miSLIC_Rev8.pdf │ │ └── release_notes │ │ │ ├── EN_LE71SDKAPIL-P2.24.0.pdf │ │ │ └── ReadMeFirst.txt │ │ ├── Le88221-241.pdf │ │ ├── Le88266-286.pdf │ │ ├── arch │ │ └── bcm63xx │ │ │ ├── hbi_hal.h │ │ │ ├── mpi_hal.h │ │ │ ├── sys_service.c │ │ │ ├── sys_service.h │ │ │ ├── vp_api_profile_type.h │ │ │ ├── vp_api_types.h │ │ │ ├── vp_hal.c │ │ │ └── vp_hal.h │ │ └── readme.txt │ ├── inc │ ├── bcm63xx.h │ ├── bcm63xx_line_state.c │ ├── bcm63xx_line_state.h │ ├── bcm63xx_log.h │ ├── bcm63xx_phone.h │ ├── bcm63xx_ring_buf.c │ ├── bcm63xx_ring_buf.h │ ├── board.h │ ├── compile.h │ ├── config.h │ ├── countryArchive.h │ ├── extern │ │ ├── linux │ │ │ ├── atomic.h │ │ │ ├── barrier.h │ │ │ ├── bitops.h │ │ │ ├── clk.h │ │ │ ├── delay.h │ │ │ ├── dma-mapping.h │ │ │ ├── errno.h │ │ │ ├── file.h │ │ │ ├── jiffies.h │ │ │ ├── kernel.h │ │ │ ├── list.h │ │ │ ├── log2.h │ │ │ ├── mm.h │ │ │ ├── module.h │ │ │ ├── mutex.h │ │ │ ├── poll.h │ │ │ ├── sched.h │ │ │ ├── slab.h │ │ │ ├── spinlock.h │ │ │ ├── stddef.h │ │ │ ├── timer.h │ │ │ ├── types.h │ │ │ ├── uaccess.h │ │ │ ├── wait.h │ │ │ └── workqueue.h │ │ └── oslec.h │ ├── macros.h │ ├── mpi.h │ ├── mutex.h │ ├── pcm.h │ ├── phone.h │ ├── phone_mgr.h │ ├── timer.h │ ├── utils.h │ └── wait_queue.h │ ├── main.c │ ├── main.h │ ├── main_dahdi.c │ ├── main_driver.c │ ├── make_nohw.sh │ ├── mpi │ └── mpi.c │ ├── pcm │ └── pcm.c │ ├── phone │ ├── phone.c │ ├── phone_mgr.c │ └── zarlink │ │ ├── le88221 │ │ ├── slic_le88221.c │ │ └── slic_le88221.h │ │ ├── le88266 │ │ ├── slic_le88266.c │ │ └── slic_le88266.h │ │ ├── profiles │ │ ├── VE880_ABS100V_LITE_NB_PCM_Rev2_8.c │ │ ├── VE880_ABS100V_LITE_NB_PCM_Rev2_8.h │ │ ├── VE880_ABS100V_LITE_NB_PCM_Rev2_8.vpw │ │ ├── VE880_ABS100V_LITE_WB_PCM_Rev2_8.c │ │ ├── VE880_ABS100V_LITE_WB_PCM_Rev2_8.h │ │ ├── VE880_ABS100V_LITE_WB_PCM_Rev2_8.vpw │ │ ├── profiles_common.c │ │ ├── profiles_common.h │ │ ├── profiles_common.vpw │ │ └── readme.txt │ │ ├── zarlink_common.c │ │ └── zarlink_common.h │ ├── timer │ └── timer.c │ └── wait_queue │ └── wait_queue.c └── documents ├── V.23-1988.pdf ├── en_30065901v010301p_on_hook_data_transmission.pdf ├── en_30065902v010301o_off_hook_data_transmission.pdf ├── en_30065903v010301o_data_codings.pdf ├── es_20123501v010101m_dtmf_general.pdf ├── es_20123502v010101p_dtmf_transmitter.pdf ├── es_20123503v010301m_dtmf_receiver.pdf └── es_20123504v010201m_dtmf_transmitter_and_receiver.pdf /bcm63xx-ast-chan/asterisk-1.8-chan-bcm63xx-phone/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | include $(INCLUDE_DIR)/kernel.mk 11 | 12 | PKG_NAME:=asterisk18-chan-bcm63xx-phone 13 | PKG_RELEASE:=$(LINUX_VERSION) 14 | 15 | PKG_BUILD_DIR := $(BUILD_DIR)/asterisk-1.8-chan-bcm63xx-phone 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | 19 | define Package/asterisk18-chan-bcm63xx-phone 20 | SECTION:=net 21 | CATEGORY:=Network 22 | SUBMENU:=Telephony 23 | DEPENDS:=asterisk18 +asterisk18-codec-alaw +asterisk18-codec-a-mu \ 24 | +asterisk18-format-sln +asterisk18-format-sln16 \ 25 | +asterisk18-res-musiconhold +kmod-bcm63xx-phone 26 | TITLE:=bcm63xx-phone channel 27 | VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) 28 | URL:=http://www.kernel.org 29 | endef 30 | 31 | define Package/asterisk18-chan-bcm63xx-phone/description 32 | Asterisk 1.8 channel using bcm63xx-phone kernel module 33 | endef 34 | 35 | define Build/Prepare 36 | mkdir -p $(PKG_BUILD_DIR)/src 37 | $(CP) ../src/* $(PKG_BUILD_DIR)/src/ 38 | mkdir -p $(PKG_BUILD_DIR)/configs 39 | $(CP) ../configs/* $(PKG_BUILD_DIR)/configs/ 40 | mkdir -p $(PKG_BUILD_DIR)/obj 41 | endef 42 | 43 | TARGET_CFLAGS += $(TARGET_CFLAGS) -DBCMPH_EXPORT_DEV_FILE \ 44 | -DBCMPH_MODULE_NAME=chan_bcm63xx_phone -DBCMPH_DEBUG \ 45 | -DAST_VERSION=18 -DLOW_MEMORY -D_FORTIFY_SOURCE=2 \ 46 | -I$(KERNEL_BUILD_DIR)/bcm63xx-phone/inc \ 47 | -I$(STAGING_DIR)/usr/include/asterisk-1.8/include \ 48 | -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ 49 | -fPIC -pthread 50 | 51 | define Build/Compile 52 | rm -f $(PKG_BUILD_DIR)/obj/* $(PKG_BUILD_DIR)/*.so 53 | $(TARGET_CC) $(TARGET_CFLAGS) \ 54 | -c $(PKG_BUILD_DIR)/src/chan_bcm63xx_phone.c \ 55 | -o $(PKG_BUILD_DIR)/obj/chan_bcm63xx_phone.o 56 | $(TARGET_CC) $(TARGET_LDFLAGS) -shared -fPIC -pthread \ 57 | $(PKG_BUILD_DIR)/obj/chan_bcm63xx_phone.o \ 58 | -o $(PKG_BUILD_DIR)/chan_bcm63xx_phone.so 59 | endef 60 | 61 | define Package/asterisk18-chan-bcm63xx-phone/install 62 | $(INSTALL_DIR) $(1)/etc/asterisk 63 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/configs/bcm63xx_phone.conf.sample $(1)/etc/asterisk/ 64 | $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules 65 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_bcm63xx_phone.so $(1)/usr/lib/asterisk/modules/ 66 | endef 67 | 68 | $(eval $(call BuildPackage,asterisk18-chan-bcm63xx-phone)) 69 | -------------------------------------------------------------------------------- /bcm63xx-ast-chan/asterisk-11-chan-bcm63xx-phone/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | include $(INCLUDE_DIR)/kernel.mk 11 | 12 | PKG_NAME:=asterisk11-chan-bcm63xx-phone 13 | PKG_RELEASE:=$(LINUX_VERSION) 14 | 15 | PKG_BUILD_DIR := $(BUILD_DIR)/asterisk-11-chan-bcm63xx-phone 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | 19 | define Package/asterisk11-chan-bcm63xx-phone 20 | SECTION:=net 21 | CATEGORY:=Network 22 | SUBMENU:=Telephony 23 | DEPENDS:=asterisk11 +asterisk11-codec-alaw +asterisk11-codec-a-mu \ 24 | +asterisk11-format-sln +asterisk11-res-musiconhold +kmod-bcm63xx-phone 25 | TITLE:=bcm63xx-phone channel 26 | VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) 27 | URL:=http://www.kernel.org 28 | endef 29 | 30 | define Package/asterisk11-chan-bcm63xx-phone/description 31 | Asterisk 11 channel using bcm63xx-phone kernel module 32 | endef 33 | 34 | define Build/Prepare 35 | mkdir -p $(PKG_BUILD_DIR)/src 36 | $(CP) ../src/* $(PKG_BUILD_DIR)/src/ 37 | mkdir -p $(PKG_BUILD_DIR)/configs 38 | $(CP) ../configs/* $(PKG_BUILD_DIR)/configs/ 39 | mkdir -p $(PKG_BUILD_DIR)/obj 40 | endef 41 | 42 | define Build/Configure 43 | endef 44 | 45 | TARGET_CFLAGS += $(TARGET_CFLAGS) -DBCMPH_EXPORT_DEV_FILE \ 46 | -DBCMPH_MODULE_NAME=chan_bcm63xx_phone -DBCMPH_DEBUG \ 47 | -DAST_VERSION=110 -DLOW_MEMORY -D_FORTIFY_SOURCE=2 \ 48 | -I$(KERNEL_BUILD_DIR)/bcm63xx-phone/inc \ 49 | -I$(STAGING_DIR)/usr/include/asterisk-11/include \ 50 | -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ 51 | -fPIC -pthread 52 | 53 | define Build/Compile 54 | rm -f $(PKG_BUILD_DIR)/obj/* $(PKG_BUILD_DIR)/*.so 55 | $(TARGET_CC) $(TARGET_CFLAGS) \ 56 | -c $(PKG_BUILD_DIR)/src/chan_bcm63xx_phone.c \ 57 | -o $(PKG_BUILD_DIR)/obj/chan_bcm63xx_phone.o 58 | $(TARGET_CC) $(TARGET_LDFLAGS) -shared -fPIC -pthread \ 59 | $(PKG_BUILD_DIR)/obj/chan_bcm63xx_phone.o \ 60 | -o $(PKG_BUILD_DIR)/chan_bcm63xx_phone.so 61 | endef 62 | 63 | define Package/asterisk11-chan-bcm63xx-phone/install 64 | $(INSTALL_DIR) $(1)/etc/asterisk 65 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/configs/bcm63xx_phone.conf.sample $(1)/etc/asterisk/ 66 | $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules 67 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_bcm63xx_phone.so $(1)/usr/lib/asterisk/modules/ 68 | endef 69 | 70 | $(eval $(call BuildPackage,asterisk11-chan-bcm63xx-phone)) 71 | -------------------------------------------------------------------------------- /bcm63xx-ast-chan/asterisk-13-chan-bcm63xx-phone/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | include $(INCLUDE_DIR)/kernel.mk 11 | 12 | PKG_NAME:=asterisk13-chan-bcm63xx-phone 13 | PKG_RELEASE:=$(LINUX_VERSION) 14 | 15 | PKG_BUILD_DIR := $(BUILD_DIR)/asterisk-13-chan-bcm63xx-phone 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | 19 | define Package/asterisk13-chan-bcm63xx-phone 20 | SECTION:=net 21 | CATEGORY:=Network 22 | SUBMENU:=Telephony 23 | DEPENDS:=asterisk13 +asterisk13-codec-alaw +asterisk13-codec-a-mu \ 24 | +asterisk13-format-sln +asterisk13-res-musiconhold +kmod-bcm63xx-phone 25 | TITLE:=bcm63xx-phone channel 26 | VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) 27 | URL:=http://www.kernel.org 28 | endef 29 | 30 | define Package/asterisk13-chan-bcm63xx-phone/description 31 | Asterisk 13 channel using bcm63xx-phone kernel module 32 | endef 33 | 34 | define Build/Prepare 35 | mkdir -p $(PKG_BUILD_DIR)/src 36 | $(CP) ../src/* $(PKG_BUILD_DIR)/src/ 37 | mkdir -p $(PKG_BUILD_DIR)/configs 38 | $(CP) ../configs/* $(PKG_BUILD_DIR)/configs/ 39 | mkdir -p $(PKG_BUILD_DIR)/obj 40 | endef 41 | 42 | define Build/Configure 43 | endef 44 | 45 | TARGET_CFLAGS += $(TARGET_CFLAGS) -DBCMPH_EXPORT_DEV_FILE \ 46 | -DBCMPH_MODULE_NAME=chan_bcm63xx_phone -DBCMPH_DEBUG \ 47 | -DAST_VERSION=130 -DLOW_MEMORY -D_FORTIFY_SOURCE=2 \ 48 | -I$(KERNEL_BUILD_DIR)/bcm63xx-phone/inc \ 49 | -I$(STAGING_DIR)/usr/include/asterisk-13/include \ 50 | -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ 51 | -fPIC -pthread 52 | 53 | define Build/Compile 54 | rm -f $(PKG_BUILD_DIR)/obj/* $(PKG_BUILD_DIR)/*.so 55 | $(TARGET_CC) $(TARGET_CFLAGS) \ 56 | -c $(PKG_BUILD_DIR)/src/chan_bcm63xx_phone.c \ 57 | -o $(PKG_BUILD_DIR)/obj/chan_bcm63xx_phone.o 58 | $(TARGET_CC) $(TARGET_LDFLAGS) -shared -fPIC -pthread \ 59 | $(PKG_BUILD_DIR)/obj/chan_bcm63xx_phone.o \ 60 | -o $(PKG_BUILD_DIR)/chan_bcm63xx_phone.so 61 | endef 62 | 63 | define Package/asterisk13-chan-bcm63xx-phone/install 64 | $(INSTALL_DIR) $(1)/etc/asterisk 65 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/configs/bcm63xx_phone.conf.sample $(1)/etc/asterisk/ 66 | $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules 67 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_bcm63xx_phone.so $(1)/usr/lib/asterisk/modules/ 68 | endef 69 | 70 | $(eval $(call BuildPackage,asterisk13-chan-bcm63xx-phone)) 71 | -------------------------------------------------------------------------------- /bcm63xx-ast-chan/src/callerid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __CALLERID_H__ 10 | #define __CALLERID_H__ 11 | 12 | #include "tone_generation.h" 13 | 14 | typedef enum { 15 | BCMPH_NO_CID, /* Do not use CallerID */ 16 | BCMPH_CID_SIG_BELL, /* Use FSK modulation Telcordia GR-30 */ 17 | BCMPH_CID_SIG_V23, /* Use FSK modulation V23 */ 18 | BCMPH_CID_SIG_DTMF, /* Use DTMF */ 19 | } bcmph_cid_signalling_t; 20 | 21 | typedef enum { 22 | BCMPH_CID_START_RING, /* CID information sent after first ring */ 23 | BCMPH_CID_START_RING_PULSE, /* CID information sent after short ring */ 24 | BCMPH_CID_START_POLARITY, /* CID information sent before first ring. Start is signalled by polarity reversal */ 25 | BCMPH_CID_START_DTMF, /* CID information sent before first ring. Start is signalled by special DTMF */ 26 | BCMPH_CID_START_POLARITY_DTMF, /* CID information sent before first ring. Start is signalled by polarity reversal followed by special DTMF */ 27 | } bcmph_cid_start_t; 28 | 29 | enum { 30 | BCMPH_CID_UNKNOWN_NUMBER = 0x01, 31 | BCMPH_CID_PRIVATE_NUMBER = 0x02, 32 | BCMPH_CID_UNKNOWN_NAME = 0x04, 33 | BCMPH_CID_PRIVATE_NAME = 0x08, 34 | }; 35 | 36 | extern size_t bcmph_callerid_generate(const char *name, const char *number, 37 | bcmph_cid_signalling_t cid_signalling, bcmph_cid_start_t cid_start, 38 | int flags, __s16 *buffer, size_t buffer_len); 39 | 40 | typedef struct { 41 | int sample_rate; 42 | div_t current; 43 | div_t inc[2]; 44 | bcmph_fraction_seq_t counter; 45 | __s16 vol; 46 | } bcmph_fsk_modulator_t; 47 | 48 | typedef struct bcmph_callerid_generator { 49 | bcmph_sound_generator_t sound_generator; 50 | __u8 msg[64]; 51 | size_t msg_len; 52 | bool generate_dtmf; 53 | size_t silence_in_samples_before_dtas; 54 | size_t samples_dtas; 55 | size_t silence_in_samples_before_data; 56 | size_t silence_in_samples_after_data; 57 | bcmph_dual_tone_generator_t dual_tone_generator; 58 | union { 59 | struct { 60 | bcmph_fsk_modulator_t modulator; 61 | size_t seizure_bytes; 62 | size_t mark_bits_before; 63 | size_t mark_bits_after; 64 | } fsk; 65 | struct { 66 | size_t samples_remaining; 67 | } dtmf; 68 | } u; 69 | size_t (*write)(struct bcmph_callerid_generator *t, __s16 *buffer, size_t buffer_len); 70 | size_t pos; 71 | } bcmph_callerid_generator_t; 72 | 73 | extern void bcmph_callerid_generator_init(bcmph_callerid_generator_t *t, 74 | const char *name, const char *number, 75 | bcmph_cid_signalling_t cid_signalling, bcmph_cid_start_t cid_start, 76 | int flags); 77 | 78 | #endif /* __CALLERID_H__ */ 79 | -------------------------------------------------------------------------------- /bcm63xx-ast-chan/src/logger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __LOGGER_H__ 10 | #define __LOGGER_H__ 11 | 12 | #include 13 | 14 | #ifdef AST_VERSION 15 | 16 | #include 17 | #include 18 | 19 | #undef bcm_assert 20 | #undef bcm_pr_debug 21 | #undef bcm_pr_warn 22 | #ifdef BCMPH_DEBUG 23 | #define bcm_assert(cond) if (!(cond)) { ast_log(AST_LOG_DEBUG, "condition '%s' is false\n", #cond); } 24 | #define bcm_pr_debug(fmt, args...) ast_log(AST_LOG_DEBUG, fmt, ## args) 25 | #define bcm_pr_warn(fmt, args...) ast_log(AST_LOG_WARNING, fmt, ## args) 26 | #else /* !BCMPH_DEBUG */ 27 | #define bcm_assert(cond) 28 | #define bcm_pr_debug(fmt, args...) 29 | #define bcm_pr_warn(fmt, args...) 30 | #endif /* !BCMPH_DEBUG */ 31 | 32 | #endif /* AST_VERSION */ 33 | 34 | #endif /* __LOGGER_H__ */ 35 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | include $(INCLUDE_DIR)/kernel.mk 11 | 12 | PKG_NAME:=bcm63xx-phone-test 13 | PKG_RELEASE:=$(LINUX_VERSION) 14 | PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) 15 | 16 | include $(INCLUDE_DIR)/package.mk 17 | 18 | define Package/bcm63xx-phone-test 19 | SECTION:=utils 20 | CATEGORY:=Utilities 21 | DEPENDS:=+kmod-bcm63xx-phone 22 | TITLE:=Testing utility for driver bcm63xx-phone 23 | VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) 24 | URL:=http://www.kernel.org 25 | endef 26 | 27 | define Package/bcm63xx-phone-test/description 28 | Testing utility for driver bcm63xx-phone. 29 | endef 30 | 31 | define Build/Prepare 32 | mkdir -p $(PKG_BUILD_DIR) 33 | $(CP) ./src/* $(PKG_BUILD_DIR)/ 34 | endef 35 | 36 | define Build/Configure 37 | endef 38 | 39 | define Build/Compile 40 | cd $(PKG_BUILD_DIR) && rm -f *.o *.a 41 | cd $(PKG_BUILD_DIR) && $(TARGET_CC) -I$(KERNEL_BUILD_DIR)/bcm63xx-phone/inc \ 42 | $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/bcm63xx-phone-test main.c 43 | endef 44 | 45 | define Package/bcm63xx-phone-test/install 46 | $(INSTALL_DIR) $(1)/bin 47 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/bcm63xx-phone-test $(1)/bin/ 48 | endef 49 | 50 | $(eval $(call BuildPackage,bcm63xx-phone-test)) 51 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/fake_kernel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #include 17 | 18 | void fake_kernel_init(void) 19 | { 20 | bcm_pr_debug("%s()\n", __func__); 21 | 22 | jiffies_init(); 23 | timer_init(); 24 | workqueue_init(); 25 | } 26 | 27 | void fake_kernel_deinit(void) 28 | { 29 | bcm_pr_debug("%s()\n", __func__); 30 | 31 | workqueue_deinit(); 32 | timer_deinit(); 33 | jiffies_deinit(); 34 | } 35 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/barrier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_BARRIER_H__ 10 | #define __FK_LINUX_BARRIER_H__ 11 | 12 | #include 13 | 14 | #define barrier() __sync_synchronize() 15 | 16 | #ifndef mb 17 | #define mb() barrier() 18 | #endif 19 | 20 | #ifndef rmb 21 | #define rmb() mb() 22 | #endif 23 | 24 | #ifndef wmb 25 | #define wmb() mb() 26 | #endif 27 | 28 | #ifndef dma_rmb 29 | #define dma_rmb() rmb() 30 | #endif 31 | 32 | #ifndef dma_wmb 33 | #define dma_wmb() wmb() 34 | #endif 35 | 36 | #ifndef read_barrier_depends 37 | #define read_barrier_depends() do { } while (0) 38 | #endif 39 | 40 | #endif // __FK_LINUX_BARRIER_H__ 41 | 42 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/bitops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_BITOPS_H__ 10 | #define __FK_LINUX_BITOPS_H__ 11 | 12 | #include 13 | 14 | static inline int test_and_clear_bit(int bit, unsigned long *addr) 15 | { 16 | return (__sync_fetch_and_and(addr, (~(1UL << bit)))); 17 | } 18 | 19 | static inline int test_and_set_bit(int bit, unsigned long *addr) 20 | { 21 | return (__sync_fetch_and_or(addr, 1UL << bit)); 22 | } 23 | 24 | static inline void clear_bit(int bit, unsigned long *addr) 25 | { 26 | test_and_clear_bit(bit, addr); 27 | } 28 | 29 | static inline void set_bit(int bit, unsigned long *addr) 30 | { 31 | test_and_set_bit(bit, addr); 32 | } 33 | 34 | static inline int test_bit(int bit, unsigned long *addr) 35 | { 36 | return ((*addr & (1UL << bit))); 37 | } 38 | 39 | static inline int fls(int x) 40 | { 41 | return ((x) ? sizeof(x) * 8 - __builtin_clz(x) : 0); 42 | } 43 | 44 | #endif // __FK_LINUX_BITOPS_H__ 45 | 46 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/clk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_CLK_H__ 10 | #define __FK_LINUX_CLK_H__ 11 | 12 | #include 13 | 14 | #endif // __FK_LINUX_CLK_H__ 15 | 16 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/delay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_DELAY_H__ 10 | #define __FK_LINUX_DELAY_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | static inline void msleep(unsigned long msecs) 17 | { 18 | usleep(msecs * 1000); 19 | } 20 | 21 | #endif // __FK_LINUX_DELAY_H__ 22 | 23 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/dma-mapping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_DMA_MAPPING_H__ 10 | #define __FK_LINUX_DMA_MAPPING_H__ 11 | 12 | #include 13 | 14 | typedef void * dma_addr_t; 15 | 16 | #endif // __FK_LINUX_DMA_MAPPING_H__ 17 | 18 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/errno.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_ERRNO_H__ 10 | #define __FK_LINUX_ERRNO_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | #define ERESTARTSYS ERESTART 17 | 18 | #endif // __FK_LINUX_ERRNO_H__ 19 | 20 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_FILE_H__ 10 | #define __FK_LINUX_FILE_H__ 11 | 12 | #include 13 | 14 | struct inode { 15 | int dummy; 16 | }; 17 | 18 | struct file { 19 | void *private_data; 20 | int f_flags; 21 | }; 22 | 23 | static inline int nonseekable_open(struct inode *n, struct file *f) 24 | { 25 | return (0); 26 | } 27 | 28 | #endif // __FK_LINUX_FILE_H__ 29 | 30 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/jiffies.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_JIFFIES_H__ 10 | #define __FK_LINUX_JIFFIES_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | extern void jiffies_init(void); 17 | 18 | extern void jiffies_deinit(void); 19 | 20 | #define MAX_JIFFY_OFFSET ((LONG_MAX >> 1) - 1) 21 | 22 | #define MS_PER_JIFFY 4 23 | 24 | #define msecs_to_jiffies(arg) ((arg + (MS_PER_JIFFY - 1)) / MS_PER_JIFFY) 25 | 26 | #define jiffies_to_msecs(arg) (arg * MS_PER_JIFFY) 27 | 28 | #define usecs_to_jiffies(arg) (((arg) + ((MS_PER_JIFFY * 1000) - 1)) / (MS_PER_JIFFY * 1000)) 29 | 30 | #define jiffies_to_usecs(arg) ((arg) * (MS_PER_JIFFY * 1000)) 31 | 32 | static inline int time_before(unsigned long v, unsigned long ref) 33 | { 34 | return (v < ref); 35 | } 36 | 37 | static inline int time_after(unsigned long v, unsigned long ref) 38 | { 39 | return (v > ref); 40 | } 41 | 42 | extern unsigned long get_jiffies(void); 43 | 44 | extern void jiffies_to_timespec(unsigned long jiffies, struct timespec *ts); 45 | 46 | #endif // __FK_LINUX_JIFFIES_H__ 47 | 48 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_KERNEL_H__ 10 | #define __FK_LINUX_KERNEL_H__ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | /* 18 | * min()/max()/clamp() macros that also do 19 | * strict type-checking.. See the 20 | * "unnecessary" pointer comparison. 21 | */ 22 | #define min(x, y) ({ \ 23 | typeof(x) _min1 = (x); \ 24 | typeof(y) _min2 = (y); \ 25 | (void) (&_min1 == &_min2); \ 26 | _min1 < _min2 ? _min1 : _min2; }) 27 | 28 | #define max(x, y) ({ \ 29 | typeof(x) _max1 = (x); \ 30 | typeof(y) _max2 = (y); \ 31 | (void) (&_max1 == &_max2); \ 32 | _max1 > _max2 ? _max1 : _max2; }) 33 | 34 | #define simple_strtol strtol 35 | 36 | #endif // __FK_LINUX_KERNEL_H__ 37 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_LIST_H__ 10 | #define __FK_LINUX_LIST_H__ 11 | 12 | #include 13 | 14 | struct list_head { 15 | struct list_head *next, *prev; 16 | }; 17 | 18 | static inline void INIT_LIST_HEAD(struct list_head *list) 19 | { 20 | list->next = list; 21 | list->prev = list; 22 | } 23 | 24 | static inline int list_empty(const struct list_head *head) 25 | { 26 | return head->next == head; 27 | } 28 | 29 | static inline void __list_add(struct list_head *new, struct list_head *prev, 30 | struct list_head *next) 31 | { 32 | next->prev = new; 33 | new->next = next; 34 | new->prev = prev; 35 | prev->next = new; 36 | } 37 | 38 | static inline void list_add(struct list_head *new, struct list_head *head) 39 | { 40 | __list_add(new, head, head->next); 41 | } 42 | 43 | static inline void list_add_tail(struct list_head *new, struct list_head *head) 44 | { 45 | __list_add(new, head->prev, head); 46 | } 47 | 48 | static inline void __list_del(struct list_head * prev, struct list_head * next) 49 | { 50 | next->prev = prev; 51 | prev->next = next; 52 | } 53 | 54 | static inline void __list_del_entry(struct list_head *entry) 55 | { 56 | __list_del(entry->prev, entry->next); 57 | } 58 | 59 | static inline void list_del_init(struct list_head *entry) 60 | { 61 | __list_del_entry(entry); 62 | INIT_LIST_HEAD(entry); 63 | } 64 | 65 | #define list_entry(ptr, type, member) \ 66 | container_of(ptr, type, member) 67 | 68 | #define list_first_entry(ptr, type, member) \ 69 | list_entry((ptr)->next, type, member) 70 | 71 | #define list_next_entry(pos, member) \ 72 | list_entry((pos)->member.next, typeof(*(pos)), member) 73 | 74 | #define list_for_each_entry(pos, head, member) \ 75 | for (pos = list_first_entry(head, typeof(*pos), member); \ 76 | &pos->member != (head); \ 77 | pos = list_next_entry(pos, member)) 78 | 79 | #define list_for_each_entry_safe(pos, n, head, member) \ 80 | for (pos = list_first_entry(head, typeof(*pos), member), \ 81 | n = list_next_entry(pos, member); \ 82 | &pos->member != (head); \ 83 | pos = n, n = list_next_entry(n, member)) 84 | 85 | #endif // __FK_LINUX_LIST_H__ 86 | 87 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/log2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_LOG2_H__ 10 | #define __FK_LINUX_LOG2_H__ 11 | 12 | #include 13 | 14 | static inline bool is_power_of_2(size_t val) 15 | { 16 | return ((~((val - 1) ^ (~(val - 1)))) == 0); 17 | } 18 | 19 | #endif // __FK_LINUX_LOG2_H__ 20 | 21 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/mm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_MM_H__ 10 | #define __FK_LINUX_MM_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | #define PAGE_SIZE 4096UL 17 | 18 | #define __get_free_pages(flags, mm_order) ((unsigned long)(kmalloc(PAGE_SIZE << mm_order, GFP_KERNEL))) 19 | 20 | #define free_pages(ptr, mm_order) kfree((void *)(ptr)) 21 | 22 | static inline int get_order(size_t len) 23 | { 24 | int ret = 0; 25 | while ((PAGE_SIZE << ret) < len) { 26 | ret += 1; 27 | } 28 | return (ret); 29 | } 30 | 31 | #endif // __FK_LINUX_MM_H__ 32 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_MODULE_H__ 10 | #define __FK_LINUX_MODULE_H__ 11 | 12 | #include 13 | 14 | #define KBUILD_MODNAME "acme" 15 | 16 | #endif // __FK_LINUX_MODULE_H__ 17 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_MUTEX_H__ 10 | #define __FK_LINUX_MUTEX_H__ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | struct mutex { 20 | pthread_mutex_t obj; 21 | struct { 22 | pthread_mutexattr_t attr; 23 | } priv; 24 | }; 25 | 26 | extern void mutex_init(struct mutex *t); 27 | 28 | static inline void mutex_destroy(struct mutex *t) 29 | { 30 | int ret = pthread_mutex_destroy(&(t->obj)); 31 | if (ret) { 32 | bcm_pr_warn("**** pthread_mutex_destroy() failed with error code %d : '%s' ****\n", 33 | (int)(ret), strerror(ret)); 34 | } 35 | ret = pthread_mutexattr_destroy(&(t->priv.attr)); 36 | if (ret) { 37 | bcm_pr_warn("**** pthread_mutexattr_destroy() failed with error code %d : '%s' ****\n", 38 | (int)(ret), strerror(ret)); 39 | } 40 | } 41 | 42 | static inline int mutex_trylock(struct mutex *t) 43 | { 44 | if (pthread_mutex_trylock(&(t->obj))) { 45 | return (0); 46 | } 47 | else { 48 | return (1); 49 | } 50 | } 51 | 52 | static inline int mutex_lock_interruptible(struct mutex *t) 53 | { 54 | int ret = pthread_mutex_lock(&(t->obj)); 55 | if (ret) { 56 | bcm_pr_err("**** pthread_mutex_lock() failed with error code %d : '%s' ****\n", 57 | (int)(ret), strerror(ret)); 58 | } 59 | return (ret); 60 | } 61 | 62 | static inline void mutex_unlock(struct mutex *t) 63 | { 64 | int ret = pthread_mutex_unlock(&(t->obj)); 65 | if (ret) { 66 | bcm_pr_warn("**** pthread_mutex_lock() failed with error code %d : '%s' ****\n", 67 | (int)(ret), strerror(ret)); 68 | } 69 | } 70 | 71 | #endif // __FK_LINUX_MUTEX_H__ 72 | 73 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/poll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_POLL_H__ 10 | #define __FK_LINUX_POLL_H__ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #endif // __FK_LINUX_POLL_H__ 18 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_SCHED_H__ 10 | #define __FK_LINUX_SCHED_H__ 11 | 12 | #include 13 | 14 | #endif // __FK_LINUX_SCHED_H__ 15 | 16 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/slab.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_SLAB_H__ 10 | #define __FK_LINUX_SLAB_H__ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | #define __GFP_COMP 0 20 | #define __GFP_NORETRY 0 21 | #define __GFP_ZERO 0x0001u 22 | 23 | #define GFP_DMA 0 24 | #define GFP_KERNEL 0 25 | 26 | static inline void *kmalloc(size_t size, unsigned int flags) 27 | { 28 | void *ret = malloc(size); 29 | if ((NULL != ret) && ((flags & __GFP_ZERO))) { 30 | memset(ret, 0, size); 31 | } 32 | return (ret); 33 | } 34 | 35 | static inline void *kzalloc(size_t size, unsigned int flags) 36 | { 37 | return kmalloc(size, flags | __GFP_ZERO); 38 | } 39 | 40 | static inline void *kcalloc(size_t n, size_t size, unsigned int flags) 41 | { 42 | return (kmalloc(n * size, flags)); 43 | } 44 | 45 | static inline void kfree(void *ptr) 46 | { 47 | bcm_assert(NULL != ptr); 48 | free(ptr); 49 | } 50 | 51 | #endif // __FK_LINUX_SLAB_H__ 52 | 53 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/spinlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_SPINLOCK_H__ 10 | #define __FK_LINUX_SPINLOCK_H__ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | typedef struct { 25 | struct { 26 | atomic_t locked; 27 | pthread_t thread_id; 28 | } priv; 29 | } spinlock_t; 30 | 31 | static inline void spin_lock_init(spinlock_t *t) 32 | { 33 | memset(t, 0, sizeof(*t)); 34 | atomic_set(&(t->priv.locked), 0); 35 | } 36 | 37 | static inline void spin_lock(spinlock_t *t) 38 | { 39 | bcm_assert((!pthread_equal(pthread_self(), t->priv.thread_id)) 40 | || (0 == atomic_read(&(t->priv.locked)))); 41 | 42 | while (!atomic_cas(&(t->priv.locked), 0, 1)) { 43 | sched_yield(); 44 | } 45 | t->priv.thread_id = pthread_self(); 46 | barrier(); 47 | } 48 | 49 | static inline void spin_unlock(spinlock_t *t) 50 | { 51 | if (pthread_equal(pthread_self(), t->priv.thread_id)) { 52 | atomic_cas(&(t->priv.locked), 1, 0); 53 | barrier(); 54 | } 55 | else { 56 | bcm_assert(false); 57 | } 58 | } 59 | 60 | static inline int spin_is_locked(spinlock_t *t) 61 | { 62 | return (atomic_read(&(t->priv.locked))); 63 | } 64 | 65 | static inline void spin_lock_bh(spinlock_t *t) 66 | { 67 | spin_lock(t); 68 | } 69 | 70 | static inline void spin_unlock_bh(spinlock_t *t) 71 | { 72 | spin_unlock(t); 73 | } 74 | 75 | static inline void spin_lock_irqsave(spinlock_t *t, unsigned long flags) 76 | { 77 | spin_lock(t); 78 | } 79 | 80 | static inline void spin_unlock_irqrestore(spinlock_t *t, unsigned long flags) 81 | { 82 | spin_unlock(t); 83 | } 84 | 85 | #endif // __FK_LINUX_SPINLOCK_H__ 86 | 87 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/stddef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_STDDEF_H__ 10 | #define __FK_LINUX_STDDEF_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | #define ARRAY_SIZE(tab) (sizeof(tab) / sizeof(tab[0])) 17 | 18 | #define container_of(ptr, type, member) ({ \ 19 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 20 | (type *)( (char *)__mptr - offsetof(type,member) );}) 21 | 22 | #endif // __FK_LINUX_STDDEF_H__ 23 | 24 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_TIMER_H__ 10 | #define __FK_LINUX_TIMER_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | struct timer_queue; 20 | 21 | struct timer_list { 22 | void (*function)(unsigned long); 23 | unsigned long data; 24 | unsigned long expires; 25 | struct { 26 | struct work_struct work; 27 | } priv; 28 | }; 29 | 30 | extern void init_timer(struct timer_list *t); 31 | 32 | extern void add_timer(struct timer_list *t); 33 | 34 | extern int del_timer_sync(struct timer_list *t); 35 | 36 | extern void timer_init(void); 37 | 38 | extern void timer_deinit(void); 39 | 40 | #endif // __FK_LINUX_TIMER_H__ 41 | 42 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/uaccess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_UACCESS_H__ 10 | #define __FK_LINUX_UACCESS_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | static inline int copy_from_user(void *dest, void *src, size_t s) 17 | { 18 | memcpy(dest, src, s); 19 | return (0); 20 | } 21 | 22 | static inline int copy_to_user(void *dest, void *src, size_t s) 23 | { 24 | memcpy(dest, src, s); 25 | return (0); 26 | } 27 | 28 | #define VERIFY_READ 0 29 | #define VERIFY_WRITE 1 30 | 31 | static inline int access_ok(int type, const void *addr, unsigned long size) 32 | { 33 | return (1); 34 | } 35 | 36 | #endif // __FK_LINUX_UACCESS_H__ 37 | 38 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/linux/workqueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FK_LINUX_WORKQUEUE_H__ 10 | #define __FK_LINUX_WORKQUEUE_H__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | #include 17 | 18 | extern void workqueue_init(void); 19 | 20 | extern void workqueue_deinit(void); 21 | 22 | struct work_struct { 23 | struct { 24 | void (*cb)(struct work_struct *work); 25 | struct list_head list; 26 | int state; 27 | long owner; 28 | pthread_t thread_id; 29 | } priv; 30 | }; 31 | 32 | extern void INIT_WORK(struct work_struct *t, void (*cb)(struct work_struct *work)); 33 | 34 | #define WQ_UNBOUND 0x01 35 | #define WQ_FREEZABLE 0x02 36 | #define WQ_HIGHPRI 0 37 | 38 | struct workqueue_struct; 39 | 40 | extern struct workqueue_struct *alloc_workqueue(const char *fmt, unsigned int flags, int max_active); 41 | 42 | extern void flush_workqueue(struct workqueue_struct *t); 43 | 44 | extern void destroy_workqueue(struct workqueue_struct *t); 45 | 46 | extern bool queue_work(struct workqueue_struct *t, struct work_struct *work); 47 | 48 | extern bool cancel_work_sync(struct work_struct *t); 49 | 50 | #endif // __FK_LINUX_WORKQUEUE_H__ 51 | 52 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/extern/oslec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OSLEC - A line echo canceller. This code is being developed 3 | * against and partially complies with G168. Using code from SpanDSP 4 | * 5 | * Written by Steve Underwood 6 | * and David Rowe 7 | * 8 | * Copyright (C) 2001 Steve Underwood and 2007-2008 David Rowe 9 | * 10 | * All rights reserved. 11 | * 12 | * This program is free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License version 2, as 14 | * published by the Free Software Foundation. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 | * 25 | */ 26 | 27 | #ifndef __OSLEC_H 28 | #define __OSLEC_H 29 | 30 | #include 31 | 32 | /* Mask bits for the adaption mode */ 33 | #define ECHO_CAN_USE_ADAPTION 0x01 34 | #define ECHO_CAN_USE_NLP 0x02 35 | #define ECHO_CAN_USE_CNG 0x04 36 | #define ECHO_CAN_USE_CLIP 0x08 37 | #define ECHO_CAN_USE_TX_HPF 0x10 38 | #define ECHO_CAN_USE_RX_HPF 0x20 39 | #define ECHO_CAN_DISABLE 0x40 40 | 41 | /** 42 | * oslec_state: G.168 echo canceller descriptor. 43 | * 44 | * This defines the working state for a line echo canceller. 45 | */ 46 | struct oslec_state; 47 | 48 | /** 49 | * oslec_create - Create a voice echo canceller context. 50 | * @len: The length of the canceller, in samples. 51 | * @return: The new canceller context, or NULL if the canceller could not be 52 | * created. 53 | */ 54 | struct oslec_state *oslec_create(int len, int adaption_mode); 55 | 56 | /** 57 | * oslec_free - Free a voice echo canceller context. 58 | * @ec: The echo canceller context. 59 | */ 60 | void oslec_free(struct oslec_state *ec); 61 | 62 | /** 63 | * oslec_flush - Flush (reinitialise) a voice echo canceller context. 64 | * @ec: The echo canceller context. 65 | */ 66 | void oslec_flush(struct oslec_state *ec); 67 | 68 | /** 69 | * oslec_adaption_mode - set the adaption mode of a voice echo canceller context. 70 | * @ec The echo canceller context. 71 | * @adaption_mode: The mode. 72 | */ 73 | void oslec_adaption_mode(struct oslec_state *ec, int adaption_mode); 74 | 75 | void oslec_snapshot(struct oslec_state *ec); 76 | 77 | /** 78 | * oslec_update: Process a sample through a voice echo canceller. 79 | * @ec: The echo canceller context. 80 | * @tx: The transmitted audio sample. 81 | * @rx: The received audio sample. 82 | * 83 | * The return value is the clean (echo cancelled) received sample. 84 | */ 85 | int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx); 86 | 87 | /** 88 | * oslec_hpf_tx: Process to high pass filter the tx signal. 89 | * @ec: The echo canceller context. 90 | * @tx: The transmitted auio sample. 91 | * 92 | * The return value is the HP filtered transmit sample, send this to your D/A. 93 | */ 94 | int16_t oslec_hpf_tx(struct oslec_state *ec, int16_t tx); 95 | 96 | #endif /* __OSLEC_H */ 97 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/fake_kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FAKE_KERNEL_H__ 10 | #define __FAKE_KERNEL_H__ 11 | 12 | #include 13 | 14 | extern void fake_kernel_init(void); 15 | 16 | extern void fake_kernel_deinit(void); 17 | 18 | #endif // __FAKE_KERNEL_H__ 19 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/inc/fake_kernel_compile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __FAKE_KERNEL_COMPILE_H__ 10 | #define __FAKE_KERNEL_COMPILE_H__ 11 | 12 | #ifdef __KERNEL__ 13 | # error "Can't include this file if __KERNEL__ is defined" 14 | #endif /* !__KERNEL__ */ 15 | 16 | #pragma GCC diagnostic ignored "-Wunused-parameter" 17 | #pragma GCC diagnostic ignored "-Wswitch-enum" 18 | 19 | #include 20 | 21 | #define __init 22 | #define __exit 23 | #define __iomem 24 | 25 | #define likely(cond) cond 26 | #define unlikely(cond) cond 27 | 28 | /* 29 | struct bcm63xx_spi_trx_opts { 30 | __u8 fill_byte; 31 | bool wait_completion_with_irq; 32 | bool drop_cs_after_each_byte; 33 | __u8 cs_off_clk_cycles; 34 | }; 35 | 36 | */ 37 | 38 | #endif /* __FAKE_KERNEL_COMPILE_H__ */ 39 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/jiffies.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | static struct { 19 | struct timespec ts0; 20 | } jiffies_state; 21 | 22 | unsigned long get_jiffies(void) 23 | { 24 | int ret; 25 | unsigned long ms; 26 | struct timespec ts; 27 | 28 | ret = clock_gettime(CLOCK_MONOTONIC, &(ts)); 29 | if (ret) { 30 | bcm_pr_warn("**** clock_gettime() failed with error code %d : '%s' ****\n", 31 | (int)(ret), strerror(ret)); 32 | } 33 | if (ts.tv_nsec < jiffies_state.ts0.tv_nsec) { 34 | ts.tv_sec -= 1; 35 | ts.tv_nsec += 1000000000; 36 | } 37 | ts.tv_sec -= jiffies_state.ts0.tv_sec; 38 | ts.tv_nsec -= jiffies_state.ts0.tv_nsec; 39 | ms = (ts.tv_sec * 1000) + ((ts.tv_nsec + 500000) / 1000000); 40 | return (msecs_to_jiffies(ms)); 41 | } 42 | 43 | void jiffies_to_timespec(unsigned long jiffies, struct timespec *ts) 44 | { 45 | unsigned long ms = jiffies_to_msecs(jiffies); 46 | ts->tv_sec = ms / 1000; 47 | ts->tv_nsec = (ms % 1000) * 1000000; 48 | ts->tv_sec += jiffies_state.ts0.tv_sec; 49 | ts->tv_nsec += jiffies_state.ts0.tv_nsec; 50 | if (ts->tv_nsec >= 1000000000) { 51 | ts->tv_nsec -= 1000000000; 52 | ts->tv_sec += 1; 53 | } 54 | } 55 | 56 | void jiffies_init(void) 57 | { 58 | bcm_pr_debug("%s()\n", __func__); 59 | 60 | int ret = clock_gettime(CLOCK_MONOTONIC, &(jiffies_state.ts0)); 61 | if (ret) { 62 | bcm_pr_err("**** timer_create() failed with error code %d : '%s' ****\n", 63 | (int)(ret), strerror(ret)); 64 | exit(ret); 65 | } 66 | } 67 | 68 | void jiffies_deinit(void) 69 | { 70 | bcm_pr_debug("%s()\n", __func__); 71 | } 72 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/mutex.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | void mutex_init(struct mutex *t) 19 | { 20 | int ret; 21 | 22 | bcm_pr_debug("%s()\n", __func__); 23 | 24 | ret = pthread_mutexattr_init(&(t->priv.attr)); 25 | if (ret) { 26 | bcm_pr_err("**** pthread_mutexattr_init() failed with error code %d : '%s' ****\n", 27 | (int)(ret), strerror(ret)); 28 | exit(ret); 29 | } 30 | ret = pthread_mutexattr_settype(&(t->priv.attr), PTHREAD_MUTEX_ERRORCHECK); 31 | if (ret) { 32 | bcm_pr_err("**** pthread_mutexattr_settype() failed with error code %d : '%s' ****\n", 33 | (int)(ret), strerror(ret)); 34 | exit(ret); 35 | } 36 | ret = pthread_mutex_init(&(t->obj), &(t->priv.attr)); 37 | if (ret) { 38 | bcm_pr_err("**** pthread_mutexattr_init() failed with error code %d : '%s' ****\n", 39 | (int)(ret), strerror(ret)); 40 | exit(ret); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /bcm63xx-phone-test/fake_kernel/wait.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | void init_waitqueue_head(wait_queue_head_t *t) 20 | { 21 | int ret; 22 | 23 | bcm_pr_debug("%s()\n", __func__); 24 | 25 | INIT_LIST_HEAD(&(t->priv.wait_queues)); 26 | mutex_init(&(t->priv.mutex)); 27 | ret = pthread_cond_init(&(t->priv.cond), NULL); 28 | if (ret) { 29 | bcm_pr_err("**** pthread_cond_init() failed with error code %d : '%s' ****\n", 30 | (int)(ret), strerror(ret)); 31 | exit(ret); 32 | } 33 | } 34 | 35 | void deinit_waitqueue_head(wait_queue_head_t *t) 36 | { 37 | bcm_pr_debug("%s()\n", __func__); 38 | 39 | mutex_lock_interruptible(&(t->priv.mutex)); 40 | bcm_assert(list_empty(&(t->priv.wait_queues))); 41 | list_del_init(&(t->priv.wait_queues)); 42 | mutex_unlock(&(t->priv.mutex)); 43 | pthread_cond_destroy(&(t->priv.cond)); 44 | mutex_destroy(&(t->priv.mutex)); 45 | } 46 | -------------------------------------------------------------------------------- /bcm63xx-phone/bcm63xx-phone-dahdi/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | include $(INCLUDE_DIR)/kernel.mk 11 | 12 | PKG_NAME:=bcm63xx-phone-dahdi 13 | PKG_VERSION=0.2 14 | PKG_RELEASE:=1 15 | PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME) 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | 19 | define KernelPackage/bcm63xx-phone-dahdi 20 | SUBMENU:=Voice over IP 21 | TITLE:=DAHDI driver for Le88221 and Le88266 22 | DEPENDS:=@(TARGET_brcm63xx) kmod-dahdi @!PACKAGE_kmod-bcm63xx-phone 23 | FILES:=$(PKG_BUILD_DIR)/bcm63xx-phone-dahdi.$(LINUX_KMOD_SUFFIX) 24 | # Uncomment the following line if compilation failed 25 | # - because symbol BCMPH_USE_SPI_DRIVER is defined in inc/config.h 26 | # - driver spi-bcm63xx is not compiled as a built-in driver of the 27 | # kernel but as a module 28 | # FILES+=$(LINUX_DIR)/drivers/spi/spi-bcm63xx.$(LINUX_KMOD_SUFFIX) 29 | endef 30 | 31 | define KernelPackage/bcm63xx-phone-dahdi/description 32 | DAHDI kernel driver for Le88221 and Le88266 for Broadcom 6358 33 | endef 34 | 35 | define Build/Prepare 36 | mkdir -p $(PKG_BUILD_DIR) 37 | $(CP) ../src/* $(PKG_BUILD_DIR)/ 38 | sed -e "s/module\\.o/$(PKG_NAME)\\.o/g" -e "s/module-objs/$(PKG_NAME)-objs/g" "$(PKG_BUILD_DIR)/Makefile.src" > "$(PKG_BUILD_DIR)/Makefile" 39 | endef 40 | 41 | define Build/Compile 42 | $(MAKE) -C "$(LINUX_DIR)" \ 43 | CROSS_COMPILE="$(TARGET_CROSS)" \ 44 | ARCH="$(LINUX_KARCH)" \ 45 | SUBDIRS="$(PKG_BUILD_DIR)" BCMPH_EFLAGS="-DBCMPH_MODULE_NAME=bcm63xx_phone_dahdi -DBCMPH_MODULE_VERSION=$(PKG_VERSION) -DBCMPH_DAHDI_DRIVER -DBCMPH_DEBUG" \ 46 | modules V=1 47 | endef 48 | 49 | $(eval $(call KernelPackage,bcm63xx-phone-dahdi)) 50 | -------------------------------------------------------------------------------- /bcm63xx-phone/bcm63xx-phone/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | include $(TOPDIR)/rules.mk 10 | include $(INCLUDE_DIR)/kernel.mk 11 | 12 | PKG_NAME:=bcm63xx-phone 13 | PKG_VERSION=0.2 14 | PKG_RELEASE:=1 15 | PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME) 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | 19 | define KernelPackage/bcm63xx-phone 20 | SUBMENU:=Voice over IP 21 | TITLE:=Kernel driver for Le88221 and Le88266 22 | DEPENDS:=@(TARGET_brcm63xx) +kmod-echo 23 | FILES:=$(PKG_BUILD_DIR)/bcm63xx-phone.$(LINUX_KMOD_SUFFIX) 24 | # Uncomment the following line if compilation failed 25 | # - because symbol BCMPH_USE_SPI_DRIVER is defined in inc/config.h 26 | # - driver spi-bcm63xx is not compiled as a built-in driver of the 27 | # kernel but as a module 28 | # FILES+=$(LINUX_DIR)/drivers/spi/spi-bcm63xx.$(LINUX_KMOD_SUFFIX) 29 | endef 30 | 31 | define KernelPackage/bcm63xx-phone/description 32 | Kernel driver for Le88221 and Le88266 for Broadcom 6358 33 | endef 34 | 35 | define Build/Prepare 36 | mkdir -p $(PKG_BUILD_DIR) 37 | $(CP) ../src/* $(PKG_BUILD_DIR)/ 38 | sed -e "s/module\\.o/$(PKG_NAME)\\.o/g" -e "s/module-objs/$(PKG_NAME)-objs/g" "$(PKG_BUILD_DIR)/Makefile.src" > "$(PKG_BUILD_DIR)/Makefile" 39 | endef 40 | 41 | define Build/Compile 42 | $(MAKE) -C "$(LINUX_DIR)" \ 43 | CROSS_COMPILE="$(TARGET_CROSS)" \ 44 | ARCH="$(LINUX_KARCH)" \ 45 | SUBDIRS="$(PKG_BUILD_DIR)" BCMPH_EFLAGS="-DBCMPH_MODULE_NAME=bcm63xx_phone -DBCMPH_MODULE_VERSION=$(PKG_VERSION) -DBCMPH_EXPORT_DEV_FILE -DBCMPH_DEBUG"\ 46 | modules V=1 47 | endef 48 | 49 | $(eval $(call KernelPackage,bcm63xx-phone)) 50 | -------------------------------------------------------------------------------- /bcm63xx-phone/patches/14.07/000-disable-spi-bcm63xx-module.patch: -------------------------------------------------------------------------------- 1 | From 845733ad720ff6e1ccffbbd93e56ad29f68c9b72 Mon Sep 17 00:00:00 2001 2 | From: Gilles Mazoyer 3 | Date: Thu, 3 Dec 2015 08:35:30 +0100 4 | Subject: [PATCH] Modification de la configuration par defaut du noyau pour la 5 | plateforme BCM63xx, pour que le modules spi-bcm63xx ne soit pas linke avec le 6 | noyau 7 | 8 | --- 9 | target/linux/brcm63xx/config-3.10 | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/target/linux/brcm63xx/config-3.10 b/target/linux/brcm63xx/config-3.10 13 | index 206391d..833f3d6 100644 14 | --- a/target/linux/brcm63xx/config-3.10 15 | +++ b/target/linux/brcm63xx/config-3.10 16 | @@ -153,7 +153,7 @@ CONFIG_RTL8367_PHY=y 17 | CONFIG_SERIAL_BCM63XX=y 18 | CONFIG_SERIAL_BCM63XX_CONSOLE=y 19 | CONFIG_SPI=y 20 | -CONFIG_SPI_BCM63XX=y 21 | +CONFIG_SPI_BCM63XX=n 22 | CONFIG_SPI_BCM63XX_HSSPI=y 23 | CONFIG_SPI_BITBANG=y 24 | CONFIG_SPI_GPIO=y 25 | -- 26 | 2.6.2 27 | 28 | -------------------------------------------------------------------------------- /bcm63xx-phone/patches/15.05/000-disable-spi-bcm63xx-module.patch: -------------------------------------------------------------------------------- 1 | From 0f6857f2b5d9f53b96c22778f4d96cf3b3df49a4 Mon Sep 17 00:00:00 2001 2 | From: Gilles Mazoyer 3 | Date: Wed, 30 Sep 2015 16:06:45 +0200 4 | Subject: [PATCH] Modification de la configuration par defaut du noyau pour la 5 | plateforme BCM63xx, pour que le modules spi-bcm63xx ne soit pas linke avec le 6 | noyau 7 | 8 | --- 9 | target/linux/brcm63xx/config-3.18 | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/target/linux/brcm63xx/config-3.18 b/target/linux/brcm63xx/config-3.18 13 | index 0d7a5c7..0072637 100644 14 | --- a/target/linux/brcm63xx/config-3.18 15 | +++ b/target/linux/brcm63xx/config-3.18 16 | @@ -194,7 +194,7 @@ CONFIG_RTL8367_PHY=y 17 | CONFIG_SERIAL_BCM63XX=y 18 | CONFIG_SERIAL_BCM63XX_CONSOLE=y 19 | CONFIG_SPI=y 20 | -CONFIG_SPI_BCM63XX=y 21 | +CONFIG_SPI_BCM63XX=n 22 | CONFIG_SPI_BCM63XX_HSSPI=y 23 | CONFIG_SPI_BITBANG=y 24 | CONFIG_SPI_GPIO=y 25 | -- 26 | 2.6.2 27 | 28 | -------------------------------------------------------------------------------- /bcm63xx-phone/patches/17.01/000-disable-spi-bcm63xx-module.patch: -------------------------------------------------------------------------------- 1 | From 3c83def8313f114abe0a23f335e18043f739f027 Mon Sep 17 00:00:00 2001 2 | From: Gilles Mazoyer 3 | Date: Mon, 7 Nov 2016 12:26:28 +0100 4 | Subject: [PATCH] Modification de la configuration par defaut du noyau pour la 5 | plateforme BCM63xx, pour que le modules spi-bcm63xx ne soit pas linke avec le 6 | noyau 7 | 8 | --- 9 | target/linux/brcm63xx/config-4.4 | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/target/linux/brcm63xx/config-4.4 b/target/linux/brcm63xx/config-4.4 13 | index fb448ad..98c7998 100644 14 | --- a/target/linux/brcm63xx/config-4.4 15 | +++ b/target/linux/brcm63xx/config-4.4 16 | @@ -211,7 +211,7 @@ CONFIG_SCHED_HRTICK=y 17 | CONFIG_SERIAL_BCM63XX=y 18 | CONFIG_SERIAL_BCM63XX_CONSOLE=y 19 | CONFIG_SPI=y 20 | -CONFIG_SPI_BCM63XX=y 21 | +CONFIG_SPI_BCM63XX=m 22 | CONFIG_SPI_BCM63XX_HSSPI=y 23 | CONFIG_SPI_BITBANG=y 24 | CONFIG_SPI_GPIO=y 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /bcm63xx-phone/patches/18.06/000-disable-spi-bcm63xx-module.patch: -------------------------------------------------------------------------------- 1 | From a19add8ca9a4d1ac8874f716595bb8151288894b Mon Sep 17 00:00:00 2001 2 | From: Gilles Mazoyer 3 | Date: Wed, 22 Aug 2018 14:39:28 +0200 4 | Subject: [PATCH] Modification de la configuration par defaut du noyau pour la 5 | plateforme BCM63xx, pour que le modules spi-bcm63xx ne soit pas linke avec le 6 | noyau 7 | 8 | --- 9 | target/linux/brcm63xx/config-4.9 | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/target/linux/brcm63xx/config-4.9 b/target/linux/brcm63xx/config-4.9 13 | index f1c34715f1..2dd4b8e217 100644 14 | --- a/target/linux/brcm63xx/config-4.9 15 | +++ b/target/linux/brcm63xx/config-4.9 16 | @@ -219,7 +219,7 @@ CONFIG_RTL8367_PHY=y 17 | CONFIG_SERIAL_BCM63XX=y 18 | CONFIG_SERIAL_BCM63XX_CONSOLE=y 19 | CONFIG_SPI=y 20 | -CONFIG_SPI_BCM63XX=y 21 | +CONFIG_SPI_BCM63XX=m 22 | CONFIG_SPI_BCM63XX_HSSPI=y 23 | CONFIG_SPI_MASTER=y 24 | CONFIG_SQUASHFS_EMBEDDED=y 25 | -- 26 | 2.11.0 27 | 28 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/Makefile.src: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 3 | # Gilles Mazoyer 4 | # 5 | # This is free software, licensed under the GNU General Public License v2. 6 | # See /LICENSE for more information. 7 | # 8 | 9 | ccflags-y += -Wall -I$(SUBDIRS)/inc 10 | #ccflags-y += -DBCMPH_TEST_PCM 11 | ifneq ($(strip $(BCMPH_EFLAGS)),) 12 | ccflags-y += $(BCMPH_EFLAGS) 13 | endif 14 | 15 | ZARLINK_VERSION=2.24.0.lite 16 | 17 | ccflags-y += -I$(SUBDIRS)/extern/zarlink/arch/bcm63xx 18 | ccflags-y += -I$(SUBDIRS)/extern/zarlink/$(ZARLINK_VERSION)/api_lib/includes 19 | ccflags-y += -I$(SUBDIRS)/extern/zarlink/$(ZARLINK_VERSION)/api_lib/vp880_api 20 | 21 | 22 | MODULE_SRCS += board/board.c 23 | MODULE_SRCS += inc/bcm63xx_line_state.c 24 | MODULE_SRCS += inc/bcm63xx_ring_buf.c 25 | MODULE_SRCS += mpi/mpi.c 26 | MODULE_SRCS += pcm/pcm.c 27 | MODULE_SRCS += phone/phone.c 28 | MODULE_SRCS += phone/phone_mgr.c 29 | MODULE_SRCS += phone/zarlink/le88221/slic_le88221.c 30 | MODULE_SRCS += phone/zarlink/le88266/slic_le88266.c 31 | MODULE_SRCS += phone/zarlink/zarlink_common.c 32 | MODULE_SRCS += timer/timer.c 33 | MODULE_SRCS += wait_queue/wait_queue.c 34 | MODULE_SRCS += $(subst $(SUBDIRS)/,,$(wildcard $(SUBDIRS)/phone/zarlink/profiles/*.c)) 35 | MODULE_SRCS += $(subst $(SUBDIRS)/,,$(wildcard $(SUBDIRS)/extern/zarlink/$(ZARLINK_VERSION)/api_lib/vp880_api/*.c)) 36 | MODULE_SRCS += $(subst $(SUBDIRS)/,,$(wildcard $(SUBDIRS)/extern/zarlink/$(ZARLINK_VERSION)/api_lib/common/*.c)) 37 | MODULE_SRCS += $(subst $(SUBDIRS)/,,$(wildcard $(SUBDIRS)/extern/zarlink/arch/bcm63xx/*.c)) 38 | 39 | MODULE_OBJS := $(patsubst %.c,%.o,$(MODULE_SRCS)) 40 | 41 | obj-m := module.o 42 | 43 | module-objs := $(MODULE_OBJS) 44 | module-objs += main.o main_dahdi.o main_driver.o common.o debug.o 45 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_adaptive_ringing.h: -------------------------------------------------------------------------------- 1 | /** \file vp_adaptive_ringing.h 2 | * vp_adaptive_ringing.h 3 | * 4 | * Header file that defines the data structureds related to the 5 | * adaptive ringing power management routines 6 | * 7 | * Copyright (c) 2011, Microsemi Corporation 8 | * 9 | * $Revision: 9497 $ 10 | * $LastChangedDate: 2012-02-06 17:03:04 -0600 (Mon, 06 Feb 2012) $ 11 | */ 12 | 13 | #ifndef VP_THERMAL_RINGING_H 14 | #define VP_THERMAL_RINGING_H 15 | 16 | #include "vp886_registers.h" 17 | 18 | /* Thermal Ringing Timer duration in ms. This needs to be short enough 19 | * so that the SADC and VADC buffers are emptied often enough not 20 | * to overflow. At the same time, the more often the timer fires, 21 | * the greater amount of SPI traffic to read the buffers. It's 22 | * a tradeoff that is system dependant. Choose wisely. 23 | */ 24 | #define VP_886_THERMAL_RINGING_TIMER_DURATION 10 25 | 26 | /* Timer to debounce any power adaptation steps. */ 27 | #define VP_886_THERMAL_RINGING_DEBOUNCE_DURATION 160 28 | 29 | /* Specifies the sampling rate for the SADC and VADC */ 30 | #define VP_886_THERMAL_RINGING_SADC_DRATE VP886_R_SADC_DRATE_GROUP_500HZ 31 | #define VP_886_THERMAL_RINGING_VADC_DRATE VP886_R_VADC_DRATE_500HZ 32 | 33 | /* In order to easily re-use the NGSLAC code, we scale the inputs to use 34 | * that of the NGSLAC */ 35 | #define VAB_INPUT_FULL_SCALE 240 36 | #define VAB_DESIRED_FULL_SCALE 400 37 | 38 | #define VBAT_INPUT_FULL_SCALE 240 39 | #define VBAT_DESIRED_FULL_SCALE 400 40 | 41 | #define IMT_INPUT_FULL_SCALE 1191 42 | #define IMT_DESIRED_FULL_SCALE 1000 43 | 44 | /* Full scale ringing gain */ 45 | #define FULL_RINGING_GAIN 32767L 46 | 47 | /* Number of consecutive samples before taking a decision */ 48 | #define DEB_COUNTER_MAX 4 49 | 50 | /* Size of data buffers used to hold data samples 51 | * obtained from the ADCs. This is arbitrary at the 52 | * moment and will likely be tweaked as necessary 53 | * to avoid line object bloat while still holding 54 | * enough samples for the algorithm to process. 55 | * This could simply be just the size of the HW 56 | * ADC buffers (12) or maybe some more just in-case 57 | * a delay in processing is required. 58 | */ 59 | #define VP_886_THERMAL_RINGING_BUF_SIZE 32 60 | 61 | /* SLIC power calculation struct */ 62 | typedef struct SlicPowerIntegratorStruct { 63 | int16 samples; 64 | int32 batPwr; 65 | int32 loadPwr; 66 | int32 imtSqr; 67 | } SlicPowerIntegrator; 68 | 69 | /* There will an instance on this struct in each line object */ 70 | typedef struct RingPowerAdaptChannelDataStruct { 71 | const unsigned short chan; 72 | int16 halfCycCount; 73 | int16 halfCycIdx; 74 | SlicPowerIntegrator integrator; 75 | SlicPowerIntegrator halfCyc[2]; 76 | int16 ringGain; 77 | } RingPowerAdaptChannelData; 78 | 79 | /* Need to define a struct that contains an instance of the above 80 | * along with the necessary buffers and indicies for the SADC 81 | * VADC data collection for Vring, Vbat, and IMT 82 | */ 83 | typedef struct RingPowerAdaptModuleStruct { 84 | RingPowerAdaptChannelData rpaChanData; 85 | int16 vtrBuf[VP_886_THERMAL_RINGING_BUF_SIZE]; 86 | int16 vbatBuf[VP_886_THERMAL_RINGING_BUF_SIZE]; 87 | int16 imtBuf[VP_886_THERMAL_RINGING_BUF_SIZE]; 88 | int16 vtrBufSWWrtIdx; 89 | int16 vtrBufSWRdIdx; 90 | int16 vbatBufSWWrtIdx; 91 | int16 vbatBufSWRdIdx; 92 | int16 imtBufSWWrtIdx; 93 | int16 imtBufSWRdIdx; 94 | int16 halfCycleTickCount; 95 | int16 halfCycleTicks[2]; 96 | int16 rspt; 97 | int16 rsptLow; 98 | int16 rsptMid; 99 | int16 rsptHigh; 100 | int16 rtth; 101 | int16 vtrDelay; 102 | int16 vbatDelay; 103 | int16 imtDelay; 104 | uint16 rFuse; 105 | int16 samplesAvail; 106 | bool firstBufferThrownOut; 107 | bool crunchTheNumbers; 108 | uint8 ringGenParams[VP886_R_RINGGEN_LEN]; 109 | uint8 loopSup[VP886_R_LOOPSUP_LEN]; 110 | bool lowIlr; 111 | bool debouncing; 112 | uint8 debCounterHigh; 113 | uint8 debCounterLow; 114 | } RingPowerAdaptModuleType; 115 | 116 | #endif /* VP_THERMAL_RINGING_H */ 117 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_api_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_api_common.h -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_api_dev_term.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_dev_term.h 2 | * vp_api_dev_term.h 3 | * 4 | * This file contains declaration for VP-API Device and termination types. 5 | * 6 | * $Revision: 11225 $ 7 | * $LastChangedDate: 2013-11-19 09:28:34 -0600 (Tue, 19 Nov 2013) $ 8 | */ 9 | 10 | #ifndef VP_API_DEV_TERM_H 11 | #define VP_API_DEV_TERM_H 12 | 13 | /****************************************************************************** 14 | * ENUMERATIONS * 15 | ******************************************************************************/ 16 | /* Valid Device Types supported by VP-API-II. For the corresponding part numbers 17 | * supported by each device type please see VP-API-II documentation. 18 | */ 19 | typedef enum VpDeviceType { 20 | VP_DEV_RSRVD1 = 0, 21 | VP_DEV_580_SERIES, 22 | VP_DEV_790_SERIES, 23 | VP_DEV_VCP_SERIES, 24 | VP_DEV_880_SERIES = 4, /* Fixed value to match calibration profile */ 25 | VP_DEV_RSVD_SERIES, 26 | VP_DEV_VCP2_SERIES, 27 | VP_DEV_KWRAP, 28 | VP_DEV_890_SERIES = 8, /* Fixed value to match calibration profile */ 29 | VP_DEV_792_SERIES, 30 | VP_DEV_MELT_SERIES, 31 | VP_DEV_792_GROUP, 32 | VP_DEV_886_SERIES = 12, 33 | VP_DEV_887_SERIES = 13, 34 | VP_NUM_DEV_TYPES, 35 | VP_DEV_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */ 36 | } VpDeviceType; 37 | 38 | /** 39 | * Deprecated name (VCP) based on older name for VCP. All new applications 40 | * should use VCP instead 41 | */ 42 | #define VP_DEV_DVP_SERIES VP_DEV_VCP_SERIES 43 | 44 | /** Valid Termination Types (per line) supported by API-II. See the VP-API-II 45 | Reference Guide for descriptions. */ 46 | typedef enum VpTermType { 47 | /* FXS */ 48 | VP_TERM_FXS_GENERIC = 0x00, VP_TERM_FXS_FIRST = VP_TERM_FXS_GENERIC, 49 | VP_TERM_FXS_ISOLATE = 0x01, 50 | VP_TERM_FXS_TITO_TL_R = 0x02, 51 | VP_TERM_FXS_CO_TL = 0x03, 52 | VP_TERM_FXS_75181 = 0x04, 53 | VP_TERM_FXS_75282 = 0x05, 54 | VP_TERM_FXS_RDT = 0x06, 55 | VP_TERM_FXS_RR = 0x07, 56 | VP_TERM_FXS_SPLITTER = 0x08, 57 | VP_TERM_FXS_TO_TL = 0x09, 58 | VP_TERM_FXS_LOW_PWR = 0x0A, 59 | VP_TERM_FXS_TI = 0x0B, 60 | VP_TERM_FXS_SPLITTER_LP = 0x0C, 61 | VP_TERM_FXS_ISOLATE_LP = 0x0D, 62 | VP_TERM_FXS_LCAS = 0x0E, 63 | VP_TERM_FXS_RR_TI = 0x0F, 64 | VP_TERM_FXS_CUSTOM = 0x10, 65 | VP_TERM_FXS_TL_MW = 0x11, 66 | VP_TERM_FXS_RR_MW = 0x12, VP_TERM_FXS_LAST = VP_TERM_FXS_RR_MW, 67 | 68 | /* MeLT */ 69 | VP_TERM_MELT_RELAY_CAL_CT = 0x40, VP_TERM_MELT_FIRST = VP_TERM_MELT_RELAY_CAL_CT, 70 | VP_TERM_MELT_RELAY_CAL_SPLIT = 0x41, 71 | VP_TERM_MELT_RELAY_CAL_BRIDGED = 0x42, 72 | VP_TERM_MELT_LTAS_CT = 0x43, 73 | VP_TERM_MELT_RELAY_CT = 0x44, 74 | VP_TERM_MELT_RELAY_SPLIT = 0x45, 75 | VP_TERM_MELT_RELAY_BRIDGED = 0x46, 76 | VP_TERM_MELT_LTAS_BRIDGED = 0x47, VP_TERM_MELT_LAST = VP_TERM_MELT_LTAS_BRIDGED, 77 | 78 | /* FXO */ 79 | VP_TERM_FXO_GENERIC = 0x80, VP_TERM_FXO_FIRST = VP_TERM_FXO_GENERIC, 80 | VP_TERM_FXO_DISC = 0x81, 81 | VP_TERM_FXO_CUSTOM = 0x82, VP_TERM_FXO_LAST = VP_TERM_FXO_CUSTOM, 82 | 83 | VP_TERM_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */ 84 | } VpTermType; 85 | 86 | #endif /* VP_API_DEV_TERM_H */ 87 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_api_fxo_params.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_fxo_params.h 2 | * vp_api_fxo_params.h 3 | * 4 | * This file contains the approved system parameters for proper 5 | * FXO operation on the reference designs 6 | * 7 | * Copyright (c) 2011, Microsemi Corporation 8 | * 9 | * $Revision: 9115 $ 10 | * $LastChangedDate: 2011-11-15 15:25:17 -0600 (Tue, 15 Nov 2011) $ 11 | */ 12 | 13 | #ifndef VP_API_FXO_PARAMS_H 14 | #define VP_API_FXO_PARAMS_H 15 | 16 | #define VP_FXO_DTMF_ON_DEFAULT 0x0027 /* DTMF On = 195mS */ 17 | #define VP_FXO_DTMF_OFF_DEFAULT 0x0028 /* DTMF Off = 200mS */ 18 | #define VP_FXO_FLASH_HOOK_DEFAULT 0x0078 /* Flash Hook = 600mS */ 19 | #define VP_FXO_PULSE_BREAK_DEFAULT 0x0C /* Pulse Break = 60mS */ 20 | #define VP_FXO_PULSE_MAKE_DEFAULT 0x08 /* Pulse Make = 40mS */ 21 | #define VP_FXO_INTERDIG_DEFAULT 0x0028 /* Interdigit Period = 200mS */ 22 | #define VP_FXO_RING_DET_MAX_DEFAULT 0xEB /* Ring Period Max = 58.75mS */ 23 | #define VP_FXO_RING_DET_MIN_DEFAULT 0x79 /* Ring Period Min = 30.25mS */ 24 | #define VP_FXO_RING_DET_VOLT_DEFAULT 0x02 /* Ring Voltage Min = 38V */ 25 | #define VP_FXO_DISC_DET_MIN_DEFAULT 0x03 /* Disconnect Det Min = 4.2V */ 26 | #define VP_FXO_LIU_DET_THRESH_DEFAULT 0x26 /* Line-In-Use Det Threshold = 38V */ 27 | 28 | /* In ms, time that FXO detector activity is ignored after a state change */ 29 | #define VP_FXO_STATE_CHANGE_DEBOUNCE (50) 30 | 31 | /* In ms, time that FXO detector activity is ignored after a ring trip */ 32 | #define VP_FXO_RING_TRIP_DEBOUNCE (200) 33 | 34 | /* In ms, time that FXO disconnect detector is debounced */ 35 | #define VP_FXO_DISCONNECT_DEBOUNCE (300) 36 | 37 | /* In ms, time that FXO will change to loop open if detecting disconnect */ 38 | #define VP_FXO_DISC_TO_LOOP_OPEN (5000) 39 | 40 | typedef enum vp_fxo_dialingProfileParams { 41 | VP_FXO_DIALING_PROFILE_DTMF_ON_MSB = 6, 42 | VP_FXO_DIALING_PROFILE_DTMF_ON_LSB = 7, 43 | VP_FXO_DIALING_PROFILE_DTMF_OFF_MSB = 8, 44 | VP_FXO_DIALING_PROFILE_DTMF_OFF_LSB = 9, 45 | VP_FXO_DIALING_PROFILE_FLASH_HOOK_MSB = 10, 46 | VP_FXO_DIALING_PROFILE_FLASH_HOOK_LSB = 11, 47 | VP_FXO_DIALING_PROFILE_PULSE_BREAK = 12, 48 | VP_FXO_DIALING_PROFILE_PULSE_MAKE = 13, 49 | VP_FXO_DIALING_PROFILE_INTERDIGIT_MSB = 14, 50 | VP_FXO_DIALING_PROFILE_INTERDIGIT_LSB = 15, 51 | VP_FXO_DIALING_PROFILE_RING_PERIOD_MAX = 16, 52 | VP_FXO_DIALING_PROFILE_RING_PERIOD_MIN = 17, 53 | VP_FXO_DIALING_PROFILE_RING_VOLTAGE_MIN = 18, 54 | VP_FXO_DIALING_PROFILE_DISC_VOLTAGE_MIN = 19, 55 | VP_FXO_DIALING_PROFILE_LIU_THRESHOLD_MIN = 20, 56 | VP_FXO_DIALING_PROFILE_RING_PERIOD_MAX_ACT = 21, 57 | VP_FXO_DIALING_PROFILE_DTMF_HIGH_LVL_MSB = 22, 58 | VP_FXO_DIALING_PROFILE_DTMF_HIGH_LVL_LSB = 23, 59 | VP_FXO_DIALING_PROFILE_DTMF_LOW_LVL_MSB = 24, 60 | VP_FXO_DIALING_PROFILE_DTMF_LOW_LVL_LSB = 25, 61 | VP_FXO_DIALING_PROFILE_POH_INT_TIME = 26, 62 | VP_FXO_DIALING_PROFILE_POH_THRESHOLD = 27, 63 | VP_FXO_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req.*/ 64 | } vp_fxo_dialingProfileParams; 65 | #endif 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_debug_colors.h: -------------------------------------------------------------------------------- 1 | /* \file vp_debug_colors.h 2 | * vp_debug_colors.h 3 | * 4 | * This file contains ANSI X3.64 codes for displaying colors. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | * 8 | * $Revision: 9129 $ 9 | * $LastChangedDate: 2011-11-17 11:03:13 -0600 (Thu, 17 Nov 2011) $ 10 | */ 11 | 12 | #ifndef VP_DEBUG_COLORS_H 13 | #define VP_DEBUG_COLORS_H 14 | 15 | #include "vp_api_cfg.h" 16 | 17 | #ifdef VP_DEBUG_COLOR 18 | 19 | #define COLORS_begin "\x1b[" 20 | #define COLORS_delim ";" 21 | #define COLORS_end "m" 22 | #define COLORS_reset "0" 23 | #define COLORS_bold "1" 24 | #define COLORS_nonbold "22" 25 | #define COLORS_fore "3" 26 | #define COLORS_back "4" 27 | 28 | #define COLORS_black "0" 29 | #define COLORS_red "1" 30 | #define COLORS_green "2" 31 | #define COLORS_yellow "3" 32 | #define COLORS_blue "4" 33 | #define COLORS_magenta "5" 34 | #define COLORS_cyan "6" 35 | #define COLORS_white "7" 36 | 37 | #define COLORS_bright_black COLORS_black COLORS_delim COLORS_bold 38 | #define COLORS_bright_red COLORS_red COLORS_delim COLORS_bold 39 | #define COLORS_bright_green COLORS_green COLORS_delim COLORS_bold 40 | #define COLORS_bright_yellow COLORS_yellow COLORS_delim COLORS_bold 41 | #define COLORS_bright_blue COLORS_blue COLORS_delim COLORS_bold 42 | #define COLORS_bright_magenta COLORS_magenta COLORS_delim COLORS_bold 43 | #define COLORS_bright_cyan COLORS_cyan COLORS_delim COLORS_bold 44 | #define COLORS_bright_white COLORS_white COLORS_delim COLORS_bold 45 | 46 | #define COLORS_dark_black COLORS_black COLORS_delim COLORS_nonbold 47 | #define COLORS_dark_red COLORS_red COLORS_delim COLORS_nonbold 48 | #define COLORS_dark_green COLORS_green COLORS_delim COLORS_nonbold 49 | #define COLORS_dark_yellow COLORS_yellow COLORS_delim COLORS_nonbold 50 | #define COLORS_dark_blue COLORS_blue COLORS_delim COLORS_nonbold 51 | #define COLORS_dark_magenta COLORS_magenta COLORS_delim COLORS_nonbold 52 | #define COLORS_dark_cyan COLORS_cyan COLORS_delim COLORS_nonbold 53 | #define COLORS_dark_white COLORS_white COLORS_delim COLORS_nonbold 54 | 55 | /* 56 | * Usage example: 57 | * printf( color_reset "this is white-on-black text" 58 | * color(red, blue) "this is red-on-blue text" 59 | * color_fg(green) "this is green-on-blue text" 60 | * color_fg(bright_white) "this is bright-white-on-blue text" 61 | * color_bg(black) "this is bright-white-on-black text" 62 | * color_reset "this is white on black\n" 63 | * ); 64 | * Note: Bright colors are only allowed in the foreground. 65 | */ 66 | 67 | #define color_fg(c) COLORS_begin COLORS_fore COLORS_ ## c COLORS_end 68 | #define color_bg(c) COLORS_begin COLORS_back COLORS_ ## c COLORS_end 69 | #define color(fore_c, back_c) COLORS_begin COLORS_fore COLORS_ ## fore_c COLORS_delim COLORS_back COLORS_ ## back_c COLORS_end 70 | #define color_reset COLORS_begin COLORS_reset COLORS_end 71 | 72 | #else /* !defined(VP_DEBUG_COLOR) */ 73 | 74 | #define color_fg(c) "" 75 | #define color_bg(c) "" 76 | #define color(fore_c, back_c) "" 77 | #define color_reset "" 78 | 79 | #endif 80 | 81 | #endif /* VP_DEBUG_COLORS_H */ 82 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_debug_masks.h: -------------------------------------------------------------------------------- 1 | /** \file vp_debug_masks.h 2 | * vp_debug_masks.h 3 | * 4 | * This file contains the debug masks for the VP-APi_II 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | * 8 | * $Revision: 11245 $ 9 | * $LastChangedDate: 2013-12-17 11:24:47 -0600 (Tue, 17 Dec 2013) $ 10 | */ 11 | 12 | #ifndef VP_DEBUG_MASKS_H 13 | #define VP_DEBUG_MASKS_H 14 | 15 | /* VP-API debug message types: */ 16 | #define VP_DBG_ERROR 0x00000001L /* Any error condition */ 17 | #define VP_DBG_WARNING 0x00000002L /* Any warning condition */ 18 | #define VP_DBG_INFO 0x00000004L /* Un-categorized information */ 19 | #define VP_DBG_API_FUNC 0x00000008L /* API function entry/exit (except tick) */ 20 | 21 | #define VP_DBG_API_FUNC_INT 0x00000010L /* Internal API function entry/exit */ 22 | #define VP_DBG_HAL 0x00000020L /* HAL traffic */ 23 | #define VP_DBG_SSL 0x00000040L /* SSL function entry/exit */ 24 | #define VP_DBG_EVENT 0x00000080L /* Events/results from VpGetEvent()/VpGetResults() */ 25 | 26 | #define VP_DBG_HOOK 0x00000100L /* Hook Based Code */ 27 | #define VP_DBG_LINE_STATE 0x00000200L /* Set Line State Based Code */ 28 | #define VP_DBG_CALIBRATION 0x00000400L /* VpCalCodec(), VpCalLine(), VpCal() */ 29 | #define VP_DBG_TEST 0x00000800L /* Verbose test debug */ 30 | 31 | #define VP_DBG_TEST_FUNC 0x00001000L /* Test I/F function enter and exit */ 32 | #define VP_DBG_FXO_FUNC 0x00002000L /* FXO Detection Code */ 33 | #define VP_DBG_SEQUENCER 0x00004000L /* Sequencer Based Code */ 34 | #define VP_DBG_CID 0x00008000L /* Caller ID funcitons */ 35 | 36 | #define VP_DBG_TEST_PCM 0x00010000L /* Verbose test pcm collection */ 37 | #define VP_DBG_GAIN 0x00020000L /* VpSetRelGain() and VP_OPTION_ID_ABS_GAIN */ 38 | #define VP_DBG_TIMER 0x00040000L /* API Timers */ 39 | #define VP_DBG_TEST_CALC 0x00080000L /* Verbose test calculations */ 40 | 41 | #define VP_DBG_ADP_RING 0x00100000L /* Adaptive Ringing */ 42 | #define VP_DBG_INTERRUPT 0x00200000L /* Interrupts */ 43 | #define VP_DBG_DTMF 0x00400000L /* DTMF Detection */ 44 | #define VP_DBG_DTMF_DETAIL 0x00800000L /* Detailed DTMF Detection */ 45 | 46 | #define VP_DBG_ALL 0xFFFFFFFFL 47 | 48 | #endif /* VP_DEBUG_MASKS_H */ 49 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_dtmf_detect.h: -------------------------------------------------------------------------------- 1 | /** \file vp_pulse_decode.h 2 | * vp_pulse_decode.h 3 | * 4 | * Header file for the VP DTMF Detect Module c file. 5 | * 6 | * Copyright (c) 2013, Microsemi Corporation 7 | * 8 | * $Revision: 9734 $ 9 | * $LastChangedDate: 2012-03-30 16:37:31 -0500 (Fri, 30 Mar 2012) $ 10 | */ 11 | 12 | #ifndef VP_DTMF_DETECT_H 13 | #define VP_DTMF_DETECT_H 14 | 15 | #include "vp_api.h" 16 | #include "vp_api_types.h" 17 | 18 | /* Use different block sizes to get near-integer k for each target frequency, 19 | where k = (target / (sampleRate / blockSize)) */ 20 | #define VP_DTMF_BLOCK_SIZE_4KHZ_MAX 53 21 | #define VP_DTMF_BLOCK_SIZE_4KHZ_697 52 22 | #define VP_DTMF_BLOCK_SIZE_4KHZ_770 52 23 | #define VP_DTMF_BLOCK_SIZE_4KHZ_852 52 24 | #define VP_DTMF_BLOCK_SIZE_4KHZ_941 51 25 | #define VP_DTMF_BLOCK_SIZE_4KHZ_1209 53 26 | #define VP_DTMF_BLOCK_SIZE_4KHZ_1336 51 27 | #define VP_DTMF_BLOCK_SIZE_4KHZ_1477 51 28 | #define VP_DTMF_BLOCK_SIZE_4KHZ_1633 51 29 | #define VP_DTMF_BLOCK_SIZE_4KHZ_615 52 30 | #define VP_DTMF_BLOCK_SIZE_4KHZ_1075 52 31 | #define VP_DTMF_BLOCK_SIZE_4KHZ_1820 53 32 | 33 | #define VP_DTMF_BLOCK_SIZE_8KHZ_MAX 106 34 | #define VP_DTMF_BLOCK_SIZE_8KHZ_697 103 35 | #define VP_DTMF_BLOCK_SIZE_8KHZ_770 104 36 | #define VP_DTMF_BLOCK_SIZE_8KHZ_852 103 37 | #define VP_DTMF_BLOCK_SIZE_8KHZ_941 102 38 | #define VP_DTMF_BLOCK_SIZE_8KHZ_1209 106 39 | #define VP_DTMF_BLOCK_SIZE_8KHZ_1336 102 40 | #define VP_DTMF_BLOCK_SIZE_8KHZ_1477 103 41 | #define VP_DTMF_BLOCK_SIZE_8KHZ_1633 103 42 | #define VP_DTMF_BLOCK_SIZE_8KHZ_615 104 43 | #define VP_DTMF_BLOCK_SIZE_8KHZ_1075 104 44 | #define VP_DTMF_BLOCK_SIZE_8KHZ_1820 105 45 | 46 | /* Block size to normalize results against */ 47 | #define VP_DTMF_NORMAL_BLOCKSIZE 102 48 | 49 | /* Scale energy results down by this many bits */ 50 | #define VP_DTMF_NORMAL_ENERGY_SCALE 16 51 | 52 | 53 | #ifdef VP886_INCLUDE_DTMF_DETECT 54 | 55 | void 56 | VpDtmfDetectReset( 57 | VpLineCtxType *pLineCtx, 58 | VpDtmfDetectDataType *pDtmfData, 59 | bool freshStart); 60 | 61 | void 62 | VpDtmfDetectInit( 63 | VpLineCtxType *pLineCtx, 64 | VpDtmfDetectDataType *pDtmfData); 65 | 66 | VpDigitType 67 | VpDtmfDetectProcess( 68 | VpLineCtxType *pLineCtx, 69 | VpDtmfDetectDataType *pDtmfData, 70 | int16 *pSamples, 71 | uint8 numSamples); 72 | 73 | #endif /* VP886_INCLUDE_DTMF_DETECT */ 74 | 75 | #endif /* VP_DTMF_DETECT_H */ 76 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_pulse_decode.h: -------------------------------------------------------------------------------- 1 | /** \file vp_pulse_decode.h 2 | * vp_pulse_decode.h 3 | * 4 | * Header file for the VP Pulse Decoder Module c file. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | * 8 | * $Revision: 9734 $ 9 | * $LastChangedDate: 2012-03-30 16:37:31 -0500 (Fri, 30 Mar 2012) $ 10 | */ 11 | 12 | #ifndef VP_PULSE_DECODE_H 13 | #define VP_PULSE_DECODE_H 14 | 15 | #include "vp_api.h" 16 | #include "vp_api_types.h" 17 | #include "sys_service.h" 18 | 19 | EXTERN void 20 | VpPulseDecodeInit( 21 | VpPulseDecodeDataType *pPulseData); 22 | 23 | EXTERN uint16 24 | VpPulseDecodeRun( 25 | VpLineCtxType *pLineCtx, 26 | VpPulseDecodeDataType *pPulseData, 27 | VpPulseDecodeInputType input, 28 | uint16 timestamp); 29 | 30 | #endif /* VP_PULSE_DECODE_H */ 31 | 32 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/api_lib/includes/vp_timer_queue.h: -------------------------------------------------------------------------------- 1 | /** \file vp_timer_queue.h 2 | * vp_timer_queue.h 3 | * 4 | * Header file for the VP Timer Queue Module c file. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | * 8 | * $Revision: 10976 $ 9 | * $LastChangedDate: 2013-05-21 18:08:34 -0500 (Tue, 21 May 2013) $ 10 | */ 11 | 12 | #ifndef VP_TIMER_QUEUE_H 13 | #define VP_TIMER_QUEUE_H 14 | 15 | #include "vp_api.h" 16 | #include "vp_api_types.h" 17 | #include "sys_service.h" 18 | 19 | #define VP_END_OF_TIMER_QUEUE -1 20 | 21 | /* Note: The following functions may be called from 22 | device specific timer function wrappers if necessary */ 23 | EXTERN bool 24 | VpInitTimerQueue( 25 | VpTimerQueueInfoType *pInfo, 26 | VpTimerQueueNodeType *pNodes); 27 | 28 | EXTERN bool 29 | VpInsertTimer( 30 | VpDevCtxType *pDevCtx, 31 | VpTimerQueueInfoType *pInfo, 32 | VpTimerQueueNodeType *pNodes, 33 | uint16 timerId, 34 | uint32 timerDuration, 35 | uint8 channelId, 36 | uint32 handle); 37 | 38 | EXTERN bool 39 | VpRemoveTimer( 40 | VpDevCtxType *pDevCtx, 41 | VpTimerQueueInfoType *pInfo, 42 | VpTimerQueueNodeType *pNodes, 43 | uint16 timerId, 44 | uint8 channelId, 45 | uint32 handle, 46 | bool matchHandle); 47 | 48 | EXTERN bool 49 | VpRemoveChannelTimers( 50 | VpDevCtxType *pDevCtx, 51 | VpTimerQueueInfoType *pInfo, 52 | VpTimerQueueNodeType *pNodes, 53 | uint8 channelId); 54 | 55 | EXTERN bool 56 | VpRestartTimer( 57 | VpDevCtxType *pDevCtx, 58 | VpTimerQueueInfoType *pInfo, 59 | VpTimerQueueNodeType *pNodes, 60 | uint16 timerId, 61 | uint32 timerDuration, 62 | uint8 channelId, 63 | uint32 handle); 64 | 65 | EXTERN bool 66 | VpExtendTimer( 67 | VpDevCtxType *pDevCtx, 68 | VpTimerQueueInfoType *pInfo, 69 | VpTimerQueueNodeType *pNodes, 70 | uint16 timerId, 71 | uint32 timerDuration, 72 | uint8 channelId, 73 | uint32 handle); 74 | 75 | EXTERN void 76 | VpProcessTimers( 77 | VpDevCtxType *pDevCtx, 78 | VpTimerQueueInfoType *pInfo, 79 | VpTimerQueueNodeType *pNodes); 80 | 81 | #endif /* VP_TIMER_QUEUE_H */ 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_initialization/VE880_ABS_profiles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_ABS_profiles.c -- 3 | * 4 | * This file contains profile data in byte format 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_ABS_profiles.vpw 8 | * Type: VE880 ABS Configuration for -27/-81V Supply with VBL Regulation, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:43:00 10 | * Device: VE880 Le88266 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #include "VE880_ABS_profiles.h" 16 | 17 | 18 | /************** Device Parameters **************/ 19 | 20 | /* Device Configuration Data - VE880 ABS -27/-81V Power Optimized With Free Run, PCM/MPI Interface */ 21 | const VpProfileDataType ABS_DEV_PROFILE[] = 22 | { 23 | /* Device Profile for VE880 Device Family */ 24 | 0x00, 0xFF, 0x00, 0x20, /* Profile Index and Length */ 25 | 0x05, 0x00, /* Version and MPI Command */ 26 | 0x20, 0x00, /* PCLK Frequency */ 27 | 0x8A, 0x00, /* Device Config 1, Battery Control Mode */ 28 | 0x40, 0x02, /* Clock Slot and Max Events */ 29 | 0x05, 0x00, /* Device Tickrate */ 30 | 0xE4, 0x00, 0x04, 0x00, /* Switching Regulator Parameters */ 31 | 0x1B, 0x05, /* Y-Voltage, Z-Voltage */ 32 | 0x00, 0x00, 0x00, 0x00, /* RSVD */ 33 | 0xB1, 0x00, 0xB1, 0x00, 0xB0, 0x40, /* Regulator Timing Parameters */ 34 | 0x2C, 0x40, 0x2C, 0x40, 0x2C, 0x40 /* FreeRun Timing Parameters */ 35 | }; 36 | 37 | /************** AC Filter Coefficients **************/ 38 | 39 | /* AC FXS RF14 600R Normal Coefficients (Default) */ 40 | const VpProfileDataType ABS_AC_600_FXS[] = 41 | { 42 | /* AC Profile */ 43 | 0xA4, 0x00, 0xF4, 0x4C, 0x01, 0x49, 0xCA, 0xF5, 0x98, 0xAA, 0x7B, 0xAB, 44 | 0x2C, 0xA3, 0x25, 0xA5, 0x24, 0xB2, 0x3D, 0x9A, 0x2A, 0xAA, 0xA6, 0x9F, 45 | 0x01, 0x8A, 0x1D, 0x01, 0xA3, 0xA0, 0x2E, 0xB2, 0xB2, 0xBA, 0xAC, 0xA2, 46 | 0xA6, 0xCB, 0x3B, 0x45, 0x88, 0x2A, 0x20, 0x3C, 0xBC, 0x4E, 0xA6, 0x2B, 47 | 0xA5, 0x2B, 0x3E, 0xBA, 0x8F, 0x82, 0xA8, 0x71, 0x80, 0xA9, 0xF0, 0x50, 48 | 0x00, 0x86, 0x2A, 0x42, 0xA1, 0xCB, 0x1B, 0xA3, 0xA8, 0xFB, 0x87, 0xAA, 49 | 0xFB, 0x9F, 0xA9, 0xF0, 0x96, 0x2E, 0x01, 0x00 50 | }; 51 | 52 | /************** DC Feed Parameters **************/ 53 | 54 | /* DC FXS Default -- Use for all countries unless country file exists - 22 mA current feed */ 55 | const VpProfileDataType ABS_DC_22MA_CC[] = 56 | { 57 | /* DC Profile */ 58 | 0x00, 0x01, 0x01, 0x0B, 0x01, 0x08, 0xC2, 0x19, 0x86, 0xAA, 0x02, 0xC6, 59 | 0x11, 0x04, 0x01 60 | }; 61 | 62 | /************** Ring Signal Parameters **************/ 63 | 64 | /* Default Ringing 25Hz 50 Vrms Fixed - Use for all countries unless country file exists */ 65 | const VpProfileDataType ABS_RING_25HZ_SINE[] = 66 | { 67 | /* Sine, 25 Hz, 1.41 CF, 70.00 Vpk, 0.00 Bias */ 68 | /* Ringing Profile */ 69 | 0x00, 0x04, 0x01, 0x12, 0x00, 0x0E, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x44, 70 | 0x3A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00 71 | }; 72 | 73 | /************** Call Progress Tones **************/ 74 | 75 | /************** Cadence Definitions **************/ 76 | 77 | /************** Caller ID **************/ 78 | 79 | /************** Metering Profile **************/ 80 | 81 | /* end of file VE880_ABS_profiles.c */ 82 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_initialization/VE880_ABS_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_ABS_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_ABS_profiles.vpw 8 | * Type: VE880 ABS Configuration for -27/-81V Supply with VBL Regulation, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:43:00 10 | * Device: VE880 Le88266 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef VE880_ABS_PROFILES_H 16 | #define VE880_ABS_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | extern const VpProfileDataType ABS_DEV_PROFILE[]; /* Device Configuration Data - VE880 ABS -27/-81V Power Optimized With Free Run, PCM/MPI Interface */ 27 | 28 | /************** AC Filter Coefficients **************/ 29 | extern const VpProfileDataType ABS_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 30 | 31 | /************** DC Feed Parameters **************/ 32 | extern const VpProfileDataType ABS_DC_22MA_CC[]; /* DC FXS Default -- Use for all countries unless country file exists - 22 mA current feed */ 33 | 34 | /************** Ring Signal Parameters **************/ 35 | extern const VpProfileDataType ABS_RING_25HZ_SINE[]; /* Default Ringing 25Hz 50 Vrms Fixed - Use for all countries unless country file exists */ 36 | 37 | /************** Call Progress Tones **************/ 38 | 39 | /************** Cadence Definitions **************/ 40 | 41 | /************** Caller ID **************/ 42 | 43 | /************** Metering Profile **************/ 44 | 45 | #endif /* VE880_ABS_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_initialization/VE880_FB_profiles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_FB_profiles.c -- 3 | * 4 | * This file contains profile data in byte format 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_FB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Flyback Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:49:08 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #include "VE880_FB_profiles.h" 16 | 17 | 18 | /************** Device Parameters **************/ 19 | 20 | /* Device Configuration Data - VE880 Tracker 100V Flyback, PCM/MPI Interface */ 21 | const VpProfileDataType FB_DEV_PROFILE[] = 22 | { 23 | /* Device Profile for VE880 Device Family */ 24 | 0x00, 0xFF, 0x02, 0x1A, /* Profile Type and Length */ 25 | 0x05, 0x00, /* Version and MPI Command */ 26 | 0x20, 0x00, /* PCLK Frequency */ 27 | 0x8A, 0x00, /* Device Config 1 and MCLK Correction */ 28 | 0x40, 0x02, /* Clock Slot and Max Events */ 29 | 0x05, 0x00, /* Device Tickrate */ 30 | 0xE4, 0x00, 0x04, 0x11, /* Flyback (100V) Switching Regulator Parameters */ 31 | 0x97, 0xFF, 0x95, 0x00, 0x94, 0x40, /* Regulator Timing Parameters */ 32 | 0x14, 0xF6, 0x14, 0x40, 0x14, 0x40 /* FreeRun Timing Parameters */ 33 | }; 34 | 35 | /************** AC Coefficients **************/ 36 | 37 | /* AC FXS RF14 600R Normal Coefficients (Default) */ 38 | const VpProfileDataType FB_AC_600_FXS[] = 39 | { 40 | /* AC Profile */ 41 | 0xA4, 0x00, 0xF4, 0x4C, 0x01, 0x49, 0xCA, 0xF5, 0x98, 0xAA, 0x7B, 0xAB, 42 | 0x2C, 0xA3, 0x25, 0xA5, 0x24, 0xB2, 0x3D, 0x9A, 0x2A, 0xAA, 0xA6, 0x9F, 43 | 0x01, 0x8A, 0x1D, 0x01, 0xA3, 0xA0, 0x2E, 0xB2, 0xB2, 0xBA, 0xAC, 0xA2, 44 | 0xA6, 0xCB, 0x3B, 0x45, 0x88, 0x2A, 0x20, 0x3C, 0xBC, 0x4E, 0xA6, 0x2B, 45 | 0xA5, 0x2B, 0x3E, 0xBA, 0x8F, 0x82, 0xA8, 0x71, 0x80, 0xA9, 0xF0, 0x50, 46 | 0x00, 0x86, 0x2A, 0x42, 0xA1, 0xCB, 0x1B, 0xA3, 0xA8, 0xFB, 0x87, 0xAA, 47 | 0xFB, 0x9F, 0xA9, 0xF0, 0x96, 0x2E, 0x01, 0x00 48 | }; 49 | 50 | /************** DC Feed Parameters **************/ 51 | 52 | /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 53 | const VpProfileDataType FB_DC_25MA_CC[] = 54 | { 55 | /* DC Profile */ 56 | 0x00, 0x01, 0x00, 0x0B, 0x01, 0x08, 0xC2, 0x19, 0x84, 0xB2, 0x07, 0xC6, 57 | 0x33, 0x07, 0x01 58 | }; 59 | 60 | /************** Ring Parameters **************/ 61 | 62 | /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 63 | const VpProfileDataType FB_RING_25HZ_SINE[] = 64 | { 65 | /* Sine, 25 Hz, 1.41 CF, 85.00 Vpk, 0.00 Bias */ 66 | /* Ringing Profile */ 67 | 0x00, 0x04, 0x00, 0x12, 0x00, 0x0E, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x44, 68 | 0x46, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00 69 | }; 70 | 71 | /************** Call Progress Tones **************/ 72 | 73 | /************** Cadence Definitions **************/ 74 | 75 | /************** Caller ID **************/ 76 | 77 | /************** Metering Profile **************/ 78 | 79 | /* end of file VE880_FB_profiles.c */ 80 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_initialization/VE880_FB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_FB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_FB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Flyback Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:49:08 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef VE880_FB_PROFILES_H 16 | #define VE880_FB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | extern const VpProfileDataType FB_DEV_PROFILE[]; /* Device Configuration Data - VE880 Tracker 100V Flyback, PCM/MPI Interface */ 27 | 28 | /************** AC Coefficients **************/ 29 | extern const VpProfileDataType FB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 30 | 31 | /************** DC Feed Parameters **************/ 32 | extern const VpProfileDataType FB_DC_25MA_CC[]; /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 33 | 34 | /************** Ring Parameters **************/ 35 | extern const VpProfileDataType FB_RING_25HZ_SINE[]; /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 36 | 37 | /************** Call Progress Tones **************/ 38 | 39 | /************** Cadence Definitions **************/ 40 | 41 | /************** Caller ID **************/ 42 | 43 | /************** Metering Profile **************/ 44 | 45 | #endif /* VE880_FB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_initialization/VE880_IB_profiles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_IB_profiles.c -- 3 | * 4 | * This file contains profile data in byte format 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_IB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Inverting Boost Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:50:35 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #include "VE880_IB_profiles.h" 16 | 17 | 18 | /************** Device Parameters **************/ 19 | 20 | /* Device Configuration Data - VE880 Tracker 100V Inverting Boost, PCM/MPI Interface */ 21 | const VpProfileDataType IB_DEV_PROFILE[] = 22 | { 23 | /* Device Profile for VE880 Device Family */ 24 | 0x00, 0xFF, 0x02, 0x1A, /* Profile Type and Length */ 25 | 0x05, 0x00, /* Version and MPI Command */ 26 | 0x20, 0x00, /* PCLK Frequency */ 27 | 0x8A, 0x00, /* Device Config 1 and MCLK Correction */ 28 | 0x40, 0x02, /* Clock Slot and Max Events */ 29 | 0x05, 0x00, /* Device Tickrate */ 30 | 0xE4, 0x00, 0x04, 0x11, /* Inverting Boost (100V) Switching Regulator Parameters */ 31 | 0xB3, 0xFF, 0x94, 0x52, 0xD0, 0x52, /* Regulator Timing Parameters */ 32 | 0x20, 0x80, 0x30, 0x52, 0x30, 0x52 /* FreeRun Timing Parameters */ 33 | }; 34 | 35 | /************** AC Coefficients **************/ 36 | 37 | /* AC FXS RF14 600R Normal Coefficients (Default) */ 38 | const VpProfileDataType IB_AC_600_FXS[] = 39 | { 40 | /* AC Profile */ 41 | 0xA4, 0x00, 0xF4, 0x4C, 0x01, 0x49, 0xCA, 0xF5, 0x98, 0xAA, 0x7B, 0xAB, 42 | 0x2C, 0xA3, 0x25, 0xA5, 0x24, 0xB2, 0x3D, 0x9A, 0x2A, 0xAA, 0xA6, 0x9F, 43 | 0x01, 0x8A, 0x1D, 0x01, 0xA3, 0xA0, 0x2E, 0xB2, 0xB2, 0xBA, 0xAC, 0xA2, 44 | 0xA6, 0xCB, 0x3B, 0x45, 0x88, 0x2A, 0x20, 0x3C, 0xBC, 0x4E, 0xA6, 0x2B, 45 | 0xA5, 0x2B, 0x3E, 0xBA, 0x8F, 0x82, 0xA8, 0x71, 0x80, 0xA9, 0xF0, 0x50, 46 | 0x00, 0x86, 0x2A, 0x42, 0xA1, 0xCB, 0x1B, 0xA3, 0xA8, 0xFB, 0x87, 0xAA, 47 | 0xFB, 0x9F, 0xA9, 0xF0, 0x96, 0x2E, 0x01, 0x00 48 | }; 49 | 50 | /************** DC Feed Parameters **************/ 51 | 52 | /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 53 | const VpProfileDataType IB_DC_25MA_CC[] = 54 | { 55 | /* DC Profile */ 56 | 0x00, 0x01, 0x00, 0x0B, 0x01, 0x08, 0xC2, 0x19, 0x84, 0xB2, 0x07, 0xC6, 57 | 0x33, 0x07, 0x01 58 | }; 59 | 60 | /************** Ring Parameters **************/ 61 | 62 | /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 63 | const VpProfileDataType IB_RING_25HZ_SINE[] = 64 | { 65 | /* Sine, 25 Hz, 1.41 CF, 85.00 Vpk, 0.00 Bias */ 66 | /* Ringing Profile */ 67 | 0x00, 0x04, 0x00, 0x12, 0x00, 0x0E, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x44, 68 | 0x46, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00 69 | }; 70 | 71 | /************** Call Progress Tones **************/ 72 | 73 | /************** Cadence Definitions **************/ 74 | 75 | /************** Caller ID **************/ 76 | 77 | /************** Metering Profile **************/ 78 | 79 | /* end of file VE880_IB_profiles.c */ 80 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_initialization/VE880_IB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_IB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_IB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Inverting Boost Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:50:35 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef VE880_IB_PROFILES_H 16 | #define VE880_IB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | extern const VpProfileDataType IB_DEV_PROFILE[]; /* Device Configuration Data - VE880 Tracker 100V Inverting Boost, PCM/MPI Interface */ 27 | 28 | /************** AC Coefficients **************/ 29 | extern const VpProfileDataType IB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 30 | 31 | /************** DC Feed Parameters **************/ 32 | extern const VpProfileDataType IB_DC_25MA_CC[]; /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 33 | 34 | /************** Ring Parameters **************/ 35 | extern const VpProfileDataType IB_RING_25HZ_SINE[]; /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 36 | 37 | /************** Call Progress Tones **************/ 38 | 39 | /************** Cadence Definitions **************/ 40 | 41 | /************** Caller ID **************/ 42 | 43 | /************** Metering Profile **************/ 44 | 45 | #endif /* VE880_IB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_line_test/VE880_ABS_profiles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_ABS_profiles.c -- 3 | * 4 | * This file contains profile data in byte format 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_ABS_profiles.vpw 8 | * Type: VE880 ABS Configuration for -27/-81V Supply with VBL Regulation, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:43:00 10 | * Device: VE880 Le88266 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #include "VE880_ABS_profiles.h" 16 | 17 | 18 | /************** Device Parameters **************/ 19 | 20 | /* Device Configuration Data - VE880 ABS -27/-81V Power Optimized With Free Run, PCM/MPI Interface */ 21 | const VpProfileDataType ABS_DEV_PROFILE[] = 22 | { 23 | /* Device Profile for VE880 Device Family */ 24 | 0x00, 0xFF, 0x00, 0x20, /* Profile Index and Length */ 25 | 0x05, 0x00, /* Version and MPI Command */ 26 | 0x20, 0x00, /* PCLK Frequency */ 27 | 0x8A, 0x00, /* Device Config 1, Battery Control Mode */ 28 | 0x40, 0x02, /* Clock Slot and Max Events */ 29 | 0x05, 0x00, /* Device Tickrate */ 30 | 0xE4, 0x00, 0x04, 0x00, /* Switching Regulator Parameters */ 31 | 0x1B, 0x05, /* Y-Voltage, Z-Voltage */ 32 | 0x00, 0x00, 0x00, 0x00, /* RSVD */ 33 | 0xB1, 0x00, 0xB1, 0x00, 0xB0, 0x40, /* Regulator Timing Parameters */ 34 | 0x2C, 0x40, 0x2C, 0x40, 0x2C, 0x40 /* FreeRun Timing Parameters */ 35 | }; 36 | 37 | /************** AC Filter Coefficients **************/ 38 | 39 | /* AC FXS RF14 600R Normal Coefficients (Default) */ 40 | const VpProfileDataType ABS_AC_600_FXS[] = 41 | { 42 | /* AC Profile */ 43 | 0xA4, 0x00, 0xF4, 0x4C, 0x01, 0x49, 0xCA, 0xF5, 0x98, 0xAA, 0x7B, 0xAB, 44 | 0x2C, 0xA3, 0x25, 0xA5, 0x24, 0xB2, 0x3D, 0x9A, 0x2A, 0xAA, 0xA6, 0x9F, 45 | 0x01, 0x8A, 0x1D, 0x01, 0xA3, 0xA0, 0x2E, 0xB2, 0xB2, 0xBA, 0xAC, 0xA2, 46 | 0xA6, 0xCB, 0x3B, 0x45, 0x88, 0x2A, 0x20, 0x3C, 0xBC, 0x4E, 0xA6, 0x2B, 47 | 0xA5, 0x2B, 0x3E, 0xBA, 0x8F, 0x82, 0xA8, 0x71, 0x80, 0xA9, 0xF0, 0x50, 48 | 0x00, 0x86, 0x2A, 0x42, 0xA1, 0xCB, 0x1B, 0xA3, 0xA8, 0xFB, 0x87, 0xAA, 49 | 0xFB, 0x9F, 0xA9, 0xF0, 0x96, 0x2E, 0x01, 0x00 50 | }; 51 | 52 | /************** DC Feed Parameters **************/ 53 | 54 | /* DC FXS Default -- Use for all countries unless country file exists - 22 mA current feed */ 55 | const VpProfileDataType ABS_DC_22MA_CC[] = 56 | { 57 | /* DC Profile */ 58 | 0x00, 0x01, 0x01, 0x0B, 0x01, 0x08, 0xC2, 0x19, 0x86, 0xAA, 0x02, 0xC6, 59 | 0x11, 0x04, 0x01 60 | }; 61 | 62 | /************** Ring Signal Parameters **************/ 63 | 64 | /* Default Ringing 25Hz 50 Vrms Fixed - Use for all countries unless country file exists */ 65 | const VpProfileDataType ABS_RING_25HZ_SINE[] = 66 | { 67 | /* Sine, 25 Hz, 1.41 CF, 70.00 Vpk, 0.00 Bias */ 68 | /* Ringing Profile */ 69 | 0x00, 0x04, 0x01, 0x12, 0x00, 0x0E, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x44, 70 | 0x3A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00 71 | }; 72 | 73 | /************** Call Progress Tones **************/ 74 | 75 | /************** Cadence Definitions **************/ 76 | 77 | /************** Caller ID **************/ 78 | 79 | /************** Metering Profile **************/ 80 | 81 | /* end of file VE880_ABS_profiles.c */ 82 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_line_test/VE880_ABS_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_ABS_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_ABS_profiles.vpw 8 | * Type: VE880 ABS Configuration for -27/-81V Supply with VBL Regulation, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:43:00 10 | * Device: VE880 Le88266 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef VE880_ABS_PROFILES_H 16 | #define VE880_ABS_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | extern const VpProfileDataType ABS_DEV_PROFILE[]; /* Device Configuration Data - VE880 ABS -27/-81V Power Optimized With Free Run, PCM/MPI Interface */ 27 | 28 | /************** AC Filter Coefficients **************/ 29 | extern const VpProfileDataType ABS_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 30 | 31 | /************** DC Feed Parameters **************/ 32 | extern const VpProfileDataType ABS_DC_22MA_CC[]; /* DC FXS Default -- Use for all countries unless country file exists - 22 mA current feed */ 33 | 34 | /************** Ring Signal Parameters **************/ 35 | extern const VpProfileDataType ABS_RING_25HZ_SINE[]; /* Default Ringing 25Hz 50 Vrms Fixed - Use for all countries unless country file exists */ 36 | 37 | /************** Call Progress Tones **************/ 38 | 39 | /************** Cadence Definitions **************/ 40 | 41 | /************** Caller ID **************/ 42 | 43 | /************** Metering Profile **************/ 44 | 45 | #endif /* VE880_ABS_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_line_test/VE880_FB_profiles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_FB_profiles.c -- 3 | * 4 | * This file contains profile data in byte format 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_FB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Flyback Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:49:08 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #include "VE880_FB_profiles.h" 16 | 17 | 18 | /************** Device Parameters **************/ 19 | 20 | /* Device Configuration Data - VE880 Tracker 100V Flyback, PCM/MPI Interface */ 21 | const VpProfileDataType FB_DEV_PROFILE[] = 22 | { 23 | /* Device Profile for VE880 Device Family */ 24 | 0x00, 0xFF, 0x02, 0x1A, /* Profile Type and Length */ 25 | 0x05, 0x00, /* Version and MPI Command */ 26 | 0x20, 0x00, /* PCLK Frequency */ 27 | 0x8A, 0x00, /* Device Config 1 and MCLK Correction */ 28 | 0x40, 0x02, /* Clock Slot and Max Events */ 29 | 0x05, 0x00, /* Device Tickrate */ 30 | 0xE4, 0x00, 0x04, 0x11, /* Flyback (100V) Switching Regulator Parameters */ 31 | 0x97, 0xFF, 0x95, 0x00, 0x94, 0x40, /* Regulator Timing Parameters */ 32 | 0x14, 0xF6, 0x14, 0x40, 0x14, 0x40 /* FreeRun Timing Parameters */ 33 | }; 34 | 35 | /************** AC Coefficients **************/ 36 | 37 | /* AC FXS RF14 600R Normal Coefficients (Default) */ 38 | const VpProfileDataType FB_AC_600_FXS[] = 39 | { 40 | /* AC Profile */ 41 | 0xA4, 0x00, 0xF4, 0x4C, 0x01, 0x49, 0xCA, 0xF5, 0x98, 0xAA, 0x7B, 0xAB, 42 | 0x2C, 0xA3, 0x25, 0xA5, 0x24, 0xB2, 0x3D, 0x9A, 0x2A, 0xAA, 0xA6, 0x9F, 43 | 0x01, 0x8A, 0x1D, 0x01, 0xA3, 0xA0, 0x2E, 0xB2, 0xB2, 0xBA, 0xAC, 0xA2, 44 | 0xA6, 0xCB, 0x3B, 0x45, 0x88, 0x2A, 0x20, 0x3C, 0xBC, 0x4E, 0xA6, 0x2B, 45 | 0xA5, 0x2B, 0x3E, 0xBA, 0x8F, 0x82, 0xA8, 0x71, 0x80, 0xA9, 0xF0, 0x50, 46 | 0x00, 0x86, 0x2A, 0x42, 0xA1, 0xCB, 0x1B, 0xA3, 0xA8, 0xFB, 0x87, 0xAA, 47 | 0xFB, 0x9F, 0xA9, 0xF0, 0x96, 0x2E, 0x01, 0x00 48 | }; 49 | 50 | /************** DC Feed Parameters **************/ 51 | 52 | /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 53 | const VpProfileDataType FB_DC_25MA_CC[] = 54 | { 55 | /* DC Profile */ 56 | 0x00, 0x01, 0x00, 0x0B, 0x01, 0x08, 0xC2, 0x19, 0x84, 0xB2, 0x07, 0xC6, 57 | 0x33, 0x07, 0x01 58 | }; 59 | 60 | /************** Ring Parameters **************/ 61 | 62 | /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 63 | const VpProfileDataType FB_RING_25HZ_SINE[] = 64 | { 65 | /* Sine, 25 Hz, 1.41 CF, 85.00 Vpk, 0.00 Bias */ 66 | /* Ringing Profile */ 67 | 0x00, 0x04, 0x00, 0x12, 0x00, 0x0E, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x44, 68 | 0x46, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00 69 | }; 70 | 71 | /************** Call Progress Tones **************/ 72 | 73 | /************** Cadence Definitions **************/ 74 | 75 | /************** Caller ID **************/ 76 | 77 | /************** Metering Profile **************/ 78 | 79 | /* end of file VE880_FB_profiles.c */ 80 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_line_test/VE880_FB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_FB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_FB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Flyback Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:49:08 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef VE880_FB_PROFILES_H 16 | #define VE880_FB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | extern const VpProfileDataType FB_DEV_PROFILE[]; /* Device Configuration Data - VE880 Tracker 100V Flyback, PCM/MPI Interface */ 27 | 28 | /************** AC Coefficients **************/ 29 | extern const VpProfileDataType FB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 30 | 31 | /************** DC Feed Parameters **************/ 32 | extern const VpProfileDataType FB_DC_25MA_CC[]; /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 33 | 34 | /************** Ring Parameters **************/ 35 | extern const VpProfileDataType FB_RING_25HZ_SINE[]; /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 36 | 37 | /************** Call Progress Tones **************/ 38 | 39 | /************** Cadence Definitions **************/ 40 | 41 | /************** Caller ID **************/ 42 | 43 | /************** Metering Profile **************/ 44 | 45 | #endif /* VE880_FB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_line_test/VE880_IB_profiles.c: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_IB_profiles.c -- 3 | * 4 | * This file contains profile data in byte format 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_IB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Inverting Boost Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:50:35 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #include "VE880_IB_profiles.h" 16 | 17 | 18 | /************** Device Parameters **************/ 19 | 20 | /* Device Configuration Data - VE880 Tracker 100V Inverting Boost, PCM/MPI Interface */ 21 | const VpProfileDataType IB_DEV_PROFILE[] = 22 | { 23 | /* Device Profile for VE880 Device Family */ 24 | 0x00, 0xFF, 0x02, 0x1A, /* Profile Type and Length */ 25 | 0x05, 0x00, /* Version and MPI Command */ 26 | 0x20, 0x00, /* PCLK Frequency */ 27 | 0x8A, 0x00, /* Device Config 1 and MCLK Correction */ 28 | 0x40, 0x02, /* Clock Slot and Max Events */ 29 | 0x05, 0x00, /* Device Tickrate */ 30 | 0xE4, 0x00, 0x04, 0x11, /* Inverting Boost (100V) Switching Regulator Parameters */ 31 | 0xB3, 0xFF, 0x94, 0x52, 0xD0, 0x52, /* Regulator Timing Parameters */ 32 | 0x20, 0x80, 0x30, 0x52, 0x30, 0x52 /* FreeRun Timing Parameters */ 33 | }; 34 | 35 | /************** AC Coefficients **************/ 36 | 37 | /* AC FXS RF14 600R Normal Coefficients (Default) */ 38 | const VpProfileDataType IB_AC_600_FXS[] = 39 | { 40 | /* AC Profile */ 41 | 0xA4, 0x00, 0xF4, 0x4C, 0x01, 0x49, 0xCA, 0xF5, 0x98, 0xAA, 0x7B, 0xAB, 42 | 0x2C, 0xA3, 0x25, 0xA5, 0x24, 0xB2, 0x3D, 0x9A, 0x2A, 0xAA, 0xA6, 0x9F, 43 | 0x01, 0x8A, 0x1D, 0x01, 0xA3, 0xA0, 0x2E, 0xB2, 0xB2, 0xBA, 0xAC, 0xA2, 44 | 0xA6, 0xCB, 0x3B, 0x45, 0x88, 0x2A, 0x20, 0x3C, 0xBC, 0x4E, 0xA6, 0x2B, 45 | 0xA5, 0x2B, 0x3E, 0xBA, 0x8F, 0x82, 0xA8, 0x71, 0x80, 0xA9, 0xF0, 0x50, 46 | 0x00, 0x86, 0x2A, 0x42, 0xA1, 0xCB, 0x1B, 0xA3, 0xA8, 0xFB, 0x87, 0xAA, 47 | 0xFB, 0x9F, 0xA9, 0xF0, 0x96, 0x2E, 0x01, 0x00 48 | }; 49 | 50 | /************** DC Feed Parameters **************/ 51 | 52 | /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 53 | const VpProfileDataType IB_DC_25MA_CC[] = 54 | { 55 | /* DC Profile */ 56 | 0x00, 0x01, 0x00, 0x0B, 0x01, 0x08, 0xC2, 0x19, 0x84, 0xB2, 0x07, 0xC6, 57 | 0x33, 0x07, 0x01 58 | }; 59 | 60 | /************** Ring Parameters **************/ 61 | 62 | /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 63 | const VpProfileDataType IB_RING_25HZ_SINE[] = 64 | { 65 | /* Sine, 25 Hz, 1.41 CF, 85.00 Vpk, 0.00 Bias */ 66 | /* Ringing Profile */ 67 | 0x00, 0x04, 0x00, 0x12, 0x00, 0x0E, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x44, 68 | 0x46, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00 69 | }; 70 | 71 | /************** Call Progress Tones **************/ 72 | 73 | /************** Cadence Definitions **************/ 74 | 75 | /************** Caller ID **************/ 76 | 77 | /************** Metering Profile **************/ 78 | 79 | /* end of file VE880_IB_profiles.c */ 80 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE880_line_test/VE880_IB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VE880_IB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\VE880_initialization\VE880_IB_profiles.vpw 8 | * Type: VE880 Tracker Configuration for a 100V Inverting Boost Power Supply, Lite Narrowband Coefficients and PCM/MPI Interface at 8.192MHz PCLK 9 | * Date: Tuesday, August 07, 2012 11:50:35 10 | * Device: VE880 Le88506 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef VE880_IB_PROFILES_H 16 | #define VE880_IB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | extern const VpProfileDataType IB_DEV_PROFILE[]; /* Device Configuration Data - VE880 Tracker 100V Inverting Boost, PCM/MPI Interface */ 27 | 28 | /************** AC Coefficients **************/ 29 | extern const VpProfileDataType IB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 30 | 31 | /************** DC Feed Parameters **************/ 32 | extern const VpProfileDataType IB_DC_25MA_CC[]; /* DC FXS Default -- Use for for all countries unless country file exists - 25 mA current feed */ 33 | 34 | /************** Ring Parameters **************/ 35 | extern const VpProfileDataType IB_RING_25HZ_SINE[]; /* Default Ringing 25Hz 60Vrms Tracking - Use for all countries unless country file exists */ 36 | 37 | /************** Call Progress Tones **************/ 38 | 39 | /************** Cadence Definitions **************/ 40 | 41 | /************** Caller ID **************/ 42 | 43 | /************** Metering Profile **************/ 44 | 45 | #endif /* VE880_IB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/VE890_initialization_1FXS_1FXO/Le71HR8923_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Le71HR8923_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * Type: Custom Design Using Zarlink VE890 - Le89336 8 | * Date: Thursday, March 29, 2012 08:41:18 9 | * Device: VE890 Le89336 10 | * 11 | * This file was generated with Profile Wizard Version: B2.0.0-RC1 12 | */ 13 | 14 | #ifndef LE71HR8923_REVA_PROFILES_H 15 | #define LE71HR8923_REVA_PROFILES_H 16 | 17 | #ifdef VP_API_TYPES_H 18 | #include "vp_api_types.h" 19 | #else 20 | typedef unsigned char VpProfileDataType; 21 | #endif 22 | 23 | 24 | /************** Device_Parameters **************/ 25 | extern const VpProfileDataType DEV_PROFILE[]; /* VE8911 Inverting Boost (100V) Device Profile */ 26 | 27 | /************** AC_Coefficients **************/ 28 | extern const VpProfileDataType AC_FXS_600R[]; /* AC FXS RF50 600R Normal Coefficients (Default) */ 29 | extern const VpProfileDataType AC_FXO_LC[]; /* AC FXO LC filter 600 Ohm Normal Coefficients (Default) */ 30 | 31 | /************** DC_Coefficients **************/ 32 | extern const VpProfileDataType DC_25MA_CC[]; /* DC FXS Default -- Use for for all countries unless country file exists */ 33 | 34 | /************** Ring_Parameters **************/ 35 | extern const VpProfileDataType RING_25HZ_SINE[]; /* Ringing 25 Hz 60 Vrms Tracking */ 36 | 37 | /************** Call_Progress_Tones **************/ 38 | 39 | /************** Cadence_Definitions **************/ 40 | 41 | /************** Caller_ID **************/ 42 | 43 | /************** FXO_Dialing_Profile **************/ 44 | extern const VpProfileDataType FXO_DIALING_DEF[]; /* Default FXO/Dialing */ 45 | #endif /* LE71HR892_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/ZL880_initialization/ZLR88621L_ABS_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ZLR88621L_ABS_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\ZL880_initialization\ZLR88621_ABS_profiles.vpw 8 | * Type: Design for ZLR88621L SM2 Line Module Featuring the ZL88601, Lite Coefficients 9 | * Date: Monday, August 06, 2012 17:55:09 10 | * Device: ZL880 ZL88601 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef ZLR88621L_ABS_PROFILES_H 16 | #define ZLR88621L_ABS_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device_Parameters **************/ 26 | extern const VpProfileDataType ABS_DEV_PROFILE[]; /* Device Configuration Data - ZL88601 100V ABS (-81V/-27V) */ 27 | 28 | /************** DC_Parameters **************/ 29 | extern const VpProfileDataType ABS_DC_23MA_CC[]; /* USA DC FXS Parameters - 23mA Current Feed */ 30 | 31 | /************** AC_Coefficients **************/ 32 | extern const VpProfileDataType ABS_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 33 | 34 | /************** Ring_Parameters **************/ 35 | extern const VpProfileDataType ABS_RING_25HZ_SINE[]; /* Ringing 25Hz 50Vrms Fixed, AC Trip */ 36 | 37 | /************** Call_Progress_Tones **************/ 38 | 39 | /************** Cadence_Definitions **************/ 40 | 41 | /************** Caller_ID **************/ 42 | 43 | /************** Metering_Profile **************/ 44 | 45 | #endif /* ZLR88621L_ABS_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/ZL880_initialization/ZLR88721L_FB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ZLR88721L_FB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\ZL880_initialization\ZLR88721L_FB_profiles.vpw 8 | * Type: Design for ZLR88721L SM2 Line Module Featuring the ZL88701, Lite Coefficients 9 | * Date: Monday, August 06, 2012 17:55:23 10 | * Device: ZL880 ZL88701 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef ZLR88721L_FB_PROFILES_H 16 | #define ZLR88721L_FB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Profile **************/ 26 | extern const VpProfileDataType FB_DEV_PROFILE[]; /* Device Configuration Data - ZL88701 Tracker 100V Flyback */ 27 | 28 | /************** DC_Coefficients **************/ 29 | extern const VpProfileDataType FB_DC_25MA_CC[]; /* USA DC FXS Parameters - 25mA Current Feed */ 30 | 31 | /************** AC_Coefficients **************/ 32 | extern const VpProfileDataType FB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 33 | 34 | /************** Ring_Parameters **************/ 35 | extern const VpProfileDataType FB_RING_25HZ_SINE[]; /* Ringing 25Hz 50Vrms Tracking, AC Trip */ 36 | 37 | /************** Call_Progress_Tones **************/ 38 | 39 | /************** Cadence_Definitions **************/ 40 | 41 | /************** Caller_ID **************/ 42 | 43 | /************** Metering_Profile **************/ 44 | 45 | #endif /* ZLR88721L_FB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/ZL880_initialization/ZLR88722L_IB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ZLR88722L_IB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\ZL880_initialization\ZLR88722L_IB_profiles.vpw 8 | * Type: Design for ZLR88722L SM2 Line Module Featuring the ZL88701, Lite Coefficients 9 | * Date: Monday, August 06, 2012 17:54:41 10 | * Device: ZL880 ZL88701 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef ZLR88722L_IB_PROFILES_H 16 | #define ZLR88722L_IB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Profile **************/ 26 | extern const VpProfileDataType IB_DEV_PROFILE[]; /* Device Configuration Data */ 27 | 28 | /************** DC Profile **************/ 29 | extern const VpProfileDataType IB_DC_25MA_CC[]; /* USA DC FXS Parameters - 25mA Current Feed */ 30 | 31 | /************** AC Profile **************/ 32 | extern const VpProfileDataType IB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 33 | 34 | /************** Ringing Profile **************/ 35 | extern const VpProfileDataType IB_RING_25HZ_SINE[]; /* USA Ringing 20Hz 50Vrms Tracking, AC Trip */ 36 | 37 | /************** Tone Profile **************/ 38 | 39 | /************** Cadence Profile **************/ 40 | 41 | /************** Caller ID Profile **************/ 42 | 43 | /************** Metering_Profile **************/ 44 | 45 | #endif /* ZLR88722L_IB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/ZL880_line_test/ZLR88621L_ABS_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ZLR88621L_ABS_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\ZL880_initialization\ZLR88621_ABS_profiles.vpw 8 | * Type: Design for ZLR88621L SM2 Line Module Featuring the ZL88601, Lite Coefficients 9 | * Date: Monday, August 06, 2012 17:55:09 10 | * Device: ZL880 ZL88601 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef ZLR88621L_ABS_PROFILES_H 16 | #define ZLR88621L_ABS_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device_Parameters **************/ 26 | extern const VpProfileDataType ABS_DEV_PROFILE[]; /* Device Configuration Data - ZL88601 100V ABS (-81V/-27V) */ 27 | 28 | /************** DC_Parameters **************/ 29 | extern const VpProfileDataType ABS_DC_23MA_CC[]; /* USA DC FXS Parameters - 23mA Current Feed */ 30 | 31 | /************** AC_Coefficients **************/ 32 | extern const VpProfileDataType ABS_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 33 | 34 | /************** Ring_Parameters **************/ 35 | extern const VpProfileDataType ABS_RING_25HZ_SINE[]; /* Ringing 25Hz 50Vrms Fixed, AC Trip */ 36 | 37 | /************** Call_Progress_Tones **************/ 38 | 39 | /************** Cadence_Definitions **************/ 40 | 41 | /************** Caller_ID **************/ 42 | 43 | /************** Metering_Profile **************/ 44 | 45 | #endif /* ZLR88621L_ABS_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/ZL880_line_test/ZLR88721L_FB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ZLR88721L_FB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\ZL880_initialization\ZLR88721L_FB_profiles.vpw 8 | * Type: Design for ZLR88721L SM2 Line Module Featuring the ZL88701, Lite Coefficients 9 | * Date: Monday, August 06, 2012 17:55:23 10 | * Device: ZL880 ZL88701 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef ZLR88721L_FB_PROFILES_H 16 | #define ZLR88721L_FB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Profile **************/ 26 | extern const VpProfileDataType FB_DEV_PROFILE[]; /* Device Configuration Data - ZL88701 Tracker 100V Flyback */ 27 | 28 | /************** DC_Coefficients **************/ 29 | extern const VpProfileDataType FB_DC_25MA_CC[]; /* USA DC FXS Parameters - 25mA Current Feed */ 30 | 31 | /************** AC_Coefficients **************/ 32 | extern const VpProfileDataType FB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 33 | 34 | /************** Ring_Parameters **************/ 35 | extern const VpProfileDataType FB_RING_25HZ_SINE[]; /* Ringing 25Hz 50Vrms Tracking, AC Trip */ 36 | 37 | /************** Call_Progress_Tones **************/ 38 | 39 | /************** Cadence_Definitions **************/ 40 | 41 | /************** Caller_ID **************/ 42 | 43 | /************** Metering_Profile **************/ 44 | 45 | #endif /* ZLR88721L_FB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/ZL880_line_test/ZLR88722L_IB_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ZLR88722L_IB_profiles.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: X:\shafer\lightning\ztap2012\ztap\applications\quickstarts\sdk_examples\ZL880_initialization\ZLR88722L_IB_profiles.vpw 8 | * Type: Design for ZLR88722L SM2 Line Module Featuring the ZL88701, Lite Coefficients 9 | * Date: Monday, August 06, 2012 17:54:41 10 | * Device: ZL880 ZL88701 11 | * 12 | * This file was generated with Profile Wizard Version: P2.3.0 13 | */ 14 | 15 | #ifndef ZLR88722L_IB_PROFILES_H 16 | #define ZLR88722L_IB_PROFILES_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Profile **************/ 26 | extern const VpProfileDataType IB_DEV_PROFILE[]; /* Device Configuration Data */ 27 | 28 | /************** DC Profile **************/ 29 | extern const VpProfileDataType IB_DC_25MA_CC[]; /* USA DC FXS Parameters - 25mA Current Feed */ 30 | 31 | /************** AC Profile **************/ 32 | extern const VpProfileDataType IB_AC_600_FXS[]; /* AC FXS RF14 600R Normal Coefficients (Default) */ 33 | 34 | /************** Ringing Profile **************/ 35 | extern const VpProfileDataType IB_RING_25HZ_SINE[]; /* USA Ringing 20Hz 50Vrms Tracking, AC Trip */ 36 | 37 | /************** Tone Profile **************/ 38 | 39 | /************** Cadence Profile **************/ 40 | 41 | /************** Caller ID Profile **************/ 42 | 43 | /************** Metering_Profile **************/ 44 | 45 | #endif /* ZLR88722L_IB_PROFILES_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/common/sdk_qs_board.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include /* sleep() */ 6 | 7 | #include "sdk_qs_board.h" 8 | #include "vp_api.h" 9 | #include "sys_service.h" 10 | #include "telecom_lib.h" 11 | 12 | int fpgaDriver = -1; 13 | 14 | 15 | /* This function includes any board-specific initialization that needs to be 16 | done at startup. */ 17 | void 18 | BoardInit( 19 | void) 20 | { 21 | /* Pull down the SLAC's reset signal for 100 ms. */ 22 | if (TelecomLibRegWrite(RESET_CFG_REG, 0x606, 0x600) < 0) { 23 | printf("TelecomLibRegWrite() failed.\n"); 24 | } 25 | usleep(100000); 26 | 27 | /* Raise the SLAC's reset signal and wait 100 ms. */ 28 | if (TelecomLibRegWrite(RESET_CFG_REG, 0x606, 0x606) < 0) { 29 | printf("TelecomLibRegWrite() failed.\n"); 30 | } 31 | usleep(500000); 32 | 33 | /* Initialize semaphore for critical sections: */ 34 | if (VpSysInit() == FALSE) { 35 | printf("VpSysInit() failed.\n"); 36 | } 37 | 38 | /* Open the ZTAP FPGA driver */ 39 | fpgaDriver = open(TELECOM_MOD_FILE_DES, O_RDWR); 40 | if (fpgaDriver == -1) { 41 | printf("Can't open ZTAP FPGA driver, fd \"%s\"", TELECOM_MOD_FILE_DES); 42 | } else { 43 | ioctl(fpgaDriver, TELECOM_MOD_IOCTL_TSA_RESET); 44 | } 45 | 46 | return; 47 | } 48 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/common/sdk_qs_board.h: -------------------------------------------------------------------------------- 1 | #ifndef SDK_QS_BOARD_H 2 | #define SDK_QS_BOARD_H 3 | 4 | extern void BoardInit(void); 5 | 6 | #endif /* SDK_QS_BOARD_H */ 7 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/apps/common/sdk_qs_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef SDK_QS_UTILS_H 2 | #define SDK_QS_UTILS_H 3 | 4 | #include "vp_api.h" 5 | 6 | #define QS_DEBUG printf 7 | 8 | extern char* 9 | MapStatus( 10 | VpStatusType status); 11 | 12 | extern void 13 | UtilPrintEvent( 14 | VpEventType *pEvent); 15 | 16 | #endif /* SDK_QS_UTILS_H */ 17 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/examples/hbi_hal.h: -------------------------------------------------------------------------------- 1 | /* hbi_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. Porting the VoicePath API to a new host processor 6 | * consists of modifying the typedefs in this file, setting the HBI_PINCONFIG 7 | * define below, and modifying the function implementations in vp_hal.c. 8 | * 9 | * Copyright (c) 2011, Microsemi Corporation 10 | */ 11 | #ifndef HBI_HAL_H 12 | #define HBI_HAL_H 13 | #include "vp_api_types.h" 14 | /* Define the EXTERN macro, if necessary */ 15 | #ifndef EXTERN 16 | #ifdef __cplusplus 17 | #define EXTERN extern "C" 18 | #else 19 | #define EXTERN extern 20 | #endif /* __cplusplus */ 21 | #endif /* EXTERN */ 22 | /****************************************************************************** 23 | * PLATFORM-SPECIFIC OPTIONS * 24 | ******************************************************************************/ 25 | /* HBI configuration register */ 26 | #define HBI_CFG_ENDLITTLE 0 /* 1=byte swapping for data words only */ 27 | #define HBI_CFG_PWAIT_POLHI 0 /* 0=PWAIT pin active low, 1=PWAIT pin active high */ 28 | #define HBI_CFG_PWAIT_EN 0 /* 0=PWAIT pin disabled, 1=PWAIT pin enabled */ 29 | #define HBI_CFG_PWAIT_MODEOSD 0 /* 0=PWAIT pin TTL, 1=PWAIT pin open source/drain */ 30 | #define HBI_CFG_INT_MODETTL 1 /* 0=INT pin open drain, 1=INT pin TTL */ 31 | #define HBI_CFG_PINEA 0 /* 0=IO[2:0], 1=EA[10:8] */ 32 | #define HBI_PINCONFIG (HBI_CFG_ENDLITTLE | (HBI_CFG_PWAIT_POLHI << 1) | (HBI_CFG_PWAIT_EN << 2) | (HBI_CFG_PWAIT_MODEOSD << 3) | (HBI_CFG_INT_MODETTL << 4) | (HBI_CFG_PINEA << 5)) 33 | #define HBI_CMD_CONFIGURE_INT 0xFD00 34 | #define DEFAULT_DEVICE_ID 0 35 | /****************************************************************************** 36 | * PLATFORM-SPECIFIC FUNCTIONS * 37 | ******************************************************************************/ 38 | /* See vp_hal.c for descriptions. */ 39 | EXTERN bool VpHalHbiInit(VpDeviceIdType deviceId); 40 | EXTERN bool VpHalHbiCmd(VpDeviceIdType deviceId, uint16 cmd); 41 | EXTERN bool VpHalHbiWrite(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 42 | EXTERN bool VpHalHbiRead(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 43 | EXTERN bool VpHalHbiBootWr(VpDeviceIdType deviceId, uint8 numwords, VpImagePtrType data); 44 | #endif /* HBI_HAL_H */ 45 | 46 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/examples/mpi_hal.h: -------------------------------------------------------------------------------- 1 | /** \file mpi_hal.h 2 | * mpi_hal.h 3 | * 4 | * Header file for the VP-API-II c files requiring MPI interface. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef MPI_UVB_HAL_H 9 | #define MPI_UVB_HAL_H 10 | #include "vp_api_types.h" 11 | 12 | EXTERN void 13 | VpMpiCmd( 14 | VpDeviceIdType deviceId, 15 | uint8 ecVal, 16 | uint8 cmd, 17 | uint8 cmdLen, 18 | uint8 *dataPtr); 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/examples/sys_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sys_service.h 3 | * 4 | * This file is the header for all standard types used in the API code. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef SYS_SERVICE_H 9 | #define SYS_SERVICE_H 10 | #include "vp_api_types.h" 11 | /* Critical section types */ 12 | typedef enum { 13 | VP_MPI_CRITICAL_SEC, /* MPI access critical code section */ 14 | VP_HBI_CRITICAL_SEC, /* HBI access critical code section */ 15 | VP_CODE_CRITICAL_SEC, /* Critical code section */ 16 | VP_NUM_CRITICAL_SEC_TYPES, /* The number of critical section types */ 17 | VP_CRITICAL_SEC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */ 18 | } VpCriticalSecType; 19 | 20 | EXTERN uint8 21 | VpSysEnterCritical( 22 | VpDeviceIdType deviceId, 23 | VpCriticalSecType criticalSecType); 24 | 25 | EXTERN uint8 26 | VpSysExitCritical( 27 | VpDeviceIdType deviceId, 28 | VpCriticalSecType criticalSecType); 29 | 30 | EXTERN void 31 | VpSysWait( 32 | uint8 time); 33 | 34 | EXTERN void 35 | VpSysDisableInt( 36 | VpDeviceIdType deviceId); 37 | 38 | EXTERN void 39 | VpSysEnableInt( 40 | VpDeviceIdType deviceId); 41 | 42 | EXTERN bool 43 | VpSysTestInt( 44 | VpDeviceIdType deviceId); 45 | 46 | EXTERN void 47 | VpSysDtmfDetEnable( 48 | VpDeviceIdType deviceId, 49 | uint8 channelId); 50 | 51 | EXTERN void 52 | VpSysDtmfDetDisable( 53 | VpDeviceIdType deviceId, 54 | uint8 channelId); 55 | 56 | EXTERN void * 57 | VpSysTestHeapAcquire( 58 | uint8 *pHeapId); 59 | 60 | EXTERN bool 61 | VpSysTestHeapRelease( 62 | uint8 heapId); 63 | 64 | EXTERN void 65 | VpSysPcmCollectAndProcess( 66 | void *pLineCtx, 67 | VpDeviceIdType deviceId, 68 | uint8 channelId, 69 | uint8 startTimeslot, 70 | uint16 operationTime, 71 | uint16 settlingTime, 72 | uint16 operationMask); 73 | 74 | /* Enable the XML tag debug output */ 75 | #undef ENABLE_DBG_TAG 76 | 77 | #include 78 | #ifdef ENABLE_DBG_TAG 79 | #include 80 | EXTERN int 81 | VpSysDebugPrintf( 82 | const char *format, ...); 83 | #else 84 | #define VpSysDebugPrintf printf 85 | #endif /* ENABLE_DBG_TAG */ 86 | 87 | #endif /* SYS_SERVICE_H */ 88 | 89 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/examples/vp_api_profile_type.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_profile_type.h 2 | * vp_api_profile_type.h 3 | * 4 | * Header file for the VpProfileDataType typedef. If using the API "apitypes", 5 | * this file is automatically included. Otherwise, this type is defined in the 6 | * header file output from the Profile Wizard (app should include). 7 | * 8 | * Copyright (c) 2011, Microsemi Corporation 9 | */ 10 | #ifndef API_PROFILE_TYPE_H 11 | #define API_PROFILE_TYPE_H 12 | typedef unsigned char VpProfileDataType; 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/examples/vp_hal.h: -------------------------------------------------------------------------------- 1 | /* vp_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. The functions are defined in ve_hal.c. Porting the 6 | * VoicePath API to a new host processor consists of modifying the typedefs 7 | * in this file, setting the HBI_PINCONFIG define below, and modifying the 8 | * function implementations in vp_hal.c. 9 | * 10 | * Copyright (c) 2011, Microsemi Corporation 11 | */ 12 | #ifndef _VP_HAL_H 13 | #define _VP_HAL_H 14 | #include "vp_api_types.h" 15 | #include "hbi_hal.h" 16 | #include "mpi_hal.h" 17 | #include "sys_service.h" 18 | #endif /* _VP_HAL_H */ 19 | 20 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/hbi_hal.h: -------------------------------------------------------------------------------- 1 | /* hbi_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. Porting the VoicePath API to a new host processor 6 | * consists of modifying the typedefs in this file, setting the HBI_PINCONFIG 7 | * define below, and modifying the function implementations in vp_hal.c. 8 | * 9 | * Copyright (c) 2011, Microsemi Corporation 10 | */ 11 | #ifndef HBI_HAL_H 12 | #define HBI_HAL_H 13 | #include "vp_api_types.h" 14 | /* Define the EXTERN macro, if necessary */ 15 | #ifndef EXTERN 16 | #ifdef __cplusplus 17 | #define EXTERN extern "C" 18 | #else 19 | #define EXTERN extern 20 | #endif /* __cplusplus */ 21 | #endif /* EXTERN */ 22 | /****************************************************************************** 23 | * PLATFORM-SPECIFIC OPTIONS * 24 | ******************************************************************************/ 25 | /* HBI configuration register */ 26 | #define HBI_CFG_ENDLITTLE 0 /* 1=byte swapping for data words only */ 27 | #define HBI_CFG_PWAIT_POLHI 0 /* 0=PWAIT pin active low, 1=PWAIT pin active high */ 28 | #define HBI_CFG_PWAIT_EN 0 /* 0=PWAIT pin disabled, 1=PWAIT pin enabled */ 29 | #define HBI_CFG_PWAIT_MODEOSD 0 /* 0=PWAIT pin TTL, 1=PWAIT pin open source/drain */ 30 | #define HBI_CFG_INT_MODETTL 1 /* 0=INT pin open drain, 1=INT pin TTL */ 31 | #define HBI_CFG_PINEA 0 /* 0=IO[2:0], 1=EA[10:8] */ 32 | #define HBI_PINCONFIG (HBI_CFG_ENDLITTLE | (HBI_CFG_PWAIT_POLHI << 1) | (HBI_CFG_PWAIT_EN << 2) | (HBI_CFG_PWAIT_MODEOSD << 3) | (HBI_CFG_INT_MODETTL << 4) | (HBI_CFG_PINEA << 5)) 33 | #define HBI_CMD_CONFIGURE_INT 0xFD00 34 | #define DEFAULT_DEVICE_ID 0 35 | /****************************************************************************** 36 | * PLATFORM-SPECIFIC FUNCTIONS * 37 | ******************************************************************************/ 38 | /* See vp_hal.c for descriptions. */ 39 | EXTERN bool VpHalHbiInit(VpDeviceIdType deviceId); 40 | EXTERN bool VpHalHbi(VpDeviceIdType deviceId, bool isWordData, bool isWrite, uint16p data); 41 | EXTERN bool VpHalHbiCmd(VpDeviceIdType deviceId, uint16 cmd); 42 | EXTERN bool VpHalHbiWrite(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 43 | EXTERN bool VpHalHbiRead(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 44 | EXTERN bool VpHalHbiBootWr(VpDeviceIdType deviceId, uint8 numwords, VpImagePtrType data); 45 | #endif /* HBI_HAL_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/mpi_hal.h: -------------------------------------------------------------------------------- 1 | /** \file mpi_hal.h 2 | * mpi_hal.h 3 | * 4 | * Header file for the VP-API-II c files requiring MPI interface. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef MPI_UVB_HAL_H 9 | #define MPI_UVB_HAL_H 10 | #include "vp_api_types.h" 11 | 12 | EXTERN void 13 | VpMpiCmd( 14 | VpDeviceIdType deviceId, 15 | uint8 ecVal, 16 | uint8 cmd, 17 | uint8 cmdLen, 18 | uint8 *dataPtr); 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/sys_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sys_service.h 3 | * 4 | * This file is the header for all standard types used in the API code. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef SYS_SERVICE_H 9 | #define SYS_SERVICE_H 10 | #include "vp_api_types.h" 11 | 12 | /* Critical section types */ 13 | typedef enum { 14 | VP_MPI_CRITICAL_SEC, /* MPI access critical code section */ 15 | VP_HBI_CRITICAL_SEC, /* HBI access critical code section */ 16 | VP_CODE_CRITICAL_SEC, /* Critical code section */ 17 | VP_NUM_CRITICAL_SEC_TYPES, /* The number of critical section types */ 18 | VP_CRITICAL_SEC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */ 19 | } VpCriticalSecType; 20 | 21 | EXTERN void 22 | VpSysServiceInit(void); 23 | 24 | EXTERN void 25 | VpSysServiceToggleLed( 26 | uint8 ledNum); 27 | 28 | EXTERN uint8 29 | VpSysEnterCritical( 30 | VpDeviceIdType deviceId, 31 | VpCriticalSecType criticalSecType); 32 | 33 | EXTERN uint8 34 | VpSysExitCritical( 35 | VpDeviceIdType deviceId, 36 | VpCriticalSecType criticalSecType); 37 | 38 | EXTERN void 39 | VpSysWait( 40 | uint8 time); 41 | 42 | EXTERN void 43 | VpSysDisableInt( 44 | VpDeviceIdType deviceId); 45 | 46 | EXTERN void 47 | VpSysEnableInt( 48 | VpDeviceIdType deviceId); 49 | 50 | EXTERN bool 51 | VpSysTestInt( 52 | VpDeviceIdType deviceId); 53 | 54 | EXTERN void 55 | VpSysDtmfDetEnable( 56 | VpDeviceIdType deviceId, 57 | uint8 channelId); 58 | 59 | EXTERN void 60 | VpSysDtmfDetDisable( 61 | VpDeviceIdType deviceId, 62 | uint8 channelId); 63 | 64 | EXTERN void * 65 | VpSysTestHeapAcquire( 66 | uint8 *pHeapId); 67 | 68 | EXTERN bool 69 | VpSysTestHeapRelease( 70 | uint8 heapId); 71 | 72 | EXTERN void 73 | VpSysPcmCollectAndProcess( 74 | void *pLineCtx, 75 | VpDeviceIdType deviceId, 76 | uint8 channelId, 77 | uint8 startTimeslot, 78 | uint16 operationTime, 79 | uint16 settlingTime, 80 | uint16 operationMask); 81 | 82 | #ifdef __KERNEL__ 83 | #define VpSysDebugPrintf printk 84 | #else 85 | #include 86 | #define VpSysDebugPrintf printf 87 | #endif 88 | 89 | #endif /* SYS_SERVICE_H */ 90 | 91 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/vp_api_profile_type.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_profile_type.h 2 | * vp_api_profile_type.h 3 | * 4 | * Header file for the VpProfileDataType typedef. If using the API "apitypes", 5 | * this file is automatically included. Otherwise, this type is defined in the 6 | * header file output from the Profile Wizard (app should include). 7 | * 8 | * Copyright (c) 2011, Microsemi Corporation 9 | */ 10 | #ifndef API_PROFILE_TYPE_H 11 | #define API_PROFILE_TYPE_H 12 | typedef unsigned char VpProfileDataType; 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/vp_firmware.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef MODULE 3 | 4 | #include 5 | #include /* loacation copy_xyz_user*/ 6 | #include /* kmalloc and kfree */ 7 | 8 | #include "vp_api_types.h" 9 | 10 | 11 | #ifdef ZARLINK_CFG_INTERNAL 12 | #include "vp_firmware.h" 13 | VpApiMod792FirmwareType g792Firmware = {NULL, 0}; 14 | 15 | extern int VpApiIoctl792Firmware ( 16 | unsigned long arg) 17 | { 18 | VpApiMod792FirmWareType firmwareInfo; 19 | 20 | /* copy info from user space */ 21 | unsigned long cu = copy_from_user( &firmwareInfo, (void*)arg, sizeof(VpApiMod792FirmWareType) ); 22 | 23 | /* decide if we are storing or freeing a 792 firmware image */ 24 | if (firmwareInfo.size && firmwareInfo.pImage && !cu) { 25 | uint16 *pImage = kmalloc( (sizeof(uint16) * firmwareInfo.size) , GFP_KERNEL); 26 | 27 | if (pImage == NULL) { 28 | printk("no mem\n"); 29 | return -1; 30 | } 31 | 32 | if (firmwareInfo.pImage == NULL) { 33 | printk("no image\n"); 34 | return -1; 35 | } 36 | 37 | memcpy(pImage, firmwareInfo.pImage, (sizeof(uint16) * firmwareInfo.size)); 38 | g792Firmware.pImage = pImage; 39 | g792Firmware.length = firmwareInfo.size; 40 | } else { 41 | if (g792Firmware.pImage == NULL) { 42 | return 0; 43 | } 44 | 45 | kfree(g792Firmware.pImage); 46 | g792Firmware.pImage = NULL; 47 | } 48 | 49 | return 0; 50 | } 51 | 52 | 53 | #endif /* ZARLINK_CFG_INTERNAL */ 54 | #endif /* MODULE */ 55 | 56 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/vp_firmware.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef VP_FIRMWARE_H 3 | #define VP_FIRMWARE_H 4 | 5 | #ifdef ZARLINK_CFG_INTERNAL 6 | 7 | typedef struct { 8 | uint16 *pImage; 9 | uint32 length; 10 | } VpApiMod792FirmwareType; 11 | 12 | typedef struct VpApiMod792Image { 13 | uint16 *pImage; 14 | uint32 size; 15 | 16 | } VpApiMod792FirmWareType; 17 | 18 | extern int VpApiIoctl792Firmware ( 19 | unsigned long arg); 20 | 21 | 22 | extern VpApiMod792FirmwareType g792Firmware; 23 | #endif 24 | 25 | #endif /* ZARLINK_CFG_INTERNAL */ 26 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/kernel/vp_hal.h: -------------------------------------------------------------------------------- 1 | /* vp_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. The functions are defined in ve_hal.c. Porting the 6 | * VoicePath API to a new host processor consists of modifying the typedefs 7 | * in this file, setting the HBI_PINCONFIG define below, and modifying the 8 | * function implementations in vp_hal.c. 9 | * 10 | * Copyright (c) 2011, Microsemi Corporation 11 | */ 12 | #ifndef _VP_HAL_H 13 | #define _VP_HAL_H 14 | #include "vp_api_types.h" 15 | #include "hbi_hal.h" 16 | #include "mpi_hal.h" 17 | #include "sys_service.h" 18 | #endif /* _VP_HAL_H */ 19 | 20 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/userspace/hbi_hal.h: -------------------------------------------------------------------------------- 1 | /* hbi_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. Porting the VoicePath API to a new host processor 6 | * consists of modifying the typedefs in this file, setting the HBI_PINCONFIG 7 | * define below, and modifying the function implementations in vp_hal.c. 8 | * 9 | * Copyright (c) 2011, Microsemi Corporation 10 | */ 11 | #ifndef HBI_HAL_H 12 | #define HBI_HAL_H 13 | #include "vp_api_types.h" 14 | /* Define the EXTERN macro, if necessary */ 15 | #ifndef EXTERN 16 | #ifdef __cplusplus 17 | #define EXTERN extern "C" 18 | #else 19 | #define EXTERN extern 20 | #endif /* __cplusplus */ 21 | #endif /* EXTERN */ 22 | /****************************************************************************** 23 | * PLATFORM-SPECIFIC OPTIONS * 24 | ******************************************************************************/ 25 | /* HBI configuration register */ 26 | #define HBI_CFG_ENDLITTLE 0 /* 1=byte swapping for data words only */ 27 | #define HBI_CFG_PWAIT_POLHI 0 /* 0=PWAIT pin active low, 1=PWAIT pin active high */ 28 | #define HBI_CFG_PWAIT_EN 0 /* 0=PWAIT pin disabled, 1=PWAIT pin enabled */ 29 | #define HBI_CFG_PWAIT_MODEOSD 0 /* 0=PWAIT pin TTL, 1=PWAIT pin open source/drain */ 30 | #define HBI_CFG_INT_MODETTL 1 /* 0=INT pin open drain, 1=INT pin TTL */ 31 | #define HBI_CFG_PINEA 0 /* 0=IO[2:0], 1=EA[10:8] */ 32 | #define HBI_PINCONFIG (HBI_CFG_ENDLITTLE | (HBI_CFG_PWAIT_POLHI << 1) | (HBI_CFG_PWAIT_EN << 2) | (HBI_CFG_PWAIT_MODEOSD << 3) | (HBI_CFG_INT_MODETTL << 4) | (HBI_CFG_PINEA << 5)) 33 | #define HBI_CMD_CONFIGURE_INT 0xFD00 34 | #define DEFAULT_DEVICE_ID 0 35 | /****************************************************************************** 36 | * PLATFORM-SPECIFIC FUNCTIONS * 37 | ******************************************************************************/ 38 | /* See vp_hal.c for descriptions. */ 39 | EXTERN bool VpHalHbiInit(VpDeviceIdType deviceId); 40 | EXTERN bool VpHalHbi(VpDeviceIdType deviceId, bool isWordData, bool isWrite, uint16p data); 41 | EXTERN bool VpHalHbiCmd(VpDeviceIdType deviceId, uint16 cmd); 42 | EXTERN bool VpHalHbiWrite(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 43 | EXTERN bool VpHalHbiRead(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 44 | EXTERN bool VpHalHbiBootWr(VpDeviceIdType deviceId, uint8 numwords, VpImagePtrType data); 45 | #endif /* HBI_HAL_H */ 46 | 47 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/userspace/mpi_hal.h: -------------------------------------------------------------------------------- 1 | /** \file mpi_hal.h 2 | * mpi_hal.h 3 | * 4 | * Header file for the VP-API-II c files requiring MPI interface. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef MPI_UVB_HAL_H 9 | #define MPI_UVB_HAL_H 10 | #include "vp_api_types.h" 11 | 12 | EXTERN void 13 | VpMpiCmd( 14 | VpDeviceIdType deviceId, 15 | uint8 ecVal, 16 | uint8 cmd, 17 | uint8 cmdLen, 18 | uint8 *dataPtr); 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/userspace/sys_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sys_service.h 3 | * 4 | * This file is the header for all standard types used in the API code. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef SYS_SERVICE_H 9 | #define SYS_SERVICE_H 10 | 11 | #include "vp_api_types.h" 12 | 13 | /* Critical section types */ 14 | typedef enum { 15 | VP_MPI_CRITICAL_SEC, /* MPI access critical code section */ 16 | VP_HBI_CRITICAL_SEC, /* HBI access critical code section */ 17 | VP_CODE_CRITICAL_SEC, /* Critical code section */ 18 | VP_NUM_CRITICAL_SEC_TYPES, /* The number of critical section types */ 19 | VP_CRITICAL_SEC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */ 20 | } VpCriticalSecType; 21 | 22 | EXTERN bool 23 | VpSysInit(void); 24 | 25 | EXTERN void 26 | VpSysServiceToggleLed( 27 | uint8 ledNum); 28 | 29 | EXTERN uint8 30 | VpSysEnterCritical( 31 | VpDeviceIdType deviceId, 32 | VpCriticalSecType criticalSecType); 33 | 34 | EXTERN uint8 35 | VpSysExitCritical( 36 | VpDeviceIdType deviceId, 37 | VpCriticalSecType criticalSecType); 38 | 39 | EXTERN void 40 | VpSysWait( 41 | uint8 time); 42 | 43 | EXTERN void 44 | VpSysDisableInt( 45 | VpDeviceIdType deviceId); 46 | 47 | EXTERN void 48 | VpSysEnableInt( 49 | VpDeviceIdType deviceId); 50 | 51 | EXTERN bool 52 | VpSysTestInt( 53 | VpDeviceIdType deviceId); 54 | 55 | EXTERN void 56 | VpSysDtmfDetEnable( 57 | VpDeviceIdType deviceId, 58 | uint8 channelId); 59 | 60 | EXTERN void 61 | VpSysDtmfDetDisable( 62 | VpDeviceIdType deviceId, 63 | uint8 channelId); 64 | 65 | EXTERN void * 66 | VpSysTestHeapAcquire( 67 | uint8 *pHeapId); 68 | 69 | EXTERN bool 70 | VpSysTestHeapRelease( 71 | uint8 heapId); 72 | 73 | EXTERN void 74 | VpSysPcmCollectAndProcess( 75 | void *pLineCtx, 76 | VpDeviceIdType deviceId, 77 | uint8 channelId, 78 | uint8 startTimeslot, 79 | uint16 operationTime, 80 | uint16 settlingTime, 81 | uint16 operationMask); 82 | 83 | #ifdef __KERNEL__ 84 | #define VpSysDebugPrintf printk 85 | #else 86 | #include 87 | #define VpSysDebugPrintf printf 88 | #endif 89 | 90 | #endif /* SYS_SERVICE_H */ 91 | 92 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/userspace/vp_api_profile_type.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_profile_type.h 2 | * vp_api_profile_type.h 3 | * 4 | * Header file for the VpProfileDataType typedef. If using the API "apitypes", 5 | * this file is automatically included. Otherwise, this type is defined in the 6 | * header file output from the Profile Wizard (app should include). 7 | * 8 | * Copyright (c) 2011, Microsemi Corporation 9 | */ 10 | #ifndef API_PROFILE_TYPE_H 11 | #define API_PROFILE_TYPE_H 12 | typedef unsigned char VpProfileDataType; 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/arch/ztap/userspace/vp_hal.h: -------------------------------------------------------------------------------- 1 | /* vp_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. The functions are defined in ve_hal.c. Porting the 6 | * VoicePath API to a new host processor consists of modifying the typedefs 7 | * in this file, setting the HBI_PINCONFIG define below, and modifying the 8 | * function implementations in vp_hal.c. 9 | * 10 | * Copyright (c) 2011, Microsemi Corporation 11 | */ 12 | #ifndef _VP_HAL_H 13 | #define _VP_HAL_H 14 | #include "vp_api_types.h" 15 | #include "hbi_hal.h" 16 | #include "mpi_hal.h" 17 | #include "sys_service.h" 18 | #endif /* _VP_HAL_H */ 19 | 20 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88621_ABS/ZLR88621H_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88621_ABS/ZLR88621H_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88621_ABS/ZLR88621L_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88621_ABS/ZLR88621L_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88721_Tracker_FB/ZLR88721H_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88721_Tracker_FB/ZLR88721H_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88721_Tracker_FB/ZLR88721L_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88721_Tracker_FB/ZLR88721L_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88722_Tracker_IB/ZLR88722L_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88722_Tracker_IB/ZLR88722L_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88821_Shared_Tracker/ZLR88821_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88821_Shared_Tracker/ZLR88821_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88822_BB_ABS/ZLR88822_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/ZL880/ZLR88822_BB_ABS/ZLR88822_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96621_ABS/ZLR96621L_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96621_ABS/ZLR96621L_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96622_BB_ABS/ZLR96622_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96622_BB_ABS/ZLR96622_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96721_Tracker_FB/ZLR96721H_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96721_Tracker_FB/ZLR96721H_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96722_Tracker_IB/ZLR96722L_SM2_LITE.vpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/coefficient_sets/miSLIC/ZLR96722_Tracker_IB/ZLR96722L_SM2_LITE.vpw -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/documents/VP_API_II_An_Applications_Perspective_Rev1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/documents/VP_API_II_An_Applications_Perspective_Rev1.pdf -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/documents/VP_Api_CSLAC_Rev20.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/documents/VP_Api_CSLAC_Rev20.pdf -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/documents/VP_Api_ZL880-miSLIC_Rev8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/documents/VP_Api_ZL880-miSLIC_Rev8.pdf -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/release_notes/EN_LE71SDKAPIL-P2.24.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/2.24.0.lite/release_notes/EN_LE71SDKAPIL-P2.24.0.pdf -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/2.24.0.lite/release_notes/ReadMeFirst.txt: -------------------------------------------------------------------------------- 1 | Microsemi Corporation VP-API-II (LE71SDKAPIL), version P2.24.0 2 | 3 | Release Notes 4 | Nov 17 2014 5 | Copyright (c) 2014 Microsemi Corporation 6 | 7 | Descriptions of the files included in this release are below: 8 | ============================================================= 9 | NOTES: The selection of files installed in the following directories is 10 | dependent on the device family selection made during the installation 11 | process. 12 | 13 | Install Folder\release_notes\ 14 | Contains the "Release and Errata" notes for this release. 15 | 16 | Install Folder\documents\ 17 | Contains VP-API documentation. Please review the necessary documentation 18 | carefully before making use of VP-API. 19 | 20 | Install Folder\api_lib\ 21 | VP-API Library. 22 | 23 | Install Folder\apps\ 24 | Applications built on VP-API. These applications provide the basic 25 | steps necessary to develop an application using the VP-API-II. 26 | 27 | Install Folder\coefficient_sets\VE880 (if VE880 is included in installation) 28 | Contains approved coefficients for VE880 reference designs. 29 | 30 | Install Folder\coefficient_sets\VE890 (if VE890 is included in installation) 31 | Contains approved coefficients for VE890 reference designs. 32 | 33 | Install Folder\coefficient_sets\ZL880 (if ZL880 is included in installation) 34 | Contains approved coefficients for ZL880 reference designs. 35 | 36 | Install Folder\arch\ 37 | Contains example implementations of Hardware Abstraction Layer and 38 | System Services layer. 39 | 40 | api_lib directory 41 | ================= 42 | Install Folder\api_lib\includes\ 43 | Contains the include files necessary for importing VP-API library. It 44 | is typically sufficient if applications include vp_api.h in their 45 | programs. This file brings all the necessary definitions for making use 46 | of VP_API. It is sufficient to have an include path for just this 47 | directory. 48 | 49 | Install Folder\api_lib\includes\vp_api_cfg.h 50 | This is the most important file the users will have to carefully review 51 | and configure. This file determines various compile time options that 52 | the VP-API makes use of. 53 | 54 | The support for libraries is also determined in this file. By default 55 | installation comes with all libraries DISABLED. Users should enable the 56 | necessary libraries by defining necessary conditional flags. 57 | 58 | Install Folder\api_lib\common\ 59 | Includes necessary files to support common functions of the VP-API. 60 | 61 | Install Folder\api_lib\vp886_api\ 62 | Includes necessary files to support ZL880 series devices. 63 | 64 | Install Folder\api_lib\vp890_api\ 65 | Includes necessary files to support VE890 series devices. 66 | 67 | Install Folder\api_lib\vp880_api\ 68 | Includes necessary files to support VE880 series devices. 69 | 70 | Install Folder\api_lib\vp790_api\ 71 | Includes necessary files to support VE790 series devices. 72 | 73 | Install Folder\api_lib\vp580_api\ 74 | Includes necessary files to support VE580 series devices. 75 | 76 | apps directory 77 | ============== 78 | This directory contains applications that are tested on Microsemi Voice 79 | platforms. Users should be able to port these applications to their 80 | platforms with minimal modifications. Typically the directories contain 81 | documentation that describes the application. 82 | 83 | arch directory 84 | ============== 85 | This directory contains example implementations of Hardware 86 | Abstraction Layer (HAL) and System Services Layer (SS) implementation. It 87 | also contains skeleton files to be filled in by the customer. 88 | 89 | Users of VP-API will need to develop HAL and SS layers as applicable to 90 | to the hardware and software environments they are working. 91 | 92 | 93 | All technical details of this release described in the "Release and Errata Notice" 94 | found in directory "install_dir\release_notes". -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/Le88221-241.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/Le88221-241.pdf -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/Le88266-286.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/bcm63xx-phone/src/extern/zarlink/Le88266-286.pdf -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/arch/bcm63xx/hbi_hal.h: -------------------------------------------------------------------------------- 1 | /* hbi_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. Porting the VoicePath API to a new host processor 6 | * consists of modifying the typedefs in this file, setting the HBI_PINCONFIG 7 | * define below, and modifying the function implementations in vp_hal.c. 8 | * 9 | * Copyright (c) 2011, Microsemi Corporation 10 | */ 11 | #ifndef HBI_HAL_H 12 | #define HBI_HAL_H 13 | #include "vp_api_types.h" 14 | /* Define the EXTERN macro, if necessary */ 15 | #ifndef EXTERN 16 | #ifdef __cplusplus 17 | #define EXTERN extern "C" 18 | #else 19 | #define EXTERN extern 20 | #endif /* __cplusplus */ 21 | #endif /* EXTERN */ 22 | /****************************************************************************** 23 | * PLATFORM-SPECIFIC OPTIONS * 24 | ******************************************************************************/ 25 | /* HBI configuration register */ 26 | #define HBI_CFG_ENDLITTLE 0 /* 1=byte swapping for data words only */ 27 | #define HBI_CFG_PWAIT_POLHI 0 /* 0=PWAIT pin active low, 1=PWAIT pin active high */ 28 | #define HBI_CFG_PWAIT_EN 0 /* 0=PWAIT pin disabled, 1=PWAIT pin enabled */ 29 | #define HBI_CFG_PWAIT_MODEOSD 0 /* 0=PWAIT pin TTL, 1=PWAIT pin open source/drain */ 30 | #define HBI_CFG_INT_MODETTL 1 /* 0=INT pin open drain, 1=INT pin TTL */ 31 | #define HBI_CFG_PINEA 0 /* 0=IO[2:0], 1=EA[10:8] */ 32 | #define HBI_PINCONFIG (HBI_CFG_ENDLITTLE | (HBI_CFG_PWAIT_POLHI << 1) | (HBI_CFG_PWAIT_EN << 2) | (HBI_CFG_PWAIT_MODEOSD << 3) | (HBI_CFG_INT_MODETTL << 4) | (HBI_CFG_PINEA << 5)) 33 | #define HBI_CMD_CONFIGURE_INT 0xFD00 34 | #define DEFAULT_DEVICE_ID 0 35 | /****************************************************************************** 36 | * PLATFORM-SPECIFIC FUNCTIONS * 37 | ******************************************************************************/ 38 | /* See vp_hal.c for descriptions. */ 39 | EXTERN bool VpHalHbiInit(VpDeviceIdType deviceId); 40 | EXTERN bool VpHalHbiCmd(VpDeviceIdType deviceId, uint16 cmd); 41 | EXTERN bool VpHalHbiWrite(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 42 | EXTERN bool VpHalHbiRead(VpDeviceIdType deviceId, uint16 cmd, uint8 numwords, uint16p data); 43 | EXTERN bool VpHalHbiBootWr(VpDeviceIdType deviceId, uint8 numwords, VpImagePtrType data); 44 | #endif /* HBI_HAL_H */ 45 | 46 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/arch/bcm63xx/mpi_hal.h: -------------------------------------------------------------------------------- 1 | /** \file mpi_hal.h 2 | * mpi_hal.h 3 | * 4 | * Header file for the VP-API-II c files requiring MPI interface. 5 | * 6 | * Copyright (c) 2008, Zarlink Semiconductor, Inc. 7 | */ 8 | #ifndef MPI_UVB_HAL_H 9 | #define MPI_UVB_HAL_H 10 | #include "vp_api_types.h" 11 | /* 12 | * The API header is needed to define the Device Types used by the API to know 13 | * how to implement VpMpiReset 14 | */ 15 | #include "vp_api_dev_term.h" 16 | 17 | EXTERN void 18 | VpMpiCmd( 19 | VpDeviceIdType deviceId, 20 | uint8 ecVal, 21 | uint8 cmd, 22 | uint8 cmdLen, 23 | uint8 *dataPtr); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/arch/bcm63xx/sys_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sys_service.h 3 | * 4 | * This file is the header for all standard types used in the API code. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef SYS_SERVICE_H 9 | #define SYS_SERVICE_H 10 | #include "vp_api_types.h" 11 | /* Critical section types */ 12 | typedef enum { 13 | VP_MPI_CRITICAL_SEC, /* MPI access critical code section */ 14 | VP_HBI_CRITICAL_SEC, /* HBI access critical code section */ 15 | VP_CODE_CRITICAL_SEC, /* Critical code section */ 16 | VP_NUM_CRITICAL_SEC_TYPES, /* The number of critical section types */ 17 | VP_CRITICAL_SEC_ENUM_SIZE = FORCE_STANDARD_C_ENUM_SIZE /* Portability Req. */ 18 | } VpCriticalSecType; 19 | 20 | EXTERN uint8 21 | VpSysEnterCritical( 22 | VpDeviceIdType deviceId, 23 | VpCriticalSecType criticalSecType); 24 | 25 | EXTERN uint8 26 | VpSysExitCritical( 27 | VpDeviceIdType deviceId, 28 | VpCriticalSecType criticalSecType); 29 | 30 | EXTERN void 31 | VpSysWait( 32 | uint8 time); 33 | 34 | EXTERN void 35 | VpSysDisableInt( 36 | VpDeviceIdType deviceId); 37 | 38 | EXTERN void 39 | VpSysEnableInt( 40 | VpDeviceIdType deviceId); 41 | 42 | EXTERN bool 43 | VpSysTestInt( 44 | VpDeviceIdType deviceId); 45 | 46 | EXTERN void 47 | VpSysDtmfDetEnable( 48 | VpDeviceIdType deviceId, 49 | uint8 channelId); 50 | 51 | EXTERN void 52 | VpSysDtmfDetDisable( 53 | VpDeviceIdType deviceId, 54 | uint8 channelId); 55 | 56 | EXTERN void * 57 | VpSysTestHeapAcquire( 58 | uint8 *pHeapId); 59 | 60 | EXTERN bool 61 | VpSysTestHeapRelease( 62 | uint8 heapId); 63 | 64 | EXTERN void 65 | VpSysPcmCollectAndProcess( 66 | void *pLineCtx, 67 | VpDeviceIdType deviceId, 68 | uint8 channelId, 69 | uint8 startTimeslot, 70 | uint16 operationTime, 71 | uint16 settlingTime, 72 | uint16 operationMask); 73 | 74 | /* For Zarlink debugging function */ 75 | #define VpSysDebugPrintf printk 76 | 77 | #endif /* SYS_SERVICE_H */ 78 | 79 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/arch/bcm63xx/vp_api_profile_type.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_profile_type.h 2 | * vp_api_profile_type.h 3 | * 4 | * Header file for the VpProfileDataType typedef. If using the API "apitypes", 5 | * this file is automatically included. Otherwise, this type is defined in the 6 | * header file output from the Profile Wizard (app should include). 7 | * 8 | * Copyright (c) 2011, Microsemi Corporation 9 | */ 10 | #ifndef API_PROFILE_TYPE_H 11 | #define API_PROFILE_TYPE_H 12 | typedef unsigned char VpProfileDataType; 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/arch/bcm63xx/vp_api_types.h: -------------------------------------------------------------------------------- 1 | /** \file vp_api_types.h 2 | * vp_api_types.h 3 | * 4 | * This file is the header for all standard types used in the API code. 5 | * 6 | * Copyright (c) 2011, Microsemi Corporation 7 | */ 8 | #ifndef VP_API_TYPES_H 9 | #define VP_API_TYPES_H 10 | 11 | #include 12 | #include 13 | 14 | typedef struct { 15 | bcm_mpi_t *mpi; 16 | } zarlink_device_id_t; 17 | 18 | #include "vp_api_profile_type.h" 19 | /* VpDeviceIdType defines the type for the deviceId in the VpDevCtxType type. 20 | * This information is passed through the API to the HAL to communicate 21 | * with a specific device. The values assigned via VpMakeDeviceObject() 22 | * are user defined and may be simple device indexing (0, 1, .. (n-1)): 23 | * where n = device number in system 24 | */ 25 | typedef const zarlink_device_id_t *VpDeviceIdType; 26 | /* 27 | * The 'VpLineIdType' defines a system wide Line identification that the system 28 | * could use to identify a line. This type can be defined to contain anything 29 | * that the customer chooses. It could be defined to contain just an index or 30 | * a pointer. The system wide line identity could be set using the 31 | * VpMapLineId() function for a given line. The VP-API returns this line id 32 | * information when line specific events occur (along with the event). 33 | */ 34 | typedef size_t VpLineIdType; 35 | 36 | /* 37 | * Macros for displaying VpDeviceIdType and VpLineIdType values. If you have 38 | * defined these (in vp_api_types.h) as something other than simple integers, 39 | * you should modify the printf format strings as needed: 40 | */ 41 | #define VP_PRINT_DEVICE_ID(deviceId) VpSysDebugPrintf(" (dev 0x%lX)", (unsigned long)(deviceId)) 42 | #define VP_PRINT_LINE_ID(lineId) VpSysDebugPrintf(" (line %lu)", (unsigned long)(lineId)) 43 | 44 | #ifndef NULL 45 | #define NULL (0) 46 | #endif 47 | #define VP_NULL NULL 48 | #ifdef EXTERN 49 | #undef EXTERN 50 | #error EXTERN was redefined! 51 | #endif /* undef EXTERN */ 52 | #ifdef __cplusplus 53 | #define EXTERN extern "C" 54 | #else 55 | #define EXTERN extern 56 | #endif /* __cplusplus */ 57 | /********************* DECLARATIONS ***************************/ 58 | /* Constants */ 59 | #define FALSE (0) /* Boolean constant */ 60 | #define TRUE (1) /* Boolean constant */ 61 | #ifndef __cplusplus 62 | /* C++ language provides a boolean data type; So no need to define 63 | * one more data type; Make use of it 64 | * NOTE: The 'C' portions of the VP-API assume C++ "bool" to be of the 65 | * same size as that of "char". Please make sure this assumption is correct. 66 | */ 67 | #define bool _Bool 68 | #endif /* __cplusplus */ 69 | /****************** typedefs ***********************************/ 70 | /* These are the basic number types used */ 71 | /* for uint8, uint16, uint32, int8, int16, int32 */ 72 | typedef unsigned char uchar; 73 | typedef __u8 uint8; 74 | typedef __u16 uint16; 75 | typedef __u32 uint32; 76 | typedef __s8 int8; 77 | typedef __s16 int16; 78 | typedef __s32 int32; 79 | 80 | typedef uint8* uint8p; 81 | typedef uint16* uint16p; 82 | typedef uint32* uint32p; 83 | typedef int8* int8p; 84 | typedef int16* int16p; 85 | typedef int32* int32p; 86 | typedef const VpProfileDataType * VpProfilePtrType; 87 | typedef uint8p VpImagePtrType; 88 | typedef uint16p VpVectorPtrType; 89 | typedef uint8 VpPktDataType; 90 | typedef VpPktDataType* VpPktDataPtrType; 91 | /* Some compilers optimize the size of enumeration data types based on 92 | * the maximum data value assigned to the members of that data type. 93 | * 'Standard C' requires enumeration data types to be of the same size 94 | * as that of native 'int' implementation. 95 | * The VP-API from a portability perspective adds a 'dummy' member to 96 | * all enumeration data types that force the compilers to allocate the size 97 | * of enumeration data types to be equal to that of native 'int' 98 | * implementation */ 99 | #define FORCE_STANDARD_C_ENUM_SIZE (0xFFFF) 100 | 101 | /* Eliminate error messages that occur when comparing an enumeration constant 102 | < 0 */ 103 | #define FORCE_SIGNED_ENUM (0xFFFF) 104 | 105 | /* Define any API specific basic data type ranges (that are necessary) */ 106 | #define VP_INT16_MAX (SHRT_MAX) 107 | #define VP_INT16_MIN (SHRT_MIN) 108 | #define VP_INT32_MAX (LONG_MAX) 109 | #define VP_INT32_MIN (LONG_MIN) 110 | #endif /* VP_API_TYPES_H */ 111 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/arch/bcm63xx/vp_hal.h: -------------------------------------------------------------------------------- 1 | /* vp_hal.h 2 | * 3 | * This file defines the interface between the VoicePath API and the Hardware 4 | * Abstraction Layer (HAL). The types and functions declared in this file are 5 | * platform-dependent. The functions are defined in ve_hal.c. Porting the 6 | * VoicePath API to a new host processor consists of modifying the typedefs 7 | * in this file, setting the HBI_PINCONFIG define below, and modifying the 8 | * function implementations in vp_hal.c. 9 | * 10 | * Copyright (c) 2011, Microsemi Corporation 11 | */ 12 | #ifndef _VP_HAL_H 13 | #define _VP_HAL_H 14 | #include "vp_api_types.h" 15 | #include "hbi_hal.h" 16 | #include "mpi_hal.h" 17 | #include "sys_service.h" 18 | #endif /* _VP_HAL_H */ 19 | 20 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/extern/zarlink/readme.txt: -------------------------------------------------------------------------------- 1 | The directory 2.24.0 contains library Voice Path API Lite version 2.24 2 | from Microsemi. 3 | 4 | The library can be used in open source project according to a Microsemi 5 | representative : 6 | >> ... 7 | >> We have two API versions available to control the voice chipset : 8 | >> 9 | >> 1. The LE71SK0002 VOICEPATH API-II SOFTWARE that requires Software Licence agreement to be signed by Legal that cannot be distributed for GPL 10 | >> 2. The LE71SDKAPIL API-II Lite that doesn't require any Legal document and can be distributed as GPL 11 | >> ... 12 | 13 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/bcm63xx_line_state.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifdef __KERNEL__ 10 | #include 11 | #include 12 | #include 13 | #else /* !__KERNEL__ */ 14 | #include 15 | #include 16 | #endif /* !__KERNEL__ */ 17 | 18 | #include "bcm63xx_line_state.h" 19 | #include "macros.h" 20 | 21 | void bcm_phone_line_state_reset(bcm_phone_line_state_t *t, 22 | bcm_phone_line_status_t status, bcm_phone_codec_t codec, 23 | bool rev_polarity, bcm_phone_line_mode_t mode, 24 | bcm_phone_line_tone_t tone) 25 | { 26 | t->status = status; 27 | t->codec = codec; 28 | t->rev_polarity = rev_polarity; 29 | t->mode = mode; 30 | t->tone = tone; 31 | bcm_phone_line_state_reset_change_counts(t); 32 | bcm_phone_line_state_reset_flash_count(t); 33 | bcm_phone_line_state_reset_digits(t); 34 | } 35 | 36 | void bcm_phone_line_state_move(bcm_phone_line_state_t *t, bcm_phone_line_state_t *dest) 37 | { 38 | size_t len; 39 | 40 | dest->status = t->status; 41 | dest->status_change_count += t->status_change_count; 42 | t->status_change_count = 0; 43 | dest->codec = t->codec; 44 | dest->codec_change_count += t->codec_change_count; 45 | t->codec_change_count = 0; 46 | dest->rev_polarity = t->rev_polarity; 47 | dest->rev_polarity_change_count += t->rev_polarity_change_count; 48 | t->rev_polarity_change_count = 0; 49 | dest->mode = t->mode; 50 | dest->mode_change_count += t->mode_change_count; 51 | t->mode_change_count = 0; 52 | dest->tone = t->tone; 53 | dest->tone_change_count += t->tone_change_count; 54 | t->tone_change_count = 0; 55 | len = t->digits_count; 56 | if (len > (ARRAY_SIZE(dest->digits) - dest->digits_count)) { 57 | len = ARRAY_SIZE(dest->digits) - dest->digits_count; 58 | } 59 | if (len > 0) { 60 | memcpy(&(dest->digits[dest->digits_count]), t->digits, len); 61 | dest->digits_count += len; 62 | t->digits_count -= len; 63 | if (t->digits_count > 0) { 64 | memmove(t->digits, &(t->digits[len]), t->digits_count * sizeof(char)); 65 | } 66 | } 67 | dest->flash_count += t->flash_count; 68 | t->flash_count = 0; 69 | } 70 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/compile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | /* Enable extra warnings corresponding to option -Wextra */ 9 | #pragma GCC diagnostic warning "-Wall" 10 | 11 | #pragma GCC diagnostic warning "-Wclobbered" 12 | #pragma GCC diagnostic warning "-Wempty-body" 13 | #pragma GCC diagnostic warning "-Wignored-qualifiers" 14 | #pragma GCC diagnostic warning "-Wmissing-field-initializers" 15 | #pragma GCC diagnostic warning "-Wmissing-parameter-type" 16 | #pragma GCC diagnostic warning "-Wold-style-declaration" 17 | #pragma GCC diagnostic warning "-Woverride-init" 18 | #pragma GCC diagnostic warning "-Wsign-compare" 19 | #ifdef BCMPH_NOHW 20 | # pragma GCC diagnostic warning "-Wshift-negative-value" 21 | #endif // BCMPH_NOHW 22 | #pragma GCC diagnostic warning "-Wswitch-default" 23 | //#pragma GCC diagnostic warning "-Wswitch-enum" 24 | #pragma GCC diagnostic warning "-Wtype-limits" 25 | #pragma GCC diagnostic warning "-Wuninitialized" 26 | #pragma GCC diagnostic warning "-Wunused-but-set-parameter" 27 | #pragma GCC diagnostic warning "-Wunused-but-set-variable" 28 | //#pragma GCC diagnostic warning "-Wunused-parameter" 29 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __CONFIG_H__ 10 | #define __CONFIG_H__ 11 | 12 | /* 13 | Define if MPI driver must uses the kernel driver spi-bcm63xx 14 | Kernel driver spi-bcm63xx must be patched to add the function 15 | bcm63xx_spi_raw_sync_locked(). 16 | Without this function, spi-bcm63xx is too slow mainly because it does 17 | not allow toggling CS signal between each byte, forcing to have one 18 | spi_transfer for each byte 19 | */ 20 | #undef BCMPH_USE_SPI_DRIVER 21 | /* Define to enable the usage of interrupts in PCM code */ 22 | #undef BCMPH_ENABLE_PCM_INTERRUPTS 23 | /* Define to trace MPI transfers */ 24 | #undef BCMPH_DEBUG_MPI 25 | /* Define to use option VP_OPTION_ID_PULSE in MicroSemi VoicePath API */ 26 | #undef BCMPH_VP_DECODE_PULSE 27 | 28 | #ifndef __KERNEL__ 29 | # ifndef BCMPH_NOHW 30 | # define BCMPH_NOHW 31 | # endif /* BMCPH_NOHW */ 32 | # ifdef BCMPH_DAHDI_DRIVER 33 | # error "BCMPH_DAHDI_DRIVER can't be defined if __KERNEL__ is undefined" 34 | # endif 35 | #endif /* !__KERNEL__ */ 36 | 37 | #ifdef BCMPH_NOHW 38 | # ifndef BCMPH_TEST_PCM 39 | # define BCMPH_TEST_PCM 40 | # endif /* !BCMPH_TEST_PCM */ 41 | # ifdef BCMPH_ENABLE_PCM_INTERRUPTS 42 | # error "BCMPH_ENABLE_PCM_INTERRUPTS is incompatible with BCMPH_NOHW" 43 | # endif /* BCMPH_ENABLE_PCM_INTERRUPTS */ 44 | #endif /* BCMPH_NOHW */ 45 | 46 | #ifdef BCMPH_TEST_PCM 47 | # ifndef BCMPH_DEBUG 48 | # define BCMPH_DEBUG 49 | # endif /* !BCMPH_DEBUG */ 50 | # ifdef BCMPH_DEBUG_MPI 51 | # error "BCMPH_DEBUG_MPI is incompatible with BCMPH_TEST_PCM" 52 | # endif 53 | #endif /* !BCMPH_TEST_PCM */ 54 | 55 | #ifndef BCMPH_DEBUG 56 | # ifdef BCMPH_DEBUG_MPI 57 | # error "BCMPH_DEBUG_MPI can't be defined if BCMPH_DEBUG is undefined" 58 | # endif 59 | #endif 60 | 61 | #ifndef __KERNEL__ 62 | # ifdef BCMPH_DEBUG_MPI 63 | # error "BCMPH_DEBUG_MPI can't be defined if __KERNEL__ is undefined" 64 | # endif 65 | #endif 66 | 67 | #ifdef BCMPH_DAHDI_DRIVER 68 | # ifdef BCMPH_EXPORT_DEV_FILE 69 | # error "BCMPH_DAHDI is incompatible with BCMPH_EXPORT_DEV_FILE" 70 | # endif 71 | #endif 72 | 73 | #if ((!defined BCMPH_DAHDI_DRIVER) && (!defined BCMPH_EXPORT_DEV_FILE)) 74 | # define BCMPH_EXPORT_DEV_FILE 75 | #endif 76 | 77 | #endif /* __CONFIG_H__ */ 78 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/countryArchive.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * 3 | * Filename: countryArchive.h 4 | * 5 | **************************************************************************** 6 | * Description: 7 | * 8 | * This file provides a central list or archive of supported countries. 9 | * It is intended to be used to generate an enumerated type of countries. 10 | * It MUST be included by another wrapper header file which provides 11 | * the enum skeleton and macro to generate enumerated type names. The 12 | * enum macro that MUST be defined in the containing header file is 13 | * 'COUNTRY_ARCHIVE_MAKE_NAME'. For example, the containing header file 14 | * should declare something similar to the following: 15 | * 16 | * #define COUNTRY_ARCHIVE_MAKE_NAME( country ) MY_COUNTRY_##country 17 | * 18 | * typedef enum 19 | * { 20 | * #include 21 | * 22 | * } MY_COUNTRY; 23 | * 24 | * 25 | * This example would generate a list of countries as follows: 26 | * 27 | * enum 28 | * { 29 | * MY_COUNTRY_JAPAN, 30 | * MY_COUNTRY_GERMANY, 31 | * MY_COUNTRY_SWEDEN, 32 | * ... 33 | * } MY_COUNTRY; 34 | * 35 | * Using this method allows the list of countries to be maintained in a 36 | * central location. However, modules are free to create their own country 37 | * name-space by providing a wrapper for this file. 38 | * 39 | ****************************************************************************/ 40 | 41 | /* 42 | ** Include guards have been purposefully excluded. This header MUST be included 43 | ** by a wrapper header file which provides the inclusion protection. 44 | */ 45 | 46 | #ifndef COUNTRY_ARCHIVE_MAKE_NAME 47 | #error "COUNTRY_ARCHIVE_MAKE_NAME must be defined!" 48 | #endif 49 | 50 | COUNTRY_ARCHIVE_MAKE_NAME( ETSI ) /* ETSI */ 51 | COUNTRY_ARCHIVE_MAKE_NAME( GR57 ) /* Telcordia GR-57 */ 52 | COUNTRY_ARCHIVE_MAKE_NAME( AT ) /* Austria */ 53 | COUNTRY_ARCHIVE_MAKE_NAME( AU ) /* Australia */ 54 | COUNTRY_ARCHIVE_MAKE_NAME( BE ) /* Belgium */ 55 | COUNTRY_ARCHIVE_MAKE_NAME( BG ) /* Bulgaria */ 56 | COUNTRY_ARCHIVE_MAKE_NAME( BR ) /* Brazil */ 57 | COUNTRY_ARCHIVE_MAKE_NAME( CA ) /* Canada */ 58 | COUNTRY_ARCHIVE_MAKE_NAME( CH ) /* Switzerland */ 59 | COUNTRY_ARCHIVE_MAKE_NAME( CN ) /* China */ 60 | COUNTRY_ARCHIVE_MAKE_NAME( DE ) /* Germany */ 61 | COUNTRY_ARCHIVE_MAKE_NAME( DK ) /* Danemark */ 62 | COUNTRY_ARCHIVE_MAKE_NAME( ES ) /* Spain */ 63 | COUNTRY_ARCHIVE_MAKE_NAME( FI ) /* Finland */ 64 | COUNTRY_ARCHIVE_MAKE_NAME( FR ) /* France */ 65 | COUNTRY_ARCHIVE_MAKE_NAME( GB ) /* United Kingdom */ 66 | COUNTRY_ARCHIVE_MAKE_NAME( GR ) /* Greece */ 67 | COUNTRY_ARCHIVE_MAKE_NAME( HK ) /* Hong Kong */ 68 | COUNTRY_ARCHIVE_MAKE_NAME( HU ) /* Hungary */ 69 | COUNTRY_ARCHIVE_MAKE_NAME( IE ) /* Ireland */ 70 | COUNTRY_ARCHIVE_MAKE_NAME( IL ) /* Israel */ 71 | COUNTRY_ARCHIVE_MAKE_NAME( IS ) /* Iceland */ 72 | COUNTRY_ARCHIVE_MAKE_NAME( IT ) /* Italy */ 73 | COUNTRY_ARCHIVE_MAKE_NAME( JP ) /* Japan */ 74 | COUNTRY_ARCHIVE_MAKE_NAME( KR ) /* Korea */ 75 | COUNTRY_ARCHIVE_MAKE_NAME( NL ) /* Netherlands */ 76 | COUNTRY_ARCHIVE_MAKE_NAME( NO ) /* Norway */ 77 | COUNTRY_ARCHIVE_MAKE_NAME( NZ ) /* New Zealand */ 78 | COUNTRY_ARCHIVE_MAKE_NAME( PT ) /* Portugal */ 79 | COUNTRY_ARCHIVE_MAKE_NAME( RU ) /* Russia */ 80 | COUNTRY_ARCHIVE_MAKE_NAME( SE ) /* Sweden */ 81 | COUNTRY_ARCHIVE_MAKE_NAME( SG ) /* Singapore */ 82 | COUNTRY_ARCHIVE_MAKE_NAME( TK ) /* Turkey */ 83 | COUNTRY_ARCHIVE_MAKE_NAME( TW ) /* Taiwan */ 84 | COUNTRY_ARCHIVE_MAKE_NAME( US ) /* United States */ 85 | COUNTRY_ARCHIVE_MAKE_NAME( ZA ) /* South Africa */ 86 | 87 | #undef COUNTRY_ARCHIVE_MAKE_NAME 88 | 89 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/atomic.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/barrier.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/bitops.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/clk.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/delay.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/dma-mapping.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/errno.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/file.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/jiffies.h: -------------------------------------------------------------------------------- 1 | #ifndef __BCMPH_LINUX_JIFFIES_H__ 2 | #define __BCMPH_LINUX_JIFFIES_H__ 3 | 4 | #include 5 | 6 | static inline unsigned long get_jiffies(void) 7 | { 8 | return (jiffies); 9 | } 10 | 11 | #endif // __BCMPH_LINUX_JIFFIES_H__ 12 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/kernel.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/list.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/log2.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/mm.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/module.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/mutex.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/poll.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/sched.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/slab.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/spinlock.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/stddef.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/timer.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/types.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/uaccess.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef __BCMPH_LINUX_WAIT_H__ 2 | #define __BCMPH_LINUX_WAIT_H__ 3 | 4 | #include 5 | 6 | static inline void deinit_waitqueue_head(wait_queue_head_t *t) 7 | { 8 | } 9 | 10 | #endif // __BCMPH_LINUX_WAIT_H__ 11 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/linux/workqueue.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/extern/oslec.h: -------------------------------------------------------------------------------- 1 | #ifndef BCMPH_NOHW 2 | # include <../drivers/misc/echo/oslec.h> 3 | #else 4 | 5 | /* 6 | * OSLEC - A line echo canceller. This code is being developed 7 | * against and partially complies with G168. Using code from SpanDSP 8 | * 9 | * Written by Steve Underwood 10 | * and David Rowe 11 | * 12 | * Copyright (C) 2001 Steve Underwood and 2007-2008 David Rowe 13 | * 14 | * All rights reserved. 15 | * 16 | * This program is free software; you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License version 2, as 18 | * published by the Free Software Foundation. 19 | * 20 | * This program is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU General Public License 26 | * along with this program; if not, write to the Free Software 27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 28 | * 29 | */ 30 | 31 | # ifndef __OSLEC_H 32 | # define __OSLEC_H 33 | 34 | /* Mask bits for the adaption mode */ 35 | #define ECHO_CAN_USE_ADAPTION 0x01 36 | #define ECHO_CAN_USE_NLP 0x02 37 | #define ECHO_CAN_USE_CNG 0x04 38 | #define ECHO_CAN_USE_CLIP 0x08 39 | #define ECHO_CAN_USE_TX_HPF 0x10 40 | #define ECHO_CAN_USE_RX_HPF 0x20 41 | #define ECHO_CAN_DISABLE 0x40 42 | 43 | /** 44 | * oslec_state: G.168 echo canceller descriptor. 45 | * 46 | * This defines the working state for a line echo canceller. 47 | */ 48 | struct oslec_state; 49 | 50 | /** 51 | * oslec_create - Create a voice echo canceller context. 52 | * @len: The length of the canceller, in samples. 53 | * @return: The new canceller context, or NULL if the canceller could not be 54 | * created. 55 | */ 56 | struct oslec_state *oslec_create(int len, int adaption_mode); 57 | 58 | /** 59 | * oslec_free - Free a voice echo canceller context. 60 | * @ec: The echo canceller context. 61 | */ 62 | void oslec_free(struct oslec_state *ec); 63 | 64 | /** 65 | * oslec_flush - Flush (reinitialise) a voice echo canceller context. 66 | * @ec: The echo canceller context. 67 | */ 68 | void oslec_flush(struct oslec_state *ec); 69 | 70 | /** 71 | * oslec_adaption_mode - set the adaption mode of a voice echo canceller context. 72 | * @ec The echo canceller context. 73 | * @adaption_mode: The mode. 74 | */ 75 | void oslec_adaption_mode(struct oslec_state *ec, int adaption_mode); 76 | 77 | void oslec_snapshot(struct oslec_state *ec); 78 | 79 | /** 80 | * oslec_update: Process a sample through a voice echo canceller. 81 | * @ec: The echo canceller context. 82 | * @tx: The transmitted audio sample. 83 | * @rx: The received audio sample. 84 | * 85 | * The return value is the clean (echo cancelled) received sample. 86 | */ 87 | int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx); 88 | 89 | /** 90 | * oslec_hpf_tx: Process to high pass filter the tx signal. 91 | * @ec: The echo canceller context. 92 | * @tx: The transmitted auio sample. 93 | * 94 | * The return value is the HP filtered transmit sample, send this to your D/A. 95 | */ 96 | int16_t oslec_hpf_tx(struct oslec_state *ec, int16_t tx); 97 | 98 | # endif /* __OSLEC_H */ 99 | 100 | #endif /* BCMPH_NOHW */ 101 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/macros.h: -------------------------------------------------------------------------------- 1 | #ifndef __MACROS_H__ 2 | #define __MACROS_H__ 3 | 4 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) 5 | #define GNUC_VERSION \ 6 | (__GNUC__ << 16) + __GNUC_MINOR__ 7 | #define GNUC_PREREQ(maj, min) \ 8 | (GNUC_VERSION >= ((maj) << 16) + (min)) 9 | #else 10 | #define GNUC_PREREQ(maj, min) 0 11 | #endif 12 | 13 | #ifndef BUILD_BUG_ON_ZERO 14 | # define BUILD_BUG_ON_ZERO(e) \ 15 | (sizeof(struct { int:-!!(e)*1234; })) 16 | #endif 17 | 18 | #if GNUC_PREREQ(3, 1) 19 | #define SAME_TYPE(a, b) \ 20 | __builtin_types_compatible_p(typeof(a), typeof(b)) 21 | #define MUST_BE_ARRAY(a) \ 22 | BUILD_BUG_ON_ZERO(SAME_TYPE((a), &(*a))) 23 | #else 24 | #define MUST_BE_ARRAY(a) \ 25 | BUILD_BUG_ON_ZERO(sizeof(a) % sizeof(*a)) 26 | #endif 27 | 28 | #ifndef ARRAY_SIZE 29 | # ifdef __cplusplus 30 | template 31 | char ( &ARRAY_SIZE_HELPER( T (&array)[N] ))[N]; 32 | # define ARRAY_SIZE( array ) \ 33 | (sizeof( ARRAY_SIZE_HELPER( array ) )) 34 | # else 35 | # define ARRAY_SIZE(a) ( \ 36 | (sizeof(a) / sizeof(*a)) \ 37 | + MUST_BE_ARRAY(a)) 38 | # endif 39 | #endif /* !ARRAY_SIZE */ 40 | 41 | #ifndef container_of 42 | # define container_of(ptr, type, member) ({ \ 43 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 44 | (type *)( (char *)__mptr - offsetof(type,member) );}) 45 | #endif /* container_of */ 46 | 47 | #endif /* __MACROS_H__ */ 48 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/mpi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __MPI_H__ 10 | #define __MPI_H__ 11 | 12 | #include "config.h" 13 | 14 | #ifdef __KERNEL__ 15 | # ifdef BCMPH_USE_SPI_DRIVER 16 | # include 17 | # ifndef BCMPH_NOHW 18 | # include <../drivers/spi/spi-bcm63xx.h> 19 | # endif /* BCMPH_NOHW */ 20 | # endif /* BCMPH_USE_SPI_DRIVER */ 21 | #endif /* __KERNEL__ */ 22 | 23 | #ifndef BCMPH_USE_SPI_DRIVER 24 | # ifndef BCMPH_NOHW 25 | # include 26 | # include 27 | # include 28 | # endif /* !BCMPH_NOHW */ 29 | #endif /* !BCMPH_USE_SPI_DRIVER */ 30 | 31 | #include "board.h" 32 | 33 | #ifdef BCMPH_DEBUG_MPI 34 | #define MPI_READ 0 35 | #define MPI_WRITE 1 36 | #endif /* BCMPH_DEBUG_MPI */ 37 | 38 | 39 | #ifndef BCMPH_USE_SPI_DRIVER 40 | typedef struct { 41 | __u32 ref_count; 42 | # ifndef BCMPH_NOHW 43 | struct completion done; 44 | int irq; 45 | 46 | int num_chipselect; 47 | 48 | const unsigned long *reg_offsets; 49 | 50 | void __iomem *regs; 51 | resource_size_t res_start; 52 | resource_size_t res_size; 53 | 54 | /* Platform data */ 55 | unsigned fifo_size; 56 | unsigned int msg_type_shift; 57 | unsigned int msg_ctl_width; 58 | 59 | /* data iomem */ 60 | __u8 __iomem *tx_io; 61 | const __u8 __iomem *rx_io; 62 | 63 | struct clk *clk; 64 | struct platform_device *pdev; 65 | 66 | __u8 clk_cfg; 67 | __u8 fill_byte; 68 | # endif /* BCMPH_NOHW */ 69 | } bcm_mpi_dev_data_t; 70 | 71 | # ifndef BCMPH_NOHW 72 | struct bcm63xx_spi_trx_opts { 73 | u8 fill_byte; 74 | bool wait_completion_with_irq; 75 | bool drop_cs_after_each_byte; 76 | u8 cs_off_clk_cycles; 77 | }; 78 | # endif /* BCMPH_NOHW */ 79 | #endif /* !BCMPH_USE_SPI_DRIVER */ 80 | 81 | typedef struct mpi { 82 | #ifndef BCMPH_NOHW 83 | struct bcm63xx_spi_trx_opts trx_opts; 84 | #endif /* BCMPH_NOHW */ 85 | #ifdef BCMPH_USE_SPI_DRIVER 86 | __u32 mpi_clk; /* SPI clock speed */ 87 | struct spi_device *dev; 88 | bool bus_is_locked; 89 | #else /* !BCMPH_USE_SPI_DRIVER */ 90 | bcm_mpi_dev_data_t *dev_data; 91 | __u16 mpi_cs; 92 | __u8 clk_cfg; 93 | #endif /* !BCMPH_USE_SPI_DRIVER */ 94 | #ifdef BCMPH_DEBUG_MPI 95 | __u8 trace[16384]; 96 | size_t trace_len; 97 | #endif /* BCMPH_DEBUG_MPI */ 98 | } bcm_mpi_t; 99 | 100 | extern int bcm_mpi_init(bcm_mpi_t *t, const bcm_mpi_params_t *params); 101 | 102 | extern void bcm_mpi_deinit(bcm_mpi_t *t); 103 | 104 | extern int bcm_mpi_read(bcm_mpi_t *t, __u8 *buf, __u8 buf_len, const __u8 *buf_prepend, __u8 prepend_len); 105 | 106 | extern int bcm_mpi_write(bcm_mpi_t *t, const __u8 *buf, __u8 buf_len); 107 | 108 | extern int bcm_mpi_read_write(bcm_mpi_t *t, __u8 *buf, __u8 buf_len); 109 | 110 | #ifdef BCMPH_DEBUG_MPI 111 | extern void bcm_mpi_dump_and_reset_trace(bcm_mpi_t *t); 112 | #endif /* BCMPH_DEBUG_MPI */ 113 | 114 | #endif /* __MPI_H__ */ 115 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __MUTEX_H__ 10 | #define __MUTEX_H__ 11 | 12 | #include 13 | 14 | typedef struct 15 | { 16 | struct mutex *lock; 17 | bool is_locked; 18 | } bcmph_mutex_t; 19 | 20 | static inline void bcmph_mutex_init(bcmph_mutex_t *t, struct mutex *lock, bool is_locked) 21 | { 22 | bcm_assert(NULL != lock); 23 | t->lock = lock; 24 | t->is_locked = is_locked; 25 | } 26 | 27 | static inline int bcmph_mutex_lock_interruptible(bcmph_mutex_t *t) 28 | { 29 | int ret; 30 | 31 | bcm_assert(!t->is_locked); 32 | ret = mutex_lock_interruptible(t->lock); 33 | if (!ret) { 34 | t->is_locked = true; 35 | } 36 | return (ret); 37 | } 38 | 39 | static inline bool bcmph_mutex_is_locked(const bcmph_mutex_t *t) 40 | { 41 | return (t->is_locked); 42 | } 43 | 44 | static inline bool bcmph_mutex_trylock(bcmph_mutex_t *t) 45 | { 46 | bcm_assert(!t->is_locked); 47 | 48 | // BEWARE : mutex_trylock() return 1 on success and 0 if mutex can't be locked 49 | if (mutex_trylock(t->lock)) { 50 | t->is_locked = true; 51 | } 52 | return (t->is_locked); 53 | } 54 | 55 | static inline void bcmph_mutex_unlock(bcmph_mutex_t *t) 56 | { 57 | bcm_assert(t->is_locked); 58 | mutex_unlock(t->lock); 59 | t->is_locked = false; 60 | } 61 | 62 | static inline void bcmph_mutex_deinit(bcmph_mutex_t *t) 63 | { 64 | if (bcmph_mutex_is_locked(t)) { 65 | bcmph_mutex_unlock(t); 66 | } 67 | } 68 | 69 | #endif // __MUTEX_H__ 70 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __UTILS_H__ 10 | #define __UTILS_H__ 11 | 12 | #include "config.h" 13 | 14 | #include 15 | #include 16 | 17 | #ifndef BCMPH_NOHW 18 | 19 | // Simple macro to get pseudo TimeStamp Counter on MIPS processor 20 | #define rdtscl(dest) \ 21 | __asm__ __volatile__("mfc0 %0,$9; nop" : "=r" (dest)) 22 | 23 | #endif // BCMPH_NOHW 24 | 25 | // Boundary must be a power of 2 26 | static inline size_t round_up_to_pow_of_2(size_t addr, size_t boundary) 27 | { 28 | bcm_assert(is_power_of_2(boundary)); 29 | #ifdef __KERNEL__ 30 | return (round_up(addr, boundary)); 31 | #else // !__KERNEL__ 32 | return ((addr + boundary - 1) & (~(boundary - 1))); 33 | #endif // !__KERNEL__ 34 | } 35 | 36 | static inline size_t round_down_to_pow_of_2(size_t addr, size_t boundary) 37 | { 38 | bcm_assert((~((boundary - 1) ^ (~(boundary - 1)))) == 0); 39 | #ifdef __KERNEL__ 40 | return (round_down(addr, boundary)); 41 | #else // !__KERNEL__ 42 | return (addr & (~(boundary - 1))); 43 | #endif // !__KERNEL__ 44 | } 45 | 46 | static inline size_t round_up_generic(size_t addr, size_t boundary) 47 | { 48 | return (((addr + boundary - 1) / boundary) * boundary); 49 | } 50 | 51 | static inline size_t round_down_generic(size_t addr, size_t boundary) 52 | { 53 | return ((addr / boundary) * boundary); 54 | } 55 | 56 | static inline size_t round_up_to_next_pow_of_2(size_t addr) 57 | { 58 | size_t pow = 0; 59 | if (addr > 0) { 60 | addr -= 1; 61 | while (0 != addr) { 62 | addr >>= 1; 63 | pow += 1; 64 | } 65 | } 66 | return (1 << pow); 67 | } 68 | 69 | #endif // __UTILS_H__ 70 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/inc/wait_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #ifndef __WAIT_QUEUE_H__ 10 | #define __WAIT_QUEUE_H__ 11 | 12 | #include "config.h" 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | typedef struct { 22 | // Kernel wait queue used to block processes 23 | wait_queue_head_t wq; 24 | // Counter that tells processes blocked in wait queue that something 25 | // has changed 26 | atomic_t counter; 27 | } bcm_wait_queue_t; 28 | 29 | static inline void bcm_wait_queue_init(bcm_wait_queue_t *t) 30 | { 31 | bcm_pr_debug("%s()\n", __func__); 32 | init_waitqueue_head(&(t->wq)); 33 | atomic_set(&(t->counter), 0); 34 | } 35 | 36 | static inline void bcm_wait_queue_deinit(bcm_wait_queue_t *t) 37 | { 38 | bcm_pr_debug("%s()\n", __func__); 39 | deinit_waitqueue_head(&(t->wq)); 40 | } 41 | 42 | static inline void bcm_wait_queue_wake_up(bcm_wait_queue_t *t) 43 | { 44 | dd_bcm_pr_debug("%s()\n", __func__); 45 | atomic_inc(&(t->counter)); 46 | wake_up_interruptible_all(&(t->wq)); 47 | } 48 | 49 | static inline int bcm_wait_queue_get_counter(bcm_wait_queue_t *t) 50 | { 51 | return (atomic_read(&(t->counter))); 52 | } 53 | 54 | extern int bcm_wait_queue_wait_event_counter(bcm_wait_queue_t *t, int counter, 55 | bcmph_mutex_t *lock); 56 | 57 | static inline int bcm_wait_queue_wait_event(bcm_wait_queue_t *t, 58 | bcmph_mutex_t *lock) 59 | { 60 | return (bcm_wait_queue_wait_event_counter(t, 61 | bcm_wait_queue_get_counter(t), lock)); 62 | } 63 | 64 | extern int bcm_wait_queue_wait_event_counter_timeout(bcm_wait_queue_t *t, 65 | int counter, long timeout_in_jiffies, bcmph_mutex_t *lock); 66 | 67 | static inline int bcm_wait_queue_wait_event_timeout(bcm_wait_queue_t *t, 68 | long timeout_in_jiffies, bcmph_mutex_t *lock) 69 | { 70 | return (bcm_wait_queue_wait_event_counter_timeout(t, 71 | bcm_wait_queue_get_counter(t), timeout_in_jiffies, 72 | lock)); 73 | } 74 | 75 | #endif // __WAIT_QUEUE_H__ 76 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/make_nohw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright (C) 2015 5 | # Gilles Mazoyer 6 | # 7 | # This is free software, licensed under the GNU General Public License v2. 8 | # See /LICENSE for more information. 9 | # 10 | 11 | # Makefile used to compile the driver in test mode that can be insmod 12 | # on a PC. 13 | 14 | set -x 15 | 16 | if [ "$1" = "clean" ]; then 17 | find . -name "*.ko" -type f -exec rm {} \; 18 | find . -name "*.o" -type f -exec rm {} \; 19 | find . -name ".*.ko.cmd" -type f -exec rm {} \; 20 | find . -name ".*.o.cmd" -type f -exec rm {} \; 21 | find . -name "*.mod.c" -type f -exec rm {} \; 22 | rm modules.order Module.symvers Makefile 23 | rm -fr .tmp_versions 24 | exit $? 25 | elif [ "$1" = "drv" ]; then 26 | PKG_NAME=bcm63xx-phone 27 | BCMPH_EFLAGS="-DBCMPH_NOHW -DBCMPH_MODULE_NAME=bcm63xx_phone -DBCMPH_MODULE_VERSION=0.2 -DBCMPH_EXPORT_DEV_FILE -DBCMPH_DEBUG" 28 | elif [ "$1" = "dahdi" ]; then 29 | PKG_NAME=bcm63xx-phone-dahdi 30 | BCMPH_EFLAGS="-DBCMPH_NOHW -DBCMPH_MODULE_NAME=bcm63xx_phone_dahdi -DBCMPH_MODULE_VERSION=0.2 -DBCMPH_DAHDI_DRIVER -DBCMPH_DEBUG -I/usr/include" 31 | else 32 | echo "Parameter #1 must be clean, dahdi or driver" 33 | exit 1 34 | fi 35 | 36 | set -e 37 | set -u 38 | 39 | sed -e "s/module\\.o/${PKG_NAME}\\.o/g" -e "s/module-objs/${PKG_NAME}-objs/g" "Makefile.src" > "Makefile" 40 | make -C "/lib/modules/$(uname -r)/build/" "V=1" "SUBDIRS=$(pwd)" "BCMPH_EFLAGS=${BCMPH_EFLAGS}" "CONFIG_DEBUG_SECTION_MISMATCH=y" modules 41 | 42 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/phone.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include "zarlink/le88221/slic_le88221.h" 17 | #include "zarlink/le88266/slic_le88266.h" 18 | 19 | // Include after system files 20 | #include 21 | 22 | void phone_device_init(phone_device_t *t, 23 | const vtbl_phone_device_t *vtbl, 24 | const phone_desc_device_t *desc, __u8 tick_period) 25 | { 26 | size_t line_idx; 27 | 28 | bcm_pr_debug("%s()\n", __func__); 29 | 30 | bcm_assert((NULL != vtbl) && (NULL != desc) 31 | && (desc->line_count <= ARRAY_SIZE(t->lines))); 32 | 33 | t->vtbl = vtbl; 34 | t->desc = desc; 35 | t->tick_period = tick_period; 36 | t->started = false; 37 | t->country = BCMPH_COUNTRY_ETSI; 38 | for (line_idx = 0; (line_idx < ARRAY_SIZE(t->lines)); line_idx += 1) { 39 | t->lines[line_idx] = NULL; 40 | } 41 | } 42 | 43 | void phone_device_deinit(phone_device_t *t) 44 | { 45 | bcm_pr_debug("%s()\n", __func__); 46 | } 47 | 48 | phone_device_t * __init phone_device_alloc( 49 | const phone_desc_device_t *dev_desc, __u8 tick_period) 50 | { 51 | phone_device_t *ret = NULL; 52 | 53 | bcm_pr_debug("%s()\n", __func__); 54 | 55 | switch (dev_desc->type) { 56 | #ifdef VP_CC_880_SERIES 57 | case BCMPH_VD_ZARLINK_88221: { 58 | phone_dev_le88221_t *dev = (phone_dev_le88221_t *)(kmalloc(sizeof(phone_dev_le88221_t), GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY)); 59 | if (NULL == dev) { 60 | bcm_pr_err("Cannot allocate %lu bytes for device Zarlink Le88221\n", 61 | (unsigned long)(sizeof(phone_dev_le88221_t))); 62 | } 63 | else { 64 | bcm_pr_debug("%lu bytes of memory allocated, starting at address 0x%lx\n", (unsigned long)(sizeof(phone_dev_le88221_t)), (unsigned long)(dev)); 65 | if (phone_dev_le88221_init(dev, dev_desc, tick_period)) { 66 | kfree(dev); 67 | } 68 | else { 69 | ret = &(dev->ve880.vdz.vd); 70 | bcm_assert(((void *)(ret)) == ((void *)(dev))); 71 | } 72 | } 73 | break; 74 | } 75 | case BCMPH_VD_ZARLINK_88266: { 76 | phone_dev_le88266_t *dev = (phone_dev_le88266_t *)(kmalloc(sizeof(phone_dev_le88266_t), GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY)); 77 | if (NULL == dev) { 78 | bcm_pr_err("Cannot allocate %lu bytes for device Zarlink Le88266\n", 79 | (unsigned long)(sizeof(phone_dev_le88266_t))); 80 | } 81 | else { 82 | bcm_pr_debug("%lu bytes of memory allocated, starting at address 0x%lx\n", (unsigned long)(sizeof(phone_dev_le88266_t)), (unsigned long)(dev)); 83 | if (phone_dev_le88266_init(dev, dev_desc, tick_period)) { 84 | kfree(dev); 85 | } 86 | else { 87 | ret = &(dev->ve880.vdz.vd); 88 | bcm_assert(((void *)(ret)) == ((void *)(dev))); 89 | } 90 | } 91 | break; 92 | } 93 | #endif // VP_CC_880_SERIES 94 | default: { 95 | bcm_pr_err("Unknow phone device %d\n", (int)(dev_desc->type)); 96 | break; 97 | } 98 | } 99 | 100 | return (ret); 101 | } 102 | 103 | void phone_device_free(phone_device_t *t) 104 | { 105 | bcm_pr_debug("%s()\n", __func__); 106 | 107 | if (NULL != t) { 108 | void *p = (*(t->vtbl->deinit))(t); 109 | kfree(p); 110 | } 111 | } 112 | 113 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/zarlink/le88221/slic_le88221.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | #include 9 | 10 | #include 11 | 12 | #include "slic_le88221.h" 13 | 14 | #ifdef VP_CC_880_SERIES 15 | 16 | #include 17 | 18 | // Include after system files 19 | #include 20 | 21 | static void *le88221_deinit(phone_device_t *d) 22 | { 23 | size_t line_idx; 24 | phone_dev_le88221_t *t = container_of(d, phone_dev_le88221_t, ve880.vdz.vd); 25 | 26 | bcm_pr_debug("%s()\n", __func__); 27 | 28 | phone_dev_zarlink_ve880_stop(&(t->ve880.vdz.vd)); 29 | 30 | for (line_idx = 0; (line_idx < ARRAY_SIZE(t->lines)); line_idx += 1) { 31 | phone_dev_zarlink_deinit_line(&(t->ve880.vdz), line_idx); 32 | phone_line_deinit(&(t->lines[line_idx].vl)); 33 | } 34 | 35 | phone_dev_zarlink_ve880_deinit(&(t->ve880)); 36 | 37 | return (t); 38 | } 39 | 40 | static vtbl_phone_dev_zarlink_t vtbl_le88221 = { 41 | .vd = { 42 | .deinit = le88221_deinit, 43 | .start = phone_dev_zarlink_ve880_start, 44 | .stop = phone_dev_zarlink_ve880_stop, 45 | .tick = phone_dev_zarlink_tick, 46 | .update_line_state_asap = phone_dev_zarlink_update_line_state_asap 47 | }, 48 | }; 49 | 50 | int __init phone_dev_le88221_init(phone_dev_le88221_t *t, 51 | const phone_desc_device_t *dev_desc, __u8 tick_period) 52 | { 53 | int ret = 0; 54 | size_t line_idx; 55 | 56 | bcm_pr_debug("%s()\n", __func__); 57 | 58 | bcm_assert(ARRAY_SIZE(t->lines) <= ARRAY_SIZE(t->ve880.vdz.lines)); 59 | 60 | bcm_assert((NULL != dev_desc) && (NULL != dev_desc->parameters.zarlink)); 61 | for (line_idx = 0; (line_idx < dev_desc->line_count); line_idx += 1) { 62 | bcm_assert(NULL != dev_desc->lines[line_idx].parameters.zarlink); 63 | } 64 | 65 | do { // Empty loop 66 | if (dev_desc->line_count > ARRAY_SIZE(t->lines)) { 67 | bcm_pr_err("Le88221 description can only have %lu lines at most\n", (unsigned long)(ARRAY_SIZE(t->lines))); 68 | ret = -ENODEV; 69 | break; 70 | } 71 | 72 | ret = phone_dev_zarlink_ve880_init(&(t->ve880), &(vtbl_le88221), dev_desc, tick_period); 73 | if (ret) { 74 | break; 75 | } 76 | 77 | for (line_idx = 0; (line_idx < ARRAY_SIZE(t->lines)); line_idx += 1) { 78 | phone_line_init(&(t->lines[line_idx].vl)); 79 | memset(&(t->lines[line_idx].obj), 0, sizeof(t->lines[line_idx].obj)); 80 | memset(&(t->lines[line_idx].ctx), 0, sizeof(t->lines[line_idx].ctx)); 81 | phone_dev_zarlink_init_line(&(t->ve880.vdz), line_idx, 82 | &(t->lines[line_idx].vl), &(t->lines[line_idx].obj), &(t->lines[line_idx].ctx)); 83 | } 84 | } 85 | while (false); 86 | 87 | return (ret); 88 | } 89 | 90 | #endif // VP_CC_880_SERIES 91 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/zarlink/le88221/slic_le88221.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | #ifndef __SLIC_LE88221_H__ /* support nested includes */ 9 | #define __SLIC_LE88221_H__ 10 | 11 | #include 12 | 13 | #include "../zarlink_common.h" 14 | 15 | #ifdef VP_CC_880_SERIES 16 | 17 | #define LE88221_NUM_LINES 2 18 | 19 | typedef struct { 20 | phone_dev_zarlink_ve880_t ve880; 21 | struct { 22 | phone_line_t vl; 23 | VpLineCtxType ctx; 24 | Vp880LineObjectType obj; 25 | } lines[LE88221_NUM_LINES]; 26 | } phone_dev_le88221_t; 27 | 28 | extern int phone_dev_le88221_init(phone_dev_le88221_t *dev, 29 | const phone_desc_device_t *dev_desc, __u8 tick_period); 30 | 31 | #endif // VP_CC_880_SERIES 32 | 33 | #endif /* __SLIC_LE88221_H__ */ 34 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/zarlink/le88266/slic_le88266.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | #include 9 | 10 | #include 11 | 12 | #include "slic_le88266.h" 13 | 14 | #ifdef VP_CC_880_SERIES 15 | 16 | #include 17 | 18 | // Include after system files 19 | #include 20 | 21 | static void *le88266_deinit(phone_device_t *d) 22 | { 23 | size_t line_idx; 24 | phone_dev_le88266_t *t = container_of(d, phone_dev_le88266_t, ve880.vdz.vd); 25 | 26 | bcm_pr_debug("%s()\n", __func__); 27 | 28 | phone_dev_zarlink_ve880_stop(&(t->ve880.vdz.vd)); 29 | 30 | for (line_idx = 0; (line_idx < ARRAY_SIZE(t->lines)); line_idx += 1) { 31 | phone_dev_zarlink_deinit_line(&(t->ve880.vdz), line_idx); 32 | phone_line_deinit(&(t->lines[line_idx].vl)); 33 | } 34 | 35 | phone_dev_zarlink_ve880_deinit(&(t->ve880)); 36 | 37 | return (t); 38 | } 39 | 40 | static vtbl_phone_dev_zarlink_t vtbl_le88266 = { 41 | .vd = { 42 | .deinit = le88266_deinit, 43 | .start = phone_dev_zarlink_ve880_start, 44 | .stop = phone_dev_zarlink_ve880_stop, 45 | .tick = phone_dev_zarlink_tick, 46 | .update_line_state_asap = phone_dev_zarlink_update_line_state_asap 47 | }, 48 | }; 49 | 50 | int __init phone_dev_le88266_init(phone_dev_le88266_t *t, 51 | const phone_desc_device_t *dev_desc, __u8 tick_period) 52 | { 53 | int ret = 0; 54 | size_t line_idx; 55 | 56 | bcm_pr_debug("%s()\n", __func__); 57 | 58 | bcm_assert(ARRAY_SIZE(t->lines) <= ARRAY_SIZE(t->ve880.vdz.lines)); 59 | 60 | bcm_assert((NULL != dev_desc) && (NULL != dev_desc->parameters.zarlink)); 61 | for (line_idx = 0; (line_idx < dev_desc->line_count); line_idx += 1) { 62 | bcm_assert(NULL != dev_desc->lines[line_idx].parameters.zarlink); 63 | } 64 | 65 | do { // Empty loop 66 | if (dev_desc->line_count > ARRAY_SIZE(t->lines)) { 67 | bcm_pr_err("Le88266 description can only have %lu lines at most\n", (unsigned long)(ARRAY_SIZE(t->lines))); 68 | ret = -ENODEV; 69 | break; 70 | } 71 | 72 | ret = phone_dev_zarlink_ve880_init(&(t->ve880), &(vtbl_le88266), dev_desc, tick_period); 73 | if (ret) { 74 | break; 75 | } 76 | 77 | for (line_idx = 0; (line_idx < ARRAY_SIZE(t->lines)); line_idx += 1) { 78 | phone_line_init(&(t->lines[line_idx].vl)); 79 | memset(&(t->lines[line_idx].obj), 0, sizeof(t->lines[line_idx].obj)); 80 | memset(&(t->lines[line_idx].ctx), 0, sizeof(t->lines[line_idx].ctx)); 81 | phone_dev_zarlink_init_line(&(t->ve880.vdz), line_idx, 82 | &(t->lines[line_idx].vl), &(t->lines[line_idx].obj), &(t->lines[line_idx].ctx)); 83 | } 84 | } 85 | while (false); 86 | 87 | return (ret); 88 | } 89 | 90 | #endif // VP_CC_880_SERIES 91 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/zarlink/le88266/slic_le88266.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | #ifndef __SLIC_LE88266_H__ /* support nested includes */ 9 | #define __SLIC_LE88266_H__ 10 | 11 | #include 12 | 13 | #include "../zarlink_common.h" 14 | 15 | #ifdef VP_CC_880_SERIES 16 | 17 | #define LE88266_NUM_LINES 2 18 | 19 | typedef struct { 20 | phone_dev_zarlink_ve880_t ve880; 21 | struct { 22 | phone_line_t vl; 23 | VpLineCtxType ctx; 24 | Vp880LineObjectType obj; 25 | } lines[LE88266_NUM_LINES]; 26 | } phone_dev_le88266_t; 27 | 28 | extern int phone_dev_le88266_init(phone_dev_le88266_t *dev, 29 | const phone_desc_device_t *dev_desc, __u8 tick_period); 30 | 31 | #endif // VP_CC_880_SERIES 32 | 33 | #endif /* __SLIC_LE88266_H__ */ 34 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/zarlink/profiles/profiles_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * profiles_common.h -- 3 | * 4 | * This header file exports the Profile data types 5 | * 6 | * Project Info -- 7 | * File: C:\Microsemi\Profile_Wizard_P2.7.0\Data\bcm63xx-phone\profiles_common.vpw 8 | * Type: VP880 VoicePort MiniPBX Project (Line Module LE71HE0824) 9 | * Date: Monday, March 23, 2015 09:14:40 10 | * Device: VE880 Le88241 11 | * 12 | * This file was generated with Profile Wizard Version: P2.7.0 13 | */ 14 | 15 | #ifndef PROFILES_COMMON_H 16 | #define PROFILES_COMMON_H 17 | 18 | #ifdef VP_API_TYPES_H 19 | #include "vp_api_types.h" 20 | #else 21 | typedef unsigned char VpProfileDataType; 22 | #endif 23 | 24 | 25 | /************** Device Parameters **************/ 26 | 27 | /************** AC_Filter_Coefficients **************/ 28 | 29 | /************** DC_Feed_Parameters **************/ 30 | 31 | /************** Ring_Signal_Parameters **************/ 32 | 33 | /************** Call_Progress_Tones **************/ 34 | extern const VpProfileDataType TONE_DIAL[]; /* US Dial Tone */ 35 | extern const VpProfileDataType TONE_SIT[]; /* Special Information Tone (Called Number Not Connected) */ 36 | extern const VpProfileDataType TONE_BUSY[]; /* Busy Signal */ 37 | extern const VpProfileDataType TONE_RINGBACK[]; /* Standard Ringback */ 38 | extern const VpProfileDataType TONE_CALLWAIT[]; /* Call Waiting Beep */ 39 | extern const VpProfileDataType TONE_ONEKHZ_L[]; /* A 1kHz tone at -10dBm0 */ 40 | extern const VpProfileDataType TONE_ONEKHZ_H[]; /* A 1kHz tone at 0dBm0 */ 41 | extern const VpProfileDataType TONE_CLI[]; /* Caller ID Alert Tone for UK Cadence */ 42 | extern const VpProfileDataType TONE_ROH[]; /* Receiver Off-Hook */ 43 | 44 | /************** Cadence_Definitions **************/ 45 | 46 | /************** Caller_ID **************/ 47 | 48 | /************** Metering_Profile **************/ 49 | 50 | #endif /* PROFILES_COMMON_H */ 51 | 52 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/phone/zarlink/profiles/readme.txt: -------------------------------------------------------------------------------- 1 | Profiles have been generated with Profile Wizard version 2.7.0 from reference project 2 | 3 | For device parameters 4 | 5 | PCM : 6 | * Transmit edge : positive 7 | * Transmit Clock Slot : 0 8 | * Receive Clock Slot : 0 9 | * PCLK Frequency : 2048 10 | 11 | Interrupt Mode : TTL Compatible 12 | 13 | Driver : 14 | * Tick rate : 10 msec 15 | -------------------------------------------------------------------------------- /bcm63xx-phone/src/wait_queue/wait_queue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 3 | * Gilles Mazoyer 4 | * 5 | * This is free software, licensed under the GNU General Public License v2. 6 | * See /LICENSE for more information. 7 | */ 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | 15 | int bcm_wait_queue_wait_event_counter(bcm_wait_queue_t *t, int counter, bcmph_mutex_t *lock) 16 | { 17 | int ret; 18 | 19 | dd_bcm_pr_debug("%s()\n", __func__); 20 | 21 | do { // Empty loop 22 | if (NULL != lock) { 23 | bcm_assert(bcmph_mutex_is_locked(lock)); 24 | bcmph_mutex_unlock(lock); 25 | } 26 | ret = wait_event_interruptible(t->wq, (atomic_read(&(t->counter)) != counter)); 27 | if (0 != ret) { 28 | if (-ERESTARTSYS == ret) { 29 | d_bcm_pr_debug("wait_event_interruptible() has been interupted !\n"); 30 | } 31 | else { 32 | d_bcm_pr_err("wait_event_interruptible() failed !\n"); 33 | } 34 | break; 35 | } 36 | if (NULL != lock) { 37 | if (bcmph_mutex_lock_interruptible(lock)) { 38 | ret = -ERESTARTSYS; 39 | break; 40 | } 41 | } 42 | } while (0); 43 | return (ret); 44 | } 45 | 46 | int bcm_wait_queue_wait_event_counter_timeout(bcm_wait_queue_t *t, int counter, 47 | long timeout_in_jiffies, bcmph_mutex_t *lock) 48 | { 49 | int ret; 50 | 51 | dd_bcm_pr_debug("%s()\n", __func__); 52 | 53 | do { // Empty loop 54 | if (NULL != lock) { 55 | bcm_assert(bcmph_mutex_is_locked(lock)); 56 | bcmph_mutex_unlock(lock); 57 | } 58 | ret = wait_event_interruptible_timeout(t->wq, (atomic_read(&(t->counter)) != counter), timeout_in_jiffies); 59 | if (ret < 0) { 60 | if (-ERESTARTSYS == ret) { 61 | dd_bcm_pr_debug("wait_event_interruptible_timeout() has been interupted !\n"); 62 | } 63 | else { 64 | d_bcm_pr_err("wait_event_interruptible_timeout() failed !\n"); 65 | } 66 | break; 67 | } 68 | if (NULL != lock) { 69 | if (bcmph_mutex_lock_interruptible(lock)) { 70 | ret = -ERESTARTSYS; 71 | break; 72 | } 73 | } 74 | } while (0); 75 | return (ret); 76 | } 77 | -------------------------------------------------------------------------------- /documents/V.23-1988.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/V.23-1988.pdf -------------------------------------------------------------------------------- /documents/en_30065901v010301p_on_hook_data_transmission.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/en_30065901v010301p_on_hook_data_transmission.pdf -------------------------------------------------------------------------------- /documents/en_30065902v010301o_off_hook_data_transmission.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/en_30065902v010301o_off_hook_data_transmission.pdf -------------------------------------------------------------------------------- /documents/en_30065903v010301o_data_codings.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/en_30065903v010301o_data_codings.pdf -------------------------------------------------------------------------------- /documents/es_20123501v010101m_dtmf_general.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/es_20123501v010101m_dtmf_general.pdf -------------------------------------------------------------------------------- /documents/es_20123502v010101p_dtmf_transmitter.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/es_20123502v010101p_dtmf_transmitter.pdf -------------------------------------------------------------------------------- /documents/es_20123503v010301m_dtmf_receiver.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/es_20123503v010301m_dtmf_receiver.pdf -------------------------------------------------------------------------------- /documents/es_20123504v010201m_dtmf_transmitter_and_receiver.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgid69/bcm63xx-phone/a49d39ee17c6b083a48ed583c3644f154127b593/documents/es_20123504v010201m_dtmf_transmitter_and_receiver.pdf --------------------------------------------------------------------------------