[zaptel-commits] kpfleming: branch 1.2 r2104 - /branches/1.2/wctc4xxp/base.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Feb 7 12:52:53 MST 2007


Author: kpfleming
Date: Wed Feb  7 13:52:52 2007
New Revision: 2104

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2104
Log:
make the workqueue usage compatible with 2.6.20 kernel

Modified:
    branches/1.2/wctc4xxp/base.c

Modified: branches/1.2/wctc4xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctc4xxp/base.c?view=diff&rev=2104&r1=2103&r2=2104
==============================================================================
--- branches/1.2/wctc4xxp/base.c (original)
+++ branches/1.2/wctc4xxp/base.c Wed Feb  7 13:52:52 2007
@@ -339,8 +339,6 @@
 	struct zt_transcoder *uencode;
 	struct zt_transcoder *udecode;
 };
-
-static void dte_wque_run(struct wcdte *wc);
 
 struct wcdte_desc {
 	char *name;
@@ -1015,8 +1013,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) {
@@ -1534,7 +1539,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);
@@ -1550,7 +1560,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