Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4341798imm; Wed, 30 May 2018 03:58:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEbeqHZeT/2PFFVRSvP8ahhM9/HvIUuByXMT8V0OSMe77YYQxupwV+OfYuVRyAqC8SsnAX X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr2405205plx.318.1527677937110; Wed, 30 May 2018 03:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527677937; cv=none; d=google.com; s=arc-20160816; b=wiE/43S4lo78d0qi9mCh5TTLXPLKdWER4oK7KFRiLYHBC31tw2unlh6zNihmlSuS4k FewrueDmiDB4efJ3VzHD1ekjnHWsMoP7XgehyD2zOiCswcicLImJ6nv5Dzs1MOxZBZkP IXdjoDg94xTjK/5FFULv0il/wnmSHLme7kkrXnCGff6ewdcGKLLKfYp8VLW/z1FocyLu i07pp3/q8bfciumx7yTTQSSwlyAXjYR1NPw8J8S6RfeAjH37S42ZAvelv6a4u69iew80 ARiAmstvH0aWMLmJkq1u9l6Y/8q31xx3zSnnFrc9ed7LIwMM39vRhBTBiJKkcQrSBwA8 da9A== 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:arc-authentication-results; bh=43tITg0jvWKph8YjAFJQE+kVQ+r5Tk72PR1UcVyrAw0=; b=ME2oV3ycw0iJ5rpV8fBQaVrn2xxon8/G6H/NyXGiTB2n3REamZj1zgg3NlCxCHdaOS yH7HlK+8rQKEPubIii8zWStj7hJH0sY8wfNPGDVA9mcbA6LMj0ZDfi9o50c42oUaPoeJ BQ/39gfKI/JeN6M3jqlkJazlsu0ZCtRQMv5sHQdT1zTN4VOqr+FVGl7hJc06WKRmwjje MO9rdJasszwfAWbNtQr2cXlTsSpfeGRFD38jv44nXUTMQI3TzSkr4N9L2oyhJzW1b5sT VHozWkvfrnCzWm5lqoOjZOfF4EdDcJy75ylRAqHut0b930qmTKVxYVbAVK9B3Lw8Gx6/ LkrQ== 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 u76-v6si11619151pfj.58.2018.05.30.03.58.43; Wed, 30 May 2018 03:58:57 -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 S1751817AbeE3K5Q (ORCPT + 99 others); Wed, 30 May 2018 06:57:16 -0400 Received: from www62.your-server.de ([213.133.104.62]:58632 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbeE3K5M (ORCPT ); Wed, 30 May 2018 06:57:12 -0400 Received: from [80.254.69.162] (helo=localhost.localdomain) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fNyn0-0002mK-C2; Wed, 30 May 2018 12:57:10 +0200 Subject: Re: [PATCH v5 0/3] IR decoding using BPF To: Sean Young , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , Mauro Carvalho Chehab , netdev@vger.kernel.org, Matthias Reichl , Devin Heitmueller , Y Song , Quentin Monnet References: From: Daniel Borkmann Message-ID: Date: Wed, 30 May 2018 12:57:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24616/Wed May 30 06:31:21 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/27/2018 01:24 PM, Sean Young wrote: > The kernel IR decoders (drivers/media/rc/ir-*-decoder.c) 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, for which lircd is need to decode the IR . > > 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. > It might also be possible to support non-button devices such as analog > directional pads or air conditioning remote controls and decode the target > temperature in bpf, and pass that to an input device. > > 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 > > Changes since v4: > - Renamed rc_dev_bpf_{attach,detach,query} to lirc_bpf_{attach,detach,query} > - Fixed error path in lirc_bpf_query > - Rebased on bpf-next > > Changes since v3: > - Implemented review comments from Quentin Monnet and Y Song (thanks!) > - More helpful and better formatted bpf helper documentation > - Changed back to bpf_prog_array rather than open-coded implementation > - scancodes can be 64 bit > - bpf gets passed values in microseconds, not nanoseconds. > microseconds is more than than enough (IR receivers support carriers upto > 70kHz, at which point a single period is already 14 microseconds). Also, > this makes it much more consistent with lirc mode2. > - Since it looks much more like lirc mode2, rename the program type to > BPF_PROG_TYPE_LIRC_MODE2. > - Rebased on bpf-next > > Changes since v2: > - Fixed locking issues > - Improved self-test to cover more cases > - Rebased on bpf-next again > > Changes since v1: > - Code review comments from Y Song and > Randy Dunlap > - Re-wrote sample bpf to be selftest > - Renamed RAWIR_DECODER -> RAWIR_EVENT (Kconfig, context, bpf prog type) > - Rebase on bpf-next > - Introduced bpf_rawir_event context structure with simpler access checking Applied to bpf-next, thanks Sean!