efinet.c (315221) | efinet.c (328889) |
---|---|
1/*- 2 * Copyright (c) 2001 Doug Rabson 3 * Copyright (c) 2002, 2006 Marcel Moolenaar 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Doug Rabson 3 * Copyright (c) 2002, 2006 Marcel Moolenaar 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: stable/11/sys/boot/efi/libefi/efinet.c 315221 2017-03-14 02:06:03Z pfg $"); | 29__FBSDID("$FreeBSD: stable/11/sys/boot/efi/libefi/efinet.c 328889 2018-02-05 17:01:18Z kevans $"); |
30 31#include <sys/param.h> 32#include <netinet/in.h> 33#include <netinet/in_systm.h> 34 35#include <stand.h> 36#include <net.h> 37#include <netif.h> --- 209 unchanged lines hidden (view full) --- 247 248 if (net == NULL) 249 return; 250 251 net->Shutdown(net); 252} 253 254static int efinet_dev_init(void); | 30 31#include <sys/param.h> 32#include <netinet/in.h> 33#include <netinet/in_systm.h> 34 35#include <stand.h> 36#include <net.h> 37#include <netif.h> --- 209 unchanged lines hidden (view full) --- 247 248 if (net == NULL) 249 return; 250 251 net->Shutdown(net); 252} 253 254static int efinet_dev_init(void); |
255static void efinet_dev_print(int); | 255static int efinet_dev_print(int); |
256 257struct devsw efinet_dev = { 258 .dv_name = "net", 259 .dv_type = DEVT_NET, 260 .dv_init = efinet_dev_init, 261 .dv_strategy = net_strategy, 262 .dv_open = net_open, 263 .dv_close = net_close, --- 77 unchanged lines hidden (view full) --- 341 dif->dif_stats = &stats[i]; 342 dif->dif_private = handles2[i]; 343 } 344 free(handles2); 345 346 return (0); 347} 348 | 256 257struct devsw efinet_dev = { 258 .dv_name = "net", 259 .dv_type = DEVT_NET, 260 .dv_init = efinet_dev_init, 261 .dv_strategy = net_strategy, 262 .dv_open = net_open, 263 .dv_close = net_close, --- 77 unchanged lines hidden (view full) --- 341 dif->dif_stats = &stats[i]; 342 dif->dif_private = handles2[i]; 343 } 344 free(handles2); 345 346 return (0); 347} 348 |
349static void | 349static int |
350efinet_dev_print(int verbose) 351{ 352 CHAR16 *text; 353 EFI_HANDLE h; | 350efinet_dev_print(int verbose) 351{ 352 CHAR16 *text; 353 EFI_HANDLE h; |
354 int unit; | 354 int unit, ret = 0; |
355 | 355 |
356 pager_open(); | 356 printf("%s devices:", efinet_dev.dv_name); 357 if ((ret = pager_output("\n")) != 0) 358 return (ret); 359 |
357 for (unit = 0, h = efi_find_handle(&efinet_dev, 0); 358 h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { 359 printf(" %s%d:", efinet_dev.dv_name, unit); 360 text = efi_devpath_name(efi_lookup_devpath(h)); 361 if (text != NULL) { 362 printf(" %S", text); 363 efi_free_devpath_name(text); 364 } | 360 for (unit = 0, h = efi_find_handle(&efinet_dev, 0); 361 h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { 362 printf(" %s%d:", efinet_dev.dv_name, unit); 363 text = efi_devpath_name(efi_lookup_devpath(h)); 364 if (text != NULL) { 365 printf(" %S", text); 366 efi_free_devpath_name(text); 367 } |
365 if (pager_output("\n")) | 368 if ((ret = pager_output("\n")) != 0) |
366 break; 367 } | 369 break; 370 } |
368 pager_close(); | 371 return (ret); |
369} | 372} |