Commit Graph

1347 Commits

Author SHA1 Message Date
Paulo Borges 2e9cb14e26 hfp: Move HFP versions definitions to hfp.h
hfp.h should store all HFP related definitions.
2013-04-18 08:43:21 -05:00
Vinicius Costa Gomes df1f9bf730 hfpmodem: Send AT+BAC with the supported codecs
Before, the AT+BAC command was being sent with fixed information,
now we send the command (that inform the AG of the codecs supported by
the HF) with the codecs supported by the registered Handsfree Audio
Agent.
2013-04-09 14:33:41 -05:00
Denis Kenzior b18963af33 drivers: Include hfp.h 2013-04-09 14:33:41 -05:00
Anthony Viallard 8650c1019a sim: Add SIMCOM SIM card ready quirk
SIM is busy right after pin is entered. Use the quirk which
add a CPIN? pooling check until having "CPIN: READY" answer.
2013-04-01 21:38:26 -05:00
Claudio Takahasi 0772fda92e hfpmodem: Fix segfault in CIEV GAtChat callback
This patch fixes segmentation fault when the network registration
watch is called without being initialized. CIEV GAtChat callback can
be called before ofono_netreg_register().

==15101== Invalid read of size 8
==15101==    at 0x492B56: ofono_netreg_register (network.c:2073)
==15101==    by 0x47245E: hfp_netreg_probe (network-registration.c:311)
==15101==    by 0x492A8D: ofono_netreg_create (network.c:1881)
==15101==    by 0x4849D5: hfp_pre_sim (hfp_hf_bluez5.c:288)
==15101==    by 0x48C486: ofono_modem_set_powered (modem.c:1194)
==15101==    by 0x484E9D: slc_established (hfp_hf_bluez5.c:85)
==15101==    by 0x4702AD: chld_cb (slc.c:147)
==15101==    by 0x440457: at_chat_finish_command (gatchat.c:461)
==15101==    by 0x44109F: new_bytes (gatchat.c:532)
==15101==    by 0x4433B7: received_data (gatio.c:122)
==15101==    by 0x3CBAA47824: g_main_context_dispatch (gmain.c:2539)
==15101==    by 0x3CBAA47B57: g_main_context_iterate.isra.23
(gmain.c:3146)
==15101==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
2013-02-21 17:09:54 -06:00
Denis Kenzior 2fa7a4a66e netreg: Fix broken CMER behavior on MBM 2013-01-21 10:23:34 -06:00
Denis Kenzior b9782fedfc hfpmodem: Add comment for previous commit 2013-01-21 09:41:54 -06:00
Mikel Astiz 843bd71169 hfpmodem: Fix release-and-swap without +CIEV
Some phones do not send the corresponding call state update (+CIEV)
after a successful release-and-swap operation (AT+CHLD=1).

This has been observed with a Nokia 500, while testing ReleaseAndSwap()
while an active and a held call exist:

ofonod[20414]: > AT+CLCC\r
ofonod[20414]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n
ofonod[20414]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n
ofonod[20414]: < \r\nOK\r\n
ofonod[20414]: > AT+CHLD=1\r
ofonod[20414]: < \r\nOK\r\n

After this, no +CIEV is received, but the call has been hung up.

The proposed approach to solve this consists of using AT+CLCC, unless
a call release has been received within a specific time period.

The result fixes the problem as can be seen below:

ofonod[20847]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n
ofonod[20847]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: > AT+CHLD=1\r
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: > AT+CLCC\r
ofonod[20847]: < \r\n+CLCC: 1,0,0,0,0,"<number1>",145\r\n
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: < \r\n+CIEV: 5,2\r\n
ofonod[20847]: < \r\n+CIEV: 5,0\r\n
2013-01-21 09:41:54 -06:00
Mikel Astiz cbb784e734 hfpmodem: Avoid transitional voicecall states
While processing the result of AT+CLCC, process the differences in a way
that disconnections are reported first, then call state changes and
finally new calls.

