diff options
author | Koen Vandeputte <koen.vandeputte@ncentric.com> | 2018-02-15 15:15:59 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-02-18 09:34:32 +0100 |
commit | 046222dfaf1272d7689f9bca17ecdd1fbdda38e5 (patch) | |
tree | 9c1ec38a4605de4cf5f892e5158216a26469409a /package/network/utils/uqmi/files | |
parent | 0393009ec84e0f22d854e8e11e630d393d44efe9 (diff) | |
download | upstream-046222dfaf1272d7689f9bca17ecdd1fbdda38e5.tar.gz upstream-046222dfaf1272d7689f9bca17ecdd1fbdda38e5.tar.bz2 upstream-046222dfaf1272d7689f9bca17ecdd1fbdda38e5.zip |
uqmi: fix raw-ip mode for newer lte modems
Some newer LTE modems, like the MC7455 or EC25-E do not support
"802.3" mode, and will stay in "raw-ip" regardless of the mode being
set.
In this case, the driver must be informed that it should handle all
packets in raw mode. [1]
This commit fixes connectivity issues for these devices.
Before:
[ Node 5 ] udhcpc -i wwan0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
After:
[ Node 5 ] udhcpc -i wwan0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 100.66.245.226
udhcpc: lease of 100.66.245.226 obtained, lease time 7200
udhcpc: ifconfig wwan0 100.66.245.226 netmask 255.255.255.252 broadcast
+
udhcpc: setting default routers: 100.66.245.225
[1] https://lists.freedesktop.org/archives/libqmi-
devel/2017-January/002064.html
Tested on cns3xxx using a Sierra Wireless MC7455 LTE-A
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[bumped PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network/utils/uqmi/files')
-rwxr-xr-x | package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 15 |
1 files changed, 14 insertions, 1 deletions
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 9c953ea697..9a534d4b96 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -27,7 +27,7 @@ proto_qmi_init_config() { proto_qmi_setup() { local interface="$1" - + local dataformat local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 @@ -99,6 +99,19 @@ proto_qmi_setup() { uqmi -s -d "$device" --set-data-format 802.3 uqmi -s -d "$device" --wda-set-data-format 802.3 + dataformat="$(uqmi -s -d "$device" --wda-get-data-format)" + + if [ "$dataformat" = '"raw-ip"' ]; then + + [ -f /sys/class/net/$ifname/qmi/raw_ip ] || { + echo "Device only supports raw-ip mode but is missing this required driver attribute: /sys/class/net/$ifname/qmi/raw_ip" + return 1 + } + + echo "Device does not support 802.3 mode. Informing driver of raw-ip only for $ifname .." + echo "Y" > /sys/class/net/$ifname/qmi/raw_ip + fi + uqmi -s -d "$device" --sync echo "Waiting for network registration" |