Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 09-20-2011, 07:40 AM   #1
LQ Newbie
Registered: Sep 2011
Posts: 2

Rep: Reputation: Disabled
usb_control_msg data inside module

If I have a code with a USB ctrl message data inside a module
defined as:
static unsigned char* reset = "\xFF\x00\xEE";
and use that directly in usb_control_msg()
I can't get any results (if I read usbmon correctly it never gets sent).

But if I change the code to allocate the same data
at runtime using kmemdup() and pass that buffer to usb_control_msg()
everything seems to be working.

Why the static data inside the kernel module can't be used directly?
There is no mention about this in any usb_contorl_msg()
documentation I can find.

kernel version 2.6.38 (ubuntu 10.4)
Old 09-20-2011, 10:23 AM   #2
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 228

Rep: Reputation: 54
On your architecture, static data in modules cannot be used for DMA.

In general, you must use kmalloc or the DMA API for allocating DMA-able buffers.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Other stuff accessing data from inside my Gmail! resetreset Programming 14 01-12-2011 11:16 PM
[SOLVED] Build KVM as a module or inside the kernel ? Linux.tar.gz Linux - Software 2 10-05-2009 04:08 AM
bash ; changing some data inside of a file sebastian29 Linux - Newbie 7 09-08-2008 10:56 PM
how will you know if a cd-rw has a data inside? jaepi Programming 4 05-17-2007 09:57 AM
how to open a file inside a kernel module yugandhar Linux - Kernel 2 08-11-2006 07:43 AM

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration