100-compat.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. --- a/src/Makefile.in
  2. +++ b/src/Makefile.in
  3. @@ -63,7 +63,7 @@ POST_UNINSTALL = :
  4. # the headerfile of linux kernels 2.6.x contain to much arithmetic
  5. # with void pointers (which is allowed for gcc!)
  6. -@KERNEL_2_6_FALSE@am__append_6 = -Wpointer-arith
  7. +@KERNEL_2_6_FALSE@am__append_6 =
  8. subdir = src
  9. DIST_COMMON = $(drv_dsl_cpe_api_include_HEADERS) $(srcdir)/Makefile.am \
  10. $(srcdir)/Makefile.in
  11. --- a/src/common/drv_dsl_cpe_os_linux.c
  12. +++ b/src/common/drv_dsl_cpe_os_linux.c
  13. @@ -11,6 +11,7 @@
  14. #define DSL_INTERN
  15. +#include <linux/device.h>
  16. #include "drv_dsl_cpe_api.h"
  17. #include "drv_dsl_cpe_api_ioctl.h"
  18. @@ -238,14 +239,7 @@ static DSL_long_t DSL_DRV_Ioctls(DSL_DRV
  19. }
  20. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
  21. - if (pFile->f_dentry != DSL_NULL)
  22. - {
  23. - pINode = pFile->f_dentry->d_inode;
  24. - }
  25. - else
  26. - {
  27. - pINode = DSL_NULL;
  28. - }
  29. + pINode = file_inode(pFile);
  30. #endif
  31. if (pINode == DSL_NULL)
  32. @@ -1118,6 +1112,9 @@ static void DSL_DRV_DebugInit(void)
  33. return;
  34. }
  35. +static struct class *dsl_class;
  36. +static dev_t dsl_devt;
  37. +
  38. /* Entry point of driver */
  39. int __init DSL_ModuleInit(void)
  40. {
  41. @@ -1156,6 +1153,10 @@ int __init DSL_ModuleInit(void)
  42. DSL_DRV_DevNodeInit();
  43. + dsl_class = class_create(THIS_MODULE, "dsl_cpe_api0");
  44. + dsl_devt = MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0);
  45. + device_create(dsl_class, NULL, dsl_devt, NULL, "dsl_cpe_api0");
  46. +
  47. return 0;
  48. }
  49. @@ -1163,6 +1164,11 @@ void __exit DSL_ModuleCleanup(void)
  50. {
  51. printk("Module will be unloaded"DSL_DRV_CRLF);
  52. + device_destroy(dsl_class, dsl_devt);
  53. + dsl_devt = NULL;
  54. + class_destroy(dsl_class);
  55. + dsl_class = NULL;
  56. +
  57. unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
  58. DSL_DRV_Cleanup();