patch-drivers_isdn_hardware_mISDN_contr_c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. - capi_ctr_reseted has been renamed in linux kernel commit
  2. 4e329972052c3649367b91de783f6293b8653cb2
  3. - kernel now wants a struc file_operations for proc files
  4. --- mISDN-1_1_9_2.orig/drivers/isdn/hardware/mISDN/contr.c 2009-01-22 14:36:34.000000000 +0100
  5. +++ mISDN-1_1_9_2/drivers/isdn/hardware/mISDN/contr.c 2011-07-15 18:33:55.765001537 +0200
  6. @@ -367,17 +367,12 @@ procinfo(struct capi_ctr *ctrl)
  7. }
  8. static int
  9. -read_proc(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *ctrl)
  10. +proc_show(struct seq_file *file, void *data)
  11. {
  12. - int len = 0;
  13. + struct capi_ctr *ctrl = file->private;
  14. - len += sprintf(page+len, "mISDN_read_proc\n");
  15. - if (off+count >= len)
  16. - *eof = 1;
  17. - if (len < off)
  18. - return 0;
  19. - *start = page + off;
  20. - return ((count < len-off) ? count : len-off);
  21. + seq_printf(file, "mISDN_proc_show\n");
  22. + return 0;
  23. };
  24. @@ -399,7 +394,7 @@ ResetController(struct capi_ctr *ctrl)
  25. #ifdef OLDCAPI_DRIVER_INTERFACE
  26. contr->ctrl->reseted(contr->ctrl);
  27. #else
  28. - capi_ctr_reseted(contr->ctrl);
  29. + capi_ctr_down(contr->ctrl);
  30. #endif
  31. }
  32. @@ -601,6 +596,19 @@ ControllerPutStatus(Controller_t *contr,
  33. contrDebug(contr, CAPI_DBG_CONTR, "%s: %s", __FUNCTION__, msg);
  34. }
  35. +static int misdn_proc_open(struct inode *inode, struct file *file)
  36. +{
  37. + return single_open(file, proc_show, PDE(inode)->data);
  38. +}
  39. +
  40. +static const struct file_operations misdn_proc_fops = {
  41. + .owner = THIS_MODULE,
  42. + .open = misdn_proc_open,
  43. + .read = seq_read,
  44. + .llseek = seq_lseek,
  45. + .release = single_release,
  46. +};
  47. +
  48. int
  49. ControllerConstr(Controller_t **contr_p, mISDNstack_t *st, mISDN_pid_t *pid, mISDNobject_t *ocapi)
  50. {
  51. @@ -719,7 +727,7 @@ ControllerConstr(Controller_t **contr_p,
  52. contr->ctrl->load_firmware = LoadFirmware;
  53. contr->ctrl->reset_ctr = ResetController;
  54. contr->ctrl->procinfo = procinfo;
  55. - contr->ctrl->ctr_read_proc = read_proc;
  56. + contr->ctrl->proc_fops = &misdn_proc_fops;
  57. retval = attach_capi_ctr(contr->ctrl);
  58. #endif
  59. if (!retval) {