root@OpenWrt:~# lspci
00:00.0 Class 0604: 17cb:1001
01:00.0 Class ff00: 17cb:0306
root@OpenWrt:~# 

root@OpenWrt:~# insmod pcie_mhi.ko qmap_mode=4
[  200.906104] mhi_init Quectel_Linux_PCIE_MHI_Driver_V1.3.0.17
[  200.907913] mhi_pci_probe pci_dev->name = 0000:01:00.0, domain=0, bus=1, slot=0, vendor=17CB, device=0306
[  200.912164] mhi_q 0000:01:00.0: BAR 0: assigned [mem 0x48000000-0x48000fff 64bit]
[  200.920593] mhi_q 0000:01:00.0: enabling device (0140 -> 0142)
root@OpenWrt:~# [  201.112214] [I][mhi_netdev_enable_iface] Prepare the channels for transfer
[  201.154640] [I][mhi_netdev_enable_iface] Exited.
[  201.159271] rmnet_vnd_register_device(rmnet_mhi0.1)=0
[  201.162953] rmnet_vnd_register_device(rmnet_mhi0.2)=0
[  201.167698] rmnet_vnd_register_device(rmnet_mhi0.3)=0
[  201.172178] rmnet_vnd_register_device(rmnet_mhi0.4)=0

root@OpenWrt:~# brctl addbr br0
root@OpenWrt:~# brctl addif br0 eth1
root@OpenWrt:~# brctl addif br0 rmnet_mhi0.2
root@OpenWrt:~# brctl show
bridge name	bridge id		STP enabled	interfaces
br0		8000.00001c353487	no		eth1
							                rmnet_mhi0.2
							                
root@OpenWrt:~# quectel-qmi-proxy -d /dev/mhi_QMI0 &
[04-14_06:44:01:556] Will use cdc-wdm='/dev/mhi_QMI0', proxy='quectel-qmi-proxy0'
[04-14_06:44:01:573] qmi_proxy_init enter
[04-14_06:44:01:573] qmi_proxy_loop enter thread_id 0xb6f20d44
[04-14_06:44:03:574] qmi_proxy_init succful
[04-14_06:44:03:574] local server: quectel-qmi-proxy0 sockfd = 4
[04-14_06:44:03:575] qmi_proxy_server_fd = 4


root@OpenWrt:~# quectel-CM -n 1 -s cmnet &
[04-14_06:47:53:303] Quectel_QConnectManager_Linux_V1.6.0.25
[04-14_06:47:53:314] network interface '' or qmidev '' is not exist
[04-14_06:47:53:315] netcard driver = pcie_mhi, driver version = V1.3.0.17
[04-14_06:47:53:316] qmap_mode = 4, qmap_version = 9, qmap_size = 16384, muxid = 0x81, qmap_netcard = rmnet_mhi0.1
[04-14_06:47:53:316] Modem works in QMI mode
[04-14_06:47:53:318] connect to quectel-qmi-proxy0 sockfd = 7
[04-14_06:47:53:318] cdc_wdm_fd = 7
[04-14_06:47:53:326] Get clientWDS = 15
[04-14_06:47:53:329] Get clientDMS = 2
[04-14_06:47:53:334] Get clientNAS = 4
[04-14_06:47:53:338] Get clientUIM = 1
[04-14_06:47:53:343] Get clientWDA = 1
[04-14_06:47:53:347] requestBaseBandVersion RM500QGLABR10A03M4G
[04-14_06:47:53:351] qmap_settings.rx_urb_size = 16384
[04-14_06:47:53:352] qmap_settings.ul_data_aggregation_max_datagrams  = 11
[04-14_06:47:53:352] qmap_settings.ul_data_aggregation_max_size       = 8192
[04-14_06:47:53:352] qmap_settings.dl_minimum_padding                 = 0
[04-14_06:47:53:369] requestGetSIMStatus SIMStatus: SIM_READY
[04-14_06:47:53:370] requestSetProfile[1] cmnet///0
[04-14_06:47:53:402] requestGetProfile[1] cmnet///0
[04-14_06:47:53:407] requestRegistrationState2 MCC: 0, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:47:53:411] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[04-14_06:47:53:412] ifconfig rmnet_mhi0 down
[04-14_06:47:53:436] ifconfig rmnet_mhi0.1 0.0.0.0
[04-14_06:47:53:460] ifconfig rmnet_mhi0.1 down
[04-14_06:48:26:399] requestRegistrationState2 MCC: 460, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:26:405] requestRegistrationState2 MCC: 460, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:26:411] requestRegistrationState2 MCC: 460, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:26:970] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_NSA
[04-14_06:48:26:992] requestSetupDataCall WdsConnectionIPv4Handle: 0x34176710
[04-14_06:48:27:005] ifconfig rmnet_mhi0 up
[04-14_06:48:27:031] ifconfig rmnet_mhi0.1 up
[04-14_06:48:27:057] you are use OpenWrt?
[04-14_06:48:27:057] should not calling udhcpc manually?
[04-14_06:48:27:080] should use "/sbin/ifstaus wan" to check rmnet_mhi0.1 's status?
[04-14_06:48:27:081] busybox udhcpc -f -n -q -t 5 -i rmnet_mhi0.1
[04-14_06:48:27:363] udhcpc: ifconfig rmnet_mhi0.1 10.245.22.3 netmask 255.255.255.248 broadcast +
[04-14_06:48:27:398] udhcpc: setting default routers: 10.245.22.4
[04-14_06:48:27:491] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_NSA

root@OpenWrt:~# quectel-CM -n 2 -s 4gnet -b  &
[04-14_06:48:06:842] Quectel_QConnectManager_Linux_V1.6.0.25
[04-14_06:48:06:853] network interface '' or qmidev '' is not exist
[04-14_06:48:06:854] netcard driver = pcie_mhi, driver version = V1.3.0.17
[04-14_06:48:06:855] qmap_mode = 4, qmap_version = 9, qmap_size = 16384, muxid = 0x82, qmap_netcard = rmnet_mhi0.2
[04-14_06:48:06:855] Modem works in QMI mode
[04-14_06:48:06:857] connect to quectel-qmi-proxy0 sockfd = 7
[04-14_06:48:06:858] cdc_wdm_fd = 7
[04-14_06:48:06:864] Get clientWDS = 16
[04-14_06:48:06:867] Get clientDMS = 3
[04-14_06:48:06:871] Get clientNAS = 5
[04-14_06:48:06:874] Get clientUIM = 2
[04-14_06:48:06:879] Get clientWDA = 2
[04-14_06:48:06:886] requestBaseBandVersion RM500QGLABR10A03M4G
[04-14_06:48:06:891] qmap_settings.rx_urb_size = 16384
[04-14_06:48:06:891] qmap_settings.ul_data_aggregation_max_datagrams  = 11
[04-14_06:48:06:892] qmap_settings.ul_data_aggregation_max_size       = 8192
[04-14_06:48:06:892] qmap_settings.dl_minimum_padding                 = 0
[04-14_06:48:06:909] requestGetSIMStatus SIMStatus: SIM_READY
[04-14_06:48:06:909] requestSetProfile[2] 4gnet///0
[04-14_06:48:06:940] requestGetProfile[2] 4gnet///0
[04-14_06:48:06:944] requestRegistrationState2 MCC: 0, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:06:949] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[04-14_06:48:06:949] ifconfig rmnet_mhi0 down
[04-14_06:48:06:973] ifconfig rmnet_mhi0.2 0.0.0.0
[04-14_06:48:06:998] ifconfig rmnet_mhi0.2 down
[04-14_06:48:26:400] requestRegistrationState2 MCC: 460, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:26:405] requestRegistrationState2 MCC: 460, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:26:411] requestRegistrationState2 MCC: 460, MNC: 0, PS: Detached, DataCap: UNKNOW
[04-14_06:48:26:970] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_NSA
[04-14_06:48:27:220] requestSetupDataCall WdsConnectionIPv4Handle: 0x341450a0
[04-14_06:48:27:228] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_NSA
[04-14_06:48:27:238] ifconfig rmnet_mhi0 up
[04-14_06:48:27:263] ifconfig rmnet_mhi0.2 up
[04-14_06:48:27:313] echo '0xaf51be9' > /sys/class/net/rmnet_mhi0.2/bridge_ipv4

root@OpenWrt:~# ifconfig rmnet_mhi0.1
rmnet_mhi0.1 Link encap:Ethernet  HWaddr 02:50:F4:00:00:00  
          inet addr:10.245.22.3  Mask:255.255.255.248
          inet6 addr: fe80::50:f4ff:fe00:0/64 Scope:Link
          UP RUNNING NOARP  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1836 (1.7 KiB)  TX bytes:2052 (2.0 KiB)

root@OpenWrt:~# ifconfig rmnet_mhi0.2
rmnet_mhi0.2 Link encap:Ethernet  HWaddr 02:50:F4:00:00:00  
          inet6 addr: fe80::50:f4ff:fe00:0/64 Scope:Link
          UP RUNNING NOARP  MTU:1500  Metric:1
          RX packets:347 errors:0 dropped:0 overruns:0 frame:0
          TX packets:795 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:119871 (117.0 KiB)  TX bytes:121254 (118.4 KiB)

root@OpenWrt:~# ifconfig br0 up
[  520.005476] rmnet_mhi0.2 PC Mac Address: 00:0e:c6:a6:6c:f1
[  520.025896] rmnet_mhi0.2 PC Mac Address: 00:0e:c6:a6:6c:f1
[  520.028002] rmnet_mhi0.2 PC Mac Address: 00:0e:c6:a6:6c:f1
[  520.144371] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  520.410052] rmnet_mhi0.2 sip = 0.0.0.0, tip=10.245.27.233, ipv4=10.245.27.233
[  520.414504] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  520.847074] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  521.410241] rmnet_mhi0.2 sip = 0.0.0.0, tip=10.245.27.233, ipv4=10.245.27.233
[  522.410455] rmnet_mhi0.2 sip = 0.0.0.0, tip=10.245.27.233, ipv4=10.245.27.233
[  522.822594] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  523.410638] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.233, ipv4=10.245.27.233
[  523.510028] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  523.997961] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  543.799483] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233
[  543.929301] rmnet_mhi0.2 sip = 10.245.27.233, tip=10.245.27.234, ipv4=10.245.27.233

