]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
MdeModulePkg: Change OPTIONAL keyword usage style
[mirror_edk2.git] / MdeModulePkg / Bus / Ata / AtaBusDxe / AtaPassThruExecute.c
index 35a1b47e8a36b63f9bf6c4017227a3ccf17d8aef..c947a778a0c16d52774fb5de561556592962bf5f 100644 (file)
   for Security Protocol Specific layout. This implementation uses big endian for\r
   Cylinder register.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 \r
 **/\r
@@ -119,7 +113,7 @@ UINTN mMaxTransferBlockNumber[] = {
 EFI_STATUS\r
 AtaDevicePassThru (\r
   IN OUT ATA_DEVICE                       *AtaDevice,\r
-  IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *TaskPacket, OPTIONAL\r
+  IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *TaskPacket  OPTIONAL,\r
   IN OUT EFI_EVENT                        Event OPTIONAL\r
   )\r
 {\r
@@ -315,7 +309,7 @@ IdentifyAtaDevice (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  DEBUG ((EFI_D_INFO, "AtaBus - Identify Device: Port %x PortMultiplierPort %x\n", AtaDevice->Port, AtaDevice->PortMultiplierPort));\r
+  DEBUG ((DEBUG_INFO, "AtaBus - Identify Device: Port %x PortMultiplierPort %x\n", AtaDevice->Port, AtaDevice->PortMultiplierPort));\r
 \r
   //\r
   // Check whether the WORD 88 (supported UltraDMA by drive) is valid\r
@@ -470,7 +464,7 @@ DiscoverAtaDevice (
 EFI_STATUS\r
 TransferAtaDevice (\r
   IN OUT ATA_DEVICE                       *AtaDevice,\r
-  IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *TaskPacket, OPTIONAL\r
+  IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *TaskPacket  OPTIONAL,\r
   IN OUT VOID                             *Buffer,\r
   IN EFI_LBA                              StartLba,\r
   IN UINT32                               TransferLength,\r
@@ -542,7 +536,7 @@ TransferAtaDevice (
   //\r
   // As AtaBus is used to manage ATA devices, we have to use the lowest transfer rate to\r
   // calculate the possible maximum timeout value for each read/write operation.\r
-  // The timout value is rounded up to nearest integar and here an additional 30s is added\r
+  // The timeout value is rounded up to nearest integer and here an additional 30s is added\r
   // to follow ATA spec in which it mentioned that the device may take up to 30s to respond\r
   // commands in the Standby/Idle mode.\r
   //\r
@@ -633,14 +627,14 @@ AtaTerminateNonBlockingTask (
 \r
   //\r
   // Aborting operation has been done. From now on, don't need to abort normal operation.\r
-  //  \r
+  //\r
   OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
   AtaDevice->Abort = FALSE;\r
   gBS->RestoreTPL (OldTpl);\r
 }\r
 \r
 /**\r
-  Call back funtion when the event is signaled.\r
+  Call back function when the event is signaled.\r
 \r
   @param[in]  Event     The Event this notify function registered to.\r
   @param[in]  Context   Pointer to the context data registered to the\r
@@ -680,7 +674,7 @@ AtaNonBlockingCallBack (
   }\r
 \r
   DEBUG ((\r
-    EFI_D_BLKIO,\r
+    DEBUG_BLKIO,\r
     "NON-BLOCKING EVENT FINISHED!- STATUS = %r\n",\r
     Task->Token->TransactionStatus\r
     ));\r
@@ -689,7 +683,7 @@ AtaNonBlockingCallBack (
   // Reduce the SubEventCount, till it comes to zero.\r
   //\r
   (*Task->UnsignalledEventCount) --;\r
-  DEBUG ((EFI_D_BLKIO, "UnsignalledEventCount = %d\n", *Task->UnsignalledEventCount));\r
+  DEBUG ((DEBUG_BLKIO, "UnsignalledEventCount = %d\n", *Task->UnsignalledEventCount));\r
 \r
   //\r
   // Remove the SubTask from the Task list.\r
@@ -702,7 +696,7 @@ AtaNonBlockingCallBack (
     //\r
     if (!(*Task->IsError)) {\r
       gBS->SignalEvent (Task->Token->Event);\r
-      DEBUG ((EFI_D_BLKIO, "Signal the upper layer event!\n"));\r
+      DEBUG ((DEBUG_BLKIO, "Signal the upper layer event!\n"));\r
     }\r
 \r
     FreePool (Task->UnsignalledEventCount);\r
@@ -715,8 +709,8 @@ AtaNonBlockingCallBack (
     if (!IsListEmpty (&AtaDevice->AtaTaskList)) {\r
       Entry   = GetFirstNode (&AtaDevice->AtaTaskList);\r
       AtaTask = ATA_ASYN_TASK_FROM_ENTRY (Entry);\r
-      DEBUG ((EFI_D_BLKIO, "Start to embark a new Ata Task\n"));\r
-      DEBUG ((EFI_D_BLKIO, "AtaTask->NumberOfBlocks = %x; AtaTask->Token=%x\n", AtaTask->NumberOfBlocks, AtaTask->Token));\r
+      DEBUG ((DEBUG_BLKIO, "Start to embark a new Ata Task\n"));\r
+      DEBUG ((DEBUG_BLKIO, "AtaTask->NumberOfBlocks = %x; AtaTask->Token=%x\n", AtaTask->NumberOfBlocks, AtaTask->Token));\r
       Status = AccessAtaDevice (\r
                  AtaTask->AtaDevice,\r
                  AtaTask->Buffer,\r
@@ -735,7 +729,7 @@ AtaNonBlockingCallBack (
   }\r
 \r
   DEBUG ((\r
-    EFI_D_BLKIO,\r
+    DEBUG_BLKIO,\r
     "PACKET INFO: Write=%s, Length=%x, LowCylinder=%x, HighCylinder=%x, SectionNumber=%x\n",\r
     Task->Packet.OutDataBuffer != NULL ? L"YES" : L"NO",\r
     Task->Packet.OutDataBuffer != NULL ? Task->Packet.OutTransferLength : Task->Packet.InTransferLength,\r
@@ -844,13 +838,13 @@ AccessAtaDevice(
       FreePool (EventCount);\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
-    DEBUG ((EFI_D_BLKIO, "Allocation IsError Addr=%x\n", IsError));\r
+    DEBUG ((DEBUG_BLKIO, "Allocation IsError Addr=%x\n", IsError));\r
     *IsError = FALSE;\r
     TempCount   = (NumberOfBlocks + MaxTransferBlockNumber - 1) / MaxTransferBlockNumber;\r
     *EventCount = TempCount;\r
-    DEBUG ((EFI_D_BLKIO, "AccessAtaDevice, NumberOfBlocks=%x\n", NumberOfBlocks));\r
-    DEBUG ((EFI_D_BLKIO, "AccessAtaDevice, MaxTransferBlockNumber=%x\n", MaxTransferBlockNumber));\r
-    DEBUG ((EFI_D_BLKIO, "AccessAtaDevice, EventCount=%x\n", TempCount));\r
+    DEBUG ((DEBUG_BLKIO, "AccessAtaDevice, NumberOfBlocks=%x\n", NumberOfBlocks));\r
+    DEBUG ((DEBUG_BLKIO, "AccessAtaDevice, MaxTransferBlockNumber=%x\n", MaxTransferBlockNumber));\r
+    DEBUG ((DEBUG_BLKIO, "AccessAtaDevice, EventCount=%x\n", TempCount));\r
   } else {\r
     while (!IsListEmpty (&AtaDevice->AtaTaskList) || !IsListEmpty (&AtaDevice->AtaSubTaskList)) {\r
       //\r
@@ -912,7 +906,7 @@ AccessAtaDevice(
       //\r
       // Blocking Mode.\r
       //\r
-      DEBUG ((EFI_D_BLKIO, "Blocking AccessAtaDevice, TransferBlockNumber=%x; StartLba = %x\n", TransferBlockNumber, StartLba));\r
+      DEBUG ((DEBUG_BLKIO, "Blocking AccessAtaDevice, TransferBlockNumber=%x; StartLba = %x\n", TransferBlockNumber, StartLba));\r
       Status = TransferAtaDevice (AtaDevice, NULL, Buffer, StartLba, (UINT32) TransferBlockNumber, IsWrite, NULL);\r
     }\r
 \r