51 return EFI_INVALID_PARAMETER;
54 if ((ConfigData !=
NULL) &&
55 ((ConfigData->SwAddressLength == 0) ||
56 (ConfigData->StationAddress ==
NULL) ||
57 (ConfigData->SwAddressType <= 1500)))
59 return EFI_INVALID_PARAMETER;
64 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
71 gBS->RestoreTPL (OldTpl);
126 IN VOID *TargetSwAddress OPTIONAL,
127 IN VOID *TargetHwAddress OPTIONAL,
128 IN UINT32 TimeoutValue,
141 return EFI_INVALID_PARAMETER;
144 if (((!DenyFlag) && ((TargetHwAddress ==
NULL) || (TargetSwAddress ==
NULL))) ||
145 (DenyFlag && (TargetHwAddress !=
NULL) && (TargetSwAddress !=
NULL)) ||
146 ((TargetHwAddress ==
NULL) && (TargetSwAddress ==
NULL)))
148 return EFI_INVALID_PARAMETER;
153 if (!Instance->Configured) {
154 return EFI_NOT_STARTED;
158 ArpService = Instance->ArpService;
159 SnpMode = &Instance->ArpService->SnpMode;
164 MatchAddress[Hardware].Type = SnpMode->
IfType;
165 MatchAddress[Hardware].Length = (UINT8)SnpMode->
HwAddressSize;
166 MatchAddress[Hardware].AddressPtr = TargetHwAddress;
171 MatchAddress[Protocol].Type = Instance->ConfigData.
SwAddressType;
173 MatchAddress[Protocol].AddressPtr = TargetSwAddress;
175 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
182 &MatchAddress[Protocol],
183 &MatchAddress[Hardware]
186 if (CacheEntry ==
NULL) {
191 &ArpService->ResolvedCacheTable,
194 &MatchAddress[Protocol],
195 &MatchAddress[Hardware]
199 if ((CacheEntry !=
NULL) && !Overwrite) {
203 Status = EFI_ACCESS_DENIED;
207 if ((CacheEntry ==
NULL) && (TargetSwAddress !=
NULL)) {
212 &ArpService->PendingRequestTable,
215 &MatchAddress[Protocol],
220 if (CacheEntry !=
NULL) {
231 if (CacheEntry ==
NULL) {
232 DEBUG ((DEBUG_ERROR,
"ArpAdd: Failed to allocate pool for CacheEntry.\n"));
233 Status = EFI_OUT_OF_RESOURCES;
241 CacheEntry->DefaultDecayTime = TimeoutValue;
242 CacheEntry->DecayTime = TimeoutValue;
249 &MatchAddress[Hardware],
250 &MatchAddress[Protocol]
262 InsertHeadList (&ArpService->DeniedCacheTable, &CacheEntry->List);
264 InsertHeadList (&ArpService->ResolvedCacheTable, &CacheEntry->List);
269 gBS->RestoreTPL (OldTpl);
312 IN BOOLEAN BySwAddress,
313 IN VOID *AddressBuffer OPTIONAL,
314 OUT UINT32 *EntryLength OPTIONAL,
315 OUT UINT32 *EntryCount OPTIONAL,
324 if ((This ==
NULL) ||
325 (!Refresh && (EntryCount ==
NULL) && (EntryLength ==
NULL)) ||
326 ((Entries !=
NULL) && ((EntryLength ==
NULL) || (EntryCount ==
NULL))))
328 return EFI_INVALID_PARAMETER;
333 if (!Instance->Configured) {
334 return EFI_NOT_STARTED;
337 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
352 gBS->RestoreTPL (OldTpl);
378 IN BOOLEAN BySwAddress,
379 IN VOID *AddressBuffer OPTIONAL
387 return EFI_INVALID_PARAMETER;
392 if (!Instance->Configured) {
393 return EFI_NOT_STARTED;
396 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
403 gBS->RestoreTPL (OldTpl);
431 return EFI_INVALID_PARAMETER;
436 if (!Instance->Configured) {
437 return EFI_NOT_STARTED;
440 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
447 gBS->RestoreTPL (OldTpl);
478 IN VOID *TargetSwAddress OPTIONAL,
480 OUT VOID *TargetHwAddress
493 if ((This ==
NULL) || (TargetHwAddress ==
NULL)) {
494 return EFI_INVALID_PARAMETER;
499 if (!Instance->Configured) {
500 return EFI_NOT_STARTED;
504 ArpService = Instance->ArpService;
505 SnpMode = &ArpService->SnpMode;
507 if ((TargetSwAddress ==
NULL) ||
508 ((Instance->ConfigData.
SwAddressType == IPV4_ETHER_PROTO_TYPE) &&
509 IP4_IS_LOCAL_BROADCAST (*((UINT32 *)TargetSwAddress))))
519 if ((Instance->ConfigData.
SwAddressType == IPV4_ETHER_PROTO_TYPE) &&
520 IP4_IS_MULTICAST (NTOHL (*((UINT32 *)TargetSwAddress))))
526 Status = ArpService->Mnp->McastIpToMac (
535 HardwareAddress.Type = SnpMode->
IfType;
537 HardwareAddress.AddressPtr =
NULL;
541 ProtocolAddress.AddressPtr = TargetSwAddress;
548 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
554 if (CacheEntry !=
NULL) {
555 Status = EFI_ACCESS_DENIED;
563 &ArpService->ResolvedCacheTable,
569 if (CacheEntry !=
NULL) {
575 CacheEntry->Addresses[Hardware].AddressPtr,
576 CacheEntry->Addresses[Hardware].Length
582 if (ResolvedEvent ==
NULL) {
583 Status = EFI_NOT_READY;
591 if (RequestContext ==
NULL) {
592 DEBUG ((DEBUG_ERROR,
"ArpRequest: Allocate memory for RequestContext failed.\n"));
594 Status = EFI_OUT_OF_RESOURCES;
598 RequestContext->Instance = Instance;
599 RequestContext->UserRequestEvent = ResolvedEvent;
600 RequestContext->UserHwAddrBuffer = TargetHwAddress;
607 &ArpService->PendingRequestTable,
613 if (CacheEntry !=
NULL) {
614 CacheEntry->NextRetryTime = Instance->ConfigData.
RetryTimeOut;
615 CacheEntry->RetryCount = Instance->ConfigData.
RetryCount;
621 if (CacheEntry ==
NULL) {
622 DEBUG ((DEBUG_ERROR,
"ArpRequest: Allocate memory for CacheEntry failed.\n"));
625 Status = EFI_OUT_OF_RESOURCES;
637 InsertTailList (&ArpService->PendingRequestTable, &CacheEntry->List);
643 InsertHeadList (&CacheEntry->UserRequestList, &RequestContext->List);
648 ArpSendFrame (Instance, CacheEntry, ARP_OPCODE_REQUEST);
649 Status = EFI_NOT_READY;
653 gBS->RestoreTPL (OldTpl);
658 gBS->SignalEvent (ResolvedEvent);
700 IN VOID *TargetSwAddress OPTIONAL,
708 if ((This ==
NULL) ||
709 ((TargetSwAddress !=
NULL) && (ResolvedEvent ==
NULL)) ||
710 ((TargetSwAddress ==
NULL) && (ResolvedEvent !=
NULL)))
712 return EFI_INVALID_PARAMETER;
717 if (!Instance->Configured) {
718 return EFI_NOT_STARTED;
721 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
734 gBS->RestoreTPL (OldTpl);
EFI_STATUS ArpConfigureInstance(IN ARP_INSTANCE_DATA *Instance, IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL)
VOID ArpSendFrame(IN ARP_INSTANCE_DATA *Instance, IN ARP_CACHE_ENTRY *CacheEntry, IN UINT16 ArpOpCode)
UINTN ArpDeleteCacheEntry(IN ARP_INSTANCE_DATA *Instance, IN BOOLEAN BySwAddress, IN UINT8 *AddressBuffer OPTIONAL, IN BOOLEAN Force)
ARP_CACHE_ENTRY * ArpFindNextCacheEntryInTable(IN LIST_ENTRY *CacheTable, IN LIST_ENTRY *StartEntry, IN FIND_OPTYPE FindOpType, IN NET_ARP_ADDRESS *ProtocolAddress OPTIONAL, IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL)
UINTN ArpAddressResolved(IN ARP_CACHE_ENTRY *CacheEntry, IN ARP_INSTANCE_DATA *Instance OPTIONAL, IN EFI_EVENT UserEvent OPTIONAL)
EFI_STATUS ArpFindCacheEntry(IN ARP_INSTANCE_DATA *Instance, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL, OUT UINT32 *EntryLength OPTIONAL, OUT UINT32 *EntryCount OPTIONAL, OUT EFI_ARP_FIND_DATA **Entries OPTIONAL, IN BOOLEAN Refresh)
UINTN ArpCancelRequest(IN ARP_INSTANCE_DATA *Instance, IN VOID *TargetSwAddress OPTIONAL, IN EFI_EVENT UserEvent OPTIONAL)
ARP_CACHE_ENTRY * ArpAllocCacheEntry(IN ARP_INSTANCE_DATA *Instance)
VOID ArpFillAddressInCacheEntry(IN ARP_CACHE_ENTRY *CacheEntry, IN NET_ARP_ADDRESS *HwAddr OPTIONAL, IN NET_ARP_ADDRESS *SwAddr OPTIONAL)
ARP_CACHE_ENTRY * ArpFindDeniedCacheEntry(IN ARP_SERVICE_DATA *ArpService, IN NET_ARP_ADDRESS *ProtocolAddress OPTIONAL, IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL)
#define ARP_INSTANCE_DATA_FROM_THIS(a)
EFI_STATUS EFIAPI ArpCancel(IN EFI_ARP_PROTOCOL *This, IN VOID *TargetSwAddress OPTIONAL, IN EFI_EVENT ResolvedEvent OPTIONAL)
EFI_STATUS EFIAPI ArpRequest(IN EFI_ARP_PROTOCOL *This, IN VOID *TargetSwAddress OPTIONAL, IN EFI_EVENT ResolvedEvent OPTIONAL, OUT VOID *TargetHwAddress)
EFI_STATUS EFIAPI ArpConfigure(IN EFI_ARP_PROTOCOL *This, IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL)
EFI_STATUS EFIAPI ArpFind(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL, OUT UINT32 *EntryLength OPTIONAL, OUT UINT32 *EntryCount OPTIONAL, OUT EFI_ARP_FIND_DATA **Entries OPTIONAL, IN BOOLEAN Refresh)
EFI_STATUS EFIAPI ArpAdd(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN DenyFlag, IN VOID *TargetSwAddress OPTIONAL, IN VOID *TargetHwAddress OPTIONAL, IN UINT32 TimeoutValue, IN BOOLEAN Overwrite)
EFI_STATUS EFIAPI ArpDelete(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL)
EFI_STATUS EFIAPI ArpFlush(IN EFI_ARP_PROTOCOL *This)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
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)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG(Expression)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_MAC_ADDRESS BroadcastAddress