Commit Graph

63 Commits

Author SHA1 Message Date
Martin Xu a9f75b3f23 huawei: Fix huawei_disconnect function issue
huawei_disconnect is used to recovery the io and gprs context when
io error happends, see commit 39382730d7
However, io error not only happends at PPP disconnect, in theory it
can happends at any situation. I also observed that it happens when modem
go into offline mode at my Huawei EM770W modem. in this case, gprs should
not be reopened.
2011-03-15 13:54:59 -05:00
Andras Domokos 4a36b93d6a ssn: remove SSN atom completely 2011-03-11 13:08:51 -06:00
Lucas De Marchi 42ecf16c29 huawei: do not check for NULL pointer
cb_data_new() uses g_new0(), hence there's no need to check the return
value being NULL.
2011-03-04 05:14:02 -08:00
Marcel Holtmann a5e83f5668 huawei: Move SMS support into post_sim stage 2011-01-29 10:30:03 +01:00
Lucas De Marchi a72115510a huawei: do not query sim state on pre_sim
Sim state is already known after modem is enabled and there's no need to
query it again. Before this patch, query_sim_state() was called upon
huawei_enable() and huawei_pre_sim(). Both functions might call
notify_sim_state() with a valid state. Hence we could eventually end up
sending AT+CFUN=5 command twice.
2011-01-19 15:39:49 +01:00
Lucas De Marchi edaff4b505 huawei: do not set timer more than once
If a "^SYSINFO" arrives after the timer for query_sim_locked() has been
set up, it'd would set a new timer, signaling a sim state change more
than once.
2011-01-19 14:21:29 +01:00
Lucas De Marchi 4c2920d8a5 huawei: use VENDOR_HUAWEI quirk on sim creation 2011-01-10 15:38:42 -06:00
Lucas De Marchi d90fd381b5 huawei: cancel poll when going to a valid state 2010-12-21 17:21:21 -06:00
Denis Kenzior b22d2109da huawei: Move radio_settings to post_sim 2010-12-21 16:31:11 -06:00
Lucas De Marchi 5212a1b5a4 huawei: Add support for radio settings 2010-12-21 16:03:00 -06:00
Lucas De Marchi 67486801d0 huawei: fix SIM state notification when locked
When SIM is locked, huawei modem does not send any notification about
SIM state change because it does not differentiate 'invalid' from
'locked'.

In order to be able to unlock the sim, this patch forces a notification
of a valid state after a timeout.
2010-12-21 13:37:25 -06:00
Denis Kenzior 0571baa5f1 huawei: Pass the HUAWEI vendor ID to gprs driver 2010-12-11 11:39:07 -06:00
Lucas De Marchi 67f78f680d plugins: 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 12:55:49 -06:00
Denis Kenzior a6909a227f huawei: Fixup whitespace corruption 2010-10-13 05:04:46 -05:00
Marcel Holtmann 5101702583 huawei: Use modem interface only if NDIS support is not available 2010-10-05 16:50:09 +02:00
Marcel Holtmann acc1f1d6af huawei: Add support for enabling NDIS GPRS driver if supported 2010-10-05 16:38:23 +02:00
Marcel Holtmann 190be6348c huawei: Add support for specific audio settings 2010-09-30 00:01:14 +09:00
Marcel Holtmann 461ef8ad97 huawei: Remove pointless vendor quirk 2010-09-29 23:59:50 +09:00
Marcel Holtmann 815b3e592d huawei: Use specific voice call atom driver 2010-09-27 12:44:09 +09:00
Marcel Holtmann c201ffd197 huawei: Move voice call init to post_sim phase
Seems like that making emergency voice calls without SIM present is
not really possible. Move the voice call init to post_sim phase instead.
2010-09-27 00:05:52 +09:00
Marcel Holtmann 1b640f6a45 huawei: Remove voice call notifications from modem plugin 2010-09-27 00:03:36 +09:00
Marcel Holtmann be1912fe9c Make debug handling with OFONO_AT_DEBUG a bit more consistent 2010-09-24 14:14:04 +09:00
Kalle Valo 78842faa30 huawei: fix online logic
The recently introduced online support to huawei didn't work with my
Huawei E1552. The problem was that with command AT+CFUN=1;+CFUN=5
the modem didn't initialise the sim state properly.

To fix this I changed the logic so that CFUN=5 is called only after the sim
state has switched to a valid state. Now my Huawei E1552 works with connman
again.

PIN locked SIMs still won't work. The problem is that it takes some time for
the sim state to go to a valid state:

