Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ab22cbda
Commit
ab22cbda
authored
Mar 21, 2011
by
Florian Mickler
Committed by
Mauro Carvalho Chehab
May 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[media] vp7045: get rid of on-stack dma buffers
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
54f4e11a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
13 deletions
+34
-13
drivers/media/dvb/dvb-usb/vp7045.c
drivers/media/dvb/dvb-usb/vp7045.c
+34
-13
No files found.
drivers/media/dvb/dvb-usb/vp7045.c
View file @
ab22cbda
...
@@ -28,9 +28,9 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
...
@@ -28,9 +28,9 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
int
vp7045_usb_op
(
struct
dvb_usb_device
*
d
,
u8
cmd
,
u8
*
out
,
int
outlen
,
u8
*
in
,
int
inlen
,
int
msec
)
int
vp7045_usb_op
(
struct
dvb_usb_device
*
d
,
u8
cmd
,
u8
*
out
,
int
outlen
,
u8
*
in
,
int
inlen
,
int
msec
)
{
{
int
ret
=
0
;
int
ret
=
0
;
u8
inbuf
[
12
]
=
{
0
},
outbuf
[
20
]
=
{
0
}
;
u8
*
buf
=
d
->
priv
;
out
buf
[
0
]
=
cmd
;
buf
[
0
]
=
cmd
;
if
(
outlen
>
19
)
if
(
outlen
>
19
)
outlen
=
19
;
outlen
=
19
;
...
@@ -38,19 +38,21 @@ int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in,
...
@@ -38,19 +38,21 @@ int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in,
if
(
inlen
>
11
)
if
(
inlen
>
11
)
inlen
=
11
;
inlen
=
11
;
ret
=
mutex_lock_interruptible
(
&
d
->
usb_mutex
);
if
(
ret
)
return
ret
;
if
(
out
!=
NULL
&&
outlen
>
0
)
if
(
out
!=
NULL
&&
outlen
>
0
)
memcpy
(
&
out
buf
[
1
],
out
,
outlen
);
memcpy
(
&
buf
[
1
],
out
,
outlen
);
deb_xfer
(
"out buffer: "
);
deb_xfer
(
"out buffer: "
);
debug_dump
(
outbuf
,
outlen
+
1
,
deb_xfer
);
debug_dump
(
buf
,
outlen
+
1
,
deb_xfer
);
if
((
ret
=
mutex_lock_interruptible
(
&
d
->
usb_mutex
)))
return
ret
;
if
(
usb_control_msg
(
d
->
udev
,
if
(
usb_control_msg
(
d
->
udev
,
usb_sndctrlpipe
(
d
->
udev
,
0
),
usb_sndctrlpipe
(
d
->
udev
,
0
),
TH_COMMAND_OUT
,
USB_TYPE_VENDOR
|
USB_DIR_OUT
,
0
,
0
,
TH_COMMAND_OUT
,
USB_TYPE_VENDOR
|
USB_DIR_OUT
,
0
,
0
,
out
buf
,
20
,
2000
)
!=
20
)
{
buf
,
20
,
2000
)
!=
20
)
{
err
(
"USB control message 'out' went wrong."
);
err
(
"USB control message 'out' went wrong."
);
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
unlock
;
goto
unlock
;
...
@@ -61,17 +63,17 @@ int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in,
...
@@ -61,17 +63,17 @@ int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in,
if
(
usb_control_msg
(
d
->
udev
,
if
(
usb_control_msg
(
d
->
udev
,
usb_rcvctrlpipe
(
d
->
udev
,
0
),
usb_rcvctrlpipe
(
d
->
udev
,
0
),
TH_COMMAND_IN
,
USB_TYPE_VENDOR
|
USB_DIR_IN
,
0
,
0
,
TH_COMMAND_IN
,
USB_TYPE_VENDOR
|
USB_DIR_IN
,
0
,
0
,
in
buf
,
12
,
2000
)
!=
12
)
{
buf
,
12
,
2000
)
!=
12
)
{
err
(
"USB control message 'in' went wrong."
);
err
(
"USB control message 'in' went wrong."
);
ret
=
-
EIO
;
ret
=
-
EIO
;
goto
unlock
;
goto
unlock
;
}
}
deb_xfer
(
"in buffer: "
);
deb_xfer
(
"in buffer: "
);
debug_dump
(
inbuf
,
12
,
deb_xfer
);
debug_dump
(
buf
,
12
,
deb_xfer
);
if
(
in
!=
NULL
&&
inlen
>
0
)
if
(
in
!=
NULL
&&
inlen
>
0
)
memcpy
(
in
,
&
inbuf
[
1
],
inlen
);
memcpy
(
in
,
&
buf
[
1
],
inlen
);
unlock:
unlock:
mutex_unlock
(
&
d
->
usb_mutex
);
mutex_unlock
(
&
d
->
usb_mutex
);
...
@@ -222,8 +224,26 @@ static struct dvb_usb_device_properties vp7045_properties;
...
@@ -222,8 +224,26 @@ static struct dvb_usb_device_properties vp7045_properties;
static
int
vp7045_usb_probe
(
struct
usb_interface
*
intf
,
static
int
vp7045_usb_probe
(
struct
usb_interface
*
intf
,
const
struct
usb_device_id
*
id
)
const
struct
usb_device_id
*
id
)
{
{
return
dvb_usb_device_init
(
intf
,
&
vp7045_properties
,
struct
dvb_usb_device
*
d
;
THIS_MODULE
,
NULL
,
adapter_nr
);
int
ret
=
dvb_usb_device_init
(
intf
,
&
vp7045_properties
,
THIS_MODULE
,
&
d
,
adapter_nr
);
if
(
ret
)
return
ret
;
d
->
priv
=
kmalloc
(
20
,
GFP_KERNEL
);
if
(
!
d
->
priv
)
{
dvb_usb_device_exit
(
intf
);
return
-
ENOMEM
;
}
return
ret
;
}
static
void
vp7045_usb_disconnect
(
struct
usb_interface
*
intf
)
{
struct
dvb_usb_device
*
d
=
usb_get_intfdata
(
intf
);
kfree
(
d
->
priv
);
dvb_usb_device_exit
(
intf
);
}
}
static
struct
usb_device_id
vp7045_usb_table
[]
=
{
static
struct
usb_device_id
vp7045_usb_table
[]
=
{
...
@@ -238,6 +258,7 @@ MODULE_DEVICE_TABLE(usb, vp7045_usb_table);
...
@@ -238,6 +258,7 @@ MODULE_DEVICE_TABLE(usb, vp7045_usb_table);
static
struct
dvb_usb_device_properties
vp7045_properties
=
{
static
struct
dvb_usb_device_properties
vp7045_properties
=
{
.
usb_ctrl
=
CYPRESS_FX2
,
.
usb_ctrl
=
CYPRESS_FX2
,
.
firmware
=
"dvb-usb-vp7045-01.fw"
,
.
firmware
=
"dvb-usb-vp7045-01.fw"
,
.
size_of_priv
=
sizeof
(
u8
*
),
.
num_adapters
=
1
,
.
num_adapters
=
1
,
.
adapter
=
{
.
adapter
=
{
...
@@ -284,7 +305,7 @@ static struct dvb_usb_device_properties vp7045_properties = {
...
@@ -284,7 +305,7 @@ static struct dvb_usb_device_properties vp7045_properties = {
static
struct
usb_driver
vp7045_usb_driver
=
{
static
struct
usb_driver
vp7045_usb_driver
=
{
.
name
=
"dvb_usb_vp7045"
,
.
name
=
"dvb_usb_vp7045"
,
.
probe
=
vp7045_usb_probe
,
.
probe
=
vp7045_usb_probe
,
.
disconnect
=
dvb_usb_device_exi
t
,
.
disconnect
=
vp7045_usb_disconnec
t
,
.
id_table
=
vp7045_usb_table
,
.
id_table
=
vp7045_usb_table
,
};
};
...
...
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