[zaptel-commits] kpfleming: trunk r2112 - in /trunk: ./ xpp/ ztcodec_dte/

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Feb 7 13:44:30 MST 2007


Author: kpfleming
Date: Wed Feb  7 14:44:29 2007
New Revision: 2112

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2112
Log:
Merged revisions 2111 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

................
r2111 | kpfleming | 2007-02-07 14:36:52 -0600 (Wed, 07 Feb 2007) | 11 lines

Merged revisions 2110 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r2110 | kpfleming | 2007-02-07 14:29:22 -0600 (Wed, 07 Feb 2007) | 3 lines

build XPP on the kernels that Xorcom says are OK to build on
update workqueue usage to conform to kernel 2.6.20 API

........

................

Modified:
    trunk/   (props changed)
    trunk/Makefile
    trunk/xpp/xbus-core.c
    trunk/ztcodec_dte/base.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.4-merged (original)
+++ branch-1.4-merged Wed Feb  7 14:44:29 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-1471,1490,1500,1507,1520,1528,1530,1536,1543,1547,1568,1574,1576,1601,1611,1615,1642,1661,1664,1687,1698,1701,1767,1774,1820,1828,1836,1878,1887,1892,1899,1913,1921,1924,1937,1944,1954,1988,1998,2039,2044,2087,2099,2105,2107
+/branches/1.4:1-1471,1490,1500,1507,1520,1528,1530,1536,1543,1547,1568,1574,1576,1601,1611,1615,1642,1661,1664,1687,1698,1701,1767,1774,1820,1828,1836,1878,1887,1892,1899,1913,1921,1924,1937,1944,1954,1988,1998,2039,2044,2087,2099,2105,2107,2111

Modified: trunk/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/Makefile?view=diff&rev=2112&r1=2111&r2=2112
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Wed Feb  7 14:44:29 2007
@@ -130,9 +130,6 @@
 LTZ_SO_MAJOR_VER:=1
 LTZ_SO_MINOR_VER:=0
 
-ifeq ($(findstring xpp_usb,$(MENUSELECT_MODULES)),)
-  BUILD_XPP:=yes
-endif
 MODULES:=pciradio tor2 torisa wcfxo wct1xxp wctdm wctdm24xxp wcte11xp wcusb zaptel ztd-eth ztd-loc ztdummy ztdynamic zttranscode
 MODULES:=$(filter-out $(MENUSELECT_MODULES),$(MODULES))
 MODULE_ALIASES=wcfxs wctdm8xxp wct2xxp
@@ -140,10 +137,7 @@
 MODULESO:=$(MODULES:%=%.o)
 MODULESKO:=$(MODULES:%=%.ko)
 ifeq ($(BUILDVER),linux26)
-MODULES_BUILD:=$(MODULESKO)
 HOTPLUG_FIRMWARE:=$(shell if grep CONFIG_FW_LOADER $(KINCLUDES)/linux/autoconf.h | grep -q undef; then echo "no"; else echo "yes"; fi)
-else
-MODULES_BUILD:=$(MODULESO)
 endif
 
 BIN_DIR:=$(INSTALL_PREFIX)/sbin
@@ -158,9 +152,15 @@
 obj-m+=wct4xxp/
 MODULES+=wct4xxp
 endif
+
 ifeq ($(findstring ztcodec_dte,$(MENUSELECT_MODULES)),)
 obj-m+=ztcodec_dte/
 MODULES+=ztcodec_dte
+endif
+
+ifeq ($(findstring xpp_usb,$(MENUSELECT_MODULES)),)
+obj-m+=xpp/
+MODULES+=xpp
 endif
 
 # Set this to override hotplug firmware loading and revert to classic header
@@ -168,19 +168,6 @@
 ifeq ($(HOTPLUG_FIRMWARE),yes)
 CFLAGS+=-DHOTPLUG_FIRMWARE
 endif	
-
-# Also build xpp in the subdirectory xpp/ . But only for >=2.6.10 and only 
-# for i386 or x86_64. On other archs the module will probably build but panic.
-# These lines are only meaningful when this Makefile is used as kconfig for 
-# 2.6 build
-
-ifneq (,$(shell [ 0$(SUBLEVEL) -ge 10 ] && [ "$(ARCH)" = 'i386' ] && [ "x$(BUILD_XPP)" = "xyes" ] && echo 1))
-obj-m+=xpp/
-endif
-
-ifneq (,$(shell [ 0$(SUBLEVEL) -ge 10 ] && [ "$(ARCH)" = 'x86_64' ] && [ "x$(BUILD_XPP)" = "xyes" ] && echo 1))
-obj-m+=xpp/
-endif
 
 BINS:=fxotune fxstest sethdlc-new ztcfg ztdiag ztmonitor ztspeed zttest zttool
 UTILS:=$(filter-out zttool fxstest ztcfg,$(BINS))
@@ -494,9 +481,9 @@
 	$(INSTALL) $(BINS) $(BIN_DIR)
 
 install-modules: install-$(BUILDVER)
-install-linux24: $(MODULES_BUILD)
+install-linux24: $(MODULESO)
 	$(INSTALL) -d $(MOD_DIR)
