LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-11-2011, 05:43 AM   #1
tanniru
LQ Newbie
 
Registered: Mar 2006
Posts: 24

Rep: Reputation: 0
how can we send data from device driver to an user application?


Hi..

how can we send data from device driver to an user application?
which will be efficient one?

1) using named pipe.. thats FIFO
..... here i'm getting problem in "write" in kernel space... cant do that.. error comes.. while "read" works just fine.
(( someone please just help me in fixing write problem. getting -14 returned each time i tried to write by several ways))

2) using copy_to_user and copy_from_user
..... i'm not much aware of these functions

3) using these sockets? netlink sockets?

Last edited by tanniru; 05-11-2011 at 05:49 AM.
 
Old 05-11-2011, 06:43 AM   #2
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by tanniru View Post
2) using copy_to_user and copy_from_user
..... i'm not much aware of these functions
http://www.gnugeneration.com/books/l...20/kernel-api/
 
Old 05-11-2011, 08:57 AM   #3
robvoo
LQ Newbie
 
Registered: Jul 2009
Distribution: debian, ubuntu
Posts: 22

Rep: Reputation: 2
LDD

http://lwn.net/Kernel/LDD3/
 
Old 05-12-2011, 01:45 AM   #4
robvoo
LQ Newbie
 
Registered: Jul 2009
Distribution: debian, ubuntu
Posts: 22

Rep: Reputation: 2
@tanniru

Quote:
1) using named pipe.. thats FIFO
..... here i'm getting problem in "write" in kernel space... cant do that.. error comes.. while "read" works just fine.
(( someone please just help me in fixing write problem. getting -14 returned each time i tried to write by several ways))
Answer) I think you want to make a charater device that handels the reads / writes actions and contains a fifo of some sort?
Quote:
2) using copy_to_user and copy_from_user
..... i'm not much aware of these functions
Have a look at the links posted above they would explain when and who they are used
Quote:
3) using these sockets? netlink sockets?
The answer depends on what you try to accomplish or create:
Are you just trying to access a device via a kernel space driver?
Or are you creating the driver yourself?
What kind of device driver / interface exists for your device?
What kind of data should it produce or handle?



Regards Rob
 
  


Reply



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
Reading and understanding data send to USB device Dahoon Linux - Hardware 1 06-15-2009 11:11 PM
how to send datas to HID device?why I can only send two bytes data to HID device? wch_zj Linux - Software 1 01-05-2006 07:14 AM
why I can only send two bytes data to HID device? wch_zj Programming 0 01-05-2006 12:04 AM
How to send data from kernel to user thegreatest Programming 5 11-23-2005 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration