]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
Fixed EBC build issues.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / Ip4Config.c
1 /** @file
2
3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Ip4Config.c
15
16 Abstract:
17
18 This code implements the IP4Config and NicIp4Config protocols.
19
20
21 **/
22
23 #include "Ip4Config.h"
24
25 IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];
26
27 VOID
28 EFIAPI
29 Ip4ConfigOnDhcp4Complete (
30 IN EFI_EVENT Event,
31 IN VOID *Context
32 );
33
34
35 /**
36 Return the name and MAC address for the NIC. The Name, if not NULL,
37 has at least IP4_NIC_NAME_LENGTH bytes.
38
39 @param This The NIC IP4 CONFIG protocol
40 @param Name The buffer to return the name
41 @param NicAddr The buffer to return the MAC addr
42
43 @retval EFI_INVALID_PARAMETER This is NULL
44 @retval EFI_SUCCESS The name or address of the NIC are returned.
45
46 **/
47 STATIC
48 EFI_STATUS
49 EFIAPI
50 EfiNicIp4ConfigGetName (
51 IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,
52 IN UINT16 *Name, OPTIONAL
53 IN NIC_ADDR *NicAddr OPTIONAL
54 )
55 {
56 IP4_CONFIG_INSTANCE *Instance;
57
58 if (This == NULL) {
59 return EFI_INVALID_PARAMETER;
60 }
61
62 Instance = IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG (This);
63
64 if (Name != NULL) {
65 NetCopyMem (Name, Instance->NicName, IP4_NIC_NAME_LENGTH);
66 }
67
68 if (NicAddr != NULL) {
69 CopyMem (NicAddr, &Instance->NicAddr, sizeof (NIC_ADDR));
70 }
71
72 return EFI_SUCCESS;
73 }
74
75
76 /**
77 Get the NIC's configure information from the IP4 configure variable.
78 It will remove the invalid variable.
79
80 @param NicAddr The NIC to check
81
82 @return NULL if no configure for the NIC in the variable, or it is invalid.
83 @return Otherwise the NIC's IP configure parameter.
84
85 **/
86 NIC_IP4_CONFIG_INFO *
87 Ip4ConfigGetNicInfo (
88 IN NIC_ADDR *NicAddr
89 )
90 {
91 IP4_CONFIG_VARIABLE *Variable;
92 IP4_CONFIG_VARIABLE *NewVariable;
93 NIC_IP4_CONFIG_INFO *Config;
94
95 //
96 // Read the configuration parameter for this NicAddr from
97 // the EFI variable
98 //
99 Variable = Ip4ConfigReadVariable ();
100
101 if (Variable == NULL) {
102 return NULL;
103 }
104
105 Config = Ip4ConfigFindNicVariable (Variable, NicAddr);
106
107 if (Config == NULL) {
108 NetFreePool (Variable);
109 return NULL;
110 }
111
112 //
113 // Validate the configuration, if the configuration is invalid,
114 // remove it from the variable.
115 //
116 if (!Ip4ConfigIsValid (Config)) {
117 NewVariable = Ip4ConfigModifyVariable (Variable, &Config->NicAddr, NULL);
118 Ip4ConfigWriteVariable (NewVariable);
119
120 if (NewVariable != NULL) {
121 NetFreePool (NewVariable);
122 };
123
124 NetFreePool (Config);
125 Config = NULL;
126 }
127
128 NetFreePool (Variable);
129 return Config;
130 }
131
132
133 /**
134 Get the configure parameter for this NIC.
135
136 @param This The NIC IP4 CONFIG protocol
137 @param ConfigLen The length of the NicConfig buffer.
138 @param NicConfig The buffer to receive the NIC's configure
139 parameter.
140
141 @retval EFI_INVALID_PARAMETER This or ConfigLen is NULL
142 @retval EFI_NOT_FOUND There is no configure parameter for the NIC in
143 NVRam.
144
145 **/
146 EFI_STATUS
147 EFIAPI
148 EfiNicIp4ConfigGetInfo (
149 IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,
150 IN OUT UINTN *ConfigLen,
151 OUT NIC_IP4_CONFIG_INFO *NicConfig
152 )
153 {
154 IP4_CONFIG_INSTANCE *Instance;
155 NIC_IP4_CONFIG_INFO *Config;
156 EFI_STATUS Status;
157 UINTN Len;
158
159 if ((This == NULL) || (ConfigLen == NULL)) {
160 return EFI_INVALID_PARAMETER;
161 }
162
163 //
164 // Read the Nic's configuration parameter from variable
165 //
166 Instance = IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG (This);
167 Config = Ip4ConfigGetNicInfo (&Instance->NicAddr);
168
169 if (Config == NULL) {
170 return EFI_NOT_FOUND;
171 }
172
173 //
174 // Copy the data to user's buffer
175 //
176 Len = SIZEOF_NIC_IP4_CONFIG_INFO (Config);
177
178 if ((*ConfigLen < Len) || (NicConfig == NULL)) {
179 Status = EFI_BUFFER_TOO_SMALL;
180 } else {
181 Status = EFI_SUCCESS;
182 NetCopyMem (NicConfig, Config, Len);
183 }
184
185 *ConfigLen = Len;
186
187 NetFreePool (Config);
188 return Status;
189 }
190
191
192 /**
193 Set the IP configure parameters for this NIC. If Reconfig is TRUE,
194 the IP driver will be informed to discard current auto configure
195 parameter and restart the auto configuration process. If current
196 there is a pending auto configuration, EFI_ALREADY_STARTED is
197 returned. You can only change the configure setting when either
198 the configure has finished or not started yet. If NicConfig, the
199 NIC's configure parameter is removed from the variable.
200
201 @param This The NIC IP4 CONFIG protocol
202 @param NicConfig The new NIC IP4 configure parameter
203 @param Reconfig Inform the IP4 driver to restart the auto
204 configuration
205
206 @retval EFI_INVALID_PARAMETER This is NULL or the configure parameter is
207 invalid.
208 @retval EFI_ALREADY_STARTED There is a pending auto configuration.
209 @retval EFI_NOT_FOUND No auto configure parameter is found
210
211 **/
212 EFI_STATUS
213 EFIAPI
214 EfiNicIp4ConfigSetInfo (
215 IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,
216 IN NIC_IP4_CONFIG_INFO *NicConfig, OPTIONAL
217 IN BOOLEAN Reconfig
218 )
219 {
220 IP4_CONFIG_INSTANCE *Instance;
221 IP4_CONFIG_VARIABLE *Variable;
222 IP4_CONFIG_VARIABLE *NewVariable;
223 EFI_STATUS Status;
224
225 //
226 // Validate the parameters
227 //
228 if (This == NULL) {
229 return EFI_INVALID_PARAMETER;
230 }
231
232 Instance = IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG (This);
233
234 if ((NicConfig != NULL) && (!Ip4ConfigIsValid (NicConfig) ||
235 !NIC_ADDR_EQUAL (&NicConfig->NicAddr, &Instance->NicAddr))) {
236 return EFI_INVALID_PARAMETER;
237 }
238
239 if (Instance->State == IP4_CONFIG_STATE_STARTED) {
240 return EFI_ALREADY_STARTED;
241 }
242
243 //
244 // Update the parameter in the configure variable
245 //
246 Variable = Ip4ConfigReadVariable ();
247
248 if ((Variable == NULL) && (NicConfig == NULL)) {
249 return EFI_NOT_FOUND;
250 }
251
252 NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NicConfig);
253 Status = Ip4ConfigWriteVariable (NewVariable);
254
255 if (NewVariable != NULL) {
256 NetFreePool (NewVariable);
257 }
258
259 //
260 // Variable is NULL when saving the first configure parameter
261 //
262 if (Variable != NULL) {
263 NetFreePool (Variable);
264 }
265
266 if (EFI_ERROR (Status)) {
267 return Status;
268 }
269
270 //
271 // Signal the IP4 to run the auto configuration again
272 //
273 if (Reconfig && (Instance->ReconfigEvent != NULL)) {
274 Status = gBS->SignalEvent (Instance->ReconfigEvent);
275 }
276
277 return Status;
278 }
279
280
281 /**
282 Start the auto configuration process.
283
284 @param This The IP4 configure protocol
285 @param DoneEvent The event to signal when auto configure is done
286 @param ReconfigEvent The event to signal when reconfigure is necessary.
287
288 @retval EFI_INVALID_PARAMETER One of the function parameters is NULL.
289 @retval EFI_ALREADY_STARTED The auto configuration has already started.
290 @retval EFI_SUCCESS The auto configure is successfully started.
291
292 **/
293 EFI_STATUS
294 EFIAPI
295 EfiIp4ConfigStart (
296 IN EFI_IP4_CONFIG_PROTOCOL *This,
297 IN EFI_EVENT DoneEvent,
298 IN EFI_EVENT ReconfigEvent
299 )
300 {
301 IP4_CONFIG_INSTANCE *Instance;
302 EFI_DHCP4_PROTOCOL *Dhcp4;
303 EFI_DHCP4_MODE_DATA Dhcp4Mode;
304 EFI_DHCP4_PACKET_OPTION *OptionList[1];
305 IP4_CONFIG_DHCP4_OPTION ParaList;
306 EFI_STATUS Status;
307 UINT32 Source;
308 EFI_TPL OldTpl;
309
310 if ((This == NULL) || (DoneEvent == NULL) || (ReconfigEvent == NULL)) {
311 return EFI_INVALID_PARAMETER;
312 }
313
314 Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);
315
316 OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
317
318 if (Instance->State != IP4_CONFIG_STATE_IDLE) {
319 Status = EFI_ALREADY_STARTED;
320
321 goto ON_EXIT;
322 }
323
324 Instance->DoneEvent = DoneEvent;
325 Instance->ReconfigEvent = ReconfigEvent;
326
327 Instance->NicConfig = Ip4ConfigGetNicInfo (&Instance->NicAddr);
328
329 if (Instance->NicConfig == NULL) {
330 Source = IP4_CONFIG_SOURCE_DHCP;
331 } else {
332 Source = Instance->NicConfig->Source;
333 }
334
335 //
336 // If the source is static, the auto configuration is done.
337 // return now.
338 //
339 if (Source == IP4_CONFIG_SOURCE_STATIC) {
340 Instance->State = IP4_CONFIG_STATE_CONFIGURED;
341 Instance->Result = EFI_SUCCESS;
342
343 gBS->SignalEvent (Instance->DoneEvent);
344 Status = EFI_SUCCESS;
345 goto ON_EXIT;
346 }
347
348 //
349 // Start the dhcp process
350 //
351 ASSERT ((Source == IP4_CONFIG_SOURCE_DHCP) && (Instance->Dhcp4 == NULL));
352
353 Status = NetLibCreateServiceChild (
354 Instance->Controller,
355 Instance->Image,
356 &gEfiDhcp4ServiceBindingProtocolGuid,
357 &Instance->Dhcp4Handle
358 );
359
360 if (EFI_ERROR (Status)) {
361 goto ON_ERROR;
362 }
363
364 Status = gBS->OpenProtocol (
365 Instance->Dhcp4Handle,
366 &gEfiDhcp4ProtocolGuid,
367 (VOID **) &Instance->Dhcp4,
368 Instance->Image,
369 Instance->Controller,
370 EFI_OPEN_PROTOCOL_BY_DRIVER
371 );
372
373 if (EFI_ERROR (Status)) {
374 goto ON_ERROR;
375 }
376
377 //
378 // Check the current DHCP status, if the DHCP process has
379 // already finished, return now.
380 //
381 Dhcp4 = Instance->Dhcp4;
382 Status = Dhcp4->GetModeData (Dhcp4, &Dhcp4Mode);
383
384 if (EFI_ERROR (Status)) {
385 goto ON_ERROR;
386 }
387
388 if (Dhcp4Mode.State == Dhcp4Bound) {
389 Ip4ConfigOnDhcp4Complete (NULL, Instance);
390
391 goto ON_EXIT;
392 }
393
394 //
395 // Try to start the DHCP process. Use most of the current
396 // DHCP configuration to avoid problems if some DHCP client
397 // yields the control of this DHCP service to us.
398 //
399 ParaList.Head.OpCode = DHCP_TAG_PARA_LIST;
400 ParaList.Head.Length = 2;
401 ParaList.Head.Data[0] = DHCP_TAG_NETMASK;
402 ParaList.Route = DHCP_TAG_ROUTER;
403 OptionList[0] = &ParaList.Head;
404 Dhcp4Mode.ConfigData.OptionCount = 1;
405 Dhcp4Mode.ConfigData.OptionList = OptionList;
406
407 Status = Dhcp4->Configure (Dhcp4, &Dhcp4Mode.ConfigData);
408
409 if (EFI_ERROR (Status)) {
410 goto ON_ERROR;
411 }
412
413 //
414 // Start the DHCP process
415 //
416 Status = gBS->CreateEvent (
417 EVT_NOTIFY_SIGNAL,
418 NET_TPL_EVENT,
419 Ip4ConfigOnDhcp4Complete,
420 Instance,
421 &Instance->Dhcp4Event
422 );
423
424 if (EFI_ERROR (Status)) {
425 goto ON_ERROR;
426 }
427
428 Status = Dhcp4->Start (Dhcp4, Instance->Dhcp4Event);
429
430 if (EFI_ERROR (Status)) {
431 goto ON_ERROR;
432 }
433
434 Instance->State = IP4_CONFIG_STATE_STARTED;
435 Instance->Result = EFI_NOT_READY;
436
437 ON_ERROR:
438 if (EFI_ERROR (Status)) {
439 Ip4ConfigCleanConfig (Instance);
440 }
441
442 ON_EXIT:
443 NET_RESTORE_TPL (OldTpl);
444
445 return Status;
446 }
447
448
449 /**
450 Stop the current auto configuration
451
452 @param This The IP4 CONFIG protocol
453
454 @retval EFI_INVALID_PARAMETER This is NULL.
455 @retval EFI_NOT_STARTED The auto configuration hasn't been started.
456 @retval EFI_SUCCESS The auto configuration has been stopped.
457
458 **/
459 EFI_STATUS
460 EFIAPI
461 EfiIp4ConfigStop (
462 IN EFI_IP4_CONFIG_PROTOCOL *This
463 )
464 {
465 IP4_CONFIG_INSTANCE *Instance;
466 EFI_STATUS Status;
467 EFI_TPL OldTpl;
468
469 if (This == NULL) {
470 return EFI_INVALID_PARAMETER;
471 }
472
473 Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);
474
475 Status = EFI_SUCCESS;
476 OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
477
478 if (Instance->State == IP4_CONFIG_STATE_IDLE) {
479 Status = EFI_NOT_STARTED;
480 goto ON_EXIT;
481 }
482
483 //
484 // Release all the configure parameters. Don't signal the user
485 // event. The user wants to abort the configuration, this isn't
486 // the configuration done or reconfiguration.
487 //
488 Ip4ConfigCleanConfig (Instance);
489
490 ON_EXIT:
491 NET_RESTORE_TPL (OldTpl);
492
493 return Status;
494 }
495
496
497 /**
498 Get the current outcome of the auto configuration process
499
500 @param This The IP4 CONFIG protocol
501 @param ConfigDataSize The size of the configure data
502 @param ConfigData The buffer to save the configure data
503
504 @retval EFI_INVALID_PARAMETER This or ConfigDataSize is NULL
505 @retval EFI_BUFFER_TOO_SMALL The buffer is too small. The needed size is
506 returned in the ConfigDataSize.
507 @retval EFI_SUCCESS The configure data is put in the buffer
508
509 **/
510 EFI_STATUS
511 EFIAPI
512 EfiIp4ConfigGetData (
513 IN EFI_IP4_CONFIG_PROTOCOL *This,
514 IN OUT UINTN *ConfigDataSize,
515 OUT EFI_IP4_IPCONFIG_DATA *ConfigData OPTIONAL
516 )
517 {
518 IP4_CONFIG_INSTANCE *Instance;
519 NIC_IP4_CONFIG_INFO *NicConfig;
520 EFI_STATUS Status;
521 EFI_TPL OldTpl;
522 UINTN Len;
523
524 if ((This == NULL) || (ConfigDataSize == NULL)) {
525 return EFI_INVALID_PARAMETER;
526 }
527
528 Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);
529
530 Status = EFI_SUCCESS;
531 OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
532
533 if (Instance->State == IP4_CONFIG_STATE_IDLE) {
534 Status = EFI_NOT_STARTED;
535 } else if (Instance->State == IP4_CONFIG_STATE_STARTED) {
536 Status = EFI_NOT_READY;
537 }
538
539 if (EFI_ERROR (Status)) {
540 goto ON_EXIT;
541 }
542
543 //
544 // Copy the configure data if auto configuration succeeds.
545 //
546 Status = Instance->Result;
547
548 if (Status == EFI_SUCCESS) {
549 ASSERT (Instance->NicConfig != NULL);
550
551 NicConfig = Instance->NicConfig;
552 Len = SIZEOF_IP4_CONFIG_INFO (&NicConfig->Ip4Info);
553
554 if ((*ConfigDataSize < Len) || (ConfigData == NULL)) {
555 Status = EFI_BUFFER_TOO_SMALL;
556 } else {
557 NetCopyMem (ConfigData, &NicConfig->Ip4Info, Len);
558 }
559
560 *ConfigDataSize = Len;
561 }
562
563 ON_EXIT:
564 NET_RESTORE_TPL (OldTpl);
565
566 return Status;
567 }
568
569
570 /**
571 Callback function when DHCP process finished. It will save the
572 retrieved IP configure parameter from DHCP to the NVRam.
573
574 @param Event The callback event
575 @param Context Opaque context to the callback
576
577 @return None
578
579 **/
580 VOID
581 EFIAPI
582 Ip4ConfigOnDhcp4Complete (
583 IN EFI_EVENT Event,
584 IN VOID *Context
585 )
586 {
587 IP4_CONFIG_INSTANCE *Instance;
588 EFI_DHCP4_MODE_DATA Dhcp4Mode;
589 EFI_IP4_IPCONFIG_DATA *Ip4Config;
590 EFI_STATUS Status;
591 BOOLEAN Perment;
592 IP4_ADDR Subnet;
593
594 Instance = (IP4_CONFIG_INSTANCE *) Context;
595 ASSERT (Instance->Dhcp4 != NULL);
596
597 Instance->State = IP4_CONFIG_STATE_CONFIGURED;
598 Instance->Result = EFI_TIMEOUT;
599
600 //
601 // Get the DHCP retrieved parameters
602 //
603 Status = Instance->Dhcp4->GetModeData (Instance->Dhcp4, &Dhcp4Mode);
604
605 if (EFI_ERROR (Status)) {
606 goto ON_EXIT;
607 }
608
609 if (Dhcp4Mode.State == Dhcp4Bound) {
610 //
611 // Save the new configuration retrieved by DHCP both in
612 // the instance and to NVRam. So, both the IP4 driver and
613 // other user can get that address.
614 //
615 Perment = FALSE;
616
617 if (Instance->NicConfig != NULL) {
618 ASSERT (Instance->NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);
619 Perment = Instance->NicConfig->Perment;
620 NetFreePool (Instance->NicConfig);
621 }
622
623 Instance->NicConfig = NetAllocatePool (sizeof (NIC_IP4_CONFIG_INFO) +
624 sizeof (EFI_IP4_ROUTE_TABLE));
625
626 if (Instance->NicConfig == NULL) {
627 Instance->Result = EFI_OUT_OF_RESOURCES;
628 goto ON_EXIT;
629 }
630
631 CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (NIC_ADDR));
632 Instance->NicConfig->Source = IP4_CONFIG_SOURCE_DHCP;
633 Instance->NicConfig->Perment = Perment;
634
635 Ip4Config = &Instance->NicConfig->Ip4Info;
636 Ip4Config->StationAddress = Dhcp4Mode.ClientAddress;
637 Ip4Config->SubnetMask = Dhcp4Mode.SubnetMask;
638
639 //
640 // Create a route for the connected network
641 //
642 Ip4Config->RouteTableSize = 1;
643
644 Subnet = EFI_NTOHL (Dhcp4Mode.ClientAddress) & EFI_NTOHL (Dhcp4Mode.SubnetMask);
645
646 EFI_IP4 (Ip4Config->RouteTable[0].SubnetAddress) = HTONL (Subnet);
647 Ip4Config->RouteTable[0].SubnetMask = Dhcp4Mode.SubnetMask;
648 EFI_IP4 (Ip4Config->RouteTable[0].GatewayAddress) = 0;
649
650 //
651 // Create a route if there is a default router.
652 //
653 if (EFI_IP4 (Dhcp4Mode.RouterAddress) != 0) {
654 Ip4Config->RouteTableSize = 2;
655 EFI_IP4 (Ip4Config->RouteTable[1].SubnetAddress) = 0;
656 EFI_IP4 (Ip4Config->RouteTable[1].SubnetMask) = 0;
657 Ip4Config->RouteTable[1].GatewayAddress = Dhcp4Mode.RouterAddress;
658 }
659
660 Instance->Result = EFI_SUCCESS;
661
662 //
663 // ignore the return status of EfiNicIp4ConfigSetInfo. Network
664 // stack can operate even that failed.
665 //
666 EfiNicIp4ConfigSetInfo (&Instance->NicIp4Protocol, Instance->NicConfig, FALSE);
667 }
668
669 ON_EXIT:
670 gBS->SignalEvent (Instance->DoneEvent);
671 Ip4ConfigCleanDhcp4 (Instance);
672 return ;
673 }
674
675
676 /**
677 Release all the DHCP related resources.
678
679 @param This The IP4 configure instance
680
681 @return None
682
683 **/
684 VOID
685 Ip4ConfigCleanDhcp4 (
686 IN IP4_CONFIG_INSTANCE *This
687 )
688 {
689 if (This->Dhcp4 != NULL) {
690 This->Dhcp4->Stop (This->Dhcp4);
691
692 gBS->CloseProtocol (
693 This->Dhcp4Handle,
694 &gEfiDhcp4ProtocolGuid,
695 This->Image,
696 This->Controller
697 );
698
699 This->Dhcp4 = NULL;
700 }
701
702 if (This->Dhcp4Handle != NULL) {
703 NetLibDestroyServiceChild (
704 This->Controller,
705 This->Image,
706 &gEfiDhcp4ServiceBindingProtocolGuid,
707 This->Dhcp4Handle
708 );
709
710 This->Dhcp4Handle = NULL;
711 }
712
713 if (This->Dhcp4Event == NULL) {
714 gBS->CloseEvent (This->Dhcp4Event);
715 This->Dhcp4Event = NULL;
716 }
717 }
718
719
720 /**
721 Clean up all the configuration parameters
722
723 @param Instance The IP4 configure instance
724
725 @return None
726
727 **/
728 VOID
729 Ip4ConfigCleanConfig (
730 IN IP4_CONFIG_INSTANCE *Instance
731 )
732 {
733 if (Instance->NicConfig != NULL) {
734 NetFreePool (Instance->NicConfig);
735 Instance->NicConfig = NULL;
736 }
737
738 Instance->State = IP4_CONFIG_STATE_IDLE;
739 Instance->DoneEvent = NULL;
740 Instance->ReconfigEvent = NULL;
741
742 Ip4ConfigCleanDhcp4 (Instance);
743 }
744
745 EFI_IP4_CONFIG_PROTOCOL mIp4ConfigProtocolTemplate = {
746 EfiIp4ConfigStart,
747 EfiIp4ConfigStop,
748 EfiIp4ConfigGetData
749 };
750
751 EFI_NIC_IP4_CONFIG_PROTOCOL mNicIp4ConfigProtocolTemplate = {
752 EfiNicIp4ConfigGetName,
753 EfiNicIp4ConfigGetInfo,
754 EfiNicIp4ConfigSetInfo
755 };