瀏覽代碼

[efi] Add last_opened_snpdev()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 年之前
父節點
當前提交
db014f3c23
共有 2 個文件被更改,包括 16 次插入0 次删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存