Commit Graph

260 Commits

Author SHA1 Message Date
Denis Kenzior 7dca0a7315 sim: Fix pin retries bogus values on some arch-es
On some architectures the SimManager.Retries property was getting bogus
values.  This is because we were sending an array which pointed to int
values instead of the expected unsigned char values.

This fix allocates a temporary array of unsigned chars to hold the
actual D-Bus values being sent.  Additionally, the dictionary array is
changed to point to the temporary unsigned char based values instead of
the raw 'int' based retry values.
2014-12-04 08:57:48 -06:00
Denis Kenzior 509630ea98 sim: Fix crash
ofonod[32055]: ++++++++ backtrace ++++++++
ofonod[32055]: #0  0x7f6af0ee3b30 in /lib64/libc.so.6
ofonod[32055]: #1  0x4c2466 in __ofono_watchlist_remove_item() at
src/watch.c:57
ofonod[32055]: #2  0x4b5b73 in ofono_sim_remove_spn_watch() at
src/sim.c:2715
ofonod[32055]: #3  0x497c30 in netreg_unregister() at src/network.c:1817
ofonod[32055]: #4  0x4912e1 in __ofono_atom_unregister() at
src/modem.c:277
ofonod[32055]: #5  0x491387 in flush_atoms() at src/modem.c:425
ofonod[32055]: #6  0x4b6cb8 in __ofono_sim_refresh() at src/sim.c:3154
ofonod[32055]: #7  0x4b8c41 in handle_command_refresh() at
src/stk.c:2302
ofonod[32055]: #8  0x4baf0d in
ofono_stk_proactive_command_handled_notify() at src/stk.c:3048
ofonod[32055]: #9  0x46c60f in satn_notify() at
drivers/ifxmodem/stk.c:229
ofonod[32055]: #10 0x7f6af1711455 in /usr/lib64/libglib-2.0.so.0
ofonod[32055]: #11 0x43e729 in at_chat_match_notify() at
gatchat/gatchat.c:421
ofonod[32055]: #12 0x440da8 in received_data() at gatchat/gatio.c:125
ofonod[32055]: #13 0x441834 in dispatch_sources() at
gatchat/gatmux.c:157
ofonod[32055]: #14 0x441bbd in received_data() at gatchat/gatmux.c:215
ofonod[32055]: #15 0x7f6af173dfc3 in /usr/lib64/libglib-2.0.so.0
ofonod[32055]: #16 0x7f6af16ef065 in /usr/lib64/libglib-2.0.so.0
ofonod[32055]: #17 0x7f6af16efd0f in /usr/lib64/libglib-2.0.so.0
ofonod[32055]: #18 0x7f6af16efef9 in /usr/lib64/libglib-2.0.so.0
ofonod[32055]: #19 0x7f6af16f032f in /usr/lib64/libglib-2.0.so.0
ofonod[32055]: #20 0x48f5f8 in main() at src/main.c:249
ofonod[32055]: #21 0x7f6af0ed04bd in /lib64/libc.so.6
ofonod[32055]: +++++++++++++++++++++++++++
2012-11-28 10:31:14 -06:00
Denis Kenzior 00b37a5e64 sim: Fix crash
When modem is brought online, then sim removed and re-inserted.  We
crash when going online again due to the spn related data-structures not
being initialized properly
2012-11-28 10:31:14 -06:00
Denis Kenzior 736f44e0d3 sim: Read icons with a full SIM/USIM path 2012-11-23 07:22:25 -06:00
Denis Kenzior 19210edd3a sim: Update to the new sim reading API 2012-11-22 10:26:34 -06:00
Denis Kenzior b97e79b3df sim: Fix SIM re-init case of SIM Refresh
When the SIM is being refreshed, we try to access the SIM too fast after
the SIM REFRESH proactive command is received.  Instead set the sim atom
into the 'RESETTING' state and wait until the modem driver signals the
sim insertion again.
2012-11-22 06:50:08 -06:00
Denis Kenzior 454ca9f40e sim: destroy spn info as part of sim main state 2012-11-22 06:50:08 -06:00
August Mayer 22c0738981 sim: implement function to get password type 2012-08-16 00:59:18 -05:00
Marcel Holtmann 674cb0d167 sim: Add extra errors for EFmsisdn and EFad length mismatches 2012-06-25 00:00:45 -07:00
Denis Kenzior 72ce19bf3e sim: Fix use of uninitialized values
In the case of an error, sim_pin_query_cb should not assume the
pin_type value is valid.
2012-06-19 12:59:42 -05:00
Denis Kenzior d69269b77f sim: Don't re-init the SIM needlessly
When calling ChangePin with the wrong original PIN, we're still left in
the READY state.  Do not re-initialize the SIM needlessly in this case.
2012-06-19 12:54:37 -05:00
Denis Kenzior bc38ef91cd sim: Allow IMSI to be obtained via EF reads 2012-06-17 08:01:04 -05:00
Denis Kenzior e0e6e2c439 sim: Revert adding special callback for EFiccid
This reverts commit 1960dbbc79.
2012-06-16 09:50:05 -05:00
Denis Kenzior a8247d17af sim: Revert adding special callback for EFmsisdn
This reverts commit c3124b66d9.
2012-06-16 09:50:05 -05:00
Denis Kenzior bee063dd76 sim: Revert adding special callback for EFad
This reverts commit 5522df64fa.
2012-06-16 09:50:05 -05:00
Marcel Holtmann 5522df64fa sim: Add special callback for reading MCC and MNC value 2012-06-16 21:30:28 -07:00
Marcel Holtmann c3124b66d9 sim: Add special callback for reading MSISDN value 2012-06-16 20:52:18 -07:00
Marcel Holtmann 1960dbbc79 sim: Add special callback for reading ICCID value 2012-06-16 20:22:30 -07:00
Marcel Holtmann 10297b153a sim: Use ofono_bool_t instead of gboolean 2012-06-16 20:08:10 -07:00
Lucas De Marchi e0d6f9f0ce Do not set signature and reply in GDBus tables
Use GDBUS_* macros, so signature and reply fields are not set in each
method/signal.
2012-05-20 02:47:57 -07:00
Lucas De Marchi b3489f2ee8 Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their
own vector.
2012-05-20 02:47:57 -07:00
Henrique Dante de Almeida 924ee02ff7 Constify GDBus signal tables
Constify signal tables with the following command:

    find . -name '*.[ch]' -exec \
             sed -i 's/\(GDBusSignalTable .* =\)/const \1/g' {} \;
