From: phil@pjd.me.uk (phil)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Writing driver for a net device which does not support interrupt
Date: Mon, 23 Mar 2015 16:59:00 +0000 [thread overview]
Message-ID: <55104654.3020406@pjd.me.uk> (raw)
In-Reply-To: <550FF047.90103@gmail.com>
On 23/03/15 10:51, Freeman Zhang wrote:
> I'm writing a net device driver for my final project in college. But the
> half-finished device doesn't support interrupt yet(those hardware guys...)
>
> So I'm wondering if there is some way to poll the device for its status
> and events.
You should take a look at kernel timers, this is a rather old resource
and was just the first hit in a google search but it should still be
relevant.
http://www.ibm.com/developerworks/library/l-timers-list/
Kernel timers will sort of prepare you for interrupts i.e. a kernel
timer will fire every $time_value and you can put your code which should
normally run during an interrupt in the callback code.
I've used kernel timers to debug interrupts on our hardware devices,
i.e. there have been times when the hardware has stopped raising
interrupts and I've put timers in to cover this. For example a new
firmware might work fine, but have completely broken interrupts or not
fire interrupts often enough and timers can prove to the hardware guys
that it's interrupts at fault ;)
hint: you might also want to look at tasklets and have your timer
callback just call a tasklet.
Phil
next prev parent reply other threads:[~2015-03-23 16:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 10:51 Writing driver for a net device which does not support interrupt Freeman Zhang
2015-03-23 15:51 ` Valdis.Kletnieks at vt.edu
2015-03-24 1:24 ` Freeman Zhang
2015-03-23 16:59 ` phil [this message]
2015-03-24 1:34 ` Freeman Zhang
2015-03-24 16:52 ` Daniel Baluta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55104654.3020406@pjd.me.uk \
--to=phil@pjd.me.uk \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).