Commit Graph

35 Commits

Author SHA1 Message Date
Giacinto Cifelli 13467d5dcb include: add ofono_modem_set_powered_timeout_hint
function to set the powered timeout for those cases where a device might
require longer time to boot (uncommon).

The function is effective if called before Powered=true,
so it is best called by modem detection logic and prior to calling
ofono_modem_register.
2018-10-24 14:26:59 -05:00
Slava Monich 94e3275d9c include: Add ofono_modem_get_voicecall 2018-07-02 10:34:25 -05:00
Slava Monich fa670ad295 include: Add ofono_modem_get_gprs 2018-04-27 11:13:19 -05:00
Slava Monich 6cd169b05b include: Add ofono_modem_get_sim 2017-10-05 11:22:49 -05:00
Denis Kenzior 47b24507fc include: Add ofono_modem_find 2013-02-14 08:47:10 -06:00
Denis Kenzior b73a6c4f87 include: Add TEST modem type 2012-11-02 14:02:26 -05:00
Denis Kenzior 6c7cf451a4 modem: Conform to coding style item M9 2012-06-16 09:50:05 -05:00
Marcel Holtmann 67c6a01d46 modem: Add function for setting new driver type 2012-06-17 00:58:08 -07:00
Daniel Wagner 768dfc6e3f include: Add modem type to modem.h 2011-11-22 20:34:45 -06:00
Marcel Holtmann 7e6afe37bf core: Update copyright information 2011-10-10 13:39:42 -07:00
Jeevaka Badrappan c7c45cf4ef include: add ofono_modem_get_emergency_mode api 2011-04-04 23:36:49 -05:00
Gustavo F. Padovan ab53869a8a modem: add ofono_modem_reset() to modem.h 2010-12-07 12:16:20 -06:00
Denis Kenzior cfa956596c modem: Add ofono_modem_is_registered 2010-10-25 16:32:49 -05:00
Denis Kenzior ad8607994f modem: Be consistent when naming callback typedefs 2010-08-12 15:46:46 -05:00
Marcel Holtmann 236f3acc0f Add support for Features property on modem interface 2010-06-09 20:46:10 -07:00
Pekka Pessi 8001338da7 Use ofono_bool_t instead of bool in modem API. 2010-05-27 13:01:06 -05:00
Denis Kenzior e7529bfa70 Fix: minor style issues 2010-05-26 21:03:12 -05:00
Pekka Pessi 4f1506ba25 Add: Online property to modem
The online/offline state is changed with the new set_online() modem driver
method.

In order to track atoms, there are modem states as follows:
- OFONO_MODEM_STATE_POWER_OFF
- OFONO_MODEM_STATE_PRE_SIM
- OFONO_MODEM_STATE_OFFLINE
- OFONO_MODEM_STATE_ONLINE

Atoms are added with driver methods pre_sim(), post_sim() and post_online().
Atoms are removed by modem core when the state changes.
2010-05-26 14:24:11 -05:00
Denis Kenzior d87f285fdf Add support for modem names 2010-02-12 18:29:41 -06:00
Denis Kenzior 1b5c314f9a Refactor: Allow persisent modem names 2010-01-06 15:50:25 -06:00
Marcel Holtmann 144080e749 Update copyright information 2010-01-01 17:00:10 -08:00
Denis Kenzior 0698fc2788 Split populate modem driver method
Introduce two new methods
	- pre_sim - SIM is not inserted or locked.  This should populate
	  the modem with atoms that can be used without the SIM.
	  Generally this is the devinfo atom, the sim atom and the voice
	  call atom (emergency calls only)
	- post_sim - SIM is ready.  This method should populate the
	  modem with the remaining atoms
