Skip to contentSkip to conversation

beginner of a driver-developer

DISCUSSION [email protected] 2 participants 2 messages May 6, 2004

lore
Share & tools
lore
#0 lore raw

I am a beginner of a driver-developer.
I got some problems.

you know some structs such as "file_operation" were defined in Header Files.when I define a struct in .C files,i always got errors below:

fops has an incomplete type
storage size of 'fops' isn't known

In my .C files , I defined as followed:

.....................
struct file_operation fops;
.....................

How can i solve this sort of problems. Thank you.

#1 lore raw
Quoted 8 lines · On Thu, May 06, 2004 at 09:05:08PM +0800, [email protected] wrote:

I am a beginner of a driver-developer.
I got some problems.

you know some structs such as "file_operation" were defined in Header Files.when I define a struct in .C files,i always got errors below:

fops has an incomplete type
storage size of 'fops' isn't known

Quoted 7 lines

In my .C files , I defined as followed:

.....................
struct file_operation fops;
.....................

How can i solve this sort of problems. Thank you.

In this particular case you did not include the header file that defines the file_operations struct.
May I suggest you read "Linux Device drivers" by Jonathan Corbet. It's available somewhere on the net, but I can recommend the paper version. On lwn.net there is also a nice series of articles refelcting the changes from 2.4 -> 2.6, also made by said Jonathan Corbet.

Sam