]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
1 update function header
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiMisc.c
1 /** @file
2 Miscellaneous routines for IScsi driver.
3
4 Copyright (c) 2004 - 2008, Intel Corporation.<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "IScsiImpl.h"
16
17 GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 IScsiHexString[] = "0123456789ABCDEFabcdef";
18
19 /**
20 Removes (trims) specified leading and trailing characters from a string.
21
22 @param[in, out] Str Pointer to the null-terminated string to be trimmed. On return,
23 str will hold the trimmed string.
24
25 @param[in] CharC Character will be trimmed from str.
26 **/
27 VOID
28 StrTrim (
29 IN OUT CHAR16 *Str,
30 IN CHAR16 CharC
31 )
32 {
33 CHAR16 *Pointer1;
34 CHAR16 *Pointer2;
35
36 if (*Str == 0) {
37 return;
38 }
39
40 //
41 // Trim off the leading and trailing characters c
42 //
43 for (Pointer1 = Str; (*Pointer1 != 0) && (*Pointer1 == CharC); Pointer1++) {
44 ;
45 }
46
47 Pointer2 = Str;
48 if (Pointer2 == Pointer1) {
49 while (*Pointer1 != 0) {
50 Pointer2++;
51 Pointer1++;
52 }
53 } else {
54 while (*Pointer1 != 0) {
55 *Pointer2 = *Pointer1;
56 Pointer1++;
57 Pointer2++;
58 }
59 *Pointer2 = 0;
60 }
61
62
63 for (Pointer1 = Str + StrLen(Str) - 1; Pointer1 >= Str && *Pointer1 == CharC; Pointer1--) {
64 ;
65 }
66 if (Pointer1 != Str + StrLen(Str) - 1) {
67 *(Pointer1 + 1) = 0;
68 }
69 }
70
71 /**
72 Calculate the prefix length of the IPv4 subnet mask.
73
74 @param[in] SubnetMask The IPv4 subnet mask.
75
76 @return The prefix length of the subnet mask.
77 @return 0 Some unexpected error happened.
78 **/
79 UINT8
80 IScsiGetSubnetMaskPrefixLength (
81 IN EFI_IPv4_ADDRESS *SubnetMask
82 )
83 {
84 UINT8 Len;
85 UINT32 ReverseMask;
86
87 //
88 // The SubnetMask is in network byte order.
89 //
90 ReverseMask = (SubnetMask->Addr[0] << 24) | (SubnetMask->Addr[1] << 16) | (SubnetMask->Addr[2] << 8) | (SubnetMask->Addr[3]);
91
92 //
93 // Reverse it.
94 //
95 ReverseMask = ~ReverseMask;
96
97 if ((ReverseMask != 0) & ((ReverseMask + 1) != 0)) {
98 return 0;
99 }
100
101 Len = 0;
102
103 while (ReverseMask != 0) {
104 ReverseMask = ReverseMask >> 1;
105 Len++;
106 }
107
108 return (UINT8) (32 - Len);
109 }
110
111 /**
112 Convert the hexadecimal encoded LUN string into the 64-bit LUN.
113
114 @param[in] Str The hexadecimal encoded LUN string.
115 @param[out] Lun Storage to return the 64-bit LUN.
116
117 @retval EFI_SUCCESS The 64-bit LUN is stored in Lun.
118 @retval EFI_INVALID_PARAMETER The string is malformatted.
119 **/
120 EFI_STATUS
121 IScsiAsciiStrToLun (
122 IN CHAR8 *Str,
123 OUT UINT8 *Lun
124 )
125 {
126 UINT32 Index;
127 CHAR8 *LunUnitStr[4];
128 CHAR8 Digit;
129 UINTN Temp;
130
131 ZeroMem (Lun, 8);
132 ZeroMem (LunUnitStr, sizeof (LunUnitStr));
133
134 Index = 0;
135 LunUnitStr[0] = Str;
136
137 if (!IsHexDigit ((UINT8 *) &Digit, *Str)) {
138 return EFI_INVALID_PARAMETER;
139 }
140
141 while (*Str != '\0') {
142 //
143 // Legal representations of LUN:
144 // 4752-3A4F-6b7e-2F99,
145 // 6734-9-156f-127,
146 // 4186-9
147 //
148 if (*Str == '-') {
149 *Str = '\0';
150 Index++;
151
152 if (*(Str + 1) != '\0') {
153 if (!IsHexDigit ((UINT8 *) &Digit, *(Str + 1))) {
154 return EFI_INVALID_PARAMETER;
155 }
156
157 LunUnitStr[Index] = Str + 1;
158 }
159 } else if (!IsHexDigit ((UINT8 *) &Digit, *Str)) {
160 return EFI_INVALID_PARAMETER;
161 }
162
163 Str++;
164 }
165
166 for (Index = 0; (Index < 4) && (LunUnitStr[Index] != NULL); Index++) {
167 if (AsciiStrLen (LunUnitStr[Index]) > 4) {
168 return EFI_INVALID_PARAMETER;
169 }
170
171 Temp = AsciiStrHexToUintn (LunUnitStr[Index]);
172 *((UINT16 *) &Lun[Index * 2]) = HTONS (Temp);
173 }
174
175 return EFI_SUCCESS;
176 }
177
178 /**
179 Convert the 64-bit LUN into the hexadecimal encoded LUN string.
180
181 @param[in] Lun The 64-bit LUN.
182 @param[out] Str The storage to return the hexadecimal encoded LUN string.
183 **/
184 VOID
185 IScsiLunToUnicodeStr (
186 IN UINT8 *Lun,
187 OUT CHAR16 *Str
188 )
189 {
190 UINTN Index;
191 CHAR16 *TempStr;
192
193 TempStr = Str;
194
195 for (Index = 0; Index < 4; Index++) {
196
197 if ((Lun[2 * Index] | Lun[2 * Index + 1]) == 0) {
198 StrCpy (TempStr, L"0-");
199 } else {
200 TempStr[0] = (CHAR16) IScsiHexString[Lun[2 * Index] >> 4];
201 TempStr[1] = (CHAR16) IScsiHexString[Lun[2 * Index] & 0x0F];
202 TempStr[2] = (CHAR16) IScsiHexString[Lun[2 * Index + 1] >> 4];
203 TempStr[3] = (CHAR16) IScsiHexString[Lun[2 * Index + 1] & 0x0F];
204 TempStr[4] = L'-';
205 TempStr[5] = 0;
206
207 StrTrim (TempStr, L'0');
208 }
209
210 TempStr += StrLen (TempStr);
211 }
212
213 Str[StrLen (Str) - 1] = 0;
214
215 for (Index = StrLen (Str) - 1; Index > 1; Index = Index - 2) {
216 if ((Str[Index] == L'0') && (Str[Index - 1] == L'-')) {
217 Str[Index - 1] = 0;
218 } else {
219 break;
220 }
221 }
222 }
223
224 /**
225 Convert the ASCII string into a UNICODE string.
226
227 @param[in] Source The ASCII string.
228 @param[out] Destination The storage to return the UNICODE string.
229
230 @return CHAR16 * Pointer to the UNICODE string.
231 **/
232 CHAR16 *
233 IScsiAsciiStrToUnicodeStr (
234 IN CHAR8 *Source,
235 OUT CHAR16 *Destination
236 )
237 {
238 ASSERT (Destination != NULL);
239 ASSERT (Source != NULL);
240
241 while (*Source != '\0') {
242 *(Destination++) = (CHAR16) *(Source++);
243 }
244
245 *Destination = '\0';
246
247 return Destination;
248 }
249
250 /**
251 Convert the UNICODE string into an ASCII string.
252
253 @param[in] Source The UNICODE string.
254 @param[out] Destination The storage to return the ASCII string.
255
256 @return CHAR8 * Pointer to the ASCII string.
257 **/
258 **/
259 CHAR8 *
260 IScsiUnicodeStrToAsciiStr (
261 IN CHAR16 *Source,
262 OUT CHAR8 *Destination
263 )
264 {
265 ASSERT (Destination != NULL);
266 ASSERT (Source != NULL);
267
268 while (*Source != '\0') {
269 //
270 // If any Unicode characters in Source contain
271 // non-zero value in the upper 8 bits, then ASSERT().
272 //
273 ASSERT (*Source < 0x100);
274 *(Destination++) = (CHAR8) *(Source++);
275 }
276
277 *Destination = '\0';
278
279 return Destination;
280 }
281
282 /**
283 Convert the decimal dotted IPv4 address into the binary IPv4 address.
284
285 @param[in] Str The UNICODE string.
286 @param[out] Ip The storage to return the ASCII string.
287
288 @retval EFI_SUCCESS The binary IP address is returned in Ip.
289 @retval EFI_INVALID_PARAMETER The IP string is malformatted.
290 **/
291 EFI_STATUS
292 IScsiAsciiStrToIp (
293 IN CHAR8 *Str,
294 OUT EFI_IPv4_ADDRESS *Ip
295 )
296 {
297 UINTN Index;
298 UINTN Number;
299
300 Index = 0;
301
302 while (*Str) {
303
304 if (Index > 3) {
305 return EFI_INVALID_PARAMETER;
306 }
307
308 Number = 0;
309 while (NET_IS_DIGIT (*Str)) {
310 Number = Number * 10 + (*Str - '0');
311 Str++;
312 }
313
314 if (Number > 0xFF) {
315 return EFI_INVALID_PARAMETER;
316 }
317
318 Ip->Addr[Index] = (UINT8) Number;
319
320 if ((*Str != '\0') && (*Str != '.')) {
321 //
322 // The current character should be either the NULL terminator or
323 // the dot delimiter.
324 //
325 return EFI_INVALID_PARAMETER;
326 }
327
328 if (*Str == '.') {
329 //
330 // Skip the delimiter.
331 //
332 Str++;
333 }
334
335 Index++;
336 }
337
338 if (Index != 4) {
339 return EFI_INVALID_PARAMETER;
340 }
341
342 return EFI_SUCCESS;
343 }
344
345 /**
346 Convert the mac address into a hexadecimal encoded "-" seperated string.
347
348 @param[in] Mac The mac address.
349 @param[in] Len Length in bytes of the mac address.
350 @param[out] Str The storage to return the mac string.
351 **/
352 VOID
353 IScsiMacAddrToStr (
354 IN EFI_MAC_ADDRESS *Mac,
355 IN UINT32 Len,
356 OUT CHAR16 *Str
357 )
358 {
359 UINT32 Index;
360
361 for (Index = 0; Index < Len; Index++) {
362 Str[3 * Index] = (CHAR16) IScsiHexString[(Mac->Addr[Index] >> 4) & 0x0F];
363 Str[3 * Index + 1] = (CHAR16) IScsiHexString[Mac->Addr[Index] & 0x0F];
364 Str[3 * Index + 2] = L'-';
365 }
366
367 Str[3 * Index - 1] = L'\0';
368 }
369
370 /**
371 Convert the binary encoded buffer into a hexadecimal encoded string.
372
373 @param[in] BinBuffer The buffer containing the binary data.
374 @param[in] BinLength Length of the binary buffer.
375 @param[in, out] HexStr Pointer to the string.
376 @param[in, out] HexLength The length of the string.
377
378 @retval EFI_SUCCESS The binary data is converted to the hexadecimal string
379 and the length of the string is updated.
380 @retval EFI_BUFFER_TOO_SMALL The string is too small.
381 @retval EFI_INVALID_PARAMETER The IP string is malformatted.
382 **/
383 EFI_STATUS
384 IScsiBinToHex (
385 IN UINT8 *BinBuffer,
386 IN UINT32 BinLength,
387 IN OUT CHAR8 *HexStr,
388 IN OUT UINT32 *HexLength
389 )
390 {
391 UINTN Index;
392
393 if ((HexStr == NULL) || (BinBuffer == NULL) || (BinLength == 0)) {
394 return EFI_INVALID_PARAMETER;
395 }
396
397 if (((*HexLength) - 3) < BinLength * 2) {
398 *HexLength = BinLength * 2 + 3;
399 return EFI_BUFFER_TOO_SMALL;
400 }
401
402 *HexLength = BinLength * 2 + 3;
403 //
404 // Prefix for Hex String
405 //
406 HexStr[0] = '0';
407 HexStr[1] = 'x';
408
409 for (Index = 0; Index < BinLength; Index++) {
410 HexStr[Index * 2 + 2] = IScsiHexString[BinBuffer[Index] >> 4];
411 HexStr[Index * 2 + 3] = IScsiHexString[BinBuffer[Index] & 0x0F];
412 }
413
414 HexStr[Index * 2 + 2] = '\0';
415
416 return EFI_SUCCESS;
417 }
418
419 /**
420 Convert the hexadecimal string into a binary encoded buffer.
421
422 @param[in, out] BinBuffer The binary buffer.
423 @param[in, out] BinLength Length of the binary buffer.
424 @param[in] HexStr The hexadecimal string.
425
426 @retval EFI_SUCCESS The hexadecimal string is converted into a binary
427 encoded buffer.
428 @retval EFI_BUFFER_TOO_SMALL The binary buffer is too small to hold the converted data.s
429 **/
430 EFI_STATUS
431 IScsiHexToBin (
432 IN OUT UINT8 *BinBuffer,
433 IN OUT UINT32 *BinLength,
434 IN CHAR8 *HexStr
435 )
436 {
437 UINTN Index;
438 UINT32 HexCount;
439 CHAR8 *HexBuf;
440 UINT8 Digit;
441 UINT8 Byte;
442
443 Digit = 0;
444
445 //
446 // Find out how many hex characters the string has.
447 //
448 HexBuf = HexStr;
449 if ((HexBuf[0] == '0') && ((HexBuf[1] == 'x') || (HexBuf[1] == 'X'))) {
450 HexBuf += 2;
451 }
452
453 for (Index = 0, HexCount = 0; IsHexDigit (&Digit, HexBuf[Index]); Index++, HexCount++)
454 ;
455
456 if (HexCount == 0) {
457 *BinLength = 0;
458 return EFI_SUCCESS;
459 }
460 //
461 // Test if buffer is passed enough.
462 //
463 if (((HexCount + 1) / 2) > *BinLength) {
464 *BinLength = (HexCount + 1) / 2;
465 return EFI_BUFFER_TOO_SMALL;
466 }
467
468 *BinLength = (HexCount + 1) / 2;
469
470 for (Index = 0; Index < HexCount; Index++) {
471
472 IsHexDigit (&Digit, HexBuf[HexCount - 1 - Index]);
473
474 if ((Index & 1) == 0) {
475 Byte = Digit;
476 } else {
477 Byte = BinBuffer[*BinLength - 1 - Index / 2];
478 Byte &= 0x0F;
479 Byte = (UINT8) (Byte | (Digit << 4));
480 }
481
482 BinBuffer[*BinLength - 1 - Index / 2] = Byte;
483 }
484
485 return EFI_SUCCESS;
486 }
487
488 /**
489 Generate random numbers.
490
491 @param[in, out] Rand The buffer to contain random numbers.
492 @param[in] RandLength The length of the Rand buffer.
493 **/
494 VOID
495 IScsiGenRandom (
496 IN OUT UINT8 *Rand,
497 IN UINTN RandLength
498 )
499 {
500 UINT32 Random;
501
502 while (RandLength > 0) {
503 Random = NET_RANDOM (NetRandomInitSeed ());
504 *Rand++ = (UINT8) (Random);
505 RandLength--;
506 }
507 }
508
509 /**
510 Create the iSCSI driver data..
511
512 @param[in] Image The handle of the driver image.
513 @param[in] Controller The handle of the controller.
514
515 @return The iSCSI driver data created.
516 @return NULL Some unexpected error happened.
517 **/
518 ISCSI_DRIVER_DATA *
519 IScsiCreateDriverData (
520 IN EFI_HANDLE Image,
521 IN EFI_HANDLE Controller
522 )
523 {
524 ISCSI_DRIVER_DATA *Private;
525 EFI_STATUS Status;
526
527 Private = AllocateZeroPool (sizeof (ISCSI_DRIVER_DATA));
528 if (Private == NULL) {
529 return NULL;
530 }
531
532 Private->Signature = ISCSI_DRIVER_DATA_SIGNATURE;
533 Private->Image = Image;
534 Private->Controller = Controller;
535
536 //
537 // Create an event to be signal when the BS to RT transition is triggerd so
538 // as to abort the iSCSI session.
539 //
540 Status = gBS->CreateEvent (
541 EVT_SIGNAL_EXIT_BOOT_SERVICES,
542 TPL_CALLBACK,
543 IScsiOnExitBootService,
544 Private,
545 &Private->ExitBootServiceEvent
546 );
547 if (EFI_ERROR (Status)) {
548 gBS->FreePool (Private);
549 return NULL;
550 }
551
552 CopyMem(&Private->IScsiExtScsiPassThru, &gIScsiExtScsiPassThruProtocolTemplate, sizeof(EFI_EXT_SCSI_PASS_THRU_PROTOCOL));
553
554 //
555 // 0 is designated to the TargetId, so use another value for the AdapterId.
556 //
557 Private->ExtScsiPassThruMode.AdapterId = 2;
558 Private->ExtScsiPassThruMode.Attributes = EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL | EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL;
559 Private->ExtScsiPassThruMode.IoAlign = 4;
560 Private->IScsiExtScsiPassThru.Mode = &Private->ExtScsiPassThruMode;
561
562 //
563 // Install the Ext SCSI PASS THRU protocol.
564 //
565 Status = gBS->InstallProtocolInterface (
566 &Private->ExtScsiPassThruHandle,
567 &gEfiExtScsiPassThruProtocolGuid,
568 EFI_NATIVE_INTERFACE,
569 &Private->IScsiExtScsiPassThru
570 );
571 if (EFI_ERROR (Status)) {
572 gBS->CloseEvent (Private->ExitBootServiceEvent);
573 gBS->FreePool (Private);
574
575 return NULL;
576 }
577
578 IScsiSessionInit (&Private->Session, FALSE);
579
580 return Private;
581 }
582
583 /**
584 Clean the iSCSI driver data.
585
586 @param[in] Private The iSCSI driver data.
587 **/
588 VOID
589 IScsiCleanDriverData (
590 IN ISCSI_DRIVER_DATA *Private
591 )
592 {
593 if (Private->DevicePath != NULL) {
594 gBS->UninstallProtocolInterface (
595 Private->ExtScsiPassThruHandle,
596 &gEfiDevicePathProtocolGuid,
597 Private->DevicePath
598 );
599
600 gBS->FreePool (Private->DevicePath);
601 }
602
603 if (Private->ExtScsiPassThruHandle != NULL) {
604 gBS->UninstallProtocolInterface (
605 Private->ExtScsiPassThruHandle,
606 &gEfiExtScsiPassThruProtocolGuid,
607 &Private->IScsiExtScsiPassThru
608 );
609 }
610
611 gBS->CloseEvent (Private->ExitBootServiceEvent);
612
613 gBS->FreePool (Private);
614 }
615
616 /**
617 Get the various configuration data of this iSCSI instance.
618
619 @param[in] Private The iSCSI driver data.
620
621 @retval EFI_SUCCESS The configuration of this instance is got.
622 @retval EFI_ABORTED The operation was aborted.
623 @retval Others Some unexpected error happened.
624 **/
625 EFI_STATUS
626 IScsiGetConfigData (
627 IN ISCSI_DRIVER_DATA *Private
628 )
629 {
630 EFI_STATUS Status;
631 ISCSI_SESSION *Session;
632 UINTN BufferSize;
633 EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
634 EFI_SIMPLE_NETWORK_MODE *Mode;
635 CHAR16 MacString[65];
636
637 //
638 // get the iSCSI Initiator Name
639 //
640 Session = &Private->Session;
641 Session->InitiatorNameLength = ISCSI_NAME_MAX_SIZE;
642 Status = gIScsiInitiatorName.Get (
643 &gIScsiInitiatorName,
644 &Session->InitiatorNameLength,
645 Session->InitiatorName
646 );
647 if (EFI_ERROR (Status)) {
648 return Status;
649 }
650
651 Status = gBS->HandleProtocol (
652 Private->Controller,
653 &gEfiSimpleNetworkProtocolGuid,
654 (VOID **)&Snp
655 );
656 if (EFI_ERROR (Status)) {
657 return Status;
658 }
659
660 Mode = Snp->Mode;
661
662 //
663 // Get the mac string, it's the name of various variable
664 //
665 IScsiMacAddrToStr (&Mode->PermanentAddress, Mode->HwAddressSize, MacString);
666
667 //
668 // Get the normal configuration.
669 //
670 BufferSize = sizeof (Session->ConfigData.NvData);
671 Status = gRT->GetVariable (
672 MacString,
673 &gEfiIScsiInitiatorNameProtocolGuid,
674 NULL,
675 &BufferSize,
676 &Session->ConfigData.NvData
677 );
678 if (EFI_ERROR (Status)) {
679 return Status;
680 }
681
682 if (!Session->ConfigData.NvData.Enabled) {
683 return EFI_ABORTED;
684 }
685 //
686 // Get the CHAP Auth information.
687 //
688 BufferSize = sizeof (Session->AuthData.AuthConfig);
689 Status = gRT->GetVariable (
690 MacString,
691 &mIScsiCHAPAuthInfoGuid,
692 NULL,
693 &BufferSize,
694 &Session->AuthData.AuthConfig
695 );
696
697 if (!EFI_ERROR (Status) && Session->ConfigData.NvData.InitiatorInfoFromDhcp) {
698 //
699 // Start dhcp.
700 //
701 Status = IScsiDoDhcp (Private->Image, Private->Controller, &Session->ConfigData);
702 }
703
704 return Status;
705 }
706
707 /**
708 Get the device path of the iSCSI tcp connection and update it.
709
710 @param[in] Private The iSCSI driver data.
711
712 @return The updated device path.
713 @return NULL Some unexpected error happened.
714 **/
715 EFI_DEVICE_PATH_PROTOCOL *
716 IScsiGetTcpConnDevicePath (
717 IN ISCSI_DRIVER_DATA *Private
718 )
719 {
720 ISCSI_SESSION *Session;
721 ISCSI_CONNECTION *Conn;
722 TCP4_IO *Tcp4Io;
723 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
724 EFI_STATUS Status;
725 EFI_DEV_PATH *DPathNode;
726
727 Session = &Private->Session;
728 if (Session->State != SESSION_STATE_LOGGED_IN) {
729 return NULL;
730 }
731
732 Conn = NET_LIST_USER_STRUCT_S (
733 Session->Conns.ForwardLink,
734 ISCSI_CONNECTION,
735 Link,
736 ISCSI_CONNECTION_SIGNATURE
737 );
738 Tcp4Io = &Conn->Tcp4Io;
739
740 Status = gBS->HandleProtocol (
741 Tcp4Io->Handle,
742 &gEfiDevicePathProtocolGuid,
743 (VOID **)&DevicePath
744 );
745 if (EFI_ERROR (Status)) {
746 return NULL;
747 }
748 //
749 // Duplicate it.
750 //
751 DevicePath = DuplicateDevicePath (DevicePath);
752
753 DPathNode = (EFI_DEV_PATH *) DevicePath;
754
755 while (!IsDevicePathEnd (&DPathNode->DevPath)) {
756 if ((DevicePathType (&DPathNode->DevPath) == MESSAGING_DEVICE_PATH) &&
757 (DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP)
758 ) {
759
760 DPathNode->Ipv4.LocalPort = 0;
761 DPathNode->Ipv4.StaticIpAddress = (BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);
762 break;
763 }
764
765 DPathNode = (EFI_DEV_PATH *) NextDevicePathNode (&DPathNode->DevPath);
766 }
767
768 return DevicePath;
769 }
770
771 /**
772 Abort the session when the transition from BS to RT is initiated.
773
774 @param[in] Event The event signaled.
775 @param[in] Context The iSCSI driver data.
776 **/
777 VOID
778 EFIAPI
779 IScsiOnExitBootService (
780 IN EFI_EVENT Event,
781 IN VOID *Context
782 )
783 {
784 ISCSI_DRIVER_DATA *Private;
785
786 Private = (ISCSI_DRIVER_DATA *) Context;
787 gBS->CloseEvent (Private->ExitBootServiceEvent);
788
789 IScsiSessionAbort (&Private->Session);
790 }