[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] fifo question
is it ok to use in kernel module (non-rt) the following for writing/reading fifos (to comunicate with rt task) ?
// ...
struct msg rt_msg;
rtf_create(FIFO, sizeof(rt_msg));
rt_msg.cmd=1;
if ( rtf_put(FIFO, &rt_msg, sizeof(rt_msg)) != sizeof(rt_msg) ) {
printk("FIFO_CTL write failed, terminating\n");
return(-EINVAL);
}
if( rtf_get(FIFO, &rt_msg, sizeof(rt_msg)) != sizeof(rt_msg) ){
printk("FIFO read failed, terminating\n");
return(-EINVAL);
}
printk("got from rttsak: %d\n", rt_msg.cmd);
// ...
rgds,
Denis.
--
("\''/").__..-''"`-. . denis.karpov@lut.fi
`9_ 9 ) `-. ( ).`-._.`) http://www.lut.fi/~karpov/
(_Y_.)' ._ ) `._`. " -.-' +358 (0)40 502 0931
_..`-'_..-_/ /-'_.' Lappeenranta University of Technology
(l)-'' ((i).' ((!.'
*** Born free...Taxed to death. ***