Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp520748imm; Tue, 15 May 2018 05:20:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq4Cr6PXWjvuwrbN6eZPMraEeu+P8StY0yPEgLaRoAewLqhdDCkzn4kiGTP++/r+xBaAnVI X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr13998963pld.163.1526386819332; Tue, 15 May 2018 05:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526386819; cv=none; d=google.com; s=arc-20160816; b=zNkxkxV4SZrgfVtw+U9BsCJJotBvsvrc19ziLdPEYKbKI1dIxdPr2jXjekQWmeENcB NtT0co0dXEP04cJhyQJ8gIRFi5J5CbEYQuSt4+Mefj4j+O+jaH0uXt9zUOBrxE0SJ8am cOgmPLMRIy7LnwOHcLa5vXIsqH0So5rVfinA6WByhi4YKy2syKSYnBazZXl2pGB+hQtD u/4qq97F5+/zDeerMkSdRDZ+m4BLhCVGsj/pwrdeEBD613xGyqYr4/FI+xD0+9c4F0kZ DuXL59fyvLX40nbVNBbvK5SH25n+S17+KoqvooMPbAeTu6fULGPLVdqQJSiPYd6AlY+b iUsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=JMs40i8BttwnMoQ0/nh5uRKbNnDYA2VESKfQOdJO/H4=; b=CAvc+lsTQpCS1DBI8MFvfQ8/SkaTJ7TIfw9Lidkg0xLaD8w7XlSYf72usPrxhjdYq5 LdMc6xDmobDzMmw8hEfaqIcEo7H0tUDQ6bOx26hN7GTch515ktH1bVkagi+353HFvRx6 O2YEdcLGdsIS/qORew/zikNd6yStQ5FlFFwFA3jdFiCNcl0+1hmGAhuGnBi/MUblClGC ajg9+zQ5emOhsXwlCHIBi820//Dx7sTzIIR+Of0VJYtlvnEAhK0Nu+0rHK729p7xa0wQ 2RWcyP24DLlOTe9hVyyRz81m3h2yuux2ahh5yUgk5U4AqnyyQqK0IS7pxz2pabShI+4j Ts0Q== 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 g8-v6si2575690pgr.474.2018.05.15.05.20.05; Tue, 15 May 2018 05:20:19 -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 S1753302AbeEOMTl (ORCPT + 99 others); Tue, 15 May 2018 08:19:41 -0400 Received: from gofer.mess.org ([88.97.38.141]:43053 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbeEOMTg (ORCPT ); Tue, 15 May 2018 08:19:36 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id DCE8160DE7; Tue, 15 May 2018 13:19:33 +0100 (BST) Date: Tue, 15 May 2018 13:19:33 +0100 From: Sean Young To: Randy Dunlap Cc: 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: Re: [PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER Message-ID: <20180515121933.ogyvf4fi6sezzryy@gofer.mess.org> References: <32a944171d5c48abf126259595b0088ce3122c91.1526331777.git.sean@mess.org> <089862eb-8d37-6479-3c2a-ba6199ae7d3c@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <089862eb-8d37-6479-3c2a-ba6199ae7d3c@infradead.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 04:27:19PM -0700, Randy Dunlap wrote: > On 05/14/2018 02:10 PM, Sean Young wrote: > > Add support for BPF_PROG_IR_DECODER. This type of BPF program can call > > Kconfig file below uses IR_BPF_DECODER instead of the symbol name above. > > and then patch 3 says a third choice: > The context provided to a BPF_PROG_RAWIR_DECODER is a struct ir_raw_event; Yes, you're right. I guess the source/trigger is raw IR events; decoding is something you're likely to do, but not necessarily. So: bpf type: BPF_PROG_TYPE_RAWIR_EVENT, has context struct bpf_rawir_event. Then we can call the Kconfig option CONFIG_BPF_RAW_IR_EVENT Sean > > > rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report > > that the last key should be repeated. > > > > Signed-off-by: Sean Young > > --- > > drivers/media/rc/Kconfig | 8 +++ > > drivers/media/rc/Makefile | 1 + > > drivers/media/rc/ir-bpf-decoder.c | 93 +++++++++++++++++++++++++++++++ > > include/linux/bpf_types.h | 3 + > > include/uapi/linux/bpf.h | 16 +++++- > > 5 files changed, 120 insertions(+), 1 deletion(-) > > create mode 100644 drivers/media/rc/ir-bpf-decoder.c > > > > diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig > > index eb2c3b6eca7f..10ad6167d87c 100644 > > --- a/drivers/media/rc/Kconfig > > +++ b/drivers/media/rc/Kconfig > > @@ -120,6 +120,14 @@ config IR_IMON_DECODER > > remote control and you would like to use it with a raw IR > > receiver, or if you wish to use an encoder to transmit this IR. > > > > +config IR_BPF_DECODER > > + bool "Enable IR raw decoder using BPF" > > + depends on BPF_SYSCALL > > + depends on RC_CORE=y > > + help > > + Enable this option to make it possible to load custom IR > > + decoders written in BPF. > > + > > endif #RC_DECODERS > > > > menuconfig RC_DEVICES > > diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile > > index 2e1c87066f6c..12e1118430d0 100644 > > --- a/drivers/media/rc/Makefile > > +++ b/drivers/media/rc/Makefile > > @@ -5,6 +5,7 @@ obj-y += keymaps/ > > obj-$(CONFIG_RC_CORE) += rc-core.o > > rc-core-y := rc-main.o rc-ir-raw.o > > rc-core-$(CONFIG_LIRC) += lirc_dev.o > > +rc-core-$(CONFIG_IR_BPF_DECODER) += ir-bpf-decoder.o > > > -- > ~Randy