The goal is to avoid unnecessary transitional states such as two active
calls existing at the same time.
2013-01-21 09:41:54 -06:00
Mikel Astiz 9726e50d82 hfpmodem: Refactor voicecall notify with foreach
Define a helper function in order to use foreach statements when
ofono_voicecall_notify() needs to be called.
2013-01-21 09:41:54 -06:00
Vinicius Costa Gomes a419432c0f hfpmodem: Add support for sending the supported codecs
Right now, only the mandatory CVSD codec is supported. The mSBC
mandatory codec is "temporarily" not supported.

The spec alows this, HFP 1.6 Spec Section 4.34.1 page 92: "If wide band
speech is supported then the mandatory codec (mSBC) shall be included
unless it is temporarily unavailable."
2013-01-17 11:21:16 -06:00
Vinicius Costa Gomes f09a57d799 hfpmodem: Add version defines for HFP 1.6 2013-01-17 11:21:16 -06:00
Denis Kenzior b67e68e753 sim: Fix whitespace violation 2013-01-15 12:16:08 -06:00
Christopher Vogl 404f2e3cb9 sim: return from cpin when sim ready for telit
Especially for Telit HE910 it is not enough to wait for
entering a PIN code.
If we do not wait for #QSS: 3, subsequent commands,
like +CMER will report SIM BUSY and the network registration
atom will be removed as a consequence.
2012-12-17 09:50:22 -06:00
Daniel Wagner 79453f3284 atutil: Remove unused macro
With commit 6ee21a3fc1
the usage DECLARE_FAILURE was removed.
2012-12-17 09:50:22 -06:00
Denis Kenzior fb1d1c3426 hfp: use ofono_handsfree_battchg_notify 2012-12-17 09:50:22 -06:00
Mingli Wu 911eeb6565 atmodem: remove pending idle callbacks at removal
If device probe and removal happen in short succession, it's possible
that the idle handler registered in the probe function doesn't run before
the device is removed.  In this case, the idle handler needs to be
unregistered so that it does not run and try to access the data that's
destroyed during the removal.
2012-12-04 23:48:14 -06:00
Denis Kenzior 25e7ecd3c7 atmodem: Re-work the CBS driver
We might have mis-interpreted how 27.007 intends for CBS to work.  After
studying the implementation notes of the IMC 6260 modem, the spec intent
made a little bit more sense.
2012-12-04 23:47:58 -06:00
Marcel Holtmann 788922cbdf qmi: Include persistent device configuration service 2012-12-04 05:42:14 +01:00
Marcel Holtmann 15f309742c qmi: Print service number if name is not known 2012-12-01 21:37:22 +01:00
Denis Kenzior 68df0eb758 ifx: Fix the case of modem-originated call
During STK Set Up Call, we have modem-originated calls that do not go
through the core 'Dial' method.  Make sure the calls are still detected
in this case.
2012-11-28 10:31:15 -06:00
Denis Kenzior b26f7c73d3 atmodem: For IFX XSIMSTATE 7 should never occur
in the case of a PIN entry, XSIMSTATE of 7 (Ready to Attach) should
never occur
2012-11-28 10:31:14 -06:00
Marcel Holtmann 076abafb03 qmimodem: Fix reporting of PIN or PUK states 2012-11-27 23:31:52 +01:00
Denis Kenzior 2528b74491 atmodem: Always quote data in CRSM write operations 2012-11-23 07:22:25 -06:00
Denis Kenzior 291f4e0bb0 atmodem: Support CRSM with paths
For GET STATUS and READ BINARY variations, support appending of the
optional path in the CRSM command
2012-11-23 07:22:25 -06:00
Marcel Holtmann 67670a659f qmimodem: Add support for UIM service handling 2012-11-25 20:11:29 +01:00
Marcel Holtmann 56e4798e1e qmimodem: Print error string instead of code if available 2012-11-25 10:19:40 +01:00
Marcel Holtmann 9b4d69cf8d qmimodem: Pretty print service name in debug logs 2012-11-25 00:05:54 +01:00
Marcel Holtmann 535e16c8a4 qmimodem: Fix debug printing of messages 2012-11-25 00:05:15 +01:00
Marcel Holtmann 7feb9e2711 qmimodem: Add helper for error message strings 2012-11-25 00:04:14 +01:00
Denis Kenzior 57692483a9 atmodem: Update sim driver to the new api 2012-11-22 10:26:34 -06:00
Denis Kenzior 180f91f6c9 qmi: Update sim-legacy driver to the new API 2012-11-22 10:26:34 -06:00
Denis Kenzior d32c6451bd isi: Update UICC driver to the new API 2012-11-22 10:26:34 -06:00
Denis Kenzior 6451d012ec isimodem: Update sim driver to the new API 2012-11-22 10:26:34 -06:00
Marcel Holtmann 48a5fec5cc atmodem: Monitor IFX technology and band changes 2012-11-23 16:20:15 +01:00
Cedric Jehasse b728a02981 atmodem: add PIN retry count for Alcatel modems 2012-11-15 12:31:06 -06:00
Cedric Jehasse 5f9c1e9e34 atmodem: Poll SIM state after entering PIN
Encountered a problem of CME ERROR 14: SIM busy on Alcatel and Huawei modem.
The Huawei modem has a ^SIMST unsollicited sim state indication, but not all
Huawei modems support this.
So poll the SIM state, as was already done for ZTE modems.
2012-11-12 13:30:38 -06:00
Cedric Jehasse 0f242c9714 atmodem: Add ALCATEL vendor 2012-11-12 13:30:13 -06:00
Holger Hans Peter Freyther 2b9b1ae6d3 sim: Fix the quirk handling of CPIN for Wavecom
The Wavecom Q2XXX support broke in commit 72ce19bf3e.
This is because at_cpin_cb called decode_at_error with final and not
with OK. This lead to an error being set in the error variable and the
new code returns early when an error is set.

