mirror of https://github.com/ipxe/ipxe.git
Add find_pci_netdev()
parent
fdc97499bf
commit
1fa5cd0e2b
|
@ -264,6 +264,8 @@ extern void netdev_close ( struct net_device *netdev );
|
||||||
extern void unregister_netdev ( struct net_device *netdev );
|
extern void unregister_netdev ( struct net_device *netdev );
|
||||||
extern void free_netdev ( struct net_device *netdev );
|
extern void free_netdev ( struct net_device *netdev );
|
||||||
struct net_device * find_netdev ( const char *name );
|
struct net_device * find_netdev ( const char *name );
|
||||||
|
struct net_device * find_pci_netdev ( unsigned int busdevfn );
|
||||||
|
|
||||||
extern int net_tx ( struct pk_buff *pkb, struct net_device *netdev,
|
extern int net_tx ( struct pk_buff *pkb, struct net_device *netdev,
|
||||||
struct net_protocol *net_protocol, const void *ll_dest );
|
struct net_protocol *net_protocol, const void *ll_dest );
|
||||||
extern int net_rx ( struct pk_buff *pkb, struct net_device *netdev,
|
extern int net_rx ( struct pk_buff *pkb, struct net_device *netdev,
|
||||||
|
|
|
@ -313,6 +313,24 @@ struct net_device * find_netdev ( const char *name ) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get network device by PCI bus:dev.fn address
|
||||||
|
*
|
||||||
|
* @v busdevfn PCI bus:dev.fn address
|
||||||
|
* @ret netdev Network device, or NULL
|
||||||
|
*/
|
||||||
|
struct net_device * find_pci_netdev ( unsigned int busdevfn ) {
|
||||||
|
struct net_device *netdev;
|
||||||
|
|
||||||
|
list_for_each_entry ( netdev, &net_devices, list ) {
|
||||||
|
if ( ( netdev->dev->desc.bus_type == BUS_TYPE_PCI ) &&
|
||||||
|
( netdev->dev->desc.pci.busdevfn == busdevfn ) )
|
||||||
|
return netdev;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transmit network-layer packet
|
* Transmit network-layer packet
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue