Commit Graph

139 Commits

Author SHA1 Message Date
Renat Zaripov 409b0f01b6 sim: Add SIMCOM specific PIN retry handling
Use AT+SPIC for obtaining retries remaining for SIM PIN / PUK

AT+SPIC Retries Remaining to Input SIM PIN/PUK

+SPIC: <pin1>,<pin2>,<puk1>,<puk2>

Parameters
<pin1> Times remained to input chv1
<pin2> Times remained to input chv2
<puk1> Times remained to input puk1
<puk2> Times remained to input puk2
2012-02-22 04:14:16 -06:00
Guillaume Zajac 38056fdd50 atmodem: Create new sim driver without EF entries
This driver will be used by CDMA modems to support PIN
management and IMSI retreival.
EF entries for CDMA modems cannot be implemented without
manufacturers specifications.
2012-01-11 06:46:24 -06:00
Marcel Holtmann 2e0f1f79c1 atmodem: Add support for Option HSO specific PIN retry counters 2011-12-29 12:08:38 -08:00
Marcel Holtmann 4e77afffb3 drivers: Update copyright information 2011-10-10 13:39:48 -07:00
Marcel Holtmann 703d0a1237 speedup: Add support for retrieving PIN retry counters 2011-08-04 17:00:05 +02:00
Marcel Holtmann 4c8ae3f9ec atmodem: Add Speedup vendor quirk to SIM file reading 2011-08-04 15:54:26 +02:00
Marcel Holtmann 5b7d2329dc atmodem: Enable support for PIN retry counters of ZTE modems 2011-08-03 23:54:39 +02:00
Miia Leinonen 2cb3027dd6 atmodem: Add MBM vendor quirk for SIM record update 2011-03-02 22:53:35 -06:00
Jeevaka Badrappan fa96b806bd atmodem: Add pin retry count support for mbm 2011-02-01 16:36:43 +01:00
Rémi Denis-Courmont 56dfe5066b atmodem: implement standard PIN retries 2011-02-01 13:51:21 +01:00
Jeevaka Badrappan e4ef929aee atmodem: fix memory leak 2011-01-29 12:43:17 -06:00
Jeevaka Badrappan 4258fb5915 atmodem: remove NULL check 2011-01-29 18:39:37 +01:00
Marcel Holtmann 938e635ae6 atmodem: Add Sierra vendor quirk for SIM file reading 2011-01-27 15:49:32 +01:00
Lucas De Marchi b7fca84c93 atmodem: rename parameter according to header 2011-01-26 18:23:38 +01:00
Denis Kenzior 58f223da5f sim: Add a missing break statement just in case 2011-01-19 14:57:12 -06:00
Jeevaka Badrappan 508b93eecb atmodem: add ifx support for pin retry count 2011-01-19 14:57:12 -06:00
Jeevaka Badrappan d9ae1405f3 atmodem: coding style fix 2011-01-18 15:55:41 +01:00
Jeevaka Badrappan b97676acc3 atmodem: M15 coding style fix 2011-01-12 08:06:58 -08:00
Marcel Holtmann 4bab8d3ad3 atmodem: Use switch statement for vendor quirks 2011-01-10 15:35:39 -08:00
Denis Kenzior 94c104b25f sim: Fix missing return in the atmodem driver
In some circumstances it was possible to call the callback with both
failure and success
2011-01-10 16:21:16 -06:00
Denis Kenzior 55d47dcac1 sim: Prefer not using _ prefix for style reasons 2011-01-10 16:14:50 -06:00
Lucas De Marchi 5dfd568a2a atmodem: implement query for remaining pin retries
Implement query method for the remaining pin retries on huawei modem.
2011-01-10 16:08:55 -06:00
Lucas De Marchi 45f2576bb6 atmodem: check for VENDOR_HUAWEI on sim atom 2011-01-10 15:38:29 -06:00
Lucas De Marchi b82a7f8511 drivers: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-11-29 11:37:09 -06:00
Marit Henriksen a25d57531c atmodem: Remove at_pin_send_puk_cb, and use at_pin_send_cb instead.
When adding the use of pin event *EPEV also to at_pin_send_puk_cb,
it becomes identical to at_pin_send_cb, and can be removed.
2010-11-04 10:40:17 +01:00
Marcel Holtmann a917f094cb atmodem: Add SIM ready quirk for IFX when entering PUK
For the Infineon modem, also the PUK entering needs to be extended with
a quirk to wait for the SIM ready notification.
2010-10-18 15:10:05 +02:00
Marcel Holtmann 43a6ece561 atmodem: Remove workaround for SIM ready notifier removal 2010-10-15 16:07:51 +03:00
Denis Kenzior aa50067ccd sim: Use enums for EF valid / invalidated status 2010-10-15 07:25:50 -05:00
Petteri Tikander 84efadcf5a atmodem: returns file-status of SIM EF-file 2010-10-15 02:19:02 -05:00
Marcel Holtmann 3ad4e5ab21 atmodem: Update IFX specific SIM ready checking
It seems that the XSIM notification doesn't really send SIM ready
status. It sends ready to attach instead:

  > AT+CPIN="0000"\r
  < \r\nOK\r\n
  < \r\n+XLOCK: "PN",5,0,"PU",5,0,"PP",5,0,"PC",5,0,"PS",5,0\r\n
  < \r\n+XSIM: 7\r\n

So either SIM ready or ready to attach is received more to the
post_sim state.
2010-09-29 23:23:29 +09:00
Marcel Holtmann 25bb671d4e atmodem: Add special handling for Infineon SIM ready state 2010-09-25 11:32:40 +09:00
Marcel Holtmann a8d3e7433a atmodem: Remove useless NULL checks before g_free 2010-08-16 22:02:01 +02:00
Denis Kenzior ac524be99f atmodem: Use g_at_chat_clone 2010-08-12 16:40:40 -05:00
Andrzej Zaborowski 79372d26f5 atmodem: Make sim operations return sim error codes. 2010-07-08 14:27:33 -05:00
Andrzej Zaborowski b450efafec atmodem: Don't unregister *EPEV in *EPEV handler.
Handlers are called when looping over the unsolicited responses hash,
registering or unregistering modifies that hash and confuses glib.
2010-06-29 13:59:13 -05:00
Denis Kenzior 681aaef1ab atmodem: Use a switch/case in sim.c 2010-06-18 14:24:18 -05:00
Andrzej Zaborowski a2dc7dfee0 atmodem: Add PIN entry quirk for mbm.
Wait for *EPEV unsolicited response after PIN entered, otherwise the
next AT+CPIN? query still returns the old value for a fraction of a
second and ofono gets stuck until the next PIN entry attempt.
2010-06-18 14:14:39 -05:00
Marcel Holtmann f566935f7a Fix memory leak introduced by HSO quirk 2010-06-13 11:46:29 +02:00
Marcel Holtmann 66c50b6a72 Add nasty quirk to allow HSO devices to read network code length
The AT+CRSM=192 commands are failing on HSO devices and thus it might
be needed to return its details from a predefined database. Start with
testing this for reading the network code length.
2010-06-13 08:10:13 +02:00
Marcel Holtmann 88d083c4fd Coding style fix for the PIN type table 2010-06-09 18:23:05 -07:00
Andrzej Zaborowski 5e11442ef7 atmodem: Pass allowed response prefixes to gatchat
Not doing this creates a race condition where any notification
comming in in the middle of a sequence of commands may be counted
as a response to one of the commands and get lost.
2010-05-12 12:18:33 -05:00
Andrzej Zaborowski aad4d0de78 Add Sim Toolkit atom
- Add ofono_stk atom in stk.c
- Move envelope command from sim driver to stk driver
2010-04-15 16:49:40 -05:00
Denis Kenzior 6d28f82dc1 Add Wavecom's quirky CPIN handling 2010-02-08 16:13:43 -06:00
Denis Kenzior c98b951fe6 Refactor: Remove atutil dump_response
No longer needed now that we have nice AT command tracing using
OFONO_AT_DEBUG=1
2010-02-08 12:28:23 -06:00
Denis Kenzior 7f9a9b0cdc Fix: Don't use ofono_debug directly in plugins 2010-02-08 12:09:01 -06:00
Marcel Holtmann 144080e749 Update copyright information 2010-01-01 17:00:10 -08:00
Denis Kenzior 79c0d4c779 Fix: The extra 00 at the end isn't necessary 2009-12-17 21:45:39 -06:00
Denis Kenzior f74b300a49 Fix: Use capitals for hex-encoded pdus 2009-12-17 21:45:38 -06:00
Denis Kenzior 5fb5a2ceea Fix: Make sure we don't leak under any conditions 2009-12-17 21:45:38 -06:00
Denis Kenzior b1cc0bc184 Simplify previous patch 2009-12-17 21:45:38 -06:00
Denis Kenzior e27508f71a Implementat SIM envelope in atmodem driver 2009-12-17 21:45:38 -06:00
Denis Kenzior 5335d2deb1 Fix: Don't leak data in SIM atom driver 2009-11-11 15:58:45 -06:00
Denis Kenzior 27e32f12cd Fix: Rename G1 quirk to QUALCOMM_MSM 2009-11-10 16:29:23 -06:00
Andrzej Zaborowski d6c3a513c6 Work around Palm Pre SIM file reading quirk.
I'm not sure if MSM is not a too generic name but it seems the G1's
Qualcomm MSM suffers from similar problems.
2009-11-10 16:29:23 -06:00
Denis Kenzior ca60851774 Fix: Quiet a warning 2009-10-02 19:25:58 -05:00
Denis Kenzior dcf4ac50b3 Make generic sim driver work with 3G SIMs
3G (UICC) based SIMs use a different response format than 2G sims.  In
theory this also allows us to determine whether SIM filesystem format is
3G or 2G
2009-10-02 18:25:56 -05:00
Denis Kenzior c8150fc120 Use small caps for 2G/3G functions 2009-10-02 18:25:56 -05:00
Denis Kenzior c9a2eedc08 Add utility to parse 2G GET_RESPONSE data
This format is described in 51.011 and the older 11.11.  It is not
supported by newer 3G UICC based devices & sim card combinations
2009-10-02 18:25:56 -05:00
Andrzej Zaborowski 2a02f45c79 Add plugin interface for getting PIN lock state.
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.
2009-09-23 14:27:52 -05:00
Denis Kenzior 5fd083f6f4 Refactor: Do not use int instead of enum
27.007 does not define an enumeration for SIM PIN/PUK values.  This
should be handled by ofono enum instead
2009-09-22 00:07:07 -05:00
Denis Kenzior 7d7732d637 Don't treat READY CPIN result differently 2009-09-22 00:07:07 -05:00
Denis Kenzior 63416e2851 Rearrange sim password enum 2009-09-22 00:07:06 -05:00
Andrzej Zaborowski ee02b14836 Do PIN authentication
This adds checking whether PIN is required during SIM initialisation and
delaying the sim ready notifications until after correct PIN is given.
2009-09-22 00:07:06 -05:00
Denis Kenzior cbb36acee8 Rework DECLARE_FAILURE to be a bit nicer 2009-09-11 12:39:56 -05:00
Denis Kenzior 4c5791a500 Rename at.h to atmodem.h 2009-09-04 20:37:49 -05:00
Denis Kenzior a613105f91 Rename generic_at drivers to atmodem
Be more consistent with directory naming
2009-09-01 22:33:05 -05:00
Denis Kenzior 9caa606bcc Make remove functions not return anything 2009-09-01 22:27:08 -05:00
Denis Kenzior 422df0edfb change int vendor to unsigned int vendor 2009-09-01 21:39:02 -05:00
Denis Kenzior aecf42646e Add vendor flag capability to sim 2009-09-01 18:14:58 -05:00
Denis Kenzior d724bc727a Fix unused variable chat 2009-08-20 15:39:11 -05:00
Denis Kenzior 8c92e3dd18 Remove modem member from cb_data 2009-08-19 18:35:08 -05:00
Denis Kenzior 7e8f2ef241 Update SIM AT driver to the new API 2009-08-19 18:35:06 -05:00
Andrzej Zaborowski ed56d7c585 Fix record number in at_sim_update_record. 2009-08-05 12:39:09 -05:00
Denis Kenzior cb75833fc8 Rename ofono_modem_userdata 2009-07-29 16:44:16 -05:00
Denis Kenzior 426d201b2e Add support for cyclic files 2009-07-27 17:09:58 -05:00
Denis Kenzior 555e2e689d Refactor SIM file access code
SIM File Access conditions would be reported similarly between various
stacks, so it seems like the core logic of figuring out the access
conditions belongs up in the daemon.

