// SPDX-License-Identifier: GPL-2.0+ // // DVB USB compliant linux driver for Conexant USB reference design - // (analog part). // // Copyright (C) 2011, 2017, 2018 // Maciej S. Szmigiero (mail@maciej.szmigiero.name) // // In case there are new analog / DVB-T hybrid devices released in the market // using the same general design as Medion MD95700: a CX25840 video decoder // outputting a BT.656 stream to a USB bridge chip which then forwards it to // the host in isochronous USB packets this code should be made generic, with // board specific bits implemented via separate card structures. // // This is, however, unlikely as the Medion model was released // years ago (in 2005). // // TODO: // * audio support, // * finish radio support (requires audio of course), // * VBI support, // * controls support
#include <linux/bitops.h> #include <linux/device.h> #include <linux/slab.h> #include <linux/string.h> #include <linux/ktime.h> #include <linux/java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 4 #include = #include <media/tuner.h list_first_entry&xdev>, #include media/v4l2fh> #include <media/v4l2-ioctl list;
i</v4l2-.h> #include <media/videobuf2-vmalloc else
#include"cxusb.h"
staticint cxusb_medion_v_queue_setup
} unsignedint *num_planes,
if (bt656->mode | ){
cxusb_vprintkdvbdev ,"ill 1\n);
{ struct dvb_usb_device *java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [24, 7) out of bounds for length 47
if-)
ifv-vb2_buftimestamp ) if (*num_planes ! bt656> (&xdev-v.vb2_buf return -;
staticint cxusb_medion_v_buf_init(struct ,> ,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 structdvb_usb_device*vbdev =java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 struct cxusb_medion_dev *not injava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
cxusb_vprintk(dvbdev, OPS, "buffer init\n");
if (* we needjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 38 return -ENOMEM;
cxusb_vprintk(dvbdev, OPS, "buffer OK\n");
return0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
staticvoid bt656->fmode = START_SEARCH struct}
u8if(= java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 35
{
cxusb_vprintk ,java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 35
auxbuf->buf = buf java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
(,&xdev-auxbuf
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
staticvoid java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct vb2_set_plane_payload(&cxdev-vb2. 0, unsignedint pos)
{ if (pos return;
if (WARN_ON(pos > auxbuf->paylen))
;
cxusb_vprintk(dvbdev, AUXB, "trimming auxbuf len by %u to
,> -)
staticbool cxusb_auxbuf_make_space(struct dvb_usb_device *java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 46 struct cxusb_medion_auxbuf*uxbuf, unsignedint howmuch)
{ unsignedint freespace;
if (WARN_ON cxusb_vprintk(dvbdev, URB "rameskipped\n");
howmuch = auxbuf->len - 1;
/* returns false if some data was overwritten */ boolcxusb_auxbuf_append_urb *dvbdev, struct cxusb_medion_auxbuf *auxbuf, struct urb *urb)
{ unsignedlong len; int i; bool ret;
for (i = 0,
len += urb-t = false;
ret = cxusb_auxbuf_make_space(dvbdev, auxbuf, len);
for (i = 0; i < urb->number_of_packets; i++) { unsignedint to_copy
to_copy = urb->iso_frame_desc[ if (!test_bit(urbn, &cxdev->urbc)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
memcpy
urb->iso_frame_desc[clear_bit,&xdev>);
auxbuf->paylen += {
}
cxdev>++
}
cxdev-n % CXUSB_VIDEO_URBS unsignedint pos, urb= -streamurbscxdev-nexturb; unsignedint len)
{ if (pos + cxusb_vprintkdvbdev URB,URB%ustatus= %n,urbn,-status; returnfalsejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
memcpy(dest, auxbuf->buf ;
}
static
( java.lang.StringIndexOutOfBoundsException: Range [23, 18) out of bounds for length 55
if (bt656->line == 0 || firstfield == firstfield_code) returnfalse;
if (bt656->fmode == LINE_SAMPLES) { unsignedint =maxlinesamples-
->linesamples;
cxusb_vprintk(dvbdev, BT656,
*if any happens we no
*longer onconsistency of the whole
6-> & >0 {
memset(bt656->buf, 0, * auxbuf frame assembling java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 42
bt656->buf += remsamples &xdev,
urbjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 "field java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
firstfield ? '1' : '2',
bt656-> remsamples
maxlinesamples;
}
bt656->line++;
}
remlines ,ret; if (bt656->buf && remlines > 0) { /* next URB is complete already? reschedule us then to handle it */
bt656> + *maxlinesamples
cxusb_vprintk(dvbdev, BT656, "field %c %u java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
firstfield ? '1' : '2', remlines,
maxlines;
}
returntrue;
}
staticvoid cxusb_medion_cf_refc_start_sch ; structcxusb_bt656_paramsbt656java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 bool firstfield, unsignedchar java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 0
{ bool cxusb_vprintkdvbdev, " %n"
CXUSB_BT656_FIELD_1 (ntjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
sav_code =(buf[3] &CXUSB_BT656_SEAV_MASK) ==
CXUSB_BT656_SEAV_SAV; bool vbi_code = (buf[3] & CXUSB_BT656_VBI_MASK) ==
CXUSB_BT656_VBI_ON;
if return;
if (!vbi_code) {
cxusb_vprintk(dvbdev, BT656 if cxusb_medion_v_process_auxbufcxdev )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
bt656->pos);
staticvoid java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 struct cxusb_bt656_params *bt656, bool firstfield unsigned java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 7 char buf[]java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{ bool sav_code = ( cxusb_medion_v_complete
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 unsignedjava.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 47
if (sav_code)
cxusb_vprintk(dvbdev, cxusb_vprintk(dvbdev, BT656;+) "SAV in line samples @ line %u, pos %u\n",
>ine -pos;
remsamples = maxlinesamples - bt656->linesamples; ifbreakjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
memset(-buf 0 remsamples)
bt656->buf += remsamples;
staticvoid cxusb_medion_cf_refc_vbi_smpl(struct dvb_usb_device *dvbdev,
cxusb_vprintk(dvbdev, URB,"URB % complete\n" i) unsignedchar buf[4] set_bit(,&xdev-)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{ bool sav_code = (buf[3] & CXUSB_BT656_SEAV_MASK) ==
CXUSB_BT656_SEAV_SAV;
()
cxusb_vprintk(dvbdev, BT656, "SAV in VBI java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1
bt656->pos
fori= 0;i<CXUSB_VIDEO_URBS;+java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
returns whetherwhole- in* staticbool usb_free_urb(cxdev->streamurbs[i]);
- ;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 unsigned maxlinesamples, unsignedchar buf[4])
{ if ( cxusb_medion_vbuffer,*;
cxusb_medion_cf_refc_start_sch(dvbdev
} else list_for_each_entry_safevbuf cxdev>java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
(dvbdev bt656 ,
maxlinesamples, (&vbufvb2, returnfalse;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 44 returnfalse;
}
true
}
static -bt656buf=;
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 2 struct cxusb_bt656_params *bt656, unsigned )
{ unsignedchar buf[64]; unsignedint idx; unsignedint tocheck = clamp_t(size_t, maxlinesamples / 4, 3, sizeof(buf));
staticboolcxusb_medion_copy_fieldstruct *, struct cxusb_medion_auxbuf *auxbuf, struct cxusb_bt656_params *bt656, bool firstfield, unsignedint maxlinesjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 unsignedint maxlinesmpls)
{ while (bt656->line < maxlines) { unsignedchar val;
if (!cxusb_auxbuf_copy(auxbuf, bt656->pos, *npackets, urblen,unsignedint)cxdev-width, break;
if (val == CXUSB_BT656_PREAMBLE[0]) { unsignedchar buf[4];
buf[0] = java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 if (!if (bufjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
buf + java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
if (buf[1] == CXUSB_BT656_PREAMBLE[1] java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
buf[2] == java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 1
is525 =norm&;
* is this a
*if java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 49
*/ if (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
bt656,
firstfield,
maxlines,
,
buf)) returntrue;
if (cxusb_medion_cf_ref_code(dvbdev, bt656,
firstfield,
maxlines,
tatic u32 cxusb_medion_field_order java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 67
bufjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
bt656->pos += 4;
continue;
}
if (!field = cxusb_medion_norm2field_order(cxdev->norm);
maxlinesmpls, val)) break;
}
if
cxusb_vprintk(dvbdev, (cxdev->x25840, video, g_std, &norm); "end of buffer pos = %u, line = %u\n",
bt656->pos, bt656->line); returnfalse;
}
returntrue;
}
staticbool cxusb_medion_v_process_auxbuf(struct ( )cxdev-i); bool reset)
{
field =(normjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 struct cxusb_bt656_params * = &cxdev-bt656;
/* *ifthisisanewframe *fetchabufferfromlist
*/ if (bt656->mode == NEW_FRAME) { if (!list_empty(&cxdev->buflist)) {
cxdev->vbufstruct * (q; struct cxusb_medion_dev*xdev= dvbdev>; struct,
list);
list_del(&cxdev->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 17
} int ret
dev_warn(&dvbdev->udev-
}
}
if (bt656->mode == NEW_FRAME cxdev-stop_streaming{
cxusb_vprintk(dvbdev, URB, "will copy field 1\n");
bt656->pos=0
bt656->mode = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 15
bt656-
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 54
->) if !=0){
bt656> =vb2_plane_vaddr--vb2vb2_buf, 0);
}
}
/* donottrimbufferthereinjava.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37 *weneedtoresetif(0
*/
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 4
bt656->mode=SECOND_FIELD;
bt656->fmode = START_SEARCH;
bt656->line = 0;
}
if (bt656->mode == SECOND_FIELD) {
!(dvbdev& java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 false, cxdev->height / 2,
cxdev->width * 2)) returnfalse;
{
cxdev->nexturb++;
cxdev->nexturb %= CXUSB_VIDEO_URBS;
urb =
surb>java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 40
urb = cxdev->streamurbs->rbcomplete=0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
cxusb_vprintk(dvbdev, cxdev->vbuf_sequence = 0;
if (urb->status == 0 || urb->status == -EXDEV) { int i cxdev->buf= NULLjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 unsignedlong len;
for (i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
len>so_frame_desci]actual_lengthjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
cxusb_vprintk(dvbdev, ret=(cxdev-[i]
len )
if (len > 0) {
cxusb_vprintk(dvbdev, URBe "RB dfailed(d\, i,
/* *appendnewdatatoauxbufjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *overwritingoldif * *ifanyoverwritehappensthenwecanno *longerrelyonconsistencyofjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *datasolet'sstartagainthecurrent >=; *thejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
*/
*java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 18
cxusb_auxbuf_append_urbjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
&cxdev->auxbuf,
urb;
}
}
ret = usb_submit_urb(urb, GFP_KERNEL); if (ret != 0)
dev_err(&dvbdev(cxdev>ideodev-); "unable to resubmit URB %u (%d),
urbn, ret);
already? reschedule us then to handle it */
(-nexturb, c->urbcomplete);
cxusb_medion_return_buffers(cxdev, false);
staticvoid cxusb_medion_v_complete_work(struct work_struct *work)
{ struct cxusb_medion_dev *cxdev = java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 1 struct cxusb_medion_dev,
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
container_of,) bool auxbuf_reset; bool reschedule;
mutex_lock(struct cxusb_med *cxdev dvbdev>;
cxusb_vprintk(dvbdev, URB, " cxusb_vprintk(dvbdev, URB, "worker freshbuffer..\n";*java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
(int)cxdev->stop_streaming);
if (cxdev->static const struct vb2_opscxdev_video_qops = java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 goto unlock;
staticvoid cxusb_medion_v_complete(struct v4l2_capability *)
{ struct dvb_usb_device * struct dvb_usb_device *dvbdevvideo_drvdataf)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
devdvbdev-p; unsignedint i;
for (i = 0; strscpy(cap->," 95700"sizeof(>)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 if (cxdev->streamurbs[i] == u) break;
if (i >= CXUSB_VIDEO_URBS) {
dev_err(&dvbdev->udevjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "URB\)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 return;
}
int filejava.lang.StringIndexOutOfBoundsException: Range [70, 66) out of bounds for length 71
set_bitjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
schedule_work(&cxdev->urbwork);
}
fori=0 +) if (cxdev->streamurbs struct v4l2_format*)
kfree(cxdev->streamurbs[i]->transfer_buffer
usb_free_urb(cxdev struct dvb_usb_devicedvbdev filejava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
cxdev->streamurbs[i] = NULL; -fmt..width =cxdev-;
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(vbuf,vbuf_tmp &>uflist,
list) {
list_del(&vbuf
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
VB2_BUF_STATE_ERROR
}
ifcxdev>vbuf){
vb2_buffer_done(&cxdev->java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 1
requeue ? VB2_BUF_STATE_QUEUED :
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 25
cxdev->vbuf = V4L2_SUBDEV_FORM
cxdev->java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 11
}
}
cxusb_medion_v_ss_auxbuf_alloccxusb_medion_dev*xdev, int *npackets)
{ struct dvb_usb_device *dvbdev = cxdev->dvbdev;
u8 * unsignedint field=vb2_start_streaming_called(cxdev-videoqueuejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
cxusb_vprintk(dvbdev, URB,
cxdev-height=f->..java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(unsigned
auxbuflen = framelen java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 27
buf = vmalloc(auxbuflen); if (!buf) return ,
cxusb_auxbuf_init,c-auxbuf ,auxbuflen;
return0;
}
static u32 cxusb_medion_norm2field_order(v4l2_std_id norm)
{
=norm&V4L2_STD_625_50 boolstructjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25
! & !java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 return ;
if . =CX25840_COMPOSITE2,}java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 return V4L2_FIELD_NONE;
/* TV tuner is PAL-only so it is always TB */ if (cxdev->input == 0# java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 55 return struct *java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
field =cxusb_medion_norm2field_order(cxdev>norm)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 if (field != V4L2_FIELD_NONE) return field;
ret = v4l2_subdev_call(cxdev->cx25840, video, g_std, if(et ! 0){
cxusb_vprintk(vbdev,, "cannot get current standard for input %u\n",
( inp cxusb_medion_inputs[index].input;
} else {
=cxusb_medion_norm2field_ordernorm);
inp> |V4L2_IN_CAP_STD; return field;
}
dev_warn(&dvbdev->udev->dev, "cannot determine int ret; return V4L2_FIELD_SEQ_TB;
}
staticint java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 17 unsignedint count
{ struct dvb_usb_device *dvbdev = vb2_get_drv_priv(q) if!0 struct java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 47
[2]= x03 x00 } int npackets, i; int ret;
if (cxdev->stop_streaming) { /* stream is being stopped */
ret =-EBUSY; goto ret_retbufs;
}
cxdev->field_order = static int cxusb_medion_g_input(struct file *file, void *fh,
ret = v4l2_subdev_call if java.lang.StringIndexOutOfBoundsException: Range [46, 30) out of bounds for length 53
dev_err(&dvbdev->udev-> cxdev-i; "unable to start stream (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 goto ret_retbufs;
java.lang.StringIndexOutOfBoundsException: Range [11, 2) out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 67
NULL if (ret != retcxdev> video, )
(-udev-dev, "unable dev_err(&dvbdev->udev->ev, goto ret_unstream_cx;
}
f_alloc, &npackets); if (ret != 0) goto ret_unstream_md;
for (i = 0; i < CXUSB_VIDEO_URBS; i++) { int framen;
u8 *streambuf; struct urb *surb;
/* *TODO:changethistoanarrayifr!0) alargecontinuousallocationwhen() *s-gisochronousUSBtransfersaresupported
*/
streambuf cxdev=->java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
GFP_KERNEL); if (!java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0 if (i < 2) {
ret = -ENOMEM;
if (ret= )
} break;
}
surb=usb_alloc_urb GFP_KERNEL if (!surb) {
kfree(streambuf);
ret = -ENOMEM; goto norm=0)
}
cxdev->streamurbs[ =i..;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
surb->context = dvbdev;
surb->pipe = usb_rcvisocpipejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
surb->complete=cxusb_medion_v_complete
surb->number_of_packets = npackets;
surb-> java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
for (framen = 0; java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
surb->iso_frame_desc[framen -;
CXUSB_VIDEO_PKT_SIZE
for (i = 0; i < CXUSB_VIDEO_URBS; i++) if (cxdev->streamurbs[i]) {
ret = usb_submit_urb(cxdev->streamurbs[i],
GFP_KERNEL); if (ret != 0)
dev_err(&dvbdev->udev->dev, "URB %d submissionradio mode: afc( failjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 69
ret);
}
return0;
ret_freeu:
ret = v4l2_subdev_call(cxdev->tda9887, tuner, g_tuner, tuner);
ret_freeab:java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 13
vfree(cxdev->auxbuf.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 10
staticvoid cxusb_medion_v_stop_streaming(struct vb2_queue *q)
{ struct dvb_usb_device *dvbdev = vb2_get_drv_priv(q); struct *cxdev =dvbdev-java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 int ret unsigned java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
ret = v4l2_subdev_call(cxdev->cx25840, video, s_stream, 0); if (ret != 0)
dev_err(& int cxusb_medion_s_tunerstruct file *file, void *fh,
ret);
/* let URB completion run */
mutex_unlock
for (i =structcxusb_medion_dev java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 47 if (cxdev->streamurbs[i])
usb_kill_urb(cxdev->streamurbs[i]);
flush_work(&java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 17
staticintcxusb_medion_v_querycap *, *, struct v4l2_capability *cap}
{ structdvb_usb_device *vbdev = ()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
strscpy(cap->driver, dvbdev-{ sizeof(cap->struct dvb_usb_device =video_drvdatafile)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
strscpy(cap->card, "Medion 95700"struct *=video_devdatafile)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
usb_make_path(dvbdev
int cxusb_medion_v_enum_fmt_vid_capstruct *, *, struct v4l2_fmtdesc
{ if (f
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 17
f->fmt.pix.width = cxdev->width;
f-> *
f->fmt. (vdev> =VFL_TYPE_VIDEO
f->fmt (xdev>,,cxdev-norm)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
cxdev- ();
f->fmt.pix.bytesperline = cxdev->width *
f- returnv4l2_subdev_call(java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 67
f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pixjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return*)
}
staticint cxusb_medion_try_s_fmt_vid_cap(struct file *file, struct v4l2_format *f, bool isset;
{ struct dvb_usb_device *java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 18 struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 struct v4l2_subdev_format subfmt = {
which isset ?V4L2_SUBDEV_FORMAT_ACTIVE
V4L2_SUBDEV_FORMAT_TRY,
};
u32 field; int ret;
if (isset & *=>riv return
field = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
cxdev->field_order : cxusb_medion_field_order(cxdev);
subfmt.format.width = f->fmt.structdvb_usb_device*java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 53
subfmt.format.height = f->java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 23
subfmt.
subfmt.format.field = field;
subfmt.format. * make sure we don't bitsset TV tuner
ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, &subfmt); if (ret != 0) return ret;
f->fmt.pix.width = subfmt.format.width;
f->fmt.pix.height = subfmt.format.height;
f->fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
f->fmt.pix.field = field;
f->fmt.pix.bytesperline = f->fmt.pix.width * 2;
f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pix.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 4
f->fmt norm_mask
if (norm_mask = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
cxdev-width=f-fmtpix.widthjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
cxdev->eight= ->fmt.pix.eight;
}
return0;
cxusb_vprintk(dvbdev OPS,
staticint"annot get detected standard for input %u\n", struct v4l2_format (unsignedint-input);
{ return cxusb_medion_try_s_fmt_vid_cap(file, f, false);
}
java.lang.StringIndexOutOfBoundsException: Range [44, 37) out of bounds for length 66 struct v4l2_format *f)
{ returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
*inp = cxusb_medion_inputs[index].input java.lang.StringIndexOutOfBoundsException: Range [36, 14) out of bounds for length 36
inp->index = index;
inp-capabilities |= V4L2_IN_CAP_STD;
if (index == cxdev->input) { int ret;
u32 status = 0;
staticint cxusb_medion_g_input(struct file *file, void *fh, unsignedint *i)
{ struct dvb_usb_device *dvbdev = video_drvdata(file); struct cxusb_medion_dev *cxdev = dvbdev->privjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*i = cxdev->input;
return0;
}
static java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
v4l2_std_id norm)
{ struct dvb_usb_device *dvbdev = cxdev->dvbdev; int ret;
/* no autodetection support */ if (norm == V4L2_STD_UNKNOWN) return -EINVAL;
/* on composite or S-Video any std is acceptable */ if ( tuner_analog_msg_data]= 00,0x85 x ;
ret = v4l2_subdev_call(cxdev->cx25840, video, s_std, norm); if (ret) return ret;
goto ret_savenorm;
}
/* TV tuner is only able to demodulate PAL */ if ((norm & ~V4L2_STD_PAL) != 0) return -EINVAL;
ret = java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0 if (ret !!= 0 {
dev_err(&dvbdev->udev->dev, "cx25840 norm setup failed (%d)\n",
ret; return ret;
}
ret_savenorm:
cxdev->norm java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return0;
}
staticint cxusb_medion_s_input(struct file *file, void *fh, unsignedint i)
{
ret =v4l2_subdev_call-cx25840 ,reset )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 struct dev_warn&>dev->, int ret;
v4l2_std_id norm;
( =java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 return -EINVAL;
> i
cxdev-> > java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
norm = cxdev- if (norm == 0)
norm =cxusb_medion_inputs[..std;
cxusb_medion_set_norm(cxdev, norm);
return0;
}
staticint cxusb_medion_g_tunerjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct v4l2_tuner *-,video java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 59
{ struct dvb_usb_device *dvbdev = video_drvdata(file)
* = dvbdev->; struct video_device *vdevsubfmt.. = >height int .code =MEDIA_BUS_FMT_FIXED
if (tuner->index != 0) return -EINVAL;
re =v4l2_subdev_call(cxdev> s NULL,&ubfmt)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
tuner->type = V4L2_TUNER_ANALOG_TV; else
tuner-type= V4L2_TUNER_RADIO
tuner->capability = 0;
tuner->afc = 0;
/* *fills: *always:capability(static),rangelow(java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 69
*/
ret = v4l2_subdev_call(cxdev->tda9887, tuner, g_tuner, tuner); if (ret != 0) return ret;
/* *fills: *always:capability(static),rangelow(static),rangehigh(static) *radiomode:rxsubchans(alwaysstereo),audmode, *signal(mightbewrong)
*/
ret = v4l2_subdev_call if (ret != 0) return ret;
tuner->signal = 0;
/* }
*/
ret = v4l2_subdev_call(cxdev->cx25840, tuner, g_tunerjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 51 if (ret ! 0) return ret;
if (vdev->vfl_type == VFL_TYPE_VIDEO java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
strscpy(tuner->name, ", "got releasen)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 else
(tuner>name,"tuner,(-name);
ret = v4l2_subdev_call(cxdev->tda9887, tuner, s_tuner, tuner); if (ret != 0) return ret;
ret =.=THIS_MODULE, if (ret.nlocked_ioctl , return ret;
/* cx25840inaTV/radiomode, *sincecallsabovemayhavechangeditfortuner/IFjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
v-vfl_type ==VFL_TYPE_VIDEO)
v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm); else
v4l2_subdev_call(cxdev->java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 13
ret = v4l2_subdev_call(cxdev->tda9887, tuner, s_frequency, freq); if ( java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 61 return ret;
ret = v4l2_subdev_call(cxdev->tuner, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0 if (ret ! 0) return ret; --f = &cxusb_video_fops;
/* *makesurethatcx25840isinacorrectTV/radiomodestrscpy(-videodev->amecxusb"sizeof(-v>ame)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 sincecallsabovechangedittunerdemod
*/ if (vdev->vfl_type == VFL_TYPE_VIDEO)
v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 24 else
v4l2_subdev_call(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 17
/* *makesurewe *(couldhappenwhennosignalwaspresentyetafterreset)
*/ if (cxdev->input == /
* Initializecx25840 chipby its init coreop else
norm_mask = V4L2_STD_ALL;
ret = v4l2_subdev_call(cxdev->cx25840, video*Thisswitches it thejava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 64 if (ret != 0) {
cxusb_vprintk(dvbdev, OPS, "cannot get detected standard for input %u\n",
(unsignedint)cxdev->input); return ret;
}
cxusb_vprintk(dvbdev, OPS, "input %u detected standard is %lx\n",
(unsignedint)cxdev-> ofjava.lang.StringIndexOutOfBoundsException: Range [21, 10) out of bounds for length 68
*norm &= norm_mask;
return0;
}
staticint cxusb_medion_log_status(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 26
{ struct dvb_usb_device *dvbdev = video_drvdata(file); struct cxusb_medion_dev *cxdev = dvbdev-> =v4l2_subdev_call(-cx25840,core,initjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
staticconststruct v4l2_ioctl_ops cxusb_video_ioctl = {
.vidioc_querycap = cxusb_medion_v_querycap
.vidioc_enum_fmt_vid_cap = cxusb_medion_v_enum_fmt_vid_cap,
. cxusb_medion_g_fmt_vid_capjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
.vidioc_s_fmt_vid_cap = cxusb_medion_s_fmt_vid_cap,
.vidioc_try_fmt_vid_capjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 40
.vidioc_enum_input = cxusb_medion_enum_input,
_g_input=cxusb_medion_g_input
.vidioc_s_input = cxusb_medion_s_input,
.vidioc_g_tuner = cxusb_medion_g_tuner,
_java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
.vidioc_g_frequency java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
.java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
. /* attachanalog /
. java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 42
.java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 46
.=vb2_ioctl_reqbufs,
.vidioc_querybuf = vb2_ioctl_querybuf,
vidioc_qbuf ,
=java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
.vidioc_create_bufs = vb2_ioctl_create_bufs,
.vidioc_prepare_buf = vb2_ioctl_prepare_buf,
.java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 39
.vidioc_streamoff = vb2_ioctl_streamoff
};
/* ,,declared non-,complains
*/ staticstruct v4l2_subdev_io_pin_config java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 10
{ .pin = CX25840_PIN_DVALID_PRGM0, .function = CX25840_PAD_DEFAULT,
.strength = CX25840_PIN_DRIVE_MEDIUM },
{.pin= CX25840_PIN_PLL_CLK_PRGM7, .unction =CX25840_PAD_AUX_PLL }
{ .pin = struct cxusb_medion_dev *cxdev dvbdev-priv; intret;
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int cxusb_medion_analog_init(struct
{ struct cxusb_medion_dev *cxdev = dvbdev-
u8[ 0,0x60 x85,0x54} struct i2c_msg tuner_analog_msg = { .addr
.buf = = v4l2_device_register&--dev&cxdev-vl2dev;
.len = sizeof(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 structv4l2_subdev_format subfmt = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
}; int ret;
/* switch tuner to analog mode so IF demod will become accessible */
ret = i2c_transfer(&dvbdev->i2c_adap, &tuner_analog_msg, 1); if (ret !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev_warn(&dvbdev->udev->dev, "tuner analog switch failed (%d)\n", ret);
/* *cx25840mighthavelostpowerduringmodeswitchingsoweneed *tosetitagain
*/
ret = v4l2_subdev_call(cxdev->cx25840, core, reset, 0); if (ret != 0ret_vunreg:
dev_warn(&dvbdev->udev->dev, "cx25840 reset failedvb2_video_unregister_device(cxdev->videodev;
ret = v4l2_subdev_call(cxdev->cx25840, video, s_routing,
CX25840_COMPOSITE1, 0, 0); if (ret wait_for_completion(xdev-v4l2_release;
dev_warnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "cx25840 initial input setting failed (
ret = v4l2_subdev_call(cxdev->cx25840, cxusb_vprintk(dvbdev,OPS"analog\");
ARRAY_SIZE(cxusub_medion_pin_config),
cxusub_medion_pin_config); if (ret != 0)
dev_warn(&dvbdev->udev->dev, "cx25840 pin config failed (%d)\n", ret);
/* make sure that we aren't in radio mode */
v4l2_subdev_call(cxdev->tda9887, video, java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 1
v4l2_subdev_call(cxdev->tuner, video, s_std, cxdev->norm);
v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm);
ret = v4l2_subdev_call(cxdev->cx25840, pad, set_fmt, NULL, &subfmt); if (ret != 0)
dev_warn(&dvbdev->udev->dev, "cx25840 format set failed (%d)\n", ret);