Hi Redouane
Find some comments below.
The purpose of the patch is to handle Network Initiated Context Activation and PDN connection request as part of EPS Attach procedure (LTE) in oFono core.
In order to avoid issue regarding CID allocation :
- driver should call the core using ofono_gprs_set_cid_range function to specify CID range for UE initiated PDN connection
- driver could use a new function to check if the CID is already used or not : ofono_gprs_is_cid_used, usefull in case the modem is not using a specific range for UE initiated PDN connection.
- driver will use a new function to notify the gprs atom of a new PDN connection with all the ip parameters from AT+CGCONTRDP (I can provide an update later to handle PCSCF and IMS Signaling Flag as well) commmand : ofono_gprs_context_activated
ofono_gprs_context_activated is similar to ofono_gprs_context_deactivated.
This function must be call by any gprs driver when :
- a context has been activated without explicit request as part of attach procedure in LTE (PDN ACT X and X is a unused CID)
- a context has been activated by the Network (NW PDN ACT X, NW ACT X,Y)
Behavior of the function :
List all the context and try to find correct APN with empty username and empty password.
If such context is not found then create a new one with "Internet" type only if we are in LTE with no Active context.
Otherwise deactivate the connection.
For the context (found or created):
Update the settings
Set to active
The function will also assign the context to a context driver.
---
include/gprs-context.h | 7 +++
include/gprs.h | 3 +
src/gprs.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++
src/idmap.c | 12 ++++
src/idmap.h | 1 +
5 files changed, 162 insertions(+), 0 deletions(-)
diff --git a/include/gprs-context.h b/include/gprs-context.h
index c29c0dc..e208b66 100644
--- a/include/gprs-context.h
+++ b/include/gprs-context.h
@@ -76,6 +76,13 @@ struct ofono_gprs_context_driver {
ofono_gprs_context_cb_t cb, void *data);
};
+
+void ofono_gprs_context_activated(struct ofono_gprs_context *gc,
+ const int cid, const char *apn,
+ const char *interface, ofono_bool_t static_ip,
+ const char *address, const char *netmask,
+ const char *gw, const char **dns);
+