All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
To: Denis Kenzior <denkenz@gmail.com>, ofono@lists.linux.dev
Cc: absicsz@gmail.com, merlijn@wizzup.org
Subject: Re: [PATCH] qmi: radio-settings: Do not unconditionally try to enable unsupported modes
Date: Wed, 11 Dec 2024 15:54:54 +0200	[thread overview]
Message-ID: <0579e270-d57d-40bb-af96-011e463e1538@gmail.com> (raw)
In-Reply-To: <acedcbad-dd01-4423-9fb7-3c90081ca5a7@gmail.com>

Hi Denis,


On 11.12.24 г. 7:13 ч., Denis Kenzior wrote:

> 
> This looks like copy-paste of get_caps_cb.  Lets avoid that by invoking 
> QMI_DMS_GET_CAPS during probe().  See below.
> 

I was looking into doing it during probe, somehow missed 
OFONO_ATOM_DRIVER_FLAG_REGISTER_ON_PROBE flag. Now I see.

...

+    if (rsd->rat_mode_any || !get_rat_mode_any(rs, mode, cb, user_data))
> 
> So your intent here is to query the radio capabilities first if they 
> haven't been queried before?  If so, then the typical pattern is to do 
> this during probe(), before calling ofono_radio_settings_register().  
> See qmimodem/lte.c for an example.
> 

Exactly(the intent), but will do it like in lte.c

...

>>       available_rats = 0;
>> +
>>       for (i = 0; i < caps->radio_if_count; i++) {
>>           switch (caps->radio_if[i]) {
>>           case QMI_DMS_RADIO_IF_GSM:
>>               available_rats |= OFONO_RADIO_ACCESS_MODE_GSM;
>> +            rsd->rat_mode_any |= QMI_NAS_RAT_MODE_PREF_GSM;
>>               break;
>>           case QMI_DMS_RADIO_IF_UMTS:
>>               available_rats |= OFONO_RADIO_ACCESS_MODE_UMTS;
>> +            rsd->rat_mode_any |= QMI_NAS_RAT_MODE_PREF_UMTS;
>>               break;
>>           case QMI_DMS_RADIO_IF_LTE:
>>               available_rats |= OFONO_RADIO_ACCESS_MODE_LTE;
>> +            rsd->rat_mode_any |= QMI_NAS_RAT_MODE_PREF_LTE;
>>               break;
>>           }
>>       }
> 
> Wouldn't it be easier to simply do
> rsd->rat_mode_any = available_rats?
> 

No, because available_rats are of type OFONO_RADIO_ACCESS_TYPE_XXX, 
while rat_mode_any is of type QMI_NAS_RAT_MODE_PREF_XXX

Will send v2 with the above issues fixed.

Regards,
Ivo

  reply	other threads:[~2024-12-11 13:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 17:20 [PATCH] qmi: radio-settings: Do not unconditionally try to enable unsupported modes Ivaylo Dimitrov
2024-12-11  5:13 ` Denis Kenzior
2024-12-11 13:54   ` Ivaylo Dimitrov [this message]
2024-12-11 15:16   ` [PATCH v2] " Ivaylo Dimitrov
2024-12-11 15:30     ` patchwork-bot+ofono

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0579e270-d57d-40bb-af96-011e463e1538@gmail.com \
    --to=ivo.g.dimitrov.75@gmail.com \
    --cc=absicsz@gmail.com \
    --cc=denkenz@gmail.com \
    --cc=merlijn@wizzup.org \
    --cc=ofono@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.