<br><br><div class="gmail_quote">On Fri, May 4, 2012 at 6:55 AM, ÏÄÒµÌí <span dir="ltr"><<a href="mailto:summerxyt@gmail.com" target="_blank">summerxyt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Chetan,<br>
<br>
Thanks for reply and it works. And I want to verify some other things.<br>
<br>
Is it a good way to use workqueue to do this job: send data to user<br>
space through netlink socket from kernel?<br>
<br>
Thanks!<br>
<br>
2012/5/4 Chetan Nanda <<a href="mailto:chetannanda@gmail.com" target="_blank">chetannanda@gmail.com</a>>:<br>
<div><div>><br>
> On May 3, 2012 8:37 PM, "ÏÄÒµÌí" <<a href="mailto:summerxyt@gmail.com" target="_blank">summerxyt@gmail.com</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I want to use workqueue in my irq handler. Some materials say that I can<br>
>> use<br>
>><br>
>> INIT_WORK( &work, function, &data );<br>
>><br>
>> to initialize work, whose type is struct work_struct, and data is<br>
>> something should be passed to function.<br>
>> however, it seems that now the macro INIT_WORK() only accept two<br>
>> parameters:&work and function.<br>
>><br>
>> My problem is how to pass data to the function and why they change that<br>
>> macro?<br>
>><br>
>> Thanks!<br>
>><br>
> May be you are looking for something like this:<br>
> <a href="http://www.linuxforums.org/forum/kernel/183688-init_work-two-arguments.html" target="_blank">http://www.linuxforums.org/forum/kernel/183688-init_work-two-arguments.html</a><br>
><br>
> ~chetan _______________________________________________<br>
>> Kernelnewbies mailing list<br>
>> <a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div>Hi,<div>To send data from kernel space and user-space see kernel's notification mechanism like fanotify which works on by creating an anonymous fd in the user-space process's context which then might perform normal read() and write() call to receive and send data to kernel.</div>
<div><br></div><div>- Rohan </div>