-/*++\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
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
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
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
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
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
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
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
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
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
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
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
}\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
}\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
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
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
}\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
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
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
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
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
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
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
//\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
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
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
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
// 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
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
// 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
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
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
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
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
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
// 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
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
#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
}\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
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
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
}\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
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
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
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
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
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
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
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
\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
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
*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
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
&MdiStatusReg\r
);\r
\r
- if (!((MdiControlReg == 0xffff) || \r
+ if (!((MdiControlReg == 0xffff) ||\r
((MdiStatusReg == 0) && (MdiControlReg == 0)))) {\r
\r
//\r
}\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
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
// 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
// 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
}\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
}\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
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
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
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