190-2.6.32_proc_fixes.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. --- a/tn7dsl.c
  2. +++ b/tn7dsl.c
  3. @@ -197,7 +197,7 @@ led_reg_t ledreg[2];
  4. static struct led_funcs ledreg[2];
  5. #endif
  6. -#define DEV_DSLMOD CTL_UNNUMBERED
  7. +#define DEV_DSLMOD 0
  8. #define MAX_STR_SIZE 256
  9. #define DSL_MOD_SIZE 256
  10. @@ -333,8 +333,8 @@ static void tn7dsl_chng_modulation(void*
  11. static unsigned int tn7dsl_set_modulation(void* data, int flag);
  12. static void tn7dsl_ctrl_fineGain(int value);
  13. static void tn7dsl_set_fineGainValue(int value);
  14. -static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
  15. - void *buffer, size_t * lenp);
  16. +static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer,
  17. + size_t * lenp, loff_t *ppos);
  18. static void tn7dsl_register_dslss_led(void);
  19. void tn7dsl_dslmod_sysctl_register(void);
  20. void tn7dsl_dslmod_sysctl_unregister(void);
  21. @@ -3398,8 +3398,8 @@ unsigned int tn7dsl_get_memory(unsigned
  22. -static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
  23. - void *buffer, size_t *lenp)
  24. +static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer,
  25. + size_t *lenp, loff_t *ppos)
  26. {
  27. char *ptr;
  28. int ret, len = 0;
  29. @@ -3411,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl,
  30. char mod_req[16] = { '\t' };
  31. char fst_byt;
  32. - if (!*lenp || (filp->f_pos && !write))
  33. + if (!*lenp || (*ppos && !write))
  34. {
  35. *lenp = 0;
  36. return 0;
  37. @@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl,
  38. */
  39. if(write)
  40. {
  41. - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
  42. + ret = proc_dostring(ctl, write, buffer, lenp, ppos);
  43. - switch (ctl->ctl_name)
  44. + switch ((long)ctl->extra2)
  45. {
  46. case DEV_DSLMOD:
  47. ptr = strpbrk(info, " \t");
  48. @@ -3507,14 +3507,21 @@ static int dslmod_sysctl(ctl_table *ctl,
  49. else
  50. {
  51. len += sprintf(info+len, mod_req);
  52. - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
  53. + ret = proc_dostring(ctl, write, buffer, lenp, ppos);
  54. }
  55. return ret;
  56. }
  57. ctl_table dslmod_table[] = {
  58. - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
  59. + {
  60. + .procname = "dslmod",
  61. + .data = info,
  62. + .maxlen = DSL_MOD_SIZE,
  63. + .mode = 0644,
  64. + .proc_handler = &dslmod_sysctl,
  65. + .extra2 = (void *)DEV_DSLMOD,
  66. + }
  67. ,
  68. {0}
  69. };
  70. @@ -3522,7 +3529,12 @@ ctl_table dslmod_table[] = {
  71. /* Make sure that /proc/sys/dev is there */
  72. ctl_table dslmod_root_table[] = {
  73. #ifdef CONFIG_PROC_FS
  74. - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
  75. + {
  76. + .procname = "dev",
  77. + .maxlen = 0,
  78. + .mode = 0555,
  79. + .child = dslmod_table,
  80. + }
  81. ,
  82. #endif /* CONFIG_PROC_FS */
  83. {0}