From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1300BC433E0 for ; Tue, 9 Mar 2021 10:22:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3A996526C for ; Tue, 9 Mar 2021 10:22:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbhCIKVb (ORCPT ); Tue, 9 Mar 2021 05:21:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbhCIKU7 (ORCPT ); Tue, 9 Mar 2021 05:20:59 -0500 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7E91C06174A for ; Tue, 9 Mar 2021 02:20:58 -0800 (PST) Received: by mail-pg1-x532.google.com with SMTP id n9so7497859pgi.7 for ; Tue, 09 Mar 2021 02:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pNSjqyK0LPyqyWQYbvZumKo7SJVV4crx1fZyzzPnaNs=; b=T+yUcoxevbEmJNoONa0+BBenPFuWKB7cpD1e63zw63BwE7IaMGrco3KARQiF5ASc6r q2sPxAUery7rTfptxjG6h3jquKPfeM2M0mep0jJUVQvqVbI3ELYUhFUjCXJuMDs+Cq// p0RxOgl85MzOYeD2usqDzl3nRc+5qiCMk0Xl7DjtyQusnEka//n7FdLsadc9qkepYMx+ 2NBOX/6h+ACrmWc9PO75l6Iq7lGuqnWLnnE0Mi3s+C+nXUJPgthkBNOnZdJ6s/SWu/cP sTKJiwl6huvrv78eNYiYB6poFZOWcKX+Pz9Js+PuTbOi9DtAfiK8aaB3wCXSMgX0cpoa X/Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pNSjqyK0LPyqyWQYbvZumKo7SJVV4crx1fZyzzPnaNs=; b=N5hbMfJYYydyQF042I4Lg81nb/IMZK/HbuBQj42ChIrCMJBMwO41QPAtkkLtXhjCKK ZKS0LgZ10vpacUQ5OVLmLfNz722OPHnVVMj+TNhTg0G0B0HcUY5WUREA8Vz/yyvv053R agu1mw4naWX5ALOraWMji8o1o2Z99sm7YGiZUMzBwuq4B3Z5LIOpi3x2fvh0Bc6xVIHa O1eGzEgSOUfV/QbZAQyX2gf31j44zKNU5gyOy4mIMa7J2gekUNV+mD3Ll3Q+0hsupNhj FYFCFjutHvYwH+kCj29GPFRCQvtEotwo4C7wgA9rA8ha+uw6RZYT1pC9R56oc+8D2I+y du6g== X-Gm-Message-State: AOAM533soOYCObDOjZQ4pVLyocf7beC37SUwv/fshTEtXMF2HsE6lXj4 uPVxAhOBIFChn15UNEqKmiWTlx58+9kq7kKcRUCDfg== X-Google-Smtp-Source: ABdhPJxi2zpk7PcFQnet3iZZhhQfYdqsYJ5OppLqfcYaWWQ4QbAI4RXP49wyGJ4MslA4plTSMWHpB1/Ue0TATKHKyPg= X-Received: by 2002:aa7:86d9:0:b029:1ef:4f40:4bba with SMTP id h25-20020aa786d90000b02901ef4f404bbamr21859345pfo.54.1615285258264; Tue, 09 Mar 2021 02:20:58 -0800 (PST) MIME-Version: 1.0 References: <1615279336-27227-1-git-send-email-loic.poulain@linaro.org> In-Reply-To: From: Loic Poulain Date: Tue, 9 Mar 2021 11:28:49 +0100 Message-ID: Subject: Re: [PATCH net-next v3] net: Add Qcom WWAN control driver To: Greg KH Cc: Jakub Kicinski , David Miller , linux-arm-msm , Aleksander Morgado , open list , Network Development , Bjorn Andersson , Manivannan Sadhasivam , Hemant Kumar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Greg, On Tue, 9 Mar 2021 at 10:35, Greg KH wrote: > > On Tue, Mar 09, 2021 at 09:42:16AM +0100, Loic Poulain wrote: > > The MHI WWWAN control driver allows MHI Qcom based modems to expose > > different modem control protocols/ports to userspace, so that userspace > > modem tools or daemon (e.g. ModemManager) can control WWAN config > > and state (APN config, SMS, provider selection...). A Qcom based > > modem can expose one or several of the following protocols: > > - AT: Well known AT commands interactive protocol (microcom, minicom...) > > - MBIM: Mobile Broadband Interface Model (libmbim, mbimcli) > > - QMI: Qcom MSM/Modem Interface (libqmi, qmicli) > > - QCDM: Qcom Modem diagnostic interface (libqcdm) > > - FIREHOSE: XML-based protocol for Modem firmware management > > (qmi-firmware-update) > > > > The different interfaces are exposed as character devices, in the same > > way as for USB modem variants (known as modem 'ports'). > > > > Note that this patch is mostly a rework of the earlier MHI UCI > > tentative that was a generic interface for accessing MHI bus from > > userspace. As suggested, this new version is WWAN specific and is > > dedicated to only expose channels used for controlling a modem, and > > for which related opensource user support exist. Other MHI channels > > not fitting the requirements will request either to be plugged to > > the right Linux subsystem (when available) or to be discussed as a > > new MHI driver (e.g AI accelerator, WiFi debug channels, etc...). > > > > This change introduces a new drivers/net/wwan directory, aiming to > > be the common place for WWAN drivers. > > > > Co-developed-by: Hemant Kumar > > Signed-off-by: Hemant Kumar > > Signed-off-by: Loic Poulain > > --- > > v2: update copyright (2021) > > v3: Move driver to dedicated drivers/net/wwan directory > > > > drivers/net/Kconfig | 2 + > > drivers/net/Makefile | 1 + > > drivers/net/wwan/Kconfig | 26 ++ > > drivers/net/wwan/Makefile | 6 + > > drivers/net/wwan/mhi_wwan_ctrl.c | 559 +++++++++++++++++++++++++++++++++++++++ > > 5 files changed, 594 insertions(+) > > create mode 100644 drivers/net/wwan/Kconfig > > create mode 100644 drivers/net/wwan/Makefile > > create mode 100644 drivers/net/wwan/mhi_wwan_ctrl.c > > > > diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig > > index 1ebb4b9..28b18f2 100644 > > --- a/drivers/net/Kconfig > > +++ b/drivers/net/Kconfig > > @@ -501,6 +501,8 @@ source "drivers/net/wan/Kconfig" > > > > source "drivers/net/ieee802154/Kconfig" > > > > +source "drivers/net/wwan/Kconfig" > > + > > config XEN_NETDEV_FRONTEND > > tristate "Xen network device frontend driver" > > depends on XEN > > diff --git a/drivers/net/Makefile b/drivers/net/Makefile > > index f4990ff..5da6424 100644 > > --- a/drivers/net/Makefile > > +++ b/drivers/net/Makefile > > @@ -68,6 +68,7 @@ obj-$(CONFIG_SUNGEM_PHY) += sungem_phy.o > > obj-$(CONFIG_WAN) += wan/ > > obj-$(CONFIG_WLAN) += wireless/ > > obj-$(CONFIG_IEEE802154) += ieee802154/ > > +obj-$(CONFIG_WWAN) += wwan/ > > > > obj-$(CONFIG_VMXNET3) += vmxnet3/ > > obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o > > diff --git a/drivers/net/wwan/Kconfig b/drivers/net/wwan/Kconfig > > new file mode 100644 > > index 0000000..643aa10 > > --- /dev/null > > +++ b/drivers/net/wwan/Kconfig > > @@ -0,0 +1,26 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > +# > > +# Wireless WAN device configuration > > +# > > + > > +menuconfig WWAN > > + bool "Wireless WAN" > > + help > > + This section contains Wireless WAN driver configurations. > > + > > +if WWAN > > + > > +config MHI_WWAN_CTRL > > + tristate "MHI WWAN control driver for QCOM based PCIe modems" > > + depends on MHI_BUS > > + help > > + MHI WWAN CTRL allow QCOM based PCIe modems to expose different modem > > + control protocols/ports to userspace, including AT, MBIM, QMI, DIAG > > + and FIREHOSE. These protocols can be accessed directly from userspace > > + (e.g. AT commands) or via libraries/tools (e.g. libmbim, libqmi, > > + libqcdm...). > > + > > + To compile this driver as a module, choose M here: the module will be > > + called mhi_wwan_ctrl. > > + > > +endif # WWAN > > diff --git a/drivers/net/wwan/Makefile b/drivers/net/wwan/Makefile > > new file mode 100644 > > index 0000000..994a80b > > --- /dev/null > > +++ b/drivers/net/wwan/Makefile > > @@ -0,0 +1,6 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +# > > +# Makefile for the Linux WWAN device drivers. > > +# > > + > > +obj-$(CONFIG_MHI_WWAN_CTRL) += mhi_wwan_ctrl.o > > diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c b/drivers/net/wwan/mhi_wwan_ctrl.c > > new file mode 100644 > > index 0000000..3904cd0 > > --- /dev/null > > +++ b/drivers/net/wwan/mhi_wwan_ctrl.c > > @@ -0,0 +1,559 @@ > > +// SPDX-License-Identifier: GPL-2.0-only > > +/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.*/ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#define MHI_WWAN_CTRL_DRIVER_NAME "mhi_wwan_ctrl" > > So a driver name is the same as the class that is being created? > > That feels wrong, shouldn't the "class" be wwan? The driver does not aim to be THE wwan implementation, given the heterogeneity of WWAN interfaces, so 'wwan' is probably too generic for this bus/vendor specific driver. But since we create a new wwan subdir, maybe we should create a minimal wwan_sysfs.c, that would initially just offer a common class for all WWAN devices (wwan or wwan-ports), as a first step to if not standardize, at least group such devices under the same hat. Otherwise, we can just use the misc class... Any thoughts? > > > +#define MHI_WWAN_CTRL_MAX_MINORS 128 > > Why so many? Right, it's not valid anymore, I'm going to change that. Thanks, Loic