Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-21-2006, 08:23 AM   #1
LQ Newbie
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
Polling Device Drivers

Hi all,

I am in the process of writing a polling device driver for a WinTV-Pro 150 TV card for Linux. I have source code for an interrupt driver for this code but am trying to implement a polling driver as part of an analysis between these two types of drivers (interrupt and polling).
I have been searching forums and sites looking for information regarding the polling aspect but have found nothing except small paragraphs discussing the the theory behind polling (no sample source code or polling driver functions).
Can anyone point me in the direction of a good site for learning more about how to write polling drivers or have any opinions themselves?

Old 04-04-2006, 09:04 PM   #2
Registered: Aug 2003
Location: Vancouver, Canada
Distribution: RH, SL
Posts: 37

Rep: Reputation: 15
In my opinion, and many others, polling is only used as a last resort. To get decent performance you will have to use most of the CPU cycles idly watching and waiting for something to happen. In certain "extreme" situations, with high throughput when you want to lower overhead, polling might be a better choice, but I don't think a TV video card would qualify.

I really suggest you continue on with learning how to use an interrupt-based driver.

Basically a polling driver would look crudely like the following,

int returncode;
returncode = getinfofromcard(&data);
while (returncode==0)
localvar = data.var;
etc... /* process the io here */
returncode = getinfofromcard(&data);

case returncode

1: /* do something for error code 1 */

Good luck,
Dave Asgeirsson


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
Proper way of polling a device george_mercury Programming 4 12-13-2008 01:13 PM
Code for a Polling Linux Device Driver Jay-Whizzle Linux - Hardware 1 03-22-2006 12:52 AM
Is there a way of detecting directory changes without polling? naf Programming 2 03-01-2006 11:16 AM
NAPI in linux with kernel 2.6 for device polling wangjinyi Linux - Networking 0 09-22-2005 02:36 AM
about device polling wangjinyi Fedora 0 04-27-2005 02:22 AM > Forums > Non-*NIX Forums > Programming

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

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