~awe/phablet-extras/ofono-nettime-plugin

« back to all changes in this revision

Viewing changes to drivers/isimodem/isi.h

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2009-08-15 15:55:11 UTC
  • Revision ID: james.westby@ubuntu.com-20090815155511-frst06dijguhyfi4
Tags: upstream-0.3
ImportĀ upstreamĀ versionĀ 0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of oFono - Open Source Telephony
 
3
 *
 
4
 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
 
5
 *
 
6
 * Contact: Aki Niemi <aki.niemi@nokia.com>
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public License
 
10
 * version 2 as published by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
20
 * 02110-1301 USA
 
21
 *
 
22
 */
 
23
 
 
24
#define DECLARE_FAILURE(e)                      \
 
25
        struct ofono_error e;                   \
 
26
        e.type = OFONO_ERROR_TYPE_FAILURE;      \
 
27
        e.error = 0                             \
 
28
 
 
29
struct isi_data {
 
30
        struct ofono_modem *modem;
 
31
        struct netreg_data *netreg;
 
32
};
 
33
 
 
34
struct isi_cb_data {
 
35
        void *cb;
 
36
        void *data;
 
37
        struct ofono_modem *modem;
 
38
        void *user;
 
39
};
 
40
 
 
41
static inline struct isi_cb_data *isi_cb_data_new(struct ofono_modem *modem,
 
42
                                                void *cb, void *data)
 
43
{
 
44
        struct isi_cb_data *ret;
 
45
 
 
46
        ret = g_try_new0(struct isi_cb_data, 1);
 
47
 
 
48
        if (ret) {
 
49
                ret->cb = cb;
 
50
                ret->data = data;
 
51
                ret->modem = modem;
 
52
        }
 
53
        return ret;
 
54
}
 
55
 
 
56
void dump_msg(const unsigned char *msg, size_t len);