From the course: Linux Device Drivers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Examine the net_device_ops structure

Examine the net_device_ops structure - Linux Tutorial

From the course: Linux Device Drivers

Start my 1-month free trial

Examine the net_device_ops structure

- [Instructor] Let's dig more into device driver for network devices by looking at the net device ops and some of the functions. So we'll look at the net device ops structure, and then we'll look at four functions, the open, the ioctal, the start transmit and the get stats. Here's the net device ops structure and the e1000e driver. And you can see like other ops structures, they use the dot field name equals address of a function, and they've got open-close transmit frame and so forth. This is not the complete ops structure, but it's a good bit of it. And we'll look at some of these functions. The open is called when you bring the interface up, like if up or if config and giving it an address. The open, like open for character and black drivers, allocates resources, allocate some memory, registers some things and so forth, including registering the interrupt handlers. So after this, the device should be ready to accept…

Contents