Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4841231imm; Mon, 14 May 2018 14:11:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZUgcht4Y3X7l/TNZc9rvNGNpDhcLe5ISgOMCfIYlkoLfH+Sfhqv7UDsGKwKIPDM0B12tv X-Received: by 2002:aa7:8492:: with SMTP id u18-v6mr12010660pfn.225.1526332290698; Mon, 14 May 2018 14:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526332290; cv=none; d=google.com; s=arc-20160816; b=a+vS5LeoIHENbb4C6y3/JIf4sq7mmDCas2OQ5FzGQTCGUMmTOR0+z2lf0obyP24PBF NXYOKu+7aNup42X/r05G55sjjSDe9D6vE+fUC+xqhzrenPcejm0yh4DVNQlHhDyFjBoI roPg/5alUPxEuSRjOJOSDpsq2GXekdvPWURh4f5wlUNX6pSHQNRpWj8tjTEYC+uK/RGR 44qlLMOqgxq1dNcGcze8O32r/HFnRyN3co77yl/Woh+F28Cf1EyyyfS2gImseWxtHy4V DMJR6F5uPRN0ZO6zDZ/puLRQyXtTgC6q41YcXvMDIpHANyoRvI3OUaUMaMTXWlCAQtdY MLYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :arc-authentication-results; bh=Kpb+WtvW9iFvH8x/gsdQoKFj8syCnbVeDqyqAk/OovA=; b=S3EUqVGhLWaMiSilHD/nlDsEehkFIR4eTbgHq48RZyoZKPOKlI8EO3zWQ70zVva0eO 2thRBTv+CunazJmaQV3CEm50C0kO/r3GZN9rGzPnluATy4HpTbGRRAzTjARrB+X4nSSa MCtPobT6uEBbfIfeQ1DILUoVTbZhyLS0zTyH33Sz6llWLKuk2e602+bLIJu3NIAdpfwJ oncm0aONwe3Fx10vouDo737kOeHiafduXnQL5PVmeTXJlHzKxWa4KOaQL2yns5EG3CQ3 R4eyVm4X8qKjW9lbHymd+HYE37+SCNDOBCUwdmFppHk1e3swBBu9Yzb0nxzhqreNzDRb mVFQ== 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 m14-v6si8258385pgs.178.2018.05.14.14.11.16; Mon, 14 May 2018 14:11:30 -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 S1752272AbeENVLG (ORCPT + 99 others); Mon, 14 May 2018 17:11:06 -0400 Received: from gofer.mess.org ([88.97.38.141]:44913 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbeENVLD (ORCPT ); Mon, 14 May 2018 17:11:03 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 37AF560DE7; Mon, 14 May 2018 22:11:01 +0100 (BST) From: Sean Young To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , Mauro Carvalho Chehab , Daniel Borkmann , netdev@vger.kernel.org, Matthias Reichl , Devin Heitmueller Subject: [PATCH v1 0/4] IR decoding using BPF Date: Mon, 14 May 2018 22:10:57 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kernel IR decoders support the most widely used IR protocols, but there are many protocols which are not supported[1]. For example, the lirc-remotes[2] repo has over 2700 remotes, many of which are not supported by rc-core. There is a "long tail" of unsupported IR protocols. IR encoding is done in such a way that some simple circuit can decode it; therefore, bpf is ideal. In order to support all these protocols, here we have bpf based IR decoding. The idea is that user-space can define a decoder in bpf, attach it to the rc device through the lirc chardev. Separate work is underway to extend ir-keytable to have an extensive library of bpf-based decoders, and a much expanded library of rc keymaps. Another future application would be to compile IRP[3] to a IR BPF program, and so support virtually every remote without having to write a decoder for each. Thanks, Sean Young [1] http://www.hifi-remote.com/wiki/index.php?title=DecodeIR [2] https://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/ [3] http://www.hifi-remote.com/wiki/index.php?title=IRP_Notation Sean Young (4): media: rc: introduce BPF_PROG_IR_DECODER media: bpf: allow raw IR decoder bpf programs to be used media: rc bpf: move ir_raw_event to uapi samples/bpf: an example of a raw IR decoder drivers/media/rc/Kconfig | 8 + drivers/media/rc/Makefile | 1 + drivers/media/rc/ir-bpf-decoder.c | 284 ++++++++++++++++++++++ drivers/media/rc/lirc_dev.c | 30 +++ drivers/media/rc/rc-core-priv.h | 15 ++ drivers/media/rc/rc-ir-raw.c | 5 + include/linux/bpf_types.h | 3 + include/media/rc-core.h | 19 +- include/uapi/linux/bpf.h | 17 +- include/uapi/linux/bpf_rcdev.h | 24 ++ kernel/bpf/syscall.c | 7 + samples/bpf/Makefile | 4 + samples/bpf/bpf_load.c | 9 +- samples/bpf/grundig_decoder_kern.c | 112 +++++++++ samples/bpf/grundig_decoder_user.c | 54 ++++ tools/bpf/bpftool/prog.c | 1 + tools/include/uapi/linux/bpf.h | 17 +- tools/testing/selftests/bpf/bpf_helpers.h | 6 + 18 files changed, 594 insertions(+), 22 deletions(-) create mode 100644 drivers/media/rc/ir-bpf-decoder.c create mode 100644 include/uapi/linux/bpf_rcdev.h create mode 100644 samples/bpf/grundig_decoder_kern.c create mode 100644 samples/bpf/grundig_decoder_user.c -- 2.17.0