RM500Q-GL download speed issue

Hello,
I’m working on a mt7621 board with RM500Q-GL module with openwrt version, 17.01 and kernel 4.4.198.
I got the qmi_wwan_q driver from the link below -

https://forums.quectel.com/t/rm500q-linux-drivers/11876

The qmi_wwan_q driver version is V1.2.1 and that of QConnectManager is V1.6.1.

ISSUE:
I’m unable to get the 5G download speed more than 100-110 Mbps.
The upload speed is about 100Mbps. When checked on phone, the 5G download speed is about 800Mbps.

1) What is the cause of download speed getting limited to 110Mbps? and How can I increase it to about 800Mbps?

The device is getting connected on 5G (NSA) and is in QMI mode as can be seen from the AT commands shown below.
But from the logs, I can see that the device is registered as RMNET/USB device instead of WWAN/QMI device.

[  238.600722] qmi_wwan_q 2-1:1.4 wwan0: register 'qmi_wwan_q' at usb-1e1c0000.usb-1, RMNET/USB device, 26:5c:b5:e7:46:d3

2) How do i set it back to WWAN/QMI device?

Also, setting qmap_mode to 0 doesn’t up the interface without qmap mode.

insmod qmi_wwan_q.ko qmap_mode=0

Below is the output for usb devices as well as lsusb -t.

