nathan
nathan

Reputation: 854

why network interface has no Major number and minor number

guys I am learning Linux Device Drivers.I have a question when reading below

"Since there is no equivalent of major and minor numbers for network interfaces, a network driver does not request such a number"

so could you please tell me why network interface has no major number or minor number by design?

Thanks

Upvotes: 0

Views: 347

Answers (1)

user8549610
user8549610

Reputation:

Major and minor numbers are used by character devices or block devices, and this implies that the user interacts with these devices by reading from and writing to special files (nodes), so a node may be created using the two numbers (major determines the device driver whilst minor is to specify a particular device managed by the driver).

Network drivers don't need the numbers since the approach (or design, as you say) of accessing network adapters doesn't assume their representation as files or nodes. Instead, the concept of network interfaces is used. And you typically make use of these network interfaces by means of socket API (say, Berkeley sockets), and such a kernel subsystem as network stack is involved here as an intermediate agent between your application and the network driver. There is no read/write access through files.

Upvotes: 2

Related Questions