Bug#493397: Patch to compile zaptel-source against 2.6.26

2008-08-29 Thread Carlos Martin Ugalde
Hope this will help you. With this patch zaptel-source compiles cleanly
against 2.6.22 kernels

--- kernel/zaptel-base.c2008-08-29 10:42:45.0 +
+++ kernel/zaptel-base.c2008-08-29 10:43:10.0 +
@@ -164,12 +164,29 @@
 /* udev necessary data structures.  Yeah! */
 #ifdef CONFIG_ZAP_UDEV

-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,26)
+#define CLASS_DEV_CREATE(class, devt, device, name) \
+   device_create(class, device, devt, name)
+#elif LINUX_VERSION_CODE = KERNEL_VERSION(2,6,15)
 #define CLASS_DEV_CREATE(class, devt, device, name) \
 class_device_create(class, NULL, devt, device, name)
-#else
+#elif LINUX_VERSION_CODE = KERNEL_VERSION(2,6,13)
 #define CLASS_DEV_CREATE(class, devt, device, name) \
 class_device_create(class, devt, device, name)
+#else
+#define CLASS_DEV_CREATE(class, devt, device, name) \
+class_simple_device_add(class, devt, device, name)
+#endif
+
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,26)
+#define CLASS_DEV_DESTROY(class, devt) \
+   device_destroy(class, devt)
+#elif LINUX_VERSION_CODE = KERNEL_VERSION(2,6,13)
+#define CLASS_DEV_DESTROY(class, devt) \
+   CLASS_DEV_DESTROY(class, devt)
+#else
+#define CLASS_DEV_DESTROY(class, devt) \
+   class_simple_device_remove(class, devt)
 #endif

 #if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,13)
@@ -178,8 +195,6 @@
 static struct class_simple *zap_class = NULL;
 #define class_create class_simple_create
 #define class_destroy class_simple_destroy
-#define class_device_create class_simple_device_add
-#define class_device_destroy(a, b) class_simple_device_remove(b)
 #endif

 #endif /* CONFIG_ZAP_UDEV */
@@ -5337,7 +5352,7 @@
 #ifdef CONFIG_ZAP_UDEV
for (x = 0; x  span-channels; x++) {
if (span-chans[x].channo  250)
-   class_device_destroy(zap_class, MKDEV(ZT_MAJOR,
span-chans[x].channo));
+   CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR,
span-chans[x].channo));
}
 #endif /* CONFIG_ZAP_UDEV */

@@ -7825,7 +7840,7 @@
 int zt_unregister_chardev(struct zt_chardev *dev)
 {
 #ifdef CONFIG_ZAP_UDEV
-   class_device_destroy(zap_class, MKDEV(ZT_MAJOR, dev-minor));
+   CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, dev-minor));
 #endif /* CONFIG_ZAP_UDEV */

 #ifdef CONFIG_DEVFS_FS
@@ -7904,10 +7919,10 @@
devfs_unregister_chrdev(ZT_MAJOR, zaptel);
 #else
 #ifdef CONFIG_ZAP_UDEV
-   class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 253)); /* timer
*/
-   class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 254)); /*
channel */
-   class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 255)); /* pseudo
*/
-   class_device_destroy(zap_class, MKDEV(ZT_MAJOR, 0)); /* ctl */
+   CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 253)); /* timer */
+   CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 254)); /* channel
*/
+   CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 255)); /* pseudo */
+   CLASS_DEV_DESTROY(zap_class, MKDEV(ZT_MAJOR, 0)); /* ctl */
class_destroy(zap_class);
 #endif /* CONFIG_ZAP_UDEV */
unregister_chrdev(ZT_MAJOR, zaptel);
-- 

   .
Carlos Martín Ugalde  \|/
SERCONI, S.L.\\Y//   Antes de imprimir este correo
Corro-e: [EMAIL PROTECTED]\\|//   Piensa si es realmente necesario
Web: www.serconi.es   \Y/¡Ahorra papel!
Tlf: 916 494 407 __#__
Fax: 916 494 866 \___/





--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#493397: patch for vzaphfc_main.c

2008-08-29 Thread Carlos Martin Ugalde
This patch is also needed to compile zaptel-source against 2.6.26

--- vzaphfc_main.orig.c 2008-06-30 10:25:09.0 +
+++ vzaphfc_main.c  2008-08-29 11:33:06.0 +
@@ -46,6 +46,11 @@
 #define B1 1
 #define B2 2

+#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,26)
+struct proc_dir_entry proc_root;
+struct proc_dir_entry *proc_root_driver = proc_root;
+#endif
+
 static int modes = 0; // all TE
 static int nt_modes[hfc_MAX_BOARDS] = { [0 ... (hfc_MAX_BOARDS-1)] =
-1 };
 static int force_l1_up = 0;
-- 

   .
Carlos Martín Ugalde  \|/
SERCONI, S.L.\\Y//   Antes de imprimir este correo
Corro-e: [EMAIL PROTECTED]\\|//   Piensa si es realmente necesario
Web: www.serconi.es   \Y/¡Ahorra papel!
Tlf: 916 494 407 __#__
Fax: 916 494 866 \___/





--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]