mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Enrico Weigelt, metux IT consult" <lkml@metux.net>
To: Ajay Garg <ajaygargnsit@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Query on how WWAN and Modem interact
Date: Fri, 5 Apr 2019 14:30:49 +0200	[thread overview]
Message-ID: <463b23e5-b84f-9fbe-bb44-7d60077f69aa@metux.net> (raw)
In-Reply-To: <CAHP4M8VDaAQF=5DTNX2SoMmytNwjsa82i1qfx3FnFvpjH4eYVg@mail.gmail.com>

On 29.03.19 05:35, Ajay Garg wrote:

> I am wanting to have some insight on how a modem plugs into the
> linux-kernel at architecture level.

Well, that depends ... which type of modem ? which protocols ?

The most common case are the classical serial modems, attached to
some uart (including those isa or pci cards that just have  speaking AT
commands. Here, somebody needs to do the
dialing (eg. 'chat' command) - after dialing the some daemon
for the corresponding (ppp, uucp, ax25, ...) needs to take over.

With async-ppp (ppp over uart) it goes like this:

* pppd is started, sets up tty, etc
* pppd calls a chat script (usually using 'chat' command) for doing
  the dialing (AT commands) - this subprocess gets the fd to the
  tty as its stdin/stdout
* when this finished, it takes back control and does some ppp handshake
  (line probing, authentication, address/routing handshake, ...)
* then it creates a new ppp* device, attaches the ppp line discipline
  to the tty and assignes this to the new device
* the unix black magic: line disciplies
  -> these are special filters that can be attached to a tty for
     intercepting the traffic, eg. for job control or trivial line
     editing via a terminal, etc
  -> the kernel also has a ppp line discipline which intercepts ppp
     frames that contain IP packets puts them into the ppp network
     interface's rx queue (so pppd won't ever see them), as well as
     writing out the outbound packets back to the tty

Of course, there're are also lots of other kind of modems and protocols
that work differently ...

> Now, we are in a bit of situation, where only the AT-interface (of the
> modem) might be available to us (via a serial /dev/tty interface).

That's the classic old fashioned way - pppd package comes with tools to
handle that. (by the way: I wouldn't like to cope w/ complicated things
like modemmanger, etc).

> Also, using AT-commands to actually set up sockets is also fine.

What do you mean w/ sockets ?

Are you talking about basebands with integrated ip stack ? Those are
nice for tiny MCUs w/o any OS, but tricky to properly integrate into
into the berkeley socket api.

What chips exactly are you talking about ?

> Now, my query is once the AT-commands succesfully set up a socket, how
> does that link to "wwan" interface in "ifconfig" listings.

If the baseband/modem really does the whole IP stack, including sockets,
on its own, the answer most likely is: not at all.

But that depends on what baseband/modem exactly you're talking about.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

      reply	other threads:[~2019-04-05 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  4:35 Ajay Garg
2019-04-05 12:30 ` Enrico Weigelt, metux IT consult [this message]

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=463b23e5-b84f-9fbe-bb44-7d60077f69aa@metux.net \
    --to=lkml@metux.net \
    --cc=ajaygargnsit@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®