LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 09-20-2011, 06:40 AM   #1
Jyke
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, 09:23 AM   #2
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 227

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.
  


Reply


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 10:16 PM
[SOLVED] Build KVM as a module or inside the kernel ? Linux.tar.gz Linux - Software 2 10-05-2009 03:08 AM
bash ; changing some data inside of a file sebastian29 Linux - Newbie 7 09-08-2008 09:56 PM
how will you know if a cd-rw has a data inside? jaepi Programming 4 05-17-2007 08:57 AM
how to open a file inside a kernel module yugandhar Linux - Kernel 2 08-11-2006 06:43 AM


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

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