linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aring@mojatatu.com>
To: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: "Andreas Färber" <afaerber@suse.de>,
	"Jian-Hong Pan" <starnight@g.ncu.edu.tw>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Jiri Pirko" <jiri@resnulli.us>,
	"Marcel Holtmann" <marcel@holtmann.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Matthias Brugger" <mbrugger@suse.com>,
	"Janus Piwek" <jpiwek@arroweurope.com>,
	"Michael Röder" <michael.roeder@avnet.eu>,
	"Dollar Chen" <dollar.chen@wtmec.com>,
	"Ken Yu" <ken.yu@rakwireless.com>,
	"Konstantin Böhm" <konstantin.boehm@ancud.de>,
	"Jan Jongboom" <jan.jongboom@arm.com>,
	"Jon Ortego" <Jon.Ortego@imst.de>,
	contact@snootlab.com, "Ben Whitten" <ben.whitten@lairdtech.com>,
	"Brian Ray" <brian.ray@link-labs.com>,
	lora@globalsat.com.tw, "Alexander Graf" <agraf@suse.de>,
	"Michal Kubeček" <mkubecek@suse.cz>,
	"Rob Herring" <robh@kernel.org>,
	devicetree@vger.kernel.org, "Steve deRosier" <derosier@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	linux-spi@vger.kernel.org,
	"Pieter Robyns" <pieter.robyns@uhasselt.be>,
	"Hasnain Virk" <Hasnain.Virk@arm.com>,
	linux-wpan <linux-wpan@vger.kernel.org>,
	"Stefan Schmidt" <stefan@datenfreihafen.org>,
	"Daniele Comel" <dcomel@mipot.com>,
	"Sebastian Heß" <shess@hessware.de>,
	"Xue Liu" <liuxuenetmail@gmail.com>
Subject: Re: [RFC net-next 00/15] net: A socket API for LoRa
Date: Thu, 9 Aug 2018 11:12:35 -0400	[thread overview]
Message-ID: <20180809151235.4yiu75pnq4ww5mdx@x220t> (raw)
In-Reply-To: <20180809125939.39ac2cc9@alans-desktop>

Hi,

On Thu, Aug 09, 2018 at 12:59:39PM +0100, Alan Cox wrote:
> > Yes, and we are talking about that concrete sx1276 driver here, whose
> > chipset has a state machine that only allows either rx or tx and also
> > has standby and sleep modes with differing levels of data retention.
> 
> It's a hardware limit, it should never influence the protocol stack
> itself just the driver. Linux always tries to design to optimize the
> non-crappy case. In the long term that works out best because hardware
> improves and you don't want to be tied to an old limit.
> 
> > > (Some ancient ethernet cards do this btw.. they can't listen and transmit
> > > at the same time)  
> > 
> > So when do they start receiving?
> 
> When they are not transmitting. The transmit path switches modes and when
> the frame send is done it goes back to receiving. As old ethernet was
> also half duplex that worked.
> 

We do the same at some IEEE 802.15.4 transceivers. A transceiver has
_one_ framebuffer only for tx and rx. Another one has two framebuffer
separated tx and rx, but is half duplex.

There is a little performance tweak in separated framebuffers that you
can fill up the tx framebuffer while the transceiver receives the frame
(completely independet from any bus communicaten/linux handling).

> > The issue here was that my original description, which you appear to
> > have cut, suggested a continuous listen mode, interrupted by transmit.
> 
> I don't think I cut it but if so I didn't mean to and your approach is
> the one I agree with.
> 
...

