* Proper syntax to open() device driver from app.
@ 2001-12-13 15:30 Steven Vacca
0 siblings, 0 replies; 2+ messages in thread
From: Steven Vacca @ 2001-12-13 15:30 UTC (permalink / raw)
To: LinuxEmbeddedMailList (E-mail)
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Proper syntax to open() device driver from app.
@ 2001-12-13 16:11 Steven Vacca
0 siblings, 0 replies; 2+ messages in thread
From: Steven Vacca @ 2001-12-13 16:11 UTC (permalink / raw)
To: LinuxEmbeddedMailList (E-mail)
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-12-13 16:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-13 15:30 Proper syntax to open() device driver from app Steven Vacca
-- strict thread matches above, loose matches on Subject: below --
2001-12-13 16:11 Steven Vacca
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.