|
@@ -313,6 +313,24 @@ struct net_device * find_netdev ( const char *name ) {
|
313
|
313
|
return NULL;
|
314
|
314
|
}
|
315
|
315
|
|
|
316
|
+/**
|
|
317
|
+ * Get network device by PCI bus:dev.fn address
|
|
318
|
+ *
|
|
319
|
+ * @v busdevfn PCI bus:dev.fn address
|
|
320
|
+ * @ret netdev Network device, or NULL
|
|
321
|
+ */
|
|
322
|
+struct net_device * find_pci_netdev ( unsigned int busdevfn ) {
|
|
323
|
+ struct net_device *netdev;
|
|
324
|
+
|
|
325
|
+ list_for_each_entry ( netdev, &net_devices, list ) {
|
|
326
|
+ if ( ( netdev->dev->desc.bus_type == BUS_TYPE_PCI ) &&
|
|
327
|
+ ( netdev->dev->desc.pci.busdevfn == busdevfn ) )
|
|
328
|
+ return netdev;
|
|
329
|
+ }
|
|
330
|
+
|
|
331
|
+ return NULL;
|
|
332
|
+}
|
|
333
|
+
|
316
|
334
|
/**
|
317
|
335
|
* Transmit network-layer packet
|
318
|
336
|
*
|