Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp192956imm; Fri, 3 Aug 2018 01:46:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcUoy/nXYOz3JeXAiJ1TDeLc9z2gejoohbQZSUGBcgvEkrn1ZO7Er1Hu5qPOp7rjPv6pJ+u X-Received: by 2002:a17:902:7287:: with SMTP id d7-v6mr2665575pll.54.1533285971650; Fri, 03 Aug 2018 01:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533285971; cv=none; d=google.com; s=arc-20160816; b=rEX9YfDrdBg10XZ4aJxq/RaBnu0eR1xH0LT4TyICsTivulPaRj8RPAMZomLmaMTxI+ WLnHCFKYDn3GuTKcyIdsy0ApsWV40AeQowiZ+M2vnwi+vYHC7i+4AaEO+2BcDrgP9Km7 Kiq5J1mCkP+rqoF78TtoPgqXS2vcKbYix+J/iHvmDSI+Czmde+xXDTLrSM1yNyTMzGYs z1qY5S5/m1NYJzPaQNh4dE75GUPzONVa6g+eSru04wT4JUg8O0am3ndi2XB45fBwwRdA eADpDp4bBtzeMmNnWfFreBQZ0XB4vU22KK1VwrO8Fsqq53HvdOdJjzCtHmIJK+Wji8oB HkXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject:arc-authentication-results; bh=kM6Ir0YX7rJXLpsxk8BqEtexznw/dQ9djcLnqdpK0So=; b=mytJHReBLlKVduePFqisnog9F5htnEkBL31PPABiD8VwWfid3nIpGX34r/4DhdMzX2 0ljv54sVFbTCt5GnaoX6yk+MQrpmqJyEZmS/qVZwdn2so0MeKhcXAvsyqf3e9yAKwWCv y/R0cWwIrwN4+ZRxB4dghkWgz1lT4F/ZMqiVMLQdzNK0+7jsQChGeHXApSny3lWZR5rG XjwyWhjaIfbEOjgGCJTIL9z5PaS31qpP0/HsWettJVEtrBj2mTBUVIkZzM5wz2cKS/Js 6htb6xwhqn5qdjnrj4L7xkPHUoi1kZxwTT0yXB03/Re/k1BlmAMvbh9l1+9Gp9N+tvgO Ouxg== ARC-Authentication-Results: i=1; mx.google.com; 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 v25-v6si4302233pgk.555.2018.08.03.01.45.57; Fri, 03 Aug 2018 01:46:11 -0700 (PDT) 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; 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 S1732336AbeHCKkI (ORCPT + 99 others); Fri, 3 Aug 2018 06:40:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:55974 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728442AbeHCKkH (ORCPT ); Fri, 3 Aug 2018 06:40:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 488C1ADBA; Fri, 3 Aug 2018 08:44:47 +0000 (UTC) Subject: linux-lora.git and LoRaWAN (was: [RFC net-next 00/15] net: A socket API for LoRa) To: Jian-Hong Pan Cc: Ben Whitten , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Jiri Pirko , Marcel Holtmann , "David S. Miller" , Matthias Brugger , Janus Piwek , =?UTF-8?Q?Michael_R=c3=b6der?= , Dollar Chen , Ken Yu , =?UTF-8?Q?Konstantin_B=c3=b6hm?= , Jan Jongboom , "contact@snootlab.com" , Brian Ray , "lora@globalsat.com.tw" , Alexander Graf , =?UTF-8?Q?Michal_Kube=c4=8dek?= , Rob Herring , "devicetree@vger.kernel.org" , Steve deRosier , Mark Brown , "linux-spi@vger.kernel.org" , Hasnain Virk , Stefan Schmidt , "linux-wireless@vger.kernel.org" , "seth.forshee@canonical.com" , Jon Ortego , Daniele Comel , Powen Ko References: <20180701110804.32415-1-afaerber@suse.de> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Openpgp: preference=signencrypt Autocrypt: addr=afaerber@suse.de; prefer-encrypt=mutual; keydata= xsFNBE6W6ZQBEAC/BIukDnkVenIkK9O14UucicBIVvRB5WSMHC23msS+R2h915mW7/vXfn+V 0nrr5ECmEg/5OjujKf0x/uhJYrsxcp45nDyYCk+RYoOJmGzzUFya1GvT/c04coZ8VmgFUWGE vCfhHJro85dZUL99IoLP21VXEVlCPyIngSstikeuf14SY17LPTN1aIpGQDI2Qt8HHY1zOVWv iz53aiFLFeIVhQlBmOABH2Ifr2M9loRC9yOyGcE2GhlzgyHGlQxEVGFn/QptX6iYbtaTBTU0 c72rpmbe1Nec6hWuzSwu2uE8lF+HYcYi+22ml1XBHNMBeAdSEbSfDbwc///8QKtckUzbDvME S8j4KuqQhwvYkSg7dV9rs53WmjO2Wd4eygkC3tBhPM5s38/6CVGl3ABiWJs3kB08asUNy8Wk juusU/nRJbXDzxu1d+hv0d+s5NOBy/5+7Pa6HeyBnh1tUmCs5/f1D/cJnuzzYwAmZTHFUsfQ ygGBRRKpAVu0VxCFNPSYKW0ULi5eZV6bcj+NAhtafGsWcv8WPFXgVE8s2YU38D1VtlBvCo5/ 0MPtQORqAQ/Itag1EHHtnfuK3MBtA0fNxQbb2jha+/oMAi5hKpmB/zAlFoRtYHwjFPFldHfv Iljpe1S0rDASaF9NsQPfUBEm7dA5UUkyvvi00HZ3e7/uyBGb0QARAQABzSJBbmRyZWFzIEbD pHJiZX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VOu+Ees RAEdbtRt37A8brlb/ENxbLd9SGC8/j20FQjit7oPNMkTJDs7Uo2eb7WxOt5pSTVVqZkv7Q== Organization: SUSE Linux GmbH Message-ID: <6dda350b-66ab-b5ab-41ed-319b27e4e28c@suse.de> Date: Fri, 3 Aug 2018 10:44:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jian-Hong, Am 02.08.2018 um 09:52 schrieb Jian-Hong Pan: > 2018-07-18 19:28 GMT+08:00 Ben Whitten : >>> 1) PF_LORA/AF_LORA and associated identifiers are >>> proposed to represent >>> this technology. While for an SX1276 [...] it >>> might work to >>> layer LoRaWAN as a protocol option for PF_LORA and > add >>> LoRaWAN address >>> fields to the union in my sockaddr_lora, how would that >>> work for devices >>> that only support LoRaWAN but not pure LoRa? Do we >>> need both AF_LORA and >>> AF_LORAWAN, or just a separate ETH_P_LORAWAN or >>> ARPHRD_LORAWAN? [...] >>> Meanwhile my attempt to play with netlink during SUSE >>> Hackweek has been >>> going slow and I could use some guidance or a volunteer to >>> contribute: I >>> have a bare skeleton of registration, commands, attributes >>> and multicast >>> groups, but no plan yet how to connect that to the actual >>> drivers to >>> query or apply the settings... >> >> Happy to help, I will be starting from zero on netlink but I can contribute my existing work incorporating Marks comments for sx1301 etal. >> >>> https://git.kernel.org/pub/scm/linux/kernel/git/afaerber/li >>> nux-lora.git/tree/net/lora/netlink.c?h=lora-next > > Is this the repository used for the LoRa subsystem now?!!! > If it is, than great! Yes, my linux-lora.git contains this RFC patchset (modulo SX1276 fixes spotted by kbuild bot) plus a new serdev driver for another module and ongoing work by Ben and me for refactoring SX1301. It's monitored by the 0-day test service (kbuild bot). As this patchset was an RFC and does not have any Acked-bys from maintainers, the tree does not have a for-next branch integrated into linux-next on basis of 4.18-rc1, but instead (like my personal GitHub tree before) has a lora-next branch that rebases as patch queue on top of linux-next for now. The intent is to allow collaboration on getting things into a state that I can later submit a clean (squashed) RFC v2 for review, with all issues raised for this v1 addressed. For contributing patches to my linux-lora.git I suggest to use --subject-prefix="PATCH lora-next" to distinguish from net-next. And I just realize I should add a MAINTAINERS entry in my tree to make sure patches CC me, too. (I do monitor netdev for patches with subject "lora", but chances are someone might omit that.) > As the previous mails, I am trying to implement the LoRaWAN > specification as the soft MAC as the MAC layer over LoRa PHY. > This is the the talk about LoRaWAN class module I gave in Netdev Conf > https://www.slideshare.net/chienhungpan/lorawan-class-module-and-subsystem > > The expectation is: > > socket APIs: > send and receive the data > ------------------------------------------------------------ > LoRaWAN class module implements MAC: > append the header/footer, encryption/decryption, timing slot and MAC commands > ------------------------------------------------------------ > LoRa device drivers: > send and receive the messages for MAC layer > ------------------------------------------------------------ > LoRa devices Thanks for sharing your slides. We seem to be in alignment for the abstract concept above. The devil is in the implementation details. ^.- > Is it possible that combine the LoRaWAN class module I implemented? Yes, as stated in this cover letter, I would love if you could help merge your LoRaWAN implementation with my driver framework. Comparing 802.15.4 and 802.11, I think MAC code should go into net/maclorawan/ and then is a fairly independent module, with you as maintainer. > I start from the simplest class A end device's behavior, especially > the timing slot. > Also the encryption/decryption for uplink/downlink data messages. > I can send it as patches. > > However, I have 2 problems right now. > 1. Which Address and Protocol Family should we use? PF_LORA or PF_LORAWAN? That was one of the questions I raised above. I now think we need both. I'm not yet too deep into LoRaWAN, but from the AT command interfaces I've seen there's confirmed and unconfirmed transmission modes that with PF_LORAWAN might be mapped to SOCK_STREAM and SOCK_DGRAM. Or do you see a way of doing both on a single PF_LORA SOCK_LORAWAN socket? > 2. To test the LoRaWAN class module, adding more procedures in LoRa > device drivers to register as a LoRaWAN device is needed. No, I don't think so. There are (at least) two types of devices, LoRaWAN and LoRa devices. The SX1276 is a pure LoRa device and thus should only expose a LoRa network device. It'll be the task of the maclorawan module to translate between the two layers, not the business of the device driver; SX1276 should receive a ready-to-send LoRa skb. For Ethernet, PF_INET and PF_INET6 don't need separate devices either, both use eth0. What I do think we need is your struct lora_hw, maybe renamed to lora_phy. That could be the missing piece for registration of the device drivers with nllora module? Note that similarly we'll also need an nllorawan module that needs to work both with your maclorawan and with some of my device drivers that implement the MAC in an MCU. Additionally I've been looking into socket options at PF_LORA dgram layer for some radio options, but discarded that again for lack of precedence. Basically I wondered whether we could allow to choose SF, bandwidth, etc. on socket level and then apply those settings before sending one packet rather than expecting a global netlink operation that affects all sockets for that interface. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)