This also fixes various problems, including:
  - access conditions read from bytes 10-12, instead of 9-11.
  - read/update, invalidate/rehabilitate and increase conditions
    read from the wrong bits (0-3 instead of 4-7 and vice versa)
2009-07-27 17:09:56 -05:00
Andrzej Zaborowski 5c981d421e Return SIM file access conditions from read_file_info. 2009-07-27 17:09:46 -05:00
Denis Kenzior 2289298615 Style fixes 2009-07-14 15:45:04 -05:00
Denis Kenzior 38a23eb108 Make oFono use proper record ids, don't use tricks 2009-07-14 15:45:04 -05:00
Andrzej Zaborowski fde5fc5a83 Add write/read operations for cyclic files in SIM. 2009-06-22 13:22:14 -05:00
Denis Kenzior 6fdf580a5d Cleanup EFmsisdn reading patch 2009-06-18 04:02:13 -05:00
Andrzej Zaborowski 1c6d44d9c0 Read own numbers from EFmsisdn instead of AT+CNUM. 2009-06-18 04:02:08 -05:00
Denis Kenzior c3e3750ebb Minor style fixes 2009-06-18 04:02:06 -05:00
Andrzej Zaborowski 2b451eaeab Add record based file capability to sim_ops
Add capability to read / write / stat files on the SIM.  This now
supports cyclic, linear fixed and transparent SIM files.

Parse GET RESPONSE result to find structure of the file (cyclic, linear
fixed, or transparent), the file size and the record length.

Add both read and update capability for binary and record-based files.

Implement writing sim files through AT.
2009-06-18 04:02:05 -05:00
Andrzej Zaborowski 498759f2b6 Use GET RESPONSE sim command to retrieve EF length
Also accept 0x9f as a success status word 1 for READ BINARY (GSM specific).
2009-06-18 04:02:03 -05:00
Denis Kenzior 5a4d750414 Do not use empty prefixes 2009-05-29 18:37:39 -05:00
Denis Kenzior db2a98ae5a Cleanup SimManager interface
Future-Proof own numbers support.  For now we only report voice numbers
Rename attributes to be a bit better
2009-05-26 18:20:03 -05:00
Denis Kenzior ab68cd8e7e Create ofono_phone_number struct
Creates a new structure in driver.h called ofono_phone_number.
This is meant to replace const char *number, int number_type
arguments everywhere.

Fix up all existing code to use this structure instead.
2009-05-26 18:18:12 -05:00
Andrzej Zaborowski 17fd4588fe Add atmodem SIM-related operations 2009-05-26 18:15:56 -05:00