]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
qmi_wwan: extend permitted QMAP mux_id value range
authorReinhard Speyerer <rspmn@arcor.de>
Wed, 12 Jun 2019 17:03:50 +0000 (19:03 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1839036
[ Upstream commit 36815b416fa48766ac5a98e4b2dc3ebc5887222e ]

Permit mux_id values up to 254 to be used in qmimux_register_device()
for compatibility with ip(8) and the rmnet driver.

Fixes: c6adf77953bc ("net: usb: qmi_wwan: add qmap mux protocol support")
Cc: Daniele Palmas <dnlplm@gmail.com>
Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Documentation/ABI/testing/sysfs-class-net-qmi
drivers/net/usb/qmi_wwan.c

index 7122d6264c49d6c02c2c0074e145f19b93fc63dd..c310db4ccbc2eeb2aa7250438fd9f7b308b8fdbd 100644 (file)
@@ -29,7 +29,7 @@ Contact:      Bjørn Mork <bjorn@mork.no>
 Description:
                Unsigned integer.
 
-               Write a number ranging from 1 to 127 to add a qmap mux
+               Write a number ranging from 1 to 254 to add a qmap mux
                based network device, supported by recent Qualcomm based
                modems.
 
@@ -46,5 +46,5 @@ Contact:      Bjørn Mork <bjorn@mork.no>
 Description:
                Unsigned integer.
 
-               Write a number ranging from 1 to 127 to delete a previously
+               Write a number ranging from 1 to 254 to delete a previously
                created qmap mux based network device.
index e4cc0398a8015bc99dcf228bd049502c542df864..677021738035846a9671e38e2c65759c45d044dd 100644 (file)
@@ -363,8 +363,8 @@ static ssize_t add_mux_store(struct device *d,  struct device_attribute *attr, c
        if (kstrtou8(buf, 0, &mux_id))
                return -EINVAL;
 
-       /* mux_id [1 - 0x7f] range empirically found */
-       if (mux_id < 1 || mux_id > 0x7f)
+       /* mux_id [1 - 254] for compatibility with ip(8) and the rmnet driver */
+       if (mux_id < 1 || mux_id > 254)
                return -EINVAL;
 
        if (!rtnl_trylock())