Sfoglia il codice sorgente

[efi] Add last_opened_snpdev()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 anni fa
parent
commit
db014f3c23
2 ha cambiato i file con 16 aggiunte e 0 eliminazioni
  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 Vedi File

@@ -71,5 +71,6 @@ struct efi_snp_device {
71 71
 
72 72
 extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
73 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 76
 #endif /* _IPXE_EFI_SNP_H */

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

@@ -1005,3 +1005,18 @@ struct net_driver efi_snp_driver __net_driver = {
1005 1005
 	.notify = efi_snp_notify,
1006 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…
Annulla
Salva