Commit Graph

677 Commits

Author SHA1 Message Date
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 ecde57eeba Fix memory leak in generic_at driver 2009-08-30 13:29:44 -05:00
Denis Kenzior 45e03f4173 Add debug to modem_create 2009-08-30 13:29:44 -05:00
Denis Kenzior 96dc40b107 Make history drivers work again 2009-08-29 10:47:26 -05:00
Denis Kenzior 789610389e Fix a problem with CtrlZ echo
When a PDU is submitted and echoed by the modem, the CtrlZ character
is also echoed back.  Fix the parser to handle this case appropriately.
2009-08-29 10:47:16 -05:00
Rémi Denis-Courmont aef72327c2 gisi: return GPRS interface index/name 2009-08-28 15:20:27 +03:00
Aki Niemi 373665cdd0 gisi: Fix indication debugging 2009-08-25 18:26:24 +03:00
Aki Niemi 74782318bd Rename all files under drivers/isimodem/ 2009-08-25 14:04:42 +03:00
Aki Niemi 4148f82e4e Fix typo in technology name 2009-08-25 10:47:19 +03:00
Marcel Holtmann 70aab2a826 Convert to fully non-recursive build system 2009-08-24 23:49:40 -07:00
Marcel Holtmann 7d3d52009d Use script to generate list of builtin plugin symbols 2009-08-24 19:05:41 -07:00
Marcel Holtmann d9a2bb1337 Use proper variables for various commands 2009-08-24 18:51:39 -07:00
Aki Niemi 70440bcd0b Add straw-man for rest of ISI modem driver 2009-08-24 15:47:17 +03:00
Rémi Denis-Courmont 484af7eec2 Fix broken dependency on include/ofono/*.h files
The fact that the directory exists does not prove that (all of) the
header file symbolic links have been created. This is particularly
annoying when a new header file gets added.
2009-08-24 13:35:54 +03:00
Aki Niemi 03d4dad98d Fix build warning 2009-08-24 13:34:53 +03:00
Aki Niemi bc71ac101f Fix typos 2009-08-24 13:14:52 +03:00
Aki Niemi 5086088458 gisi: Fix warning in g_isi_subscribe()
Save the GIsiModem instance in GIsiClient, so that calling
g_isi_subscribe() doesn't throw a warning.
2009-08-23 23:19:03 +03:00
Aki Niemi 5562438c5c Fix memory leak in ISI phonebook driver 2009-08-23 23:16:46 +03:00
Aki Niemi 197cefbba5 gisi: Add debugging hooks 2009-08-22 18:01:24 +03:00
Aki Niemi 53e575bd5c Fix memory leak in isimodem.c 2009-08-22 18:00:58 +03:00
Aki Niemi 54a6cc6253 Move dump_msg() to isi.h as static inline 2009-08-22 15:37:34 +03:00
Andrzej Zaborowski 64ade1c7c8 Fix getting the offset into sms fragment bitmap.
Otherwise only 64 fragments fit.
2009-08-21 19:46:39 -05:00
Denis Kenzior 4750081d72 Add generic_at modem driver
Useful for testing or when the device is extremely 27.007 compliant,
e.g. phonesim
2009-08-21 19:25:51 -05:00
Denis Kenzior b3e6dd8e51 Update the isi driver to the new modem driver api 2009-08-21 19:25:51 -05:00
Denis Kenzior 038251eac5 Introduce the Modem driver API 2009-08-21 19:25:51 -05:00
Denis Kenzior 6ac46cee4f Remove org.ofono.at.Manager 2009-08-21 19:25:51 -05:00
Denis Kenzior 267ae7ad6d Add CONFIGDIR automake magic 2009-08-21 19:25:51 -05:00
Denis Kenzior da5adf366a Remove unused function 2009-08-21 19:25:51 -05:00
Aki Niemi 77aa9c9621 Enable multi-modem support
This patch enables concurrent use of multiple ISI modems, e.g., all
connected via USB using cdc_phonet.
2009-08-21 16:31:17 +03:00
Aki Niemi 70e69ac452 Enable multiple instances of phonebook driver 2009-08-21 16:30:13 +03:00
Aki Niemi f06c09d17a Enable multiple instances of devinfo driver 2009-08-21 16:29:34 +03:00
Aki Niemi 621d584b4d Move struct isi_data to private 2009-08-21 16:28:32 +03:00
Aki Niemi a42ec65274 Refactor isidevinfo
Remove storing of pending request objects to linked list;
g_isi_client_destroy() will clear those properly. Fix naming of enums,
and use DECLARE_SUCCESS() macro.
2009-08-21 10:16:42 +03:00
Aki Niemi a434d94169 Pass modem instance to phonebook driver 2009-08-21 10:06:40 +03:00
Denis Kenzior 28b9d5d747 Fix unused variable l 2009-08-20 18:20:14 -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 4fac5d1c73 Hide the ofono_modem datastructure 2009-08-20 16:58:01 -05:00
Denis Kenzior ca95c87dae Port history to the new atom API
Use __atom_foreach
2009-08-20 16:29:18 -05:00
Denis Kenzior 2fea7be017 Add __ofono_modem_foreach_atom function 2009-08-20 15:59:50 -05:00
Denis Kenzior b8589c7cdf Fix unused variable modem 2009-08-20 15:39:13 -05:00
Denis Kenzior 919aae6cd9 Fix unused function remove_all_watches 2009-08-20 15:39:13 -05:00
Denis Kenzior 6261b83dbf Fix unused variable modem 2009-08-20 15:39:13 -05:00
Denis Kenzior a81852b761 Remove unused function 2009-08-20 15:39:12 -05:00
Denis Kenzior aa9a0f6072 Remove unused function 2009-08-20 15:39:12 -05:00
Denis Kenzior ec3e0f5ce5 Fix implicit declaration of extract_bcd_number 2009-08-20 15:39:12 -05:00
Denis Kenzior 552351e252 Fix unused variable path 2009-08-20 15:39:12 -05:00
Denis Kenzior 191c521f9d Fix unused variable l 2009-08-20 15:39:12 -05:00
Denis Kenzior ba851568f5 Fix unused variable pbd 2009-08-20 15:39:12 -05:00
Denis Kenzior 92e373f1c2 Fix return with no value warning 2009-08-20 15:39:12 -05:00
Denis Kenzior fa330cafbd Fix a bunch of warnings about mixed signedness 2009-08-20 15:39:12 -05:00