> 
> There is a heirarchy. Let me us IP for an example
> 
> (historically it was SOCK_PACKET nowdays PF_PACKET - the layering got
> sorted better)
> 
> PF_PACKET SOCK_RAW ETH_P_ALL		
> 
> Everything on that device minus some things like hardware pre-ambles
> 
> PF_PACKET SOCK_RAW ETH_P_SOMETHING
> 
> Everything on that device that has the underlying protocol (and the
> protocol might not be in the packet but a property of the interface
> because it only does that format - simple example SLIP is IP packets over
> a serial link a SLIP interface is IP, not because there is anything
> saying it is but because that is *all* it can be)
> 
> You get the two above for free. PF_PACKET is built into the stack so
> providing you label packets with the ETH_P_xxx you have for Lora, you can
> use PF_PACKET interfaces to dump them and write raw packets at the kernel
> layer.
> 

In 802.15.4:

We recommend nowadays to use PF_PACKET raw sockets for construct L2
frames in userspace. We use that mostly to connect some user space
stacks to make some interop testing without hardware being involved.

For DGRAM sockets, due lack of UAPI limitations of sockaddr_t we
have our own implementation. DGRAM in PF_PACKET use some limitated
feature to "just send something" to an unique address scheme... but some
users need more access because 802.15.4 address scheme is complex.

> PF_INET SOCK_RAW

I think LoRa should look into the 6lowpan subsystem of the Linux kernel
for that. 6lowpan is known as some "IPv6-over-foo" adaptations. Mostly
you just need to implement some mapping from L2 address to SLAAC IPv6 address
pattern only. I see there is a draft at 6lo wg [0] for that which is
expired 2016 (But I would not care about that).

At the end you have a master IP capable interface and your slave is your L2
interface. The 6lowpan interface is a RAW IP interface and do a protocol
translation in the background. On L2 interface you will see L2 + 6LoWPAN
+ $IP_UPPER_LAYER.

Current benefits are more compression, but there exists also some ndisc
optimizations for low power networks which we don't support right now.

- Alex