2009-09-17 10:14:02 -05:00
Marcel Holtmann 154102e873 Add modem properties for booleans 2009-09-08 09:12:19 +02:00
Denis Kenzior 7a95c41fab Get rid of node argument in ofono_modem_create 2009-09-02 17:39:23 -05:00
Denis Kenzior 8e62522575 Add modem property capability
Add ofono_modem_set_string & ofono_modem_get_string
Add ofono_modem_set_integer & ofono_modem_get_integer
2009-09-02 17:39:23 -05:00
Denis Kenzior 7ff85d9737 populate should return void 2009-09-01 22:29:02 -05:00
Denis Kenzior 9caa606bcc Make remove functions not return anything 2009-09-01 22:27:08 -05:00
Denis Kenzior 9967c407fa Reformat comments a little 2009-08-30 15:32:08 -05:00
Andres Salomon 34b73ace78 driver callback naming
On Sun, 30 Aug 2009 13:45:45 -0500
Denis Kenzior <denkenz@gmail.com> wrote:

> Hi Andres,
>
> > static struct ofono_modem_driver g1_driver = {
> >         .name = "HTC G1",
> >         .probe = g1_probe,
> >         .enable = g1_enable,
> >         .disable = g1_disable,
> >         .remove = g1_remove,
> >         .populate = g1_populate,
> > };
> >
>
> So the current intention:
> .probe - Detect whether device is really supported by the plugin,
> initialize any data structures specific to the device
> .remove - Destroy data structures
> .enable - Perform power up
> .disable - Perform power down
> .populate - Populate the atoms supported by this device (e.g. netreg,
> voicecall, etc)  This is called by the core after every power cycle,
> when the device is brought up.
>

Thanks!  See patch below.

> >
> > Of course, I'm also wondering why there needs to be two separate
> > layers of calls in the first place.  Why not have drivers register
> > everything from within probe, call ofono_set_powered(modem, TRUE)
> > once the device is ready, and be done with it?
>
> The reason for this is e.g. airplane mode, where you physically want
> to turn off the device.  Another case is for battery / power reasons,
> e.g. a netbook with a USB modem that is not being used.
>

Fair enough.  In the kernel, we have callbacks named suspend/resume
to handle that.

> > The only reason why this doesn't blow up in the generic_at plugin is
> > because the driver_data is leaked.  If one were to free it from
> > generic_at_exit in the wrong place (since it's allocated from
> > generic_at_init, it would make sense to free it in generic_at_exit),
> > one would see the same SEGV/SIGBUS/SIGILL errors upon ctrl-c.
>
> So the leak has now been fixed.
>
> I think you're being unnecessarily harsh here.  To be fair, the
> generic_at driver does something like this at init:

My criticism is simply w/ the naming.  'enable'/'disable' doesn't imply
anything about power.  powerup/powerdown, poweron/poweroff,
suspend/resume would all imply power state changes (at least the latter
would be familiar to those who do kernel stuff).  Having comments that
describe what the callbacks do would also work, though.

>From 80a7b54d52201dfd7d8b590457450ae0a4f72888 Mon Sep 17 00:00:00 2001
From: Andres Salomon <dilinger@collabora.co.uk>
Date: Sun, 30 Aug 2009 15:56:16 -0400
Subject: [PATCH] Add comments to ofono_modem_driver struct

Document what all the callbacks do.
2009-08-30 15:29:59 -05:00
Denis Kenzior 038251eac5 Introduce the Modem driver API 2009-08-21 19:25:51 -05:00
Denis Kenzior e0ff90e6da Rename ofono_modem_*_userdata
Rename ofono_modem_get_userdata to ofono_modem_get_data
Rename ofono_modem_set_userdata to ofono_modem_set_data

For consistency with other drivers
2009-08-20 18:19:21 -05:00
Denis Kenzior e711b0e62a Break out device info into a separate driver
The modem info ops (Serial, Manufacturer, etc) are broken into a
separate oFono atom.  This is mainly to support a proper modem device
driver infrastructure.  As a result the data structures have been
tweaked a little.

driver.h is now empty and has been removed.
2009-08-20 12:48:29 -05:00
Denis Kenzior cb75833fc8 Rename ofono_modem_userdata 2009-07-29 16:44:16 -05:00
Denis Kenzior 4fbca244ea Make plugins use ofono_modem_get_path 2009-07-29 16:44:16 -05:00
Denis Kenzior 19eeb7f1ba Rename modem_add_interface / modem_remove_interface
Move to ofono_modem_add_interface, ofono_modem_remove_interface
and put in ofono/modem.h
2009-07-29 16:44:16 -05:00