Re: how does ifconfig communicates with network device driver strace output given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 12, 2010 at 2:28 AM, Tapas Mishra <mightydreams@xxxxxxxxx> wrote:
> Hi,
> I read the 17th Chapter of LDD3 and explored what is a network device driver.
> I wanted to understand in real context the working of network device
> driver on my laptop.
> The book described about snull (dummy ) device.
>
> So here is the problem
> when I do an ifconfig the open,close, and other methods which the
> driver has defined come into action.
> I did strace ifconfig to understand what system calls were issued when
> I do an ifconfig from userspace
> here is the output of strace
> http://pastebin.com/FMggtA9s
> what I see is most of the calls are
> open,access,fstat,mmap,mprotect,close,ioctl,write,
> what I am not clear is
> what mechanism is existing which says that when ifconfig is issued
> then the response will come from
> a particular set of driver (I understand that we register the driver
> by register_netdev but how does the
> system calls or requests from ifconfig transferred to the particular
> device or how does
> ifconfig communicates with kernel and I see the resultant commands
> issued via strace as you see in above pastebin output.

drivers/net/e100.c is a standard Ethernet pci driver to look at.

Basically, there is are function pointers to all those functions in
the struct net_device or net_device_ops depending on how old your
kernel is.  Net_device_ops is the newer of the two.

The driver registers with the pci subsystem and the pci subsystem
determines which driver to use and therefore which
net_device/net_device_ops struct to call for those functions.

--
John

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux