diff options
author | Michael Brown | 2013-03-13 23:34:06 +0100 |
---|---|---|
committer | Michael Brown | 2013-03-13 23:42:15 +0100 |
commit | db014f3c23be19e11964d48f2bcb25b54a9bf722 (patch) | |
tree | 0a523365890a232cfced14ada30b71964cc5765e /src | |
parent | [autoboot] Split main control flow out of main() into a new function ipxe() (diff) | |
download | ipxe-db014f3c23be19e11964d48f2bcb25b54a9bf722.tar.gz ipxe-db014f3c23be19e11964d48f2bcb25b54a9bf722.tar.xz ipxe-db014f3c23be19e11964d48f2bcb25b54a9bf722.zip |
[efi] Add last_opened_snpdev()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/ipxe/efi/efi_snp.h | 1 | ||||
-rw-r--r-- | src/interface/efi/efi_snp.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_snp.h b/src/include/ipxe/efi/efi_snp.h index c8676090..074d1b27 100644 --- a/src/include/ipxe/efi/efi_snp.h +++ b/src/include/ipxe/efi/efi_snp.h @@ -71,5 +71,6 @@ struct efi_snp_device { extern int efi_snp_hii_install ( struct efi_snp_device *snpdev ); extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev ); +extern struct efi_snp_device * last_opened_snpdev ( void ); #endif /* _IPXE_EFI_SNP_H */ diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c index 20027596..48a6f397 100644 --- a/src/interface/efi/efi_snp.c +++ b/src/interface/efi/efi_snp.c @@ -1005,3 +1005,18 @@ struct net_driver efi_snp_driver __net_driver = { .notify = efi_snp_notify, .remove = efi_snp_remove, }; + +/** + * Get most recently opened SNP device + * + * @ret snpdev Most recently opened SNP device, or NULL + */ +struct efi_snp_device * last_opened_snpdev ( void ) { + struct net_device *netdev; + + netdev = last_opened_netdev(); + if ( ! netdev ) + return NULL; + + return efi_snp_demux ( netdev ); +} |