Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3927713imu; Tue, 18 Dec 2018 06:30:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/UVnb+W66foThmPEJgZGh7EwHhPrTb+08g9GdZ6feN4OY6txcgQa24oV5C1+buOTHW85k1H X-Received: by 2002:a17:902:d911:: with SMTP id c17mr17168410plz.151.1545143415950; Tue, 18 Dec 2018 06:30:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545143415; cv=none; d=google.com; s=arc-20160816; b=KQzOvpTvDZIRkbdqM2l2k90hD9u37XbJQbqRl8rtlZar7tnvrSSkkB0uFftxbrIwKe xN610gJ6n/JtAjwh94dQI4pGg1KmBPuPDIlB41ISkEP6qsZHNEDpDlNrZk+/NweZzCS0 8MAOpXwmDdy1FOcZN/Gs2ECot+1b8llBbJO4CPO1N2hpCSADHULaoQhskDllDk/TT70c 5cdCxFs8/0RNy+FyQBW7AbYSEfuuNnOGIwQQ8qFNe7d41UDm34J0VMJFmKQk+MvqixfK 8WvZKrOZqT7JuLb1VrEXL9WEgHUEX+KFs+YXPFRfx9bCyj6sFACNx77dk+giacqaeV0Y uGKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rBrK8cQ72TbNjqCTL0/cxQjz7lUhccTjfnchQwNrscc=; b=L0yCl4P/cRB+jZ+YJSFs9OsOb6dwMxV185NiQEWm6O9p7Pwb8rOapYeVoWsZSSLfhv g3BbpVEUa/TnLP/hIPQD7HDh/vqUZtOj0F4ZcHFGioRilONRtDAi8OvEW4mvpEbEnYjl a1XoUyFfWa/+YoJkcOvC0cI3oACKIVV6bqK6pkqIY138O0wU8I1vP4/6YAkh2WpDHnM9 kHsgm1Rthg25jvK82/s4kymG64a2e2iLPHe1pRK8cFruI7Nm16BwFUmV44RWleyKjpcJ oPzBNycwRcGFpA6fH1ZcNr7UxHDbKkZYjAwFSKZXuxs5TTIxOvFjZ0FeZbBOk67rnJPL 8arQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@g.ncu.edu.tw header.s=google header.b=m1jJLvGY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si13281509pgl.457.2018.12.18.06.30.00; Tue, 18 Dec 2018 06:30:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@g.ncu.edu.tw header.s=google header.b=m1jJLvGY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727089AbeLRO1H (ORCPT + 99 others); Tue, 18 Dec 2018 09:27:07 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:37319 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbeLRO1H (ORCPT ); Tue, 18 Dec 2018 09:27:07 -0500 Received: by mail-ot1-f66.google.com with SMTP id 40so15816983oth.4 for ; Tue, 18 Dec 2018 06:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=g.ncu.edu.tw; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rBrK8cQ72TbNjqCTL0/cxQjz7lUhccTjfnchQwNrscc=; b=m1jJLvGYGeGJSTC2uwsAU1GbC48Vi3+LLS+/7Zn9Y2SoaAUQzYQNzKw/escLXzVDBV 5noCt9Ql2cjw7LarZTxqZGVaQbMoSh0II/Va6TJNI2/7DyQiCf3i7teZw0gpawx20Ihm Sgl0EwXsgt0dFJ5iaWeh60xb4tF0DWl5UX5EQ= 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=rBrK8cQ72TbNjqCTL0/cxQjz7lUhccTjfnchQwNrscc=; b=U0ZypZwRgN67EcugKzP24xGXE2UTuAS+m5wHAhKHFEJyiZAj9hw6tVQNl8vPpf3/+r AoKXAhSPm5Z+v8rZShMBrSguEyUx5nyrNxOjBHCF+WyfeRaxYYFN7onuGzg+qTFuk+f0 6KUfXVBknGZ7MssBFaVBJzomqZ0bpZehREPZhsWe/Mk1gHYDDMJVAEGHs9gZj9tZXX4Y i6wIFW9uoO1TFghYu0xJ0pBYAPr4DcwByYqRuZv7P8OSVg21brBtI8ZKkRSBM88Yilrf 60NojzKbXnK2CsN3NqVJZV9d4+vv5uzIdaXslHA2ZBG/7g18hDNjXv0A2mVaM/yzWOWi 9pJw== X-Gm-Message-State: AA+aEWbaOg+qEJr5Bab7rYlY9Cuz6jgNh8KCOPnAxsz0yPgZTi15z9Ow 8DtQCtHiRoqS0iXTV7gDTryWSQ== X-Received: by 2002:a05:6830:13c2:: with SMTP id e2mr11661728otq.15.1545143225081; Tue, 18 Dec 2018 06:27:05 -0800 (PST) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com. [209.85.210.42]) by smtp.gmail.com with ESMTPSA id 4sm7775041otw.39.2018.12.18.06.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Dec 2018 06:27:04 -0800 (PST) Received: by mail-ot1-f42.google.com with SMTP id t5so15861644otk.1; Tue, 18 Dec 2018 06:27:03 -0800 (PST) X-Received: by 2002:a9d:77d4:: with SMTP id w20mr12017080otl.196.1545143223416; Tue, 18 Dec 2018 06:27:03 -0800 (PST) MIME-Version: 1.0 References: <20181216101858.9585-6-starnight@g.ncu.edu.tw> <20181217140233.GG2096@nanopsycho> In-Reply-To: <20181217140233.GG2096@nanopsycho> From: Jian-Hong Pan Date: Tue, 18 Dec 2018 22:27:09 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 5/6] net: maclorawan: Implement maclorawan class module To: Jiri Pirko Cc: =?UTF-8?Q?Andreas_F=C3=A4rber?= , "David S . Miller" , Alan Cox , linux-lpwan@lists.infradead.org, netdev@vger.kernel.org, ", "linux-kernel@vger.kernel.org>," , Marcel Holtmann , Dollar Chen , Ken Yu , linux-wpan - ML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Sun, Dec 16, 2018 at 11:18:59AM CET, starnight@g.ncu.edu.tw wrote: > >LoRaWAN defined by LoRa Alliance(TM) is the MAC layer over LoRa devices. > > > >This patch implements part of Class A end-devices SoftMAC defined in > >LoRaWAN(TM) Specification Ver. 1.0.2: > >1. End-device receive slot timing > >2. Only single channel and single data rate for now > >3. Unconfirmed data up/down message types > > > >On the other side, it defines the basic interface and operation > >functions for compatible LoRa device drivers. > > > >Signed-off-by: Jian-Hong Pan > >--- > >V2: > >- Split the LoRaWAN class module patch in V1 into LoRaWAN socket and > > LoRaWAN Soft MAC modules > >- Modify for Big/Little-Endian > >- Use SPDX license identifiers > > > >V3: > >- Remove the decoration word - inline of the functions > >- Order local variables from longest to shortest line in the functions > >- Change the calling mac_cb function to lrw_get_mac_cb macro > > > >V4: > >- Fix the delay period between RX window#1 and window#2 > >- Fix by coding style report from scripts/checkpatch.pl > > > >V5: > >- Initial rx_skb_list when it is allocated with LoRa hardware > >- Check the sk_buff's data length before access it > >- Deal FPort field and decrypt payload in lrw_parse_frame function > >- Drop the recieved frame if parse failed > >- Fix the bug which passes wrong skb properties from maclorawan to lorawan module > > > > net/maclorawan/Kconfig | 14 + > > net/maclorawan/Makefile | 2 + > > net/maclorawan/mac.c | 555 ++++++++++++++++++++++++++++++++++++ > > net/maclorawan/main.c | 606 ++++++++++++++++++++++++++++++++++++++++ > > 4 files changed, 1177 insertions(+) > > create mode 100644 net/maclorawan/Kconfig > > create mode 100644 net/maclorawan/Makefile > > create mode 100644 net/maclorawan/mac.c > > create mode 100644 net/maclorawan/main.c > > > I don't get it. In patch "Add LoRaWAN API declaration for LoRa devices" > you add headers for "API" and here you implement functions. That is just > weird. Does it mean you can have other implementations? LoRaWAN defined by LoRa Alliance(TM) is the MAC layer over LoRa PHY. This part is soft-MAC as Andreas mentioned http://lists.infradead.org/pipermail/linux-lpwan/2018-December/000010.html > Also, you don't really have any user of this API in the set. Please > introduce at least 1 driver, preferably more (I see that Andreas has > multiple ones in his patchset). You cannot push kernel infrastructure > without kernel user. The soft-MAC is suitable for the LoRa chips' device drivers, like sx1276/77/78/79, RFM95/96/97/98W ... Still waiting for Andreas' sx1276 version 2 patch and more discussion. For example, how to make PF_LORA and PF_LORAWAN like Ethernet, PF_INET and PF_INET6 don't need separate devices either, both use eth0. https://lkml.org/lkml/2018/8/3/266 Jian-Hong Pan