summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-03-26 12:49:49 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-03-26 23:00:28 -0500
commit7972f844c7ee1a04e68a49622edd26e4f72ecc2c (patch)
treeae182ef7b33b36183bb05ff3f916506a05ff4b6d
parent88994bbe819dc01d108d6e47ac62fce68d700e1a (diff)
downloadofono-7972f844c7ee1a04e68a49622edd26e4f72ecc2c.tar.bz2
Refactor: Simplify the internal GPRS API
We no longer expose lac/ci/tech attributes obtained from CGREG (some modems, like ISI, do not even report them for GPRS separately). Simplify the internal gprs driver api to only report the registration status (e.g. home, roaming, searching, not registered, etc)
-rw-r--r--include/gprs.h9
-rw-r--r--src/gprs.c14
2 files changed, 9 insertions, 14 deletions
diff --git a/include/gprs.h b/include/gprs.h
index 8f54ba56..a1cbcd9c 100644
--- a/include/gprs.h
+++ b/include/gprs.h
@@ -32,8 +32,7 @@ struct ofono_gprs;
struct ofono_gprs_context;
typedef void (*ofono_gprs_status_cb_t)(const struct ofono_error *error,
- int status, int lac, int ci,
- int tech, void *data);
+ int status, void *data);
typedef void (*ofono_gprs_cb_t)(const struct ofono_error *error, void *data);
@@ -44,13 +43,11 @@ struct ofono_gprs_driver {
void (*remove)(struct ofono_gprs *gprs);
void (*set_attached)(struct ofono_gprs *gprs, int attached,
ofono_gprs_cb_t cb, void *data);
- void (*registration_status)(struct ofono_gprs *gprs,
+ void (*attached_status)(struct ofono_gprs *gprs,
ofono_gprs_status_cb_t cb, void *data);
};
-void ofono_gprs_status_notify(struct ofono_gprs *gprs,
- int status, int lac, int ci, int tech);
-
+void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status);
void ofono_gprs_detached_notify(struct ofono_gprs *gprs);
int ofono_gprs_driver_register(const struct ofono_gprs_driver *d);
diff --git a/src/gprs.c b/src/gprs.c
index df350f25..dfb6d16a 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -892,13 +892,12 @@ static void gprs_attached_update(struct ofono_gprs *gprs)
}
static void registration_status_cb(const struct ofono_error *error,
- int status, int lac, int ci, int tech,
- void *data)
+ int status, void *data)
{
struct ofono_gprs *gprs = data;
if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
- ofono_gprs_status_notify(gprs, status, lac, ci, tech);
+ ofono_gprs_status_notify(gprs, status);
gprs->flags &= ~GPRS_FLAG_ATTACHING;
@@ -917,9 +916,9 @@ static void gprs_attach_callback(const struct ofono_error *error, void *data)
else
gprs->driver_attached = !gprs->driver_attached;
- if (gprs->driver->registration_status) {
- gprs->driver->registration_status(gprs, registration_status_cb,
- gprs);
+ if (gprs->driver->attached_status) {
+ gprs->driver->attached_status(gprs, registration_status_cb,
+ gprs);
return;
}
@@ -1320,8 +1319,7 @@ void ofono_gprs_detached_notify(struct ofono_gprs *gprs)
*/
}
-void ofono_gprs_status_notify(struct ofono_gprs *gprs,
- int status, int lac, int ci, int tech)
+void ofono_gprs_status_notify(struct ofono_gprs *gprs, int status)
{
/* If we are not attached and haven't tried to attach, ignore */
if (gprs->driver_attached == FALSE)