The addition of the terminator in at_sim_probe for Wavecom broke in
git commit ac524be99f because
terminators can not be added on cloned chats.

Move the addition of the terminator from the atmodem to the wavecom
plugin. Use the same terminator for Q2XXX and the normal Wavecom
class. The WAVECOM terminator has been tested on a Q2XXX modem.

Apply the CPIN quirk for both WAVECOM and WAVECOM_Q2XXX inside the
sim.c file. Introduce needs_wavecom_sim_quirk to handle it for
WAVECOM and WAVECOM_Q2XXX.
2012-11-01 04:56:51 -05:00
Denis Kenzior bddfb9bfc5 isimodem: Fix style issues in previous commit 2012-09-11 23:30:25 -05:00
Jarko Poutiainen dc2dc41bcf isimodem: voicecall answer fix for Nemo on N9
Voicecall answering in Mer/Nemomobile run on Nokia N9 will fail
unless call id is passed to modem.
2012-09-11 23:29:43 -05:00
Denis Kenzior b274e74102 netreg: Remove netreg atom in case init fails 2012-09-11 23:21:48 -05:00
Denis Kenzior bb0f308223 netreg: Don't register for CIEV twice 2012-09-11 23:20:53 -05:00
Christopher Vogl edbf04cded netreg: Add telit version for ciev notification 2012-09-11 23:16:32 -05:00
Christopher Vogl b87619a43a netreg: Query and select supported CMER modes 2012-09-11 22:54:43 -05:00
Philippe Nunes 006a37cdf8 atmodem: specify class for call barring query
class is specified when querying the call barring status if
the class is not the default (7 - voice, data and fax)
2012-09-05 15:04:18 -05:00
Christopher Vogl 90c7bdfc8d sim: return from CPIN when SIM unlocked for telit
Only return from CPIN when the modem informs that the SIM is ready
2012-08-22 18:44:18 -05:00
August Mayer 4293e4ea63 gprs: data bearer for telit with PSNT
Telit neither supports '+CPSB' nor reports the data bearer through
'+CGREG'. It has its own +PSNT command.
2012-08-16 01:10:56 -05:00
Denis Kenzior b264440737 sim: Minor formatting nitpicks 2012-08-16 01:05:54 -05:00
Denis Kenzior aec21db6cb sim: Fix warning
drivers/atmodem/sim.c: In function ‘at_pct_cb’:
drivers/atmodem/sim.c:872:2: error: ISO C90 forbids mixed declarations
and code
2012-08-16 01:05:46 -05:00
August Mayer ee8ba6f2ff sim: support PIN retry counters for telit modems 2012-08-16 01:00:28 -05:00
Christopher Vogl 76ccb73063 gprs-context: print reason for ppp disconnect 2012-08-13 08:38:30 -05:00
Guillaume Zajac 79b6fd4b24 gprs-context: Add new driver entry definition 2012-07-15 20:05:23 -05:00
Marcel Holtmann dd3db6f6bd qmimodem: Avoid shadowing length parameter 2012-07-15 20:16:59 -03:00
Marcel Holtmann 3be98b5b97 isimodem: Avoid shadowing variables 2012-07-15 20:14:12 -03:00
Denis Kenzior 2e51814f32 ifx: Add CSSI and CSSU support 2012-07-12 14:12:55 -05:00
Denis Kenzior 05bf01991d qmi: fix whitespace 2012-06-24 17:40:59 -05:00
Marcel Holtmann 1c20ec6c16 modem: Add skeleton for USSD support 2012-06-25 20:24:33 -07:00
Marcel Holtmann 71f6d63859 qmimodem: Add skeleton for voice call support 2012-06-25 12:11:08 -07:00
Marcel Holtmann a04341cdb6 qmimodem: Make sure all service destroy functions are called 2012-06-25 10:25:03 -07:00
Marcel Holtmann a41b7a246b qmimodem: Add support for canceling all service requests 2012-06-25 10:20:08 -07:00
Marcel Holtmann 5ada27b7c1 qmimodem: Use shared DMS service for device information and SIM handling 2012-06-25 09:31:49 -07:00
Marcel Holtmann a19dc51227 qmimodem: Add support for shared services with same client id 2012-06-25 09:30:31 -07:00
Marcel Holtmann 18fb4817f7 qmimodem: Use unsigned int for notify id to make GUINT_TO_POINTER happy 2012-06-25 01:57:15 -07:00
Marcel Holtmann 8f2549416a qmimodem: Use unsigned int for tid to make GUINT_TO_POINTER happy 2012-06-25 01:23:14 -07:00
Marcel Holtmann 2c00dfb0fe qmimodem: Use unsigned int for hash_id to make GUINT_TO_POINTER happy 2012-06-25 01:18:48 -07:00
Marcel Holtmann 9faf249e8e swmodem: Add extra informational AT+CGCONTRDP command 2012-06-25 00:02:17 -07:00
Marcel Holtmann b168c0f953 qmimodem: Add support for unregister of individual notifications 2012-06-24 23:31:49 -07:00
Marcel Holtmann 29067f75bc qmimodem: Add support for canceling service requests 2012-06-24 23:20:25 -07:00
Marcel Holtmann d4d639f40e qmimodem: Add skeleton for radio settings support 2012-06-24 22:56:27 -07:00
Marcel Holtmann 1631d21e35 qmimodem: Return transaction identifier from service requests 2012-06-24 22:38:26 -07:00
Marcel Holtmann 74d208768a qmimodem: Add helper function for accessing 64-bit integers 2012-06-24 22:24:56 -07:00
Marcel Holtmann 797f3a502e qmimodem: Add common constants for GSM, UMTS and LTE bands 2012-06-24 22:21:39 -07:00
Marcel Holtmann 8c590a85c2 qmimodem: Add support for SMS handling 2012-06-22 13:20:11 -07:00
Marcel Holtmann c958378d6c qmimodem: Add support for GPS location reporting 2012-06-21 21:08:31 -07:00
Marcel Holtmann b12dad8883 qmimodem: Add support for GPRS data connection handling 2012-06-21 20:47:22 -07:00
Marcel Holtmann b36bb2ee50 qmimodem: Add support for network registration handling 2012-06-21 18:44:43 -07:00
Marcel Holtmann 3a42d98623 qmimodem: Add support for legacy SIM handling 2012-06-21 17:29:16 -07:00
Marcel Holtmann ad20ea12c5 qmimodem: Add support for device information handling 2012-06-21 16:07:59 -07:00
Marcel Holtmann 0e6fc7aee4 qmimodem: Add support for QMI control point handling 2012-06-21 15:18:36 -07:00
Denis Kenzior b6588a9e9e sms: Constify isimodem driver submit method 2012-06-16 09:50:05 -05:00
Denis Kenzior b947ee702b sms: Constify atmodem driver submit method 2012-06-16 09:50:05 -05:00
Pablo Neira Ayuso 78637b130d sim: Quirk Wavecom Q2XXX CPIN behavior 2012-05-31 09:48:12 -05:00
Pablo Neira Ayuso 535ff69ded sms: Handle quirky Wavecom Q2XXX CPMS syntax 2012-05-30 00:03:10 -05:00
Pablo Neira Ayuso 1ccecfe01e sim: Handle quirky CPIN of Wavecom Q2XXX 2012-05-30 00:03:10 -05:00
Pablo Neira Ayuso 88b7e73ffb drivers: add quirk for Wavecom Q2403/Q2686 modems
The existing wavecom driver in tree slightly differs from these
modems. Thus, it doesn't work work with them. We (the osmocom
team) use these Wavecom Q2403/Q2686 modems in our testbed.
2012-05-30 00:03:10 -05:00
Marcel Holtmann 85d43570fd build: Add skeleton for Qualcomm QMI modem driver 2012-05-27 10:13:55 +02:00
Marcel Holtmann ec4ba8a6fc atmodem: Enable Icera radio access technology updates 2012-05-26 16:15:34 +02:00
Marcel Holtmann 3f191c3397 huaweimodem: Use network interface from modem for GPRS context 2012-05-26 09:48:25 +02:00
Marcel Holtmann a589766884 iceramodem: Read supported bands as part of radio settings 2012-05-25 20:54:21 +02:00
Marcel Holtmann 2c2871cd9e atmodem: Fix parsing of Icera network state updates 2012-05-25 14:46:41 +02:00
Marcel Holtmann 1698d720ce atmodem: Add support for Icera PIN retry counters 2012-05-25 14:32:28 +02:00
Marcel Holtmann f29aab2515 iceramodem: Handle context deactivation responses 2012-05-25 12:55:08 +02:00
Marcel Holtmann 6afa4434b7 iceramodem: Add support special radio settings handling 2012-05-25 10:32:33 +02:00
Marcel Holtmann 119b4434b4 atmodem: Add support for Icera network status updates 2012-05-24 05:00:01 +02:00
Marcel Holtmann a96422cd50 atmodem: Add support for Icera network time handling 2012-05-24 04:58:35 +02:00
Marcel Holtmann 19e7437c46 atmodem: Icera devices don't support SMS ACK PDUs either 2012-05-24 03:54:29 +02:00
Marcel Holtmann 1f9f161e0b atmodem: Fix issue with AT+CREG=? and AT+CGREG=? handling
Some modems might see an interim +CREG: or +CGREG: notification when
querying the supported modes.

  Aux: > AT+CFUN=1\r
  Aux: < \r\nOK\r\n
  Aux: > AT+CREG=?\r
  Aux: < \r\n+CREG: 2\r\n
  Aux: < \r\n+CREG: (0-2)\r\nOK\r\n
  Unable to initialize Network Registration

To make this work, skip to the first line with an actual range value.
2012-05-24 03:28:50 +02:00
Marcel Holtmann 9b288f92f8 iceramodem: Add special GPRS context driver 2012-05-22 12:05:24 +02:00
Marcel Holtmann 929c529716 atmodem: The Icera modem does not support CIND reporting 2012-05-22 12:03:00 +02:00