48 UINT32 InterruptStatus;
51 return EFI_INVALID_PARAMETER;
54 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
56 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
58 if (MnpConfigData !=
NULL) {
62 CopyMem (MnpConfigData, &Instance->ConfigData, sizeof (*MnpConfigData));
65 if (SnpModeData !=
NULL) {
69 Snp = Instance->MnpServiceData->MnpDeviceData->Snp;
75 Snp->GetStatus (Snp, &InterruptStatus,
NULL);
76 CopyMem (SnpModeData, Snp->
Mode, sizeof (*SnpModeData));
79 if (!Instance->Configured) {
80 Status = EFI_NOT_STARTED;
85 gBS->RestoreTPL (OldTpl);
153 if ((This ==
NULL) ||
154 ((MnpConfigData !=
NULL) &&
155 (MnpConfigData->ProtocolTypeFilter > 0) &&
156 (MnpConfigData->ProtocolTypeFilter <= 1500))
159 return EFI_INVALID_PARAMETER;
162 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
164 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
166 if ((MnpConfigData ==
NULL) && (!Instance->Configured)) {
180 gBS->RestoreTPL (OldTpl);
230 if ((This ==
NULL) || (IpAddress ==
NULL) || (MacAddress ==
NULL)) {
231 return EFI_INVALID_PARAMETER;
234 Ip6Address = &IpAddress->v6;
236 if ((Ipv6Flag && !IP6_IS_MULTICAST (Ip6Address)) ||
237 (!Ipv6Flag && !IP4_IS_MULTICAST (EFI_NTOHL (*IpAddress)))
243 return EFI_INVALID_PARAMETER;
246 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
248 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
250 if (!Instance->Configured) {
251 Status = EFI_NOT_STARTED;
255 Snp = Instance->MnpServiceData->MnpDeviceData->Snp;
256 ASSERT (Snp !=
NULL);
260 if (Snp->
Mode->
IfType == NET_IFTYPE_ETHERNET) {
266 MacAddress->Addr[0] = 0x01;
267 MacAddress->Addr[1] = 0x00;
268 MacAddress->Addr[2] = 0x5E;
269 MacAddress->Addr[3] = (UINT8)(IpAddress->v4.Addr[1] & 0x7F);
270 MacAddress->Addr[4] = IpAddress->v4.Addr[2];
271 MacAddress->Addr[5] = IpAddress->v4.Addr[3];
278 MacAddress->Addr[0] = 0x33;
279 MacAddress->Addr[1] = 0x33;
280 MacAddress->Addr[2] = Ip6Address->Addr[12];
281 MacAddress->Addr[3] = Ip6Address->Addr[13];
282 MacAddress->Addr[4] = Ip6Address->Addr[14];
283 MacAddress->Addr[5] = Ip6Address->Addr[15];
291 Status = Snp->MCastIpToMac (
300 gBS->RestoreTPL (OldTpl);
354 BOOLEAN AddressExist;
358 if ((This ==
NULL) || (JoinFlag && (MacAddress ==
NULL))) {
362 return EFI_INVALID_PARAMETER;
365 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
366 SnpMode = Instance->MnpServiceData->MnpDeviceData->Snp->
Mode;
368 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
370 if (!Instance->Configured) {
371 Status = EFI_NOT_STARTED;
382 Status = EFI_INVALID_PARAMETER;
387 AddressExist =
FALSE;
390 if (MacAddress !=
NULL) {
394 NET_LIST_FOR_EACH (ListEntry, &Instance->GroupCtrlBlkList) {
395 GroupCtrlBlk = NET_LIST_USER_STRUCT (
400 GroupAddress = GroupCtrlBlk->GroupAddress;
403 &GroupAddress->Address,
415 if (JoinFlag && AddressExist) {
419 Status = EFI_ALREADY_STARTED;
422 if (!JoinFlag && !AddressExist) {
426 Status = EFI_NOT_FOUND;
429 if (EFI_ERROR (Status)) {
432 }
else if (
IsListEmpty (&Instance->GroupCtrlBlkList)) {
443 Status =
MnpGroupOp (Instance, JoinFlag, MacAddress, GroupCtrlBlk);
446 gBS->RestoreTPL (OldTpl);
520 if ((This ==
NULL) || (Token ==
NULL)) {
521 return EFI_INVALID_PARAMETER;
524 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
526 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
528 if (!Instance->Configured) {
529 Status = EFI_NOT_STARTED;
537 Status = EFI_INVALID_PARAMETER;
541 MnpServiceData = Instance->MnpServiceData;
542 NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
547 Status =
MnpBuildTxPacket (MnpServiceData, Token->Packet.TxData, &PktBuf, &PktLen);
548 if (EFI_ERROR (Status)) {
558 gBS->RestoreTPL (OldTpl);
609 if ((This ==
NULL) || (Token ==
NULL) || (Token->Event ==
NULL)) {
610 return EFI_INVALID_PARAMETER;
613 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
615 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
617 if (!Instance->Configured) {
618 Status = EFI_NOT_STARTED;
626 if (EFI_ERROR (Status)) {
634 if (!EFI_ERROR (Status)) {
647 gBS->RestoreTPL (OldTpl);
693 return EFI_INVALID_PARAMETER;
696 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
698 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
700 if (!Instance->Configured) {
701 Status = EFI_NOT_STARTED;
710 Status = (Status == EFI_ABORTED) ?
EFI_SUCCESS : EFI_NOT_FOUND;
719 gBS->RestoreTPL (OldTpl);
761 return EFI_INVALID_PARAMETER;
764 Instance = MNP_INSTANCE_DATA_FROM_THIS (This);
766 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
768 if (!Instance->Configured) {
769 Status = EFI_NOT_STARTED;
784 gBS->RestoreTPL (OldTpl);
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI DispatchDpc(VOID)
EFI_STATUS EFIAPI MnpCancelTokens(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, IN VOID *Arg)
EFI_STATUS MnpGroupOp(IN OUT MNP_INSTANCE_DATA *Instance, IN BOOLEAN JoinFlag, IN EFI_MAC_ADDRESS *MacAddress OPTIONAL, IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk OPTIONAL)
EFI_STATUS EFIAPI MnpTokenExist(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg)
EFI_STATUS MnpConfigureInstance(IN OUT MNP_INSTANCE_DATA *Instance, IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL)
EFI_STATUS MnpSyncSendPacket(IN MNP_SERVICE_DATA *MnpServiceData, IN UINT8 *Packet, IN UINT32 Length, IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
EFI_STATUS MnpReceivePacket(IN OUT MNP_DEVICE_DATA *MnpDeviceData)
EFI_STATUS MnpInstanceDeliverPacket(IN OUT MNP_INSTANCE_DATA *Instance)
BOOLEAN MnpIsValidTxToken(IN MNP_INSTANCE_DATA *Instance, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
EFI_STATUS MnpBuildTxPacket(IN MNP_SERVICE_DATA *MnpServiceData, IN EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData, OUT UINT8 **PktBuf, OUT UINT32 *PktLen)
EFI_STATUS EFIAPI MnpMcastIpToMac(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN BOOLEAN Ipv6Flag, IN EFI_IP_ADDRESS *IpAddress, OUT EFI_MAC_ADDRESS *MacAddress)
EFI_STATUS EFIAPI MnpTransmit(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
EFI_STATUS EFIAPI MnpGetModeData(IN EFI_MANAGED_NETWORK_PROTOCOL *This, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
EFI_STATUS EFIAPI MnpConfigure(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL)
EFI_STATUS EFIAPI MnpReceive(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
EFI_STATUS EFIAPI MnpCancel(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL)
EFI_STATUS EFIAPI MnpPoll(IN EFI_MANAGED_NETWORK_PROTOCOL *This)
EFI_STATUS EFIAPI MnpGroups(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN BOOLEAN JoinFlag, IN EFI_MAC_ADDRESS *MacAddress OPTIONAL)
EFI_STATUS EFIAPI NetMapInsertTail(IN OUT NET_MAP *Map, IN VOID *Key, IN VOID *Value OPTIONAL)
EFI_STATUS EFIAPI NetMapIterate(IN NET_MAP *Map, IN NET_MAP_CALLBACK CallBack, IN VOID *Arg OPTIONAL)
EFI_SIMPLE_NETWORK_MODE * Mode
BOOLEAN EnableMulticastReceive
EFI_MAC_ADDRESS BroadcastAddress