├── .github └── workflows │ ├── kernel-lts.yaml │ ├── kernel-mainline.yaml │ ├── kernel-next.yaml │ └── kernel-stable.yaml ├── .gitignore ├── LICENSE ├── LICENSE.LGPL ├── Makefile ├── README ├── UPGRADE.txt ├── build_tools ├── builder ├── dkms-helper ├── genmodconf ├── install_firmware ├── kernel-cp ├── kernel-doc ├── live_dahdi ├── make_dist ├── make_static_devs ├── make_version ├── make_version_h ├── test_kernel_git └── uninstall-modules ├── ci ├── Dockerfile └── build-dahdi.sh ├── dahdi-modules ├── drivers └── dahdi │ ├── Kbuild │ ├── Kconfig │ ├── adt_lec.c │ ├── adt_lec.h │ ├── arith.h │ ├── biquad.h │ ├── dahdi-base.c │ ├── dahdi-sysfs-chan.c │ ├── dahdi-sysfs.c │ ├── dahdi-sysfs.h │ ├── dahdi-version.c │ ├── dahdi.h │ ├── dahdi_dummy.c │ ├── dahdi_dynamic.c │ ├── dahdi_dynamic_eth.c │ ├── dahdi_dynamic_ethmf.c │ ├── dahdi_dynamic_loc.c │ ├── dahdi_echocan_jpah.c │ ├── dahdi_echocan_kb1.c │ ├── dahdi_echocan_mg2.c │ ├── dahdi_echocan_oslec.c │ ├── dahdi_echocan_sec.c │ ├── dahdi_echocan_sec2.c │ ├── dahdi_transcode.c │ ├── datamods │ ├── Makefile │ ├── hdlc_cisco.c │ ├── hdlc_fr.c │ ├── hdlc_generic.c │ ├── hdlc_ppp.c │ ├── hdlc_raw.c │ ├── hdlc_raw_eth.c │ └── syncppp.c │ ├── ecdis.h │ ├── fir.h │ ├── firmware │ ├── Makefile │ └── make_firmware_object.in │ ├── fxo_modes.h │ ├── hpec │ ├── dahdi_echocan_hpec.c │ ├── hpec.h │ └── hpec_user.h │ ├── makefw.c │ ├── oct612x │ ├── Kbuild │ ├── Makefile │ ├── apilib │ │ ├── bt │ │ │ ├── octapi_bt0.c │ │ │ └── octapi_bt0_private.h │ │ ├── largmath │ │ │ └── octapi_largmath.c │ │ └── llman │ │ │ ├── octapi_llman.c │ │ │ └── octapi_llman_private.h │ ├── get_discards │ ├── include │ │ ├── apilib │ │ │ ├── octapi_bt0.h │ │ │ ├── octapi_largmath.h │ │ │ └── octapi_llman.h │ │ ├── digium_unused.h │ │ ├── oct6100api │ │ │ ├── oct6100_adpcm_chan_inst.h │ │ │ ├── oct6100_adpcm_chan_pub.h │ │ │ ├── oct6100_api.h │ │ │ ├── oct6100_api_inst.h │ │ │ ├── oct6100_apimi.h │ │ │ ├── oct6100_apiud.h │ │ │ ├── oct6100_channel_inst.h │ │ │ ├── oct6100_channel_pub.h │ │ │ ├── oct6100_chip_open_inst.h │ │ │ ├── oct6100_chip_open_pub.h │ │ │ ├── oct6100_chip_stats_inst.h │ │ │ ├── oct6100_chip_stats_pub.h │ │ │ ├── oct6100_conf_bridge_inst.h │ │ │ ├── oct6100_conf_bridge_pub.h │ │ │ ├── oct6100_debug_inst.h │ │ │ ├── oct6100_debug_pub.h │ │ │ ├── oct6100_defines.h │ │ │ ├── oct6100_errors.h │ │ │ ├── oct6100_events_inst.h │ │ │ ├── oct6100_events_pub.h │ │ │ ├── oct6100_interrupts_inst.h │ │ │ ├── oct6100_interrupts_pub.h │ │ │ ├── oct6100_mixer_inst.h │ │ │ ├── oct6100_mixer_pub.h │ │ │ ├── oct6100_phasing_tsst_inst.h │ │ │ ├── oct6100_phasing_tsst_pub.h │ │ │ ├── oct6100_playout_buf_inst.h │ │ │ ├── oct6100_playout_buf_pub.h │ │ │ ├── oct6100_remote_debug_inst.h │ │ │ ├── oct6100_remote_debug_pub.h │ │ │ ├── oct6100_tlv_inst.h │ │ │ ├── oct6100_tone_detection_inst.h │ │ │ ├── oct6100_tone_detection_pub.h │ │ │ ├── oct6100_tsi_cnct_inst.h │ │ │ ├── oct6100_tsi_cnct_pub.h │ │ │ └── oct6100_tsst_inst.h │ │ ├── octdef.h │ │ ├── octmac.h │ │ ├── octosdependant.h │ │ ├── octrpc │ │ │ ├── oct6100_rpc_protocol.h │ │ │ └── rpc_protocol.h │ │ ├── octtype.h │ │ ├── octtypevx.h │ │ └── octtypewin.h │ ├── oct612x-user.c │ ├── oct612x.h │ ├── octasic-helper │ ├── octdeviceapi │ │ └── oct6100api │ │ │ ├── oct6100_adpcm_chan_priv.h │ │ │ ├── oct6100_api │ │ │ ├── oct6100_adpcm_chan.c │ │ │ ├── oct6100_channel.c │ │ │ ├── oct6100_chip_open.c │ │ │ ├── oct6100_chip_stats.c │ │ │ ├── oct6100_conf_bridge.c │ │ │ ├── oct6100_debug.c │ │ │ ├── oct6100_events.c │ │ │ ├── oct6100_interrupts.c │ │ │ ├── oct6100_memory.c │ │ │ ├── oct6100_miscellaneous.c │ │ │ ├── oct6100_mixer.c │ │ │ ├── oct6100_phasing_tsst.c │ │ │ ├── oct6100_playout_buf.c │ │ │ ├── oct6100_remote_debug.c │ │ │ ├── oct6100_tlv.c │ │ │ ├── oct6100_tone_detection.c │ │ │ ├── oct6100_tsi_cnct.c │ │ │ ├── oct6100_tsst.c │ │ │ └── oct6100_user.c │ │ │ ├── oct6100_apimi │ │ │ └── oct6100_mask_interrupts.c │ │ │ ├── oct6100_channel_priv.h │ │ │ ├── oct6100_chip_open_priv.h │ │ │ ├── oct6100_chip_stats_priv.h │ │ │ ├── oct6100_conf_bridge_priv.h │ │ │ ├── oct6100_debug_priv.h │ │ │ ├── oct6100_events_priv.h │ │ │ ├── oct6100_interrupts_priv.h │ │ │ ├── oct6100_memory_priv.h │ │ │ ├── oct6100_miscellaneous_priv.h │ │ │ ├── oct6100_mixer_priv.h │ │ │ ├── oct6100_phasing_tsst_priv.h │ │ │ ├── oct6100_playout_buf_priv.h │ │ │ ├── oct6100_remote_debug_priv.h │ │ │ ├── oct6100_tlv_priv.h │ │ │ ├── oct6100_tone_detection_priv.h │ │ │ ├── oct6100_tsi_cnct_priv.h │ │ │ ├── oct6100_tsst_priv.h │ │ │ └── oct6100_version.h │ └── test.c │ ├── opvxa1200 │ ├── Kbuild │ ├── Makefile │ └── base.c │ ├── proslic.h │ ├── voicebus │ ├── GpakApi.c │ ├── GpakApi.h │ ├── GpakCust.c │ ├── GpakCust.h │ ├── GpakHpi.h │ ├── Kbuild │ ├── gpakErrs.h │ ├── gpakenum.h │ ├── voicebus.c │ ├── voicebus.h │ ├── voicebus_net.c │ ├── voicebus_net.h │ ├── vpmadtreg.c │ ├── vpmadtreg.h │ ├── vpmoct.c │ └── vpmoct.h │ ├── vpmadt032_loader │ └── dahdi_vpmadt032_loader.c │ ├── wcaxx-base.c │ ├── wcb4xxp │ ├── Kbuild │ ├── base.c │ └── wcb4xxp.h │ ├── wcfxo.c │ ├── wct1xxp.c │ ├── wct4xxp │ ├── Kbuild │ ├── base.c │ ├── vpm450m.c │ ├── vpm450m.h │ ├── wct4xxp-diag.c │ └── wct4xxp.h │ ├── wctc4xxp │ ├── Kbuild │ └── base.c │ ├── wctdm.c │ ├── wctdm24xxp │ ├── Kbuild │ ├── base.c │ ├── wctdm24xxp.h │ ├── xhfc.c │ └── xhfc.h │ ├── wcte11xp.c │ ├── wcte12xp │ ├── Kbuild │ ├── base.c │ └── wcte12xp.h │ ├── wcte13xp-base.c │ ├── wcte43x-base.c │ ├── wcxb.c │ ├── wcxb.h │ ├── wcxb_flash.c │ ├── wcxb_flash.h │ ├── wcxb_spi.c │ ├── wcxb_spi.h │ └── xpp │ ├── Changelog_xpp │ ├── Kbuild │ ├── Kconfig │ ├── Makefile │ ├── XppConfig.pm │ ├── card_bri.c │ ├── card_bri.h │ ├── card_echo.c │ ├── card_echo.h │ ├── card_fxo.c │ ├── card_fxo.h │ ├── card_fxs.c │ ├── card_fxs.h │ ├── card_global.c │ ├── card_global.h │ ├── card_pri.c │ ├── card_pri.h │ ├── dahdi_debug.c │ ├── dahdi_debug.h │ ├── firmwares │ ├── FPGA_1141.hex │ ├── FPGA_1151.hex │ ├── FPGA_1161.201.hex │ ├── FPGA_1161.202.hex │ ├── FPGA_1161.hex │ ├── FPGA_FXS.hex │ ├── LICENSE.firmware │ ├── Makefile │ ├── PIC_TYPE_1.hex │ ├── PIC_TYPE_2.hex │ ├── PIC_TYPE_3.hex │ ├── PIC_TYPE_4.hex │ ├── PIC_TYPE_6.hex │ ├── README │ ├── USB_FW.201.hex │ ├── USB_FW.202.hex │ ├── USB_FW.hex │ └── USB_RECOV.hex │ ├── init_card_1_30 │ ├── init_card_2_30 │ ├── init_card_3_30 │ ├── init_card_4_30 │ ├── init_card_5_30 │ ├── init_card_6_30 │ ├── mmapbus.c │ ├── mmapbus.h │ ├── mmapdrv.c │ ├── param_doc │ ├── parport_debug.c │ ├── parport_debug.h │ ├── print_fxo_modes.c │ ├── xbus-core.c │ ├── xbus-core.h │ ├── xbus-pcm.c │ ├── xbus-pcm.h │ ├── xbus-sysfs.c │ ├── xdefs.h │ ├── xframe_queue.c │ ├── xframe_queue.h │ ├── xpd.h │ ├── xpp.conf │ ├── xpp_dahdi.c │ ├── xpp_dahdi.h │ ├── xpp_debug │ ├── xpp_usb.c │ ├── xproto.c │ └── xproto.h └── include └── dahdi ├── Kbuild ├── dahdi_config.h ├── fasthdlc.h ├── kernel.h ├── user.h └── wctdm_user.h /.github/workflows/kernel-lts.yaml: -------------------------------------------------------------------------------- 1 | name: DAHDI Kernel CI for LTS kernels 2 | 3 | on: 4 | schedule: 5 | - cron: 00 02 * * * 6 | pull_request: 7 | 8 | jobs: 9 | kernel_test: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | max-parallel: 1 13 | fail-fast: false 14 | matrix: 15 | kernel_branch: [ 16 | 'linux-4.14.y', 17 | 'linux-4.19.y', 18 | 'linux-5.4.y', 19 | 'linux-5.10.y', 20 | 'linux-5.15.y', 21 | 'linux-6.1.y', 22 | 'linux-6.6.y' 23 | ] 24 | steps: 25 | - name: Cache kernel git repo 26 | id: cache-kernel-git 27 | uses: actions/cache@v3 28 | with: 29 | path: ./linux 30 | key: kernel-git-cache 31 | 32 | - if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }} 33 | name: Clone Kernel repo 34 | run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 35 | 36 | - name: Update kernel git 37 | run: git fetch 38 | working-directory: ./linux 39 | 40 | - name: Switch to desired branch 41 | run: git checkout ${{matrix.kernel_branch}} 42 | working-directory: ./linux 43 | 44 | - name: Fetch dahdi-linux 45 | uses: actions/checkout@v3 46 | with: 47 | path: dahdi-linux 48 | 49 | - name: Create build container 50 | run: docker build ./ci -t dahdi-builder 51 | working-directory: ./dahdi-linux 52 | 53 | - name: Build dahdi-linux 54 | run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder" 55 | 56 | -------------------------------------------------------------------------------- /.github/workflows/kernel-mainline.yaml: -------------------------------------------------------------------------------- 1 | name: DAHDI Kernel CI for mainline kernel 2 | 3 | on: 4 | schedule: 5 | - cron: 00 02 * * * 6 | pull_request: 7 | 8 | jobs: 9 | kernel_test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Cache kernel git repo 13 | id: cache-kernel-git 14 | uses: actions/cache@v3 15 | with: 16 | path: ./linux 17 | key: kernel-mainline-git-cache 18 | 19 | - if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }} 20 | name: Clone Kernel repo 21 | run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 22 | 23 | - name: Update kernel git 24 | run: git fetch 25 | working-directory: ./linux 26 | 27 | - name: Switch to desired branch 28 | run: git checkout master 29 | working-directory: ./linux 30 | 31 | - name: Fetch dahdi-linux 32 | uses: actions/checkout@v3 33 | with: 34 | path: dahdi-linux 35 | 36 | - name: Create build container 37 | run: docker build ./ci -t dahdi-builder 38 | working-directory: ./dahdi-linux 39 | 40 | - name: Build dahdi-linux 41 | run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder" 42 | 43 | -------------------------------------------------------------------------------- /.github/workflows/kernel-next.yaml: -------------------------------------------------------------------------------- 1 | name: DAHDI Kernel CI for linux-next 2 | 3 | on: 4 | schedule: 5 | - cron: 00 02 * * * 6 | pull_request: 7 | 8 | jobs: 9 | kernel_test: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Cache kernel git repo 13 | id: cache-kernel-git 14 | uses: actions/cache@v3 15 | with: 16 | path: ./linux-next 17 | key: kernel-next-git-cache 18 | 19 | - if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }} 20 | name: Clone Kernel repo 21 | run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 22 | 23 | - name: Update kernel git 24 | run: git fetch 25 | working-directory: ./linux-next 26 | 27 | - name: Switch to desired branch 28 | run: git checkout master 29 | working-directory: ./linux-next 30 | 31 | - name: Fetch dahdi-linux 32 | uses: actions/checkout@v3 33 | with: 34 | path: dahdi-linux 35 | 36 | - name: Create build container 37 | run: docker build ./ci -t dahdi-builder 38 | working-directory: ./dahdi-linux 39 | 40 | - name: Build dahdi-linux 41 | run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux-next:/linux dahdi-builder" 42 | 43 | -------------------------------------------------------------------------------- /.github/workflows/kernel-stable.yaml: -------------------------------------------------------------------------------- 1 | name: DAHDI Kernel CI for Stable kernel 2 | 3 | on: 4 | schedule: 5 | - cron: 00 02 * * * 6 | pull_request: 7 | 8 | jobs: 9 | kernel_test: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | max-parallel: 1 13 | fail-fast: false 14 | matrix: 15 | kernel_branch: [ 16 | 'linux-6.5.y', 17 | 'linux-6.6.y', 18 | 'linux-6.7.y', 19 | 'linux-6.8.y' 20 | ] 21 | steps: 22 | - name: Cache kernel git repo 23 | id: cache-kernel-git 24 | uses: actions/cache@v3 25 | with: 26 | path: ./linux 27 | key: kernel-git-cache 28 | 29 | - if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }} 30 | name: Clone Kernel repo 31 | run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 32 | 33 | - name: Update kernel git 34 | run: git fetch 35 | working-directory: ./linux 36 | 37 | - name: Switch to desired branch 38 | run: git checkout ${{matrix.kernel_branch}} 39 | working-directory: ./linux 40 | 41 | - name: Fetch dahdi-linux 42 | uses: actions/checkout@v3 43 | with: 44 | path: dahdi-linux 45 | 46 | - name: Create build container 47 | run: docker build ./ci -t dahdi-builder 48 | working-directory: ./dahdi-linux 49 | 50 | - name: Build dahdi-linux 51 | run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder" 52 | 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Files that are generated as part of the build process which we do not want git 2 | # to track. 3 | 4 | /.pc 5 | 6 | .cache.mk 7 | *.[oa] 8 | *.mod 9 | *.mod.[oc] 10 | *.ko 11 | *.ko.unsigned 12 | *.cmd 13 | *.order 14 | *.tar.gz 15 | tags 16 | cscope.* 17 | *.symvers 18 | *.markers 19 | .*.o.d 20 | *.ur-safe 21 | 22 | README.html 23 | modules.order 24 | Module.markers 25 | build_tools/checkpatch.pl 26 | drivers/dahdi/xpp/*.verified 27 | drivers/dahdi/.tmp_versions/ 28 | drivers/dahdi/Module.symvers 29 | drivers/dahdi/makefw 30 | drivers/dahdi/radfw.h 31 | drivers/dahdi/tor2fw.h 32 | drivers/dahdi/xpp/init_fxo_modes 33 | drivers/dahdi/xpp/print_fxo_modes 34 | drivers/dahdi/xpp/xpp_version.h 35 | include/dahdi/version.h 36 | drivers/dahdi/vpmadt032_loader/vpmadt032_loader.h 37 | drivers/dahdi/vpmadt032_loader/vpmadt032_x86_32.o_shipped 38 | drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o_shipped 39 | drivers/dahdi/firmware/dahdi-fw-hx8.bin 40 | drivers/dahdi/firmware/dahdi-fw-oct6114-064.bin 41 | drivers/dahdi/firmware/dahdi-fw-oct6114-128.bin 42 | drivers/dahdi/firmware/dahdi-fw-oct6114-256.bin 43 | drivers/dahdi/firmware/dahdi-fw-tc400m.bin 44 | drivers/dahdi/firmware/dahdi-fw-te820.bin 45 | drivers/dahdi/firmware/dahdi-fw-vpmoct032.bin 46 | drivers/dahdi/firmware/dahdi-fw-a4a.bin 47 | drivers/dahdi/firmware/dahdi-fw-a4b.bin 48 | drivers/dahdi/firmware/dahdi-fw-a8a.bin 49 | drivers/dahdi/firmware/dahdi-fw-a8b.bin 50 | drivers/dahdi/firmware/dahdi-fw-oct6114-032.bin 51 | drivers/dahdi/firmware/dahdi-fw-te133.bin 52 | drivers/dahdi/firmware/dahdi-fw-te134.bin 53 | drivers/dahdi/firmware/dahdi-fw-te435.bin 54 | drivers/dahdi/firmware/make_firmware_object 55 | -------------------------------------------------------------------------------- /build_tools/genmodconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # this script makes an attempt to build a proper set of rules 4 | # for loading the DAHDI modules and automatically running dahdi_xcfg 5 | # 6 | # it accepts two parameters: 7 | # the root prefix to be used for finding/creating the files 8 | # the list of module names being installed 9 | # 10 | # the process is as follows: 11 | # 12 | # the file can be located at /etc/modprobe.conf (combined with all 13 | # other rules), /etc/modprobe.d/dahdi (DAHDI only) or /etc/modules.d/dahdi 14 | # (DAHDI only) 15 | # 16 | # when the file is DAHDI rules only, then we don't preserve the existing 17 | # contents of the file; the system administrator can put desired options and 18 | # overrides in a separate file with a name that appears earlier in the sort 19 | # order, so there is no need to edit the file produced by this script 20 | # 21 | # when the file is combined with all other rules, then we make a backup 22 | # of it and remove all the old DAHDI rules we can find, replacing them with 23 | # new ones 24 | # 25 | # in addition, versions of module-init-tools 3.2.0 and later 26 | # have the ability to pass module parameters specified on the modprobe command 27 | # line to commands in 'install' rules, thus keeping them from being lost, so 28 | # we try to determine what version is installed and take advantage of that 29 | 30 | toolver=`/sbin/modprobe --version 2>/dev/null| awk '{print $3}' | cut -d. -f2 | cut -d- -f1` 31 | if [ ${toolver} -ge 2 ]; then 32 | cmdopts=\$CMDLINE_OPTS 33 | fi 34 | if [ -d ${1}/etc/modprobe.d ]; then 35 | target=${1}/etc/modprobe.d/dahdi 36 | elif [ -d ${1}/etc/modules.d ]; then 37 | target=${1}/etc/modules.d/dahdi 38 | elif [ -f ${1}/etc/modprobe.conf ]; then 39 | target=${1}/etc/modprobe.conf 40 | combined=1 41 | elif [ -f ${1}/etc/conf.modules ]; then 42 | target=${1}/etc/conf.modules 43 | combined=1 44 | else 45 | echo No suitable location for module rules can be found... exiting. 46 | exit 1 47 | fi 48 | 49 | if [ -n "${combined}" ]; then 50 | if [ -f ${target} ]; then 51 | mv ${target} ${target}.bak 52 | cat ${target}.bak | grep -v "alias char-major-250" | grep -v "alias char-major-196" > ${target} 53 | fi 54 | else 55 | if [ -f ${target} ]; then 56 | mv ${target} ${target}.bak 57 | fi 58 | echo "# automatically generated file; do not edit" > ${target} 59 | fi 60 | 61 | echo Building ${target}... 62 | 63 | for mod in ${2}; do 64 | if ! grep -q "install ${mod} " ${target}; then 65 | echo "install ${mod} /sbin/modprobe --ignore-install ${mod} ${cmdopts} && /sbin/ztcfg" >> ${target} 66 | fi 67 | done 68 | 69 | if [ -z "${combined}" ]; then 70 | echo "***" 71 | echo "*** WARNING:" 72 | echo "*** If you had custom settings in ${target}," 73 | echo "*** they have been moved to ${target}.bak." 74 | echo "***" 75 | echo "*** In the future, do not edit ${target}, but" 76 | echo "*** instead put your changes in another file" 77 | echo "*** in the same directory so that they will not" 78 | echo "*** be overwritten by future DAHDI updates." 79 | echo "***" 80 | fi 81 | -------------------------------------------------------------------------------- /build_tools/install_firmware: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a helper script intended to be called from 3 | # drivers/dahdi/firmware/Makefile to install the different firmware version. 4 | 5 | FIRMWARE_PATTERN=$1 6 | FIRMWARE_VERSION=$2 7 | DESTDIR=$3 8 | target="$DESTDIR/lib/firmware" 9 | 10 | if ! test -f $target/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}; then 11 | echo "Installing ${FIRMWARE_PATTERN}.bin to $target" 12 | tar --no-same-owner -xf ${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}.tar.gz || exit 1 13 | install -m 644 ${FIRMWARE_PATTERN}.bin $target || exit 1 14 | rm -rf $target/.${FIRMWARE_PATTERN}-* 15 | touch $target/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION} 16 | # Remove the .bin file so that if the version is reverted, it will not 17 | # be installed with a non-matching ${FIRMARE_VERSION} file. 18 | rm ${FIRMWARE_PATTERN}.bin 19 | else 20 | echo "Firmware ${FIRMWARE_PATTERN}.bin is already installed with required version ${FIRMWARE_VERSION}" 21 | fi 22 | -------------------------------------------------------------------------------- /build_tools/kernel-cp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A simple wrapper to the kernel.org script checkpatch.pl 4 | 5 | # Usage: 6 | # 7 | # svn diff | ./build_tools/kernel-cp - 8 | # ./build_tools/kernel-cp my.diff 9 | # ./build_tools/kernel-cp --file drivers/dahdi/wctdm.c 10 | 11 | mydir=`dirname $0` 12 | 13 | check_patch_dir="$mydir/cp" 14 | rel_path="scripts/checkpatch.pl" 15 | check_patch="$mydir/checkpatch.pl" 16 | URL='http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=scripts/checkpatch.pl;hb=HEAD' 17 | 18 | # Required files in directories in the tree 19 | SUBDIRS="fs ipc lib arch init scripts drivers kernel Documentation include" 20 | 21 | set -e 22 | 23 | if [ "$1" = 'download' ]; then 24 | if [ -x "$check_patch" ]; then 25 | exit 0 26 | fi 27 | 28 | wget -O "$check_patch" "$URL" 29 | if [ `wc -c <"$check_patch"` -lt 1000 ]; then 30 | # already downloaded 31 | # FIXME: redirection fails on downloading and you get a 32 | # short HTML file as your "script". 33 | echo >&2 "$0: Error: Download failed". 34 | exit 1 35 | fi 36 | chmod +x "$check_patch" 37 | 38 | exit 0 39 | fi 40 | 41 | if [ ! -x "$check_patch" ]; then 42 | echo >&2 "Script $check_patch not found. Download it?" 43 | echo >&2 "" 44 | echo >&2 " $0 download" 45 | exit 1 46 | fi 47 | 48 | exec $check_patch --no-tree --no-signoff "$@" 49 | -------------------------------------------------------------------------------- /build_tools/kernel-doc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # a wrapper to kernel-doc from the kernel source tree 4 | # 5 | # Copyright (C) 2009 by Xorcom 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, write to the Free Software 19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 | 21 | # For 'man' version: build_tools/kernel-doc -f man | man -l - 22 | 23 | files="drivers/dahdi/dahdi-base.c" 24 | format="html" 25 | kernel="/lib/modules/`uname -r`/build" 26 | 27 | usage() { 28 | me=`basename $0` 29 | cat <&2 "Terminating..." ; exit 1 ; fi 43 | 44 | eval set -- "$options" 45 | 46 | while true ; do 47 | case "$1" in 48 | -f|--format) format="$2"; shift ;; 49 | -h|--help) usage; exit 0;; 50 | -k|--kernel) kernel="$2"; shift ;; 51 | --) shift ; break ;; 52 | esac 53 | shift; 54 | done 55 | 56 | if [ "$*" != '' ]; then 57 | files="$*" #FIXME: spaces 58 | fi 59 | 60 | script="$kernel/scripts/kernel-doc" 61 | $script -$format $files 62 | 63 | 64 | -------------------------------------------------------------------------------- /build_tools/make_dist: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if [ "$#" -ne 2 ]; then 4 | echo >&2 "Usage: $0 " 5 | exit 1 6 | fi 7 | package="$1" 8 | version="$2" 9 | tarball_prefix="$package-$version" 10 | echo "I: Making dist tarball for $tarball_prefix" 11 | tarball_name="$tarball_prefix.tar.gz" 12 | 13 | tmp_work_dir=".tmp" 14 | tmp_version_dir="$tmp_work_dir/$tarball_prefix" 15 | 16 | if [ "$DESTDIR" != '' ]; then 17 | destdir="$DESTDIR/" 18 | fi 19 | output="$destdir$tarball_name" 20 | 21 | mkdir -p "$tmp_version_dir" 22 | git archive --format tar HEAD | tar xf - -C "$tmp_version_dir" 23 | echo "$version" > "$tmp_version_dir/.version" 24 | tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix" 25 | rm -rf "$tmp_work_dir" 26 | echo "I: tarball is ready: '$output'" 27 | -------------------------------------------------------------------------------- /build_tools/make_static_devs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # make_static_devs: create static device files for DAHDI 6 | 7 | # Copyright (C) 2010 by Xorcom 8 | # 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | 23 | # In most cases DAHDI device files are generated by udev, 24 | # but there would be cases where you'd want to just have static device 25 | # files. Note that if you do use udev, that static device files will be 26 | # essentially deleted. 27 | 28 | BASE_DIR="/dev/dahdi" 29 | 30 | usage() { 31 | me=`basename $0` 32 | echo "$me: Generate static DAHDI device files" 33 | echo "" 34 | echo "Usage:" 35 | echo " $me [-h] [-d base_dir]" 36 | echo " -d base_dir: create under base_dir (default: $BASE_DIR)" 37 | echo " -h: this help message." 38 | } 39 | 40 | 41 | mknod_safe() { 42 | if [ -c $1 ]; then return; fi 43 | mknod "$@" 44 | } 45 | 46 | while getopts 'd:h' opt; do 47 | case "$opt" in 48 | h) usage; exit 0;; 49 | d) BASE_DIR="$OPTARG";; 50 | \?) usage; exit 1;; 51 | esac 52 | done 53 | 54 | mkdir -p "$BASE_DIR" 55 | mknod_safe "${BASE_DIR}/ctl" c 196 0 56 | mknod_safe "${BASE_DIR}/transcode" c 196 250 57 | mknod_safe "${BASE_DIR}/timer" c 196 253 58 | mknod_safe "${BASE_DIR}/channel" c 196 254 59 | mknod_safe "${BASE_DIR}/pseudo" c 196 255 60 | 61 | # The following are not used by Asterisk itself nowadays. Some DAHDI 62 | # users still find it simpler to open them directly rather than using 63 | # /dev/dahdi/channel and the DAHDI_SPECIFY ioctl . 64 | for i in `seq 249`; do 65 | mknod_safe ${BASE_DIR}/$i c 196 $i 66 | done 67 | 68 | -------------------------------------------------------------------------------- /build_tools/make_version: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f ${1}/.version ]; then 4 | cat ${1}/.version 5 | elif [ -d ${1}/.git ]; then 6 | VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v\([0-9]\)/\1/"` 7 | if [ $? -ne 0 ]; then 8 | MODIFIED="" 9 | if [ "`git ls-files -m | wc -l`" != "0" ]; then 10 | MODIFIED="M" 11 | fi 12 | # Some older versions of git do not support all the above 13 | # options. 14 | VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED} 15 | fi 16 | echo ${VERSION} 17 | else 18 | # Use the directory information in the absence of any other version 19 | # information 20 | pwd -P 21 | fi 22 | -------------------------------------------------------------------------------- /build_tools/make_version_h: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat << END 3 | /* 4 | * version.h 5 | * Automatically generated 6 | */ 7 | #define DAHDI_VERSION "${DAHDIVERSION}" 8 | 9 | END 10 | -------------------------------------------------------------------------------- /build_tools/test_kernel_git: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | GIT_URL=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 6 | CONF_FILE=build_tools/git_test.conf 7 | 8 | usage() { 9 | me=`basename $0` 10 | echo "$me: test building DAHDI vs. kernel from git" 11 | echo "Usage:" 12 | echo " $me checkout Pull a kernel version into " 13 | echo " $me update Update (pull) the kernel tree." 14 | echo " $me setver Set the kernel version" 15 | echo " $me versions Print available versions" 16 | echo " $me version Print current (kernel) version" 17 | echo " $me version_driver Print the version of DAHDI" 18 | echo " $me build Test-build" 19 | echo " $me git Run " 20 | echo "" 21 | echo " $me versions [pattern] List available versions." 22 | } 23 | 24 | # Set a variable in $CONF_FILE 25 | # The format of CONF_FILE is assumed to be: 26 | # VAR=value 27 | # in shell syntax. "value" may be quoted. 28 | # "value should not contain a '|' character. 29 | set_var() { 30 | var="$1" 31 | val="$2" 32 | if grep -q "^$var=" $CONF_FILE 2>/dev/null; then 33 | sed -i -e "s|^$var=.*|$var=\"$val\"|" $CONF_FILE 34 | else 35 | echo "$var=\"$val\"" >>$CONF_FILE 36 | fi 37 | } 38 | 39 | if [ -r "$CONF_FILE" ]; then . "$CONF_FILE"; fi 40 | 41 | if echo "$CONF_FILE" | grep -qv '^/'; then 42 | # make CONF_FILE an absolute path: 43 | CONF_FILE="$PWD/$CONF_FILE" 44 | fi 45 | 46 | command="$1" 47 | 48 | case "$command" in 49 | checkout) 50 | kernel_dir="$2" 51 | cd "$kernel_dir" 52 | git clone $GIT_URL 53 | set_var kernel_dir "$kernel_dir/linux-2.6" 54 | ;; 55 | update) 56 | cd "$kernel_dir" 57 | git pull 58 | ;; 59 | git) 60 | cd "$kernel_dir" 61 | shift 62 | git "$@" 63 | ;; 64 | versions) 65 | cd "$kernel_dir" 66 | git tag -l $2 | cut -c2- 67 | ;; 68 | version) 69 | cd "$kernel_dir" 70 | echo "Configured: $kernel_ver" 71 | echo -n "Actual: " 72 | git describe | cut -c2- 73 | ;; 74 | version_driver) 75 | version_h=include/dahdi/version.h 76 | make $version_h >/dev/null 77 | awk -F'"' '/DAHDI_VERSION/{print $2}' $version_h 78 | ;; 79 | setver) 80 | kernel_ver="$2" 81 | tag="v$kernel_ver" 82 | cd "$kernel_dir" 83 | git-reset --hard "$tag" 84 | make distclean 85 | make defconfig modules_prepare 86 | set_var kernel_ver "$kernel_ver" 87 | ;; 88 | test|build) 89 | # you can pass extra parameters to the make command in 90 | # two ways: 91 | # 1. Set the value of MAKE_PARAMS in git_test.conf . 92 | # 2. Any extra command-line parameter. 93 | shift 94 | make KSRC="$kernel_dir" KVERS=$kernel_ver $MAKE_PARAMS "$@" 95 | ;; 96 | *) 97 | echo "$0: no such command $command. Aborting." 98 | usage 99 | exit 1 100 | ;; 101 | esac 102 | -------------------------------------------------------------------------------- /build_tools/uninstall-modules: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script takes two arguments: a top-level module name, and a kernel version string 4 | # 5 | # It will search the entire /lib/modules directory tree for the given kernel version, 6 | # and find all modules that are dependent (even indirectly) on the specified module. 7 | # After producing that list, it will remove all those modules. 8 | 9 | base="${1}" 10 | deptree="${base}" 11 | rmlist="" 12 | founddep=1 13 | 14 | checkmod() { 15 | SAVEIFS="${IFS}" 16 | IFS="," 17 | modname=`basename ${1}` 18 | modname=${modname%.ko} 19 | if test "${modname}" = "${base}"; then 20 | rmlist="${rmlist} ${1}" 21 | IFS="${SAVEIFS}" 22 | return 23 | fi 24 | for dep in `modinfo -F depends ${1}`; do 25 | for mod in ${deptree}; do 26 | if test "${dep}" = "${mod}"; then 27 | addit=1 28 | for checkmod in ${deptree}; do 29 | if test "${checkmod}" = "${modname}"; then 30 | addit=0 31 | break 32 | fi 33 | done 34 | if test "${addit}" = "1"; then 35 | deptree="${deptree},${modname%.ko}" 36 | rmlist="${rmlist} ${1}" 37 | founddep=1 38 | fi 39 | fi 40 | done 41 | done 42 | IFS="${SAVEIFS}" 43 | } 44 | 45 | 46 | while test "${founddep}" = "1"; do 47 | founddep=0 48 | find /lib/modules/${2}/misc -name \*.ko -print > /tmp/modlist.$$ 2> /dev/null 49 | find /lib/modules/${2}/extra -name \*.ko -print >> /tmp/modlist.$$ 2> /dev/null 50 | find /lib/modules/${2}/zaptel -name \*.ko -print >> /tmp/modlist.$$ 2> /dev/null 51 | find /lib/modules/${2}/dahdi -name \*.ko -print >> /tmp/modlist.$$ 2> /dev/null 52 | exec 9<&0 < /tmp/modlist.$$ 53 | while read mod; do 54 | checkmod ${mod} 55 | done 56 | exec 0<&9 9<&- 57 | rm /tmp/modlist.$$ 58 | done 59 | 60 | if test -n "${rmlist}"; then 61 | for mod in ${rmlist}; do 62 | rm -f ${mod} 63 | done 64 | fi 65 | -------------------------------------------------------------------------------- /ci/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm 2 | RUN apt-get update 3 | RUN apt-get -y upgrade 4 | RUN apt-get -y install gcc make perl-modules 5 | RUN apt-get -y install flex bison wget libssl-dev libelf-dev bc 6 | ENTRYPOINT [ "/src/ci/build-dahdi.sh" ] 7 | -------------------------------------------------------------------------------- /ci/build-dahdi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd /linux 3 | echo "### Cleaning Kernel tree" 4 | echo " # rm .config" 5 | rm .config 6 | 7 | echo " # make clean" 8 | make clean 9 | echo "### Get kernel version" 10 | make kernelversion 11 | echo "### Create defconfig and prepare for module building" 12 | echo " # make x86_64_defconfig" 13 | make x86_64_defconfig 14 | echo " # make modules_prepare" 15 | make modules_prepare 16 | 17 | echo " # make kernel" 18 | make 19 | 20 | echo " #make modules" 21 | make modules 22 | 23 | echo "### Building DAHDI modules and installing" 24 | cd /src 25 | echo " # make clean" 26 | make clean 27 | echo " # make install KSRC=/linux" 28 | make install KSRC=/linux 29 | 30 | -------------------------------------------------------------------------------- /dahdi-modules: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MODULES="dahdi" 4 | DAHDI_MODULES_FILE="/etc/dahdi/modules" 5 | 6 | usage() { 7 | cat < 11 | 12 | * load: Loads all modules listed in /etc/dahdi/modules (one per line) 13 | * unload: Unloads the DAHDI modules (all the modules that are dependencies 14 | of $MODULES). 15 | EOF 16 | } 17 | 18 | # recursively unload a module and its dependencies, if possible. 19 | # where's modprobe -r when you need it? 20 | # inputs: module to unload. 21 | # returns: the result from 22 | unload_module() { 23 | module="$1" 24 | line=`lsmod 2>/dev/null | grep "^$1 "` 25 | if [ "$line" = '' ]; then return; fi # module was not loaded 26 | 27 | set -- $line 28 | # $1: the original module, $2: size, $3: refcount, $4: deps list 29 | mods=`echo $4 | tr , ' '` 30 | ec_modules="" 31 | # xpp_usb keeps the xpds below busy if an xpp hardware is 32 | # connected. Hence must be removed before them: 33 | case "$module" in xpd_*) mods="xpp_usb $mods";; esac 34 | 35 | for mod in $mods; do 36 | case "$mod" in 37 | dahdi_echocan_*) 38 | ec_modules="$mod $ec_modules" 39 | ;; 40 | *) 41 | # run in a subshell, so it won't step over our vars: 42 | (unload_module $mod) 43 | ;; 44 | esac 45 | done 46 | # Now that all the other dependencies are unloaded, we can unload the 47 | # dahdi_echocan modules. The drivers that register spans may keep 48 | # references on the echocan modules before they are unloaded. 49 | for mod in $ec_modules; do 50 | (unload_module $mod) 51 | done 52 | rmmod $module 53 | } 54 | 55 | unload_modules() { 56 | for module in "$@"; do 57 | unload_module $module 58 | done 59 | } 60 | 61 | load_modules() { 62 | modules=`sed -e 's/#.*$//' $DAHDI_MODULES_FILE 2>/dev/null` 63 | for line in $modules; do 64 | modprobe $line 65 | done 66 | } 67 | 68 | case "$1" in 69 | load) load_modules "$@";; 70 | unload) unload_modules $MODULES;; 71 | *) usage;; 72 | esac 73 | -------------------------------------------------------------------------------- /drivers/dahdi/adt_lec.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ADT Line Echo Canceller Parameter Parsing 3 | * 4 | * Copyright (C) 2008-2009 Digium, Inc. 5 | * 6 | * Kevin P. Fleming 7 | * 8 | * All rights reserved. 9 | * 10 | */ 11 | 12 | /* 13 | * See http://www.asterisk.org for more information about 14 | * the Asterisk project. Please do not directly contact 15 | * any of the maintainers of this project for assistance; 16 | * the project provides a web site, mailing lists and IRC 17 | * channels for your use. 18 | * 19 | * This program is free software, distributed under the terms of 20 | * the GNU General Public License Version 2 as published by the 21 | * Free Software Foundation. See the LICENSE file included with 22 | * this program for more details. 23 | */ 24 | 25 | #ifndef _ADT_LEC_C 26 | #define _ADT_LEC_C 27 | 28 | #include 29 | 30 | static inline void adt_lec_init_defaults(struct adt_lec_params *params, __u32 tap_length) 31 | { 32 | params->tap_length = tap_length; 33 | params->nlp_type = 0; 34 | params->nlp_max_suppress = 0; 35 | params->nlp_threshold = 0; 36 | } 37 | 38 | static int adt_lec_parse_params(struct adt_lec_params *params, 39 | struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p) 40 | { 41 | unsigned int x; 42 | char *c; 43 | 44 | params->tap_length = ecp->tap_length; 45 | 46 | for (x = 0; x < ecp->param_count; x++) { 47 | for (c = p[x].name; *c; c++) 48 | *c = tolower(*c); 49 | if (!strcmp(p[x].name, "nlp_type")) { 50 | switch (p[x].value) { 51 | case ADT_LEC_NLP_OFF: 52 | case ADT_LEC_NLP_MUTE: 53 | case ADT_LEC_RANDOM_NOISE: 54 | case ADT_LEC_HOTH_NOISE: 55 | case ADT_LEC_SUPPRESS: 56 | params->nlp_type = p[x].value; 57 | break; 58 | default: 59 | return -EINVAL; 60 | } 61 | } else if (!strcmp(p[x].name, "nlp_thresh")) { 62 | params->nlp_threshold = p[x].value; 63 | } else if (!strcmp(p[x].name, "nlp_suppress")) { 64 | params->nlp_max_suppress = p[x].value; 65 | } else { 66 | return -EINVAL; 67 | } 68 | } 69 | 70 | return 0; 71 | } 72 | 73 | #endif /* _ADT_LEC_C */ 74 | -------------------------------------------------------------------------------- /drivers/dahdi/adt_lec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADT Line Echo Canceller Parameter Parsing 3 | * 4 | * Copyright (C) 2008 Digium, Inc. 5 | * 6 | * Kevin P. Fleming 7 | * 8 | * All rights reserved. 9 | */ 10 | 11 | /* 12 | * See http://www.asterisk.org for more information about 13 | * the Asterisk project. Please do not directly contact 14 | * any of the maintainers of this project for assistance; 15 | * the project provides a web site, mailing lists and IRC 16 | * channels for your use. 17 | * 18 | * This program is free software, distributed under the terms of 19 | * the GNU General Public License Version 2 as published by the 20 | * Free Software Foundation. See the LICENSE file included with 21 | * this program for more details. 22 | */ 23 | 24 | #ifndef _ADT_LEC_H 25 | #define _ADT_LEC_H 26 | 27 | enum adt_lec_nlp_type { 28 | ADT_LEC_NLP_OFF = 0, 29 | ADT_LEC_NLP_MUTE, 30 | ADT_LEC_RANDOM_NOISE, 31 | ADT_LEC_HOTH_NOISE, 32 | ADT_LEC_SUPPRESS, 33 | }; 34 | 35 | enum adt_companding { 36 | ADT_COMP_ULAW = 0, 37 | ADT_COMP_ALAW, 38 | }; 39 | 40 | struct adt_lec_params { 41 | __u32 tap_length; 42 | enum adt_lec_nlp_type nlp_type; 43 | __u32 nlp_threshold; 44 | __u32 nlp_max_suppress; 45 | enum adt_companding companding; 46 | }; 47 | 48 | #endif /* _ADT_LEC_H */ 49 | -------------------------------------------------------------------------------- /drivers/dahdi/biquad.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SpanDSP - a series of DSP components for telephony 3 | * 4 | * biquad.h - General telephony bi-quad section routines (currently this just 5 | * handles canonic/type 2 form) 6 | * 7 | * Written by Steve Underwood 8 | * 9 | * Copyright (C) 2001 Steve Underwood 10 | * 11 | * All rights reserved. 12 | * 13 | */ 14 | 15 | /* 16 | * See http://www.asterisk.org for more information about 17 | * the Asterisk project. Please do not directly contact 18 | * any of the maintainers of this project for assistance; 19 | * the project provides a web site, mailing lists and IRC 20 | * channels for your use. 21 | * 22 | * This program is free software, distributed under the terms of 23 | * the GNU General Public License Version 2 as published by the 24 | * Free Software Foundation. See the LICENSE file included with 25 | * this program for more details. 26 | */ 27 | 28 | static inline void biquad2_init (biquad2_state_t *bq, 29 | int32_t gain, 30 | int32_t a1, 31 | int32_t a2, 32 | int32_t b1, 33 | int32_t b2) 34 | { 35 | bq->gain = gain; 36 | bq->a1 = a1; 37 | bq->a2 = a2; 38 | bq->b1 = b1; 39 | bq->b2 = b2; 40 | 41 | bq->z1 = 0; 42 | bq->z2 = 0; 43 | } 44 | /*- End of function --------------------------------------------------------*/ 45 | 46 | static inline int16_t biquad2 (biquad2_state_t *bq, int16_t sample) 47 | { 48 | int32_t y; 49 | int32_t z0; 50 | 51 | z0 = sample*bq->gain + bq->z1*bq->a1 + bq->z2*bq->a2; 52 | y = z0 + bq->z1*bq->b1 + bq->z2*bq->b2; 53 | 54 | bq->z2 = bq->z1; 55 | bq->z1 = z0 >> 15; 56 | y >>= 15; 57 | return y; 58 | } 59 | /*- End of function --------------------------------------------------------*/ 60 | /*- End of file ------------------------------------------------------------*/ 61 | -------------------------------------------------------------------------------- /drivers/dahdi/dahdi-sysfs.h: -------------------------------------------------------------------------------- 1 | #ifndef DAHDI_SYSFS_H 2 | #define DAHDI_SYSFS_H 3 | 4 | #define DEVICE_ATTR_READER(name, dev, buf) \ 5 | ssize_t name(struct device *dev, \ 6 | struct device_attribute *attr, \ 7 | char *buf) 8 | #define DEVICE_ATTR_WRITER(name, dev, buf, count) \ 9 | ssize_t name(struct device *dev, \ 10 | struct device_attribute *attr, \ 11 | const char *buf, size_t count) 12 | #define BUS_ATTR_READER(name, dev, buf) \ 13 | ssize_t name(struct device *dev, \ 14 | struct device_attribute *attr, \ 15 | char *buf) 16 | #define BUS_ATTR_WRITER(name, dev, buf, count) \ 17 | ssize_t name(struct device *dev, \ 18 | struct device_attribute *attr, \ 19 | const char *buf, size_t count) 20 | 21 | #define DRIVER_ATTR_READER(name, drv, buf) \ 22 | ssize_t name(struct device_driver *drv, char * buf) 23 | 24 | /* Global */ 25 | int __init dahdi_sysfs_chan_init(const struct file_operations *fops); 26 | void dahdi_sysfs_chan_exit(void); 27 | 28 | /* Channel Handling */ 29 | int chan_sysfs_create(struct dahdi_chan *chan); 30 | void chan_sysfs_remove(struct dahdi_chan *chan); 31 | 32 | #endif /* DAHDI_SYSFS_H */ 33 | -------------------------------------------------------------------------------- /drivers/dahdi/dahdi-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Dahdi Version 3 | * 4 | * Copyright (C) 2001 Jim Dixon / Zapata Telephony. 5 | * Copyright (C) 2011 Digium, Inc. 6 | * 7 | * All rights reserved. 8 | * 9 | */ 10 | 11 | /* 12 | * See http://www.asterisk.org for more information about 13 | * the Asterisk project. Please do not directly contact 14 | * any of the maintainers of this project for assistance; 15 | * the project provides a web site, mailing lists and IRC 16 | * channels for your use. 17 | * 18 | * This program is free software, distributed under the terms of 19 | * the GNU General Public License Version 2 as published by the 20 | * Free Software Foundation. See the LICENSE file included with 21 | * this program for more details. 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include "dahdi.h" 30 | 31 | const char *const dahdi_version = DAHDI_VERSION; 32 | 33 | MODULE_VERSION(DAHDI_VERSION); 34 | -------------------------------------------------------------------------------- /drivers/dahdi/dahdi.h: -------------------------------------------------------------------------------- 1 | #ifndef _DAHDI_H 2 | #define _DAHDI_H 3 | 4 | /* dahdi.h: headers intended only for the dahdi.ko module. 5 | * Not to be included elsewhere 6 | * 7 | * Written by Tzafrir Cohen 8 | * Copyright (C) 2011, Xorcom 9 | * Copyright (C) 2011, Digium, Inc 10 | * 11 | * All rights reserved. 12 | * 13 | */ 14 | 15 | /* 16 | * See http://www.asterisk.org for more information about 17 | * the Asterisk project. Please do not directly contact 18 | * any of the maintainers of this project for assistance; 19 | * the project provides a web site, mailing lists and IRC 20 | * channels for your use. 21 | * 22 | * This program is free software, distributed under the terms of 23 | * the GNU General Public License Version 2 as published by the 24 | * Free Software Foundation. See the LICENSE file included with 25 | * this program for more details. 26 | */ 27 | 28 | extern int debug; 29 | extern const char *const dahdi_version; 30 | 31 | int dahdi_register_chardev(struct dahdi_chardev *dev); 32 | int dahdi_unregister_chardev(struct dahdi_chardev *dev); 33 | int span_sysfs_create(struct dahdi_span *span); 34 | void span_sysfs_remove(struct dahdi_span *span); 35 | int __init dahdi_sysfs_init(const struct file_operations *dahdi_fops); 36 | void dahdi_sysfs_exit(void); 37 | 38 | void dahdi_sysfs_init_device(struct dahdi_device *ddev); 39 | int dahdi_sysfs_add_device(struct dahdi_device *ddev, struct device *parent); 40 | void dahdi_sysfs_unregister_device(struct dahdi_device *ddev); 41 | 42 | int dahdi_assign_span(struct dahdi_span *span, unsigned int spanno, 43 | unsigned int basechan, int prefmaster); 44 | int dahdi_unassign_span(struct dahdi_span *span); 45 | int dahdi_assign_device_spans(struct dahdi_device *ddev); 46 | 47 | static inline int get_span(struct dahdi_span *span) 48 | { 49 | return try_module_get(span->ops->owner); 50 | } 51 | 52 | static inline void put_span(struct dahdi_span *span) 53 | { 54 | module_put(span->ops->owner); 55 | } 56 | 57 | static inline int local_spanno(struct dahdi_span *span) 58 | { 59 | return span->offset + 1; 60 | } 61 | 62 | #endif /* _DAHDI_H */ 63 | -------------------------------------------------------------------------------- /drivers/dahdi/datamods/Makefile: -------------------------------------------------------------------------------- 1 | .EXPORT_ALL_VARIABLES: 2 | MODULES= \ 3 | hdlc_cisco hdlc_generic hdlc_raw syncppp \ 4 | hdlc_fr hdlc_ppp hdlc_raw_eth 5 | 6 | 7 | PWD=$(shell pwd) 8 | 9 | MODULESO:=$(MODULES:%=%.o) 10 | MODULESKO:=$(MODULES:%=%.ko) 11 | KMAKE = $(MAKE) -C $(KSRC) M=$(PWD) 12 | KMAKE_INST = $(KMAKE) \ 13 | INSTALL_MOD_PATH=$(INSTALL_PREFIX) INSTALL_MOD_DIR=misc modules_install 14 | 15 | obj-m := $(MODULESO) 16 | #obj-m:=hdlc_raw.o hdlc_cisco.o 17 | #obj-m := hdlc_cisco.o hdlc_cisco.mod.o hdlc_fr.o hdlc_generic.o hdlc_ppp.o hdlc_raw.o hdlc_raw_eth.o hdlc_raw.mod.o hdlc_x25.o 18 | 19 | all: 20 | @echo "You don't want to do make here. Do it from up above" 21 | 22 | clean: 23 | $(KMAKE) clean 24 | 25 | install: $(MODULESKO) 26 | $(KMAKE_INST) 27 | 28 | datamods: 29 | @echo "To build: $(obj-m)" 30 | @echo $(KSRC) 31 | @if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi 32 | $(KMAKE) modules 33 | -------------------------------------------------------------------------------- /drivers/dahdi/datamods/hdlc_ppp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic HDLC support routines for Linux 3 | * Point-to-point protocol support 4 | * 5 | * Copyright (C) 1999 - 2003 Krzysztof Halasa 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of version 2 of the GNU General Public License 9 | * as published by the Free Software Foundation. 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | static int ppp_open(struct net_device *dev) 28 | { 29 | hdlc_device *hdlc = dev_to_hdlc(dev); 30 | void *old_ioctl; 31 | int result; 32 | 33 | dev->priv = &hdlc->state.ppp.syncppp_ptr; 34 | hdlc->state.ppp.syncppp_ptr = &hdlc->state.ppp.pppdev; 35 | hdlc->state.ppp.pppdev.dev = dev; 36 | 37 | old_ioctl = dev->do_ioctl; 38 | hdlc->state.ppp.old_change_mtu = dev->change_mtu; 39 | sppp_attach(&hdlc->state.ppp.pppdev); 40 | /* sppp_attach nukes them. We don't need syncppp's ioctl */ 41 | dev->do_ioctl = old_ioctl; 42 | hdlc->state.ppp.pppdev.sppp.pp_flags &= ~PP_CISCO; 43 | dev->type = ARPHRD_PPP; 44 | result = sppp_open(dev); 45 | if (result) { 46 | sppp_detach(dev); 47 | return result; 48 | } 49 | 50 | return 0; 51 | } 52 | 53 | 54 | 55 | static void ppp_close(struct net_device *dev) 56 | { 57 | hdlc_device *hdlc = dev_to_hdlc(dev); 58 | 59 | sppp_close(dev); 60 | sppp_detach(dev); 61 | dev->rebuild_header = NULL; 62 | dev->change_mtu = hdlc->state.ppp.old_change_mtu; 63 | dev->mtu = HDLC_MAX_MTU; 64 | dev->hard_header_len = 16; 65 | } 66 | 67 | 68 | 69 | static __be16 ppp_type_trans(struct sk_buff *skb, struct net_device *dev) 70 | { 71 | return __constant_htons(ETH_P_WAN_PPP); 72 | } 73 | 74 | 75 | 76 | int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr) 77 | { 78 | hdlc_device *hdlc = dev_to_hdlc(dev); 79 | int result; 80 | 81 | switch (ifr->ifr_settings.type) { 82 | case IF_GET_PROTO: 83 | ifr->ifr_settings.type = IF_PROTO_PPP; 84 | return 0; /* return protocol only, no settable parameters */ 85 | 86 | case IF_PROTO_PPP: 87 | if(!capable(CAP_NET_ADMIN)) 88 | return -EPERM; 89 | 90 | if(dev->flags & IFF_UP) 91 | return -EBUSY; 92 | 93 | /* no settable parameters */ 94 | 95 | result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT); 96 | if (result) 97 | return result; 98 | 99 | hdlc_proto_detach(hdlc); 100 | memset(&hdlc->proto, 0, sizeof(hdlc->proto)); 101 | 102 | hdlc->proto.open = ppp_open; 103 | hdlc->proto.close = ppp_close; 104 | hdlc->proto.type_trans = ppp_type_trans; 105 | hdlc->proto.id = IF_PROTO_PPP; 106 | dev->hard_start_xmit = hdlc->xmit; 107 | dev->hard_header = NULL; 108 | dev->type = ARPHRD_PPP; 109 | dev->addr_len = 0; 110 | return 0; 111 | } 112 | 113 | return -EINVAL; 114 | } 115 | -------------------------------------------------------------------------------- /drivers/dahdi/datamods/hdlc_raw.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic HDLC support routines for Linux 3 | * HDLC support 4 | * 5 | * Copyright (C) 1999 - 2003 Krzysztof Halasa 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of version 2 of the GNU General Public License 9 | * as published by the Free Software Foundation. 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | static __be16 raw_type_trans(struct sk_buff *skb, struct net_device *dev) 28 | { 29 | return __constant_htons(ETH_P_IP); 30 | } 31 | 32 | 33 | 34 | int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr) 35 | { 36 | raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc; 37 | const size_t size = sizeof(raw_hdlc_proto); 38 | raw_hdlc_proto new_settings; 39 | hdlc_device *hdlc = dev_to_hdlc(dev); 40 | int result; 41 | 42 | switch (ifr->ifr_settings.type) { 43 | case IF_GET_PROTO: 44 | ifr->ifr_settings.type = IF_PROTO_HDLC; 45 | if (ifr->ifr_settings.size < size) { 46 | ifr->ifr_settings.size = size; /* data size wanted */ 47 | return -ENOBUFS; 48 | } 49 | if (copy_to_user(raw_s, &hdlc->state.raw_hdlc.settings, size)) 50 | return -EFAULT; 51 | return 0; 52 | 53 | case IF_PROTO_HDLC: 54 | if (!capable(CAP_NET_ADMIN)) 55 | return -EPERM; 56 | 57 | if (dev->flags & IFF_UP) 58 | return -EBUSY; 59 | 60 | if (copy_from_user(&new_settings, raw_s, size)) 61 | return -EFAULT; 62 | 63 | if (new_settings.encoding == ENCODING_DEFAULT) 64 | new_settings.encoding = ENCODING_NRZ; 65 | 66 | if (new_settings.parity == PARITY_DEFAULT) 67 | new_settings.parity = PARITY_CRC16_PR1_CCITT; 68 | 69 | result = hdlc->attach(dev, new_settings.encoding, 70 | new_settings.parity); 71 | if (result) 72 | return result; 73 | 74 | hdlc_proto_detach(hdlc); 75 | memcpy(&hdlc->state.raw_hdlc.settings, &new_settings, size); 76 | memset(&hdlc->proto, 0, sizeof(hdlc->proto)); 77 | 78 | hdlc->proto.type_trans = raw_type_trans; 79 | hdlc->proto.id = IF_PROTO_HDLC; 80 | dev->hard_start_xmit = hdlc->xmit; 81 | dev->hard_header = NULL; 82 | dev->type = ARPHRD_RAWHDLC; 83 | dev->flags = IFF_POINTOPOINT | IFF_NOARP; 84 | dev->addr_len = 0; 85 | return 0; 86 | } 87 | 88 | return -EINVAL; 89 | } 90 | -------------------------------------------------------------------------------- /drivers/dahdi/datamods/hdlc_raw_eth.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic HDLC support routines for Linux 3 | * HDLC Ethernet emulation support 4 | * 5 | * Copyright (C) 2002-2003 Krzysztof Halasa 6 | * 7 | * This program is free software; you can redistribute it and/or modify it 8 | * under the terms of version 2 of the GNU General Public License 9 | * as published by the Free Software Foundation. 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | static int eth_tx(struct sk_buff *skb, struct net_device *dev) 30 | { 31 | int pad = ETH_ZLEN - skb->len; 32 | if (pad > 0) { /* Pad the frame with zeros */ 33 | int len = skb->len; 34 | if (skb_tailroom(skb) < pad) 35 | if (pskb_expand_head(skb, 0, pad, GFP_ATOMIC)) { 36 | hdlc_stats(dev)->tx_dropped++; 37 | dev_kfree_skb(skb); 38 | return 0; 39 | } 40 | skb_put(skb, pad); 41 | memset(skb->data + len, 0, pad); 42 | } 43 | return dev_to_hdlc(dev)->xmit(skb, dev); 44 | } 45 | 46 | 47 | int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr) 48 | { 49 | raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc; 50 | const size_t size = sizeof(raw_hdlc_proto); 51 | raw_hdlc_proto new_settings; 52 | hdlc_device *hdlc = dev_to_hdlc(dev); 53 | int result; 54 | void *old_ch_mtu; 55 | int old_qlen; 56 | 57 | switch (ifr->ifr_settings.type) { 58 | case IF_GET_PROTO: 59 | ifr->ifr_settings.type = IF_PROTO_HDLC_ETH; 60 | if (ifr->ifr_settings.size < size) { 61 | ifr->ifr_settings.size = size; /* data size wanted */ 62 | return -ENOBUFS; 63 | } 64 | if (copy_to_user(raw_s, &hdlc->state.raw_hdlc.settings, size)) 65 | return -EFAULT; 66 | return 0; 67 | 68 | case IF_PROTO_HDLC_ETH: 69 | if (!capable(CAP_NET_ADMIN)) 70 | return -EPERM; 71 | 72 | if (dev->flags & IFF_UP) 73 | return -EBUSY; 74 | 75 | if (copy_from_user(&new_settings, raw_s, size)) 76 | return -EFAULT; 77 | 78 | if (new_settings.encoding == ENCODING_DEFAULT) 79 | new_settings.encoding = ENCODING_NRZ; 80 | 81 | if (new_settings.parity == PARITY_DEFAULT) 82 | new_settings.parity = PARITY_CRC16_PR1_CCITT; 83 | 84 | result = hdlc->attach(dev, new_settings.encoding, 85 | new_settings.parity); 86 | if (result) 87 | return result; 88 | 89 | hdlc_proto_detach(hdlc); 90 | memcpy(&hdlc->state.raw_hdlc.settings, &new_settings, size); 91 | memset(&hdlc->proto, 0, sizeof(hdlc->proto)); 92 | 93 | hdlc->proto.type_trans = eth_type_trans; 94 | hdlc->proto.id = IF_PROTO_HDLC_ETH; 95 | dev->hard_start_xmit = eth_tx; 96 | old_ch_mtu = dev->change_mtu; 97 | old_qlen = dev->tx_queue_len; 98 | ether_setup(dev); 99 | dev->change_mtu = old_ch_mtu; 100 | dev->tx_queue_len = old_qlen; 101 | memcpy(dev->dev_addr, "\x00\x01", 2); 102 | get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2); 103 | return 0; 104 | } 105 | 106 | return -EINVAL; 107 | } 108 | -------------------------------------------------------------------------------- /drivers/dahdi/firmware/make_firmware_object.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # make an object file from a raw binary firmware file 4 | # arguments: 5 | # 1 - firmware file 6 | # 2 - output file 7 | 8 | objcopy -I binary ${1} -B BFDARCH -O BFDNAME ${2} --rename-section .data=.rodata,alloc,load,data,contents,readonly 9 | -------------------------------------------------------------------------------- /drivers/dahdi/hpec/hpec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DAHDI Telephony Interface to Digium High-Performance Echo Canceller 3 | * 4 | * Copyright (C) 2006 Digium, Inc. 5 | * 6 | * All rights reserved. 7 | */ 8 | 9 | /* 10 | * See http://www.asterisk.org for more information about 11 | * the Asterisk project. Please do not directly contact 12 | * any of the maintainers of this project for assistance; 13 | * the project provides a web site, mailing lists and IRC 14 | * channels for your use. 15 | * 16 | * This program is free software, distributed under the terms of 17 | * the GNU General Public License Version 2 as published by the 18 | * Free Software Foundation. See the LICENSE file included with 19 | * this program for more details. 20 | */ 21 | 22 | #if !defined(_HPEC_H) 23 | #define _HPEC_H 24 | 25 | struct hpec_state; 26 | 27 | void __attribute__((regparm(0))) hpec_init(int __attribute__((regparm(0), format(printf, 1, 2))) (*logger)(const char *format, ...), 28 | unsigned int debug, 29 | unsigned int chunk_size, 30 | void * (*memalloc)(size_t len), 31 | void (*memfree)(void *ptr)); 32 | 33 | void __attribute__((regparm(0))) hpec_shutdown(void); 34 | 35 | int __attribute__((regparm(0))) hpec_license_challenge(struct hpec_challenge *challenge); 36 | 37 | int __attribute__((regparm(0))) hpec_license_check(struct hpec_license *license); 38 | 39 | struct hpec_state __attribute__((regparm(0))) *hpec_channel_alloc(unsigned int len); 40 | 41 | void __attribute__((regparm(0))) hpec_channel_free(struct hpec_state *channel); 42 | 43 | void __attribute__((regparm(0))) hpec_channel_update(struct hpec_state *channel, short *isig, const short *iref); 44 | 45 | #endif /* !defined(_HPEC_H) */ 46 | 47 | -------------------------------------------------------------------------------- /drivers/dahdi/hpec/hpec_user.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DAHDI Telephony Interface to Digium High-Performance Echo Canceller 3 | * 4 | * Copyright (C) 2006 Digium, Inc. 5 | * 6 | * All rights reserved. 7 | */ 8 | 9 | /* 10 | * See http://www.asterisk.org for more information about 11 | * the Asterisk project. Please do not directly contact 12 | * any of the maintainers of this project for assistance; 13 | * the project provides a web site, mailing lists and IRC 14 | * channels for your use. 15 | * 16 | * This program is free software, distributed under the terms of 17 | * the GNU General Public License Version 2 as published by the 18 | * Free Software Foundation. See the LICENSE file included with 19 | * this program for more details. 20 | */ 21 | 22 | #if !defined(_HPEC_USER_H) 23 | #define _HPEC_USER_H 24 | 25 | struct hpec_challenge { 26 | __u8 challenge[16]; 27 | }; 28 | 29 | struct hpec_license { 30 | __u32 numchannels; 31 | __u8 userinfo[256]; 32 | __u8 response[16]; 33 | }; 34 | 35 | #define DAHDI_EC_LICENSE_CHALLENGE _IOR(DAHDI_CODE, 60, struct hpec_challenge) 36 | #define DAHDI_EC_LICENSE_RESPONSE _IOW(DAHDI_CODE, 61, struct hpec_license) 37 | 38 | #endif /* !defined(_HPEC_USER_H) */ 39 | 40 | -------------------------------------------------------------------------------- /drivers/dahdi/makefw.c: -------------------------------------------------------------------------------- 1 | /* Xilinx firmware convertor program. 2 | * 3 | * Written by Jim Dixon . 4 | * 5 | * Copyright (C) 2001 Jim Dixon / Zapata Telephony. 6 | * Copyright (C) 2001-2008 Digium, Inc. 7 | * 8 | * All rights reserved. 9 | * 10 | */ 11 | 12 | /* 13 | * See http://www.asterisk.org for more information about 14 | * the Asterisk project. Please do not directly contact 15 | * any of the maintainers of this project for assistance; 16 | * the project provides a web site, mailing lists and IRC 17 | * channels for your use. 18 | * 19 | * This program is free software, distributed under the terms of 20 | * the GNU General Public License Version 2 as published by the 21 | * Free Software Foundation. See the LICENSE file included with 22 | * this program for more details. 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #define SWATH 12 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | FILE *fp; 34 | int i,j,nbytes; 35 | unsigned char c; 36 | char buf[300]; 37 | 38 | if (argc < 3) 39 | { 40 | puts("Usage... makefw filename.rbt array_name"); 41 | exit(1); 42 | } 43 | 44 | fp = fopen(argv[1],"r"); 45 | if (!fp) 46 | { 47 | perror("bit file open"); 48 | exit(1); 49 | } 50 | nbytes = 0; 51 | printf("static unsigned char %s[] = {\n",argv[2]); 52 | i = 0; 53 | while(fgets(buf,sizeof(buf) - 1,fp)) 54 | { 55 | if (!buf[0]) continue; 56 | if (buf[strlen(buf) - 1] < ' ') buf[strlen(buf) - 1] = 0; 57 | if (!buf[0]) continue; 58 | if (buf[strlen(buf) - 1] < ' ') buf[strlen(buf) - 1] = 0; 59 | if (!buf[0]) continue; 60 | if (strlen(buf) < 32) continue; 61 | if ((buf[0] != '0') && (buf[0] != '1')) continue; 62 | c = 0; 63 | for(j = 0; buf[j]; j++) 64 | { 65 | if (buf[j] > '0') c |= 1 << (j & 7); 66 | if ((j & 7) == 7) 67 | { 68 | nbytes++; 69 | if (i) printf(","); 70 | printf("0x%02x",c); 71 | if (i++ == SWATH) { 72 | printf(",\n"); 73 | i = 0; 74 | } 75 | c = 0; 76 | } 77 | } 78 | } 79 | printf("\n};\n\n"); 80 | fprintf(stderr,"Loaded %d bytes from file\n",nbytes); 81 | fclose(fp); 82 | exit(0); 83 | } 84 | 85 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/Kbuild: -------------------------------------------------------------------------------- 1 | # 2 | # Produces the oct612x library 3 | # 4 | octapi_files = octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o \ 5 | octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o \ 6 | octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o \ 7 | octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o \ 8 | octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o \ 9 | octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o \ 10 | octdeviceapi/oct6100api/oct6100_api/oct6100_events.o \ 11 | octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o \ 12 | octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o \ 13 | octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o \ 14 | octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o \ 15 | octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o \ 16 | octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o \ 17 | octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o \ 18 | octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o \ 19 | octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o \ 20 | octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o \ 21 | octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o \ 22 | apilib/bt/octapi_bt0.o \ 23 | apilib/largmath/octapi_largmath.o \ 24 | apilib/llman/octapi_llman.o \ 25 | oct612x-user.o 26 | 27 | # TODO: ccflags was added in 2.6.24 in commit f77bf01425b11947eeb3b5b54. This 28 | # should be changed to a conditional compilation based on the Kernel Version. 29 | # ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api 30 | EXTRA_CFLAGS = -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api 31 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OCT612X) := oct612x.o 32 | oct612x-objs := $(octapi_files) 33 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Produces the oct612x library 3 | # 4 | octapi_files = octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o \ 5 | octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o \ 6 | octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o \ 7 | octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o \ 8 | octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o \ 9 | octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o \ 10 | octdeviceapi/oct6100api/oct6100_api/oct6100_events.o \ 11 | octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o \ 12 | octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o \ 13 | octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o \ 14 | octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o \ 15 | octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o \ 16 | octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o \ 17 | octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o \ 18 | octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o \ 19 | octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o \ 20 | octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o \ 21 | octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o \ 22 | apilib/bt/octapi_bt0.o \ 23 | apilib/largmath/octapi_largmath.o \ 24 | apilib/llman/octapi_llman.o 25 | 26 | # TODO: ccflags was added in 2.6.24 in commit f77bf01425b11947eeb3b5b54. This 27 | # should be changed to a conditional compilation based on the Kernel Version. 28 | # ccflags-y := -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api 29 | EXTRA_CFLAGS = -I$(src)/.. -Wno-undef -I$(src)/include -I$(src)/octdeviceapi -I$(src)/octdeviceapi/oct6100api 30 | lib-y := $(octapi_files) 31 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/apilib/bt/octapi_bt0_private.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: octapi_bt0_private.h 4 | 5 | Copyright (c) 2001 Octasic Inc. All rights reserved. 6 | 7 | Description: 8 | 9 | Library used to manage a binary tree of variable max size. Library is 10 | made to use one block of contiguous memory to manage the tree. 11 | 12 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 13 | free software; you can redistribute it and/or modify it under the terms of 14 | the GNU General Public License as published by the Free Software Foundation; 15 | either version 2 of the License, or (at your option) any later version. 16 | 17 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 18 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20 | for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with the OCT6100 GPL API; if not, write to the Free Software 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 | 26 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 27 | 28 | $Octasic_Revision: 11 $ 29 | 30 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 31 | #ifndef __OCTAPI_BT0_PRIVATE_H__ 32 | #define __OCTAPI_BT0_PRIVATE_H__ 33 | 34 | 35 | 36 | #include "octdef.h" 37 | 38 | #define OCTAPI_BT0_LKEY_LARGER 0x0 39 | #define OCTAPI_BT0_LKEY_SMALLER 0x1 40 | #define OCTAPI_BT0_LKEY_EQUAL 0x2 41 | 42 | typedef struct __OCTAPI_BT0_LINK__ 43 | { 44 | UINT32 node_number; 45 | UINT32 depth; 46 | } OCTAPI_BT0_LINK; 47 | 48 | typedef struct __OCTAPI_BT0_NODE__ 49 | { 50 | UINT32 next_free_node; /* Number of the next node in the free node link-list.*/ 51 | OCTAPI_BT0_LINK l[2]; /* 0 = left link; 1 = right link.*/ 52 | } OCTAPI_BT0_NODE; 53 | 54 | 55 | typedef struct __OCTAPI_BT0__ 56 | { 57 | UINT32 number_of_items; /* Number of items on total that can be allocated in the tree.*/ 58 | UINT32 key_size; /* Size is in UINT32s*/ 59 | UINT32 data_size; /* Size is in UINT32s*/ 60 | 61 | /* Empty node linked-list:*/ 62 | UINT32 next_free_node; /* 0xFFFFFFFF means that no nodes are free.*/ 63 | 64 | /* Tree as such:*/ 65 | OCTAPI_BT0_NODE * node; /* Array of nodes (number_of_items in size).*/ 66 | 67 | /* Tree root:*/ 68 | OCTAPI_BT0_LINK root_link; 69 | 70 | /* Associated key structure*/ 71 | UINT32 * key; /* Array of keys associated to NODEs.*/ 72 | 73 | /* Associated data structure.*/ 74 | UINT32 * data; /* Array of data associated to NODEs.*/ 75 | 76 | UINT32 invalid_value; 77 | UINT32 no_smaller_key; 78 | 79 | } OCTAPI_BT0; 80 | 81 | void OctApiBt0CorrectPointers( OCTAPI_BT0 * bb ); 82 | UINT32 OctApiBt0AddNode2( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * link, UINT32 * lkey, UINT32 new_node_number ); 83 | UINT32 OctApiBt0AddNode3( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * link, UINT32 * lkey, UINT32 *p_new_node_number ); 84 | UINT32 OctApiBt0AddNode4(OCTAPI_BT0 * bb,OCTAPI_BT0_LINK * link,UINT32 * lkey,UINT32 *p_new_node_number, UINT32 *p_prev_node_number, UINT32 state ); 85 | UINT32 OctApiBt0KeyCompare( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * link, UINT32 * lkey ); 86 | void OctApiBt0UpdateLinkDepth( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * link ); 87 | void OctApiBt0Rebalance( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * root_link ); 88 | void OctApiBt0ExternalHeavy( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * root_link ); 89 | UINT32 OctApiBt0RemoveNode2( OCTAPI_BT0 * bb, OCTAPI_BT0_LINK * link, UINT32 * lkey, OCTAPI_BT0_LINK * link_to_removed_node, UINT32 state, OCTAPI_BT0_LINK * volatile_grandparent_link ); 90 | 91 | 92 | 93 | #endif /*__OCTAPI_BT0_PRIVATE_H__*/ 94 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/get_discards: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | 3 | 52 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/apilib/octapi_bt0.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: octapi_bt0.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | Library used to manage a binary tree of variable max size. Library is 10 | made to use one block of contiguous memory to manage the tree. 11 | 12 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 13 | free software; you can redistribute it and/or modify it under the terms of 14 | the GNU General Public License as published by the Free Software Foundation; 15 | either version 2 of the License, or (at your option) any later version. 16 | 17 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 18 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20 | for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with the OCT6100 GPL API; if not, write to the Free Software 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 | 26 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 27 | 28 | $Octasic_Revision: 11 $ 29 | 30 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 31 | #ifndef __OCTAPI_BT0_H__ 32 | #define __OCTAPI_BT0_H__ 33 | 34 | #include "octdef.h" 35 | 36 | #define OCTAPI_BT0_BASE 0xFFFF0000 37 | #define OCTAPI_BT0_KEY_SIZE_NOT_MUTLIPLE_OF_UINT32 OCTAPI_BT0_BASE+0x0001 38 | #define OCTAPI_BT0_DATA_SIZE_NOT_MUTLIPLE_OF_UINT32 OCTAPI_BT0_BASE+0x0002 39 | #define OCTAPI_BT0_MALLOC_FAILED OCTAPI_BT0_BASE+0x0003 40 | #define OCTAPI_BT0_NO_NODES_AVAILABLE OCTAPI_BT0_BASE+0x0004 41 | #define OCTAPI_BT0_KEY_ALREADY_IN_TREE OCTAPI_BT0_BASE+0x0005 42 | #define OCTAPI_BT0_KEY_NOT_IN_TREE OCTAPI_BT0_BASE+0x0006 43 | 44 | /* Possible result for Find Or Add function. */ 45 | #define OCTAPI0_BT0_NODE_FOUND 0 46 | #define OCTAPI0_BT0_NODE_ADDDED 1 47 | 48 | #define OCTAPI_BT0_NO_SMALLER_KEY 0xAAAAAAAA 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif /* __cplusplus */ 53 | 54 | #define octapi_bt0_get_size( number_of_items, key_size, data_size, b_size ) OctApiBt0GetSize( (UINT32) number_of_items,(UINT32) key_size, (UINT32) data_size, (PUINT32) b_size ) 55 | #define octapi_bt0_init( b, number_of_items, key_size, data_size ) OctApiBt0Init( (void **) b,(UINT32) number_of_items,(UINT32) key_size, (UINT32) data_size ) 56 | #define octapi_bt0_add_node( b, key, data ) OctApiBt0AddNode( (void *) b,(void *) key,(void **) data ) 57 | #define octapi_bt0_remove_node( b, key ) OctApiBt0RemoveNode( (void *) b,(void *) key ) 58 | #define octapi_bt0_query_node( b, key, data ) OctApiBt0QueryNode( (void *) b,(void *) key,(void **) data ) 59 | #define octapi_bt0_get_first_node( b, key, data ) OctApiBt0GetFirstNode( (void *) b,(void **) key, (void **) data ) 60 | 61 | UINT32 OctApiBt0GetSize( UINT32 number_of_items, UINT32 key_size, UINT32 data_size, UINT32 * b_size ); 62 | UINT32 OctApiBt0Init( void ** b, UINT32 number_of_items, UINT32 key_size, UINT32 data_size ); 63 | UINT32 OctApiBt0AddNode( void * b, void * key, void ** data ); 64 | UINT32 OctApiBt0RemoveNode( void * b, void * key ); 65 | UINT32 OctApiBt0QueryNode( void * b, void * key, void ** data ); 66 | UINT32 OctApiBt0GetFirstNode( void * b, void ** key, void ** data ); 67 | UINT32 OctApiBt0FindOrAddNode( void * b, void * key, void ** data, UINT32 *fnct_result ); 68 | 69 | UINT32 OctApiBt0AddNodeReportPrevNodeData( void * b, void * key, void ** data, void ** prev_data, UINT32 *fnct_result ); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif /* __cplusplus */ 74 | 75 | #endif /*__OCTAPI_BT0_H__*/ 76 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/apilib/octapi_largmath.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: octapi_largmath.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | Library used to perform arithmetic on integer values of an integer multiple 10 | of 32-bits. 11 | 12 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 13 | free software; you can redistribute it and/or modify it under the terms of 14 | the GNU General Public License as published by the Free Software Foundation; 15 | either version 2 of the License, or (at your option) any later version. 16 | 17 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 18 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20 | for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with the OCT6100 GPL API; if not, write to the Free Software 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 | 26 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 27 | 28 | $Octasic_Revision: 6 $ 29 | 30 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 31 | #ifndef __OCTAPI_LARGMATH_H__ 32 | #define __OCTAPI_LARGMATH_H__ 33 | 34 | #include "octdef.h" 35 | 36 | #define OCTAPI_LM_DIVISION_BY_ZERO 0xFFFF 37 | #define OCTAPI_LM_OVERFLOW 0xFFFE 38 | #define OCTAPI_LM_ARRAY_SIZE_MISMATCH 0xFFFD 39 | 40 | #define OCTAPI_LM_MAX_OPTIMIZE_MUL 10 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif /* __cplusplus */ 45 | 46 | #define octapi_lm_add( a, alen, b, blen, z, zlen ) OctApiLmAdd( (PUINT32) a, (USHORT) alen, (PUINT32) b, (USHORT) blen, (PUINT32) z, (USHORT) zlen ) 47 | #define octapi_lm_subtract( a, alen, bneg, blen, z, zlen, neg ) OctApiLmSubtract( (PUINT32) a, (USHORT) alen, (PUINT32) bneg, (USHORT) blen, (PUINT32) z, (USHORT) zlen, (USHORT*) neg ) 48 | #define octapi_lm_compare( a, alen, bneg, blen, neg ) OctApiLmCompare( (PUINT32) a, (USHORT) alen, (PUINT32) bneg, (USHORT) blen, (USHORT*) neg ) 49 | #define octapi_lm_multiply( a, b, ablen, z ) OctApiLmMultiply( (PUINT32) a, (PUINT32) b, (USHORT) ablen, (PUINT32) z ) 50 | #define octapi_lm_divide( n, d, q, r, ndqrlen ) OctApiLmDivide( (PUINT32) n, (PUINT32) d, (PUINT32) q, (PUINT32) r, (USHORT) ndqrlen ) 51 | #define octapi_lm_shiftright1( a, alen ) OctApiLmShiftRight1( (PUINT32) a, (USHORT) alen ) 52 | #define octapi_lm_shiftn( a, alen, shiftleft, shiftn ) OctApiLmShiftn( (PUINT32) a, (USHORT) alen, (USHORT) shiftleft, (USHORT) shiftn ) 53 | #define octapi_lm_getmsb( a, alen, msb_pos ) OctApiLmGetMsb( (PUINT32) a, (USHORT) alen, (USHORT*) msb_pos ) 54 | 55 | 56 | UINT32 OctApiLmAdd( PUINT32 a, USHORT alen, PUINT32 b, USHORT blen, PUINT32 z, USHORT zlen ); 57 | UINT32 OctApiLmSubtract( PUINT32 a, USHORT alen, PUINT32 bneg, USHORT blen, PUINT32 z, USHORT zlen, PUSHORT neg ); 58 | UINT32 OctApiLmCompare( PUINT32 a, USHORT alen, PUINT32 bneg, USHORT blen, PUSHORT neg ); 59 | UINT32 OctApiLmMultiply( PUINT32 a, PUINT32 b, USHORT ablen, PUINT32 z ); 60 | UINT32 OctApiLmDivide( PUINT32 n, PUINT32 d, PUINT32 q, PUINT32 r, USHORT ndqrlen ); 61 | UINT32 OctApiLmShiftRight1( PUINT32 a, USHORT alen ); 62 | UINT32 OctApiLmShiftn( PUINT32 a, USHORT alen, USHORT shiftleft, USHORT shiftn ); 63 | UINT32 OctApiLmGetMsb( PUINT32 a, USHORT alen, PUSHORT msb_pos ); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif /* __cplusplus */ 68 | 69 | #endif /* __OCTAPI_LARGMATH_H__ */ 70 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_adpcm_chan_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_adpcm_chan_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_adpcm_chan.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_adpcm_chan_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 6 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_ADPCM_CHAN_INST_H__ 35 | #define __OCT6100_ADPCM_CHAN_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | /***************************** DEFINES *************************************/ 40 | 41 | /***************************** TYPES ***************************************/ 42 | 43 | typedef struct _OCT6100_API_ADPCM_CHAN_ 44 | { 45 | /* Flag specifying whether the entry is used or not. */ 46 | UINT8 fReserved; 47 | 48 | /* Count used to manage entry handles allocated to user. */ 49 | UINT8 byEntryOpenCnt; 50 | 51 | /* TSI chariot memory entry. */ 52 | UINT16 usTsiMemIndex; 53 | 54 | /* ADPCM memory entry. */ 55 | UINT16 usAdpcmMemIndex; 56 | 57 | /* Input and output timeslot information. */ 58 | UINT16 usInputTimeslot; 59 | UINT16 usInputStream; 60 | UINT8 byInputNumTssts; 61 | UINT8 byInputPcmLaw; 62 | 63 | UINT16 usOutputTimeslot; 64 | UINT16 usOutputStream; 65 | UINT8 byOutputNumTssts; 66 | UINT8 byOutputPcmLaw; 67 | 68 | /* Internal info for quick access to structures associated to this TSI cnct. */ 69 | UINT16 usInputTsstIndex; 70 | UINT16 usOutputTsstIndex; 71 | 72 | } tOCT6100_API_ADPCM_CHAN, *tPOCT6100_API_ADPCM_CHAN; 73 | 74 | #endif /* __OCT6100_ADPCM_CHAN_INST_H__ */ 75 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_adpcm_chan_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_adpcm_chan_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_adpcm_chan.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_adpcm_chan_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 5 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_ADPCM_CHAN_PUB_H__ 35 | #define __OCT6100_ADPCM_CHAN_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_ADPCM_CHAN_OPEN_ 46 | { 47 | PUINT32 pulChanHndl; 48 | 49 | UINT32 ulInputTimeslot; 50 | UINT32 ulInputStream; 51 | UINT32 ulInputNumTssts; 52 | UINT32 ulInputPcmLaw; 53 | 54 | UINT32 ulOutputTimeslot; 55 | UINT32 ulOutputStream; 56 | UINT32 ulOutputNumTssts; 57 | UINT32 ulOutputPcmLaw; 58 | 59 | UINT32 ulChanMode; /* Encoding or decoding. */ 60 | 61 | UINT32 ulEncodingRate; 62 | UINT32 ulDecodingRate; 63 | 64 | UINT32 ulAdpcmNibblePosition; 65 | 66 | } tOCT6100_ADPCM_CHAN_OPEN, *tPOCT6100_ADPCM_CHAN_OPEN; 67 | 68 | typedef struct _OCT6100_ADPCM_CHAN_CLOSE_ 69 | { 70 | UINT32 ulChanHndl; 71 | 72 | } tOCT6100_ADPCM_CHAN_CLOSE, *tPOCT6100_ADPCM_CHAN_CLOSE; 73 | 74 | 75 | /************************** FUNCTION PROTOTYPES *****************************/ 76 | 77 | 78 | UINT32 Oct6100AdpcmChanOpenDef( 79 | OUT tPOCT6100_ADPCM_CHAN_OPEN f_pAdpcmChanOpen ); 80 | UINT32 Oct6100AdpcmChanOpen( 81 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 82 | IN OUT tPOCT6100_ADPCM_CHAN_OPEN f_pAdpcmChanOpen ); 83 | 84 | UINT32 Oct6100AdpcmChanCloseDef( 85 | OUT tPOCT6100_ADPCM_CHAN_CLOSE f_pAdpcmChanClose ); 86 | UINT32 Oct6100AdpcmChanClose( 87 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 88 | IN OUT tPOCT6100_ADPCM_CHAN_CLOSE f_pAdpcmChanClose ); 89 | 90 | #endif /* __OCT6100_ADPCM_CHAN_PUB_H__ */ 91 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_api.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_api.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | Header file containing all definitions used throughout the API. 10 | 11 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 12 | free software; you can redistribute it and/or modify it under the terms of 13 | the GNU General Public License as published by the Free Software Foundation; 14 | either version 2 of the License, or (at your option) any later version. 15 | 16 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 17 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with the OCT6100 GPL API; if not, write to the Free Software 23 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 24 | 25 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 26 | 27 | $Octasic_Revision: 23 $ 28 | 29 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 30 | 31 | #ifndef __OCT6100_API_H__ 32 | #define __OCT6100_API_H__ 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /***************************** INCLUDE FILES *******************************/ 39 | 40 | #include "octdef.h" 41 | 42 | #include "oct6100_defines.h" 43 | #include "oct6100_errors.h" 44 | 45 | #include "oct6100_apiud.h" 46 | #include "oct6100_tlv_inst.h" 47 | #include "oct6100_chip_stats_inst.h" 48 | #include "oct6100_tsi_cnct_inst.h" 49 | #include "oct6100_mixer_inst.h" 50 | #include "oct6100_events_inst.h" 51 | #include "oct6100_tone_detection_inst.h" 52 | #include "oct6100_conf_bridge_inst.h" 53 | #include "oct6100_playout_buf_inst.h" 54 | 55 | #include "oct6100_adpcm_chan_inst.h" 56 | #include "oct6100_phasing_tsst_inst.h" 57 | #include "oct6100_channel_inst.h" 58 | #include "oct6100_interrupts_inst.h" 59 | #include "oct6100_remote_debug_inst.h" 60 | #include "oct6100_debug_inst.h" 61 | #include "oct6100_chip_open_inst.h" 62 | #include "oct6100_api_inst.h" 63 | 64 | #include "oct6100_interrupts_pub.h" 65 | #include "oct6100_tsi_cnct_pub.h" 66 | #include "oct6100_events_pub.h" 67 | #include "oct6100_tone_detection_pub.h" 68 | #include "oct6100_mixer_pub.h" 69 | #include "oct6100_conf_bridge_pub.h" 70 | #include "oct6100_playout_buf_pub.h" 71 | 72 | #include "oct6100_channel_pub.h" 73 | #include "oct6100_remote_debug_pub.h" 74 | #include "oct6100_debug_pub.h" 75 | #include "oct6100_chip_open_pub.h" 76 | #include "oct6100_chip_stats_pub.h" 77 | #include "oct6100_adpcm_chan_pub.h" 78 | #include "oct6100_phasing_tsst_pub.h" 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* __OCT6100_API_H__ */ 85 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_apimi.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_apimi.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | This file contains the declaration of all functions exported from the 10 | APIMI block. The APIMI block contains only one function: 11 | Oct6100InterruptMask. 12 | The function is used to mask out the interrupt pin of the chip. This 13 | function is used when a deferred procedure call treats the interrupt (new 14 | interrupts must not be generated until the signalled interrupt is treated). 15 | 16 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 17 | free software; you can redistribute it and/or modify it under the terms of 18 | the GNU General Public License as published by the Free Software Foundation; 19 | either version 2 of the License, or (at your option) any later version. 20 | 21 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 22 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 23 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 24 | for more details. 25 | 26 | You should have received a copy of the GNU General Public License 27 | along with the OCT6100 GPL API; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 29 | 30 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 31 | 32 | $Octasic_Revision: 6 $ 33 | 34 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 35 | 36 | #ifndef __OCT6100_APIMI_H__ 37 | #define __OCT6100_APIMI_H__ 38 | 39 | #ifdef __cplusplus 40 | extern "C" 41 | { 42 | #endif /* __cplusplus */ 43 | 44 | /***************************** INCLUDE FILES *******************************/ 45 | 46 | #include "octdef.h" 47 | 48 | /***************************** TYPES ***************************************/ 49 | 50 | typedef struct _OCT6100_INTERRUPT_MASK_ 51 | { 52 | UINT32 ulUserChipIndex; 53 | PVOID pProcessContext; 54 | 55 | 56 | } tOCT6100_INTERRUPT_MASK, *tPOCT6100_INTERRUPT_MASK; 57 | 58 | /************************** FUNCTION PROTOTYPES *****************************/ 59 | 60 | UINT32 Oct6100InterruptMaskDef( 61 | OUT tPOCT6100_INTERRUPT_MASK f_pInterruptMask ); 62 | UINT32 Oct6100InterruptMask( 63 | IN tPOCT6100_INTERRUPT_MASK f_pInterruptMask ); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif /* __cplusplus */ 68 | 69 | #endif /* __OCT6100_APIMI_H__ */ 70 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_chip_stats_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_chip_stats_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_chip_stats.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_chip_stats_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 21 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_CHIP_STATS_INST_H__ 35 | #define __OCT6100_CHIP_STATS_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_API_CHIP_ERROR_STATS_ 46 | { 47 | UINT8 fFatalChipError; 48 | 49 | UINT32 ulInternalReadTimeoutCnt; 50 | UINT32 ulSdramRefreshTooLateCnt; 51 | UINT32 ulPllJitterErrorCnt; 52 | 53 | /* Internal tone detector error counter. */ 54 | UINT32 ulToneDetectorErrorCnt; 55 | 56 | UINT32 ulOverflowToneEventsCnt; 57 | 58 | UINT32 ulH100OutOfSyncCnt; 59 | UINT32 ulH100ClkABadCnt; 60 | UINT32 ulH100ClkBBadCnt; 61 | UINT32 ulH100FrameABadCnt; 62 | 63 | 64 | 65 | } tOCT6100_API_CHIP_ERROR_STATS, *tPOCT6100_API_CHIP_ERROR_STATS; 66 | 67 | typedef struct _OCT6100_API_CHIP_STATS_ 68 | { 69 | UINT16 usNumberChannels; 70 | UINT16 usNumberBiDirChannels; 71 | UINT16 usNumberTsiCncts; 72 | UINT16 usNumberConfBridges; 73 | UINT16 usNumberPlayoutBuffers; 74 | UINT16 usNumEcChanUsingMixer; 75 | 76 | UINT32 ulPlayoutMemUsed; 77 | UINT16 usNumberActiveBufPlayoutPorts; 78 | 79 | UINT16 usNumberPhasingTssts; 80 | UINT16 usNumberAdpcmChans; 81 | 82 | } tOCT6100_API_CHIP_STATS, *tPOCT6100_API_CHIP_STATS; 83 | 84 | #endif /* __OCT6100_CHIP_STATS_INST_H__ */ 85 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_debug_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_debug_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_debug.c. All elements defined in this file are for public 11 | usage of the API. 12 | 13 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 14 | free software; you can redistribute it and/or modify it under the terms of 15 | the GNU General Public License as published by the Free Software Foundation; 16 | either version 2 of the License, or (at your option) any later version. 17 | 18 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 19 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 20 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 21 | for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with the OCT6100 GPL API; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 26 | 27 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 28 | 29 | $Octasic_Revision: 14 $ 30 | 31 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 32 | 33 | #ifndef __OCT6100_DEBUG_PUB_H__ 34 | #define __OCT6100_DEBUG_PUB_H__ 35 | 36 | /***************************** INCLUDE FILES *******************************/ 37 | 38 | 39 | /***************************** DEFINES *************************************/ 40 | 41 | 42 | /***************************** TYPES ***************************************/ 43 | 44 | typedef struct _OCT6100_DEBUG_SELECT_CHANNEL_ 45 | { 46 | UINT32 ulChannelHndl; 47 | 48 | } tOCT6100_DEBUG_SELECT_CHANNEL, *tPOCT6100_DEBUG_SELECT_CHANNEL; 49 | 50 | typedef struct _OCT6100_DEBUG_GET_DATA_ 51 | { 52 | UINT32 ulGetDataMode; 53 | UINT32 ulGetDataContent; 54 | UINT32 ulRemainingNumBytes; 55 | UINT32 ulTotalNumBytes; 56 | UINT32 ulMaxBytes; 57 | UINT32 ulValidNumBytes; 58 | PUINT8 pbyData; 59 | 60 | } tOCT6100_DEBUG_GET_DATA, *tPOCT6100_DEBUG_GET_DATA; 61 | 62 | /************************** FUNCTION PROTOTYPES *****************************/ 63 | 64 | UINT32 Oct6100DebugSelectChannelDef( 65 | OUT tPOCT6100_DEBUG_SELECT_CHANNEL f_pSelectDebugChan ); 66 | UINT32 Oct6100DebugSelectChannel( 67 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 68 | IN OUT tPOCT6100_DEBUG_SELECT_CHANNEL f_pSelectDebugChan ); 69 | 70 | UINT32 Oct6100DebugGetDataDef( 71 | OUT tPOCT6100_DEBUG_GET_DATA f_pGetData ); 72 | UINT32 Oct6100DebugGetData( 73 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 74 | IN OUT tPOCT6100_DEBUG_GET_DATA f_pGetData ); 75 | 76 | #endif /* __OCT6100_DEBUG_PUB_H__ */ 77 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_events_inst.h: -------------------------------------------------------------------------------- 1 | 2 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 3 | 4 | File: oct6100_events_inst.h 5 | 6 | Copyright (c) 2001-2007 Octasic Inc. 7 | 8 | Description: 9 | 10 | File containing all defines, macros, and structures pertaining to the file 11 | oct6100_events.c. All elements defined in this file are for public 12 | usage of the API. All private elements are defined in the 13 | oct6100_events_priv.h file. 14 | 15 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 16 | free software; you can redistribute it and/or modify it under the terms of 17 | the GNU General Public License as published by the Free Software Foundation; 18 | either version 2 of the License, or (at your option) any later version. 19 | 20 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 21 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 22 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 23 | for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with the OCT6100 GPL API; if not, write to the Free Software 27 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 28 | 29 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 30 | 31 | $Octasic_Revision: 12 $ 32 | 33 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 34 | 35 | #ifndef __OCT6100_EVENTS_INST_H__ 36 | #define __OCT6100_EVENTS_INST_H__ 37 | 38 | /***************************** INCLUDE FILES *******************************/ 39 | 40 | 41 | /***************************** DEFINES *************************************/ 42 | 43 | 44 | /***************************** TYPES ***************************************/ 45 | 46 | typedef struct _OCT6100_API_TONE_EVENT_ 47 | { 48 | UINT32 ulChannelHandle; 49 | UINT32 ulUserChanId; 50 | UINT32 ulToneDetected; /* Tone number of the tone detected. */ 51 | UINT32 ulTimestamp; 52 | UINT32 ulEventType; 53 | UINT32 ulExtToneDetectionPort; 54 | 55 | } tOCT6100_API_TONE_EVENT, *tPOCT6100_API_TONE_EVENT; 56 | 57 | typedef struct _OCT6100_API_BUFFER_PLAYOUT_EVENT_ 58 | { 59 | UINT32 ulChannelHandle; 60 | UINT32 ulUserChanId; 61 | UINT32 ulChannelPort; 62 | UINT32 ulTimestamp; 63 | UINT32 ulUserEventId; 64 | UINT32 ulEventType; 65 | 66 | } tOCT6100_API_BUFFER_PLAYOUT_EVENT, *tPOCT6100_API_BUFFER_PLAYOUT_EVENT; 67 | 68 | #endif /* __OCT6100_EVENTS_INST_H__ */ 69 | 70 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_events_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_events_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_events.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_events_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 14 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_EVENTS_PUB_H__ 35 | #define __OCT6100_EVENTS_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_TONE_EVENT_ 46 | { 47 | UINT32 ulChannelHndl; 48 | UINT32 ulUserChanId; 49 | 50 | UINT32 ulToneDetected; 51 | 52 | UINT32 ulTimestamp; 53 | UINT32 ulEventType; 54 | 55 | UINT32 ulExtToneDetectionPort; 56 | 57 | } tOCT6100_TONE_EVENT, *tPOCT6100_TONE_EVENT; 58 | 59 | typedef struct _OCT6100_EVENT_GET_TONE_ 60 | { 61 | BOOL fMoreEvents; 62 | BOOL fResetBufs; 63 | 64 | UINT32 ulMaxToneEvent; 65 | UINT32 ulNumValidToneEvent; 66 | 67 | tPOCT6100_TONE_EVENT pToneEvent; 68 | 69 | } tOCT6100_EVENT_GET_TONE, *tPOCT6100_EVENT_GET_TONE; 70 | 71 | typedef struct _OCT6100_BUFFER_PLAYOUT_EVENT_ 72 | { 73 | UINT32 ulChannelHndl; 74 | UINT32 ulUserChanId; 75 | UINT32 ulChannelPort; 76 | 77 | UINT32 ulTimestamp; 78 | 79 | UINT32 ulUserEventId; 80 | UINT32 ulEventType; 81 | 82 | } tOCT6100_BUFFER_PLAYOUT_EVENT, *tPOCT6100_BUFFER_PLAYOUT_EVENT; 83 | 84 | typedef struct _OCT6100_BUFFER_PLAYOUT_GET_EVENT_ 85 | { 86 | BOOL fMoreEvents; 87 | BOOL fResetBufs; 88 | 89 | UINT32 ulMaxEvent; 90 | UINT32 ulNumValidEvent; 91 | 92 | tPOCT6100_BUFFER_PLAYOUT_EVENT pBufferPlayoutEvent; 93 | 94 | } tOCT6100_BUFFER_PLAYOUT_GET_EVENT, *tPOCT6100_BUFFER_PLAYOUT_GET_EVENT; 95 | 96 | /************************** FUNCTION PROTOTYPES *****************************/ 97 | 98 | UINT32 Oct6100EventGetToneDef( 99 | OUT tPOCT6100_EVENT_GET_TONE f_pEventGetTone ); 100 | UINT32 Oct6100EventGetTone( 101 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 102 | IN OUT tPOCT6100_EVENT_GET_TONE f_pEventGetTone ); 103 | 104 | UINT32 Oct6100BufferPlayoutGetEventDef( 105 | OUT tPOCT6100_BUFFER_PLAYOUT_GET_EVENT f_pBufPlayoutGetEvent ); 106 | UINT32 Oct6100BufferPlayoutGetEvent( 107 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 108 | IN OUT tPOCT6100_BUFFER_PLAYOUT_GET_EVENT f_pBufPlayoutGetEvent ); 109 | 110 | #endif /* __OCT6100_EVENTS_PUB_H__ */ 111 | 112 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_interrupts_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_interrupts_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_interrupts.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_interrupts_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 23 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_INTERRUPTS_PUB_H__ 35 | #define __OCT6100_INTERRUPTS_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_INTERRUPT_CONFIGURE_ 46 | { 47 | UINT32 ulFatalGeneralConfig; 48 | UINT32 ulFatalMemoryConfig; 49 | 50 | UINT32 ulErrorMemoryConfig; 51 | UINT32 ulErrorOverflowToneEventsConfig; 52 | UINT32 ulErrorH100Config; 53 | 54 | UINT32 ulFatalMemoryTimeout; 55 | UINT32 ulErrorMemoryTimeout; 56 | UINT32 ulErrorOverflowToneEventsTimeout; 57 | UINT32 ulErrorH100Timeout; 58 | 59 | } tOCT6100_INTERRUPT_CONFIGURE, *tPOCT6100_INTERRUPT_CONFIGURE; 60 | 61 | typedef struct _OCT6100_INTERRUPT_FLAGS_ 62 | { 63 | BOOL fFatalGeneral; 64 | UINT32 ulFatalGeneralFlags; 65 | 66 | BOOL fFatalReadTimeout; 67 | 68 | BOOL fErrorRefreshTooLate; 69 | BOOL fErrorPllJitter; 70 | 71 | BOOL fErrorOverflowToneEvents; 72 | 73 | BOOL fErrorH100OutOfSync; 74 | BOOL fErrorH100ClkA; 75 | BOOL fErrorH100ClkB; 76 | BOOL fErrorH100FrameA; 77 | 78 | BOOL fToneEventsPending; 79 | BOOL fBufferPlayoutEventsPending; 80 | 81 | BOOL fApiSynch; 82 | 83 | 84 | 85 | } tOCT6100_INTERRUPT_FLAGS, *tPOCT6100_INTERRUPT_FLAGS; 86 | 87 | /************************** FUNCTION PROTOTYPES *****************************/ 88 | 89 | UINT32 Oct6100InterruptConfigureDef( 90 | OUT tPOCT6100_INTERRUPT_CONFIGURE f_pConfigInts ); 91 | UINT32 Oct6100InterruptConfigure( 92 | IN tPOCT6100_INSTANCE_API f_pApiInst, 93 | IN OUT tPOCT6100_INTERRUPT_CONFIGURE f_pConfigInts ); 94 | 95 | UINT32 Oct6100InterruptServiceRoutineDef( 96 | OUT tPOCT6100_INTERRUPT_FLAGS f_pIntFlags ); 97 | UINT32 Oct6100InterruptServiceRoutine( 98 | IN tPOCT6100_INSTANCE_API f_pApiInst, 99 | IN OUT tPOCT6100_INTERRUPT_FLAGS f_pIntFlags ); 100 | 101 | #endif /* __OCT6100_INTERRUPTS_PUB_H__ */ 102 | 103 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_mixer_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_mixer_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_mixer.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_mixer_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 13 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_MIXER_INST_H__ 35 | #define __OCT6100_MIXER_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_API_MIXER_EVENT_ 46 | { 47 | /* Flag specifying whether the entry is used or not. */ 48 | UINT8 fReserved; 49 | 50 | /* Type of the event.*/ 51 | UINT16 usEventType; 52 | 53 | /* Source channel index */ 54 | UINT16 usSourceChanIndex; 55 | 56 | /* Destination channel index */ 57 | UINT16 usDestinationChanIndex; 58 | 59 | /* Pointer to the next entry.*/ 60 | UINT16 usNextEventPtr; 61 | 62 | } tOCT6100_API_MIXER_EVENT, *tPOCT6100_API_MIXER_EVENT; 63 | 64 | 65 | typedef struct _OCT6100_API_COPY_EVENT_ 66 | { 67 | /* Flag specifying whether the entry is used or not. */ 68 | UINT8 fReserved; 69 | 70 | /* Count used to manage entry handles allocated to user. */ 71 | UINT8 byEntryOpenCnt; 72 | 73 | /* Source + destination ports. */ 74 | UINT8 bySourcePort; 75 | UINT8 byDestinationPort; 76 | 77 | /* Index of the channels associated to this event.*/ 78 | UINT16 usSourceChanIndex; 79 | UINT16 usDestinationChanIndex; 80 | 81 | UINT16 usMixerEventIndex; 82 | 83 | } tOCT6100_API_COPY_EVENT, *tPOCT6100_API_COPY_EVENT; 84 | 85 | 86 | #endif /* __OCT6100_MIXER_INST_H__ */ 87 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_mixer_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_mixer_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_mixer.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_mixer_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 7 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_MIXER_PUB_H__ 35 | #define __OCT6100_MIXER_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_COPY_EVENT_CREATE_ 46 | { 47 | PUINT32 pulCopyEventHndl; 48 | 49 | UINT32 ulSourceChanHndl; 50 | UINT32 ulSourcePort; 51 | 52 | UINT32 ulDestinationChanHndl; 53 | UINT32 ulDestinationPort; 54 | 55 | } tOCT6100_COPY_EVENT_CREATE, *tPOCT6100_COPY_EVENT_CREATE; 56 | 57 | typedef struct _OCT6100_COPY_EVENT_DESTROY_ 58 | { 59 | UINT32 ulCopyEventHndl; 60 | 61 | } tOCT6100_COPY_EVENT_DESTROY, *tPOCT6100_COPY_EVENT_DESTROY; 62 | 63 | /************************** FUNCTION PROTOTYPES *****************************/ 64 | 65 | UINT32 Oct6100MixerCopyEventCreateDef( 66 | OUT tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate ); 67 | UINT32 Oct6100MixerCopyEventCreate( 68 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 69 | IN OUT tPOCT6100_COPY_EVENT_CREATE f_pCopyEventCreate ); 70 | 71 | UINT32 Oct6100MixerCopyEventDestroyDef( 72 | OUT tPOCT6100_COPY_EVENT_DESTROY f_pCopyEventDestroy ); 73 | UINT32 Oct6100MixerCopyEventDestroy( 74 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 75 | IN OUT tPOCT6100_COPY_EVENT_DESTROY f_pCopyEventDestroy ); 76 | 77 | #endif /* __OCT6100_MIXER_PUB_H__ */ 78 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_phasing_tsst_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_phasing_tsst_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_phasing_tsst.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_phasing_tsst_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 11 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_PHASING_TSST_INST_H__ 35 | #define __OCT6100_PHASING_TSST_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_API_PHASING_TSST_ 46 | { 47 | /* Flag specifying whether the entry is used or not. */ 48 | UINT8 fReserved; 49 | 50 | /* Count used to manage entry handles allocated to user. */ 51 | UINT8 byEntryOpenCnt; 52 | 53 | /* Count of number of resources connected in some way to this buffer. */ 54 | UINT16 usDependencyCnt; 55 | 56 | /* TDM timeslot and stream where the counter is read. */ 57 | UINT16 usStream; 58 | UINT16 usTimeslot; 59 | 60 | /* Length of the phasing TSST counter. */ 61 | UINT16 usPhasingLength; 62 | 63 | /* TSST control index where the counter comes from. */ 64 | UINT16 usPhasingTsstIndex; 65 | 66 | } tOCT6100_API_PHASING_TSST, *tPOCT6100_API_PHASING_TSST; 67 | 68 | #endif /* __OCT6100_PHASING_TSST_INST_H__ */ 69 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_phasing_tsst_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_phasing_tsst_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_phasing_tsst.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_phasing_tsst_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 10 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_PHASING_TSST_PUB_H__ 35 | #define __OCT6100_PHASING_TSST_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_PHASING_TSST_OPEN_ 46 | { 47 | PUINT32 pulPhasingTsstHndl; 48 | 49 | UINT32 ulPhasingLength; 50 | UINT32 ulTimeslot; 51 | UINT32 ulStream; 52 | 53 | 54 | 55 | } tOCT6100_PHASING_TSST_OPEN, *tPOCT6100_PHASING_TSST_OPEN; 56 | 57 | typedef struct _OCT6100_PHASING_TSST_CLOSE_ 58 | { 59 | UINT32 ulPhasingTsstHndl; 60 | 61 | } tOCT6100_PHASING_TSST_CLOSE, *tPOCT6100_PHASING_TSST_CLOSE; 62 | 63 | /************************** FUNCTION PROTOTYPES *****************************/ 64 | 65 | UINT32 Oct6100PhasingTsstOpenDef( 66 | OUT tPOCT6100_PHASING_TSST_OPEN f_pPhasingTsstOpen ); 67 | UINT32 Oct6100PhasingTsstOpen( 68 | IN tPOCT6100_INSTANCE_API f_pApiInstance, 69 | IN OUT tPOCT6100_PHASING_TSST_OPEN f_pPhasingTsstOpen ); 70 | 71 | UINT32 Oct6100PhasingTsstCloseDef( 72 | OUT tPOCT6100_PHASING_TSST_CLOSE f_pPhasingTsstClose ); 73 | UINT32 Oct6100PhasingTsstClose( 74 | IN tPOCT6100_INSTANCE_API f_pApiInstance, 75 | IN OUT tPOCT6100_PHASING_TSST_CLOSE f_pPhasingTsstClose ); 76 | 77 | #endif /* __OCT6100_PHASING_TSST_PUB_H__ */ 78 | 79 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_playout_buf_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_playout_buf_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_playout_buf.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_playout_buf_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 10 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_PLAYOUT_BUF_INST_H__ 35 | #define __OCT6100_PLAYOUT_BUF_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | #define mOCT6100_GET_BUFFER_MEMORY_NODE_LIST_PNT( pSharedInfo, pList ) \ 43 | pList = ( tPOCT6100_API_BUFFER_PLAYOUT_MALLOC_NODE )(( PUINT8 )pSharedInfo + pSharedInfo->ulPlayoutBufMemoryNodeListOfst ); 44 | 45 | #define mOCT6100_GET_BUFFER_MEMORY_NODE_ENTRY_PNT( pSharedInfo, pEntry, ulIndex ) \ 46 | pEntry = (( tPOCT6100_API_BUFFER_PLAYOUT_MALLOC_NODE )(( PUINT8 )pSharedInfo + pSharedInfo->ulPlayoutBufMemoryNodeListOfst)) + ulIndex; 47 | 48 | /***************************** TYPES ***************************************/ 49 | 50 | typedef struct _OCT6100_API_BUFFER_PLAYOUT_MALLOC_NODE_ 51 | { 52 | /* Next node. */ 53 | UINT32 ulNext; 54 | 55 | /* Previous node. */ 56 | UINT32 ulPrevious; 57 | 58 | /* Start address of this node. */ 59 | UINT32 ulStartAddress; 60 | 61 | /* Size of this node. */ 62 | UINT32 ulSize; 63 | 64 | /* Allocated node? Free node? */ 65 | UINT8 fAllocated; 66 | 67 | } tOCT6100_API_BUFFER_PLAYOUT_MALLOC_NODE, *tPOCT6100_API_BUFFER_PLAYOUT_MALLOC_NODE; 68 | 69 | typedef struct _OCT6100_API_BUFFER_ 70 | { 71 | /* Flag specifying whether the entry is used or not. */ 72 | UINT8 fReserved; 73 | 74 | /* Pcm law of the buffer. */ 75 | UINT8 byBufferPcmLaw; 76 | 77 | /* Number of channels currently playing this buffer.*/ 78 | UINT16 usDependencyCnt; 79 | 80 | /* Length of the buffer ( in bytes ).*/ 81 | UINT32 ulBufferSize; 82 | 83 | /* Address in external memory of the buffer. */ 84 | UINT32 ulBufferBase; 85 | 86 | } tOCT6100_API_BUFFER, *tPOCT6100_API_BUFFER; 87 | 88 | #endif /* __OCT6100_PLAYOUT_BUF_INST_H__ */ 89 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_remote_debug_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_remote_debug_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_remote_debug.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_remote_debug_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 6 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_REMOTE_DEBUG_INST_H__ 35 | #define __OCT6100_REMOTE_DEBUG_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_API_REMOTE_DEBUG_INFO_ 46 | { 47 | UINT32 ulSessionTreeOfst; 48 | UINT32 ulSessionListOfst; 49 | UINT32 ulSessionListHead; 50 | UINT32 ulSessionListTail; 51 | 52 | UINT32 ulPktCacheOfst; 53 | UINT32 ulDataBufOfst; 54 | 55 | UINT32 ulNumSessionsOpen; 56 | UINT32 ulMaxSessionsOpen; 57 | 58 | } tOCT6100_API_REMOTE_DEBUG_INFO, *tPOCT6100_API_REMOTE_DEBUG_INFO; 59 | 60 | typedef struct _OCT6100_API_REMOTE_DEBUG_SESSION_ 61 | { 62 | UINT32 ulSessionNum; 63 | UINT32 ulTransactionNum; 64 | UINT32 ulPktRetryNum; 65 | UINT32 ulPktByteSize; 66 | 67 | UINT32 aulLastPktTime[ 2 ]; 68 | UINT32 ulForwardLink; 69 | UINT32 ulBackwardLink; 70 | 71 | } tOCT6100_API_REMOTE_DEBUG_SESSION, *tPOCT6100_API_REMOTE_DEBUG_SESSION; 72 | 73 | #endif /* __OCT6100_REMOTE_DEBUG_INST_H__ */ 74 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_remote_debug_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_remote_debug_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_remote_debug.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_remote_debug_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 6 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_REMOTE_DEBUG_PUB_H__ 35 | #define __OCT6100_REMOTE_DEBUG_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_REMOTE_DEBUG_ 46 | { 47 | PUINT32 pulReceivedPktPayload; 48 | UINT32 ulReceivedPktLength; 49 | 50 | PUINT32 pulResponsePktPayload; 51 | UINT32 ulMaxResponsePktLength; 52 | UINT32 ulResponsePktLength; 53 | 54 | } tOCT6100_REMOTE_DEBUG, *tPOCT6100_REMOTE_DEBUG; 55 | 56 | /************************** FUNCTION PROTOTYPES *****************************/ 57 | 58 | UINT32 Oct6100RemoteDebugDef( 59 | OUT tPOCT6100_REMOTE_DEBUG f_pRemoteDebug ); 60 | UINT32 Oct6100RemoteDebug( 61 | IN OUT tPOCT6100_INSTANCE_API f_pApiInst, 62 | IN OUT tPOCT6100_REMOTE_DEBUG f_pRemoteDebug ); 63 | 64 | #endif /* __OCT6100_REMOTE_DEBUG_PUB_H__ */ 65 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_tlv_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tlv_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_tlv.c. All elements defined in this file are for public 11 | usage of the API. All instate elements are defined in the 12 | oct6100_tlv_inst.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 7 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_TLV_INST_H__ 35 | #define __OCT6100_TLV_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | /***************************** DEFINES *************************************/ 40 | 41 | /***************************** TYPES ***************************************/ 42 | 43 | typedef struct _OCT6100_TLV_OFFSET_ 44 | { 45 | /* The dword offset contain the number of dword from a base address to reach the desired dword. 46 | 47 | i.e. usDwordOffset = (total bit offset) / 32; */ 48 | 49 | UINT16 usDwordOffset; 50 | 51 | /* The bit offset will contain the bit offset required to right shift the DWORD read and obtain 52 | the desired value. This field is depend on the field size. 53 | 54 | i.e. byBitOffset = 31 - ((total bit offset) % 32) - byFieldSize; */ 55 | 56 | UINT8 byBitOffset; 57 | UINT8 byFieldSize; 58 | 59 | } tOCT6100_TLV_OFFSET, *tPOCT6100_TLV_OFFSET; 60 | 61 | typedef struct _OCT6100_TLV_TONE_INFO_ 62 | { 63 | UINT32 ulToneID; 64 | UINT32 ulDetectionPort; 65 | 66 | UINT8 aszToneName[ cOCT6100_TLV_MAX_TONE_NAME_SIZE ]; 67 | 68 | 69 | 70 | } tOCT6100_TLV_TONE_INFO, *tPOCT6100_TLV_TONE_INFO; 71 | 72 | #endif /* __OCT6100_TLV_INST_H__ */ 73 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_tone_detection_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tone_detection_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_tone_detection_buf.c. All elements defined in this file are for 11 | public usage of the API. All private elements are defined in the 12 | oct6100_tone_detection_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 8 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_TONE_DETECTION_INST_H__ 35 | #define __OCT6100_TONE_DETECTION_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | 46 | #endif /* __OCT6100_TONE_DETECTION_INST_H__ */ 47 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_tone_detection_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tone_detection_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_tone_detection.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_tone_detection_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 10 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_TONE_DETECTION_PUB_H__ 35 | #define __OCT6100_TONE_DETECTION_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_TONE_DETECTION_ENABLE_ 46 | { 47 | UINT32 ulChannelHndl; 48 | UINT32 ulToneNumber; 49 | 50 | } tOCT6100_TONE_DETECTION_ENABLE, *tPOCT6100_TONE_DETECTION_ENABLE; 51 | 52 | typedef struct _OCT6100_TONE_DETECTION_DISABLE_ 53 | { 54 | UINT32 ulChannelHndl; 55 | UINT32 ulToneNumber; 56 | BOOL fDisableAll; 57 | 58 | } tOCT6100_TONE_DETECTION_DISABLE, *tPOCT6100_TONE_DETECTION_DISABLE; 59 | 60 | /************************** FUNCTION PROTOTYPES *****************************/ 61 | 62 | UINT32 Oct6100ToneDetectionEnableDef( 63 | OUT tPOCT6100_TONE_DETECTION_ENABLE f_pBufferLoad ); 64 | UINT32 Oct6100ToneDetectionEnable( 65 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 66 | IN OUT tPOCT6100_TONE_DETECTION_ENABLE f_pBufferLoad ); 67 | 68 | UINT32 Oct6100ToneDetectionDisableDef( 69 | OUT tPOCT6100_TONE_DETECTION_DISABLE f_pBufferUnload ); 70 | UINT32 Oct6100ToneDetectionDisable( 71 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 72 | IN OUT tPOCT6100_TONE_DETECTION_DISABLE f_pBufferUnload ); 73 | 74 | #endif /* __OCT6100_TONE_DETECTION_PUB_H__ */ 75 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_tsi_cnct_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tsi_cnct_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_tsi_cnct.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_tsi_cnct_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 9 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_TSI_CNCT_INST_H__ 35 | #define __OCT6100_TSI_CNCT_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | /***************************** DEFINES *************************************/ 40 | 41 | /***************************** TYPES ***************************************/ 42 | 43 | typedef struct _OCT6100_API_TSI_CNCT_ 44 | { 45 | /* Flag specifying whether the entry is used or not. */ 46 | UINT8 fReserved; 47 | 48 | /* Count used to manage entry handles allocated to user. */ 49 | UINT8 byEntryOpenCnt; 50 | 51 | /* Input PCM law. */ 52 | UINT8 byInputPcmLaw; 53 | 54 | /* TSI chariot memory entry. */ 55 | UINT16 usTsiMemIndex; 56 | 57 | /* Input and output timeslot information. */ 58 | UINT16 usInputTimeslot; 59 | UINT16 usInputStream; 60 | 61 | UINT16 usOutputTimeslot; 62 | UINT16 usOutputStream; 63 | 64 | /* Internal info for quick access to structures associated to this TSI cnct. */ 65 | UINT16 usInputTsstIndex; 66 | UINT16 usOutputTsstIndex; 67 | 68 | } tOCT6100_API_TSI_CNCT, *tPOCT6100_API_TSI_CNCT; 69 | 70 | #endif /* __OCT6100_TSI_CNCT_INST_H__ */ 71 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_tsi_cnct_pub.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tsi_cnct_pub.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_tsi_cnct.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_tsi_cnct_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 11 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_TSI_CNCT_PUB_H__ 35 | #define __OCT6100_TSI_CNCT_PUB_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_TSI_CNCT_OPEN_ 46 | { 47 | PUINT32 pulTsiCnctHndl; 48 | 49 | UINT32 ulInputTimeslot; 50 | UINT32 ulInputStream; 51 | UINT32 ulOutputTimeslot; 52 | UINT32 ulOutputStream; 53 | 54 | } tOCT6100_TSI_CNCT_OPEN, *tPOCT6100_TSI_CNCT_OPEN; 55 | 56 | typedef struct _OCT6100_TSI_CNCT_CLOSE_ 57 | { 58 | UINT32 ulTsiCnctHndl; 59 | 60 | } tOCT6100_TSI_CNCT_CLOSE, *tPOCT6100_TSI_CNCT_CLOSE; 61 | 62 | /************************** FUNCTION PROTOTYPES *****************************/ 63 | 64 | UINT32 Oct6100TsiCnctOpenDef( 65 | OUT tPOCT6100_TSI_CNCT_OPEN f_pTsiCnctOpen ); 66 | UINT32 Oct6100TsiCnctOpen( 67 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 68 | IN OUT tPOCT6100_TSI_CNCT_OPEN f_pTsiCnctOpen ); 69 | 70 | UINT32 Oct6100TsiCnctCloseDef( 71 | OUT tPOCT6100_TSI_CNCT_CLOSE f_pTsiCnctClose ); 72 | UINT32 Oct6100TsiCnctClose( 73 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 74 | IN OUT tPOCT6100_TSI_CNCT_CLOSE f_pTsiCnctClose ); 75 | 76 | #endif /* __OCT6100_TSI_CNCT_PUB_H__ */ 77 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/oct6100api/oct6100_tsst_inst.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tsst_inst.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all defines, macros, and structures pertaining to the file 10 | oct6100_tsst.c. All elements defined in this file are for public 11 | usage of the API. All private elements are defined in the 12 | oct6100_tsst_priv.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 5 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_TSST_INST_H__ 35 | #define __OCT6100_TSST_INST_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | typedef struct _OCT6100_API_TSST_ENTRY_ 46 | { 47 | UINT16 usTsstMemoryIndex; /* Index in the TSST memory of the TSST */ 48 | UINT16 usTsstValue; /* Tsst value given by the user. */ 49 | /* bit 5:0 = stream value, bit 13:6 = timeslot value. */ 50 | 51 | UINT16 usNextEntry; /* Pointer to the next entry in the list. */ 52 | 53 | } tOCT6100_API_TSST_ENTRY, *tPOCT6100_API_TSST_ENTRY; 54 | 55 | #endif /* __OCT6100_TSST_INST_H__ */ 56 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/include/octtypewin.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: octtypewin.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | This file defines the base storage types for the Windows environment. 10 | Includes the Windows definition file and add the missing ones here. 11 | 12 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 13 | free software; you can redistribute it and/or modify it under the terms of 14 | the GNU General Public License as published by the Free Software Foundation; 15 | either version 2 of the License, or (at your option) any later version. 16 | 17 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 18 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20 | for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with the OCT6100 GPL API; if not, write to the Free Software 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 | 26 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 27 | 28 | $Octasic_Revision: 16 $ 29 | 30 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 31 | 32 | #ifndef __OCTTYPEWIN_H__ 33 | #define __OCTTYPEWIN_H__ 34 | 35 | /*-------------------------------------------------------------------------- 36 | C language 37 | ----------------------------------------------------------------------------*/ 38 | #define WIN32_LEAN_AND_MEAN /* just get the base type definition from Windows */ 39 | #include 40 | 41 | /* Disable argument not used warning */ 42 | #pragma warning( disable : 4100 ) 43 | /* Disable Level 4 warning: nonstandard extension used : translation unit is empty */ 44 | #pragma warning( disable : 4206 ) 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | /* 16-bit integer */ 51 | typedef unsigned short UINT16; 52 | typedef signed short INT16; 53 | typedef unsigned short *PUINT16; 54 | typedef signed short *PINT16; 55 | 56 | /* 8-bit integer */ 57 | typedef unsigned char UINT8; 58 | typedef signed char INT8; 59 | typedef signed char OCT_INT8; 60 | typedef unsigned char *PUINT8; 61 | typedef signed char *PINT8; 62 | 63 | typedef double DOUBLE; 64 | 65 | 66 | /* 32 bit integer */ 67 | #if ( defined( _MSC_VER ) && _MSC_VER == 1100 ) 68 | /* MFC5 compiler does not define UINT32 */ 69 | typedef unsigned int UINT32; 70 | typedef signed int INT32; 71 | typedef INT32 * PINT32; 72 | typedef UINT32 * PUINT32; 73 | #endif /* _MSC_VER */ 74 | 75 | /* LONG LONG */ 76 | #define LLONG signed __int64 77 | #define PLLONG signed __int64 * 78 | #define ULLONG unsigned __int64 79 | #define PULLONG unsigned __int64 * 80 | 81 | /* Double integers */ 82 | typedef double DOUBLE; 83 | typedef double * PDOUBLE; 84 | typedef float FLOAT; 85 | typedef float * PFLOAT; 86 | 87 | #ifndef OPT 88 | #define OPT /* OPT param */ 89 | #endif 90 | 91 | typedef PSZ * PPSZ; 92 | 93 | /*-------------------------------------------------------------------------- 94 | C language 95 | ----------------------------------------------------------------------------*/ 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif /* __OCTTYPEWIN_H__ */ 101 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/oct612x.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Octasic OCT6100 Interface 3 | * 4 | * Copyright (C) 2013 Digium, Inc. 5 | * 6 | * All rights reserved. 7 | * 8 | */ 9 | 10 | /* 11 | * See http://www.asterisk.org for more information about 12 | * the Asterisk project. Please do not directly contact 13 | * any of the maintainers of this project for assistance; 14 | * the project provides a web site, mailing lists and IRC 15 | * channels for your use. 16 | * 17 | * This program is free software, distributed under the terms of 18 | * the GNU General Public License Version 2 as published by the 19 | * Free Software Foundation. See the LICENSE file included with 20 | * this program for more details. 21 | */ 22 | #ifndef __OCT612X_H__ 23 | #define __OCT612X_H__ 24 | 25 | #include 26 | 27 | struct oct612x_context; 28 | 29 | /** 30 | * struct oct612x_ops - Callbacks used by oct612x library to talk to part. 31 | * 32 | */ 33 | struct oct612x_ops { 34 | int (*write)(struct oct612x_context *context, u32 address, u16 value); 35 | int (*read)(struct oct612x_context *context, u32 address, u16 *value); 36 | int (*write_smear)(struct oct612x_context *context, u32 address, 37 | u16 value, size_t count); 38 | int (*write_burst)(struct oct612x_context *context, u32 address, 39 | const u16 *value, size_t count); 40 | int (*read_burst)(struct oct612x_context *context, u32 address, 41 | u16 *value, size_t count); 42 | }; 43 | 44 | struct oct612x_context { 45 | const struct oct612x_ops *ops; 46 | struct device *dev; 47 | }; 48 | 49 | #endif /* __OCT612X_H__ */ 50 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octasic-helper: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Jeffrey C. Ollie 5 | # 6 | # $1 == information requested 7 | # $2 == path to octasic directory 8 | # 9 | 10 | APIDIR=$2/octdeviceapi/oct6100api/oct6100_api 11 | 12 | case $1 in 13 | objects) 14 | echo $APIDIR/oct6100_adpcm_chan.o \ 15 | $APIDIR/oct6100_channel.o \ 16 | $APIDIR/oct6100_chip_open.o \ 17 | $APIDIR/oct6100_chip_stats.o \ 18 | $APIDIR/oct6100_conf_bridge.o \ 19 | $APIDIR/oct6100_debug.o \ 20 | $APIDIR/oct6100_events.o \ 21 | $APIDIR/oct6100_interrupts.o \ 22 | $APIDIR/oct6100_memory.o \ 23 | $APIDIR/oct6100_miscellaneous.o \ 24 | $APIDIR/oct6100_mixer.o \ 25 | $APIDIR/oct6100_phasing_tsst.o \ 26 | $APIDIR/oct6100_playout_buf.o \ 27 | $APIDIR/oct6100_remote_debug.o \ 28 | $APIDIR/oct6100_tlv.o \ 29 | $APIDIR/oct6100_tone_detection.o \ 30 | $APIDIR/oct6100_tsi_cnct.o \ 31 | $APIDIR/oct6100_tsst.o \ 32 | $2/apilib/bt/octapi_bt0.o \ 33 | $2/apilib/largmath/octapi_largmath.o \ 34 | $2/apilib/llman/octapi_llman.o 35 | ;; 36 | cflags) 37 | echo -I$2/include -I$2/octdeviceapi -I$2/octdeviceapi/oct6100api 38 | ;; 39 | esac 40 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asterisk/dahdi-linux/648016d6b3a06f7ec75c17ef94ffa17be59eebcf/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.c -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_chip_stats_priv.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_chip_stats_priv.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all private defines, macros, structures and prototypes 10 | pertaining to the file oct6100_chip_stats.c. All elements defined in this 11 | file are for private usage of the API. All public elements are defined 12 | in the oct6100_chip_stats_pub.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 8 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_CHIP_STATS_PRIV_H__ 35 | #define __OCT6100_CHIP_STATS_PRIV_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | 46 | /************************** FUNCTION PROTOTYPES *****************************/ 47 | 48 | UINT32 Oct6100ApiChipStatsSwInit( 49 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance ); 50 | 51 | UINT32 Oct6100ChipGetStatsSer( 52 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 53 | OUT tPOCT6100_CHIP_STATS f_pChipStats ); 54 | 55 | #endif /* __OCT6100_CHIP_STATS_PRIV_H__ */ 56 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_debug_priv.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_debug_priv.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all private defines, macros, structures and prototypes 10 | pertaining to the file oct6100_debug.c. All elements defined in this 11 | file are for private usage of the API. All public elements are defined 12 | in the oct6100_debug_pub.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 12 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_DEBUG_PRIV_H__ 35 | #define __OCT6100_DEBUG_PRIV_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | 43 | /***************************** TYPES ***************************************/ 44 | 45 | 46 | /************************** FUNCTION PROTOTYPES *****************************/ 47 | 48 | 49 | UINT32 Oct6100DebugSelectChannelSer( 50 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 51 | IN tPOCT6100_DEBUG_SELECT_CHANNEL f_pSelectDebugChan, 52 | IN BOOL f_fCheckChannelRecording ); 53 | 54 | UINT32 Oct6100DebugGetDataSer( 55 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 56 | IN OUT tPOCT6100_DEBUG_GET_DATA f_pGetData ); 57 | 58 | #endif /* __OCT6100_DEBUG_PRIV_H__ */ 59 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_events_priv.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_events_priv.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all private defines, macros, structures and prototypes 10 | pertaining to the file oct6100_events.c. All elements defined in this 11 | file are for private usage of the API. All public elements are defined 12 | in the oct6100_events_pub.h file. 13 | 14 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 15 | free software; you can redistribute it and/or modify it under the terms of 16 | the GNU General Public License as published by the Free Software Foundation; 17 | either version 2 of the License, or (at your option) any later version. 18 | 19 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 20 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 21 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22 | for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with the OCT6100 GPL API; if not, write to the Free Software 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27 | 28 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 29 | 30 | $Octasic_Revision: 14 $ 31 | 32 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 33 | 34 | #ifndef __OCT6100_EVENTS_PRIV_H__ 35 | #define __OCT6100_EVENTS_PRIV_H__ 36 | 37 | /***************************** INCLUDE FILES *******************************/ 38 | 39 | 40 | /***************************** DEFINES *************************************/ 41 | 42 | #define mOCT6100_GET_TONE_EVENT_BUF_PNT( pSharedInfo, pSoftBuf ) \ 43 | pSoftBuf = ( PVOID )(( PUINT8 )pSharedInfo + pSharedInfo->SoftBufs.ulToneEventBufferMemOfst ); 44 | 45 | #define mOCT6100_GET_BUFFER_PLAYOUT_EVENT_BUF_PNT( pSharedInfo, pSoftBuf ) \ 46 | pSoftBuf = ( PVOID )(( PUINT8 )pSharedInfo + pSharedInfo->SoftBufs.ulBufPlayoutEventBufferMemOfst ); 47 | 48 | /***************************** TYPES ***************************************/ 49 | 50 | 51 | /************************** FUNCTION PROTOTYPES *****************************/ 52 | 53 | UINT32 Oct6100ApiGetEventsSwSizes( 54 | IN tPOCT6100_CHIP_OPEN f_pOpenChip, 55 | OUT tPOCT6100_API_INSTANCE_SIZES f_pInstSizes ); 56 | 57 | UINT32 Oct6100EventGetToneSer( 58 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 59 | IN OUT tPOCT6100_EVENT_GET_TONE f_pEventGetTone ); 60 | 61 | UINT32 Oct6100ApiTransferToneEvents( 62 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 63 | IN UINT32 f_ulResetBuf ); 64 | 65 | 66 | 67 | UINT32 Oct6100BufferPlayoutGetEventSer( 68 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 69 | IN OUT tPOCT6100_BUFFER_PLAYOUT_GET_EVENT f_pBufPlayoutGetEvent ); 70 | 71 | UINT32 Oct6100BufferPlayoutTransferEvents( 72 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 73 | IN UINT32 f_ulResetBuf ); 74 | 75 | UINT32 Oct6100BufferPlayoutCheckForSpecificEvent( 76 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 77 | IN UINT32 f_ulChannelIndex, 78 | IN UINT32 f_ulChannelPort, 79 | IN BOOL f_fSaveToSoftBuffer, 80 | OUT PBOOL f_pfEventDetected ); 81 | 82 | #endif /* __OCT6100_EVENTS_PRIV_H__ */ 83 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_tsst_priv.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_tsst_priv.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | File containing all private defines, macros, structures and prototypes 10 | pertaining to the file oct6100_tsst.c. All elements defined in 11 | this file are for private usage of the API. 12 | 13 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 14 | free software; you can redistribute it and/or modify it under the terms of 15 | the GNU General Public License as published by the Free Software Foundation; 16 | either version 2 of the License, or (at your option) any later version. 17 | 18 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 19 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 20 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 21 | for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with the OCT6100 GPL API; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 26 | 27 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 28 | 29 | $Octasic_Revision: 14 $ 30 | 31 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 32 | 33 | #ifndef __OCT6100_TSST_PRIV_H__ 34 | #define __OCT6100_TSST_PRIV_H__ 35 | 36 | /***************************** INCLUDE FILES *******************************/ 37 | 38 | 39 | /***************************** DEFINES *************************************/ 40 | 41 | /* TSST allocation and serialization pointer macros. */ 42 | #define mOCT6100_GET_TSST_ALLOC_PNT( pSharedInfo, pAlloc ) \ 43 | pAlloc = ( PUINT32 )(( PUINT8 )pSharedInfo + pSharedInfo->ulTsstAllocOfst); 44 | 45 | #define mOCT6100_GET_TSST_LIST_PNT( pSharedInfo, pList ) \ 46 | pList = ( tPOCT6100_API_TSST_ENTRY )(( PUINT8 )pSharedInfo + pSharedInfo->ulTsstListOfst ); 47 | 48 | #define mOCT6100_GET_TSST_LIST_ENTRY_PNT( pSharedInfo, pEntry, ulIndex ) \ 49 | pEntry = (( tPOCT6100_API_TSST_ENTRY )(( PUINT8 )pSharedInfo + pSharedInfo->ulTsstListOfst)) + ulIndex; 50 | 51 | #define mOCT6100_GET_TSST_LIST_ALLOC_PNT( pSharedInfo, pAlloc ) \ 52 | pAlloc = ( PVOID )(( PUINT8 )pSharedInfo + pSharedInfo->ulTsstListAllocOfst); 53 | 54 | /***************************** TYPES ***************************************/ 55 | 56 | 57 | /************************** FUNCTION PROTOTYPES *****************************/ 58 | 59 | UINT32 Oct6100ApiGetTsstSwSizes( 60 | OUT tPOCT6100_API_INSTANCE_SIZES f_pInstSizes ); 61 | 62 | UINT32 Oct6100ApiTsstSwInit( 63 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance ); 64 | 65 | UINT32 Oct6100ApiValidateTsst( 66 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 67 | IN UINT32 f_ulNumTssts, 68 | IN UINT32 f_ulTimeslot, 69 | IN UINT32 f_ulStream, 70 | IN UINT32 f_ulDirection ); 71 | 72 | UINT32 Oct6100ApiReserveTsst( 73 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 74 | IN UINT32 f_ulTimeslot, 75 | IN UINT32 f_ulStream, 76 | IN UINT32 f_ulNumTsst, 77 | IN UINT32 f_ulDirection, 78 | OUT PUINT16 f_pusTsstMemIndex, 79 | OUT PUINT16 f_pusTsstListIndex ); 80 | 81 | UINT32 Oct6100ApiReleaseTsst( 82 | IN OUT tPOCT6100_INSTANCE_API f_pApiInstance, 83 | IN UINT32 f_ulTimeslot, 84 | IN UINT32 f_ulStream, 85 | IN UINT32 f_ulNumTsst, 86 | IN UINT32 f_ulDirection, 87 | IN UINT16 f_usTsstListIndex ); 88 | 89 | #endif /* __OCT6100_TSST_PRIV_H__ */ 90 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_version.h: -------------------------------------------------------------------------------- 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ 2 | 3 | File: oct6100_version.h 4 | 5 | Copyright (c) 2001-2007 Octasic Inc. 6 | 7 | Description: 8 | 9 | This file contains the version of API. To obtain that version 10 | number, the user must call the API function Oct6100ApiGetVersion(). 11 | 12 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is 13 | free software; you can redistribute it and/or modify it under the terms of 14 | the GNU General Public License as published by the Free Software Foundation; 15 | either version 2 of the License, or (at your option) any later version. 16 | 17 | The OCT6100 GPL API is distributed in the hope that it will be useful, but 18 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20 | for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with the OCT6100 GPL API; if not, write to the Free Software 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25 | 26 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ 27 | 28 | $Octasic_Revision: 52 $ 29 | 30 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 31 | 32 | #ifndef __OCT6100_VERSION_H__ 33 | #define __OCT6100_VERSION_H__ 34 | 35 | /* String version of the OCT6100 API.*/ 36 | 37 | #define cOCT6100_API_VERSION "OCT6100API-01.00-PR49" 38 | 39 | #endif /* __OCT6100_VERSION_H__ */ 40 | -------------------------------------------------------------------------------- /drivers/dahdi/oct612x/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: This is not intended to be a functional program. Its only purpose 3 | is to act as a tool to find out what portions of the Octasic API kit we 4 | actually need to link into our drivers. As such, it references every API 5 | call that the actual drivers use, and we let the compiler and linker tell 6 | us what parts of each API module are actually needed to successfully 7 | build this program. 8 | */ 9 | #include "oct6100api/oct6100_api.h" 10 | 11 | int main(int argc, char **argv) 12 | { 13 | tPOCT6100_INSTANCE_API pApiInstance; 14 | UINT32 ulResult; 15 | tOCT6100_CHANNEL_MODIFY modify; 16 | tOCT6100_INTERRUPT_FLAGS InterruptFlags; 17 | tOCT6100_TONE_EVENT tonefound; 18 | tOCT6100_EVENT_GET_TONE tonesearch; 19 | tOCT6100_CHIP_OPEN ChipOpen; 20 | tOCT6100_GET_INSTANCE_SIZE InstanceSize; 21 | tOCT6100_CHANNEL_OPEN ChannelOpen; 22 | tOCT6100_TONE_DETECTION_ENABLE enable; 23 | tOCT6100_CHIP_CLOSE ChipClose; 24 | tOCT6100_API_GET_CAPACITY_PINS CapacityPins; 25 | 26 | Oct6100ChannelModifyDef(&modify); 27 | ulResult = Oct6100ChannelModify(pApiInstance, &modify); 28 | Oct6100InterruptServiceRoutineDef(&InterruptFlags); 29 | Oct6100InterruptServiceRoutine(pApiInstance, &InterruptFlags); 30 | Oct6100EventGetToneDef(&tonesearch); 31 | ulResult = Oct6100EventGetTone(pApiInstance, &tonesearch); 32 | Oct6100ChipOpenDef(&ChipOpen); 33 | Oct6100GetInstanceSizeDef(&InstanceSize); 34 | ulResult = Oct6100GetInstanceSize(&ChipOpen, &InstanceSize); 35 | ulResult = Oct6100ChipOpen(pApiInstance, &ChipOpen); 36 | Oct6100ChannelOpenDef(&ChannelOpen); 37 | ulResult = Oct6100ChannelOpen(pApiInstance, &ChannelOpen); 38 | Oct6100ToneDetectionEnableDef(&enable); 39 | Oct6100ToneDetectionEnable(pApiInstance, &enable); 40 | Oct6100ChipCloseDef(&ChipClose); 41 | ulResult = Oct6100ChipClose(pApiInstance, &ChipClose); 42 | Oct6100ApiGetCapacityPinsDef(&CapacityPins); 43 | ulResult = Oct6100ApiGetCapacityPins(&CapacityPins); 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /drivers/dahdi/opvxa1200/Kbuild: -------------------------------------------------------------------------------- 1 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OPVXA1200) += opvxa1200.o 2 | 3 | EXTRA_CFLAGS += -I$(src)/.. -Wno-undef 4 | 5 | opvxa1200-objs := base.o 6 | 7 | DAHDI_KERNEL_H_NAME:=kernel.h 8 | DAHDI_KERNEL_H_PATH:=$(DAHDI_INCLUDE)/dahdi/$(DAHDI_KERNEL_H_NAME) 9 | ifneq ($(DAHDI_KERNEL_H_PATH),) 10 | DAHDI_SPAN_MODULE:=$(shell if grep -C 5 "struct dahdi_span {" $(DAHDI_KERNEL_H_PATH) | grep -q "struct module \*owner"; then echo "yes"; else echo "no"; fi) 11 | DAHDI_SPAN_OPS:=$(shell if grep -q "struct dahdi_span_ops {" $(DAHDI_KERNEL_H_PATH); then echo "yes"; else echo "no"; fi) 12 | ifeq ($(DAHDI_SPAN_MODULE),yes) 13 | EXTRA_CFLAGS+=-DDAHDI_SPAN_MODULE 14 | else 15 | ifeq ($(DAHDI_SPAN_OPS),yes) 16 | EXTRA_CFLAGS+=-DDAHDI_SPAN_OPS 17 | endif 18 | endif 19 | endif 20 | -------------------------------------------------------------------------------- /drivers/dahdi/opvxa1200/Makefile: -------------------------------------------------------------------------------- 1 | ifdef KBUILD_EXTMOD 2 | # We only get here on kernels 2.6.0-2.6.9 . 3 | # For newer kernels, Kbuild will be included directly by the kernel 4 | # build system. 5 | include $(src)/Kbuild 6 | 7 | else 8 | endif 9 | -------------------------------------------------------------------------------- /drivers/dahdi/voicebus/GpakHpi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Adaptive Digital Technologies, Inc. 3 | * 4 | * File Name: GpakHpi.h 5 | * 6 | * Description: 7 | * This file contains common definitions related to the G.PAK interface 8 | * between a host processor and a DSP processor via the Host Port Interface. 9 | * 10 | * Version: 1.0 11 | * 12 | * Revision History: 13 | * 10/17/01 - Initial release. 14 | * 15 | * This program has been released under the terms of the GPL version 2 by 16 | * permission of Adaptive Digital Technologies, Inc. 17 | * 18 | */ 19 | 20 | /* 21 | * See http://www.asterisk.org for more information about 22 | * the Asterisk project. Please do not directly contact 23 | * any of the maintainers of this project for assistance; 24 | * the project provides a web site, mailing lists and IRC 25 | * channels for your use. 26 | * 27 | * This program is free software, distributed under the terms of 28 | * the GNU General Public License Version 2 as published by the 29 | * Free Software Foundation. See the LICENSE file included with 30 | * this program for more details. 31 | */ 32 | 33 | #ifndef _GPAKHPI_H /* prevent multiple inclusion */ 34 | #define _GPAKHPI_H 35 | 36 | 37 | /* Definition of G.PAK Command/Reply message type codes. */ 38 | #define MSG_NULL_REPLY 0 /* Null Reply (unsupported Command) */ 39 | #define MSG_SYS_CONFIG_RQST 1 /* System Configuration Request */ 40 | #define MSG_SYS_CONFIG_REPLY 2 /* System Configuration Reply */ 41 | #define MSG_READ_SYS_PARMS 3 /* Read System Parameters */ 42 | #define MSG_READ_SYS_PARMS_REPLY 4 /* Read System Parameters Reply */ 43 | #define MSG_WRITE_SYS_PARMS 5 /* Write System Parameters */ 44 | #define MSG_WRITE_SYS_PARMS_REPLY 6 /* Write System Parameters Reply */ 45 | #define MSG_CONFIGURE_PORTS 7 /* Configure Serial Ports */ 46 | #define MSG_CONFIG_PORTS_REPLY 8 /* Configure Serial Ports Reply */ 47 | #define MSG_CONFIGURE_CHANNEL 9 /* Configure Channel */ 48 | #define MSG_CONFIG_CHAN_REPLY 10 /* Configure Channel Reply */ 49 | #define MSG_TEAR_DOWN_CHANNEL 11 /* Tear Down Channel */ 50 | #define MSG_TEAR_DOWN_REPLY 12 /* Tear Down Channel Reply */ 51 | #define MSG_CHAN_STATUS_RQST 13 /* Channel Status Request */ 52 | #define MSG_CHAN_STATUS_REPLY 14 /* Channel Status Reply */ 53 | 54 | #define MSG_TEST_MODE 17 /* Configure/Perform Test Mode */ 55 | #define MSG_TEST_REPLY 18 /* Configure/Perform Test Mode Reply */ 56 | 57 | #define MSG_ALG_CONTROL 27 /* algorithm control */ 58 | #define MSG_ALG_CONTROL_REPLY 28 /* algorithm control reply */ 59 | #define MSG_GET_TXCID_ADDRESS 29 /* get tx cid buffer start address */ 60 | #define MSG_GET_TXCID_ADDRESS_REPLY 30 /* get tx cid buffer start addr reply */ 61 | 62 | #define MSG_PING 35 /* ping command */ 63 | #define MSG_PING_REPLY 36 /* ping command reply */ 64 | #define MSG_SERIAL_TXVAL 37 /* transmit serial fixed value */ 65 | #define MSG_SERIAL_TXVAL_REPLY 38 /* transmit serial fixed value reply */ 66 | #define MSG_TDM_LOOPBACK 39 /* tdm loopback control */ 67 | #define MSG_TDM_LOOPBACK_REPLY 40 /* tdm loopback control reply */ 68 | #define MSG_RESET_USAGE_STATS 41 /* reset cpu usage stats */ 69 | #define MSG_RESET_USAGE_STATS_REPLY 42 /* reset cpu usage stats reply */ 70 | 71 | #define MSG_RESET_FRAME_STATS 47 /* reset framing stats */ 72 | #define MSG_RESET_FRAME_STATS_REPLY 48 /* reset framing stats reply */ 73 | 74 | #define MSG_READ_DSP_MEMORY 49 /* read small section of DSP's memory */ 75 | #define MSG_READ_DSP_MEMORY_REPLY 50 /* read memory reply */ 76 | 77 | #define MSG_ACCESSGPIO 51 78 | #define MSG_ACCESSGPIO_REPLY 52 79 | #endif /* prevent multiple inclusion */ 80 | -------------------------------------------------------------------------------- /drivers/dahdi/voicebus/Kbuild: -------------------------------------------------------------------------------- 1 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_VOICEBUS) += dahdi_voicebus.o 2 | 3 | dahdi_voicebus-objs := voicebus.o GpakCust.o GpakApi.o voicebus_net.o vpmoct.o 4 | 5 | FIRM_DIR := ../firmware 6 | 7 | ifneq ($(HOTPLUG_FIRMWARE),yes) 8 | dahdi_voicebus-objs += $(FIRM_DIR)/dahdi-fw-vpmoct032.o 9 | $(warning WARNING: You are compiling firmware into voicebus.ko which is not available under the terms of the GPL. It may be a violation of the GPL to distribute the resulting image since it combines both GPL and non-GPL work. You should consult a lawyer of your own before distributing such an image.) 10 | else 11 | EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE 12 | endif 13 | 14 | EXTRA_CFLAGS += -I$(src)/.. -Wno-undef 15 | 16 | $(obj)/$(FIRM_DIR)/dahdi-fw-vpmoct032.o: $(obj)/voicebus.o 17 | $(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-vpmoct032.o 18 | 19 | -------------------------------------------------------------------------------- /drivers/dahdi/voicebus/voicebus_net.h: -------------------------------------------------------------------------------- 1 | #ifdef VOICEBUS_NET_DEBUG 2 | int vb_net_register(struct voicebus *, const char *); 3 | void vb_net_unregister(struct voicebus *); 4 | void vb_net_capture_vbb(struct voicebus *, const void *, 5 | const int, const u32, const u16); 6 | #else 7 | #define vb_net_register(a, b) do { ; } while (0) 8 | #define vb_net_unregister(a) do { ; } while (0) 9 | #define vb_net_capture_vbb(a, b, c, d, e) do { ; } while (0) 10 | #endif 11 | -------------------------------------------------------------------------------- /drivers/dahdi/voicebus/vpmadtreg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * vpmadtreg.c - Registration utility for firmware loaders. 3 | * 4 | * Allows drivers for boards that host VPMAD032 modules to initiate firmware 5 | * loads. 6 | * 7 | * Written by Digium Incorporated 8 | * 9 | * Copyright (C) 2008-2009 Digium, Inc. All rights reserved. 10 | * 11 | * See http://www.asterisk.org for more information about the Asterisk 12 | * project. Please do not directly contact any of the maintainers of this 13 | * project for assistance; the project provides a web site, mailing lists and 14 | * IRC channels for your use. 15 | * 16 | * This program is free software, distributed under the terms of the GNU 17 | * General Public License Version 2 as published by the Free Software 18 | * Foundation. See the LICENSE file included with this program for more 19 | * details. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "voicebus.h" 27 | #include "GpakCust.h" 28 | #include "vpmadtreg.h" 29 | 30 | -------------------------------------------------------------------------------- /drivers/dahdi/voicebus/vpmadtreg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vpmadtreg.h - Registration utility for firmware loaders. 3 | * 4 | * Allows drivers for boards that host VPMAD032 modules to initiate firmware 5 | * loads. 6 | * 7 | * Written by Digium Incorporated 8 | * 9 | * Copyright (C) 2008-2010 Digium, Inc. All rights reserved. 10 | * 11 | * See http://www.asterisk.org for more information about the Asterisk 12 | * project. Please do not directly contact any of the maintainers of this 13 | * project for assistance; the project provides a web site, mailing lists and 14 | * IRC channels for your use. 15 | * 16 | * This program is free software, distributed under the terms of the GNU 17 | * General Public License Version 2 as published by the Free Software 18 | * Foundation. See the LICENSE file included with this program for more 19 | * details. 20 | */ 21 | #ifndef __VPMADTREG_H__ 22 | #define __VPMADTREG_H__ 23 | 24 | struct vpmadt_loader { 25 | struct module *owner; 26 | struct list_head node; 27 | int (*load)(struct voicebus *); 28 | }; 29 | 30 | int vpmadtreg_register(struct vpmadt_loader *loader); 31 | int vpmadtreg_unregister(struct vpmadt_loader *loader); 32 | int vpmadtreg_loadfirmware(struct voicebus *vb); 33 | #endif 34 | -------------------------------------------------------------------------------- /drivers/dahdi/voicebus/vpmoct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VPMOCT Driver. 3 | * 4 | * Written by Russ Meyerriecks 5 | * 6 | * Copyright (C) 2010-2011 Digium, Inc. 7 | * 8 | * All rights reserved. 9 | * 10 | */ 11 | 12 | /* 13 | * See http://www.asterisk.org for more information about 14 | * the Asterisk project. Please do not directly contact 15 | * any of the maintainers of this project for assistance; 16 | * the project provides a web site, mailing lists and IRC 17 | * channels for your use. 18 | * 19 | * This program is free software, distributed under the terms of 20 | * the GNU General Public License Version 2 as published by the 21 | * Free Software Foundation. See the LICENSE file included with 22 | * this program for more details. 23 | */ 24 | 25 | #ifndef _VPMOCT_H 26 | #define _VPMOCT_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include "dahdi/kernel.h" 32 | 33 | /* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */ 34 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) 35 | #include 36 | #elif defined RHEL_RELEASE_VERSION 37 | #if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \ 38 | RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1) 39 | #include 40 | #endif 41 | #else 42 | #include 43 | #endif 44 | 45 | #define VPMOCT_FIRM_HEADER_LEN 32 46 | #define VPMOCT_BOOT_RAM_LEN 128 47 | #define VPMOCT_FLASH_BUF_SECTIONS 4 48 | #define VPMOCT_MAX_CHUNK 7 49 | 50 | /* Bootloader commands */ 51 | #define VPMOCT_BOOT_FLASH_ERASE 0x01 52 | #define VPMOCT_BOOT_FLASH_COPY 0x02 53 | #define VPMOCT_BOOT_IMAGE_VALIDATE 0x06 54 | #define VPMOCT_BOOT_REBOOT 0x07 55 | #define VPMOCT_BOOT_DECRYPT 0x08 56 | #define VPMOCT_BOOT_FLASHLOAD 0x10 57 | 58 | /* Dual use registers */ 59 | #define VPMOCT_IDENT 0x00 60 | #define VPMOCT_MAJOR 0x0a 61 | #define VPMOCT_MINOR 0x0b 62 | #define VPMOCT_SERIAL 0x90 63 | #define VPMOCT_SERIAL_SIZE 32 64 | 65 | /* Bootloader registers */ 66 | #define VPMOCT_BOOT_ERROR 0x0c 67 | #define VPMOCT_BOOT_STATUS 0x10 68 | #define VPMOCT_BOOT_CMD 0x11 69 | #define VPMOCT_BOOT_LEN 0x14 70 | #define VPMOCT_BOOT_ADDRESS1 0x18 71 | #define VPMOCT_BOOT_ADDRESS2 0x1c 72 | #define VPMOCT_BOOT_RAM 0x20 73 | 74 | enum vpmoct_mode { UNKNOWN = 0, APPLICATION, BOOTLOADER }; 75 | 76 | struct vpmoct { 77 | struct list_head pending_list; 78 | struct list_head active_list; 79 | spinlock_t list_lock; 80 | struct mutex mutex; 81 | enum vpmoct_mode mode; 82 | struct device *dev; 83 | u32 companding; 84 | u32 echo; 85 | unsigned int preecho_enabled:1; 86 | unsigned int echo_update_active:1; 87 | unsigned int companding_update_active:1; 88 | u8 preecho_timeslot; 89 | u8 preecho_buf[8]; 90 | u8 major; 91 | u8 minor; 92 | }; 93 | 94 | struct vpmoct_cmd { 95 | struct list_head node; 96 | u8 address; 97 | u8 data[VPMOCT_MAX_CHUNK]; 98 | u8 command; 99 | u8 chunksize; 100 | u8 txident; 101 | struct completion complete; 102 | }; 103 | 104 | static inline bool is_vpmoct_cmd_read(const struct vpmoct_cmd *cmd) 105 | { 106 | return (0x60 == (cmd->command & 0xf0)); 107 | } 108 | 109 | struct vpmoct *vpmoct_alloc(void); 110 | void vpmoct_free(struct vpmoct *vpm); 111 | typedef void (*load_complete_func_t)(struct device *dev, bool operational); 112 | int vpmoct_init(struct vpmoct *vpm, load_complete_func_t load_complete); 113 | int vpmoct_echocan_create(struct vpmoct *vpm, 114 | int channo, 115 | int companding); 116 | void vpmoct_echocan_free(struct vpmoct *vpm, 117 | int channo); 118 | int vpmoct_preecho_enable(struct vpmoct *vpm, int channo); 119 | int vpmoct_preecho_disable(struct vpmoct *vpm, int channo); 120 | #endif 121 | -------------------------------------------------------------------------------- /drivers/dahdi/wcb4xxp/Kbuild: -------------------------------------------------------------------------------- 1 | obj-m += wcb4xxp.o 2 | 3 | EXTRA_CFLAGS += -I$(src)/.. -Wno-undef 4 | 5 | wcb4xxp-objs := base.o 6 | 7 | $(obj)/base.o: $(src)/wcb4xxp.h 8 | -------------------------------------------------------------------------------- /drivers/dahdi/wct4xxp/Kbuild: -------------------------------------------------------------------------------- 1 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT4XXP) += wct4xxp.o 2 | 3 | FIRM_DIR := ../firmware 4 | 5 | EXTRA_CFLAGS += -I$(src)/.. -I$(src)/../oct612x/ $(shell $(src)/../oct612x/octasic-helper cflags $(src)/../oct612x) -Wno-undef 6 | 7 | # The OCT612X source files are from a vendor drop and we do not want to edit 8 | # them to make this warning go away. Therefore, turn off the 9 | # unused-but-set-variable warning for this driver. 10 | 11 | EXTRA_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable) 12 | 13 | ifeq ($(HOTPLUG_FIRMWARE),yes) 14 | EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE 15 | endif 16 | 17 | wct4xxp-objs := base.o vpm450m.o 18 | 19 | ifneq ($(HOTPLUG_FIRMWARE),yes) 20 | wct4xxp-objs += $(FIRM_DIR)/dahdi-fw-oct6114-064.o $(FIRM_DIR)/dahdi-fw-oct6114-128.o $(FIRM_DIR)/dahdi-fw-oct6114-256.o 21 | $(warning WARNING: You are compiling firmware into wct4xxp.ko which is not available under the terms of the GPL. It may be a violation of the GPL to distribute the resulting image since it combines both GPL and non-GPL work. You should consult a lawyer of your own before distributing such an image.) 22 | endif 23 | 24 | $(obj)/$(FIRM_DIR)/dahdi-fw-oct6114-064.o: $(obj)/base.o 25 | $(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-oct6114-064.o 26 | 27 | $(obj)/$(FIRM_DIR)/dahdi-fw-oct6114-128.o: $(obj)/base.o 28 | $(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-oct6114-128.o 29 | 30 | $(obj)/$(FIRM_DIR)/dahdi-fw-oct6114-256.o: $(obj)/base.o 31 | $(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-oct6114-256.o 32 | -------------------------------------------------------------------------------- /drivers/dahdi/wct4xxp/vpm450m.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2006 Digium, Inc. 3 | * 4 | * Mark Spencer 5 | * 6 | * All Rights Reserved 7 | * 8 | */ 9 | 10 | /* 11 | * See http://www.asterisk.org for more information about 12 | * the Asterisk project. Please do not directly contact 13 | * any of the maintainers of this project for assistance; 14 | * the project provides a web site, mailing lists and IRC 15 | * channels for your use. 16 | * 17 | * This program is free software, distributed under the terms of 18 | * the GNU General Public License Version 2 as published by the 19 | * Free Software Foundation. See the LICENSE file included with 20 | * this program for more details. 21 | */ 22 | 23 | #ifndef _VPM450M_H 24 | #define _VPM450M_H 25 | 26 | #include 27 | 28 | struct t4; 29 | struct vpm450m; 30 | 31 | /* From driver */ 32 | unsigned int oct_get_reg(void *data, unsigned int reg); 33 | void oct_set_reg(void *data, unsigned int reg, unsigned int val); 34 | 35 | /* From vpm450m */ 36 | struct vpm450m *init_vpm450m(struct device *device, int *isalaw, 37 | int numspans, const struct firmware *firmware); 38 | unsigned int get_vpm450m_capacity(struct device *device); 39 | void vpm450m_setec(struct vpm450m *instance, int channel, int eclen); 40 | void vpm450m_setdtmf(struct vpm450m *instance, int channel, int dtmfdetect, int dtmfmute); 41 | int vpm450m_checkirq(struct vpm450m *vpm450m); 42 | int vpm450m_getdtmf(struct vpm450m *vpm450m, int *channel, int *tone, int *start); 43 | void release_vpm450m(struct vpm450m *instance); 44 | void vpm450m_set_alaw_companding(struct vpm450m *vpm450m, 45 | int channel, bool alaw); 46 | 47 | extern int debug; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /drivers/dahdi/wctc4xxp/Kbuild: -------------------------------------------------------------------------------- 1 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTC4XXP) += wctc4xxp.o 2 | 3 | FIRM_DIR := ../firmware 4 | 5 | EXTRA_CFLAGS += -I$(src)/.. -Wno-undef 6 | 7 | ifeq ($(HOTPLUG_FIRMWARE),yes) 8 | EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE 9 | endif 10 | 11 | wctc4xxp-objs := base.o 12 | 13 | ifneq ($(HOTPLUG_FIRMWARE),yes) 14 | wctc4xxp-objs += $(FIRM_DIR)/dahdi-fw-tc400m.o 15 | endif 16 | 17 | $(obj)/$(FIRM_DIR)/dahdi-fw-tc400m.o: $(obj)/base.o 18 | $(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-tc400m.o 19 | -------------------------------------------------------------------------------- /drivers/dahdi/wctdm24xxp/Kbuild: -------------------------------------------------------------------------------- 1 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP) += wctdm24xxp.o 2 | 3 | EXTRA_CFLAGS += -I$(src)/.. -Wno-undef 4 | 5 | wctdm24xxp-objs := base.o xhfc.o 6 | -------------------------------------------------------------------------------- /drivers/dahdi/wctdm24xxp/xhfc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * B400M Quad-BRI module Driver 3 | * Written by Andrew Kohlsmith 4 | * 5 | * Copyright (C) 2010 Digium, Inc. 6 | * All rights reserved. 7 | * 8 | */ 9 | 10 | /* 11 | * See http://www.asterisk.org for more information about 12 | * the Asterisk project. Please do not directly contact 13 | * any of the maintainers of this project for assistance; 14 | * the project provides a web site, mailing lists and IRC 15 | * channels for your use. 16 | * 17 | * This program is free software, distributed under the terms of 18 | * the GNU General Public License Version 2 as published by the 19 | * Free Software Foundation. See the LICENSE file included with 20 | * this program for more details. 21 | */ 22 | 23 | 24 | #ifndef _B4XXM_H_ 25 | #define _B4XXM_H_ 26 | 27 | extern int bri_debug; 28 | extern int bri_spanfilter; 29 | extern int bri_teignorered; 30 | extern int bri_alarmdebounce; 31 | extern int bri_persistentlayer1; 32 | extern int timingcable; 33 | 34 | struct b400m; 35 | 36 | /* probes the given card to see if it's a B400M */ 37 | int wctdm_init_b400m(struct wctdm *wc, int card); 38 | void wctdm_bri_checkisr(struct wctdm *wc, 39 | struct wctdm_module *const mod, int offset); 40 | void wctdm_unload_b400m(struct wctdm *wc, int card); 41 | void wctdm_hdlc_hard_xmit(struct dahdi_chan *chan); 42 | int b400m_spanconfig(struct file *file, struct dahdi_span *span, 43 | struct dahdi_lineconfig *lc); 44 | int b400m_dchan(struct dahdi_span *span); 45 | int b400m_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype); 46 | void b400m_post_init(struct b400m *b4); 47 | void b400m_set_dahdi_span(struct b400m *b4, int spanno, 48 | struct wctdm_span *wspan); 49 | void b400m_module_init(void); 50 | void b400m_module_cleanup(void); 51 | 52 | #endif /* _B4XX_H_ */ 53 | -------------------------------------------------------------------------------- /drivers/dahdi/wcte12xp/Kbuild: -------------------------------------------------------------------------------- 1 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE12XP) += wcte12xp.o 2 | 3 | EXTRA_CFLAGS += -I$(src)/.. -Wno-undef 4 | 5 | wcte12xp-objs := base.o 6 | -------------------------------------------------------------------------------- /drivers/dahdi/wcxb_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wcxb SPI library 3 | * 4 | * Copyright (C) 2013 Digium, Inc. 5 | * 6 | * All rights reserved. 7 | * 8 | */ 9 | 10 | /* 11 | * See http://www.asterisk.org for more information about 12 | * the Asterisk project. Please do not directly contact 13 | * any of the maintainers of this project for assistance; 14 | * the project provides a web site, mailing lists and IRC 15 | * channels for your use. 16 | * 17 | * This program is free software, distributed under the terms of 18 | * the GNU General Public License Version 2 as published by the 19 | * Free Software Foundation. See the LICENSE file included with 20 | * this program for more details. 21 | */ 22 | 23 | #ifndef __WCXB_FLASH_H__ 24 | #define __WCXB_FLASH_H__ 25 | 26 | extern int wcxb_flash_read(struct wcxb_spi_device *spi, unsigned int address, 27 | void *data, size_t len); 28 | 29 | extern int wcxb_flash_sector_erase(struct wcxb_spi_device *spi, unsigned int 30 | address); 31 | extern int wcxb_flash_write(struct wcxb_spi_device *spi, unsigned int address, 32 | const void *data, size_t len); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/Changelog_xpp: -------------------------------------------------------------------------------- 1 | Sun Mar 1 2009 Oron Peled - xpp.r6795 2 | * Fix cases where the command_queue overflowed during initialization. 3 | - Also add a 'command_queue_length' parameter to xpp.ko 4 | * More migrations to sysfs: 5 | - Add a 'transport' attribute to our astribank devices which 6 | points to the usb device we use. E.g: 7 | /sys/bus/astribanks/devices/xbus-00/transport is symlinked to 8 | ../../../../../../devices/pci0000:00/0000:00:10.4/usb5/5-4 9 | - Move /proc/xpp/XBUS-??/XPD-??/span to 10 | /sys/bus/xpds/devices/??:?:?/span 11 | - Migrate from /proc/xpp/sync to: 12 | /sys/bus/astribanks/drivers/xppdrv/sync 13 | - New 'offhook' attribute in: 14 | /sys/bus/xpds/devices/??:?:?/offhook 15 | * PRI: change the "timing" priority to match the convention used by 16 | other PRI cards -- I.e: lower numbers (not 0) have higher 17 | priority. 18 | * FXO: 19 | - Power denial: create two module parameters instead of hard-coded 20 | constants (power_denial_safezone, power_denial_minlen). 21 | For sites that get non-standard power-denial signals from central 22 | office on offhook. 23 | - Don't hangup on power-denial, just notify Dahdi and wait for 24 | - Fix caller-id detection for the case central office sends it before 25 | first ring without any indication before. 26 | Asterisk's desicion. 27 | * USB_FW.hex: 28 | - Fixes cases where firmware loading would fail. 29 | 30 | Thu, Aug 14 2008 Oron Peled - xpp.r6056 31 | * First DAHDI-linux release. 32 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/Kbuild: -------------------------------------------------------------------------------- 1 | EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \ 2 | -DDEBUG \ 3 | -DPOLL_DIGITAL_INPUTS \ 4 | -DDEBUG_PCMTX \ 5 | -DPROTOCOL_DEBUG \ 6 | -g 7 | # 8 | 9 | WITH_BRISTUFF := $(shell grep -c '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_DAHDI_BRI_DCHANS\>' $(src)/../../../include/dahdi/dahdi_config.h) 10 | 11 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPP) += xpp.o 12 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXS) += xpd_fxs.o 13 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXO) += xpd_fxo.o 14 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_PRI) += xpd_pri.o 15 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_BRI) += xpd_bri.o 16 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_ECHO) += xpd_echo.o 17 | 18 | # Build only supported modules 19 | ifneq (,$(filter y m,$(CONFIG_USB))) 20 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_XPP_USB) += xpp_usb.o 21 | endif 22 | ifneq (,$(filter y m,$(CONFIG_BF537))) 23 | obj-$(DAHDI_BUILD_ALL)$(CONFIG_XPP_MMAP) += xpp_mmap.o 24 | endif 25 | 26 | xpp-objs += xbus-core.o xbus-sysfs.o xbus-pcm.o xframe_queue.o xpp_dahdi.o xproto.o card_global.o dahdi_debug.o 27 | xpd_fxs-objs += card_fxs.o 28 | xpd_fxo-objs += card_fxo.o 29 | xpd_bri-objs += card_bri.o 30 | xpd_pri-objs += card_pri.o 31 | xpd_echo-objs += card_echo.o 32 | xpp_mmap-objs += mmapbus.o mmapdrv.o 33 | 34 | ifeq (y,$(PARPORT_DEBUG)) 35 | EXTRA_CFLAGS += -DDEBUG_SYNC_PARPORT 36 | obj-m += parport_debug.o 37 | endif 38 | 39 | # Just in case it was left from an older version: 40 | clean-files += xpp_version.h 41 | 42 | # Validations: 43 | # - Syntactic verification of perl scripts 44 | # - Handle country table validation for init_card_2_* 45 | 46 | XPP_PROTOCOL_VERSION := $(shell grep XPP_PROTOCOL_VERSION $(src)/xproto.h | sed -e 's/^.*XPP_PROTOCOL_VERSION[ \t]*//') 47 | 48 | xpp_verifications = \ 49 | init_card_1_$(XPP_PROTOCOL_VERSION) \ 50 | init_card_2_$(XPP_PROTOCOL_VERSION) \ 51 | init_card_3_$(XPP_PROTOCOL_VERSION) \ 52 | init_card_4_$(XPP_PROTOCOL_VERSION) \ 53 | init_fxo_modes 54 | 55 | xpp_verified = $(foreach file, $(xpp_verifications), $(file).verified) 56 | 57 | FXO_MODES = $(src)/../fxo_modes.h 58 | FXO_VERIFY = $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION) -v $(obj)/init_fxo_modes 59 | 60 | hostprogs := print_fxo_modes 61 | always-y := $(xpp_verified) 62 | print_fxo_modes-objs := print_fxo_modes.o 63 | HOSTCFLAGS_print_fxo_modes.o += -include $(FXO_MODES) 64 | 65 | clean-files += print_fxo_modes init_fxo_modes $(xpp_verified) 66 | 67 | $(obj)/init_fxo_modes: $(obj)/print_fxo_modes 68 | @echo ' GEN $@' 69 | $(Q)$(obj)/print_fxo_modes >$@ || (rm -f $@; exit 1) 70 | 71 | $(obj)/init_fxo_modes.verified: $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION) $(obj)/init_fxo_modes 72 | @echo ' CHECK $(obj)/init_card_2_$(XPP_PROTOCOL_VERSION)' 73 | $(Q)$(FXO_VERIFY) || (rm -f $@; exit 1) 74 | $(Q)touch $@ 75 | 76 | $(obj)/init_card_%_$(XPP_PROTOCOL_VERSION).verified: $(src)/init_card_%_$(XPP_PROTOCOL_VERSION) 77 | @echo ' VERIFY $<' 78 | $(Q)perl -c $< 2> $@ || (cat $@; rm -f $@; exit 1) 79 | 80 | .PHONY: FORCE 81 | FORCE: 82 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/Kconfig: -------------------------------------------------------------------------------- 1 | # 2 | # XPP configuration 3 | # 4 | 5 | menuconfig DAHDI_XPP 6 | tristate "Xorcom Astribank Support" 7 | depends on DAHDI 8 | default DAHDI 9 | ---help--- 10 | Infrastructure support for Xorcom Astribank products. 11 | 12 | To compile this driver as a module, choose M here: the 13 | module will be called xpp. 14 | 15 | If unsure, say Y. 16 | 17 | config DAHDI_XPP_USB 18 | tristate "Astribank USB transport" 19 | depends on DAHDI_XPP && USB 20 | default DAHDI_XPP 21 | ---help--- 22 | To compile this driver as a module, choose M here: the 23 | module will be called xpp_usb. 24 | 25 | If unsure, say Y. 26 | 27 | config DAHDI_XPP_MMAP 28 | tristate "Astribank Blackfin transport" 29 | depends on DAHDI_XPP && BF537 30 | default DAHDI_XPP 31 | ---help--- 32 | To compile this driver as a module, choose M here: the 33 | module will be called xpp_mmap. 34 | 35 | This module can be compiled only on Blackfin architecture 36 | (with uClinux). 37 | 38 | If unsure, say N. 39 | 40 | config DAHDI_XPD_FXS 41 | tristate "FXS port Support" 42 | depends on DAHDI_XPP && (DAHDI_XPP_USB || DAHDI_XPP_MMAP) 43 | default DAHDI_XPP 44 | ---help--- 45 | To compile this driver as a module, choose M here: the 46 | module will be called xpd_fxs. 47 | 48 | If unsure, say Y. 49 | 50 | config DAHDI_XPD_FXO 51 | tristate "FXO port Support" 52 | depends on DAHDI_XPP && (DAHDI_XPP_USB || DAHDI_XPP_MMAP) 53 | default DAHDI_XPP 54 | ---help--- 55 | To compile this driver as a module, choose M here: the 56 | module will be called xpd_fxo. 57 | 58 | If unsure, say Y. 59 | 60 | config DAHDI_XPD_BRI 61 | tristate "BRI port Support" 62 | depends on DAHDI_XPP && (DAHDI_XPP_USB || DAHDI_XPP_MMAP) 63 | default DAHDI_XPP 64 | ---help--- 65 | To compile this driver as a module, choose M here: the 66 | module will be called xpd_pri. 67 | 68 | Note: this driver will be automatically excluded 69 | from compilation if dahdi driver does not 70 | contain the "bristuff" patch. 71 | 72 | If unsure, say Y. 73 | 74 | config DAHDI_XPD_PRI 75 | tristate "PRI port Support" 76 | depends on DAHDI_XPP && (DAHDI_XPP_USB || DAHDI_XPP_MMAP) 77 | default DAHDI_XPP 78 | ---help--- 79 | To compile this driver as a module, choose M here: the 80 | module will be called xpd_pri. 81 | 82 | If unsure, say Y. 83 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/Makefile: -------------------------------------------------------------------------------- 1 | # We only get here on kernels 2.6.0-2.6.9 . 2 | # For newer kernels, Kbuild will be included directly by the kernel 3 | # build system. 4 | -include $(src)/Kbuild 5 | 6 | ctags: 7 | ctags *.[ch] 8 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/XppConfig.pm: -------------------------------------------------------------------------------- 1 | package XppConfig; 2 | # 3 | # Written by Oron Peled 4 | # Copyright (C) 2008, Xorcom 5 | # This program is free software; you can redistribute and/or 6 | # modify it under the same terms as Perl itself. 7 | # 8 | # $Id$ 9 | # 10 | use strict; 11 | 12 | my $conf_file = "/etc/dahdi/xpp.conf"; 13 | 14 | sub import { 15 | my $pack = shift || die "Import without package?"; 16 | my $init_dir = shift || die "$pack::import -- missing init_dir parameter"; 17 | my $local_conf = "$init_dir/xpp.conf"; 18 | $conf_file = $local_conf if -r $local_conf; 19 | } 20 | 21 | sub read_config($) { 22 | my $opts = shift || die; 23 | 24 | open(F, $conf_file) || return (); 25 | while() { 26 | chomp; 27 | s/#.*//; # strip comments 28 | next unless /\S/; 29 | s/\s*$//; # Trim trailing whitespace 30 | my ($key, $value) = split(/\s+/, $_, 2); 31 | $opts->{$key} = $value; 32 | } 33 | close F; 34 | $opts->{'xppconf'} = $conf_file; 35 | return %{$opts}; 36 | } 37 | 38 | 1; 39 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/card_bri.h: -------------------------------------------------------------------------------- 1 | #ifndef CARD_BRI_H 2 | #define CARD_BRI_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2004-2006, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #include "xpd.h" 26 | 27 | enum bri_opcodes { 28 | XPROTO_NAME(BRI, SET_LED) = 0x33, 29 | }; 30 | 31 | #endif /* CARD_BRI_H */ 32 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/card_echo.h: -------------------------------------------------------------------------------- 1 | #ifndef CARD_ECHO_H 2 | #define CARD_ECHO_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2011, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | #include "xpd.h" 25 | 26 | enum echo_opcodes { 27 | XPROTO_NAME(ECHO, SET) = 0x39, 28 | XPROTO_NAME(ECHO, SET_REPLY) = 0x3A, 29 | }; 30 | 31 | #endif /* CARD_ECHO_H */ 32 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/card_fxo.h: -------------------------------------------------------------------------------- 1 | #ifndef CARD_FXO_H 2 | #define CARD_FXO_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2004-2006, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #include "xpd.h" 26 | 27 | enum fxo_opcodes { 28 | XPROTO_NAME(FXO, SIG_CHANGED) = 0x06, /**/ 29 | XPROTO_NAME(FXO, DAA_WRITE) = 0x0F, /* Write to DAA */ 30 | XPROTO_NAME(FXO, CHAN_CID) = 0x0F, /* Write to DAA */ 31 | XPROTO_NAME(FXO, LED) = 0x0F, /* Write to DAA */ 32 | }; 33 | 34 | 35 | DEF_RPACKET_DATA(FXO, SIG_CHANGED, 36 | xpp_line_t sig_status; /* channels: lsb=1, msb=8 */ 37 | xpp_line_t sig_toggles; /* channels: lsb=1, msb=8 */ 38 | ); 39 | 40 | #endif /* CARD_FXO_H */ 41 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/card_fxs.h: -------------------------------------------------------------------------------- 1 | #ifndef CARD_FXS_H 2 | #define CARD_FXS_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2004-2006, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #include "xpd.h" 26 | 27 | enum fxs_opcodes { 28 | XPROTO_NAME(FXS, SIG_CHANGED) = 0x06, 29 | /**/ XPROTO_NAME(FXS, CHAN_POWER) = 0x0F, /* Write to SLIC */ 30 | XPROTO_NAME(FXS, CHAN_CID) = 0x0F, /* Write to SLIC */ 31 | XPROTO_NAME(FXS, LED) = 0x0F, /* Write to SLIC */ 32 | }; 33 | 34 | DEF_RPACKET_DATA(FXS, SIG_CHANGED, 35 | xpp_line_t sig_status; /* channels: lsb=1, msb=8 */ 36 | xpp_line_t sig_toggles; /* channels: lsb=1, msb=8 */ 37 | ); 38 | 39 | #endif /* CARD_FXS_H */ 40 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/card_global.h: -------------------------------------------------------------------------------- 1 | #ifndef CARD_GLOBAL_H 2 | #define CARD_GLOBAL_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2004-2006, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #include "xdefs.h" 26 | #include "xbus-pcm.h" 27 | 28 | enum global_opcodes { 29 | XPROTO_NAME(GLOBAL, AB_REQUEST) = 0x07, 30 | XPROTO_NAME(GLOBAL, AB_DESCRIPTION) = 0x08, 31 | XPROTO_NAME(GLOBAL, REGISTER_REQUEST) = 0x0F, 32 | XPROTO_NAME(GLOBAL, REGISTER_REPLY) = 0x10, 33 | /**/ XPROTO_NAME(GLOBAL, PCM_WRITE) = 0x11, 34 | XPROTO_NAME(GLOBAL, PCM_READ) = 0x12, 35 | /**/ XPROTO_NAME(GLOBAL, SYNC_SOURCE) = 0x19, 36 | XPROTO_NAME(GLOBAL, SYNC_REPLY) = 0x1A, 37 | /**/ XPROTO_NAME(GLOBAL, ERROR_CODE) = 0x22, 38 | XPROTO_NAME(GLOBAL, XBUS_RESET) = 0x23, 39 | XPROTO_NAME(GLOBAL, NULL_REPLY) = 0xFE, 40 | }; 41 | 42 | struct unit_descriptor { 43 | struct xpd_addr addr; 44 | __u8 subtype:4; 45 | __u8 type:4; 46 | __u8 numchips; 47 | __u8 ports_per_chip; 48 | __u8 port_dir; /* bitmask: 0 - PSTN, 1 - PHONE */ 49 | __u8 reserved[2]; 50 | struct xpd_addr ec_addr; 51 | }; 52 | 53 | #define NUM_UNITS 6 54 | 55 | DEF_RPACKET_DATA(GLOBAL, NULL_REPLY); 56 | DEF_RPACKET_DATA(GLOBAL, AB_REQUEST, __u8 rev; __u8 reserved;); 57 | DEF_RPACKET_DATA(GLOBAL, AB_DESCRIPTION, __u8 rev; __u8 reserved[3]; 58 | struct unit_descriptor unit_descriptor[NUM_UNITS];); 59 | DEF_RPACKET_DATA(GLOBAL, REGISTER_REQUEST, reg_cmd_t reg_cmd;); 60 | DEF_RPACKET_DATA(GLOBAL, PCM_WRITE, xpp_line_t lines; __u8 pcm[PCM_CHUNKSIZE];); 61 | DEF_RPACKET_DATA(GLOBAL, PCM_READ, xpp_line_t lines; __u8 pcm[PCM_CHUNKSIZE];); 62 | DEF_RPACKET_DATA(GLOBAL, SYNC_SOURCE, __u8 sync_mode; __u8 drift;); 63 | DEF_RPACKET_DATA(GLOBAL, SYNC_REPLY, __u8 sync_mode; __u8 drift;); 64 | DEF_RPACKET_DATA(GLOBAL, REGISTER_REPLY, reg_cmd_t regcmd;); 65 | DEF_RPACKET_DATA(GLOBAL, XBUS_RESET, __u8 mask;); 66 | DEF_RPACKET_DATA(GLOBAL, ERROR_CODE, __u8 category_code; __u8 errorbits; 67 | __u8 bad_packet[0];); 68 | 69 | /* 0x07 */ DECLARE_CMD(GLOBAL, AB_REQUEST); 70 | /* 0x19 */ DECLARE_CMD(GLOBAL, SYNC_SOURCE, enum sync_mode mode, int drift); 71 | /* 0x23 */ DECLARE_CMD(GLOBAL, RESET_SPI); 72 | /* 0x23 */ DECLARE_CMD(GLOBAL, RESET_SYNC_COUNTERS); 73 | 74 | int xpp_register_request(xbus_t *xbus, xpd_t *xpd, xportno_t portno, 75 | bool writing, __u8 regnum, bool do_subreg, __u8 subreg, 76 | __u8 data_low, bool do_datah, __u8 data_high, 77 | bool should_reply, bool do_expander); 78 | int send_multibyte_request(xbus_t *xbus, unsigned unit, xportno_t portno, 79 | bool eoftx, __u8 *buf, unsigned len); 80 | int xpp_ram_request(xbus_t *xbus, xpd_t *xpd, xportno_t portno, 81 | bool writing, 82 | __u8 addr_low, 83 | __u8 addr_high, 84 | __u8 data_0, 85 | __u8 data_1, 86 | __u8 data_2, 87 | __u8 data_3, 88 | bool should_reply); 89 | extern xproto_table_t PROTO_TABLE(GLOBAL); 90 | int run_initialize_registers(xpd_t *xpd); 91 | int parse_chip_command(xpd_t *xpd, char *cmdline); 92 | extern charp initdir; 93 | 94 | #endif /* CARD_GLOBAL_H */ 95 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/card_pri.h: -------------------------------------------------------------------------------- 1 | #ifndef CARD_PRI_H 2 | #define CARD_PRI_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2004-2006, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #include "xpd.h" 26 | 27 | enum pri_opcodes { 28 | XPROTO_NAME(PRI, SET_LED) = 0x33, 29 | }; 30 | 31 | #endif /* CARD_PRI_H */ 32 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/dahdi_debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by Oron Peled 3 | * Copyright (C) 2004-2006, Xorcom 4 | * 5 | * All rights reserved. 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | */ 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "dahdi_debug.h" 28 | #include "xdefs.h" 29 | 30 | static const char rcsid[] = "$Id$"; 31 | 32 | #define P_(x) [ x ] = { .value = x, .name = #x, } 33 | static struct { 34 | int value; 35 | char *name; 36 | } poll_names[] = { 37 | P_(POLLIN), P_(POLLPRI), P_(POLLOUT), P_(POLLERR), P_(POLLHUP), 38 | P_(POLLNVAL), P_(POLLRDNORM), P_(POLLRDBAND), P_(POLLWRNORM), 39 | P_(POLLWRBAND), P_(POLLMSG), P_(POLLREMOVE) 40 | }; 41 | 42 | #undef P_ 43 | 44 | void dump_poll(int debug, const char *msg, int poll) 45 | { 46 | int i; 47 | 48 | for (i = 0; i < ARRAY_SIZE(poll_names); i++) { 49 | if (poll & poll_names[i].value) 50 | DBG(GENERAL, "%s: %s\n", msg, poll_names[i].name); 51 | } 52 | } 53 | EXPORT_SYMBOL(dump_poll); 54 | 55 | void alarm2str(int alarm, char *buf, int buflen) 56 | { 57 | char *p = buf; 58 | int left = buflen; 59 | int i; 60 | int n; 61 | 62 | if (!alarm) { 63 | snprintf(buf, buflen, "NONE"); 64 | return; 65 | } 66 | memset(buf, 0, buflen); 67 | for (i = 0; i < 8; i++) { 68 | if (left && (alarm & BIT(i))) { 69 | n = snprintf(p, left, "%s,", alarmbit2str(i)); 70 | p += n; 71 | left -= n; 72 | } 73 | } 74 | if (p > buf) /* kill last comma */ 75 | *(p - 1) = '\0'; 76 | } 77 | EXPORT_SYMBOL(alarm2str); 78 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/firmwares/FPGA_1161.202.hex: -------------------------------------------------------------------------------- 1 | FPGA_1161.201.hex -------------------------------------------------------------------------------- /drivers/dahdi/xpp/firmwares/LICENSE.firmware: -------------------------------------------------------------------------------- 1 | The firmware files (*.hex) in this directory are software for the 2 | Astribank itself and not intended to run on the Linux system itself. 3 | They are generally freely distriributable (see exact terms below). 4 | 5 | /****************************************************************************/ 6 | /* Copyright (c) 2004-2006 Xorcom Inc. All Rights Reserved. */ 7 | /* Redistribution and use of the microcode software ( Firmware ) is */ 8 | /* permitted provided that the following conditions are met: */ 9 | /* */ 10 | /* 1. Firmware is redistributed verbatim without any modification; */ 11 | /* 2. Any reproduction of Firmware must contain the above */ 12 | /* copyright notice, this list of conditions and the below */ 13 | /* disclaimer in the documentation and/or other materials */ 14 | /* provided with the distribution; and */ 15 | /* 3. The name of Xorcom may not be used to endorse or promote */ 16 | /* products derived from this Firmware without specific prior */ 17 | /* written consent. */ 18 | /* */ 19 | /* Disclaimer: Xorcom provides this firmware "as is" with no warranties */ 20 | /* or indemnities whatsoever. Xorcom expressly disclaims any express, */ 21 | /* statutory or implied warranties, including, but not limited to, the */ 22 | /* implied warranties of merchantability, fitness for a particular */ 23 | /* purpose and non-infringement. In no event shall Xorcom be liable for */ 24 | /* any direct, indirect, incidental, special, exemplary, or consequential */ 25 | /* damages (including, but not limited to, procurement of substitute */ 26 | /* goods or services; loss of use, data, or profits; or business */ 27 | /* interruption) however caused and on any theory of liability, whether */ 28 | /* in contract, strict liability, or tort (including negligence or */ 29 | /* otherwise) arising in any way out of the use of this firmware, even */ 30 | /* if advised of the possibility of such damage. User acknowledges and */ 31 | /* agrees that the purchase or use of the firmware will not create or */ 32 | /* give grounds for a license by implication, estoppel, or otherwise in */ 33 | /* any intellectual property rights (patent, copyright, trade secret, */ 34 | /* mask work, or other proprietary right) embodied in any other Xorcom */ 35 | /* hardware or firmware either solely or in combination with the firmware. */ 36 | /****************************************************************************/ 37 | 38 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/firmwares/Makefile: -------------------------------------------------------------------------------- 1 | # Install firmwares and initialization scripts for the Astribank 2 | # drivers 3 | 4 | USB_FW = USB_FW.hex USB_FW.201.hex USB_RECOV.hex 5 | FPGA_FW = FPGA_FXS.hex FPGA_1141.hex FPGA_1151.hex FPGA_1161.hex \ 6 | FPGA_1161.201.hex FPGA_1161.202.hex 7 | PIC_FW = PIC_TYPE_1.hex PIC_TYPE_2.hex PIC_TYPE_3.hex PIC_TYPE_4.hex \ 8 | PIC_TYPE_6.hex 9 | OCT_FW = $(wildcard OCT6104E-256D.ima) 10 | FIRMWARES = $(USB_FW) $(FPGA_FW) $(PIC_FW) $(OCT_FW) 11 | PROTO_VER = 30 12 | SCRIPTS_BASE = $(patsubst %,init_card_%_$(PROTO_VER),1 2 3 4 5 6) 13 | SCRIPTS = $(SCRIPTS_BASE:%=../%) 14 | TARGET = $(DESTDIR)/usr/share/dahdi 15 | 16 | all: 17 | 18 | clean: 19 | 20 | install: 21 | mkdir -p $(TARGET) 22 | install $(SCRIPTS) $(TARGET)/ 23 | install -m 644 ../XppConfig.pm $(FIRMWARES) $(TARGET)/ 24 | for id in 202 203; do \ 25 | if [ ! -r $(TARGET)/USB_FW.$$id.hex ]; then \ 26 | ln -s USB_FW.201.hex $(TARGET)/USB_FW.$$id.hex;\ 27 | fi; \ 28 | done 29 | if [ ! -r $(TARGET)/FPGA_1161.203.hex ]; then \ 30 | ln -s FPGA_1161.201.hex $(TARGET)/FPGA_1161.203.hex;\ 31 | fi 32 | 33 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/firmwares/README: -------------------------------------------------------------------------------- 1 | This distribution includes the firmware files required by the Xorcom[tm] 2 | Astribank[tm]. 3 | 4 | This distribution inlcudes just the firmware files. Be sure to use a 5 | zaptel distribution/package of a matching version. 6 | 7 | INSTALLATION 8 | """""""""""" 9 | run "make install" as root. (which will simply copy all the *.hex files 10 | to /usr/share/zaptel ) 11 | 12 | USAGE 13 | """"" 14 | When the firmware files are in place everything should work 15 | automagically. Consult the xpp documentation included in the package 16 | zaptel (or the debian package zaptel) that you use for further information. 17 | 18 | 19 | For further information contact support@xorcom.com http://xorcom.com 20 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/firmwares/USB_FW.202.hex: -------------------------------------------------------------------------------- 1 | USB_FW.201.hex -------------------------------------------------------------------------------- /drivers/dahdi/xpp/init_card_5_30: -------------------------------------------------------------------------------- 1 | #!/bin/true 2 | 3 | # ATM this script does nothing. 4 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/mmapbus.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "mmapbus.h" 5 | 6 | static int mmap_match(struct device *dev, struct device_driver *driver) 7 | { 8 | return !strncmp(dev_name(dev), driver->name, strlen(driver->name)); 9 | } 10 | 11 | static int mmap_uevent(struct device *dev, char **envp, int num_envp, 12 | char *buffer, int buffer_size) 13 | { 14 | envp[0] = buffer; 15 | envp[1] = NULL; 16 | return 0; 17 | } 18 | 19 | static void mmap_bus_release(struct device *dev) 20 | { 21 | } 22 | 23 | static void mmap_dev_release(struct device *dev) 24 | { 25 | } 26 | 27 | static struct bus_type mmap_bus_type = { 28 | .name = "mmap", 29 | .match = mmap_match, 30 | .uevent = mmap_uevent, 31 | }; 32 | 33 | static struct device mmap_bus = { 34 | .bus_id = "mmap0", 35 | .release = mmap_bus_release, 36 | }; 37 | 38 | int register_mmap_device(struct mmap_device *dev) 39 | { 40 | dev->dev.bus = &mmap_bus_type; 41 | dev->dev.parent = &mmap_bus; 42 | dev->dev.release = mmap_dev_release; 43 | strncpy(dev->dev.bus_id, dev->name, BUS_ID_SIZE); 44 | return device_register(&dev->dev); 45 | } 46 | EXPORT_SYMBOL(register_mmap_device); 47 | 48 | void unregister_mmap_device(struct mmap_device *dev) 49 | { 50 | device_unregister(&dev->dev); 51 | } 52 | EXPORT_SYMBOL(unregister_mmap_device); 53 | 54 | int register_mmap_driver(struct mmap_driver *driver) 55 | { 56 | driver->driver.bus = &mmap_bus_type; 57 | return driver_register(&driver->driver); 58 | } 59 | EXPORT_SYMBOL(register_mmap_driver); 60 | 61 | void unregister_mmap_driver(struct mmap_driver *driver) 62 | { 63 | driver_unregister(&driver->driver); 64 | } 65 | EXPORT_SYMBOL(unregister_mmap_driver); 66 | 67 | int register_mmap_bus(void) 68 | { 69 | int ret = 0; 70 | if ((ret = bus_register(&mmap_bus_type)) < 0) 71 | goto bus_type_reg; 72 | if ((ret = device_register(&mmap_bus)) < 0) 73 | goto bus_reg; 74 | return ret; 75 | 76 | bus_reg: 77 | bus_unregister(&mmap_bus_type); 78 | bus_type_reg: 79 | return ret; 80 | } 81 | EXPORT_SYMBOL(register_mmap_bus); 82 | 83 | void unregister_mmap_bus(void) 84 | { 85 | device_unregister(&mmap_bus); 86 | bus_unregister(&mmap_bus_type); 87 | } 88 | EXPORT_SYMBOL(unregister_mmap_bus); 89 | 90 | MODULE_AUTHOR("Alexander Landau "); 91 | MODULE_LICENSE("GPL"); 92 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/mmapbus.h: -------------------------------------------------------------------------------- 1 | #ifndef MMAPBUS_H 2 | #define MMAPBUS_H 3 | 4 | #include 5 | 6 | struct mmap_device { 7 | char *name; 8 | struct mmap_driver *driver; 9 | struct device dev; 10 | }; 11 | #define to_mmap_device(x) container_of(x, struct mmap_device, dev) 12 | 13 | struct mmap_driver { 14 | struct module *module; 15 | struct device_driver driver; 16 | }; 17 | #define to_mmap_driver(x) container_of(x, struct mmap_driver, driver) 18 | 19 | int register_mmap_bus(void); 20 | void unregister_mmap_bus(void); 21 | int register_mmap_device(struct mmap_device *dev); 22 | void unregister_mmap_device(struct mmap_device *dev); 23 | int register_mmap_driver(struct mmap_driver *driver); 24 | void unregister_mmap_driver(struct mmap_driver *driver); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/param_doc: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | use strict; 3 | # 4 | # Extract parameter documentation from *.ko files. 5 | # Assumes that parameter description include the default 6 | # value in the format we use in our DEF_PARM() macro 7 | # 8 | 9 | @ARGV || die "Usage: $0 module.ko....\n"; 10 | 11 | my $modinfo = '/sbin/modinfo'; 12 | my @mod_params; 13 | 14 | foreach my $file (glob "@ARGV") { 15 | undef @mod_params; 16 | print "$file:\n"; 17 | open(F, "$modinfo '$file' |") || die; 18 | while() { 19 | chomp; 20 | next unless s/^parm:\s*//; 21 | my ($name, $description) = split(/:/, $_, 2); 22 | # Extract type 23 | $description =~ s/\s*\(([^)]+)\)$//; 24 | my $type = $1; 25 | # Extract default value 26 | $description =~ s/\s*\[default\s+([^]]+)\]$//; 27 | my $default = $1; 28 | push(@mod_params, { 29 | NAME => $name, 30 | TYPE => $type, 31 | DEFVAL => $default, 32 | DESC => $description, 33 | }); 34 | } 35 | # Print sorted list 36 | foreach my $p (sort { $a->{NAME} cmp $b->{NAME} } @mod_params) { 37 | printf "\t%-8s %-22s = %-20s %s\n", $p->{TYPE}, $p->{NAME}, $p->{DEFVAL}, $p->{DESC}; 38 | } 39 | close F || die; 40 | } 41 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/parport_debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by Oron Peled 3 | * Copyright (C) 2007, Xorcom 4 | * 5 | * All rights reserved. 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | */ 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "parport_debug.h" 27 | 28 | static struct parport *debug_sync_parport; 29 | static int parport_toggles[8]; /* 8 bit flip-flop */ 30 | 31 | void flip_parport_bit(unsigned char bitnum) 32 | { 33 | static unsigned char last_value; 34 | DEFINE_SPINLOCK(lock); 35 | unsigned long flags; 36 | unsigned char mask; 37 | unsigned char value; 38 | 39 | if (!debug_sync_parport) { 40 | if (printk_ratelimit()) { 41 | printk(KERN_NOTICE "%s: no debug parallel port\n", 42 | THIS_MODULE->name); 43 | } 44 | return; 45 | } 46 | BUG_ON(bitnum > 7); 47 | mask = 1 << bitnum; 48 | spin_lock_irqsave(&lock, flags); 49 | value = last_value & ~mask; 50 | if (parport_toggles[bitnum] % 2) /* square wave */ 51 | value |= mask; 52 | last_value = value; 53 | parport_toggles[bitnum]++; 54 | spin_unlock_irqrestore(&lock, flags); 55 | parport_write_data(debug_sync_parport, value); 56 | } 57 | EXPORT_SYMBOL(flip_parport_bit); 58 | 59 | static void parport_attach(struct parport *port) 60 | { 61 | printk(KERN_INFO "%s: Using %s for debugging\n", THIS_MODULE->name, 62 | port->name); 63 | if (debug_sync_parport) { 64 | printk(KERN_ERR "%s: Using %s, ignore new attachment %s\n", 65 | THIS_MODULE->name, debug_sync_parport->name, port->name); 66 | return; 67 | } 68 | parport_get_port(port); 69 | debug_sync_parport = port; 70 | } 71 | 72 | static void parport_detach(struct parport *port) 73 | { 74 | printk(KERN_INFO "%s: Releasing %s\n", THIS_MODULE->name, port->name); 75 | if (debug_sync_parport != port) { 76 | printk(KERN_ERR "%s: Using %s, ignore new detachment %s\n", 77 | THIS_MODULE->name, debug_sync_parport->name, port->name); 78 | return; 79 | } 80 | parport_put_port(debug_sync_parport); 81 | debug_sync_parport = NULL; 82 | } 83 | 84 | static struct parport_driver debug_parport_driver = { 85 | .name = "parport_debug", 86 | .attach = parport_attach, 87 | .detach = parport_detach, 88 | }; 89 | 90 | int __init parallel_dbg_init(void) 91 | { 92 | int ret; 93 | 94 | ret = parport_register_driver(&debug_parport_driver); 95 | return ret; 96 | } 97 | 98 | void __exit parallel_dbg_cleanup(void) 99 | { 100 | parport_unregister_driver(&debug_parport_driver); 101 | } 102 | 103 | MODULE_DESCRIPTION("Use parallel port to debug drivers"); 104 | MODULE_AUTHOR("Oron Peled "); 105 | MODULE_LICENSE("GPL"); 106 | 107 | module_init(parallel_dbg_init); 108 | module_exit(parallel_dbg_cleanup); 109 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/parport_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef PARPORT_DEBUG_H 2 | #define PARPORT_DEBUG_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2007, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #ifdef DEBUG_SYNC_PARPORT 26 | void flip_parport_bit(unsigned char bitnum); 27 | #else 28 | #define flip_parport_bit(bitnum) 29 | #endif 30 | 31 | #endif /* PARPORT_DEBUG_H */ 32 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/print_fxo_modes.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | size_t i; 6 | int reg16 = 0; 7 | int reg26 = 0; 8 | int reg30 = 0; 9 | int reg31 = 0x20; 10 | char ring_osc[BUFSIZ] = ""; 11 | char ring_x[BUFSIZ] = ""; 12 | 13 | for (i = 0; i < (sizeof(fxo_modes) / sizeof(struct fxo_mode)); i++) { 14 | if (fxo_modes[i].name == NULL) 15 | break; 16 | 17 | reg16 = 0; 18 | reg26 = 0; 19 | reg30 = 0; 20 | reg31 = 0x20; 21 | ring_osc[0] = '\0'; 22 | ring_x[0] = '\0'; 23 | 24 | reg16 |= (fxo_modes[i].ohs << 6); 25 | reg16 |= (fxo_modes[i].rz << 1); 26 | reg16 |= (fxo_modes[i].rt); 27 | 28 | reg26 |= (fxo_modes[i].dcv << 6); 29 | reg26 |= (fxo_modes[i].mini << 4); 30 | reg26 |= (fxo_modes[i].ilim << 1); 31 | 32 | reg30 = (fxo_modes[i].acim); 33 | 34 | reg31 |= (fxo_modes[i].ohs2 << 3); 35 | 36 | if (fxo_modes[i].ring_osc) 37 | snprintf(ring_osc, BUFSIZ, "ring_osc=%04X", 38 | fxo_modes[i].ring_osc); 39 | if (fxo_modes[i].ring_x) 40 | snprintf(ring_x, BUFSIZ, "ring_x=%04X", 41 | fxo_modes[i].ring_x); 42 | printf("%-15s\treg16=%02X\treg26=%02X\treg30=%02X\t" 43 | "reg31=%02X\t%s\t%s\n", 44 | fxo_modes[i].name, reg16, reg26, reg30, reg31, 45 | ring_osc, ring_x); 46 | } 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/xframe_queue.h: -------------------------------------------------------------------------------- 1 | #ifndef XFRAME_QUEUE_H 2 | #define XFRAME_QUEUE_H 3 | 4 | #include 5 | #include 6 | #include "xdefs.h" 7 | 8 | #define XFRAME_QUEUE_MARGIN 10 9 | 10 | struct xframe_queue { 11 | struct list_head head; 12 | bool disabled; 13 | unsigned int count; 14 | unsigned int max_count; 15 | unsigned int steady_state_count; 16 | spinlock_t lock; 17 | const char *name; 18 | void *priv; 19 | /* statistics */ 20 | unsigned int worst_count; 21 | unsigned int overflows; 22 | s64 worst_lag_usec; /* since xframe creation */ 23 | }; 24 | 25 | void xframe_queue_init(struct xframe_queue *q, unsigned int steady_state_count, 26 | unsigned int max_count, const char *name, void *priv); 27 | __must_check bool xframe_enqueue(struct xframe_queue *q, xframe_t *xframe); 28 | __must_check xframe_t *xframe_dequeue(struct xframe_queue *q); 29 | void xframe_queue_clearstats(struct xframe_queue *q); 30 | void xframe_queue_disable(struct xframe_queue *q, bool disabled); 31 | void xframe_queue_clear(struct xframe_queue *q); 32 | uint xframe_queue_count(struct xframe_queue *q); 33 | 34 | #endif /* XFRAME_QUEUE_ */ 35 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/xpp.conf: -------------------------------------------------------------------------------- 1 | # /etc/dahdi/xpp.conf 2 | # 3 | # This file is used to configure the operation 4 | # of init_card_* initialization scripts. 5 | # 6 | 7 | # pri_protocol: is an XPP PRI device E1 (default) or T1? 8 | #pri_protocol E1 9 | # 10 | # Alternatively you can set this on a port by port basis if you have a strange 11 | # setup where some of the ports are E1 and some are T1. These specific 12 | # settings will override the default set above. 13 | #pri_protocol/xbus-00/xpd-02 T1 14 | #pri_protocol/connector:usb-0000:00:1d.7-7/xpd-03 T1 15 | #pri_protocol/label:usb:0000183/xpd-03 T1 16 | 17 | # International settings for the XPP FXO module. This is similar to the 18 | # 'opermode' kernel module of wctdm and wctdm24xxp . The default value 19 | # is 'FCC' (US settings). 20 | # 21 | # The valid settings can be shown by running the init_card_2_30 script with 22 | # the '-L' option. For example: 23 | # /usr/share/dahdi/init_card_2_30 -L 24 | # 25 | #opermode UK 26 | 27 | # Set this to enable debug mode for the scripts: 28 | #debug 1 29 | # 30 | # Skip the long calibration of the FXS modules. This saves time, but 31 | # makes the units consume much more power and hence highly unreocmmended 32 | # and unsupported. 33 | #fxs_skip_calib 1 34 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/xpp_dahdi.h: -------------------------------------------------------------------------------- 1 | #ifndef XPP_DAHDI_H 2 | #define XPP_DAHDI_H 3 | /* 4 | * Written by Oron Peled 5 | * Copyright (C) 2004-2006, Xorcom 6 | * 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | */ 24 | 25 | #include "xpd.h" 26 | #include "xproto.h" 27 | 28 | void xpd_set_spanname(xpd_t *xpd); 29 | int xpd_dahdi_preregister(xpd_t *xpd, unsigned offset); 30 | int xpd_dahdi_postregister(xpd_t *xpd); 31 | void xpd_dahdi_preunregister(xpd_t *xpd); 32 | void xpd_dahdi_postunregister(xpd_t *xpd); 33 | int create_xpd(xbus_t *xbus, const xproto_table_t *proto_table, 34 | const struct unit_descriptor *unit_descriptor, 35 | int unit, 36 | int subunit, __u8 type); 37 | xpd_t *xpd_alloc(xbus_t *xbus, int unit, int subunit, 38 | size_t privsize, const xproto_table_t *proto_table, 39 | const struct unit_descriptor *unit_descriptor, 40 | int channels); 41 | void xpd_free(xpd_t *xpd); 42 | void xpd_remove(xpd_t *xpd); 43 | int phonedev_alloc_channels(xpd_t *xpd, int channels); 44 | void update_xpd_status(xpd_t *xpd, int alarm_flag); 45 | const char *xpp_echocan_name(const struct dahdi_chan *chan); 46 | int xpp_echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp, 47 | struct dahdi_echocanparam *p, 48 | struct dahdi_echocan_state **ec); 49 | void hookstate_changed(xpd_t *xpd, int pos, bool good); 50 | int xpp_open(struct dahdi_chan *chan); 51 | int xpp_close(struct dahdi_chan *chan); 52 | int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg); 53 | int xpp_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig); 54 | int xpp_maint(struct dahdi_span *span, int cmd); 55 | int xpp_watchdog(struct dahdi_span *span, int cause); 56 | void xpp_span_assigned(struct dahdi_span *span); 57 | void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd); 58 | int total_registered_spans(void); 59 | void oht_pcm(xpd_t *xpd, int pos, bool pass); 60 | void mark_offhook(xpd_t *xpd, int pos, bool to_offhook); 61 | #define IS_OFFHOOK(xpd, pos) IS_SET((xpd)->phonedev.offhook_state, (pos)) 62 | void notify_rxsig(xpd_t *xpd, int pos, enum dahdi_rxsig rxsig); 63 | 64 | #ifdef CONFIG_PROC_FS 65 | #include 66 | 67 | extern struct proc_dir_entry *xpp_proc_toplevel; 68 | #endif 69 | 70 | #define SPAN_REGISTERED(xpd) (atomic_read(&PHONEDEV(xpd).dahdi_registered) && \ 71 | test_bit(DAHDI_FLAGBIT_REGISTERED, &PHONEDEV(xpd).span.flags)) 72 | 73 | #endif /* XPP_DAHDI_H */ 74 | -------------------------------------------------------------------------------- /drivers/dahdi/xpp/xpp_debug: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # xpp_debug: Turn on/off debugging flags via /sys/module/*/parameters/debug 4 | # 5 | 6 | modules="xpp xpp_usb xpd_fxs xpd_fxo xpd_bri xpd_pri xpd_echo" 7 | dbg_names="DEFAULT PCM LEDS SYNC SIGNAL PROC REGS DEVICES COMMANDS" 8 | 9 | usage() { 10 | echo 1>&2 "Usage: $0 [module_name] [[-]flags...]" 11 | echo 1>&2 " module_name => $modules" 12 | echo 1>&2 " flags => NONE $dbg_names ANY" 13 | echo 1>&2 "" 14 | echo 1>&2 " Example: $0 xpp ANY -PCM -LEDS" 15 | echo 1>&2 "" 16 | } 17 | 18 | sysfs_name() { 19 | f='' 20 | if [ -f "/sys/module/$1/parameters/debug" ]; then 21 | f="/sys/module/$1/parameters/debug" 22 | elif [ -f "/sys/module/$1/debug" ]; then 23 | f="/sys/module/$1/debug" 24 | fi 25 | echo "$f" 26 | } 27 | 28 | sysfs_value() { 29 | f=`sysfs_name "$1"` 30 | if [ "$f" != "" ]; then 31 | cat "$f" 32 | fi 33 | } 34 | 35 | show_debug() { 36 | usage 37 | for i in $modules 38 | do 39 | f=`sysfs_name "$i"` 40 | if [ -f "$f" ]; then 41 | val=`cat $f` 42 | j=0 43 | list='' 44 | for n in $dbg_names 45 | do 46 | if [ $(( val & (1 << j) )) -ne 0 ]; then 47 | list="$list $n" 48 | fi 49 | j=$((j+1)) 50 | done 51 | if [ "$list" = "" ]; then 52 | list=' NONE' 53 | fi 54 | echo "$i $list" 55 | fi 56 | done 57 | } 58 | 59 | calc_debug() { 60 | val="$1" 61 | shift 62 | for wanted in $* 63 | do 64 | j=0 65 | found=0 66 | for n in $dbg_names 67 | do 68 | if [ "$wanted" = "$n" ]; then 69 | : $(( val |= (1 << j) )) 70 | found=1 71 | elif [ "$wanted" = -"$n" ]; then 72 | : $(( val &= ~(1 << j) )) 73 | found=1 74 | elif [ "$wanted" = "ANY" ]; then 75 | : $(( val = ~0 )) 76 | found=1 77 | elif [ "$wanted" = -"ANY" -o "$wanted" = "NONE" ]; then 78 | val=0 79 | found=1 80 | fi 81 | j=$((j+1)) 82 | done 83 | if [ "$found" -eq 0 ]; then 84 | echo >&2 "$0: Unknown debug flag '$wanted'" 85 | exit 1 86 | fi 87 | done 88 | echo $val 89 | } 90 | 91 | if [ "$#" = 0 ]; then 92 | show_debug 93 | exit 0 94 | fi 95 | 96 | module="$1" 97 | shift 98 | 99 | if ! echo "$modules" | grep -w "$module" > /dev/null; then 100 | echo >&2 "$0: Unknown module $module" 101 | exit 1 102 | fi 103 | 104 | oldval=`sysfs_value "$module"` 105 | val=`calc_debug "$oldval" $*` 106 | file=`sysfs_name $module` 107 | 108 | echo "$val" > "$file" 109 | show_debug 110 | -------------------------------------------------------------------------------- /include/dahdi/Kbuild: -------------------------------------------------------------------------------- 1 | header-y += kernel.h 2 | header-y += user.h 3 | header-y += wctdm_user.h 4 | header-y += version.h 5 | -------------------------------------------------------------------------------- /include/dahdi/wctdm_user.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Wildcard S100P FXS Interface Driver for DAHDI Telephony interface 3 | * 4 | * Written by Mark Spencer 5 | * 6 | * Copyright (C) 2001-2008, Digium, Inc. 7 | * 8 | * All rights reserved. 9 | * 10 | */ 11 | 12 | /* 13 | * See http://www.asterisk.org for more information about 14 | * the Asterisk project. Please do not directly contact 15 | * any of the maintainers of this project for assistance; 16 | * the project provides a web site, mailing lists and IRC 17 | * channels for your use. 18 | * 19 | * This program is free software, distributed under the terms of 20 | * the GNU General Public License Version 2 as published by the 21 | * Free Software Foundation. See the LICENSE file included with 22 | * this program for more details. 23 | */ 24 | 25 | #ifndef _WCTDM_H 26 | #define _WCTDM_H 27 | 28 | #include 29 | 30 | #define NUM_REGS 109 31 | #define NUM_INDIRECT_REGS 105 32 | 33 | struct wctdm_stats { 34 | int tipvolt; /* TIP voltage (mV) */ 35 | int ringvolt; /* RING voltage (mV) */ 36 | int batvolt; /* VBAT voltage (mV) */ 37 | }; 38 | 39 | struct wctdm_regs { 40 | unsigned char direct[NUM_REGS]; 41 | unsigned short indirect[NUM_INDIRECT_REGS]; 42 | }; 43 | 44 | struct wctdm_regop { 45 | int indirect; 46 | unsigned char reg; 47 | unsigned short val; 48 | }; 49 | 50 | struct wctdm_echo_coefs { 51 | unsigned char acim; 52 | unsigned char coef1; 53 | unsigned char coef2; 54 | unsigned char coef3; 55 | unsigned char coef4; 56 | unsigned char coef5; 57 | unsigned char coef6; 58 | unsigned char coef7; 59 | unsigned char coef8; 60 | }; 61 | 62 | #define WCTDM_GET_STATS _IOR (DAHDI_CODE, 60, struct wctdm_stats) 63 | #define WCTDM_GET_REGS _IOR (DAHDI_CODE, 61, struct wctdm_regs) 64 | #define WCTDM_SET_REG _IOW (DAHDI_CODE, 62, struct wctdm_regop) 65 | #define WCTDM_SET_ECHOTUNE _IOW (DAHDI_CODE, 63, struct wctdm_echo_coefs) 66 | 67 | 68 | #endif /* _WCTDM_H */ 69 | --------------------------------------------------------------------------------