~ubuntu-branches/ubuntu/wily/ofono/wily-proposed

« back to all changes in this revision

Viewing changes to plugins/infineon.c

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Martti Piirainen, Alfonso Sanchez-Beato, Tony Espy
  • Date: 2014-07-21 18:59:17 UTC
  • mfrom: (1.3.21)
  • Revision ID: package-import@ubuntu.com-20140721185917-vwillk54uiajs9lb
Tags: 1.12.bzr6870+14.10.20140721-0ubuntu1
[ Martti Piirainen ]
* drivers/rilmodem/sim.c: notify on SIM removal (LP: #1332306)
* unit/rilmodem/test-sim-online: fix serial number check (LP: #1334867)

[ Alfonso Sanchez-Beato ]
* plugins/mtk.c: fix race condition when onlining modem
* build, drivers/infeonmodem, drivers/rilmodem, gril,
  plugins/infeon.c, plugins/ril.*, unit: add Infeon OEM hooks

[ Tony Espy ]
* build, plugins/ubuntu-provision.c, ubuntu-apndb.*: re-named
  provisioning plugin code from android-* to ubuntu-*.  Also removed
  code that queries mobile-broadband-provider-info's db, and finally
  implemented a /custom hook for custom apn dbs (LP: #1315509).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  oFono - Open Source Telephony - RIL-based devices: infineon modems
 
4
 *
 
5
 *  Copyright (C) 2014  Canonical Ltd.
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License version 2 as
 
9
 *  published by the Free Software Foundation.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 *
 
20
 */
 
21
 
 
22
#ifdef HAVE_CONFIG_H
 
23
#include <config.h>
 
24
#endif
 
25
 
 
26
#define OFONO_API_SUBJECT_TO_CHANGE
 
27
 
 
28
#include <ofono/plugin.h>
 
29
#include <ofono/log.h>
 
30
#include <ofono/modem.h>
 
31
 
 
32
#include "ofono.h"
 
33
 
 
34
#include "drivers/rilmodem/vendor.h"
 
35
#include "ril.h"
 
36
 
 
37
static int inf_probe(struct ofono_modem *modem)
 
38
{
 
39
        return ril_create(modem, OFONO_RIL_VENDOR_INFINEON);
 
40
}
 
41
 
 
42
static struct ofono_modem_driver infineon_driver = {
 
43
        .name = "infineon",
 
44
        .probe = inf_probe,
 
45
        .remove = ril_remove,
 
46
        .enable = ril_enable,
 
47
        .disable = ril_disable,
 
48
        .pre_sim = ril_pre_sim,
 
49
        .post_sim = ril_post_sim,
 
50
        .post_online = ril_post_online,
 
51
        .set_online = ril_set_online,
 
52
};
 
53
 
 
54
/*
 
55
 * This plugin is a device plugin for infineon modems that use RIL interface.
 
56
 * The plugin 'rildev' is used to determine which RIL plugin should be loaded
 
57
 * based upon an environment variable.
 
58
 */
 
59
static int inf_init(void)
 
60
{
 
61
        int retval = 0;
 
62
 
 
63
        if ((retval = ofono_modem_driver_register(&infineon_driver)))
 
64
                DBG("ofono_modem_driver_register returned: %d", retval);
 
65
 
 
66
        return retval;
 
67
}
 
68
 
 
69
static void inf_exit(void)
 
70
{
 
71
        DBG("");
 
72
        ofono_modem_driver_unregister(&infineon_driver);
 
73
}
 
74
 
 
75
OFONO_PLUGIN_DEFINE(infineon, "Infineon modem driver", VERSION,
 
76
                        OFONO_PLUGIN_PRIORITY_DEFAULT, inf_init, inf_exit)