]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Sd / SdDxe / SdDxe.c
index f657fb9c6e9916cc0b3c0fd96e768e7b112132b2..e341b4cc1c8d376aceac69c68e5e63545a4edeed 100644 (file)
@@ -4,14 +4,8 @@
   It produces BlockIo and BlockIo2 protocols to allow upper layer\r
   access the SD memory card device.\r
 \r
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -69,6 +63,13 @@ SD_DEVICE mSdDeviceTemplate = {
     1,\r
     SdEraseBlocks\r
   },\r
+  {                            // DiskInfo\r
+    EFI_DISK_INFO_SD_MMC_INTERFACE_GUID,\r
+    SdDiskInfoInquiry,\r
+    SdDiskInfoIdentify,\r
+    SdDiskInfoSenseData,\r
+    SdDiskInfoWhichIde\r
+  },\r
   {                            // Queue\r
     NULL,\r
     NULL\r
@@ -161,7 +162,7 @@ GetSdModelName (
   String[sizeof (Cid->OemId) + sizeof (Cid->ProductName)] = ' ';\r
   CopyMem (String + sizeof (Cid->OemId) + sizeof (Cid->ProductName) + 1, Cid->ProductSerialNumber, sizeof (Cid->ProductSerialNumber));\r
 \r
-  AsciiStrToUnicodeStr (String, Device->ModelName);\r
+  AsciiStrToUnicodeStrS (String, Device->ModelName, sizeof (Device->ModelName) / sizeof (Device->ModelName[0]));\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -366,7 +367,7 @@ DiscoverSdDevice (
     );\r
   AddUnicodeString2 (\r
     "en",\r
-    gSdDxeComponentName.SupportedLanguages,\r
+    gSdDxeComponentName2.SupportedLanguages,\r
     &Device->ControllerNameTable,\r
     Device->ModelName,\r
     FALSE\r
@@ -382,6 +383,8 @@ DiscoverSdDevice (
                   &Device->BlockIo2,\r
                   &gEfiEraseBlockProtocolGuid,\r
                   &Device->EraseBlock,\r
+                  &gEfiDiskInfoProtocolGuid,\r
+                  &Device->DiskInfo,\r
                   NULL\r
                   );\r
 \r
@@ -800,7 +803,7 @@ SdDxeDriverBindingStop (
     //\r
     // Free all on-going async tasks.\r
     //\r
-    OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
+    OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
     for (Link = GetFirstNode (&Device->Queue);\r
          !IsNull (&Device->Queue, Link);\r
          Link = NextLink) {\r
@@ -840,6 +843,8 @@ SdDxeDriverBindingStop (
                     &Device->BlockIo2,\r
                     &gEfiEraseBlockProtocolGuid,\r
                     &Device->EraseBlock,\r
+                    &gEfiDiskInfoProtocolGuid,\r
+                    &Device->DiskInfo,\r
                     NULL\r
                     );\r
     if (EFI_ERROR (Status)) {\r