aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2011-09-08 03:47:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 09:03:07 -0400
commit379aa4d0c09ea1786b58089da5bbb915ba976ec0 (patch)
tree67a6d4fa2886524ee63b119ab5a1bef6668c5151 /drivers/media/dvb
parent8e156702aadbec4b478f60b9fc6af91990fcd6d0 (diff)
[media] dvb-usb: add support for dvb-usb-adapters that deliver raw payload
Select this feature setting the dvb-usb-adapter caps field with DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-urb.c12
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
index 53a5c30b51b2..5c8f651344fc 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
@@ -80,6 +80,14 @@ static void dvb_usb_data_complete_204(struct usb_data_stream *stream, u8 *buffer
80 dvb_dmx_swfilter_204(&adap->demux, buffer, length); 80 dvb_dmx_swfilter_204(&adap->demux, buffer, length);
81} 81}
82 82
83static void dvb_usb_data_complete_raw(struct usb_data_stream *stream,
84 u8 *buffer, size_t length)
85{
86 struct dvb_usb_adapter *adap = stream->user_priv;
87 if (adap->feedcount > 0 && adap->state & DVB_USB_ADAP_STATE_DVB)
88 dvb_dmx_swfilter_raw(&adap->demux, buffer, length);
89}
90
83int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap) 91int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap)
84{ 92{
85 int i, ret = 0; 93 int i, ret = 0;
@@ -90,6 +98,10 @@ int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap)
90 adap->fe_adap[i].stream.complete = 98 adap->fe_adap[i].stream.complete =
91 dvb_usb_data_complete_204; 99 dvb_usb_data_complete_204;
92 else 100 else
101 if (adap->props.fe[i].caps & DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD)
102 adap->fe_adap[i].stream.complete =
103 dvb_usb_data_complete_raw;
104 else
93 adap->fe_adap[i].stream.complete = dvb_usb_data_complete; 105 adap->fe_adap[i].stream.complete = dvb_usb_data_complete;
94 adap->fe_adap[i].stream.user_priv = adap; 106 adap->fe_adap[i].stream.user_priv = adap;
95 ret = usb_urb_init(&adap->fe_adap[i].stream, 107 ret = usb_urb_init(&adap->fe_adap[i].stream,
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 6d7d13f9ce68..86cfa86d2d23 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -141,6 +141,7 @@ struct dvb_usb_adapter_fe_properties {
141#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02 141#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02
142#define DVB_USB_ADAP_NEED_PID_FILTERING 0x04 142#define DVB_USB_ADAP_NEED_PID_FILTERING 0x04
143#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08 143#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08
144#define DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD 0x10
144 int caps; 145 int caps;
145 int pid_filter_count; 146 int pid_filter_count;
146 147