diff options
author | Denis Kenzior <denkenz@gmail.com> | 2024-04-15 10:16:31 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-04-16 16:46:35 -0500 |
commit | b6ced6c5c4c94686ff85bb908bcdbc64b6719451 (patch) | |
tree | c479cd2724cfc24d5e586e1771726df78a0b6f7f | |
parent | 93395363f1cba09503c601f9fe19fe9285b6e4fc (diff) | |
download | ofono-b6ced6c5c4c94686ff85bb908bcdbc64b6719451.tar.gz |
qmi: gprs-context: Request certain TLVs to be included
Explicitly ask WDS service to include certain TLVs in its response.
This is mainly needed to obtain the value of the negotiated MTU between
the modem and the network. MTU is not included in the response
otherwise.
-rw-r--r-- | drivers/qmimodem/gprs-context.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/qmimodem/gprs-context.c b/drivers/qmimodem/gprs-context.c index b1fdfc74c..6104cc82e 100644 --- a/drivers/qmimodem/gprs-context.c +++ b/drivers/qmimodem/gprs-context.c @@ -159,11 +159,14 @@ done: static void start_net_cb(struct qmi_result *result, void *user_data) { static const uint8_t RESULT_PACKET_HANDLE = 0x01; + static const uint8_t PARAM_REQUESTED_SETTINGS = 0x10; struct cb_data *cbd = user_data; ofono_gprs_context_cb_t cb = cbd->cb; struct ofono_gprs_context *gc = cbd->user; struct gprs_context_data *data = ofono_gprs_context_get_data(gc); uint32_t handle; + uint32_t requested_settings = 0; + struct qmi_param *param; DBG(""); @@ -177,6 +180,19 @@ static void start_net_cb(struct qmi_result *result, void *user_data) data->pkt_handle = handle; + /* + * Explicitly request certain information to be provided. The requested + * settings is a bit field, with each bit representing whether the + * TLV is included in the GET_CURRENT_SETTINGS response. We request the + * following settings: + * 2 - PDP Type, 3 - APN Name, 4 - DNS, 5 - Granted QOS, + * 6 - Username, 7 - Auth Proto + * 8 - IP Address, 9 - Gateway, 13 - MTU, 14 - DNS List, + * 15 - IP Family, 17 - Extended Technology + */ + L_BITS_SET(&requested_settings, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 15, 17); + param = qmi_param_new_uint32(PARAM_REQUESTED_SETTINGS, + requested_settings); if (qmi_service_send(data->wds, QMI_WDS_GET_CURRENT_SETTINGS, NULL, get_settings_cb, cbd, cb_data_unref) > 0) { @@ -184,6 +200,8 @@ static void start_net_cb(struct qmi_result *result, void *user_data) return; } + qmi_param_free(param); + error: data->active_context = 0; CALLBACK_WITH_FAILURE(cb, cbd->data); |