Is there a way programmatically driver name of interface, e开发者_如何学编程xcept of parsing output of "ethtool -i interface_name"?
I would happy if it can be retrieved from a file.
You can query sysfs for it. Read the target of the /sys/class/net/$interface/device/driver symlink and take the part after the last /.
Example:
$ stat --format '%N' /sys/class/net/*/device/driver
‘/sys/class/net/eth0/device/driver’ -> ‘../../../../bus/pci/drivers/jme’
‘/sys/class/net/wlan0/device/driver’ -> ‘../../../../bus/pci/drivers/iwlagn’
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论