Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147854841
D20642.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20642.diff
View Options
Index: head/stand/efi/libefi/efinet.c
===================================================================
--- head/stand/efi/libefi/efinet.c
+++ head/stand/efi/libefi/efinet.c
@@ -108,7 +108,25 @@
static int
efinet_probe(struct netif *nif, void *machdep_hint)
{
+ EFI_SIMPLE_NETWORK *net;
+ EFI_HANDLE h;
+ EFI_STATUS status;
+ h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private;
+ /*
+ * Open the network device in exclusive mode. Without this
+ * we will be racing with the UEFI network stack. It will
+ * pull packets off the network leading to lost packets.
+ */
+ status = BS->OpenProtocol(h, &sn_guid, (void **)&net,
+ IH, NULL, EFI_OPEN_PROTOCOL_EXCLUSIVE);
+ if (status != EFI_SUCCESS) {
+ printf("Unable to open network interface %d for "
+ "exclusive access: %lu\n", nif->nif_unit,
+ EFI_ERROR_CODE(status));
+ return (efi_status_to_errno(status));
+ }
+
return (0);
}
@@ -269,7 +287,6 @@
struct netif_dif *dif;
struct netif_stats *stats;
EFI_DEVICE_PATH *devpath, *node;
- EFI_SIMPLE_NETWORK *net;
EFI_HANDLE *handles, *handles2;
EFI_STATUS status;
UINTN sz;
@@ -304,19 +321,6 @@
if (DevicePathType(node) != MESSAGING_DEVICE_PATH ||
DevicePathSubType(node) != MSG_MAC_ADDR_DP)
continue;
-
- /*
- * Open the network device in exclusive mode. Without this
- * we will be racing with the UEFI network stack. It will
- * pull packets off the network leading to lost packets.
- */
- status = BS->OpenProtocol(handles[i], &sn_guid, (void **)&net,
- IH, NULL, EFI_OPEN_PROTOCOL_EXCLUSIVE);
- if (status != EFI_SUCCESS) {
- printf("Unable to open network interface %d for "
- "exclusive access: %lu\n", i,
- EFI_ERROR_CODE(status));
- }
handles2[nifs] = handles[i];
nifs++;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 15, 5:06 AM (22 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29702888
Default Alt Text
D20642.diff (1 KB)
Attached To
Mode
D20642: efinet: Defer exclusively opening the network handles
Attached
Detach File
Event Timeline
Log In to Comment