mbimmodem: Add skeleton driver

This commit is contained in:
Denis Kenzior 2017-09-18 20:05:01 -05:00
parent 8dc66c11bd
commit ab58196e31
5 changed files with 132 additions and 0 deletions

View File

@ -605,6 +605,13 @@ builtin_sources += plugins/allowed-apns.c
if ELL
builtin_cflags += @ELL_CFLAGS@
builtin_libadd += @ELL_LIBS@
if MBIMMODEM
builtin_modules += mbimmodem
builtin_sources += drivers/mbimmodem/util.h \
drivers/mbimmodem/mbimmodem.h \
drivers/mbimmodem/mbimmodem.c
endif
endif
sbin_PROGRAMS = src/ofonod

View File

@ -218,6 +218,10 @@ AC_ARG_ENABLE(upower, AC_HELP_STRING([--disable-upower],
[enable_upower=${enableval}])
AM_CONDITIONAL(UPOWER, test "${enable_power}" != "no")
AC_ARG_ENABLE(mbimmodem, AC_HELP_STRING([--enable-mbimmodem],
[enable MBIM based modem support]),
[enable_mbimmodem=${enableval}])
AC_ARG_ENABLE(ell, AC_HELP_STRING([--enable-ell],
[enable support for ell]),
[enable_ell=${enableval}])
@ -230,6 +234,7 @@ if (test "${enable_ell}" = "yes"); then
AC_SUBST(ELL_LIBS)
fi
AM_CONDITIONAL(MBIMMODEM, test "${enable_ell}" != "no" && test "${enable_mbimmodem}" = "yes")
AM_CONDITIONAL(ELL, test "${enable_ell}" != "no")
AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],

View File

@ -0,0 +1,41 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
*
* 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 OFONO_API_SUBJECT_TO_CHANGE
#include <ofono/plugin.h>
#include "mbimmodem.h"
static int mbimmodem_init(void)
{
return 0;
}
static void mbimmodem_exit(void)
{
}
OFONO_PLUGIN_DEFINE(mbimmodem, "MBIM modem driver", VERSION,
OFONO_PLUGIN_PRIORITY_DEFAULT, mbimmodem_init, mbimmodem_exit)

View File

@ -0,0 +1,22 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
*
* 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
*
*/
#include "util.h"

57
drivers/mbimmodem/util.h Normal file
View File

@ -0,0 +1,57 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
*
* 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
*
*/
#include <ell/ell.h>
struct cb_data {
void *cb;
void *data;
void *user;
};
static inline struct cb_data *cb_data_new(void *cb, void *data)
{
struct cb_data *ret;
ret = l_new(struct cb_data, 1);
ret->cb = cb;
ret->data = data;
ret->user = NULL;
return ret;
}
#define CALLBACK_WITH_FAILURE(cb, args...) \
do { \
struct ofono_error cb_e; \
cb_e.type = OFONO_ERROR_TYPE_FAILURE; \
cb_e.error = 0; \
\
cb(&cb_e, ##args); \
} while (0) \
#define CALLBACK_WITH_SUCCESS(f, args...) \
do { \
struct ofono_error e; \
e.type = OFONO_ERROR_TYPE_NO_ERROR; \
e.error = 0; \
f(&e, ##args); \
} while (0)