1
votes

I have a doubt regarding struct net_device in linux kernel.

Every frame in linux kernel is represented in skbuff structure. It has an instance to struct net_device which tells about the interface or physical port from which packet is received or to be transmitted.

In struct net_device we have a variable "struct net_bridge_port" which is related to port of a bridge (if enabled).

My doubt is struct net_device structure should be filled by device driver but how can it fill information regarding the "struct net_bridge_port" at device driver level ?

Thanks in advance

1

1 Answers

1
votes

I don't know what kernel version you're looking at. But in the latest version (3.3-rc1 at the moment), struct net_bridge_port is only used in the bridging code in net/bridge. Everything relating to bridging is filled in by the bridge driver when an interface is added to a bridge, so there is nothing for the low-level network device driver to fill in.