-	$(INSTALL) -m 644 $(MODULES_BUILD) $(MOD_DIR)
+	$(INSTALL) -m 644 $(MODULESO) $(MOD_DIR)
 
 install-linux26: $(MODULESKO)
 	$(KMAKE_INST)

Modified: trunk/xpp/xbus-core.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xbus-core.c?view=diff&rev=2112&r1=2111&r2=2112
==============================================================================
--- trunk/xpp/xbus-core.c (original)
+++ trunk/xpp/xbus-core.c Wed Feb  7 14:44:29 2007
@@ -69,7 +69,6 @@
 static DEVICE_ATTR_FUNC(connector_show, dev, buf);
 static DEVICE_ATTR_FUNC(status_show, dev, buf);
 
-static int xbus_poll(void *data);
 static void xbus_release(struct device *dev);
 static int xbus_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data);
 static int xbus_read_waitfor_xpds(char *page, char **start, off_t off, int count, int *eof, void *data);
@@ -209,8 +208,16 @@
  * it returns only when all XPD's on the bus are detected and
  * initialized.
  */
-static int xbus_poll(void *data)
-{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+static void xbus_poll(struct work_struct *work)
+{
+	xbus_t			*xbus = container_of(work, xbus_t, xpds_init_work);
+#else
+static void xbus_poll(void *data)
+{
+	xbus_t			*xbus = data;
+#endif
+
 	int			id;
 	int			ret = 0;
 	unsigned long		flags;
@@ -221,11 +228,10 @@
 	int			count_removed;
 	int			count_added;
 	int			xpd_num;
-	xbus_t			*xbus = data;
 
 	if(!down_read_trylock(&xbus->in_use)) {
 		ERR("%s is being removed...\n", xbus->busname);
-		return -EBUSY;
+		return;
 	}
 	msleep(2);	/* roundtrip for older polls */
 	spin_lock_irqsave(&xbus->lock, flags);
@@ -326,7 +332,6 @@
 	wake_up(&xbus->wait_for_xpd_initialization);
 out:
 	up_read(&xbus->in_use);
-	return ret;
 }
 
 
@@ -343,7 +348,11 @@
 	xbus->hardware_exists = 1;
 	DBG("Activating: %s\n", xbus->busname);
 	/* Poll it */
-	INIT_WORK(&xbus->xpds_init_work, (void (*)(void *))xbus_poll, (void *)xbus);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+	INIT_WORK(&xbus->xpds_init_work, xbus_poll);
+#else
+	INIT_WORK(&xbus->xpds_init_work, xbus_poll, xbus);
+#endif
 	if(!queue_work(xpp_worker, &xbus->xpds_init_work)) {
 		ERR("Failed to queue xpd initialization work\n");
 		/* FIXME: need to return error */

Modified: trunk/ztcodec_dte/base.c
URL: http://svn.digium.com/view/zaptel/trunk/ztcodec_dte/base.c?view=diff&rev=2112&r1=2111&r2=2112
==============================================================================
--- trunk/ztcodec_dte/base.c (original)
+++ trunk/ztcodec_dte/base.c Wed Feb  7 14:44:29 2007
@@ -353,8 +353,6 @@
 	struct zt_transcoder *udecode;
 };
 
-static void dte_wque_run(struct wcdte *wc);
-
 struct wcdte_desc {
 	char *name;
 	int flags;
@@ -1103,8 +1101,15 @@
 	}	
 }
 
-static void dte_wque_run(struct wcdte *wc)
-{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+static void dte_wque_run(struct work_struct *work)
+{
+	struct wcdte *wc = container_of(work, struct wcdte, dte_work);
+#else
+static void dte_wque_run(void *work_data)
+{
+	struct wcdte *wc = work_data;
+#endif
 	int res;
 
 	if (wc->wqueints & 0x00000040) {
@@ -1123,7 +1128,7 @@
 	}
 }
 
-static irqreturn_t wcdte_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+ZAP_IRQ_HANDLER(wcdte_interrupt)
 {
 	struct wcdte *wc = dev_id;
 	unsigned int ints;
@@ -1653,7 +1658,12 @@
 		
 			/* Initialize the work queue */
 			wc->dte_wq = create_workqueue("tc400b");
-			INIT_WORK(&wc->dte_work, (void (*)(void *))dte_wque_run, wc);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+			INIT_WORK(&wc->dte_work, dte_wque_run);
+#else
+			INIT_WORK(&wc->dte_work, dte_wque_run, wc);
+#endif
+
 #ifdef HOTPLUG_FIRMWARE
 			if ((request_firmware(&firmware, dte_firmware, &wc->dev->dev) != 0) || !firmware) {
 				printk("TC400B: firmware %s not available from userspace\n", dte_firmware);
@@ -1673,7 +1683,7 @@
 			else
 				min_numchannels = g729_numchannels;
 
-			/* Setup Encoders nad Decoders */
+			/* Setup Encoders and Decoders */
 
 			if (!mode || strlen(mode) < 4)
 			{



More information about the zaptel-commits mailing list