cat /sys/kernel/debug/usb/devices 

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 4.04
S:  Manufacturer=Linux 4.4.198 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=1e1c0000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=2c7c ProdID=0800 Rev= 4.14
S:  Manufacturer=Quectel
S:  Product=RM500Q-GL
S:  SerialNumber=85e399e2
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan_q
E:  Ad=88(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 4.04
S:  Manufacturer=Linux 4.4.198 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=1e1c0000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=option, 5000M
    |__ Port 1: Dev 2, If 1, Class=Vendor Specific Class, Driver=option, 5000M
    |__ Port 1: Dev 2, If 2, Class=Vendor Specific Class, Driver=option, 5000M
    |__ Port 1: Dev 2, If 3, Class=Vendor Specific Class, Driver=option, 5000M
    |__ Port 1: Dev 2, If 4, Class=Vendor Specific Class, Driver=qmi_wwan_q, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/2p, 480M

Below are the logs for insmod -

insmod qmi_wwan_q.ko

[  238.562782] qmi_wwan_q 2-1:1.4: cdc-wdm0: USB WDM device
[  238.574453] qmi_wwan_q 2-1:1.4: Quectel RM500Q-GL work on RawIP mode
[  238.588092] qmi_wwan_q 2-1:1.4: rx_urb_size = 31744
[  238.600722] qmi_wwan_q 2-1:1.4 wwan0: register 'qmi_wwan_q' at usb-1e1c0000.usb-1, RMNET/USB device, 26:5c:b5:e7:46:d3
[  238.626013] net wwan0: qmap_register_device wwan0_1
[  238.630083] IPv6: ADDRCONF(NETDEV_UP): wwan0_1: link is not ready
[  238.648496] usbcore: registered new interface driver qmi_wwan_q
[  238.676590] IPv6: ADDRCONF(NETDEV_UP): wwan0: link is not ready

Below are the logs quectel-CM tool -

./quectel-CM &
[         main.c-0847: 06-04_03:59:58:025] QConnectManager_Linux_V1.6.1
[       device.c-0293: 06-04_03:59:58:045] Find /sys/bus/usb/devices/2-1 idVendor=0x2c7c idProduct=0x800, bus=0x002, dev=0x002
[       device.c-0377: 06-04_03:59:58:049] Auto find qmichannel = /dev/cdc-wdm0
[       device.c-0378: 06-04_03:59:58:050] Auto find usbnet_adapter = wwan0
[       device.c-0573: 06-04_03:59:58:052] netcard driver = qmi_wwan_q, driver version = V1.2.1
[qmap_bridge_mode.c-0322: 06-04_03:59:58:060] qmap_mode = 1, qmap_version = 9, qmap_size = 31744, muxid = 0x81, qmap_netcard = wwan0_1
[         main.c-0667: 06-04_03:59:58:061] Modem works in QMI mode
[    QmiWwanCM.c-0341: 06-04_03:59:58:083] cdc_wdm_fd = 7
[    QmiWwanCM.c-0177: 06-04_03:59:58:440] Get clientWDS = 15
[    QmiWwanCM.c-0178: 06-04_03:59:58:472] Get clientDMS = 1
[    QmiWwanCM.c-0179: 06-04_03:59:58:505] Get clientNAS = 4
[    QmiWwanCM.c-0183: 06-04_03:59:58:536] Get clientUIM = 1
[    QmiWwanCM.c-0184: 06-04_03:59:58:568] Get clientWDA = 1
[    QMIThread.c-2183: 06-04_03:59:58:600] requestBaseBandVersion RM500QGLABR11A06M4G
[    QMIThread.c[ 2480.442447] net wwan0: ul_data_aggregation_max_datagrams=11, ul_data_aggregation_max_size=4096, dl_minimum_padding=0
-0752: 06-04_03:59:58:632] qmap_settings.rx_urb_size = 31744
[    QMIThread.c-0761: 06-04_03:59:58:633] qmap_settings.ul_data_aggregation_max_datagrams  = 11
[    QMIThread.c-0767: 06-04_03:59:58:633] qmap_settings.ul_data_aggregation_max_size       = 4096
[    QMIThread.c-0773: 06-04_03:59:58:634] qmap_settings.dl_minimum_padding                 = 0
[    QMIThread.c-0968: 06-04_03:59:58:760] requestGetSIMStatus SIMStatus: SIM_READY
[    QMIThread.c-2063: 06-04_03:59:58:792] requestGetProfile[1] airtelgprs.com///0/IPV4
[    QMIThread.c-1634: 06-04_03:59:58:824] requestRegistrationState2 MCC: 404, MNC: 45, PS: Attached, DataCap: 5G_NSA
[    QMIThread.c-1769: 06-04_03:59:58:856] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[       udhcpc.c-0034: 06-04_03:59:58:865] ifconfig wwan0 down
[       udhcpc.c-0034: 06-04_03:59:58:878] ifconfig wwan0_1 0.0.0.0
[       udhcpc.c-0034: 06-04_03:59:58:888] ifconfig wwan0_1 down
[    QMIThread.c-1815: 06-04_03:59:58:920] requestSetupDataCall WdsConnectionIPv4Handle: 0xfaa330c0
[ 2480.857293] net wwan0: link_state 0x0 -> 0x1
[       udhcpc.c-0034: 06-04_03:59:59:058] ifconfig wwan0 up
[       udhcpc.c-0034: 06-04_03:59:59:070] ifconfig wwan0_1 up
[       udhcpc.c-0159: 06-04_03:59:59:100] busybox udhcpc -f -n -q -t 5 -i wwan0_1
udhcpc: started, v1.25.1
udhcpc: sending discover
udhcpc: sending select for 10.14.9.116
udhcpc: lease of 10.14.9.116 obtained, lease time 7200
[       udhcpc.c-0169: 06-04_03:59:59:493] udhcpc: ifconfig wwan0_1 10.14.9.116 netmask 255.255.255.248 broadcast +
[       udhcpc.c-0169: 06-04_03:59:59:507] udhcpc: setting default routers: 10.14.9.117

I get IP on wwan0_1

wwan0     Link encap:Ethernet  HWaddr 26:5C:B5:E7:46:D3  
          inet6 addr: fe80::245c:b5ff:fee7:46d3/64 Scope:Link
          UP RUNNING NOARP  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:632 (632.0 B)  TX bytes:672 (672.0 B)

wwan0_1   Link encap:Ethernet  HWaddr 26:5C:B5:E7:46:D3  
          inet addr:10.14.9.116  Mask:255.255.255.248
          inet6 addr: fe80::245c:b5ff:fee7:46d3/64 Scope:Link
          UP RUNNING NOARP  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:640 (640.0 B)  TX bytes:672 (672.0 B)
Port /dev/ttyUSB2                                                            
                                                                             
Press CTRL-A Z for help on special keys                                      
                                                                             
at                                                                           
OK
ATI
Quectel
RM500Q-GL
Revision: RM500QGLABR11A06M4G

OK                                                                           
at+cops?                                                                     
+COPS: 0,0,"IND airtel airtel",13                                            
                                                                             
OK                                                          
AT+QNWPREFCFG= "mode_pref"                                  
+QNWPREFCFG: "mode_pref",AUTO                               
                                                            
OK                                                          
at+qcfg="usbnet"                                            

+QCFG: "usbnet",0

OK
AT+QENG="servingcell"
+QENG: "servingcell","NOCONN"
+QENG: "LTE","FDD",404,45,2C0830C,340,1301,3,5,5,2042,-80,-10,-51,14,13,-90,-
+QENG:"NR5G-NSA",404,45,20,-80,16,-11,627936,78,12,1

OK
at+cgdcont?
+CGDCONT: 1,"IP","airtelgprs.com","0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1,,,,,,,,,"",,,,0
+CGDCONT: 4,"IPV4V6","airtelgprs.com","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,,,,,,,,,"",,,,0

OK