Sep 20 15:01:57 dell-m520 ofonod[12451]: Pcui:< \r\n+CPIN: READY\r\n\r\nOK\r\n
[...]
Sep 20 15:02:00 dell-m520 ofonod[12451]: huawei: invalid sim state in post online (0)
[...]
Sep 20 15:02:01 dell-m520 ofonod[12451]: Pcui:< \r\n^SIMST:1\r\n

I don't know why it takes so long to get a valid state.

There is also another issue, in "cold start" case the phonebook
initialisation fails:

Sep 20 14:34:24 dell-m520 ofonod[11939]: Pcui:> AT+CPBS=?\r
Sep 20 14:34:24 dell-m520 ofonod[11939]: Pcui:< \r\n+CME ERROR: SIM busy\r\n

But in "warm start" it seems to work:

Sep 20 14:38:59 dell-m520 ofonod[12091]: Pcui:> AT+CPBS=?\r
Sep 20 14:38:59 dell-m520 ofonod[12091]: Pcui:< \r\n+CPBS: ("SM","EN","ON")\r\n\r\nOK\r\n

I consider this as a minor issue and didn't investigate it at all.
2010-09-21 02:08:45 +09:00
Kalle Valo 940eaffa72 huawei: poll sim state
On my Huawei E1552 when I plug in the modem (ie. cold start) with PIN locked
SIM, the sim state is 255 (HUAWEI_SIM_STATE_NOT_EXISTENT). As the modem
doesn't send ^SIMST notifications, poll the sim state until it's ready.

In theory it might be possible to do this better, for example follow
^BOOT notifications or something, but it's unknown what parameter we
should check for.
2010-09-21 02:08:24 +09:00
Pekka Pessi 9cbff5e19a huawei: implement Online property
Huawei uses +CFUN=5 for offline
2010-09-09 01:16:33 +02:00
Marcel Holtmann ad5fb5ddda huawei: Decode voice call notifications 2010-09-05 21:54:55 +02:00
Marcel Holtmann 92916affea huawei: Decode voice channel settings 2010-09-05 20:50:30 +02:00
Marcel Holtmann ba532ae192 huawei: Check for voice call support 2010-09-04 23:43:59 +02:00
Marcel Holtmann c2cf902d03 huawei: Query AT^U2DIAG and AT^GETPORTMODE settings
Just to make the values show up in the AT command debug logs, query them
when enabling the device.
2010-08-23 17:43:20 +02:00
Denis Kenzior 56aab76f41 huawei: Use QUALCOMM_MSM quirk for sim driver 2010-08-19 18:20:29 -05:00
Marcel Holtmann d0fdaa7f72 huawei: Add support for switching USSD mode
Some newer Huawei modems have support for ^USSDMODE command which seems
to be default to 1. In that mode the text USSD is not working. Switching
it to 0 and text USSD works just fine. Assumption is that with this command
the modem switches between text and PDU mode for USSD. Currently it is
unclear on how the PDU mode is suppose to work all. So default to text mode
if this command is supported.
2010-08-19 21:01:21 +02:00
João Paulo Rechi Vita f01de438bd huawei: Fix SIM state logic
Add support for voice-only SIM cards and enable phonebook atom for
non-voice modems.
2010-08-05 14:19:56 -05:00
João Paulo Rechi Vita 4c8e084bf4 huawei: fix double include of GPRS header 2010-08-02 12:16:40 -07:00
Zhenhua Zhang bf562fd639 huawei: Add Huawei EM770 modem support
Huawei EM770W is a 3G WCDMA modem that supports HSPA/UMTS/EDGE/GPRS/GSM
data service and WCDMA/GSM short message services. It also has voice
call capability that supports both 2G and 3G network.
2010-07-02 10:40:13 -05:00
Denis Kenzior 494ce09c49 huawei: cleanup warnings from the previous patch 2010-06-29 14:44:20 -05:00
Kalle Valo 39382730d7 huawei: reopen the GPRS context on hup
Huawei always closes the tty port after PPP disconnect. Handle this in
huawei plugin, similarly as done with novatel. Now there's no need
to unplug the modem after disconnection.

Tested with Huawei E1552.

Based on a patch by Marcel Holtmann:

commit 0329a6ceaf
Author: Marcel Holtmann <marcel@holtmann.org>
Date:   Mon Jun 7 02:36:12 2010 -0700

    Reopen the GPRS context channel when the modem closes it after PPP
