https://osmocom.org/https://osmocom.org/favicon.ico?16647414092017-09-10T17:16:44ZOpen Source Mobile CommunicationsOsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=53802017-09-10T17:16:44Zlynxis
<ul></ul><p>What about using the usb path if available?</p> OsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=53812017-09-10T21:00:18Zpespin
<ul></ul><p>I really don't care that much about what we use, as long as it's consistent to identify a given physical modem.</p> OsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=53842017-09-10T23:22:55Zneelsnhofmeyr@sysmocom.de
<ul></ul><p>would be really great to have this indeed.</p> OsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=76202018-02-13T19:32:26Zpespin
<ul><li><strong>File</strong> <a href="/attachments/2936">0001-udevng-Add-OFONO_PATHNAME-property-to-set-modem-dbus.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2936/0001-udevng-Add-OFONO_PATHNAME-property-to-set-modem-dbus.patch">0001-udevng-Add-OFONO_PATHNAME-property-to-set-modem-dbus.patch</a> added</li><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Assignee</strong> changed from <i>lynxis</i> to <i>pespin</i></li></ul><p>I have a working patch for ofono which allows feeding the name used for the dbus path from a udev env variable intead of allocating it sequentially. In fact most of the code required was already in there, but the case to set a specific name was not being used by udevng.c backend.</p>
<p>udevng.c goes through all udev nodes and fills data structures in hashtable modem_list:<br /><pre>
check_device
-> check_usb_device
-> add_device
</pre></p>
<p>Then it calls check_modem_list() to create the modems for each modem in the hashtable (calls function create_modem):<br /><pre>
g_hash_table_foreach_remove(modem_list, create_modem, NULL);
create_modem
-> ofono_modem_create: modem->modem = ofono_modem_create(NULL, modem->driver);
</pre></p>
<pre>
struct ofono_modem *ofono_modem_create(const char *name, const char *type):
if (name == NULL)
snprintf(path, sizeof(path), "/%s_%d", type, next_modem_id);
else
snprintf(path, sizeof(path), "/%s", name);
</pre>
<p>How to use it:</p>
<pre>
$ cat /etc/udev/rules.d/90-local.rules
SUBSYSTEMS=="usb", DEVPATH=="/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.1/3-1.1.4/3-1.1.4.1/3-1.1.4.1.1", ENV{OFONO_PATHNAME}="foo"
$sudo udevadm control --reload-rules; sudo udevadm trigger
$ sudo udevadm info -p /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.1/3-1.1.4/3-1.1.4.1/3-1.1.4.1.1
P: /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.1/3-1.1.4/3-1.1.4.1/3-1.1.4.1.1
N: bus/usb/003/026
E: BUSNUM=003
E: DEVNAME=/dev/bus/usb/003/026
E: DEVNUM=026
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.1/3-1.1.4/3-1.1.4.1/3-1.1.4.1.1
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=Qualcomm_Gobi_2000
E: ID_MODEL_ENC=Qualcomm\x20Gobi\x202000
E: ID_MODEL_FROM_DATABASE=Gobi 2000
E: ID_MODEL_ID=9205
E: ID_REVISION=0002
E: ID_SERIAL=Qualcomm_Incorporated_Qualcomm_Gobi_2000
E: ID_USB_INTERFACES=:ffffff:
E: ID_VENDOR=Qualcomm_Incorporated
E: ID_VENDOR_ENC=Qualcomm\x20Incorporated
E: ID_VENDOR_FROM_DATABASE=Qualcomm, Inc.
E: ID_VENDOR_ID=05c6
E: MAJOR=189
E: MINOR=281
E: OFONO_PATHNAME=foo <--------
E: PRODUCT=5c6/9205/2
E: SUBSYSTEM=usb
E: TYPE=0/0/0
E: USEC_INITIALIZED=37021628322
*** start ofono ***
$ mdbus2 -s org.ofono
/
/bluetooth
/bluetooth/profile
/bluetooth/profile/dun_gw
/bluetooth/profile/hfp_ag
/bluetooth/profile/hfp_hf
/foo
/mbm_0
</pre>
<p>I'll submit now the patch to ofono ml.</p> OsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=76322018-02-14T16:10:58Zpespin
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Feedback</i></li></ul><p>Waiting for review at ofono ml: <a class="external" href="https://lists.ofono.org/pipermail/ofono/2018-February/017892.html">https://lists.ofono.org/pipermail/ofono/2018-February/017892.html</a></p> OsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=77152018-02-20T22:33:28Zpespin
<ul></ul><p>My patch was not accepted but it triggered a discussion by which patches are submitted which export the sysfs path in the Modem interface properties (which means it can be easily obtained a list with something similar to mdbus2 -s org.ofono / GetModems()).</p>
<p>The patches were already merged in master. We Hence it neither to</p>
<p>1- Rebase our osmo-gsm-tester branch on top of current master<br />2- Cherry-pick patches to our branch:<br />4b1609c2d791ac73ff33751b7ca96316938414e6<br />895ca91d856ea3e8ca6e70fe77e11e8de4610bd8<br />1df92289d4e09a1e2db0b189b5153a4c238f98f1</p> OsmoGSMTester - Feature #2509: ofono: Find a way to have consistent paths for modemshttps://osmocom.org/issues/2509?journal_id=77832018-02-23T16:32:57Zpespin
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>It took me a few hours, but I was finally able to rebase osmo-gsm-tester branch on top of current ofono master, which contains the fixes. We should really try better to havea more clean osmo-gsm-tester branch. It also looks like there's a few patches there which should be sent upstream. lynxis please have a look at the new branch to make sure I forgot something, and feel free to clean it up further.</p>
<p>I pushed the new osmo-gsm-tester branch as osmo-gsm-tester, and moved the old osmo-gsm-tester branch based on ofono 1.20 to be named "osmo-gsm-tester-1.20". I fetched manually the new osmo-gsm-tester branch in both prod and r&d main units, built it and installed it.</p>
<p>I created a patch for osmo-gsm-tester (e25cf04aeb320b4a859ba5b1337e953321880595, <a class="external" href="https://gerrit.osmocom.org/#/c/6858/">https://gerrit.osmocom.org/#/c/6858/</a>) to discover the ofono path from sysfs path, and updated the resources.conf to use sysfs paths instead of ofono paths. It is now merged.</p>