2009-10-12 21:35:59 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* oFono - Open Source Telephony
|
|
|
|
*
|
2010-01-02 01:00:10 +00:00
|
|
|
* Copyright (C) 2008-2010 Intel Corporation. All rights reserved.
|
2010-01-25 19:25:29 +00:00
|
|
|
* Copyright (C) 2010 ST-Ericsson AB.
|
2009-10-12 21:35:59 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2010-10-29 11:39:27 +00:00
|
|
|
#include <errno.h>
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <ofono/log.h>
|
|
|
|
#include <ofono/modem.h>
|
2009-10-20 17:09:46 +00:00
|
|
|
#include <ofono/gprs.h>
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
#include "gatchat.h"
|
|
|
|
#include "gatresult.h"
|
|
|
|
|
|
|
|
#include "atmodem.h"
|
2010-01-25 19:25:29 +00:00
|
|
|
#include "vendor.h"
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-22 23:00:07 +00:00
|
|
|
static const char *cgreg_prefix[] = { "+CGREG:", NULL };
|
2009-10-12 21:35:59 +00:00
|
|
|
static const char *cgdcont_prefix[] = { "+CGDCONT:", NULL };
|
|
|
|
static const char *none_prefix[] = { NULL };
|
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
struct gprs_data {
|
2009-10-12 21:35:59 +00:00
|
|
|
GAtChat *chat;
|
2010-01-18 14:30:13 +00:00
|
|
|
unsigned int vendor;
|
2009-10-12 21:35:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void at_cgatt_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|
|
|
{
|
2009-10-22 22:56:42 +00:00
|
|
|
struct cb_data *cbd = user_data;
|
|
|
|
ofono_gprs_cb_t cb = cbd->cb;
|
2009-10-12 21:35:59 +00:00
|
|
|
struct ofono_error error;
|
|
|
|
|
|
|
|
decode_at_error(&error, g_at_result_final_response(result));
|
|
|
|
|
2009-10-22 22:56:42 +00:00
|
|
|
cb(&error, cbd->data);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 22:56:42 +00:00
|
|
|
static void at_gprs_set_attached(struct ofono_gprs *gprs, int attached,
|
|
|
|
ofono_gprs_cb_t cb, void *data)
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
2009-10-22 22:56:42 +00:00
|
|
|
struct cb_data *cbd = cb_data_new(cb, data);
|
2009-10-12 21:35:59 +00:00
|
|
|
char buf[64];
|
|
|
|
|
2010-11-27 19:38:56 +00:00
|
|
|
if (cbd == NULL)
|
2009-10-12 21:35:59 +00:00
|
|
|
goto error;
|
|
|
|
|
2010-02-05 17:59:24 +00:00
|
|
|
snprintf(buf, sizeof(buf), "AT+CGATT=%i", attached ? 1 : 0);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
if (g_at_chat_send(gd->chat, buf, none_prefix,
|
2009-10-22 22:56:42 +00:00
|
|
|
at_cgatt_cb, cbd, g_free) > 0)
|
2009-10-12 21:35:59 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
error:
|
2010-08-16 20:02:01 +00:00
|
|
|
g_free(cbd);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
CALLBACK_WITH_FAILURE(cb, data);
|
|
|
|
}
|
|
|
|
|
2009-10-22 23:00:07 +00:00
|
|
|
static void at_cgreg_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-22 23:00:07 +00:00
|
|
|
struct cb_data *cbd = user_data;
|
|
|
|
ofono_gprs_status_cb_t cb = cbd->cb;
|
2009-10-12 21:35:59 +00:00
|
|
|
struct ofono_error error;
|
2010-03-26 17:54:10 +00:00
|
|
|
int status;
|
2010-01-18 14:30:13 +00:00
|
|
|
struct gprs_data *gd = cbd->user;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
decode_at_error(&error, g_at_result_final_response(result));
|
|
|
|
|
|
|
|
if (!ok) {
|
2010-03-26 17:54:10 +00:00
|
|
|
cb(&error, -1, cbd->data);
|
2009-10-12 21:35:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-12-09 18:50:22 +00:00
|
|
|
if (at_util_parse_reg(result, "+CGREG:", NULL, &status,
|
2010-03-26 17:54:10 +00:00
|
|
|
NULL, NULL, NULL, gd->vendor) == FALSE) {
|
|
|
|
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
|
2009-12-08 09:43:54 +00:00
|
|
|
return;
|
|
|
|
}
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2010-03-26 17:54:10 +00:00
|
|
|
cb(&error, status, cbd->data);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 23:00:07 +00:00
|
|
|
static void at_gprs_registration_status(struct ofono_gprs *gprs,
|
|
|
|
ofono_gprs_status_cb_t cb,
|
|
|
|
void *data)
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
2009-10-22 23:00:07 +00:00
|
|
|
struct cb_data *cbd = cb_data_new(cb, data);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2010-11-27 19:38:56 +00:00
|
|
|
if (cbd == NULL)
|
2009-10-12 21:35:59 +00:00
|
|
|
goto error;
|
|
|
|
|
2010-01-18 14:30:13 +00:00
|
|
|
cbd->user = gd;
|
|
|
|
|
2010-06-06 20:12:37 +00:00
|
|
|
switch (gd->vendor) {
|
|
|
|
case OFONO_VENDOR_NOVATEL:
|
|
|
|
/*
|
|
|
|
* Send $CNTI=0 to find out the current tech, it will be
|
|
|
|
* intercepted in nw_cnti_notify in network registration
|
|
|
|
*/
|
|
|
|
g_at_chat_send(gd->chat, "AT$CNTI=0", none_prefix,
|
|
|
|
NULL, NULL, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-10-22 23:00:07 +00:00
|
|
|
if (g_at_chat_send(gd->chat, "AT+CGREG?", cgreg_prefix,
|
|
|
|
at_cgreg_cb, cbd, g_free) > 0)
|
2009-10-12 21:35:59 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
error:
|
2010-08-16 20:02:01 +00:00
|
|
|
g_free(cbd);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2010-03-26 17:54:10 +00:00
|
|
|
CALLBACK_WITH_FAILURE(cb, -1, data);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
static void cgreg_notify(GAtResult *result, gpointer user_data)
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct ofono_gprs *gprs = user_data;
|
2010-03-26 17:54:10 +00:00
|
|
|
int status;
|
2010-01-18 14:30:13 +00:00
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-12-09 18:50:22 +00:00
|
|
|
if (at_util_parse_reg_unsolicited(result, "+CGREG:", &status,
|
2010-03-26 17:54:10 +00:00
|
|
|
NULL, NULL, NULL, gd->vendor) == FALSE)
|
2009-10-12 21:35:59 +00:00
|
|
|
return;
|
|
|
|
|
2010-03-26 17:54:10 +00:00
|
|
|
ofono_gprs_status_notify(gprs, status);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void cgev_notify(GAtResult *result, gpointer user_data)
|
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct ofono_gprs *gprs = user_data;
|
2009-10-12 21:35:59 +00:00
|
|
|
GAtResultIter iter;
|
|
|
|
const char *event;
|
|
|
|
|
2009-11-10 06:31:07 +00:00
|
|
|
g_at_result_iter_init(&iter, result);
|
|
|
|
|
2009-10-12 21:35:59 +00:00
|
|
|
if (!g_at_result_iter_next(&iter, "+CGEV:"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!g_at_result_iter_next_unquoted_string(&iter, &event))
|
|
|
|
return;
|
|
|
|
|
2009-11-10 06:31:07 +00:00
|
|
|
if (g_str_equal(event, "NW DETACH") ||
|
|
|
|
g_str_equal(event, "ME DETACH")) {
|
2009-10-26 21:55:03 +00:00
|
|
|
ofono_gprs_detached_notify(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-29 11:39:27 +00:00
|
|
|
static void xdatastat_notify(GAtResult *result, gpointer user_data)
|
|
|
|
{
|
|
|
|
struct ofono_gprs *gprs = user_data;
|
|
|
|
GAtResultIter iter;
|
|
|
|
int stat;
|
|
|
|
|
|
|
|
g_at_result_iter_init(&iter, result);
|
|
|
|
|
|
|
|
if (!g_at_result_iter_next(&iter, "+XDATASTAT:"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!g_at_result_iter_next_number(&iter, &stat))
|
|
|
|
|
|
|
|
DBG("stat %d", stat);
|
|
|
|
|
|
|
|
switch (stat) {
|
|
|
|
case 0:
|
|
|
|
ofono_gprs_suspend_notify(gprs, GPRS_SUSPENDED_UNKNOWN_CAUSE);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
ofono_gprs_resume_notify(gprs);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
static void gprs_initialized(gboolean ok, GAtResult *result, gpointer user_data)
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct ofono_gprs *gprs = user_data;
|
2009-10-22 23:00:33 +00:00
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
g_at_chat_register(gd->chat, "+CGEV:", cgev_notify, FALSE, gprs, NULL);
|
2009-12-09 08:46:33 +00:00
|
|
|
g_at_chat_register(gd->chat, "+CGREG:", cgreg_notify,
|
2010-10-29 11:39:27 +00:00
|
|
|
FALSE, gprs, NULL);
|
|
|
|
|
|
|
|
switch (gd->vendor) {
|
|
|
|
case OFONO_VENDOR_IFX:
|
|
|
|
/* Register for GPRS suspend notifications */
|
|
|
|
g_at_chat_register(gd->chat, "+XDATASTAT:", xdatastat_notify,
|
|
|
|
FALSE, gprs, NULL);
|
|
|
|
g_at_chat_send(gd->chat, "AT+XDATASTAT=1", none_prefix,
|
|
|
|
NULL, NULL, NULL);
|
|
|
|
break;
|
|
|
|
}
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
ofono_gprs_register(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-11-10 06:29:56 +00:00
|
|
|
static void at_cgreg_test_cb(gboolean ok, GAtResult *result,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
struct ofono_gprs *gprs = user_data;
|
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
|
|
|
gint range[2];
|
|
|
|
GAtResultIter iter;
|
|
|
|
int cgreg1 = 0;
|
|
|
|
int cgreg2 = 0;
|
|
|
|
const char *cmd;
|
|
|
|
|
|
|
|
if (!ok)
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
g_at_result_iter_init(&iter, result);
|
|
|
|
|
|
|
|
if (!g_at_result_iter_next(&iter, "+CGREG:"))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
if (!g_at_result_iter_open_list(&iter))
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
while (g_at_result_iter_next_range(&iter, &range[0], &range[1])) {
|
|
|
|
if (1 >= range[0] && 1 <= range[1])
|
|
|
|
cgreg1 = 1;
|
|
|
|
if (2 >= range[0] && 2 <= range[1])
|
|
|
|
cgreg2 = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_at_result_iter_close_list(&iter);
|
|
|
|
|
|
|
|
if (cgreg2)
|
|
|
|
cmd = "AT+CGREG=2";
|
|
|
|
else if (cgreg1)
|
|
|
|
cmd = "AT+CGREG=1";
|
|
|
|
else
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
g_at_chat_send(gd->chat, cmd, none_prefix, NULL, NULL, NULL);
|
|
|
|
g_at_chat_send(gd->chat, "AT+CGAUTO=0", none_prefix, NULL, NULL, NULL);
|
2010-01-25 19:25:29 +00:00
|
|
|
|
2010-08-20 18:57:30 +00:00
|
|
|
switch (gd->vendor) {
|
|
|
|
case OFONO_VENDOR_MBM:
|
|
|
|
/* Ericsson MBM and ST-E modems don't support AT+CGEREP=2,1 */
|
2010-01-25 19:25:29 +00:00
|
|
|
g_at_chat_send(gd->chat, "AT+CGEREP=1,0", none_prefix,
|
|
|
|
gprs_initialized, gprs, NULL);
|
2010-08-20 18:57:30 +00:00
|
|
|
break;
|
|
|
|
case OFONO_VENDOR_NOKIA:
|
|
|
|
/* Nokia data cards don't support AT+CGEREP=1,0 either */
|
|
|
|
g_at_chat_send(gd->chat, "AT+CGEREP=1", none_prefix,
|
|
|
|
gprs_initialized, gprs, NULL);
|
|
|
|
break;
|
|
|
|
default:
|
2010-01-25 19:25:29 +00:00
|
|
|
g_at_chat_send(gd->chat, "AT+CGEREP=2,1", none_prefix,
|
2009-11-10 06:29:56 +00:00
|
|
|
gprs_initialized, gprs, NULL);
|
2010-08-20 18:57:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-11-10 06:29:56 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
error:
|
|
|
|
ofono_info("GPRS not supported on this device");
|
|
|
|
ofono_gprs_remove(gprs);
|
|
|
|
}
|
|
|
|
|
2009-10-12 21:35:59 +00:00
|
|
|
static void at_cgdcont_test_cb(gboolean ok, GAtResult *result,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct ofono_gprs *gprs = user_data;
|
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
GAtResultIter iter;
|
2009-10-22 23:00:33 +00:00
|
|
|
int min, max;
|
2009-10-12 21:35:59 +00:00
|
|
|
const char *pdp_type;
|
2009-10-22 23:00:33 +00:00
|
|
|
gboolean found = FALSE;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
if (!ok)
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
g_at_result_iter_init(&iter, result);
|
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
while (!found && g_at_result_iter_next(&iter, "+CGDCONT:")) {
|
2009-10-23 20:17:55 +00:00
|
|
|
gboolean in_list = FALSE;
|
|
|
|
|
2009-10-12 21:35:59 +00:00
|
|
|
if (!g_at_result_iter_open_list(&iter))
|
2009-10-22 23:00:33 +00:00
|
|
|
continue;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
if (g_at_result_iter_next_range(&iter, &min, &max) == FALSE)
|
|
|
|
continue;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
if (!g_at_result_iter_close_list(&iter))
|
2009-10-22 23:00:33 +00:00
|
|
|
continue;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-23 20:17:55 +00:00
|
|
|
if (g_at_result_iter_open_list(&iter))
|
|
|
|
in_list = TRUE;
|
|
|
|
|
2009-10-12 21:35:59 +00:00
|
|
|
if (!g_at_result_iter_next_string(&iter, &pdp_type))
|
2009-10-22 23:00:33 +00:00
|
|
|
continue;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-23 20:17:55 +00:00
|
|
|
if (in_list && !g_at_result_iter_close_list(&iter))
|
|
|
|
continue;
|
|
|
|
|
2009-10-12 21:35:59 +00:00
|
|
|
/* We look for IP PDPs */
|
2009-10-23 20:17:55 +00:00
|
|
|
if (g_str_equal(pdp_type, "IP"))
|
2009-10-22 23:00:33 +00:00
|
|
|
found = TRUE;
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
if (found == FALSE)
|
|
|
|
goto error;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-22 23:00:33 +00:00
|
|
|
ofono_gprs_set_cid_range(gprs, min, max);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-11-10 06:29:56 +00:00
|
|
|
g_at_chat_send(gd->chat, "AT+CGREG=?", cgreg_prefix,
|
|
|
|
at_cgreg_test_cb, gprs, NULL);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
error:
|
2009-10-22 23:00:33 +00:00
|
|
|
ofono_info("GPRS not supported on this device");
|
2009-10-20 18:09:54 +00:00
|
|
|
ofono_gprs_remove(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
static int at_gprs_probe(struct ofono_gprs *gprs,
|
2009-10-12 21:35:59 +00:00
|
|
|
unsigned int vendor, void *data)
|
|
|
|
{
|
|
|
|
GAtChat *chat = data;
|
2009-10-20 18:09:54 +00:00
|
|
|
struct gprs_data *gd;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2010-10-29 11:39:27 +00:00
|
|
|
gd = g_try_new0(struct gprs_data, 1);
|
2010-11-27 19:38:56 +00:00
|
|
|
if (gd == NULL)
|
2010-10-29 11:39:27 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
|
2010-08-12 21:40:40 +00:00
|
|
|
gd->chat = g_at_chat_clone(chat);
|
2010-01-18 14:30:13 +00:00
|
|
|
gd->vendor = vendor;
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
ofono_gprs_set_data(gprs, gd);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2010-08-12 21:40:40 +00:00
|
|
|
g_at_chat_send(gd->chat, "AT+CGDCONT=?", cgdcont_prefix,
|
2009-10-20 18:09:54 +00:00
|
|
|
at_cgdcont_test_cb, gprs, NULL);
|
2009-10-22 23:00:33 +00:00
|
|
|
|
2009-10-12 21:35:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
static void at_gprs_remove(struct ofono_gprs *gprs)
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
2009-10-12 21:35:59 +00:00
|
|
|
|
2009-10-22 22:56:42 +00:00
|
|
|
ofono_gprs_set_data(gprs, NULL);
|
2010-08-12 21:40:40 +00:00
|
|
|
|
|
|
|
g_at_chat_unref(gd->chat);
|
2009-10-20 18:09:54 +00:00
|
|
|
g_free(gd);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
static struct ofono_gprs_driver driver = {
|
2009-10-12 21:35:59 +00:00
|
|
|
.name = "atmodem",
|
2009-10-20 18:09:54 +00:00
|
|
|
.probe = at_gprs_probe,
|
|
|
|
.remove = at_gprs_remove,
|
2009-10-22 22:56:42 +00:00
|
|
|
.set_attached = at_gprs_set_attached,
|
2010-03-26 17:54:10 +00:00
|
|
|
.attached_status = at_gprs_registration_status,
|
2009-10-12 21:35:59 +00:00
|
|
|
};
|
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
void at_gprs_init()
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
ofono_gprs_driver_register(&driver);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-20 18:09:54 +00:00
|
|
|
void at_gprs_exit()
|
2009-10-12 21:35:59 +00:00
|
|
|
{
|
2009-10-20 18:09:54 +00:00
|
|
|
ofono_gprs_driver_unregister(&driver);
|
2009-10-12 21:35:59 +00:00
|
|
|
}
|