Larry
Larry

Reputation: 1765

Kernel - networking, role of the "private" structure

Context

Reading the Linux device driver book, chapter 17.

I don't quite understand why one would need a private structure to hold information.

I don't get it, its usage.

The pci_device and net_device structure already have plenty of information.

Can someone tell me more ?

Upvotes: 1

Views: 188

Answers (1)

saurabh agarwal
saurabh agarwal

Reputation: 2174

In the book, It has been suggested that direct access of these information will deteriorate system performance and also has flexibility issue. So we use private structure to encourage the use of functions to access these information.

Reference: ch17.13860 Page 504, Linux Device Drivers, Third edition

As far as its uses is concerned. You are free to make its own use of the field or to ignore it. It is a useful resource for preserving state information across system calls.

Upvotes: 1

Related Questions