Results 1 to 2 of 2
Hi
I am making a Linux driver module. I am making my own work queue to submit tasks to.
What I want to ask is that when I declare a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-14-2012 #1Just Joined!
- Join Date
- Sep 2012
- Posts
- 1
Work Queues in Drivers
Hi
I am making a Linux driver module. I am making my own work queue to submit tasks to.
What I want to ask is that when I declare a workqueue_struct as regular a variable it gives the following error:
Declaration:
struct kt_dev {
int id;
struct cdev chardevice;
spinlock_t spinl;
struct workqueue_struct workq;
};
error: field ‘workq’ has incomplete type
Apparently workqueue_struct is only allowing pointer declaraitons. So the following has no problem:
struct kt_dev {
int id;
struct cdev chardevice;
spinlock_t spinl;
struct workqueue_struct *workq;
};
Why is this so?
Thanks
Trishabh
- 10-09-2012 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,233
That's because you are not including the header file with the actual struct workqueue_struct definition. The pointer is an opaque value, so it can be set by some other bit of code that does know about the structure and its size, members, etc.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
