gprs.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  4. *
  5. * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. */
  21. #ifndef __OFONO_GPRS_H
  22. #define __OFONO_GPRS_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_gprs;
  28. struct ofono_gprs_context;
  29. typedef void (*ofono_gprs_status_cb_t)(const struct ofono_error *error,
  30. int status, void *data);
  31. typedef void (*ofono_gprs_cb_t)(const struct ofono_error *error, void *data);
  32. struct ofono_gprs_driver {
  33. const char *name;
  34. int (*probe)(struct ofono_gprs *gprs, unsigned int vendor,
  35. void *data);
  36. void (*remove)(struct ofono_gprs *gprs);
  37. void (*set_attached)(struct ofono_gprs *gprs, int attached,
  38. ofono_gprs_cb_t cb, void *data);
  39. void (*attached_status)(struct ofono_gprs *gprs,
  40. ofono_gprs_status_cb_t cb, void *data);
  41. };
  42. enum gprs_suspend_cause {
  43. GPRS_SUSPENDED_DETACHED,
  44. GPRS_SUSPENDED_SIGNALLING,
  45. GPRS_SUSPENDED_CALL,
  46. GPRS_SUSPENDED_NO_COVERAGE,
  47. GPRS_SUSPENDED_UNKNOWN_CAUSE,
  48. };
  49. void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status);
  50. void ofono_gprs_detached_notify(struct ofono_gprs *gprs);
  51. void ofono_gprs_suspend_notify(struct ofono_gprs *gprs, int cause);
  52. void ofono_gprs_resume_notify(struct ofono_gprs *gprs);
  53. void ofono_gprs_bearer_notify(struct ofono_gprs *gprs, int bearer);
  54. struct ofono_modem *ofono_gprs_get_modem(struct ofono_gprs *gprs);
  55. int ofono_gprs_driver_register(const struct ofono_gprs_driver *d);
  56. void ofono_gprs_driver_unregister(const struct ofono_gprs_driver *d);
  57. struct ofono_gprs *ofono_gprs_create(struct ofono_modem *modem,
  58. unsigned int vendor, const char *driver,
  59. void *data);
  60. void ofono_gprs_register(struct ofono_gprs *gprs);
  61. void ofono_gprs_remove(struct ofono_gprs *gprs);
  62. void ofono_gprs_set_data(struct ofono_gprs *gprs, void *data);
  63. void *ofono_gprs_get_data(struct ofono_gprs *gprs);
  64. void ofono_gprs_set_cid_range(struct ofono_gprs *gprs,
  65. unsigned int min, unsigned int max);
  66. void ofono_gprs_add_context(struct ofono_gprs *gprs,
  67. struct ofono_gprs_context *gc);
  68. void ofono_gprs_cid_activated(struct ofono_gprs *gprs, unsigned int cid,
  69. const char *apn);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* __OFONO_GPRS_H */