2012-05-20 02:47:56 -07:00
Henrique Dante de Almeida 63bbdebdf2 Constify GDBus method tables
Constify method tables with the following command:

find . -name '*.[ch]' -exec \
             sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
2012-05-20 02:47:56 -07:00
Denis Kenzior a51004d4f7 sim: Fix crash due to uninitialized spn_watch 2012-02-01 20:12:51 -06:00
Oleg Zhurakivskyy bdf5939520 sim: Make SPN change atomic for consumers
Due to new spn watch semantics, ofono_sim_get_spn()
will report the absence of SPN while reading it,
which is probably incorrect.
2012-01-23 10:27:54 -06:00
Oleg Zhurakivskyy 810bd2aa2e sim: Add ofono_sim_get_spn() implementation 2012-01-18 10:42:59 -06:00
Oleg Zhurakivskyy ef658e92f3 sim: Add SPN watch capability 2012-01-15 19:55:58 -06:00
Oleg Zhurakivskyy 3272397ad9 sim: Minor style fixes 2012-01-15 19:36:23 -06:00
Jussi Kukkonen d9a76824ba sim: fix "network" is pin type for "networkpuk" 2012-01-01 18:17:36 -06:00
Denis Kenzior d1d674004f sim: Fix not creating simfs context in some cases 2011-12-26 18:03:40 -06:00
Denis Kenzior 748259a275 sim: Add __ofono_sim_cphs_service_available 2011-12-16 09:45:31 -06:00
Denis Kenzior 7f18695f46 sim: Reset additional state info
We were not resetting 3GPP and CPHS phase information as well as the
CPHS service table entries on sim removal / reset.
2011-12-16 09:44:10 -06:00
Marcel Holtmann 7e6afe37bf core: Update copyright information 2011-10-10 13:39:42 -07:00
Denis Kenzior c6c01110ec sim: Support SIM_STATE_LOCKED_OUT 2011-07-19 14:20:09 -05:00
Denis Kenzior 4adc4a728d sim: Break out state notification into own method 2011-07-19 14:10:17 -05:00
Denis Kenzior 3c82e9b9cc sim: Make sure only PINs can be sent to EnterPin 2011-06-02 15:56:18 -05:00
Denis Kenzior b1f4e981f4 sim: Fix potential use of uninitialized variable
In certain circumstances, when the image has been cached but EFimg has
not been read yet, we might end up accessing an unitialized variable.
Fix this by always failing if EFimg has not been read yet.
2011-05-08 23:27:17 -05:00
Frédéric Danis e7e6ce9983 sim: add +CNUM support for HFP emulator 2011-03-31 14:29:39 -05:00
Denis Kenzior 788a91402e sim: Handle an error condition better 2011-03-15 20:51:28 -05:00
Andrzej Zaborowski 9c2af56c18 sim: Watch for changes to EFimg files and EFiidf 2011-03-15 20:20:59 -05:00
Andrzej Zaborowski f2a82b8e8d sim: Watch for changes to EFmsisdn and EFsdn 2011-03-15 20:20:25 -05:00
Andrzej Zaborowski 0550553c87 sim: Split out sim context into early and main
And watch for relevant file changes on the early context.
2011-03-15 20:11:33 -05:00
Denis Kenzior 05c378bae9 sim: Document fall through case in switchcase 2011-02-25 11:53:10 -06:00
Jussi Kangas c5b321e768 sim: Expose the __ofono_sim_recheck_pin API 2011-02-25 11:51:18 -06:00
Jussi Kangas 9007bf6392 sim: Do not teardown SIM state when PIN2 is asked
We should not tear down the SIM state if PIN2 is being asked for, or if
PIN2 is blocked and PUK2 is being asked.

We also want to continue with SIM initialization if the modem requires
PIN2 / PUK2 for some reason.
2011-02-25 11:47:23 -06:00
Denis Kenzior e8553f5337 sim: Check for SIM lockout condition
When a user tries to lock/unlock/change a PIN and enters it wrongly
several times, it is possible to lock themselves out.  In this case we
should drop to a pre-sim state, wait for the user to enter the PUK and
re-init the sim.
2011-02-18 11:28:43 -06:00
Denis Kenzior 5543d935c5 sim: Move stuff around and remove forward decl 2011-02-18 11:28:43 -06:00
Denis Kenzior 5d626b6967 sim: move stuff around 2011-02-18 11:28:43 -06:00
Denis Kenzior ad181b690b sim: Tweak the behavior of sim_refresh slightly
Instead of notifying everyone of sim_inserted condition, we should
simply notify the modem directly.  It is the only one interested in this
particular change.

This partly reverts an earlier commit:
9498ad6b5633e350eb529f8efbe08270d95c8003
2011-02-17 15:09:16 -06:00
Andrzej Zaborowski 131d86a2f9 sim: Implement basic Refresh 2011-02-17 15:09:16 -06:00