[0] https://www.ietf.org/archive/id/draft-vilajosana-6lpwa-lora-hc-01.txt

  parent reply	other threads:[~2018-08-09 15:12 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 11:07 [RFC net-next 00/15] net: A socket API for LoRa Andreas Färber
2018-07-01 11:07 ` [RFC net-next 01/15] net: Reserve protocol numbers " Andreas Färber
2018-07-01 11:07 ` [RFC net-next 02/15] net: lora: Define sockaddr_lora Andreas Färber
2018-07-01 11:07 ` [RFC net-next 03/15] net: lora: Add protocol numbers Andreas Färber
2018-07-01 11:07 ` [RFC net-next 04/15] net: Add lora subsystem Andreas Färber
2018-07-01 11:07 ` [RFC net-next 05/15] HACK: net: lora: Deal with .poll_mask in 4.18-rc2 Andreas Färber
2018-07-02 16:22   ` Jiri Pirko
2018-07-02 16:59     ` Andreas Färber
2018-07-01 11:07 ` [RFC net-next 06/15] net: lora: Prepare for device drivers Andreas Färber
2018-07-01 11:07 ` [RFC net-next 07/15] net: lora: Add Semtech SX1276 Andreas Färber
2018-07-01 12:02   ` Andreas Färber
2018-07-01 11:07 ` [RFC net-next 08/15] net: lora: sx1276: Add debugfs Andreas Färber
2018-07-02 16:26   ` Jiri Pirko
2018-07-02 17:57     ` Andreas Färber
2018-07-01 11:07 ` [RFC net-next 09/15] net: lora: Prepare EUI helpers Andreas Färber
2018-07-01 11:07 ` [RFC net-next 10/15] net: lora: Add Microchip RN2483 Andreas Färber
2018-07-01 11:08 ` [RFC net-next 11/15] net: lora: Add IMST WiMOD Andreas Färber
2019-01-06 14:57   ` Heinrich Schuchardt
2019-01-07 11:29     ` Andreas Färber
2018-07-01 11:08 ` [RFC net-next 12/15] net: lora: Add USI WM-SG-SM-42 Andreas Färber
2018-07-01 11:08 ` [RFC net-next 13/15] net: lora: Prepare RAK RAK811 Andreas Färber
2018-07-01 11:08 ` [RFC net-next 14/15] net: lora: Prepare Semtech SX1257 Andreas Färber
2018-07-01 11:08 ` [RFC net-next 15/15] net: lora: Add Semtech SX1301 Andreas Färber
2018-07-02 11:51   ` Ben Whitten
2018-07-03  3:01     ` Andreas Färber
2018-07-05  8:59       ` Ben Whitten
2018-07-02 16:12   ` Mark Brown
2018-07-02 17:34     ` Andreas Färber
2018-07-02 20:43       ` Ben Whitten
2018-07-03  3:21         ` Andreas Färber
2018-07-05  8:43           ` Ben Whitten
2018-07-03 14:50       ` Mark Brown
2018-07-03 15:09         ` Andreas Färber
2018-07-03 15:31           ` Mark Brown
2018-07-03 16:40             ` Andreas Färber
2018-07-04 11:43               ` Mark Brown
2018-07-04 13:41                 ` Ben Whitten
2018-07-04 14:32                   ` Mark Brown
2018-07-03 15:11 ` [RFC net-next 00/15] net: A socket API for LoRa Jian-Hong Pan
2018-08-05  0:11   ` Andreas Färber
2018-08-08 20:36     ` Alan Cox
2018-08-08 22:42       ` Andreas Färber
2018-08-09 11:59         ` Alan Cox
2018-08-09 15:02           ` Jian-Hong Pan
2018-08-09 15:21             ` Alexander Aring
2018-08-10 15:57             ` Alan Cox
2018-08-11 18:30               ` Stefan Schmidt
2018-08-12 16:49                 ` Andreas Färber
2018-08-12 16:37               ` Jian-Hong Pan
2018-08-12 17:59                 ` Andreas Färber
2018-08-13 12:36                   ` Alan Cox
2018-08-09 15:12           ` Alexander Aring [this message]
2018-08-09  0:50     ` Andreas Färber
2018-07-04 18:26 ` Stefan Schmidt
2018-07-05 10:43   ` Helmut Tschemernjak
2018-07-11  2:07     ` Andreas Färber
2018-07-11 11:45       ` Helmut Tschemernjak
2018-07-11 15:21 ` Ben Whitten
2018-07-15 18:13   ` Andreas Färber
2018-07-18 11:28     ` Ben Whitten
2018-08-02  7:52       ` Jian-Hong Pan
2018-08-03  8:44         ` linux-lora.git and LoRaWAN (was: [RFC net-next 00/15] net: A socket API for LoRa) Andreas Färber
2018-08-05 12:49           ` Jian-Hong Pan
2018-08-05 13:49       ` [RFC net-next 00/15] net: A socket API for LoRa Andreas Färber

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=20180809151235.4yiu75pnq4ww5mdx@x220t \
    --to=aring@mojatatu.com \
    --cc=Hasnain.Virk@arm.com \
    --cc=Jon.Ortego@imst.de \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=ben.whitten@lairdtech.com \
    --cc=brian.ray@link-labs.com \
    --cc=broonie@kernel.org \
    --cc=contact@snootlab.com \
    --cc=davem@davemloft.net \
    --cc=dcomel@mipot.com \
    --cc=derosier@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dollar.chen@wtmec.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=jan.jongboom@arm.com \
    --cc=jiri@resnulli.us \
    --cc=jpiwek@arroweurope.com \
    --cc=ken.yu@rakwireless.com \
    --cc=konstantin.boehm@ancud.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=liuxuenetmail@gmail.com \
    --cc=lora@globalsat.com.tw \
    --cc=marcel@holtmann.org \
    --cc=mbrugger@suse.com \
    --cc=michael.roeder@avnet.eu \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=pieter.robyns@uhasselt.be \
    --cc=robh@kernel.org \
    --cc=shess@hessware.de \
    --cc=starnight@g.ncu.edu.tw \
    --cc=stefan@datenfreihafen.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 NNTP newsgroup(s).