B2G RIL: support RIL_VERSION = 6

RESOLVED FIXED in mozilla14

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: ferjm, Assigned: philikon)

Tracking

Trunk
mozilla14
ARM
Gonk (Firefox OS)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

5 years ago
The SMSC can´t be retrieved using Akami devices. It just shows 'Cannot send the SMS. Need to get the SMSC address first.' message. I´ll give further info (RIL data) as soon as I get an akami again...
(Reporter)

Updated

5 years ago
Blocks: 726233
(Reporter)

Comment 1

5 years ago
This may sound like a firmware issue. Anyway, we would probably want to deal with this TODO -> https://hg.mozilla.org/mozilla-central/file/0a7410527788/dom/system/b2g/ril_worker.js#l2039
Digging a bit deeper, it seems that the radio state isn't notified beyond RADIO_STATE_SIM_NOT_READY. 

First I'm getting a notification for RADIO_STATE_UNAVAILABLE = 1 (the initial value being RADIO_STATE_UNAVAILABLE = 1):

I/Gecko   (   83): RIL Worker: Handling parcel as UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED
I/Gecko   (   83): RIL Worker: Radio state changed from 1 to 1

Then, surprisingly, I get a notification for UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED. AFAIUI, this is an invitation to query REQUEST_GET_SIM_STATUS = 1 which is what the RIL worker does immediately, but it gets an error:

I/Gecko   (   83): RIL Worker: Parcel (size 12): 0,0,0,0,1,0,0,0,1,0,0,0
I/Gecko   (   83): RIL Worker: We have at least one complete parcel.
I/Gecko   (   83): RIL Worker: Received error 1 for solicited parcel type 1

Later, we get another UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED notification for RADIO_STATE_OFF = 0:

I/Gecko   (   83): RIL Worker: Handling parcel as UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED
I/Gecko   (   83): RIL Worker: Radio state changed from 1 to 0

The last radio state notification I get is for RADIO_STATE_SIM_NOT_READY = 2;

I/Gecko   (   83): RIL Worker: Handling parcel as UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED
I/Gecko   (   83): RIL Worker: Radio state changed from 0 to 2

After this I don't get any UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED or UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED anymore, even though clearly later the SIM card comes online (e.g. signal strength is notified, calls can be made, etc.). Could this be a rild bug on the akami?
Component: General → DOM: Device Interfaces
Product: Boot2Gecko → Core
QA Contact: general → device-interfaces
Summary: [B2G] SMSC cannot be retrieved on akami device → B2G RIL on akami device: UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED is not notified past RADIO_STATE_SIM_NOT_READY
Version: unspecified → Trunk
Yeaaaah, so it turns out our Gonk is just stuck in the past and the akami's RIL is newer. Header file changed pretty dramatically.

Working on a fix.
Assignee: nobody → philipp
Summary: B2G RIL on akami device: UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED is not notified past RADIO_STATE_SIM_NOT_READY → B2G RIL: support RIL_VERSION = 6
(Assignee)

Updated

5 years ago
Blocks: 736901
Created attachment 607793 [details] [diff] [review]
Part 0 (v1): Use constants when initializing RadioInterfaceLayer

Going to attach these patches without much testing to get the review off the ground while my build monster is churning through several builds in parallel.

Here's some trivial stuff to warm up!
Attachment #607793 - Flags: review?(kyle)
Created attachment 607795 [details] [diff] [review]
Part 1 (v1): Introduce ril.h v6 consts

Pretty mechanical stuff: add/change some consts according to ril.h v6. And, in some cases, the ril.h on Maguro/Akami. Which is slightly different. Kill me now.
Attachment #607795 - Flags: review?(kyle)
Attachment #607793 - Flags: review?(kyle) → review+
Comment on attachment 607795 [details] [diff] [review]
Part 1 (v1): Introduce ril.h v6 consts

Review of attachment 607795 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +201,3 @@
>          this.updateDataConnection(state);
>  
>          //TODO for simplicity's sake, for now we only look at

Nit: space between // and TODO
Attachment #607795 - Flags: review?(kyle) → review+
Created attachment 607802 [details] [diff] [review]
Part 2 (v1): Support RIL v6 parcels (off by default)

This adds support for RIL v6 parcels, disabled for now. We need to figure out a runtime way of detecting the RIL version. I'd like to punt on that for now, at least in this patch, but possibly even this bug.

To summarize this patch:

* Several parcels have changed structure, so in some cases we now have readFoobar_v5 and readFoobar_v6. In other other cases, when the delta is small, it's an inline check.

* Radio state and card state are handled differently now. The existing code is one of the oldest pieces in RIL that I wrote when I really didn't know much about what the state machine would look like. We have a better idea now. Also, RIL v6 handles radio state and card state separately, whereas v5 conflated the two ideas. So we have to work around that a little, basically deferring all things that depend on the card being ready to the actual REQUEST_GET_SIM_STATUS handler.
Attachment #607802 - Flags: review?(kyle)
Comment on attachment 607802 [details] [diff] [review]
Part 2 (v1): Support RIL v6 parcels (off by default)

Review of attachment 607802 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/ril_consts.js
@@ +1215,5 @@
> +const DATACALL_FAIL_SIGNAL_LOST = -3;
> +const DATACALL_FAIL_PREF_RADIO_TECH_CHANGED = -4;
> +const DATACALL_FAIL_RADIO_POWER_OFF = -5;
> +const DATACALL_FAIL_TETHERED_CALL_ACTIVE = -6;
> +const DATACALL_FAIL_ERROR_UNSPECIFIED = 0xffff;

Are these our consts? 'cause the sign bit on the unspecified error not being flipped seems weird. But if we're just copying, ignore me.
Attachment #607802 - Flags: review?(kyle) → review+
(In reply to Kyle Machulis [:kmachulis] [:qdot] from comment #8)
> Comment on attachment 607802 [details] [diff] [review]
> Part 2 (v1): Support RIL v6 parcels (off by default)
> 
> Review of attachment 607802 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/system/gonk/ril_consts.js
> @@ +1215,5 @@
> > +const DATACALL_FAIL_SIGNAL_LOST = -3;
> > +const DATACALL_FAIL_PREF_RADIO_TECH_CHANGED = -4;
> > +const DATACALL_FAIL_RADIO_POWER_OFF = -5;
> > +const DATACALL_FAIL_TETHERED_CALL_ACTIVE = -6;
> > +const DATACALL_FAIL_ERROR_UNSPECIFIED = 0xffff;
> 
> Are these our consts? 'cause the sign bit on the unspecified error not being
> flipped seems weird. But if we're just copying, ignore me.

Just copying from the RIL_DataCallFailCause struct in ril.h.
Created attachment 609895 [details] [diff] [review]
Part 1 (v2): Introduce ril.h v6 consts

A few more missing constants and a typo fix.
Attachment #607795 - Attachment is obsolete: true
Attachment #609895 - Flags: review?(kyle)
Created attachment 609896 [details] [diff] [review]
Part 2 (v2): Support RIL v6 parcels

There were some typos and incomplete implementations of the v6 parcels in the v1 patch. These are all fixed now and tested on the Nexus S + ICS gonk. We also auto-detect RIL v6 now.
Attachment #607802 - Attachment is obsolete: true
Attachment #609896 - Flags: review?(kyle)
Attachment #609895 - Flags: review?(kyle) → review+
Attachment #609896 - Flags: review?(kyle) → review+
https://hg.mozilla.org/mozilla-central/rev/53001c577ab9
https://hg.mozilla.org/mozilla-central/rev/87aa00676c4b
https://hg.mozilla.org/mozilla-central/rev/1db916a98bd4
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
(Assignee)

Updated

5 years ago
Depends on: 740231
No longer depends on: 740231
Blocks: 905007
You need to log in before you can comment on or make changes to this bug.