]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c
Patch to remove STATIC modifier. This is on longer recommended by EFI Framework codin...
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UndiRuntimeDxe / Decode.c
index cb7fa89749b01f0142fe97a5d97dd2fa8f49cd75..f169d88ffe9ef5357cf250113929cd7b292964aa 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Provides the basic UNID functions.\r
 \r
 Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -9,16 +10,8 @@ http://opensource.org/licenses/bsd-license.php
 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
-    decode.c\r
+**/\r
 \r
-Abstract:\r
-\r
-Revision history:\r
-\r
---*/\r
-\r
-// TODO: fix comment to add: Module Name: DECODE.C\r
 #include "Undi32.h"\r
 \r
 //\r
@@ -49,53 +42,41 @@ UNDI_CALL_TABLE api_table[PXE_OPCODE_LAST_VALID+1] = { \
 // end of global variables\r
 //\r
 \r
-VOID\r
-UNDI_GetState (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine determines the operational state of the UNDI.  It updates the state flags in the\r
   Command Descriptor Block based on information derived from the AdapterInfo instance data.\r
-\r
   To ensure the command has completed successfully, CdbPtr->StatCode will contain the result of\r
   the command execution.\r
-\r
   The CdbPtr->StatFlags will contain a STOPPED, STARTED, or INITIALIZED state once the command\r
   has successfully completed.\r
-\r
   Keep in mind the AdapterInfo->State is the active state of the adapter (based on software\r
   interrogation), and the CdbPtr->StateFlags is the passed back information that is reflected\r
   to the caller of the UNDI API.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_GetState (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   CdbPtr->StatFlags = (PXE_STATFLAGS) (CdbPtr->StatFlags | AdapterInfo->State);\r
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Start (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to change the operational state of the UNDI from stopped to started.\r
   It will do this as long as the adapter's state is PXE_STATFLAGS_GET_STATE_STOPPED, otherwise\r
   the CdbPtr->StatFlags will reflect a command failure, and the CdbPtr->StatCode will reflect the\r
   UNDI as having already been started.\r
-\r
   This routine is modified to reflect the undi 1.1 specification changes. The\r
   changes in the spec are mainly in the callback routines, the new spec adds\r
   3 more callbacks and a unique id.\r
@@ -106,17 +87,20 @@ Routine Description:
   and Sync_Mem routines and a unique id variable for the new version.\r
   This is the function which an external entity (SNP, O/S, etc) would call\r
   to provide it's I/O abstraction to the UNDI.\r
-\r
   It's final action is to change the AdapterInfo->State to PXE_STATFLAGS_GET_STATE_STARTED.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Start (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_CPB_START_30  *CpbPtr;\r
   PXE_CPB_START_31  *CpbPtr_31;\r
@@ -187,31 +171,27 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Stop (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to change the operational state of the UNDI from started to stopped.\r
   It will not do this if the adapter's state is PXE_STATFLAGS_GET_STATE_INITIALIZED, otherwise\r
   the CdbPtr->StatFlags will reflect a command failure, and the CdbPtr->StatCode will reflect the\r
   UNDI as having already not been shut down.\r
-\r
   The NIC's data structure will have the Delay, Virt2Phys, and Block, pointers zero'd out..\r
-\r
   It's final action is to change the AdapterInfo->State to PXE_STATFLAGS_GET_STATE_STOPPED.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Stop (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   if (AdapterInfo->State == PXE_STATFLAGS_GET_STATE_INITIALIZED) {\r
     CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;\r
@@ -236,31 +216,27 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_GetInitInfo (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to retrieve the initialization information that is needed by drivers and\r
   applications to initialize the UNDI.  This will fill in data in the Data Block structure that is\r
   pointed to by the caller's CdbPtr->DBaddr.  The fields filled in are as follows:\r
-\r
   MemoryRequired, FrameDataLen, LinkSpeeds[0-3], NvCount, NvWidth, MediaHeaderLen, HWaddrLen,\r
   MCastFilterCnt, TxBufCnt, TxBufSize, RxBufCnt, RxBufSize, IFtype, Duplex, and LoopBack.\r
-\r
   In addition, the CdbPtr->StatFlags ORs in that this NIC supports cable detection.  (APRIORI knowledge)\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_GetInitInfo (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_DB_GET_INIT_INFO  *DbPtr;\r
 \r
@@ -292,30 +268,26 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_GetConfigInfo (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to retrieve the configuration information about the NIC being controlled by\r
   this driver.  This will fill in data in the Data Block structure that is pointed to by the caller's CdbPtr->DBaddr.\r
   The fields filled in are as follows:\r
-\r
   DbPtr->pci.BusType, DbPtr->pci.Bus, DbPtr->pci.Device, and DbPtr->pci.\r
-\r
   In addition, the DbPtr->pci.Config.Dword[0-63] grabs a copy of this NIC's PCI configuration space.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_GetConfigInfo (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT16                  Index;\r
   PXE_DB_GET_CONFIG_INFO  *DbPtr;\r
@@ -334,37 +306,32 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Initialize (\r
-  IN  PXE_CDB       *CdbPtr,\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine resets the network adapter and initializes the UNDI using the parameters supplied in\r
   the CPB.  This command must be issued before the network adapter can be setup to transmit and\r
   receive packets.\r
-\r
   Once the memory requirements of the UNDI are obtained by using the GetInitInfo command, a block\r
   of non-swappable memory may need to be allocated.  The address of this memory must be passed to\r
   UNDI during the Initialize in the CPB.  This memory is used primarily for transmit and receive buffers.\r
-\r
   The fields CableDetect, LinkSpeed, Duplex, LoopBack, MemoryPtr, and MemoryLength are set with information\r
   that was passed in the CPB and the NIC is initialized.\r
-\r
   If the NIC initialization fails, the CdbPtr->StatFlags are updated with PXE_STATFLAGS_COMMAND_FAILED\r
   Otherwise, AdapterInfo->State is updated with PXE_STATFLAGS_GET_STATE_INITIALIZED showing the state of\r
   the UNDI is now initialized.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Initialize (\r
+  IN  PXE_CDB       *CdbPtr,\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_CPB_INITIALIZE  *CpbPtr;\r
 \r
@@ -414,27 +381,24 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Reset (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine resets the network adapter and initializes the UNDI using the parameters supplied in\r
   the CPB.  The transmit and receive queues are emptied and any pending interrupts are cleared.\r
-\r
   If the NIC reset fails, the CdbPtr->StatFlags are updated with PXE_STATFLAGS_COMMAND_FAILED\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Reset (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   if (CdbPtr->OpFlags != PXE_OPFLAGS_NOT_USED &&\r
       CdbPtr->OpFlags != PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS &&\r
@@ -452,32 +416,28 @@ Returns:
   }\r
 }\r
 \r
-VOID\r
-UNDI_Shutdown (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine resets the network adapter and leaves it in a safe state for another driver to\r
   initialize.  Any pending transmits or receives are lost.  Receive filters and external\r
   interrupt enables are disabled.  Once the UNDI has been shutdown, it can then be stopped\r
   or initialized again.\r
-\r
   If the NIC reset fails, the CdbPtr->StatFlags are updated with PXE_STATFLAGS_COMMAND_FAILED\r
-\r
   Otherwise, AdapterInfo->State is updated with PXE_STATFLAGS_GET_STATE_STARTED showing the state of\r
   the NIC as being started.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Shutdown (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   //\r
   // do the shutdown stuff here\r
@@ -493,29 +453,26 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Interrupt (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine can be used to read and/or change the current external interrupt enable\r
   settings.  Disabling an external interrupt enable prevents and external (hardware)\r
   interrupt from being signaled by the network device.  Internally the interrupt events\r
   can still be polled by using the UNDI_GetState command.\r
-\r
   The resulting information on the interrupt state will be passed back in the CdbPtr->StatFlags.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Interrupt (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT8 IntMask;\r
 \r
@@ -573,25 +530,23 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_RecFilter (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to read and change receive filters and, if supported, read\r
   and change multicast MAC address filter list.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_RecFilter (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT16                  NewFilter;\r
   UINT16                  OpFlags;\r
@@ -753,25 +708,23 @@ BadCdb:
   CdbPtr->StatCode  = PXE_STATCODE_INVALID_CDB;\r
 }\r
 \r
-VOID\r
-UNDI_StnAddr (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to get the current station and broadcast MAC addresses, and to change the\r
   current station MAC address.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_StnAddr (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_CPB_STATION_ADDRESS *CpbPtr;\r
   PXE_DB_STATION_ADDRESS  *DbPtr;\r
@@ -822,17 +775,10 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Statistics (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to read and clear the NIC traffic statistics.  This command is supported only\r
   if the !PXE structure's Implementation flags say so.\r
-\r
   Results will be parsed out in the following manner:\r
   CdbPtr->DBaddr.Data[0]   R  Total Frames (Including frames with errors and dropped frames)\r
   CdbPtr->DBaddr.Data[1]   R  Good Frames (All frames copied into receive buffer)\r
@@ -845,14 +791,18 @@ Routine Description:
   CdbPtr->DBaddr.Data[E]   T  Dropped Frames (Frames that were dropped because of collisions)\r
   CdbPtr->DBaddr.Data[14]  T  Total Collision Frames (Total collisions on this subnet)\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Statistics (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   if ((CdbPtr->OpFlags &~(PXE_OPFLAGS_STATISTICS_RESET)) != 0) {\r
     CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;\r
@@ -872,27 +822,24 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_ip2mac (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to translate a multicast IP address to a multicast MAC address.\r
-\r
   This results in a MAC address composed of 25 bits of fixed data with the upper 23 bits of the IP\r
   address being appended to it.  Results passed back in the equivalent of CdbPtr->DBaddr->MAC[0-5].\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_ip2mac (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_CPB_MCAST_IP_TO_MAC *CpbPtr;\r
   PXE_DB_MCAST_IP_TO_MAC  *DbPtr;\r
@@ -934,27 +881,24 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_NVData (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to read and write non-volatile storage on the NIC (if supported).  The NVRAM\r
   could be EEPROM, FLASH, or battery backed RAM.\r
-\r
   This is an optional function according to the UNDI specification  (or will be......)\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_NVData (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_DB_NVDATA *DbPtr;\r
   UINT16        Index;\r
@@ -985,32 +929,28 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Status (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine returns the current interrupt status and/or the transmitted buffer addresses.\r
   If the current interrupt status is returned, pending interrupts will be acknowledged by this\r
   command.  Transmitted buffer addresses that are written to the DB are removed from the transmit\r
   buffer queue.\r
-\r
   Normally, this command would be polled with interrupts disabled.\r
-\r
   The transmit buffers are returned in CdbPtr->DBaddr->TxBufer[0 - NumEntries].\r
   The interrupt status is returned in CdbPtr->StatFlags.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Status (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_DB_GET_STATUS *DbPtr;\r
   PXE_DB_GET_STATUS TmpGetStatus;\r
@@ -1123,26 +1063,24 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_FillHeader (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to fill media header(s) in transmit packet(s).\r
   Copies the MAC address into the media header whether it is dealing\r
   with fragmented or non-fragmented packets.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_FillHeader (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   PXE_CPB_FILL_HEADER             *Cpb;\r
   PXE_CPB_FILL_HEADER_FRAGMENTED  *Cpbf;\r
@@ -1198,40 +1136,34 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Transmit (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine is used to place a packet into the transmit queue.  The data buffers given to\r
   this command are to be considered locked and the application or network driver loses\r
   ownership of these buffers and must not free or relocate them until the ownership returns.\r
-\r
   When the packets are transmitted, a transmit complete interrupt is generated (if interrupts\r
   are disabled, the transmit interrupt status is still set and can be checked using the UNDI_Status\r
   command.\r
-\r
   Some implementations and adapters support transmitting multiple packets with one transmit\r
   command.  If this feature is supported, the transmit CPBs can be linked in one transmit\r
   command.\r
-\r
   All UNDIs support fragmented frames, now all network devices or protocols do.  If a fragmented\r
   frame CPB is given to UNDI and the network device does not support fragmented frames\r
   (see !PXE.Implementation flag), the UNDI will have to copy the fragments into a local buffer\r
   before transmitting.\r
 \r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @return None\r
 \r
-Returns:\r
-  None\r
-\r
---*/\r
+**/\r
+VOID\r
+UNDI_Transmit (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
 \r
   if (CdbPtr->CPBsize == PXE_CPBSIZE_NOT_USED) {\r
@@ -1249,26 +1181,24 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_Receive (\r
-  IN  PXE_CDB           *CdbPtr,\r
-  IN  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   When the network adapter has received a frame, this command is used to copy the frame\r
   into the driver/application storage location.  Once a frame has been copied, it is\r
   removed from the receive queue.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+VOID\r
+UNDI_Receive (\r
+  IN  PXE_CDB           *CdbPtr,\r
+  IN  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
 \r
   //\r
@@ -1290,74 +1220,26 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-UNDI_APIEntry_old (\r
-  IN  UINT64 cdb\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  This is the main SW UNDI API entry using the older nii protocol.\r
+\r
+/**\r
+  This is the main SW UNDI API entry using the newer nii protocol.\r
   The parameter passed in is a 64 bit flat model virtual\r
   address of the cdb.  We then jump into the common routine for both old and\r
   new nii protocol entries.\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
 // TODO:    cdb - add argument and description to function comment\r
-{\r
-  PXE_CDB           *CdbPtr;\r
-  NIC_DATA_INSTANCE *AdapterInfo;\r
-\r
-  if (cdb == (UINT64) 0) {\r
-    return ;\r
-\r
-  }\r
-\r
-  CdbPtr = (PXE_CDB *) (UINTN) cdb;\r
-\r
-  if (CdbPtr->IFnum >= pxe->IFcnt) {\r
-    CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;\r
-    CdbPtr->StatCode  = PXE_STATCODE_INVALID_CDB;\r
-    return ;\r
-  }\r
-\r
-  AdapterInfo               = &(UNDI32DeviceList[CdbPtr->IFnum]->NicInfo);\r
-\r
-  //\r
-  // entering from older entry point\r
-  //\r
-  AdapterInfo->VersionFlag  = 0x30;\r
-  UNDI_APIEntry_Common (cdb);\r
-}\r
-\r
 VOID\r
 UNDI_APIEntry_new (\r
   IN  UINT64 cdb\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  This is the main SW UNDI API entry using the newer nii protocol.\r
-  The parameter passed in is a 64 bit flat model virtual\r
-  address of the cdb.  We then jump into the common routine for both old and\r
-  new nii protocol entries.\r
-\r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
-\r
-Returns:\r
-  None\r
-\r
---*/\r
-// TODO:    cdb - add argument and description to function comment\r
 {\r
   PXE_CDB           *CdbPtr;\r
   NIC_DATA_INSTANCE *AdapterInfo;\r
@@ -1383,27 +1265,25 @@ Returns:
   UNDI_APIEntry_Common (cdb);\r
 }\r
 \r
-VOID\r
-UNDI_APIEntry_Common (\r
-  IN  UINT64 cdb\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This is the common routine for both old and new entry point procedures.\r
   The parameter passed in is a 64 bit flat model virtual\r
   address of the cdb.  We then jump into the service routine pointed to by the\r
   Api_Table[OpCode].\r
 \r
-Arguments:\r
-  CdbPtr            - Pointer to the command descriptor block.\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  CdbPtr               Pointer to the command descriptor block.\r
+  @param  AdapterInfo          Pointer to the NIC data structure information which\r
+                               the UNDI driver is layering on..\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
 // TODO:    cdb - add argument and description to function comment\r
+VOID\r
+UNDI_APIEntry_Common (\r
+  IN  UINT64 cdb\r
+  )\r
 {\r
   PXE_CDB           *CdbPtr;\r
   NIC_DATA_INSTANCE *AdapterInfo;\r
@@ -1499,26 +1379,22 @@ badcdb:
   return ;\r
 }\r
 \r
-STATIC\r
-UINT8\r
-ChkSum (\r
-  IN  VOID   *Buffer,\r
-  IN  UINT16 Len\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This does an 8 bit check sum of the passed in buffer for Len bytes.\r
   This is primarily used to update the check sum in the SW UNDI header.\r
 \r
-Arguments:\r
-  Buffer            - Pointer to the passed in buffer to check sum\r
-  Len               - Length of buffer to be check summed in bytes.\r
+  @param  Buffer               Pointer to the passed in buffer to check sum\r
+  @param  Len                  Length of buffer to be check summed in bytes.\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
+UINT8\r
+ChkSum (\r
+  IN  VOID   *Buffer,\r
+  IN  UINT16 Len\r
+  )\r
 {\r
   UINT8 Chksum;\r
   INT8  *Bp;\r
@@ -1535,27 +1411,24 @@ Returns:
   return Chksum;\r
 }\r
 \r
-VOID\r
-PxeUpdate (\r
-  IN  NIC_DATA_INSTANCE *NicPtr,\r
-  IN PXE_SW_UNDI        *PxePtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   When called with a null NicPtr, this routine decrements the number of NICs\r
   this UNDI is supporting and removes the NIC_DATA_POINTER from the array.\r
   Otherwise, it increments the number of NICs this UNDI is supported and\r
   updates the pxe.Fudge to ensure a proper check sum results.\r
 \r
-Arguments:\r
-  NicPtr            - Pointer to the NIC data structure.\r
+  @param  NicPtr               Pointer to the NIC data structure.\r
 \r
-Returns:\r
-  None\r
+  @return None\r
 \r
---*/\r
+**/\r
 // TODO:    PxePtr - add argument and description to function comment\r
+VOID\r
+PxeUpdate (\r
+  IN  NIC_DATA_INSTANCE *NicPtr,\r
+  IN PXE_SW_UNDI        *PxePtr\r
+  )\r
 {\r
   if (NicPtr == NULL) {\r
     if (PxePtr->IFcnt > 0) {\r
@@ -1578,26 +1451,22 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-PxeStructInit (\r
-  IN PXE_SW_UNDI *PxePtr,\r
-  IN UINTN       VersionFlag\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Initialize the !PXE structure\r
 \r
-Arguments:\r
-  RemainingDevicePath - Not used, always produce all possible children.\r
+  @param  RemainingDevicePath  Not used, always produce all possible children.\r
 \r
-Returns:\r
-  EFI_SUCCESS         - This driver is added to Controller.\r
-  other               - This driver does not support this device.\r
+  @retval EFI_SUCCESS          This driver is added to Controller.\r
+  @retval other                This driver does not support this device.\r
 \r
---*/\r
+**/\r
 // TODO:    PxePtr - add argument and description to function comment\r
 // TODO:    VersionFlag - add argument and description to function comment\r
+VOID\r
+PxeStructInit (\r
+  IN PXE_SW_UNDI *PxePtr\r
+  )\r
 {\r
   //\r
   // Initialize the !PXE structure\r
@@ -1629,12 +1498,8 @@ Returns:
     PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED |\r
     PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED;\r
 \r
-  if (VersionFlag == 0x30) {\r
-    PxePtr->EntryPoint = (UINT64) UNDI_APIEntry_old;\r
-  } else {\r
-    PxePtr->EntryPoint  = (UINT64) UNDI_APIEntry_new;\r
-    PxePtr->MinorVer    = PXE_ROMID_MINORVER_31;\r
-  }\r
+  PxePtr->EntryPoint  = (UINT64) (UINTN) UNDI_APIEntry_new;\r
+  PxePtr->MinorVer    = PXE_ROMID_MINORVER_31;\r
 \r
   PxePtr->reserved2[0]  = 0;\r
   PxePtr->reserved2[1]  = 0;\r