Quellcode durchsuchen

[efi] Add last_opened_snpdev()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown vor 11 Jahren
Ursprung
Commit
db014f3c23
2 geänderte Dateien mit 16 neuen und 0 gelöschten Zeilen
  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 Datei anzeigen

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 Datei anzeigen

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
+}

Laden…
Abbrechen
Speichern