]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/UndiRuntimeDxe/E100b.c
add UndiRuntimeDxe from MdeModulePkg to OptionRomPkg.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UndiRuntimeDxe / E100b.c
index d425778e06f3ca684230db47e094188f19a11497..c0600c5e5ae203502ecdc04a8d507dcfcf600855 100644 (file)
@@ -1,29 +1,20 @@
-/*++\r
-\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
-  \r
-  \r
- E100B.C\r
+/** @file\r
+  Provides basic function upon network adapter card.\r
 \r
-Abstract:\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
-Revision History\r
-\r
---*/\r
+**/\r
 \r
 #include "Undi32.h"\r
 \r
-static UINT8 basic_config_cmd[22] = {\r
+UINT8 basic_config_cmd[22] = {\r
                     22,        0x08,\r
                     0,           0,\r
                     0, (UINT8)0x80,\r
@@ -33,7 +24,7 @@ static UINT8 basic_config_cmd[22] = {
                     0x60,           0,\r
                     (UINT8)0xf2,        0x48,\r
                     0,        0x40,\r
-                    (UINT8)0xf2, (UINT8)0x80, // 0x40=Force full-duplex \r
+                    (UINT8)0xf2, (UINT8)0x80, // 0x40=Force full-duplex\r
                     0x3f,       0x05,\r
 };\r
 \r
@@ -50,63 +41,57 @@ static UINT8 basic_config_cmd[22] = {
     DelayIt (AdapterInfo, 50);    \\r
 }\r
 \r
-UINT8\r
-InByte (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT32            Port\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This function calls the MemIo callback to read a byte from the device's\r
   address space\r
   Since UNDI3.0 uses the TmpMemIo function (instead of the callback routine)\r
-  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have \r
+  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have\r
   to make undi3.0 a special case\r
-  \r
-Arguments:\r
-  Port              - Which port to read from.\r
 \r
-Returns:\r
-  Results           - The data read from the port.\r
+  @param  Port                            Which port to read from.\r
 \r
---*/\r
+  @retval Results                         The data read from the port.\r
+\r
+**/\r
 // TODO:    AdapterInfo - add argument and description to function comment\r
+UINT8\r
+InByte (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT32            Port\r
+  )\r
 {\r
   UINT8 Results;\r
 \r
   (*AdapterInfo->Mem_Io) (\r
-    AdapterInfo->Unique_ID, \r
-    PXE_MEM_READ, \r
-    1, \r
+    AdapterInfo->Unique_ID,\r
+    PXE_MEM_READ,\r
+    1,\r
     (UINT64)Port,\r
     (UINT64) (UINTN) &Results\r
     );\r
   return Results;\r
 }\r
 \r
-UINT16\r
-InWord (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT32            Port\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This function calls the MemIo callback to read a word from the device's\r
   address space\r
   Since UNDI3.0 uses the TmpMemIo function (instead of the callback routine)\r
-  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have \r
+  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have\r
   to make undi3.0 a special case\r
 \r
-Arguments:\r
-  Port              - Which port to read from.\r
+  @param  Port                            Which port to read from.\r
 \r
-Returns:\r
-  Results           - The data read from the port.\r
+  @retval Results                         The data read from the port.\r
 \r
---*/\r
+**/\r
 // TODO:    AdapterInfo - add argument and description to function comment\r
+UINT16\r
+InWord (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT32            Port\r
+  )\r
 {\r
   UINT16  Results;\r
 \r
@@ -120,28 +105,25 @@ Returns:
   return Results;\r
 }\r
 \r
-UINT32\r
-InLong (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT32            Port\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This function calls the MemIo callback to read a dword from the device's\r
   address space\r
   Since UNDI3.0 uses the TmpMemIo function (instead of the callback routine)\r
-  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have \r
+  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have\r
   to make undi3.0 a special case\r
 \r
-Arguments:\r
-  Port              - Which port to read from.\r
+  @param  Port                            Which port to read from.\r
 \r
-Returns:\r
-  Results           - The data read from the port.\r
+  @retval Results                         The data read from the port.\r
 \r
---*/\r
+**/\r
 // TODO:    AdapterInfo - add argument and description to function comment\r
+UINT32\r
+InLong (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT32            Port\r
+  )\r
 {\r
   UINT32  Results;\r
 \r
@@ -155,30 +137,27 @@ Returns:
   return Results;\r
 }\r
 \r
-VOID\r
-OutByte (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT8             Data,\r
-  IN UINT32            Port\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This function calls the MemIo callback to write a byte from the device's\r
   address space\r
   Since UNDI3.0 uses the TmpMemIo function (instead of the callback routine)\r
-  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have \r
+  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have\r
   to make undi3.0 a special case\r
 \r
-Arguments:\r
-  Data              - Data to write to Port.\r
-  Port              - Which port to write to.\r
+  @param  Data                            Data to write to Port.\r
+  @param  Port                            Which port to write to.\r
 \r
-Returns:\r
-  none\r
+  @return none\r
 \r
---*/\r
+**/\r
 // TODO:    AdapterInfo - add argument and description to function comment\r
+VOID\r
+OutByte (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT8             Data,\r
+  IN UINT32            Port\r
+  )\r
 {\r
   UINT8 Val;\r
 \r
@@ -193,30 +172,27 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-OutWord (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT16            Data,\r
-  IN UINT32            Port\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This function calls the MemIo callback to write a word from the device's\r
   address space\r
   Since UNDI3.0 uses the TmpMemIo function (instead of the callback routine)\r
-  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have \r
+  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have\r
   to make undi3.0 a special case\r
 \r
-Arguments:\r
-  Data              - Data to write to Port.\r
-  Port              - Which port to write to.\r
+  @param  Data                            Data to write to Port.\r
+  @param  Port                            Which port to write to.\r
 \r
-Returns:\r
-  none\r
+  @return none\r
 \r
---*/\r
+**/\r
 // TODO:    AdapterInfo - add argument and description to function comment\r
+VOID\r
+OutWord (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT16            Data,\r
+  IN UINT32            Port\r
+  )\r
 {\r
   UINT16  Val;\r
 \r
@@ -231,30 +207,27 @@ Returns:
   return ;\r
 }\r
 \r
-VOID\r
-OutLong (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT32            Data,\r
-  IN UINT32            Port\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This function calls the MemIo callback to write a dword from the device's\r
   address space\r
   Since UNDI3.0 uses the TmpMemIo function (instead of the callback routine)\r
-  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have \r
+  which also takes the UniqueId parameter (as in UNDI3.1 spec) we don't have\r
   to make undi3.0 a special case\r
 \r
-Arguments:\r
-  Data              - Data to write to Port.\r
-  Port              - Which port to write to.\r
+  @param  Data                            Data to write to Port.\r
+  @param  Port                            Which port to write to.\r
 \r
-Returns:\r
-  none\r
+  @return none\r
 \r
---*/\r
+**/\r
 // TODO:    AdapterInfo - add argument and description to function comment\r
+VOID\r
+OutLong (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT32            Data,\r
+  IN UINT32            Port\r
+  )\r
 {\r
   UINT32  Val;\r
 \r
@@ -269,7 +242,19 @@ Returns:
   return ;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  TODO: Add function description\r
+\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  MemAddr                         TODO: add argument description\r
+  @param  Size                            TODO: add argument description\r
+  @param  Direction                       TODO: add argument description\r
+  @param  MappedAddr                      TODO: add argument description\r
+\r
+  @return TODO: add return values\r
+\r
+**/\r
 UINTN\r
 MapIt (\r
   IN NIC_DATA_INSTANCE *AdapterInfo,\r
@@ -278,25 +263,6 @@ MapIt (
   IN UINT32            Direction,\r
   OUT UINT64           MappedAddr\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  MemAddr     - TODO: add argument description\r
-  Size        - TODO: add argument description\r
-  Direction   - TODO: add argument description\r
-  MappedAddr  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
 {\r
   UINT64  *PhyAddr;\r
 \r
@@ -338,7 +304,19 @@ Returns:
   return PXE_STATCODE_SUCCESS;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  TODO: Add function description\r
+\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  MemAddr                         TODO: add argument description\r
+  @param  Size                            TODO: add argument description\r
+  @param  Direction                       TODO: add argument description\r
+  @param  MappedAddr                      TODO: add argument description\r
+\r
+  @return TODO: add return values\r
+\r
+**/\r
 VOID\r
 UnMapIt (\r
   IN NIC_DATA_INSTANCE *AdapterInfo,\r
@@ -347,25 +325,6 @@ UnMapIt (
   IN UINT32            Direction,\r
   IN UINT64            MappedAddr\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  MemAddr     - TODO: add argument description\r
-  Size        - TODO: add argument description\r
-  Direction   - TODO: add argument description\r
-  MappedAddr  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
 {\r
   if (AdapterInfo->VersionFlag > 0x30) {\r
     //\r
@@ -386,24 +345,21 @@ Returns:
   return ;\r
 }\r
 \r
-STATIC\r
-VOID\r
-DelayIt (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  UINT16               MicroSeconds\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
 \r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
 \r
-Returns:\r
 \r
---*/\r
+**/\r
 // TODO:    MicroSeconds - add argument and description to function comment\r
+VOID\r
+DelayIt (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  UINT16               MicroSeconds\r
+  )\r
 {\r
   if (AdapterInfo->VersionFlag == 0x30) {\r
     (*AdapterInfo->Delay_30) (MicroSeconds);\r
@@ -412,24 +368,21 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-VOID\r
-BlockIt (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  UINT32               flag\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
 \r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
 \r
-Returns:\r
 \r
---*/\r
+**/\r
 // TODO:    flag - add argument and description to function comment\r
+VOID\r
+BlockIt (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  UINT32               flag\r
+  )\r
 {\r
   if (AdapterInfo->VersionFlag == 0x30) {\r
     (*AdapterInfo->Block_30) (flag);\r
@@ -438,26 +391,19 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-UINT8\r
-Load_Base_Regs (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-Returns:\r
+  @return TODO: add return values\r
 \r
-  TODO: add return values\r
-\r
---*/\r
+**/\r
+UINT8\r
+Load_Base_Regs (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   //\r
   // we will use the linear (flat) memory model and fill our base registers\r
@@ -488,28 +434,21 @@ Returns:
   return 0;\r
 }\r
 \r
-STATIC\r
-UINT8\r
-IssueCB (\r
-  NIC_DATA_INSTANCE *AdapterInfo,\r
-  TxCB              *cmd_ptr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  cmd_ptr                         TODO: add argument description\r
 \r
-  AdapterInfo - TODO: add argument description\r
-  cmd_ptr     - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT8\r
+IssueCB (\r
+  NIC_DATA_INSTANCE *AdapterInfo,\r
+  TxCB              *cmd_ptr\r
+  )\r
 {\r
   UINT16  status;\r
 \r
@@ -555,26 +494,19 @@ Returns:
   return 0;\r
 }\r
 \r
-STATIC\r
-UINT8\r
-Configure (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @return TODO: add return values\r
 \r
-  TODO: add return values\r
-\r
---*/\r
+**/\r
+UINT8\r
+Configure (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   //\r
   // all command blocks are of TxCB format\r
@@ -595,7 +527,7 @@ Returns:
   }\r
 \r
   my_filter = (UINT8) ((AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS) ? 1 : 0);\r
-  my_filter = (UINT8) ((my_filter | (AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST) ? 0 : 2));\r
+  my_filter = (UINT8) (my_filter | ((AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST) ? 0 : 2));\r
 \r
   data_ptr[15]  = (UINT8) (data_ptr[15] | my_filter);\r
   data_ptr[19]  = (UINT8) (AdapterInfo->Duplex ? 0xC0 : 0x80);\r
@@ -632,25 +564,19 @@ Returns:
   return 0;\r
 }\r
 \r
-UINT8\r
-E100bSetupIAAddr (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT8\r
+E100bSetupIAAddr (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   //\r
   // all command blocks are of TxCB format\r
@@ -693,22 +619,20 @@ Returns:
   return 0;\r
 }\r
 \r
-STATIC\r
-VOID\r
-StopRU (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Instructs the NIC to stop receiving packets.\r
 \r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
-Returns:\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
 \r
---*/\r
+\r
+**/\r
+VOID\r
+StopRU (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   if (AdapterInfo->Receive_Started) {\r
 \r
@@ -729,23 +653,22 @@ Returns:
   return ;\r
 }\r
 \r
-STATIC\r
+\r
+/**\r
+  Instructs the NIC to start receiving packets.\r
+\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
+\r
+  @retval 0                               Successful\r
+  @retval -1                              Already Started\r
+\r
+**/\r
 INT8\r
 StartRU (\r
   NIC_DATA_INSTANCE *AdapterInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Instructs the NIC to start receiving packets.\r
-\r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
-Returns:\r
-  0                               - Successful\r
-  -1                              - Already Started\r
---*/\r
 {\r
 \r
   if (AdapterInfo->Receive_Started) {\r
@@ -769,24 +692,23 @@ Returns:
   return 0;\r
 }\r
 \r
+\r
+/**\r
+  Configures the chip.  This routine expects the NIC_DATA_INSTANCE structure to be filled in.\r
+\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
+\r
+  @retval 0                               Successful\r
+  @retval PXE_STATCODE_NOT_ENOUGH_MEMORY  Insufficient length of locked memory\r
+  @retval other                           Failure initializing chip\r
+\r
+**/\r
 UINTN\r
 E100bInit (\r
   IN NIC_DATA_INSTANCE *AdapterInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Configures the chip.  This routine expects the NIC_DATA_INSTANCE structure to be filled in.\r
-\r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
-\r
-Returns:\r
-  0                               - Successful\r
-  PXE_STATCODE_NOT_ENOUGH_MEMORY  - Insufficient length of locked memory\r
-  other                           - Failure initializing chip\r
---*/\r
 {\r
   PCI_CONFIG_HEADER *CfgHdr;\r
   UINTN             stat;\r
@@ -854,7 +776,7 @@ Returns:
   AdapterInfo->rx_phy_addr    = AdapterInfo->Mapped_MemoryPtr;\r
   AdapterInfo->tx_phy_addr    = AdapterInfo->Mapped_MemoryPtr + rx_size;\r
   AdapterInfo->stat_phy_addr  = AdapterInfo->tx_phy_addr + tx_size;\r
-  \r
+\r
   //\r
   // auto detect.\r
   //\r
@@ -865,21 +787,21 @@ Returns:
   return InitializeChip (AdapterInfo);\r
 }\r
 \r
+\r
+/**\r
+  Sets the interrupt state for the NIC.\r
+\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
+\r
+  @retval 0                               Successful\r
+\r
+**/\r
 UINT8\r
 E100bSetInterruptState (\r
   IN NIC_DATA_INSTANCE *AdapterInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Sets the interrupt state for the NIC.\r
-\r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
-Returns:\r
-  0                               - Successful\r
---*/\r
 {\r
   //\r
   // don't set receive interrupt if receiver is disabled...\r
@@ -912,6 +834,20 @@ Returns:
 //\r
 // we are not going to disable broadcast for the WOL's sake!\r
 //\r
+\r
+/**\r
+  Instructs the NIC to start receiving packets.\r
+\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on.. new_filter\r
+                                              - cpb                             -\r
+                                          cpbsize                         -\r
+\r
+  @retval 0                               Successful\r
+  @retval -1                              Already Started\r
+\r
+**/\r
 UINTN\r
 E100bSetfilter (\r
   NIC_DATA_INSTANCE *AdapterInfo,\r
@@ -919,22 +855,6 @@ E100bSetfilter (
   UINT64            cpb,\r
   UINT32            cpbsize\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Instructs the NIC to start receiving packets.\r
-\r
-Arguments:\r
-  AdapterInfo                     - Pointer to the NIC data structure information\r
-                                    which the UNDI driver is layering on..\r
-  new_filter                      -\r
-  cpb                             -\r
-  cpbsize                         -\r
-\r
-Returns:\r
-  0                               - Successful\r
-  -1                              - Already Started\r
---*/\r
 {\r
   PXE_CPB_RECEIVE_FILTERS *mc_list = (PXE_CPB_RECEIVE_FILTERS *) (UINTN)cpb;\r
   UINT16                  cfg_flt;\r
@@ -1074,29 +994,23 @@ Returns:
   return 0;\r
 }\r
 \r
+\r
+/**\r
+  TODO: Add function description\r
+\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  cpb                             TODO: add argument description\r
+  @param  opflags                         TODO: add argument description\r
+\r
+  @return TODO: add return values\r
+\r
+**/\r
 UINTN\r
 E100bTransmit (\r
   NIC_DATA_INSTANCE *AdapterInfo,\r
   UINT64            cpb,\r
   UINT16            opflags\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  cpb         - TODO: add argument description\r
-  opflags     - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
 {\r
   PXE_CPB_TRANSMIT_FRAGMENTS  *tx_ptr_f;\r
   PXE_CPB_TRANSMIT            *tx_ptr_1;\r
@@ -1262,29 +1176,23 @@ Returns:
   return 0;\r
 }\r
 \r
+\r
+/**\r
+  TODO: Add function description\r
+\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  cpb                             TODO: add argument description\r
+  @param  db                              TODO: add argument description\r
+\r
+  @return TODO: add return values\r
+\r
+**/\r
 UINTN\r
 E100bReceive (\r
   NIC_DATA_INSTANCE *AdapterInfo,\r
   UINT64            cpb,\r
   UINT64            db\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  cpb         - TODO: add argument description\r
-  db          - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
 {\r
   PXE_CPB_RECEIVE *rx_cpbptr;\r
   PXE_DB_RECEIVE  *rx_dbptr;\r
@@ -1392,7 +1300,7 @@ Returns:
             // mcast\r
             //\r
 \r
-            pkt_type = PXE_FRAME_TYPE_MULTICAST;\r
+            pkt_type = PXE_FRAME_TYPE_FILTERED_MULTICAST;\r
           } else {\r
             pkt_type = PXE_FRAME_TYPE_PROMISCUOUS;\r
           }\r
@@ -1449,25 +1357,19 @@ FreeRFD:
   return ret_code;\r
 }\r
 \r
-INT16\r
-E100bReadEepromAndStationAddress (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+INT16\r
+E100bReadEepromAndStationAddress (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   INT32   Index;\r
   INT32   Index2;\r
@@ -1524,25 +1426,19 @@ Returns:
 //  3) when one is free, Tail == Head and Freecount == 1\r
 //  4) First non-Free frame is always at Tail->next\r
 //\r
-UINT8\r
-SetupCBlink (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT8\r
+SetupCBlink (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   TxCB  *head_ptr;\r
   TxCB  *tail_ptr;\r
@@ -1559,7 +1455,7 @@ Returns:
     cur_ptr[Index].PhysTCBAddress     =\r
     (UINT32) AdapterInfo->tx_phy_addr + (Index * sizeof (TxCB));\r
 \r
-    cur_ptr[Index].PhysArrayAddr      = (UINT32)(cur_ptr[Index].PhysTCBAddress + array_off);  \r
+    cur_ptr[Index].PhysArrayAddr      = (UINT32)(cur_ptr[Index].PhysTCBAddress + array_off);\r
     cur_ptr[Index].PhysTBDArrayAddres = (UINT32)(cur_ptr[Index].PhysTCBAddress + array_off);\r
 \r
     cur_ptr->free_data_ptr = (UINT64) 0;\r
@@ -1590,25 +1486,19 @@ Returns:
   return 0;\r
 }\r
 \r
-TxCB *\r
-GetFreeCB (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+TxCB *\r
+GetFreeCB (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   TxCB  *free_cb_ptr;\r
 \r
@@ -1637,27 +1527,21 @@ Returns:
   return free_cb_ptr;\r
 }\r
 \r
-VOID\r
-SetFreeCB (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN TxCB              *cb_ptr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  cb_ptr      - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  cb_ptr                          TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+VOID\r
+SetFreeCB (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN TxCB              *cb_ptr\r
+  )\r
 {\r
   //\r
   // here we assume cb are returned in the order they are taken out\r
@@ -1671,25 +1555,19 @@ Returns:
   return ;\r
 }\r
 \r
-UINT16\r
-next (\r
-  IN UINT16 ind\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  ind - TODO: add argument description\r
-\r
-Returns:\r
+  @param  ind                             TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT16\r
+next (\r
+  IN UINT16 ind\r
+  )\r
 {\r
   UINT16  Tmp;\r
 \r
@@ -1701,25 +1579,19 @@ Returns:
   return Tmp;\r
 }\r
 \r
-UINT16\r
-CheckCBList (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT16\r
+CheckCBList (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   TxCB    *Tmp_ptr;\r
   UINT16  cnt;\r
@@ -1762,25 +1634,19 @@ Returns:
 //               bit in the previous RXFD is cleared.\r
 //               Allocation done during INIT, this is making linked list.\r
 //\r
-UINT8\r
-SetupReceiveQueues (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT8\r
+SetupReceiveQueues (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   RxFD    *rx_ptr;\r
   RxFD    *tail_ptr;\r
@@ -1823,27 +1689,21 @@ Returns:
   return 0;\r
 }\r
 \r
-VOID\r
-Recycle_RFD (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN UINT16            rx_index\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  rx_index    - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  rx_index                        TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+VOID\r
+Recycle_RFD (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN UINT16            rx_index\r
+  )\r
 {\r
   RxFD  *rx_ptr;\r
   RxFD  *tail_ptr;\r
@@ -1897,7 +1757,6 @@ Returns:
 #define EE_READ_CMD   6 // 110b\r
 #define EE_ERASE_CMD  (7 << 6)\r
 \r
-STATIC\r
 VOID\r
 shift_bits_out (\r
   IN NIC_DATA_INSTANCE *AdapterInfo,\r
@@ -1956,26 +1815,19 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-UINT16\r
-shift_bits_in (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT16\r
+shift_bits_in (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT8   Tmp;\r
   INT32   Index;\r
@@ -2008,31 +1860,29 @@ Returns:
   return retval;\r
 }\r
 \r
-STATIC\r
-BOOLEAN\r
-E100bSetEepromLockOut (\r
-  IN NIC_DATA_INSTANCE  *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine sets the EEPROM lockout bit to gain exclusive access to the\r
   eeprom. the access bit is the most significant bit in the General Control\r
   Register 2 in the SCB space.\r
 \r
-Arguments:\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
 \r
-Returns:\r
-  TRUE - if it got the access\r
-  FALSE - if it fails to get the exclusive access\r
+  @retval TRUE                            if it got the access\r
+  @retval FALSE                           if it fails to get the exclusive access\r
 \r
---*/\r
+**/\r
+BOOLEAN\r
+E100bSetEepromLockOut (\r
+  IN NIC_DATA_INSTANCE  *AdapterInfo\r
+  )\r
 {\r
   UINTN wait;\r
   UINT8 tmp;\r
 \r
-  if ((AdapterInfo->DeviceID == D102_DEVICE_ID) || \r
+  if ((AdapterInfo->DeviceID == D102_DEVICE_ID) ||\r
       (AdapterInfo->RevID >= D102_REVID)) {\r
 \r
     wait = 500;\r
@@ -2057,29 +1907,27 @@ Returns:
   return TRUE;\r
 }\r
 \r
-STATIC\r
-VOID\r
-E100bReSetEepromLockOut (\r
-  IN NIC_DATA_INSTANCE  *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   This routine Resets the EEPROM lockout bit to giveup access to the\r
   eeprom. the access bit is the most significant bit in the General Control\r
   Register 2 in the SCB space.\r
 \r
-Arguments:\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
 \r
-Returns:\r
- None\r
\r
---*/\r
+  @return None\r
+\r
+**/\r
+VOID\r
+E100bReSetEepromLockOut (\r
+  IN NIC_DATA_INSTANCE  *AdapterInfo\r
+  )\r
 {\r
   UINT8 tmp;\r
 \r
-  if ((AdapterInfo->DeviceID == D102_DEVICE_ID) || \r
+  if ((AdapterInfo->DeviceID == D102_DEVICE_ID) ||\r
       (AdapterInfo->RevID >= D102_REVID)) {\r
 \r
     tmp = InByte (AdapterInfo, AdapterInfo->ioaddr + SCBGenCtrl2);\r
@@ -2090,26 +1938,25 @@ Returns:
   }\r
 }\r
 \r
+\r
+/**\r
+  Using the NIC data structure information, read the EEPROM to get a Word of data for the MAC address.\r
+\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
+  @param  Location                        Word offset into the MAC address to read.\r
+  @param  AddrLen                         Number of bits of address length.\r
+\r
+  @retval RetVal                          The word read from the EEPROM.\r
+\r
+**/\r
 UINT16\r
 E100bReadEeprom (\r
   IN NIC_DATA_INSTANCE  *AdapterInfo,\r
   IN INT32              Location,\r
   IN UINT8              AddrLen\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Using the NIC data structure information, read the EEPROM to get a Word of data for the MAC address.\r
-\r
-Arguments:\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
-  Location          - Word offset into the MAC address to read.\r
-  AddrLen           - Number of bits of address length.\r
-\r
-Returns:\r
-  RetVal            - The word read from the EEPROM.\r
-\r
---*/\r
 {\r
   UINT16  RetVal;\r
   UINT8   Tmp;\r
@@ -2174,23 +2021,22 @@ Returns:
   return RetVal;\r
 }\r
 \r
-UINT8\r
-E100bGetEepromAddrLen (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Using the NIC data structure information, read the EEPROM to determine how many bits of address length\r
   this EEPROM is in Words.\r
 \r
-Arguments:\r
-  AdapterInfo       - Pointer to the NIC data structure information which the UNDI driver is layering on..\r
+  @param  AdapterInfo                     Pointer to the NIC data structure\r
+                                          information which the UNDI driver is\r
+                                          layering on..\r
 \r
-Returns:\r
-  RetVal            - The word read from the EEPROM.\r
+  @retval RetVal                          The word read from the EEPROM.\r
 \r
---*/\r
+**/\r
+UINT8\r
+E100bGetEepromAddrLen (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT8   Tmp;\r
   UINT8   AddrLen;\r
@@ -2286,29 +2132,23 @@ Returns:
   return AddrLen;\r
 }\r
 \r
+\r
+/**\r
+  TODO: Add function description\r
+\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  DBaddr                          TODO: add argument description\r
+  @param  DBsize                          TODO: add argument description\r
+\r
+  @return TODO: add return values\r
+\r
+**/\r
 UINTN\r
 E100bStatistics (\r
   NIC_DATA_INSTANCE *AdapterInfo,\r
   UINT64            DBaddr,\r
   UINT16            DBsize\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  DBaddr      - TODO: add argument description\r
-  DBsize      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
 {\r
   PXE_DB_STATISTICS db;\r
   //\r
@@ -2396,7 +2236,7 @@ Returns:
   db.Data[0x08] = AdapterInfo->statistics->rx_crc_errs +\r
                   AdapterInfo->statistics->rx_align_errs;\r
 \r
-  db.Data[0x04] = db.Data[0x02] + \r
+  db.Data[0x04] = db.Data[0x02] +\r
                   db.Data[0x08] +\r
                   AdapterInfo->statistics->rx_resource_errs +\r
                   AdapterInfo->statistics->rx_overrun_errs;\r
@@ -2426,27 +2266,21 @@ Returns:
   return PXE_STATCODE_SUCCESS;\r
 }\r
 \r
-UINTN\r
-E100bReset (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo,\r
-  IN INT32             OpFlags\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-  OpFlags     - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
+  @param  OpFlags                         TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINTN\r
+E100bReset (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo,\r
+  IN INT32             OpFlags\r
+  )\r
 {\r
 \r
   UINT16  save_filter;\r
@@ -2497,25 +2331,19 @@ Returns:
   return 0;\r
 }\r
 \r
-UINTN\r
-E100bShutdown (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINTN\r
+E100bShutdown (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   //\r
   // disable the interrupts\r
@@ -2546,6 +2374,22 @@ Returns:
   return 0;\r
 }\r
 \r
+\r
+/**\r
+  This routine will write a value to the specified MII register\r
+  of an external MDI compliant device (e.g. PHY 100).  The command will\r
+  execute in polled mode.\r
+\r
+  @param  AdapterInfo                     pointer to the structure that contains\r
+                                          the NIC's context.\r
+  @param  RegAddress                      The MII register that we are writing to\r
+  @param  PhyAddress                      The MDI address of the Phy component.\r
+  @param  DataValue                       The value that we are writing to the MII\r
+                                          register.\r
+\r
+  @return nothing\r
+\r
+**/\r
 VOID\r
 MdiWrite (\r
   IN NIC_DATA_INSTANCE *AdapterInfo,\r
@@ -2553,27 +2397,11 @@ MdiWrite (
   IN UINT8             PhyAddress,\r
   IN UINT16            DataValue\r
   )\r
-/*++\r
-\r
-Routine Description:\r
- This routine will write a value to the specified MII register\r
- of an external MDI compliant device (e.g. PHY 100).  The command will \r
- execute in polled mode.\r
\r
-Arguments:\r
-  AdapterInfo - pointer to the structure that contains the NIC's context.\r
-  RegAddress - The MII register that we are writing to\r
-  PhyAddress - The MDI address of the Phy component.\r
-  DataValue - The value that we are writing to the MII register.\r
-\r
-Returns:\r
- nothing  \r
---*/\r
 {\r
   UINT32  WriteCommand;\r
 \r
   WriteCommand = ((UINT32) DataValue) |\r
-                 ((UINT32)(RegAddress << 16)) | \r
+                 ((UINT32)(RegAddress << 16)) |\r
                  ((UINT32)(PhyAddress << 21)) |\r
                  ((UINT32)(MDI_WRITE << 26));\r
 \r
@@ -2589,12 +2417,27 @@ Returns:
 \r
   //\r
   // poll for the mdi write to complete\r
-  while ((InLong (AdapterInfo, AdapterInfo->ioaddr + SCBCtrlMDI) & \r
+  while ((InLong (AdapterInfo, AdapterInfo->ioaddr + SCBCtrlMDI) &\r
                     MDI_PHY_READY) == 0){\r
     DelayIt (AdapterInfo, 20);\r
   }\r
 }\r
 \r
+\r
+/**\r
+  This routine will read a value from the specified MII register\r
+  of an external MDI compliant device (e.g. PHY 100), and return\r
+  it to the calling routine.  The command will execute in polled mode.\r
+\r
+  @param  AdapterInfo                     pointer to the structure that contains\r
+                                          the NIC's context.\r
+  @param  RegAddress                      The MII register that we are reading from\r
+  @param  PhyAddress                      The MDI address of the Phy component.\r
+  @param  DataValue                       pointer to the value that we read from\r
+                                          the MII register.\r
+\r
+\r
+**/\r
 VOID\r
 MdiRead (\r
   IN NIC_DATA_INSTANCE *AdapterInfo,\r
@@ -2602,22 +2445,6 @@ MdiRead (
   IN UINT8             PhyAddress,\r
   IN OUT UINT16        *DataValue\r
   )\r
-/*++\r
-\r
-Routine Description:\r
- This routine will read a value from the specified MII register\r
- of an external MDI compliant device (e.g. PHY 100), and return\r
- it to the calling routine.  The command will execute in polled mode.\r
\r
-Arguments:\r
- AdapterInfo - pointer to the structure that contains the NIC's context.\r
- RegAddress - The MII register that we are reading from\r
- PhyAddress - The MDI address of the Phy component.\r
- DataValue - pointer to the value that we read from the MII register.\r
-\r
-Returns:\r
-  \r
---*/\r
 {\r
   UINT32  ReadCommand;\r
 \r
@@ -2647,27 +2474,25 @@ Returns:
   *DataValue = InWord (AdapterInfo, AdapterInfo->ioaddr + SCBCtrlMDI);\r
 }\r
 \r
+\r
+/**\r
+  This routine will reset the PHY that the adapter is currently\r
+  configured to use.\r
+\r
+  @param  AdapterInfo                     pointer to the structure that contains\r
+                                          the NIC's context.\r
+\r
+\r
+**/\r
 VOID\r
 PhyReset (\r
   NIC_DATA_INSTANCE *AdapterInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
- This routine will reset the PHY that the adapter is currently\r
- configured to use. \r
\r
-Arguments:\r
-  AdapterInfo - pointer to the structure that contains the NIC's context.\r
-\r
-Returns:\r
-  \r
---*/\r
 {\r
   UINT16  MdiControlReg;\r
 \r
-  MdiControlReg = (MDI_CR_AUTO_SELECT | \r
-                  MDI_CR_RESTART_AUTO_NEG | \r
+  MdiControlReg = (MDI_CR_AUTO_SELECT |\r
+                  MDI_CR_RESTART_AUTO_NEG |\r
                   MDI_CR_RESET);\r
 \r
   //\r
@@ -2683,53 +2508,49 @@ Returns:
   return ;\r
 }\r
 \r
+\r
+/**\r
+  This routine will detect what phy we are using, set the line\r
+  speed, FDX or HDX, and configure the phy if necessary.\r
+  The following combinations are supported:\r
+  - TX or T4 PHY alone at PHY address 1\r
+  - T4 or TX PHY at address 1 and MII PHY at address 0\r
+  - 82503 alone (10Base-T mode, no full duplex support)\r
+  - 82503 and MII PHY (TX or T4) at address 0\r
+  The sequence / priority of detection is as follows:\r
+  - PHY 1 with cable termination\r
+  - PHY 0 with cable termination\r
+  - PHY 1 (if found) without cable termination\r
+  - 503 interface\r
+  Additionally auto-negotiation capable (NWAY) and parallel\r
+  detection PHYs are supported. The flow-chart is described in\r
+  the 82557 software writer's manual.\r
+  NOTE:  1.  All PHY MDI registers are read in polled mode.\r
+  2.  The routines assume that the 82557 has been RESET and we have\r
+  obtained the virtual memory address of the CSR.\r
+  3.  PhyDetect will not RESET the PHY.\r
+  4.  If FORCEFDX is set, SPEED should also be set. The driver will\r
+  check the values for inconsistency with the detected PHY\r
+  technology.\r
+  5.  PHY 1 (the PHY on the adapter) may have an address in the range\r
+  1 through 31 inclusive. The driver will accept addresses in\r
+  this range.\r
+  6.  Driver ignores FORCEFDX and SPEED overrides if a 503 interface\r
+  is detected.\r
+\r
+  @param  AdapterInfo                     pointer to the structure that contains\r
+                                          the NIC's context.\r
+\r
+  @retval TRUE                            If a Phy was detected, and configured\r
+                                          correctly.\r
+  @retval FALSE                           If a valid phy could not be detected and\r
+                                          configured.\r
+\r
+**/\r
 BOOLEAN\r
 PhyDetect (\r
   NIC_DATA_INSTANCE *AdapterInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
- This routine will detect what phy we are using, set the line\r
-              speed, FDX or HDX, and configure the phy if necessary.\r
-\r
-              The following combinations are supported:\r
-              - TX or T4 PHY alone at PHY address 1\r
-              - T4 or TX PHY at address 1 and MII PHY at address 0\r
-              - 82503 alone (10Base-T mode, no full duplex support)\r
-              - 82503 and MII PHY (TX or T4) at address 0\r
-\r
-              The sequence / priority of detection is as follows:\r
-              - PHY 1 with cable termination\r
-              - PHY 0 with cable termination\r
-              - PHY 1 (if found) without cable termination\r
-              - 503 interface\r
-\r
-              Additionally auto-negotiation capable (NWAY) and parallel\r
-              detection PHYs are supported. The flow-chart is described in\r
-              the 82557 software writer's manual.\r
-\r
-   NOTE:  1.  All PHY MDI registers are read in polled mode.\r
-          2.  The routines assume that the 82557 has been RESET and we have\r
-              obtained the virtual memory address of the CSR.\r
-          3.  PhyDetect will not RESET the PHY.\r
-          4.  If FORCEFDX is set, SPEED should also be set. The driver will\r
-              check the values for inconsistency with the detected PHY\r
-              technology.\r
-          5.  PHY 1 (the PHY on the adapter) may have an address in the range\r
-              1 through 31 inclusive. The driver will accept addresses in\r
-              this range.\r
-          6.  Driver ignores FORCEFDX and SPEED overrides if a 503 interface\r
-              is detected.\r
\r
-Arguments:\r
-  AdapterInfo - pointer to the structure that contains the NIC's context.\r
-\r
-Returns:\r
-  TRUE - If a Phy was detected, and configured correctly.\r
-  FALSE - If a valid phy could not be detected and configured. \r
-  \r
---*/\r
 {\r
   UINT16  *eedata;\r
   UINT16  MdiControlReg;\r
@@ -2788,7 +2609,7 @@ Returns:
       &MdiStatusReg\r
       );\r
 \r
-    if (!((MdiControlReg == 0xffff) || \r
+    if (!((MdiControlReg == 0xffff) ||\r
           ((MdiStatusReg == 0) && (MdiControlReg == 0)))) {\r
 \r
       //\r
@@ -3005,35 +2826,33 @@ Returns:
   }\r
 }\r
 \r
+\r
+/**\r
+  This routine will setup phy 1 or phy 0 so that it is configured\r
+  to match a speed and duplex over-ride option.  If speed or\r
+  duplex mode is not explicitly specified in the registry, the\r
+  driver will skip the speed and duplex over-ride code, and\r
+  assume the adapter is automatically setting the line speed, and\r
+  the duplex mode.  At the end of this routine, any truly Phy\r
+  specific code will be executed (each Phy has its own quirks,\r
+  and some require that certain special bits are set).\r
+  NOTE:  The driver assumes that SPEED and FORCEFDX are specified at the\r
+  same time. If FORCEDPX is set without speed being set, the driver\r
+  will encouter a fatal error and log a message into the event viewer.\r
+\r
+  @param  AdapterInfo                     pointer to the structure that contains\r
+                                          the NIC's context.\r
+\r
+  @retval TRUE                            If the phy could be configured correctly\r
+  @retval FALSE                           If the phy couldn't be configured\r
+                                          correctly, because an unsupported\r
+                                          over-ride option was used\r
+\r
+**/\r
 BOOLEAN\r
 SetupPhy (\r
   IN NIC_DATA_INSTANCE *AdapterInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
- This routine will setup phy 1 or phy 0 so that it is configured\r
- to match a speed and duplex over-ride option.  If speed or\r
- duplex mode is not explicitly specified in the registry, the\r
- driver will skip the speed and duplex over-ride code, and\r
- assume the adapter is automatically setting the line speed, and\r
- the duplex mode.  At the end of this routine, any truly Phy\r
- specific code will be executed (each Phy has its own quirks,\r
- and some require that certain special bits are set).\r
-\r
- NOTE:  The driver assumes that SPEED and FORCEFDX are specified at the\r
-        same time. If FORCEDPX is set without speed being set, the driver\r
-        will encouter a fatal error and log a message into the event viewer.\r
-\r
-Arguments:\r
- AdapterInfo - pointer to the structure that contains the NIC's context.\r
-\r
-Returns:\r
- TRUE - If the phy could be configured correctly\r
- FALSE - If the phy couldn't be configured correctly, because an \r
-         unsupported over-ride option was used\r
-  \r
---*/\r
 {\r
   UINT16  MdiControlReg;\r
   UINT16  MdiStatusReg;\r
@@ -3229,24 +3048,23 @@ Returns:
   return (TRUE);\r
 }\r
 \r
+\r
+/**\r
+  This routine will figure out what line speed and duplex mode\r
+  the PHY is currently using.\r
+\r
+  @param  AdapterInfo                     pointer to the structure that contains\r
+                                          the NIC's context.\r
+  @param  PhyId                           The ID of the PHY in question.\r
+\r
+  @return NOTHING\r
+\r
+**/\r
 VOID\r
 FindPhySpeedAndDpx (\r
   IN NIC_DATA_INSTANCE *AdapterInfo,\r
   IN UINT32            PhyId\r
   )\r
-/*++\r
-\r
-Routine Description:\r
- This routine will figure out what line speed and duplex mode\r
- the PHY is currently using.\r
-\r
-Arguments:\r
- AdapterInfo - pointer to the structure that contains the NIC's context.\r
- PhyId - The ID of the PHY in question.\r
-\r
-Returns:\r
-  NOTHING\r
---*/\r
 {\r
   UINT16  MdiStatusReg;\r
   UINT16  MdiMiscReg;\r
@@ -3258,7 +3076,7 @@ Returns:
   // value accordingly\r
   //\r
   AdapterInfo->LinkSpeed  = AdapterInfo->LinkSpeedReq;\r
-  AdapterInfo->Duplex = (UINT8) ((AdapterInfo->DuplexReq & PXE_FORCE_FULL_DUPLEX) ? \r
+  AdapterInfo->Duplex = (UINT8) ((AdapterInfo->DuplexReq & PXE_FORCE_FULL_DUPLEX) ?\r
                         FULL_DUPLEX : HALF_DUPLEX);\r
 \r
   //\r
@@ -3363,7 +3181,7 @@ Returns:
   // advertised ablilities, and then assuming that the highest common\r
   // denominator was chosed by NWAY.\r
   //\r
-  if ((MdiLinkPartnerAdReg & NWAY_LP_ABILITY) && \r
+  if ((MdiLinkPartnerAdReg & NWAY_LP_ABILITY) &&\r
       (MdiStatusReg & MDI_SR_AUTO_NEG_COMPLETE)) {\r
 \r
     //\r
@@ -3452,25 +3270,19 @@ Returns:
   }\r
 }\r
 \r
-VOID\r
-XmitWaitForCompletion (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+VOID\r
+XmitWaitForCompletion (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   TxCB  *TxPtr;\r
 \r
@@ -3490,27 +3302,21 @@ Returns:
   }\r
 }\r
 \r
-INT8\r
-CommandWaitForCompletion (\r
-  TxCB              *cmd_ptr,\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  cmd_ptr     - TODO: add argument description\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  cmd_ptr                         TODO: add argument description\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+INT8\r
+CommandWaitForCompletion (\r
+  TxCB              *cmd_ptr,\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   INT16 wait;\r
   wait = 5000;\r
@@ -3525,26 +3331,19 @@ Returns:
   return 0;\r
 }\r
 \r
-STATIC\r
-INT8\r
-SoftwareReset (\r
-  NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+INT8\r
+SoftwareReset (\r
+  NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT8   tco_stat;\r
   UINT16  wait;\r
@@ -3632,25 +3431,19 @@ Returns:
   return 0;\r
 }\r
 \r
-UINT8\r
-SelectiveReset (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT8\r
+SelectiveReset (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT16  wait;\r
   UINT32  stat;\r
@@ -3686,25 +3479,19 @@ Returns:
   return 0;\r
 }\r
 \r
-UINT16\r
-InitializeChip (\r
-  IN NIC_DATA_INSTANCE *AdapterInfo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   TODO: Add function description\r
 \r
-Arguments:\r
-\r
-  AdapterInfo - TODO: add argument description\r
-\r
-Returns:\r
+  @param  AdapterInfo                     TODO: add argument description\r
 \r
-  TODO: add return values\r
+  @return TODO: add return values\r
 \r
---*/\r
+**/\r
+UINT16\r
+InitializeChip (\r
+  IN NIC_DATA_INSTANCE *AdapterInfo\r
+  )\r
 {\r
   UINT16  ret_val;\r
   if (SoftwareReset (AdapterInfo) != 0) {\r