Root/package/ifx-vmmc/Makefile

1#
2# Copyright (C) 2008 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=drv_vmmc
12PKG_VERSION:=1.7.0
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_MD5SUM:=3f1b44e79408a3320aa9f8b21a260fd0
17PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
18
19include $(INCLUDE_DIR)/package.mk
20
21define KernelPackage/ifx-vmmc
22  SUBMENU:=Voice over IP
23  TITLE:=TAPI LL driver for Voice Macro
24  URL:=http://www.lantiq.com/
25  MAINTAINER:=Lantiq
26  DEPENDS:=+kmod-ifx-tapi @BROKEN
27  FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.$(LINUX_KMOD_SUFFIX)
28  AUTOLOAD:=$(call AutoLoad,25,drv_vmmc)
29  MENU:=1
30endef
31
32define KernelPackage/ifx-vmmc/description
33    Voice Subsystem Low Level Driver for Danube, AR9, VR9 device families
34endef
35
36define KernelPackage/ifx-vmmc/config
37    source "$(SOURCE)/Config.in"
38endef
39
40CONFIGURE_ARGS += \
41    ARCH=$(LINUX_KARCH) \
42    --enable-linux-26 \
43    --enable-kernelbuild="$(LINUX_DIR)" \
44    --enable-kernelincl="$(LINUX_DIR)/include" \
45    --enable-tapiincl="$(STAGING_DIR)/usr/include/drv_tapi" \
46    --with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
47    $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_EVENT_LOGGER,el-debug) \
48    $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_PMC,pmc) \
49    $(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_DISABLE_DECT_NIBBLE_SWAP,dect-nibble-swap) \
50    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_FAX,fax t38) \
51    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_CID,cid) \
52    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_DECT,dect) \
53    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_KPI,kpi) \
54    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_LT_GR909,lt calibration) \
55    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_HDLC,hdlc) \
56    $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_TRACES,trace)
57
58ifneq ($(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE),128)
59  CONFIGURE_ARGS += --enable-history-buf=$(CONFIG_VOICE_CPE_VMMC_MPS_HISTORY_SIZE)
60endif
61
62#defaults
63FW_URL:=http://localhost/
64FW_TARGET:=ifx_firmware.bin
65FW_FILE:=fw_voip_ifx.tar.gz
66COEF_TARGET:=ifx_bbd_fxs.bin
67COEF_FILE:=coef_voip_ifx.tar.gz
68
69FW_DIR:=lib/firmware
70ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE_extract),y)
71  CONFIGURE_ARGS += --with-device=DANUBE
72  FW_TARGET:=danube_firmware.bin
73  FW_URL:=http://www.arcor.de/hilfe/files/pdf/
74  FW_FILE=arcor_A800_452CPW_FW_1.02.206(20081201).bin
75  FW_MD5SUM:=19d9af4e369287a0f0abaed415cdac10
76  COEF_TARGET:=danube_bbd_fxs.bin
77  COEF_FILE:=arcor_A800_452CPW_FW_1.02.206(20081201).bin
78  COEF_MD5SUM:=19d9af4e369287a0f0abaed415cdac10
79endif
80
81ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE),y)
82  CONFIGURE_ARGS += --with-device=DANUBE
83  FW_TARGET:=danube_firmware.bin
84  FW_FILE=fw_voip_danube-12.1.0.1.0.tar.gz
85  FW_MD5SUM:=51868b88dee9dbc65d3dbba355ded91c
86  COEF_TARGET:=danube_bbd_fxs.bin
87  COEF_FILE:=coef_voip_danube-0.9.0.tar.gz
88  COEF_MD5SUM:=c8ac6592b304b03829a8123560e15710
89endif
90
91ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_AR9),y)
92  CONFIGURE_ARGS += --with-device=AR9
93  # TODO: add fw/coef
94endif
95
96ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_VR9),y)
97  CONFIGURE_ARGS += --with-device=VR9
98  # TODO: add fw/coef
99endif
100
101ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE_extract),y)
102define Download/decode
103  FILE:=ifxmips_fw_decodev2.tar.bz2
104  URL:=http://downloads.openwrt.org/sources/
105  MD5SUM:=9f4ebfae5cb9d9e8fca46057a653ae27
106endef
107$(eval $(call Download,decode))
108endif
109
110define Download/firmware
111  FILE:=$(FW_FILE)
112  URL:=$(FW_URL)
113  MD5SUM:=$(FW_MD5SUM)
114endef
115$(eval $(call Download,firmware))
116
117define Download/coef
118  FILE:=$(COEF_FILE)
119  URL:=$(FW_URL)
120  MD5SUM:=$(COEF_MD5SUM)
121endef
122$(eval $(call Download,coef))
123
124define Build/Configure
125    rm -rf \
126        $(PKG_BUILD_DIR)/coef \
127        $(PKG_BUILD_DIR)/firmware
128    mkdir -p \
129        $(PKG_BUILD_DIR)/coef \
130        $(PKG_BUILD_DIR)/firmware
131ifeq ($(CONFIG_VOICE_CPE_VMMC_WITH_DEVICE_DANUBE_extract),y)
132    $(PLATFORM_DIR)/extract.sh $(DL_DIR) '$(FW_FILE)'
133    $(CP) $(DL_DIR)/voip.bin $(PKG_BUILD_DIR)/firmware/$(FW_TARGET)
134    $(CP) $(DL_DIR)/voip_coef.bin $(PKG_BUILD_DIR)/coef/$(COEF_TARGET)
135else
136    $(TAR) -C $(PKG_BUILD_DIR)/firmware -xvzf $(DL_DIR)/$(FW_FILE)
137    $(TAR) -C $(PKG_BUILD_DIR)/coef -xvzf $(DL_DIR)/$(COEF_FILE)
138endif
139    (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
140    $(call Build/Configure/Default)
141endef
142
143define Build/InstallDev
144    $(INSTALL_DIR) $(1)/usr/include
145    mkdir -p $(1)/usr/include/drv_vmmc
146    $(CP) -v --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_vmmc
147    (cd $(1)/usr/include/drv_vmmc && ln -snf . include)
148endef
149
150define KernelPackage/ifx-vmmc/install
151    $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
152    $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
153    $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET)
154    $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_TARGET) $(1)/$(FW_DIR)/$(COEF_TARGET)
155endef
156
157$(eval $(call KernelPackage,ifx-vmmc))
158

Archive Download this file



interactive