Search
j0ke.net Open Build Service
>
Projects
>
server:telephony
>
zaptel
> device.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File device.patch of Package zaptel
--- kernel/zaptel-base.c 2008-05-11 03:57:08.000000000 +0200 +++ kernel/zaptel-base.c.new 2008-08-03 12:11:11.000000000 +0200 @@ -163,12 +163,30 @@ /* 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_device_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) @@ -177,13 +195,10 @@ 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 */ - /* There is a table like this in the PPP driver, too */ static int deftaps = 64; @@ -5282,7 +5297,11 @@ #ifdef CONFIG_ZAP_UDEV for (x = 0; x < span->channels; x++) { if (span->chans[x].channo < 250) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) + device_destroy(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo)); +#else class_device_destroy(zap_class, MKDEV(ZT_MAJOR, span->chans[x].channo)); +#endif } #endif /* CONFIG_ZAP_UDEV */ @@ -7703,7 +7722,11 @@ int zt_unregister_chardev(struct zt_chardev *dev) { #ifdef CONFIG_ZAP_UDEV +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) + device_destroy(zap_class, MKDEV(ZT_MAJOR, dev->minor)); +#else class_device_destroy(zap_class, MKDEV(ZT_MAJOR, dev->minor)); +#endif #endif /* CONFIG_ZAP_UDEV */ #ifdef CONFIG_DEVFS_FS @@ -7782,11 +7805,19 @@ devfs_unregister_chrdev(ZT_MAJOR, "zaptel"); #else #ifdef CONFIG_ZAP_UDEV +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) + device_destroy(zap_class, MKDEV(ZT_MAJOR, 253)); /* timer */ + device_destroy(zap_class, MKDEV(ZT_MAJOR, 254)); /* channel */ + device_destroy(zap_class, MKDEV(ZT_MAJOR, 255)); /* pseudo */ + device_destroy(zap_class, MKDEV(ZT_MAJOR, 0)); /* ctl */ + class_destroy(zap_class); +#else 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_destroy(zap_class); +#endif #endif /* CONFIG_ZAP_UDEV */ unregister_chrdev(ZT_MAJOR, "zaptel"); #endif