Bug 916719 - B2G Emulator: Fix bug in amodem_clear_call

Free calls in reverse order.
Merge pull request #47 from aknow/fix_gsm_clear

Bug 916719 - B2G Emulator: Fix bug in amodem_clear_call. r=vicamo
Bug 909688 - Emulator: do not auto attach data registration. r=vicamo

Do not auto attach data registration when activating data call,
instead return error if data registration is unregistered when
activating/deactivating data call.
Merge pull request #48 from jessi3py/bug-909688

Bug 909688 - Emulator: do not auto attach data registration. r=vicamo
Added command 'report' to console

The report command returns internal state of the GSM modem. The only
supported command for now is 'creg' for the network-registration state.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 933654 - 1/3: refactor amodem_send.

The original amodem_send returns the reply string of a AT command,
and then ModemDriver determines whether the modem is now waiting for
SMS by comparing that string to '> '.  However, as we're to enable
unsolicited responses after the reply, such method is no longer
effective and could be error prone.

This patch moves all reply handling into android_modem.c and returns
and modem->waiting_sms in the end of amodem_send().
Bug 933654 - 2/3: allow extra unsolicited responses.

For AT command handlers, returning NULL was a convenient alias for
asking amodem_send() to reply "OK" for them.  To allow extra
unsolicited responses after the original reply, there must be some
way to notify amodem_send() that the reply has been sent and don't
bother appending another "OK".  There are also cases that return an
empty string ("", not NULL).  The NULL value then becomes the best
choice in both literal and semantic way.
Bug 933654 - 3/3: perform voice/data registration state change in handleRadioPower.
Bug 942089 - Have different IccId for each sim card
Bug 946311 - 1/6: don't mix cid with the index to data_context array.

Signed-off-by: You-Sheng Yang (楊有勝) <vicamo@gmail.com>
Bug 946311 - 2/6: fix +CGDCONT/+CGACT

Three things to fix here:

1. From 3GPP TS 27.007 subclause 10.1.10 "PDP context activate or
deactivate +CGACT", "The read command returns the current activation
states for all the defined PDP contexts." but now we return only
active ones.

2. From 3GPP TS 27.007 subclause 10.1.1 "Define PDP context
+CGDCONT", "(about <PDP_addr>) The read form of the command will
continue to return the null string even if an address has been
allocated during the PDP startup procedure." So we should return the
given <PDP_addr> in the response of the read form.

3. Return correct supported cid range <1-MAX_DATA_CONTEXTS> in the
test form of +CGDCONT.

Signed-off-by: You-Sheng Yang (楊有勝) <vicamo@gmail.com>
Bug 946311 - 3/6: intantiate additional rmnet nics.

Create <MAX_NET_CLIENTS> additional NIC instances when radio is
enabled. These NICs will have the name "rmnet<N>".

Signed-off-by: You-Sheng Yang (楊有勝) <vicamo@gmail.com>
Bug 946311 - 4/6: support link down for SMC91C111

Original SMC91C111 doesn't support link up/down reporting (EPHSR).
This patch implement it and one may call |do_set_link| to change the
link status.

Signed-off-by: You-Sheng Yang (楊有勝) <vicamo@gmail.com>
Bug 946311 - 5/6: link up/down in AT+CGACT handler.

Signed-off-by: You-Sheng Yang (楊有勝) <vicamo@gmail.com>
Bug 946311 - 6/6: implement AT+CGCONTRDP.

Signed-off-by: You-Sheng Yang (楊有勝) <vicamo@gmail.com>
Bug 970212 - B2G Emulator: Enhance GSM/UMTS Signal Strength on Emulator. r=Vicamo.

Trigger amodem_unsol_buffered to send RIL_UNSOL_SIGNAL_STRENGTH after
"gsm signal" command to update signal strength on status bar promptly.
Merge pull request #53 from vicamo/bugzilla/946311/emulator-rmnet

Bugzilla/946311/emulator rmnet
Merge pull request #56 from chenghuk/master

Bug 970212 - B2G Emulator: Enhance GSM/UMTS Signal Strength on Emulator.
Revert "Merge pull request #53 from vicamo/bugzilla/946311/emulator-rmnet"

This reverts commit b345aaae0393057d6d3e11f3ce75a18300bf3fe4, reversing
changes made to 87aa8679560ce09f6445621d6f370d9de722cdba.
Bug 860696 - 1/4: mux bt [<bd_addr>]