Skip to content

Commit ceed73a

Browse files
Subash Abhinov Kasiviswanathandavem330
Subash Abhinov Kasiviswanathan
authored andcommitted
drivers: net: ethernet: qualcomm: rmnet: Initial implementation
RmNet driver provides a transport agnostic MAP (multiplexing and aggregation protocol) support in embedded module. Module provides virtual network devices which can be attached to any IP-mode physical device. This will be used to provide all MAP functionality on future hardware in a single consistent location. Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cdf4969 commit ceed73a

15 files changed

+1424
-0
lines changed

Documentation/networking/rmnet.txt

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

drivers/net/ethernet/qualcomm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,6 @@ config QCOM_EMAC
5959
low power, Receive-Side Scaling (RSS), and IEEE 1588-2008
6060
Precision Clock Synchronization Protocol.
6161

62+
source "drivers/net/ethernet/qualcomm/rmnet/Kconfig"
63+
6264
endif # NET_VENDOR_QUALCOMM

drivers/net/ethernet/qualcomm/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ obj-$(CONFIG_QCA7000_UART) += qcauart.o
99
qcauart-objs := qca_uart.o
1010

1111
obj-y += emac/
12+
13+
obj-$(CONFIG_RMNET) += rmnet/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# RMNET MAP driver
3+
#
4+
5+
menuconfig RMNET
6+
tristate "RmNet MAP driver"
7+
default n
8+
---help---
9+
If you select this, you will enable the RMNET module which is used
10+
for handling data in the multiplexing and aggregation protocol (MAP)
11+
format in the embedded data path. RMNET devices can be attached to
12+
any IP mode physical device.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Makefile for the RMNET module
3+
#
4+
5+
rmnet-y := rmnet_config.o
6+
rmnet-y += rmnet_vnd.o
7+
rmnet-y += rmnet_handlers.o
8+
rmnet-y += rmnet_map_data.o
9+
rmnet-y += rmnet_map_command.o
10+
obj-$(CONFIG_RMNET) += rmnet.o

0 commit comments

Comments
 (0)