2010-06-29 14:01:16 -05:00
Marcel Holtmann 118759d5ba Enable Qualcomm specific CBS quirk for Novatel and Huawei devices 2010-06-09 18:42:09 -07:00
Denis Kenzior cc6a43c477 huawei: Rework huawei plugin
- Use the PCUI (event) port for all commands unrelated to ppp
- Use the Modem port for ppp
2010-06-07 19:07:05 -05:00
Marcel Holtmann edc33cfdb3 Use event channel for SMS, CBS and USSD with Huawei devices 2010-06-06 18:22:03 -07:00
Marcel Holtmann d990308c69 Enable CBS and USSD for Huawei modems 2010-06-06 15:52:02 -07:00
Marcel Holtmann d06d87e277 Fix debug channel prefix strings for Huawei plugin 2010-06-02 21:52:03 -07:00
Kalle Valo 53d70bc137 huawei: remove voicecall support
These modems don't support voicecall anyway. Recommended by Denis.
2010-05-25 09:47:18 -05:00
Kalle Valo 99e4200c64 huawei: send a prefix with AT commands 2010-05-25 09:47:03 -05:00
Kalle Valo 2d3c0cd3b0 huawei: properly notify sim state to ofono
Instead of using ofono_modem_set_powered(), use ofono_sim_inserted_notify()
which is the proper way to notify about sim state changes.

Now the problem is that voicecall commands fail with my Huawei E1552:

ofonod[12395]: > AT+CRC=1\r
ofonod[12395]: src/sim.c:ofono_sim_add_state_watch() 0x1bf8e50
ofonod[12395]: src/sim.c:ofono_sim_add_state_watch() 0x1bf8e50
ofonod[12395]: < \r\n+CME ERROR: SIM busy\r\n
ofonod[12395]: > AT+CLIP=1\r
ofonod[12395]: < \r\n+CME ERROR: SIM busy\r\n
ofonod[12395]: > AT+COLP=1\r
ofonod[12395]: < \r\n+CME ERROR: SIM busy\r\n
ofonod[12395]: > AT+CCWA=1\r
ofonod[12395]: < \r\n+CME ERROR: SIM busy\r\n
ofonod[12395]: drivers/atmodem/voicecall.c:at_voicecall_initialized()
  voicecall_init: registering to notifications
ofonod[12395]: src/sim.c:ofono_sim_add_state_watch() 0x1bf8e50
ofonod[12395]: > AT^SYSINFO\r
ofonod[12395]: < \r\n^SYSINFO:0,0,0,0,255,,0\r\n\r\nOK\r\n
ofonod[12395]: > AT+CGMI\r
ofonod[12395]: < \r\nhuawei\r\n\r\nOK\r\n
ofonod[12395]: EventChannel: < \r\n^STIN:0,0,0\r\n
ofonod[12395]: > AT+CLCC\r
ofonod[12395]: < \r\n+CME ERROR: SIM busy\r\n

But as I can't make voice calls with this modem anyway, I don't worry
about them right now.
2010-05-25 09:46:37 -05:00
Kalle Valo 3cdbed3c37 huawei: use g_at_result_iter_skip_next() 2010-05-25 09:45:18 -05:00
Marcel Holtmann 1ff130d66e Some minor cleanups for the Huawei plugin 2010-05-25 11:13:48 +02:00
Kalle Valo 160e4fe122 huawei: follow sim state change notifications
With Huawei E1552 I got sim busy errors when I plugged in the modem
and ofono was already running:

May 24 17:02:04 tukki ofonod[7619]: > AT+CRC=1\r
May 24 17:02:04 tukki ofonod[7619]: < \r\n+CME ERROR: SIM busy\r\n
May 24 17:02:04 tukki ofonod[7619]: > AT+CLIP=1\r
May 24 17:02:04 tukki ofonod[7619]: < \r\n+CME ERROR: SIM busy\r\n

Fix this by following sim state changes with ^SIMST notification and
only enable modem after SIM is ready. In case SIM is already ready
and we miss the notification for some reason, also use AT^SYSINFO
to check the state during enable phase.

Also change huawei_enable() to return -EINPROGRESS to make sure that
ofono modem is not powered too early. I believe this was a bug.
2010-05-25 11:11:11 +02:00
Kalle Valo 36e9803cdc huawei: add gprs context
Tested with Huawei E1552 HSDPA USB stick using a finnish Saunalahti prepaid
SIM.
2010-05-19 23:09:21 -05:00
Kalle Valo 6f4b3c31fd huawei: detect possible secondary device 2010-05-19 23:08:33 -05:00
Denis Kenzior 244ea076cc Fix: Remove easy uses of g_at_chat_shutdown 2010-04-28 17:27:33 -05:00