Netdev Archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 3/3] qmi_wwan: Driver for WWAN devices requiring use of the QMI protocol
Date: Thu, 15 Dec 2011 11:52:10 -0600	[thread overview]
Message-ID: <1323971530.23419.13.camel@dcbw.foobar.com> (raw)
In-Reply-To: <87r506b1ap.fsf@nemi.mork.no>

On Thu, 2011-12-15 at 11:02 +0100, Bjørn Mork wrote:
> Dan Williams <dcbw@redhat.com> writes:
> 
> > So I thought the protocol acronym stood for "Qualcomm MSM/Modem
> > Interface"  (see
> > https://www.codeaurora.org/gitweb/quic/le/?p=kernel/msm.git;a=commitdiff;h=5f6f87b51184e13b6c493012de787895d5d18765)
> 
> That's probably correct.  Don't know where I got the messaging part
> from.  Should be corrected....
> 
> > In any case, great work here.  But I'm a bit concerned about how all
> > this should fit together.  QMI is a huge protocol that does everything a
> > modem would ever want to do, and we'd likely want to be able to speak
> > QMI from userspace to the modem too so that modem managers can expose
> > the full functionality of the modems.  For example Gobi modems have a
> > very minimal AT command set and most of the functionality is exposed
> > over QMI or DM.  That's why the Qualcomm GobiNet driver also
> > exposed /dev/qmi for userspace access.
> 
> Yes, I believe some interface should be exported.  But my primary goal
> was to make something that would just work as an ethernet device with a
> minimum of external userspace dependencies.  And this modem seems to
> have a fairly complete set of AT commands anyway.  Ideally I would want
> to stick
> 
>  auto wwan0
>  iface wwan0 inet dhcp
> 
> in my /etc/network/interface and not need any application for that to
> work.  But I realize that I must enter a SIM PIN1 code first (unless
> disabled), and that most users will want to configure a specific APN
> (although the null APN "" most likely will work just fine).
> 
> But I agree that eventually the full QMI protocol should be made
> available to userspace for other uses.  That should be fairly easy to do
> if you just proxy the commands.  But I'm worring about the interface.
> Is the /dev/qmi from GobiNet acceptable?  Why isn't it merged yet?

It would have to be /dev/qmiX (in case you have more than one
QMI-capable card in the system) and it would also have to have the right
sysfs entries so that we could match the qmiX entry up with it's parent
USB interface.  Not entirely sure how to do that.

> Wouldn't something like netlink have been more suitable?  How about
> security and the ability to control privileges on a command to command
> basis?  And are there users?  Note that even the Windows application
> supplied with the modem uses AT commands for SMS sending/receiving etc.
> The snoop I did showed a very minimal set of QMI commands.  These were
> all Windows used for startup of the network interface (partly decoded by
> me):

Huawei writes custom firmware for their dongles.  Gobi devices and other
devices that talk QMI don't  necessarily have such a full quite of AT
commands, yet they all talk the same QMI protocol.  It makes sense to
have a generic driver for this if we can.  That probably means a QMI
core (like you've got with the qmi_wwan stuff) and device-specific
drives.  The Huawei device would use the ECM-like stuff while the Gobi
bits would implement what gobi_net does.  They might even be almost the
same, I haven't looked in a while.  But they are similar enough that
they should be sharing most of the code.

But it gets more complicated.  We also have Novatel and Sierra devices
that are driven by different drivers (option for Novatel, and sierra for
Sierra) and both these vendors have Gobi-based devices that also speak
QMI, but have custom Ethernet interfaces too (sierra_net for example).

The point being that we need some mechanism for exposing QMI on all
these devices, but some of them (ie Huawei) also need to use QMI to make
the Ethernet bits happen.  Some don't.

[snip]

> 
> > Second, does the modem actually respond to DHCP over the ECM interface?
> 
> Yes.  And IMHO that's the only sensible thing to do.  Cannot be very
> difficult to implement that feature in the firmware.  It's not like you

Not quite, Option's method is just fine too (provide an AT command that
prints the IP and DNS information that you then assign to the
interface).  The devices are a lot more complicated than just doing
DHCP, and you're lucky that it works as easily as it does with the
Huawei part :)  Doesn't mean it should necessarily work that way all the
time.

But companies don't necessarily like adding features to firmware.
That's a lot harder to change than features in the driver.  I worked
with Sierra a couple years ago to get the sierra_net driver accepted to
the kernel and in the first round the DHCP bits were in the driver.
Which was unacceptable.  They finally did move it to the firmware but
not all vendors are as easy to work with as Sierra was.

> need to write a dhcp server.  You know you have only a single client on
> the other end of a point-to-point link, and the address configuration is
> given.  And all broadcast/multicast requires special treatment anyway.
> I actually thought about implementing the DHCP functionality in the
> driver before I knew that the firmware already provided this.
> 
> FWIW, the Windows driver implementation also depends on DHCP for address
> configuration .

Good to know.

> > If you take a look at the Android rmnet code (which is similar to your
> > driver) you'll see they extract the IP address and DNS details from the
> > QMI response.  Do we need to do that here too?
> 
> Based on the above, I don't think so.  
> 
> And if you still want to extract address details without using DHCP,
> then that information is available via the AT^DHCP? command anyway.  You
> don't need QMI for that part.

Ok, also good to know.  Honestly I don't really understand why everyone
just uses cdc-ether or cdc-eem these days but apparently they don't.

Dan

  reply	other threads:[~2011-12-15 17:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13  4:33 [PATCH 0/3] Adding a new driver for Huawei E392 WWAN modem Bjorn Mork
     [not found] ` <1323750784-32608-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2011-12-13  4:33   ` [PATCH 1/3] option: Removing one bogus and adding some new Huawei combinations Bjorn Mork
2011-12-13 17:16     ` Greg KH
2011-12-13  4:33   ` [PATCH 2/3] cdc_ether: allow vendor specific data interface if control interface is vendor specific Bjorn Mork
     [not found]     ` <1323750784-32608-3-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2011-12-13  4:54       ` Joe Perches
2011-12-13  4:59         ` Bjørn Mork
     [not found]           ` <87vcplcbj3.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2011-12-13 10:39             ` Sergei Shtylyov
2011-12-13  4:33   ` [PATCH 3/3] qmi_wwan: Driver for WWAN devices requiring use of the QMI protocol Bjorn Mork
     [not found]     ` <1323750784-32608-4-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2011-12-14 17:08       ` Dan Williams
     [not found]         ` <1323882501.2077.3.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2011-12-15 10:02           ` Bjørn Mork
2011-12-15 17:52             ` Dan Williams [this message]
     [not found]               ` <1323971530.23419.13.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2011-12-16 16:03                 ` Bjørn Mork
     [not found]                   ` <874nx0bj1d.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2011-12-16 17:17                     ` Dan Williams
     [not found]                       ` <1324055842.17587.18.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2012-01-04 20:57                         ` Dan Williams
2012-01-05  8:58                           ` Bjørn Mork
2011-12-13  9:02 ` [PATCH 0/3] Adding a new driver for Huawei E392 WWAN modem Bjørn Mork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323971530.23419.13.camel@dcbw.foobar.com \
    --to=dcbw@redhat.com \
    --cc=bjorn@mork.no \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).