Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
8c159d59
Commit
8c159d59
authored
Aug 27, 2007
by
Mauro Carvalho Chehab
Committed by
Mauro Carvalho Chehab
Sep 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (12790): tm6000: check for errors on usb->status
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
2df7f152
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
34 deletions
+51
-34
drivers/staging/tm6000/tm6000-video.c
drivers/staging/tm6000/tm6000-video.c
+51
-34
No files found.
drivers/staging/tm6000/tm6000-video.c
View file @
8c159d59
...
...
@@ -163,7 +163,7 @@ static void inline buffer_filled (struct tm6000_core *dev,
struct
tm6000_buffer
*
buf
)
{
/* Advice that buffer was filled */
dprintk
(
dev
,
V4L2_DEBUG_
QUEUE
,
"[%p/%d] wakeup
\n
"
,
buf
,
buf
->
vb
.
i
);
dprintk
(
dev
,
V4L2_DEBUG_
ISOC
,
"[%p/%d] wakeup
\n
"
,
buf
,
buf
->
vb
.
i
);
buf
->
vb
.
state
=
STATE_DONE
;
buf
->
vb
.
field_count
++
;
do_gettimeofday
(
&
buf
->
vb
.
ts
);
...
...
@@ -314,7 +314,7 @@ static int copy_multiplexed(u8 *ptr, u8 *out_p, unsigned long len,
pos
=
0
;
/* Announces that a new buffer were filled */
buffer_filled
(
dev
,
*
buf
);
dprintk
(
dev
,
V4L2_DEBUG_
QUEUE
,
"new buffer filled
\n
"
);
dprintk
(
dev
,
V4L2_DEBUG_
ISOC
,
"new buffer filled
\n
"
);
rc
=
get_next_buf
(
dma_q
,
buf
);
if
(
rc
<=
0
)
{
...
...
@@ -329,24 +329,9 @@ static int copy_multiplexed(u8 *ptr, u8 *out_p, unsigned long len,
return
rc
;
}
/*
* Controls the isoc copy of each urb packet
*/
static
inline
int
tm6000_isoc_copy
(
struct
urb
*
urb
,
struct
tm6000_buffer
**
buf
)
static
void
inline
print_err_status
(
struct
tm6000_core
*
dev
,
int
packet
,
int
status
)
{
struct
tm6000_dmaqueue
*
dma_q
=
urb
->
context
;
struct
tm6000_core
*
dev
=
container_of
(
dma_q
,
struct
tm6000_core
,
vidq
);
void
*
outp
=
videobuf_to_vmalloc
(
&
((
*
buf
)
->
vb
));
int
i
,
len
=
0
,
rc
=
1
;
int
size
=
(
*
buf
)
->
vb
.
size
;
char
*
p
;
unsigned
long
copied
;
copied
=
0
;
for
(
i
=
0
;
i
<
urb
->
number_of_packets
;
i
++
)
{
int
status
=
urb
->
iso_frame_desc
[
i
].
status
;
char
*
errmsg
=
"Unknown"
;
switch
(
status
)
{
...
...
@@ -375,11 +360,43 @@ static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf)
errmsg
=
"Device does not respond"
;
break
;
}
if
(
packet
<
0
)
{
dprintk
(
dev
,
V4L2_DEBUG_QUEUE
,
"URB status %d [%s].
\n
"
,
status
,
errmsg
);
}
else
{
dprintk
(
dev
,
V4L2_DEBUG_QUEUE
,
"URB packet %d, status %d [%s].
\n
"
,
packet
,
status
,
errmsg
);
}
}
if
(
status
<
0
)
/*
* Controls the isoc copy of each urb packet
*/
static
inline
int
tm6000_isoc_copy
(
struct
urb
*
urb
,
struct
tm6000_buffer
**
buf
)
{
struct
tm6000_dmaqueue
*
dma_q
=
urb
->
context
;
struct
tm6000_core
*
dev
=
container_of
(
dma_q
,
struct
tm6000_core
,
vidq
);
void
*
outp
=
videobuf_to_vmalloc
(
&
((
*
buf
)
->
vb
));
int
i
,
len
=
0
,
rc
=
1
;
int
size
=
(
*
buf
)
->
vb
.
size
;
char
*
p
;
unsigned
long
copied
;
copied
=
0
;
if
(
urb
->
status
<
0
)
{
print_err_status
(
dev
,
-
1
,
urb
->
status
);
return
0
;
}
for
(
i
=
0
;
i
<
urb
->
number_of_packets
;
i
++
)
{
int
status
=
urb
->
iso_frame_desc
[
i
].
status
;
if
(
status
<
0
)
{
print_err_status
(
dev
,
i
,
status
);
continue
;
}
len
=
urb
->
iso_frame_desc
[
i
].
actual_length
;
...
...
@@ -402,7 +419,7 @@ static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf)
if
(((
*
buf
)
->
fmt
->
fourcc
)
!=
V4L2_PIX_FMT_TM6000
)
{
buffer_filled
(
dev
,
*
buf
);
dprintk
(
dev
,
V4L2_DEBUG_
QUEUE
,
"new buffer filled
\n
"
);
dprintk
(
dev
,
V4L2_DEBUG_
ISOC
,
"new buffer filled
\n
"
);
}
return
rc
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment