cfsrvl.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) ST-Ericsson AB 2010
  3. * Author: Sjur Brendeland/sjur.brandeland@stericsson.com
  4. * License terms: GNU General Public License (GPL) version 2
  5. */
  6. #ifndef CFSRVL_H_
  7. #define CFSRVL_H_
  8. #include <linux/list.h>
  9. #include <linux/stddef.h>
  10. #include <linux/types.h>
  11. #include <linux/kref.h>
  12. struct cfsrvl {
  13. struct cflayer layer;
  14. bool open;
  15. bool phy_flow_on;
  16. bool modem_flow_on;
  17. struct dev_info dev_info;
  18. struct kref ref;
  19. };
  20. void cfsrvl_release(struct kref *kref);
  21. struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info);
  22. struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info);
  23. struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info);
  24. struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info);
  25. struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info);
  26. struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info);
  27. bool cfsrvl_phyid_match(struct cflayer *layer, int phyid);
  28. void cfservl_destroy(struct cflayer *layer);
  29. void cfsrvl_init(struct cfsrvl *service,
  30. u8 channel_id,
  31. struct dev_info *dev_info);
  32. bool cfsrvl_ready(struct cfsrvl *service, int *err);
  33. u8 cfsrvl_getphyid(struct cflayer *layer);
  34. static inline void cfsrvl_get(struct cflayer *layr)
  35. {
  36. struct cfsrvl *s;
  37. if (layr == NULL)
  38. return;
  39. s = container_of(layr, struct cfsrvl, layer);
  40. kref_get(&s->ref);
  41. }
  42. static inline void cfsrvl_put(struct cflayer *layr)
  43. {
  44. struct cfsrvl *s;
  45. if (layr == NULL)
  46. return;
  47. s = container_of(layr, struct cfsrvl, layer);
  48. kref_put(&s->ref, cfsrvl_release);
  49. }
  50. #endif /* CFSRVL_H_ */