From: Steven Vacca <svacca@valcom.com>
To: "LinuxEmbeddedMailList (E-mail)" <linuxppc-embedded@lists.linuxppc.org>
Subject: Proper syntax to open() device driver from app.
Date: Thu, 13 Dec 2001 10:30:42 -0500 [thread overview]
Message-ID: <01C183C1.37F31990.svacca@valcom.com> (raw)
I have a test driver, which turns an onboard LED ON or OFF,
resident and directly linked to the kernel image.
In chr_dev_init(), the driver's init func is called and the
device registers itself with a specified MAJOR number.
When my app runs, I'm not exactly sure of
what the proper syntax is to open() the driver (call the driver's
open() func in the file_operations struct) and then execute
ioctl() to send an LED ON or OFF cmd to the driver.
Does anyone have some examples of this?
Most info regards modules rather than resident drivers.
Am I correct in assuming that I should do something similar
to the following:
hndl = open("/dev/led",O_WRONLY,0);
ioctl(hndl,LED_ON,0);
Thanks,
ShutEye Thinkin
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next reply other threads:[~2001-12-13 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-13 15:30 Steven Vacca [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-12-13 16:11 Proper syntax to open() device driver from app Steven Vacca
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=01C183C1.37F31990.svacca@valcom.com \
--to=svacca@valcom.com \
--cc=linuxppc-embedded@lists.linuxppc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.