|
@@ -684,6 +684,24 @@ struct net_device * find_netdev ( const char *name ) {
|
684
|
684
|
return NULL;
|
685
|
685
|
}
|
686
|
686
|
|
|
687
|
+/**
|
|
688
|
+ * Get network device by index
|
|
689
|
+ *
|
|
690
|
+ * @v index Network device index
|
|
691
|
+ * @ret netdev Network device, or NULL
|
|
692
|
+ */
|
|
693
|
+struct net_device * find_netdev_by_index ( unsigned int index ) {
|
|
694
|
+ struct net_device *netdev;
|
|
695
|
+
|
|
696
|
+ /* Identify network device by index */
|
|
697
|
+ list_for_each_entry ( netdev, &net_devices, list ) {
|
|
698
|
+ if ( netdev->index == index )
|
|
699
|
+ return netdev;
|
|
700
|
+ }
|
|
701
|
+
|
|
702
|
+ return NULL;
|
|
703
|
+}
|
|
704
|
+
|
687
|
705
|
/**
|
688
|
706
|
* Get network device by PCI bus:dev.fn address
|
689
|
707
|
*
|