summaryrefslogtreecommitdiffstats
path: root/drivers/net/mhi
Commit message (Collapse)AuthorAgeFilesLines
* net: mhi: remove pointless conditional before kfree_skb()Yang Yingliang2021-03-301-2/+1
| | | | | | | | | It already has null pointer check in kfree_skb(), remove pointless pointer check before kfree_skb(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mhi: Allow decoupled MTU/MRULoic Poulain2021-03-293-1/+15
| | | | | | | | | | | | | | | | | | MBIM protocol makes the mhi network interface asymmetric, ingress data received from MHI is MBIM protocol, possibly containing multiple aggregated IP packets, while egress data received from network stack is IP protocol. This changes allows a 'protocol' to specify its own MRU, that when specified is used to allocate MHI RX buffers (skb). For MBIM, Set the default MTU to 1500, which is the usual network MTU for WWAN IP packets, and MRU to 3.5K (for allocation efficiency), allowing skb to fit in an usual 4K page (including padding, skb_shared_info, ...). Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mhi: Add support for non-linear MBIM skb processingLoic Poulain2021-03-291-26/+25
| | | | | | | | | | | | | | | Currently, if skb is non-linear, due to MHI skb chaining, it is linearized in MBIM RX handler prior MBIM decoding, causing extra allocation and copy that can be as large as the maximum MBIM frame size (32K). This change introduces MBIM decoding for non-linear skb, allowing to process 'large' non-linear MBIM packets without skb linearization. The IP packets are simply extracted from the MBIM frame using the skb_copy_bits helper. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mhi: Add mbim protoLoic Poulain2021-02-104-1/+304
| | | | | | | | | | | | | | | | | | | | | | | MBIM has initially been specified by USB-IF for transporting data (IP) between a modem and a host over USB. However some modern modems also support MBIM over PCIe (via MHI). In the same way as QMAP(rmnet), it allows to aggregate IP packets and to perform context multiplexing. This change adds minimal MBIM data transport support to MHI, allowing to support MBIM only modems. MBIM being based on USB NCM, it reuses and copy some helpers/functions from the USB stack (cdc-ncm, cdc-mbim). Note that is a subset of the CDC-MBIM specification, supporting only transport of network data (IP), there is no support for DSS. Moreover the multi-session (for multi-pdn) is not supported in this initial version, but will be added latter, and aligned with the cdc-mbim solution (VLAN tags). This code has been inspired from the mhi_mbim downstream implementation (Carl Yin <carl.yin@quectel.com>). Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mhi: Add rx_length_errors statLoic Poulain2021-02-102-0/+2
| | | | | | | This can be used by proto when packet len is incorrect. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mhi: Create mhi.hLoic Poulain2021-02-102-31/+38
| | | | | | | | Move mhi-net shared structures to mhi header, that will be used by upcoming proto(s). Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mhi: Add dedicated folderLoic Poulain2021-02-102-0/+432
Create a dedicated mhi directory for mhi-net, mhi-net is going to be split into differente files (for additional protocol support). Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>