diff mbox series

[3/4] gprs: Add some additional context types

Message ID 20240124211317.611706-3-denkenz@gmail.com (mailing list archive)
State Accepted
Commit e6a08a1098b004450f4512faeee76334facb74a4
Headers show
Series [1/4] core: Remove unused declarations from ofono.h | expand

Commit Message

Denis Kenzior Jan. 24, 2024, 9:13 p.m. UTC
These context types are currently unused, but supported by the
provisioning database.  Add them to the enumeration and update some
utility functions to handle them.

In the case of SUPL, the context type can now be set via D-Bus API.  IA
context types will be handled specially by lte atom.
---
 include/gprs-context.h |  2 ++
 src/gprs.c             | 11 +++++++++++
 2 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/include/gprs-context.h b/include/gprs-context.h
index 81055d89..5d5f0be1 100644
--- a/include/gprs-context.h
+++ b/include/gprs-context.h
@@ -37,6 +37,8 @@  enum ofono_gprs_context_type {
 	OFONO_GPRS_CONTEXT_TYPE_MMS		= 0x0002,
 	OFONO_GPRS_CONTEXT_TYPE_WAP		= 0x0004,
 	OFONO_GPRS_CONTEXT_TYPE_IMS		= 0x0008,
+	OFONO_GPRS_CONTEXT_TYPE_SUPL		= 0x0010,
+	OFONO_GPRS_CONTEXT_TYPE_IA		= 0x0020,
 };
 
 struct ofono_gprs_primary_context {
diff --git a/src/gprs.c b/src/gprs.c
index f8b6fd3c..7b681d85 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -177,6 +177,10 @@  static const char *gprs_context_default_name(enum ofono_gprs_context_type type)
 		return "WAP";
 	case OFONO_GPRS_CONTEXT_TYPE_IMS:
 		return "IMS";
+	case OFONO_GPRS_CONTEXT_TYPE_SUPL:
+		return "SUPL";
+	case OFONO_GPRS_CONTEXT_TYPE_IA:
+		return "Initial Attach";
 	}
 
 	return NULL;
@@ -196,6 +200,10 @@  static const char *gprs_context_type_to_string(
 		return "wap";
 	case OFONO_GPRS_CONTEXT_TYPE_IMS:
 		return "ims";
+	case OFONO_GPRS_CONTEXT_TYPE_SUPL:
+		return "supl";
+	case OFONO_GPRS_CONTEXT_TYPE_IA:
+		return "ia";
 	}
 
 	return NULL;
@@ -216,6 +224,9 @@  static gboolean gprs_context_string_to_type(const char *str,
 	} else if (g_str_equal(str, "ims")) {
 		*out = OFONO_GPRS_CONTEXT_TYPE_IMS;
 		return TRUE;
+	} else if (g_str_equal(str, "supl")) {
+		*out = OFONO_GPRS_CONTEXT_TYPE_SUPL;
+		return TRUE;
 	}
 
 	return FALSE;