diff options
author | Sergey Matyukevich <matyukevich@arrival.com> | 2020-12-21 23:01:32 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2020-12-22 10:36:46 -0600 |
commit | de0d5a19c16bbb3eaba473e0eaaade7f55c48bcb (patch) | |
tree | 497d812abe2c1d3f3c228fd91bd51a69ffd52f9d | |
parent | 3551cc89ecc3229c4a50a644f519f7608e188b65 (diff) | |
download | ofono-de0d5a19c16bbb3eaba473e0eaaade7f55c48bcb.tar.gz |
gemalto: gprs: support different gprs protocols
Add support for IPv6 and dual mode gprs contexts.
-rw-r--r-- | drivers/gemaltomodem/gprs-context.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gemaltomodem/gprs-context.c b/drivers/gemaltomodem/gprs-context.c index 322a5f98..9bf89c84 100644 --- a/drivers/gemaltomodem/gprs-context.c +++ b/drivers/gemaltomodem/gprs-context.c @@ -46,6 +46,7 @@ static const char *none_prefix[] = { NULL }; struct gprs_context_data { GAtChat *chat; unsigned int active_context; + enum ofono_gprs_proto proto; ofono_gprs_context_cb_t cb; void *cb_data; }; @@ -127,15 +128,25 @@ static void gemalto_gprs_activate_primary(struct ofono_gprs_context *gc, DBG("cid %u", ctx->cid); - /* IPv6 support not implemented */ - if (ctx->proto != OFONO_GPRS_PROTO_IP) - goto error; - gcd->active_context = ctx->cid; gcd->cb_data = data; gcd->cb = cb; - len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid); + + switch (ctx->proto) { + case OFONO_GPRS_PROTO_IP: + len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", + ctx->cid); + break; + case OFONO_GPRS_PROTO_IPV6: + len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IPV6\"", + ctx->cid); + break; + case OFONO_GPRS_PROTO_IPV4V6: + len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IPV4V6\"", + ctx->cid); + break; + } if (ctx->apn) snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", ctx->apn); @@ -146,7 +157,6 @@ static void gemalto_gprs_activate_primary(struct ofono_gprs_context *gc, return; -error: CALLBACK_WITH_FAILURE(cb, data); } |