Skip to content

Commit

Permalink
[efi] Add last_opened_snpdev()
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 13, 2013
1 parent 033f4c9 commit db014f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/ipxe/efi/efi_snp.h
Expand Up @@ -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 */
15 changes: 15 additions & 0 deletions src/interface/efi/efi_snp.c
Expand Up @@ -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 );
}

0 comments on commit db014f3

Please sign in to comment.