[LEDE-DEV] [LEDE-DEV, 2/3, v2] Add support of using device symlinks.
John Crispin
john at phrozen.org
Thu Dec 15 23:50:26 PST 2016
Hi,
still pending not had time to look into this. it'll take me a moment as
i am not familiar with the code so i need to find a free moment to
properly review this, sorry for the delay
John
On 16/12/2016 08:42, Nikolay Ledovskikh wrote:
> So what? It's more general and useful when, for example you
> want to bind modem tty to certain usb port.
>
> 2016-12-07 20:13 GMT+03:00 Nickolay Ledovskikh <nledovskikh at gmail.com>:
>> It's useful when using multiple usb devices that should be bound to
>> certain usb ports. Symlinks are created by hotplug handlers.
>>
>> Signed-off-by: Nickolay Ledovskikh <nledovskikh at gmail.com>
>> ---
>> package/network/utils/comgt/files/directip.sh | 1 +
>> package/network/utils/comgt/files/ncm.sh | 2 ++
>> package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 3 +++
>> 3 files changed, 6 insertions(+)
>>
>> diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh
>> index 79b8c32..4dcbd70 100644
>> --- a/package/network/utils/comgt/files/directip.sh
>> +++ b/package/network/utils/comgt/files/directip.sh
>> @@ -33,6 +33,7 @@ proto_directip_setup() {
>> return 1
>> }
>>
>> + device="$(readlink -f $device)"
>> devname="$(basename "$device")"
>> devpath="$(readlink -f /sys/class/tty/$devname/device)"
>> ifname="$( ls "$devpath"/../../*/net )"
>> diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
>> index 14b6347..917a8c5 100644
>> --- a/package/network/utils/comgt/files/ncm.sh
>> +++ b/package/network/utils/comgt/files/ncm.sh
>> @@ -63,7 +63,9 @@ proto_ncm_setup() {
>> return 1
>> }
>>
>> + device="$(readlink -f $device)"
>> devname="$(basename "$device")"
>> +
>> case "$devname" in
>> 'tty'*)
>> devpath="$(readlink -f /sys/class/tty/$devname/device)"
>> diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
>> index 1235698..fb4c339 100755
>> --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
>> +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
>> @@ -51,6 +51,7 @@ proto_qmi_setup() {
>> return 1
>> }
>>
>> + device="$(readlink -f $device)"
>> devname="$(basename "$device")"
>> devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
>> ifname="$( ls "$devpath"/net )"
>> @@ -213,6 +214,8 @@ qmi_wds_stop() {
>>
>> [ -n "$cid" ] || return
>>
>> + device="$(readlink -f $device)"
>> +
>> # disable previous autoconnect state using the global handle
>> uqmi -s -d "$device" --set-client-id wds,"$cid" --stop-network "0xffffffff"
>>
>> --
>> 2.7.3
>>
>
>
>
More information about the Lede-dev
mailing list