mirror of git://git.sysmocom.de/ofono
gprs: Add support for setting GPRS context type
This commit is contained in:
parent
6cb86931e3
commit
b3d18d5115
|
@ -91,6 +91,9 @@ void *ofono_gprs_context_get_data(struct ofono_gprs_context *gc);
|
||||||
|
|
||||||
struct ofono_modem *ofono_gprs_context_get_modem(struct ofono_gprs_context *gc);
|
struct ofono_modem *ofono_gprs_context_get_modem(struct ofono_gprs_context *gc);
|
||||||
|
|
||||||
|
void ofono_gprs_context_set_type(struct ofono_gprs_context *gc,
|
||||||
|
enum ofono_gprs_context_type type);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
13
src/gprs.c
13
src/gprs.c
|
@ -82,6 +82,7 @@ struct ofono_gprs {
|
||||||
|
|
||||||
struct ofono_gprs_context {
|
struct ofono_gprs_context {
|
||||||
struct ofono_gprs *gprs;
|
struct ofono_gprs *gprs;
|
||||||
|
enum ofono_gprs_context_type type;
|
||||||
const struct ofono_gprs_context_driver *driver;
|
const struct ofono_gprs_context_driver *driver;
|
||||||
void *driver_data;
|
void *driver_data;
|
||||||
struct ofono_atom *atom;
|
struct ofono_atom *atom;
|
||||||
|
@ -1842,10 +1843,11 @@ struct ofono_gprs_context *ofono_gprs_context_create(struct ofono_modem *modem,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
gc = g_try_new0(struct ofono_gprs_context, 1);
|
gc = g_try_new0(struct ofono_gprs_context, 1);
|
||||||
|
|
||||||
if (gc == NULL)
|
if (gc == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
gc->type = OFONO_GPRS_CONTEXT_TYPE_INVALID;
|
||||||
|
|
||||||
gc->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_GPRS_CONTEXT,
|
gc->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_GPRS_CONTEXT,
|
||||||
gprs_context_remove, gc);
|
gprs_context_remove, gc);
|
||||||
|
|
||||||
|
@ -1885,6 +1887,14 @@ struct ofono_modem *ofono_gprs_context_get_modem(struct ofono_gprs_context *gc)
|
||||||
return __ofono_atom_get_modem(gc->atom);
|
return __ofono_atom_get_modem(gc->atom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ofono_gprs_context_set_type(struct ofono_gprs_context *gc,
|
||||||
|
enum ofono_gprs_context_type type)
|
||||||
|
{
|
||||||
|
DBG("type %d", type);
|
||||||
|
|
||||||
|
gc->type = type;
|
||||||
|
}
|
||||||
|
|
||||||
int ofono_gprs_driver_register(const struct ofono_gprs_driver *d)
|
int ofono_gprs_driver_register(const struct ofono_gprs_driver *d)
|
||||||
{
|
{
|
||||||
DBG("driver: %p, name: %s", d, d->name);
|
DBG("driver: %p, name: %s", d, d->name);
|
||||||
|
@ -1988,7 +1998,6 @@ struct ofono_gprs *ofono_gprs_create(struct ofono_modem *modem,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
gprs = g_try_new0(struct ofono_gprs, 1);
|
gprs = g_try_new0(struct ofono_gprs, 1);
|
||||||
|
|
||||||
if (gprs == NULL)
|
if (gprs == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue