本文整理汇总了C++中EFI_SIMPLE_NETWORK::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_SIMPLE_NETWORK::Initialize方法的具体用法?C++ EFI_SIMPLE_NETWORK::Initialize怎么用?C++ EFI_SIMPLE_NETWORK::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFI_SIMPLE_NETWORK
的用法示例。
在下文中一共展示了EFI_SIMPLE_NETWORK::Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: interface
static void
efinet_init(struct iodesc *desc, void *machdep_hint)
{
struct netif *nif = desc->io_netif;
EFI_SIMPLE_NETWORK *net;
EFI_HANDLE h;
EFI_STATUS status;
if (nif->nif_driver->netif_ifs[nif->nif_unit].dif_unit < 0) {
printf("Invalid network interface %d\n", nif->nif_unit);
return;
}
h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private;
status = BS->HandleProtocol(h, &sn_guid, (VOID **)&nif->nif_devdata);
if (status != EFI_SUCCESS) {
printf("net%d: cannot start interface (status=%llu)\n",
nif->nif_unit, status);
return;
}
net = nif->nif_devdata;
if (net->Mode->State == EfiSimpleNetworkStopped) {
status = net->Start(net);
if (status != EFI_SUCCESS) {
printf("net%d: cannot start interface (status=%llu)\n",
nif->nif_unit, status);
return;
}
}
if (net->Mode->State != EfiSimpleNetworkInitialized) {
status = net->Initialize(net, 0, 0);
if (status != EFI_SUCCESS) {
printf("net%d: cannot init. interface (status=%llu)\n",
nif->nif_unit, status);
return;
}
}
if (net->Mode->ReceiveFilterSetting == 0) {
UINT32 mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
status = net->ReceiveFilters(net, mask, 0, FALSE, 0, 0);
if (status != EFI_SUCCESS) {
printf("net%d: cannot set rx. filters (status=%llu)\n",
nif->nif_unit, status);
return;
}
}
#ifdef EFINET_DEBUG
dump_mode(net->Mode);
#endif
bcopy(net->Mode->CurrentAddress.Addr, desc->myea, 6);
desc->xid = 1;
}