1.. SPDX-License-Identifier: GPL-2.0 2 3============ 4Rmnet Driver 5============ 6 71. Introduction 8=============== 9 10rmnet driver is used for supporting the Multiplexing and aggregation 11Protocol (MAP). This protocol is used by all recent chipsets using Qualcomm 12Technologies, Inc. modems. 13 14This driver can be used to register onto any physical network device in 15IP mode. Physical transports include USB, HSIC, PCIe and IP accelerator. 16 17Multiplexing allows for creation of logical netdevices (rmnet devices) to 18handle multiple private data networks (PDN) like a default internet, tethering, 19multimedia messaging service (MMS) or IP media subsystem (IMS). Hardware sends 20packets with MAP headers to rmnet. Based on the multiplexer id, rmnet 21routes to the appropriate PDN after removing the MAP header. 22 23Aggregation is required to achieve high data rates. This involves hardware 24sending aggregated bunch of MAP frames. rmnet driver will de-aggregate 25these MAP frames and send them to appropriate PDN's. 26 272. Packet format 28================ 29 30a. MAP packet (data / control) 31 32MAP header has the same endianness of the IP packet. 33 34Packet format:: 35 36 Bit 0 1 2-7 8 - 15 16 - 31 37 Function Command / Data Reserved Pad Multiplexer ID Payload length 38 Bit 32 - x 39 Function Raw Bytes 40 41Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command 42or data packet. Control packet is used for transport level flow control. Data 43packets are standard IP packets. 44 45Reserved bits are usually zeroed out and to be ignored by receiver. 46 47Padding is number of bytes to be added for 4 byte alignment if required by 48hardware. 49 50Multiplexer ID is to indicate the PDN on which data has to be sent. 51 52Payload length includes the padding length but does not include MAP header 53length. 54 55b. MAP packet (command specific):: 56 57 Bit 0 1 2-7 8 - 15 16 - 31 58 Function Command Reserved Pad Multiplexer ID Payload length 59 Bit 32 - 39 40 - 45 46 - 47 48 - 63 60 Function Command name Reserved Command Type Reserved 61 Bit 64 - 95 62 Function Transaction ID 63 Bit 96 - 127 64 Function Command data 65 66Command 1 indicates disabling flow while 2 is enabling flow 67 68Command types 69 70= ========================================== 710 for MAP command request 721 is to acknowledge the receipt of a command 732 is for unsupported commands 743 is for error during processing of commands 75= ========================================== 76 77c. Aggregation 78 79Aggregation is multiple MAP packets (can be data or command) delivered to 80rmnet in a single linear skb. rmnet will process the individual 81packets and either ACK the MAP command or deliver the IP packet to the 82network stack as needed 83 84MAP header|IP Packet|Optional padding|MAP header|IP Packet|Optional padding.... 85 86MAP header|IP Packet|Optional padding|MAP header|Command Packet|Optional pad... 87 883. Userspace configuration 89========================== 90 91rmnet userspace configuration is done through netlink library librmnetctl 92and command line utility rmnetcli. Utility is hosted in codeaurora forum git. 93The driver uses rtnl_link_ops for communication. 94 95https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/dataservices/tree/rmnetctl 96