Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4944083imm; Mon, 14 May 2018 16:28:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqPIup5LxECyqJWs4Xy3uHopgcufQEeFkML6fG55q2FMQWT01L6oxc42YJ0cOuocsZVqNz X-Received: by 2002:a63:a34d:: with SMTP id v13-v6mr10080836pgn.224.1526340483568; Mon, 14 May 2018 16:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526340483; cv=none; d=google.com; s=arc-20160816; b=pZyrB0DijpyMZkjkhON7zkXJRW+5TgO2c+NaG2rydSh0ASrW/ztE5iN5wmdeRjJL2q bgkZxoM/0nKdw6LGc+3cjw+wfmXU8N2sKAlx5TTGbgD7y2V6AmE9dsVyXmc+NzKNLw7q hsOEW6HKqmSk8NJUlPvcIHI1EzB0MQljlN51b61TwzqF66vcsTLXUo0BaeYoorizKvvg TwWLDfkBsGPxk6rR1HDslblaN7Iybbk+7eybry7XH8IUnNrJY7pdij/wWBJm2t/+iOFZ hQbgorWyh8pLmp+eIf4iSziPN5LOdm6olzo2QRaRAaRvxbfQ5CHaqpFuJ36ox4qniiWg dZ4g== 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:from:references:to:subject:dkim-signature :arc-authentication-results; bh=s2oxgGFNNQKbSHDWEeXc7ZHicWavyEyEZBOscp4EzPU=; b=gGNtlkkJ9z29W3bjh25F3wmVyVsNbvFeJRzOeJ2wucbFAii5tyeCozmwMhTtX95yaq r9Z8eRwhUirVwkVqd+AxtlQxY5hdf8zvtvWoBFxYSS8mNJEA4Sp6mc8JFLWEs8tFvWHf imFZdhWjy5NbhCj53HKOSKSmzXIlrPg/J1rmuCyHZ9yBq8HS1NJ/KzHNb1b/tD/5nx/h 6Dijg5e0/54JMTrJj+TONjoNGHwprtWEuZKISOCU9xzG7LNMx+lTuQRQmq/brE1or3XP /IciIU7xkQybBfxp7LmZyBCDgb5jLYVj6Epkc+4DWGilOWkrdTdjPrWav7XpksQSNgXu MadQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oZYVeLS7; 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 v189-v6si1412419pgb.120.2018.05.14.16.27.36; Mon, 14 May 2018 16:28:03 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oZYVeLS7; 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 S1752194AbeENX1Z (ORCPT + 99 others); Mon, 14 May 2018 19:27:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60708 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbeENX1X (ORCPT ); Mon, 14 May 2018 19:27:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s2oxgGFNNQKbSHDWEeXc7ZHicWavyEyEZBOscp4EzPU=; b=oZYVeLS7bdVGtUubaANLxdXIN nLSOPe1GOdhvSglcc4aHxiw8B/7Sec2NAPhrk4Z7G8s2U/sQEgMcTAPdj73zRg6ICudA7yHTwHp6Q Q5TBW0LwOOOs3KFBWP3EbFXdIvYrFG/RQvFfR5EKBHCXzvSJ92enh3A3UB9AsFRbPmr2d3WRWif35 CiZkHeaZq1kARgs7pVr12dFK2MlhzG7okxMgduoM50kRDXwIcWZYPrYmI3Crt4Zd2uCa/9wmhHEC3 ZMCScaaXMI33Qw4mEJ+lr6/dxubzSlDp4VQNb+8S/glQLYUzTD7ae8IXGvSqM8X0b9YzbHCax+Kwq 4ByjA/FSQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIMsC-0003Hg-MU; Mon, 14 May 2018 23:27:20 +0000 Subject: Re: [PATCH v1 1/4] media: rc: introduce BPF_PROG_IR_DECODER To: Sean Young , 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 References: <32a944171d5c48abf126259595b0088ce3122c91.1526331777.git.sean@mess.org> From: Randy Dunlap Message-ID: <089862eb-8d37-6479-3c2a-ba6199ae7d3c@infradead.org> Date: Mon, 14 May 2018 16:27:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <32a944171d5c48abf126259595b0088ce3122c91.1526331777.git.sean@mess.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > 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