Some modems are able to handle some proactive commands in their
firmware or otherwise, if the command doesn't require input from user.
Nevertheles ofono may need to update internal state or notify the user
where necessary. With this api the driver can notify core that a
command is being executed in the modem or that a command is finished
executing and the TERMINAL RESPONSE has been sent to SIM. It would
also be possible for a driver to handle a command.
EFiidf can be larger than 256 bytes, so allow callers to read
portions of the EFiidf from a specified offset. Cache EFiidf
files as blocks of 256 bytes so that it's not necessary to
read the entire (potentially large) file.
This patch fixes problem for modems that cannot terminate
DIALING/ALERTING calls with CHUP=1X. The main change is that
voicecall driver's hangup function is split into the functions
hangup_all and hangup_active.
Changes:
- In cases where hangup previously was used, hangup_all is used
if implemented otherwise hangup_active is used.
- Call in state DIALING/ALERTING is released with hangup_active if
implemented.
- manager_hangup_all will simply call hangup_all if implemented.
- manager_hangup_all will release calls in state
ALERTING/DIALING/INCOMING using hangup_active otherwise
release_specific.
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.
Adding a new notify function in the netreg atom for notifying a
received Network Identification and Timezone (NITZ) indication. This
data is consumed via a nettime plugin, of which there is also an
example.
Add ofono_sim_inserted_notify function to notify the core of SIM
insertion / removal.
Make every plugin generate a sim inserted event on start. For devices
with removable card, the event should be emitted after the
plugin detects such event. For devices that need to wait for SIM card
initialization, they can emit this event later.
We no longer expose lac/ci/tech attributes obtained from CGREG
(some modems, like ISI, do not even report them for GPRS separately).
Simplify the internal gprs driver api to only report the registration
status (e.g. home, roaming, searching, not registered, etc)
- Rename to cphs_service_table to be more inline with the specification.
- Since the spec allows arbitrary length service tables, use an unsigned
char * return instead of a short.
- Use bit_field function instead of defining an enum
A field 'mpty' is added to ofono_call so that we can know
whether the call belongs to multiparty call or not. According
to 27.007 7.18, it is a defined return value of AT+CLCC.
Split up GPRS into two atoms: GPRS and GPRS Context. GPRS will handle
the areas of GPRS network registration, basic GPRS capability detection
and attach / detach.
GPRS Context will handle setting up / activating / deactivating the
indicidual contexts.
This will allow us to use the generic GPRS atom for most devices while
customizing the GPRS context accordingly.
This commit implements the GPRS context setup and teardown according to
doc/dataconnectionmanager-api.txt
One issue with the AT implementation of the api is that "Powered" (a
read-write property) can be set independently of "Attached" (read-only
property) and remain set when "Attached" is clear. The semantics would
be that the network doesn't have resources to let the modem attach,
but the modem waits for the resources to become available and then
attaches. On AT the modem is in this state only when executing +CGATT,
so currently the code will rerun +CGATT as soon as the previous one
returns with error, probably starving other commands. A possible
workaround would be for "Powered" to flip back to False after the modem
fails to attach once, or give up on having separate properties.
Alternatively we could re-try to attach periodically but on one modem
I've tried +CGATT fails after about 1 minute (that's the Calypso) and
on another only about 0.5s (Nokia phones with AT emulation).
When "Powered" is set and "RoamingAllowed" is clear and we manage to
attach and find that we're roaming, ofono resets "Powered".
We may want to catch the user trying to dial *99***1# which is the
backwards compatibility quirk for old modems (same way ofono parses
USSD strings).
Every single EF read callback checks the file type reported out of the
SIM is what it expects. Instead this should be done in one place and
the errors reported accordingly
It may be useful to have the information of whether card is currently
locked and emit events when this changes but if we want to have it as a
property, we would need properties for all types of locks and it wouldn't
be all that useful.
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
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.
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.
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.
Make this into a fully fledged entity, with a driver instead of the
current kludge. This means modem drivers can actually choose whether
to instantiate a CSSN atom or not
Move the notification functions from voicecall.c into ssn.c.
Move the cssn.h header into include/ssn.h and refactor
Update call barring to utilize ofono_ssn and use the new atom_watch
functionality to detect when ssn has been added or removed
- Move call barring related functionality out of driver.h into a
dedicated file, call-barring.h
- Update to use the new atom framework
- Remove over-reliance on the modem structure, call-barring structure
should now be used instead whenever possible