Browse Source

[efi] Add last_opened_snpdev()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
db014f3c23
2 changed files with 16 additions and 0 deletions
  1. 1
    0
      src/include/ipxe/efi/efi_snp.h
  2. 15
    0
      src/interface/efi/efi_snp.c

+ 1
- 0
src/include/ipxe/efi/efi_snp.h View File

71
 
71
 
72
 extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
72
 extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
73
 extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
73
 extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
74
+extern struct efi_snp_device * last_opened_snpdev ( void );
74
 
75
 
75
 #endif /* _IPXE_EFI_SNP_H */
76
 #endif /* _IPXE_EFI_SNP_H */

+ 15
- 0
src/interface/efi/efi_snp.c View File

1005
 	.notify = efi_snp_notify,
1005
 	.notify = efi_snp_notify,
1006
 	.remove = efi_snp_remove,
1006
 	.remove = efi_snp_remove,
1007
 };
1007
 };
1008
+
1009
+/**
1010
+ * Get most recently opened SNP device
1011
+ *
1012
+ * @ret snpdev		Most recently opened SNP device, or NULL
1013
+ */
1014
+struct efi_snp_device * last_opened_snpdev ( void ) {
1015
+	struct net_device *netdev;
1016
+
1017
+	netdev = last_opened_netdev();
1018
+	if ( ! netdev )
1019
+		return NULL;
1020
+
1021
+	return efi_snp_demux ( netdev );
1022
+}

Loading…
Cancel
Save