2 * Copyright (C) 2001-2003 Hewlett-Packard Co.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 * Copyright (C) 2006-2009 Intel Corporation
5 * Contributed by Fenghua Yu <fenghua.yu@intel.com>
6 * Contributed by Bibo Mao <bibo.mao@intel.com>
7 * Contributed by Chandramouli Narayanan <mouli@linux.intel.com>
9 * This file is part of the ELILO, the EFI Linux boot loader.
11 * ELILO is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
16 * ELILO is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with ELILO; see the file COPYING. If not, write to the Free
23 * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 * Please check out the elilo.txt for complete documentation on how
27 * to use this program.
37 #define FS_NAME L"netfs"
39 #define NETFS_DEFAULT_BUFSIZE 16*MB
40 #define NETFS_DEFAULT_BUFSIZE_INC 8*MB
42 #define NETFS_DEFAULT_SERVER_TYPE EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP
43 #define NETFS_FD_MAX 2
45 typedef struct _netfs_fd {
46 struct _netfs_fd *next;
49 UINT64 netbuf_maxsize; /* currently allocated buffer */
50 UINTN netbuf_size; /* number of bytes currently used in the buffer */
51 UINT64 netbuf_pos; /* current position in the buffer */
52 BOOLEAN is_valid; /* avoid conflicting opens */
55 CHAR16 last_file[FILENAME_MAXLEN];
60 EFI_PXE_BASE_CODE *pxe;
61 EFI_HANDLE dev; /* handle to device we're attached to */
62 BOOLEAN using_pxe; /* true if downloaded using the PXE protocol vs. regular DHCP */
64 EFI_IP_ADDRESS srv_ip;
65 EFI_IP_ADDRESS cln_ip;
67 EFI_IP_ADDRESS netmask;
70 netfs_fd_t fd_tab[NETFS_FD_MAX];
76 #define NETFS_F2FD(l,f) (UINTN)((f)-(l)->fd_tab)
77 #define NETFS_FD2F(l,fd) ((l)->fd_tab+fd)
78 #define NETFS_F_INVALID(f) ((f)->is_valid == FALSE)
82 netfs_interface_t pub_intf;
84 netfs_interface_t pub_intf;
85 netfs_priv_state_t priv_data;
89 #define FS_PRIVATE(n) (&(((netfs_t *)n)->netfs_priv.priv_data))
96 static dev_tab_t *dev_tab; /* holds all devices we found */
97 static UINTN ndev; /* how many entries in dev_tab */
99 static EFI_GUID NetFsProtocol = NETFS_PROTOCOL;
103 static EFI_PXE_BASE_CODE_CALLBACK_STATUS
105 IN EFI_PXE_BASE_CODE_CALLBACK *this,
106 IN EFI_PXE_BASE_CODE_FUNCTION function,
108 IN UINT32 packet_len,
109 IN EFI_PXE_BASE_CODE_PACKET *packet OPTIONAL
112 Print(L"netfs_callback called received=%d packet_len=%d\n", received, packet_len);
116 static EFI_PXE_BASE_CODE_CALLBACK netfs_callback = {
117 EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION,
123 netfs_fd_alloc(netfs_priv_state_t *nfs, CHAR16 *name)
125 netfs_fd_t *tmp = NULL, *prev = NULL, *match;
126 UINT8 netbuf_reuse = 0;
128 if (nfs->free_fd == NULL) {
129 ERR_PRT((L"out of file descriptor"));
132 match = nfs->free_fd;
133 for (tmp = nfs->free_fd; tmp; tmp = tmp->next) {
134 if (!StrCmp(name, tmp->last_file)) {
135 DBG_PRT((L"Using cached file %s netbuf_size=%d", tmp->last_file, tmp->netbuf_size));
142 /* indicate whether or not we got a match in caching */
143 match->netbuf_reuse = netbuf_reuse;
145 if (match == nfs->free_fd)
146 nfs->free_fd = match->next;
148 prev->next = match->next;
150 nfs->free_fd_count--;
156 netfs_fd_free(netfs_priv_state_t *nfs, netfs_fd_t *f)
159 ERR_PRT((L"invalid fd"));
162 f->next = nfs->free_fd;
164 /* we keep the netbuf, in case we can reuse it */
168 nfs->free_fd_count++;
170 if (nfs->free_fd_count > NETFS_FD_MAX) {
171 ERR_PRT((L"too many free descriptors %d", nfs->free_fd_count));
177 netbuf_alloc(netfs_fd_t *f)
179 /* we will try to reuse the existing buffer first */
180 if (f->netbuf != 0) return 0;
184 f->netbuf = (CHAR8 *)alloc_pages(EFI_SIZE_TO_PAGES(f->netbuf_maxsize), EfiLoaderData, AllocateAnyPages, 0);
186 return f->netbuf == 0 ? -1 : 0;
190 netfs_name(netfs_interface_t *this, CHAR16 *name, UINTN maxlen)
192 if (name == NULL || maxlen < 1) return EFI_INVALID_PARAMETER;
194 StrnCpy(name, FS_NAME, maxlen-1);
196 name[maxlen-1] = CHAR_NULL;
202 netfs_extract_ip(netfs_priv_state_t *nfs)
204 EFI_PXE_BASE_CODE *pxe = nfs->pxe;
206 if (pxe->Mode->PxeDiscoverValid) {
207 nfs->using_pxe = TRUE;
208 Memcpy(&nfs->srv_ip, pxe->Mode->PxeReply.Dhcpv4.BootpSiAddr, sizeof(EFI_IP_ADDRESS));
209 Memcpy(&nfs->hw_addr, pxe->Mode->PxeReply.Dhcpv4.BootpHwAddr, 16*sizeof(UINT8));
211 Memcpy(&nfs->srv_ip, pxe->Mode->DhcpAck.Dhcpv4.BootpSiAddr, sizeof(EFI_IP_ADDRESS));
212 Memcpy(&nfs->hw_addr, pxe->Mode->DhcpAck.Dhcpv4.BootpHwAddr, sizeof(nfs->hw_addr));
215 Memcpy(&nfs->cln_ip, &pxe->Mode->StationIp, sizeof(EFI_IP_ADDRESS));
216 Memcpy(&nfs->netmask, &pxe->Mode->SubnetMask, sizeof(EFI_IP_ADDRESS));
219 * the fact that we use index 0, is just a guess
221 if (pxe->Mode->RouteTableEntries>0)
222 Memcpy(&nfs->gw_ip, &pxe->Mode->RouteTable[0].GwAddr, sizeof(EFI_IP_ADDRESS));
224 VERB_PRT(1, Print(L"PXE PxeDiscoverValid: %s\n", pxe->Mode->PxeDiscoverValid? L"Yes (PXE-aware DHCPD)" : L"No (Regular DHCPD)"));
226 status = BS->HandleProtocol(dev, &PxeCallbackProtocol, (VOID **)&netfs_callback);
227 status = LibInstallProtocolInterfaces(&dev, &PxeCallbackProtocol, &netfs_callback, NULL);
228 Print(L"PXE Callback support : %r\n", status);
229 if (status == EFI_SUCCESS) {
231 status = pxe->SetParameters(pxe, NULL, NULL, NULL, NULL, &doit);
232 Print(L"PXE Callback SetParameters: %r\n", status);
236 * XXX: TFTPD server not quite right when using PXE, need to extract bootservers...
238 VERB_PRT(1, Print(L"Local IP: %d.%d.%d.%d\n",
239 pxe->Mode->StationIp.v4.Addr[0] & 0xff,
240 pxe->Mode->StationIp.v4.Addr[1] & 0xff,
241 pxe->Mode->StationIp.v4.Addr[2] & 0xff,
242 pxe->Mode->StationIp.v4.Addr[3] & 0xff));
244 VERB_PRT(1, Print(L"SM: %d.%d.%d.%d\n",
245 pxe->Mode->SubnetMask.v4.Addr[0] & 0xff,
246 pxe->Mode->SubnetMask.v4.Addr[1] & 0xff,
247 pxe->Mode->SubnetMask.v4.Addr[2] & 0xff,
248 pxe->Mode->SubnetMask.v4.Addr[3] & 0xff));
250 VERB_PRT(1, Print(L"TFTPD IP: %d.%d.%d.%d\n",
251 nfs->srv_ip.v4.Addr[0] & 0xff,
252 nfs->srv_ip.v4.Addr[1] & 0xff,
253 nfs->srv_ip.v4.Addr[2] & 0xff,
254 nfs->srv_ip.v4.Addr[3] & 0xff));
256 VERB_PRT(1, Print(L"Gateway IP: %d.%d.%d.%d\n",
257 nfs->gw_ip.v4.Addr[0] & 0xff,
258 nfs->gw_ip.v4.Addr[1] & 0xff,
259 nfs->gw_ip.v4.Addr[2] & 0xff,
260 nfs->gw_ip.v4.Addr[3] & 0xff));
265 netfs_start(EFI_PXE_BASE_CODE *pxe)
269 status = uefi_call_wrapper(pxe->Start, 2, pxe, FALSE);
270 if (EFI_ERROR(status)) return status;
272 return pxe->Dhcp(pxe, FALSE);
276 netfs_open(netfs_interface_t *this, CHAR16 *name, UINTN *fd)
278 netfs_priv_state_t *nfs;
281 CHAR8 ascii_name[FILENAME_MAXLEN];
282 UINTN blocksize = 0, prev_netbufsize;
284 if (this == NULL || name == NULL || fd == NULL) return EFI_INVALID_PARAMETER;
286 nfs = FS_PRIVATE(this);
288 if (nfs->pxe == NULL) return EFI_INVALID_PARAMETER;
291 * Try to start protocol if not already active
293 if (nfs->pxe->Mode->Started == FALSE) {
294 status = netfs_start(nfs->pxe);
295 if (EFI_ERROR(status)) return status;
296 netfs_extract_ip(nfs);
299 if ((f=netfs_fd_alloc(nfs, name)) == NULL) return EFI_OUT_OF_RESOURCES;
301 if (f->netbuf_reuse) {
304 *fd = NETFS_F2FD(nfs, f);
307 f->netbuf_maxsize = NETFS_DEFAULT_BUFSIZE;
309 if (f->netbuf == NULL && netbuf_alloc(f) == -1) {
310 netfs_fd_free(nfs, f);
311 return EFI_OUT_OF_RESOURCES;
314 /* well, we need to download ! */
316 U2ascii(name, ascii_name, FILENAME_MAXLEN);
318 VERB_PRT(2, Print(L"downloading %a from %d.%d.%d.%d...", ascii_name,
319 nfs->srv_ip.v4.Addr[0],
320 nfs->srv_ip.v4.Addr[1],
321 nfs->srv_ip.v4.Addr[2],
322 nfs->srv_ip.v4.Addr[3]));
324 f->netbuf_size = f->netbuf_maxsize;
326 DBG_PRT((L"\nbefore netbuf:" PTR_FMT " netbuf_size=%d\n", f->netbuf, f->netbuf_size));
329 * For EFI versions older than 14.61:
330 * it seems like there is an EFI bug (or undocumented behavior) when the buffer size
331 * is too small AND the blocksize parameter is NULL, i.e., used the largest possible.
332 * In this case, Mtftp() never returns EFI_BUFFER_TOO_SMALL but EFI_TIMEOUT instead.
333 * This is true for 1.02 and also 1.10 it seems. Here we set it to the minimal value (512).
335 * Also it seems like on a READ_FILE which returns EFI_BUFFER_TOO_SMALL, the buffersize
336 * is NOT updated to reflect the required size for the next attempt.
338 * For EFI versions 14.61 and higher:
339 * In case the buffer is too small AND the TFTP server reports the file size (see RFC 2349),
340 * the f->netbuf_size will report the exact size for the buffer.
342 prev_netbufsize = f->netbuf_size;
344 status = uefi_call_wrapper(nfs->pxe->Mtftp, 10, nfs->pxe, EFI_PXE_BASE_CODE_TFTP_READ_FILE, f->netbuf, FALSE,
346 blocksize > 0 ? &blocksize : NULL,
352 DBG_PRT((L"after Mftp=%r netbuf:" PTR_FMT " netbuf_size=%d blocksize=%d\n",
358 if (status == EFI_TIMEOUT && blocksize == 0) {
360 * XXX: if blocksize is not adjusted we could loop forever here
363 status = EFI_BUFFER_TOO_SMALL;
366 * check if we need to increase our buffer size
368 if (status == EFI_BUFFER_TOO_SMALL) {
369 DBG_PRT((L"buffer too small, need netbuf_size=%d", f->netbuf_size));
371 * if the TFTP server supports TFTP options, then we should
372 * get the required size. So we test to see if the size
373 * we set has changed. If so, we got the required size.
374 * If not, we increase the buffer size and retry.
376 if (f->netbuf_size == prev_netbufsize) {
377 f->netbuf_maxsize += NETFS_DEFAULT_BUFSIZE_INC;
379 /* we got an answer from the TFTP server, let's try it */
380 f->netbuf_maxsize = f->netbuf_size;
384 f->netbuf = NULL; /* will force reallocation */
386 if (netbuf_alloc(f) == 0) goto retry;
388 /* fall through in case of error */
391 if (status == EFI_SUCCESS) {
392 /* start at the beginning of the file */
395 /* cache file name */
396 StrCpy(f->last_file, name);
400 *fd = NETFS_F2FD(nfs, f);
401 VERB_PRT(2, Print(L"Done\n"));
403 netfs_fd_free(nfs, f);
404 VERB_PRT(2, Print(L"Failed: %r\n", status));
406 DBG_PRT((L"File %s netbuf_size=%d: %r", name, f->netbuf_size, status));
410 for(i=0; i < netbuf_size; i++) {
411 Print(L"%c", (CHAR16)netbuf[i]);
421 netfs_read(netfs_interface_t *this, UINTN fd, VOID *buf, UINTN *size)
423 netfs_priv_state_t *nfs;
427 if (this == NULL || fd >= NETFS_FD_MAX || buf == NULL || size == NULL) return EFI_INVALID_PARAMETER;
429 nfs = FS_PRIVATE(this);
430 f = NETFS_FD2F(nfs, fd);
432 if (NETFS_F_INVALID(f)) return EFI_INVALID_PARAMETER;
434 count = MIN(*size, f->netbuf_size - f->netbuf_pos);
436 if (count) Memcpy(buf, f->netbuf+f->netbuf_pos, count);
439 f->netbuf_pos += count;
445 netfs_close(netfs_interface_t *this, UINTN fd)
447 netfs_priv_state_t *nfs;
450 if (this == NULL || fd >= NETFS_FD_MAX) return EFI_INVALID_PARAMETER;
452 nfs = FS_PRIVATE(this);
453 f = NETFS_FD2F(nfs, fd);
455 if (NETFS_F_INVALID(f)) return EFI_INVALID_PARAMETER;
457 netfs_fd_free(nfs, f);
463 netfs_seek(netfs_interface_t *this, UINTN fd, UINT64 newpos)
465 netfs_priv_state_t *nfs;
468 if (this == NULL || fd >= NETFS_FD_MAX) return EFI_INVALID_PARAMETER;
470 nfs = FS_PRIVATE(this);
471 f = NETFS_FD2F(nfs, fd);
473 if (NETFS_F_INVALID(f)) return EFI_INVALID_PARAMETER;
475 if (newpos > f->netbuf_size) return EFI_INVALID_PARAMETER;
477 f->netbuf_pos = newpos;
483 netfs_infosize(netfs_interface_t *this, UINTN fd, UINT64 *sz)
485 netfs_priv_state_t *nfs;
488 if (this == NULL || fd >= NETFS_FD_MAX || sz == NULL) return EFI_INVALID_PARAMETER;
490 nfs = FS_PRIVATE(this);
491 f = NETFS_FD2F(nfs, fd);
493 if (NETFS_F_INVALID(f)) return EFI_INVALID_PARAMETER;
495 *sz = f->netbuf_size;
501 find_dhcp_option(EFI_PXE_BASE_CODE_PACKET *packet, UINT8 use_ipv6, UINT8 option, CHAR8 *str, INTN *len)
505 UINT8 *opts = packet->Dhcpv4.DhcpOptions;
511 DBG_PRT((L"reach end of options (no marker)\n"));
516 if (tag == 0) continue;
517 if (tag == 255) break;
522 { UINT8 l = length, k = 0;
523 Print(L"found option %d len=%d: ", tag, length);
524 while (l--) { Print(L"%c(%d)\n", (CHAR16)opts[k], opts[k]); k++; }
530 while (length--) { *str++ = opts[i++]; }
539 netfs_getinfo(netfs_interface_t *this, netfs_info_t *info)
541 netfs_priv_state_t *nfs;
545 if (this == NULL || info == NULL) return EFI_INVALID_PARAMETER;
547 nfs = FS_PRIVATE(this);
549 Memcpy(&info->cln_ipaddr, &nfs->cln_ip, sizeof(EFI_IP_ADDRESS));
550 Memcpy(&info->srv_ipaddr, &nfs->srv_ip, sizeof(EFI_IP_ADDRESS));
551 Memcpy(&info->netmask, &nfs->netmask, sizeof(EFI_IP_ADDRESS));
552 Memcpy(&info->gw_ipaddr, &nfs->gw_ip, sizeof(EFI_IP_ADDRESS));
553 Memcpy(&info->hw_addr, &nfs->hw_addr, sizeof(info->hw_addr));
555 info->using_pxe = nfs->using_pxe;
556 info->started = nfs->pxe->Mode->Started;
557 info->using_ipv6 = nfs->pxe->Mode->UsingIpv6;
559 if (nfs->pxe->Mode->UsingIpv6) goto skip_options;
561 r = find_dhcp_option(&nfs->pxe->Mode->DhcpAck,nfs->pxe->Mode->UsingIpv6, 15, str, &len);
563 ascii2U(str, info->domainame, 255);
565 VERB_PRT(3, Print(L"domain(15): %a\n", str));
567 r = find_dhcp_option(&nfs->pxe->Mode->DhcpAck,nfs->pxe->Mode->UsingIpv6, 12, str, &len);
569 ascii2U(str, info->hostname, 255);
571 VERB_PRT(3, Print(L"hostname(12): %a\n", str));
574 * extract bootfile name from DHCP exchanges
576 if (nfs->using_pxe == 0) {
577 ascii2U(nfs->pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile, info->bootfile, NETFS_BOOTFILE_MAXLEN);
578 VERB_PRT(3, Print(L"bootfile: %s\n", info->bootfile));
586 find_pxe_server_type(EFI_PXE_BASE_CODE *pxe)
590 UINT8 *opts = pxe->Mode->PxeReply.Dhcpv4.DhcpOptions;
597 DBG_PRT((L"Tag #%d Length %d\n",tag, length));
599 if (tag == 43) goto found;
603 return NETFS_DEFAULT_SERVER_TYPE;
611 server_type =(opts[i+2]<<8) | opts[i+3];
612 DBG_PRT((L"ServerType: %d\n", server_type));
617 return NETFS_DEFAULT_SERVER_TYPE;
621 netfs_query_layer(netfs_interface_t *this, UINT16 server_type, UINT16 layer, UINTN maxlen, CHAR16 *str)
623 netfs_priv_state_t *nfs;
626 if (this == NULL || str == NULL) return EFI_INVALID_PARAMETER;
628 nfs = FS_PRIVATE(this);
630 if (nfs->using_pxe == FALSE) return EFI_UNSUPPORTED;
632 if (server_type == 0) server_type = find_pxe_server_type(nfs->pxe);
634 status = uefi_call_wrapper(nfs->pxe->Discover, 5, nfs->pxe, server_type, &layer, FALSE, 0);
635 if(status == EFI_SUCCESS) {
636 ascii2U(nfs->pxe->Mode->PxeReply.Dhcpv4.BootpBootFile, str, maxlen);
642 netfs_init_state(netfs_t *netfs, EFI_HANDLE dev, EFI_PXE_BASE_CODE *pxe)
644 netfs_priv_state_t *nfs = FS_PRIVATE(netfs);
647 /* need to do some init here on netfs_intf */
648 Memset(netfs, 0, sizeof(*netfs));
651 netfs->pub_intf.netfs_name = netfs_name;
652 netfs->pub_intf.netfs_open = netfs_open;
653 netfs->pub_intf.netfs_read = netfs_read;
654 netfs->pub_intf.netfs_close = netfs_close;
655 netfs->pub_intf.netfs_infosize = netfs_infosize;
656 netfs->pub_intf.netfs_seek = netfs_seek;
657 netfs->pub_intf.netfs_query_layer = netfs_query_layer;
658 netfs->pub_intf.netfs_getinfo = netfs_getinfo;
664 * we defer DHCP request until it is really necessary (netfs_open)
666 if (pxe->Mode->Started == TRUE) netfs_extract_ip(nfs);
668 Memset(nfs->fd_tab, 0, sizeof(nfs->fd_tab));
670 for (i=0; i < NETFS_FD_MAX-1; i++) {
671 nfs->fd_tab[i].next = &nfs->fd_tab[i+1];
673 /* null on last element is done by memset */
675 nfs->free_fd = nfs->fd_tab;
676 nfs->free_fd_count = NETFS_FD_MAX;
680 netfs_install_one(EFI_HANDLE dev, VOID **intf)
685 EFI_PXE_BASE_CODE *pxe;
687 status = uefi_call_wrapper(BS->HandleProtocol, 3, dev, &NetFsProtocol, (VOID **)&netfs);
688 if (status == EFI_SUCCESS) {
689 ERR_PRT((L"Warning: found existing %s protocol on device", FS_NAME));
693 status = uefi_call_wrapper(BS->HandleProtocol, 3, dev, &PxeBaseCodeProtocol, (VOID **)&pxe);
694 if (EFI_ERROR(status)) return EFI_INVALID_PARAMETER;
697 netfs = (netfs_t *)alloc(sizeof(*netfs), EfiLoaderData);
699 ERR_PRT((L"failed to allocate %s", FS_NAME));
700 return EFI_OUT_OF_RESOURCES;
703 netfs_init_state(netfs, dev, pxe);
705 status = LibInstallProtocolInterfaces(&dev, &NetFsProtocol, netfs, NULL);
706 if (EFI_ERROR(status)) {
707 ERR_PRT((L"Cannot install %s protocol: %r", FS_NAME, status));
713 if (intf) *intf = (VOID *)netfs;
716 { EFI_DEVICE_PATH *dp; CHAR16 *str;
717 dp = DevicePathFromHandle(dev);
718 str = DevicePathToStr(dp);
719 Print(L"attached %s to %s\n", FS_NAME, str);
734 uefi_call_wrapper(BS->LocateHandle, 5, ByProtocol, &PxeBaseCodeProtocol, NULL, &size, NULL);
735 if (size == 0) return EFI_UNSUPPORTED; /* no device found, oh well */
737 DBG_PRT((L"size=%d", size));
739 dev_tab = (dev_tab_t *)alloc(size, EfiLoaderData);
740 if (dev_tab == NULL) {
741 ERR_PRT((L"failed to allocate handle table"));
742 return EFI_OUT_OF_RESOURCES;
745 status = uefi_call_wrapper(BS->LocateHandle, 5, ByProtocol, &PxeBaseCodeProtocol, NULL, &size, (VOID **)dev_tab);
746 if (status != EFI_SUCCESS) {
747 ERR_PRT((L"failed to get handles: %r", status));
751 ndev = size / sizeof(EFI_HANDLE);
753 for(i=0; i < ndev; i++) {
755 netfs_install_one(dev_tab[i].dev, &intf);
756 /* override device handle with interface pointer */
757 dev_tab[i].intf = intf;
764 netfs_uninstall(VOID)
767 netfs_priv_state_t *nfs;
771 for(i=0; i < ndev; i++) {
772 if (dev_tab[i].intf == NULL) continue;
773 nfs = FS_PRIVATE(dev_tab[i].intf);
774 status = uefi_call_wrapper(BS->UninstallProtocolInterface, 3, nfs->dev, &NetFsProtocol, dev_tab[i].intf);
775 if (EFI_ERROR(status)) {
776 ERR_PRT((L"Uninstall %s error: %r", FS_NAME, status));
780 { EFI_DEVICE_PATH *dp; CHAR16 *str;
781 dp = DevicePathFromHandle(nfs->dev);
782 str = DevicePathToStr(dp);
783 Print(L"uninstalled %s on %s\n", FS_NAME, str);
787 if (nfs->pxe->Mode->Started == TRUE)
788 uefi_call_wrapper(nfs->pxe->Stop, 1, nfs->pxe);
790 free(dev_tab[i].intf);
792 if (dev_tab) free(dev_tab);