mirror of git://git.sysmocom.de/ofono
gprs: Move packet bearer stuff into gprs.c
This commit is contained in:
parent
7124a12277
commit
f8b2ea9ebe
23
src/common.c
23
src/common.c
|
@ -714,29 +714,6 @@ const char *registration_tech_to_string(int tech)
|
|||
}
|
||||
}
|
||||
|
||||
const char *packet_bearer_to_string(int bearer)
|
||||
{
|
||||
switch (bearer) {
|
||||
case PACKET_BEARER_NONE:
|
||||
return "none";
|
||||
case PACKET_BEARER_GPRS:
|
||||
return "gprs";
|
||||
case PACKET_BEARER_EGPRS:
|
||||
return "edge";
|
||||
case PACKET_BEARER_UMTS:
|
||||
return "umts";
|
||||
case PACKET_BEARER_HSUPA:
|
||||
return "hsupa";
|
||||
case PACKET_BEARER_HSDPA:
|
||||
return "hsdpa";
|
||||
case PACKET_BEARER_HSUPA_HSDPA:
|
||||
return "hspa";
|
||||
case PACKET_BEARER_EPS:
|
||||
return "lte";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
gboolean is_valid_apn(const char *apn)
|
||||
{
|
||||
int i;
|
||||
|
|
12
src/common.h
12
src/common.h
|
@ -87,18 +87,6 @@ enum bearer_class {
|
|||
BEARER_CLASS_PAD = 128,
|
||||
};
|
||||
|
||||
/* 27.007 Section 7.29 */
|
||||
enum packet_bearer {
|
||||
PACKET_BEARER_NONE = 0,
|
||||
PACKET_BEARER_GPRS = 1,
|
||||
PACKET_BEARER_EGPRS = 2,
|
||||
PACKET_BEARER_UMTS = 3,
|
||||
PACKET_BEARER_HSUPA = 4,
|
||||
PACKET_BEARER_HSDPA = 5,
|
||||
PACKET_BEARER_HSUPA_HSDPA = 6,
|
||||
PACKET_BEARER_EPS = 7,
|
||||
};
|
||||
|
||||
/* 22.030 Section 6.5.2 */
|
||||
enum ss_control_type {
|
||||
SS_CONTROL_TYPE_ACTIVATION,
|
||||
|
|
35
src/gprs.c
35
src/gprs.c
|
@ -58,6 +58,18 @@
|
|||
static GSList *g_drivers = NULL;
|
||||
static GSList *g_context_drivers = NULL;
|
||||
|
||||
/* 27.007 Section 7.29 */
|
||||
enum packet_bearer {
|
||||
PACKET_BEARER_NONE = 0,
|
||||
PACKET_BEARER_GPRS = 1,
|
||||
PACKET_BEARER_EGPRS = 2,
|
||||
PACKET_BEARER_UMTS = 3,
|
||||
PACKET_BEARER_HSUPA = 4,
|
||||
PACKET_BEARER_HSDPA = 5,
|
||||
PACKET_BEARER_HSUPA_HSDPA = 6,
|
||||
PACKET_BEARER_EPS = 7,
|
||||
};
|
||||
|
||||
struct ofono_gprs {
|
||||
GSList *contexts;
|
||||
ofono_bool_t attached;
|
||||
|
@ -126,6 +138,29 @@ struct pri_context {
|
|||
static void gprs_netreg_update(struct ofono_gprs *gprs);
|
||||
static void gprs_deactivate_next(struct ofono_gprs *gprs);
|
||||
|
||||
const char *packet_bearer_to_string(int bearer)
|
||||
{
|
||||
switch (bearer) {
|
||||
case PACKET_BEARER_NONE:
|
||||
return "none";
|
||||
case PACKET_BEARER_GPRS:
|
||||
return "gprs";
|
||||
case PACKET_BEARER_EGPRS:
|
||||
return "edge";
|
||||
case PACKET_BEARER_UMTS:
|
||||
return "umts";
|
||||
case PACKET_BEARER_HSUPA:
|
||||
return "hsupa";
|
||||
case PACKET_BEARER_HSDPA:
|
||||
return "hsdpa";
|
||||
case PACKET_BEARER_HSUPA_HSDPA:
|
||||
return "hspa";
|
||||
case PACKET_BEARER_EPS:
|
||||
return "lte";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
static const char *gprs_context_default_name(enum ofono_gprs_context_type type)
|
||||
{
|
||||
switch (type) {
|
||||
|
|
Loading…
Reference in New Issue