From patchwork Tue Jan 29 05:01:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 156925 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4229051jaa; Mon, 28 Jan 2019 21:02:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN7/MGTQPt1ptG2x8bLpM0SXXEifpAFCFqwhQo1mmzlQT5KmMN7cR38YVZ4jSBeCgyvM22Fv X-Received: by 2002:a65:64c8:: with SMTP id t8mr22092433pgv.31.1548738127673; Mon, 28 Jan 2019 21:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548738127; cv=none; d=google.com; s=arc-20160816; b=NrGb2SDBFeOsWrs7nNRj+4huCl9jk+LL5ictjtuF1cLusGAf6d0W0k4fhkjTupe0A0 40jX2kWEWrql07yw4Yz5H4Mwtvuyat0mHVzTNptDPCikrC8sJMOVnVpFqcD/e2iLVkPa RQPMaZU+fclHK+HFGy1Yk2FPhyU5kIFzsdKfxJ4XvBRKW6801d1egUWSerJbHEI5yojH Dth7IcObi89akNm9WkoEPGt8SRgJtcMLYQITvh9nx/HFkSMCTJn5Kl1dNgikxZ2VSpyB y7S9MYY8BnPwAYT383QkMlx8EdAFKxrgWU/W2BQ9cyeSIlAoZqRgO4CMe8Ul+kKD5pmn Nufw== 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:mime-version :message-id:date:subject:cc:to:from; bh=nJUOrbFpgSY/o8Oc34Mv7J0Kirvg6x0KszNx11jZPLg=; b=RekbdQYKRmLXetmK6w7oHsMk0CmqBCcxrviZrM0RHq+LBdJq76jS0kQxPESv1sUpfQ WW7eQEY13FSYzBl4BN7JNdxQ2Fd7+cWDqkcohRoCSnctV7L5+ogK32PauweDp25U4MgW G+dN+ptLSWcOsHiREHqYIy0UWr5fA3XpwXeP+u7uG0AW5i8NonvZgyrnQ8eJ+sY3Cudt nh6KtyQpagHLK3GvcqYG27M5mpmLYh2PgSlZgLQan9IC4yxhLS4BAU7Fc0lXgTQrX11i UuYU2x7Iwr3ddStOvQQbdOqmN7teluSXDThIblOCe4+iEyjSSNj+V2Kp5HwcxmFU3BAg F6Og== 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 t75si34775739pfa.170.2019.01.28.21.02.07; Mon, 28 Jan 2019 21:02:07 -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; 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 S1725805AbfA2FBq (ORCPT + 31 others); Tue, 29 Jan 2019 00:01:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:53332 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725267AbfA2FBo (ORCPT ); Tue, 29 Jan 2019 00:01:44 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0F7DDADC2; Tue, 29 Jan 2019 05:01:42 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org, linux-wpan@vger.kernel.org Cc: Alexander Aring , Stefan Schmidt , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, support@enocean.com, =?utf-8?q?Andreas_F=C3=A4rber?= Subject: [RFC net-next 0/4] net: EnOcean prototype driver Date: Tue, 29 Jan 2019 06:01:26 +0100 Message-Id: <20190129050130.10932-1-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This series implements a serdev driver for the EnOcean Serial Protocol (ESP). It follows previous weekend's Z-Wave serdev driver [1], exploring various wireless technologies surrounding LoRa/FSK/OOK in quest of a solid PHY layer. The EnOcean Radio Protocol 1 (ERP1) is based on ASK; ERP2 on FSK for sub-GHz and on IEEE 802.15.4 for 2.4 GHz. The company EnOcean also manufactures some BLE based devices unrelated to ERP or this patchset. ESP3 has been tested with basic host -> module -> host communication and radio transmission via PF_PACKET datagram sockets. ESP2 has only been tested for telegram checksums and served for abstraction. Both handle the same radio telegrams, with transparent translation for ESP2. Note how much further this implementation got on one weekend plus an evening in comparison with [1], thanks to solid, open protocol documentation. Unlike Z-Wave's Command Classes, EnOcean relies on a Learn-in process to interpret incoming telegram data from a certain device ID correctly, i.e., the receiver needs to maintain a mapping from device ID to Equipment Profile. By exposing the radio (sub)telegrams on a socket, userspace still gets to handle all the gory Equipment Profile dependent data, while abstracting the ESP-specific frames and checksumming algorithms. So far no netlink layer was required; BaseID and receiver sensitivity would in theory be ESP2 options, and ESP3 offers several more. The selection of ESP2 vs. ESP3 is done via DT. Again, these have been tested as external modules and lack Kbuild/Makefile integration with the net subsystem for now. A test program is at [2]. The receive path could not yet be tested for lack of devices and is left out. Have a lot of fun! Cheers, Andreas [1] https://patchwork.ozlabs.org/patch/1028209/ [2] https://github.com/afaerber/lora-modules/blob/master/txenocean.c P.S. My conclusion here is that PF_PACKET is a viable alternative to my current PF_LORA, if we extend my recent cfglora patches with more commands: https://lists.infradead.org/pipermail/linux-lpwan/2019-January/000154.html Only downside was that for lack of an include/uapi/linux/enocean.h header file I had to resort to a patch not included here to define ETH_P_ERP2 etc. for lack of obvious ways to prepend my own if_{ether,arp}.h files. Andreas Färber (4): net: Reserve protocol identifiers for EnOcean net: Prepare EnOcean device drivers net: enocean: Add ESP3 driver net: enocean: Prepare ESP2 support drivers/net/enocean/Makefile | 7 + drivers/net/enocean/enocean.c | 124 +++++++++++++ drivers/net/enocean/enocean_esp.c | 287 ++++++++++++++++++++++++++++ drivers/net/enocean/enocean_esp.h | 46 +++++ drivers/net/enocean/enocean_esp2.c | 276 +++++++++++++++++++++++++++ drivers/net/enocean/enocean_esp3.c | 372 +++++++++++++++++++++++++++++++++++++ include/linux/enocean/dev.h | 23 +++ include/uapi/linux/if_arp.h | 1 + include/uapi/linux/if_ether.h | 2 + 9 files changed, 1138 insertions(+) create mode 100644 drivers/net/enocean/Makefile create mode 100644 drivers/net/enocean/enocean.c create mode 100644 drivers/net/enocean/enocean_esp.c create mode 100644 drivers/net/enocean/enocean_esp.h create mode 100644 drivers/net/enocean/enocean_esp2.c create mode 100644 drivers/net/enocean/enocean_esp3.c create mode 100644 include/linux/enocean/dev.h -- 2.16.4