From patchwork Mon May 14 22:10:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Krufky X-Patchwork-Id: 11255 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SU3UO-0006R3-1C for patchwork@linuxtv.org; Tue, 15 May 2012 00:11:36 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1SU3UN-0005FK-Ea; Tue, 15 May 2012 00:11:36 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932542Ab2ENWL3 (ORCPT ); Mon, 14 May 2012 18:11:29 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:44218 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932498Ab2ENWL2 (ORCPT ); Mon, 14 May 2012 18:11:28 -0400 Received: by qadb17 with SMTP id b17so3179725qad.19 for ; Mon, 14 May 2012 15:11:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=fricng+rUlP8XMEnUDYeFv9bH6+WjtCuOr0S/zwnNU4=; b=NW2v6nPSjjAhz/jfg2CcGJF7dQ8U+eTckZ0KTQ7LWs6avs+OjzcdeAttNule2lS/hU izhhDenbaSUj0dR/ewHBJiQfG4C86d3YaoNyyQyvbrxAR0KqV+vqNoEMOm/miDTx1T+g 5sF7dgoIjK57lu0IJTOAEcFk0fhYGQoz5bPItlK3vfNR03qC60L7DzHBQJOi5X8YMLwf 3ibyo0I42EQhzycB5tapy1NPAFsBZIO4iabV9mSMw6hHdRfvOjOyvPwMq4pB9s+DdZUx KyYsyspcdThpx1l1cmF3FrJTJznnsS/7oR89p0AoclGF/Vyacz34xqzRNyxctW6Ly9oR cB4w== Received: by 10.224.199.66 with SMTP id er2mr2920947qab.33.1337033487622; Mon, 14 May 2012 15:11:27 -0700 (PDT) Received: from outlands.localdomain6 (cpe-67-247-37-142.nyc.res.rr.com. [67.247.37.142]) by mx.google.com with ESMTPS id i8sm41897420qap.0.2012.05.14.15.11.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 15:11:27 -0700 (PDT) From: Michael Krufky To: linux-media@vger.kernel.org Cc: mchehab@infradead.org, Michael Krufky , Michael Krufky Subject: [PATCH 07/11] dvb-demux: add functionality to send raw payload to the dvr device Date: Mon, 14 May 2012 18:10:49 -0400 Message-Id: <1337033453-22119-7-git-send-email-mkrufky@linuxtv.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1337033453-22119-1-git-send-email-mkrufky@linuxtv.org> References: <1337033453-22119-1-git-send-email-mkrufky@linuxtv.org> X-Gm-Message-State: ALoCoQkKNKt6ECgBUPnZUQEPJzfAu3KnLKpAsQcmxPJxjzwoXaPL7x9bY+s8qyFLfEamzcCy4RIx Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.14.220018 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' From: Michael Krufky If your driver needs to deliver the raw payload to userspace without passing through the kernel demux, use function: dvb_dmx_swfilter_raw Signed-off-by: Michael Krufky --- drivers/media/dvb/dvb-core/dvb_demux.c | 10 ++++++++++ drivers/media/dvb/dvb-core/dvb_demux.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c index faa3671..d82469f 100644 --- a/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/drivers/media/dvb/dvb-core/dvb_demux.c @@ -568,6 +568,16 @@ void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count) } EXPORT_SYMBOL(dvb_dmx_swfilter_204); +void dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, size_t count) +{ + spin_lock(&demux->lock); + + demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts, DMX_OK); + + spin_unlock(&demux->lock); +} +EXPORT_SYMBOL(dvb_dmx_swfilter_raw); + static struct dvb_demux_filter *dvb_dmx_filter_alloc(struct dvb_demux *demux) { int i; diff --git a/drivers/media/dvb/dvb-core/dvb_demux.h b/drivers/media/dvb/dvb-core/dvb_demux.h index a7d876f..fa7188a 100644 --- a/drivers/media/dvb/dvb-core/dvb_demux.h +++ b/drivers/media/dvb/dvb-core/dvb_demux.h @@ -145,5 +145,7 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *dvbdmx, const u8 *buf, void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count); void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count); +void dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, + size_t count); #endif /* _DVB_DEMUX_H_ */