/*++\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. 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) 2006, Intel Corporation\r
+All rights reserved. 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
\r
Module name:\r
snp.c\r
\r
--*/\r
{\r
-#if SNP_DEBUG\r
- Aprint ("\nissue_hwundi_command() - This should not be called!");\r
- snp_wait_for_key ();\r
-#endif\r
+ DEBUG ((EFI_D_ERROR, "\nissue_hwundi_command() - This should not be called!"));\r
+\r
if (cdb == 0) {\r
return EFI_INVALID_PARAMETER;\r
\r
\r
Routine Description:\r
Compute 8-bit checksum of a buffer.\r
- \r
+\r
Arguments:\r
ptr - Pointer to buffer.\r
len - Length of buffer in bytes.\r
);\r
if (Status == EFI_ALREADY_STARTED)\r
{\r
-#if SNP_DEBUG\r
- Aprint ("Support(): Already Started. on handle %x\n", Controller);\r
-#endif\r
+ DEBUG ((EFI_D_INFO, "Support(): Already Started. on handle %x\n", Controller));\r
return EFI_ALREADY_STARTED;\r
}\r
\r
if (!EFI_ERROR (Status))\r
{\r
-\r
-#if SNP_DEBUG\r
- Aprint ("Support(): UNDI3.1 found on handle %x\n", Controller);\r
- snp_wait_for_key ();\r
-#endif\r
+ DEBUG ((EFI_D_INFO, "Support(): UNDI3.1 found on handle %x\n", Controller));\r
IsUndi31 = TRUE;\r
} else {\r
//\r
return Status;\r
}\r
\r
-#if SNP_DEBUG\r
- Aprint ("Support(): UNDI3.0 found on handle %x\n", Controller);\r
- snp_wait_for_key ();\r
-#endif\r
+ DEBUG ((EFI_D_INFO, "Support(): UNDI3.0 found on handle %x\n", Controller));\r
}\r
//\r
// check the version, we don't want to connect to the undi16\r
}\r
\r
Status = EFI_SUCCESS;\r
-#if SNP_DEBUG\r
- Aprint ("Support(): supported on %x\n", Controller);\r
- snp_wait_for_key ();\r
-#endif\r
+ DEBUG ((EFI_D_INFO, "Support(): supported on %x\n", Controller));\r
\r
Done:\r
if (IsUndi31) {\r
// probably not a 3.1 UNDI\r
//\r
UndiNew = TRUE;\r
-#if SNP_DEBUG\r
- Aprint ("Start(): UNDI3.1 found\n");\r
- snp_wait_for_key ();\r
-#endif\r
+ DEBUG ((EFI_D_INFO, "Start(): UNDI3.1 found\n"));\r
+\r
} else {\r
UndiNew = FALSE;\r
Status = gBS->OpenProtocol (\r
return Status;\r
}\r
\r
-#if SNP_DEBUG\r
- Aprint ("Start(): UNDI3.0 found\n");\r
- snp_wait_for_key ();\r
-#endif\r
+ DEBUG ((EFI_D_INFO, "Start(): UNDI3.0 found\n"));\r
}\r
\r
pxe = (PXE_UNDI *) (UINTN) (Nii->ID);\r
Controller\r
);\r
}\r
- \r
+\r
Status = gBS->CloseProtocol (\r
Controller,\r
&gEfiDevicePathProtocolGuid,\r
\r
Routine Description:\r
This routine maps the given CPU address to a Device address. It creates a\r
- an entry in the map list with the virtual and physical addresses and the \r
+ an entry in the map list with the virtual and physical addresses and the\r
un map cookie.\r
\r
Arguments:\r
/*++\r
\r
Routine Description:\r
- This routine searches the linked list of mapped address nodes (for undi3.0 \r
+ This routine searches the linked list of mapped address nodes (for undi3.0\r
interface) to find the node that corresponds to the given virtual address and\r
returns a pointer to that node.\r
\r
/*++\r
\r
Routine Description:\r
- This routine unmaps the given virtual address and frees the memory allocated \r
+ This routine unmaps the given virtual address and frees the memory allocated\r
for the map list node corresponding to that address.\r
- \r
+\r
Arguments:\r
vaddr - virtual address (or CPU address) to be unmapped\r
\r
\r
gBS->FreePool (v);\r
\r
-#if SNP_DEBUG\r
if (Status) {\r
- Print (L"Unmap failed with status = %x\n", Status);\r
+ DEBUG ((EFI_D_ERROR, "Unmap failed with status = %x\n", Status));\r
}\r
-#endif\r
return Status;\r
}\r
\r
v->next = t->next;\r
Status = mPciIoFncs->Unmap (mPciIoFncs, t->unmap);\r
gBS->FreePool (t);\r
-#if SNP_DEBUG\r
+\r
if (Status) {\r
- Print (L"Unmap failed with status = %x\n", Status);\r
+ DEBUG ((EFI_D_ERROR, "Unmap failed with status = %x\n", Status));\r
}\r
-#endif\r
return Status;\r
}\r
}\r
\r
return EFI_NOT_FOUND;\r
}\r
-\r
-#if SNP_DEBUG\r
-VOID\r
-snp_wait_for_key (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Wait for a key stroke, used for debugging purposes\r
-\r
-Arguments:\r
- none\r
-\r
-Returns:\r
- none\r
-\r
---*/\r
-{\r
- EFI_INPUT_KEY key;\r
-\r
- Aprint ("\nPress any key to continue\n");\r
-\r
- while (gST->ConIn->ReadKeyStroke (gST->ConIn, &key) == EFI_NOT_READY) {\r
- ;\r
- }\r
-}\r
-#endif\r