/** @file\r
Implementation of collecting the statistics on a network interface.\r
- \r
-Copyright (c) 2004 - 2007, Intel Corporation. <BR> \r
-All rights reserved. This program and the accompanying materials are licensed \r
-and made available under the terms and conditions of the BSD License which \r
-accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
+\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed\r
+and made available under the terms and conditions of the BSD License which\r
+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
/**\r
Resets or collects the statistics on a network interface.\r
- \r
+\r
This function resets or collects the statistics on a network interface. If the\r
size of the statistics table specified by StatisticsSize is not big enough for\r
all the statistics that are collected by the network interface, then a partial\r
- buffer of statistics is returned in StatisticsTable, StatisticsSize is set to \r
- the size required to collect all the available statistics, and \r
+ buffer of statistics is returned in StatisticsTable, StatisticsSize is set to\r
+ the size required to collect all the available statistics, and\r
EFI_BUFFER_TOO_SMALL is returned.\r
- If StatisticsSize is big enough for all the statistics, then StatisticsTable \r
- will be filled, StatisticsSize will be set to the size of the returned \r
+ If StatisticsSize is big enough for all the statistics, then StatisticsTable\r
+ will be filled, StatisticsSize will be set to the size of the returned\r
StatisticsTable structure, and EFI_SUCCESS is returned.\r
If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
If Reset is FALSE, and both StatisticsSize and StatisticsTable are NULL, then\r
\r
@param This A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
@param Reset Set to TRUE to reset the statistics for the network interface.\r
- @param StatisticsSize On input the size, in bytes, of StatisticsTable. On output \r
+ @param StatisticsSize On input the size, in bytes, of StatisticsTable. On output\r
the size, in bytes, of the resulting table of statistics.\r
- @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that \r
- contains the statistics. Type EFI_NETWORK_STATISTICS is \r
- defined in "Related Definitions" below. \r
- \r
+ @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
+ contains the statistics. Type EFI_NETWORK_STATISTICS is\r
+ defined in "Related Definitions" below.\r
+\r
@retval EFI_SUCCESS The requested operation succeeded.\r
@retval EFI_NOT_STARTED The Simple Network Protocol interface has not been\r
started by calling Start().\r
- @retval EFI_BUFFER_TOO_SMALL StatisticsSize is not NULL and StatisticsTable is \r
- NULL. The current buffer size that is needed to \r
+ @retval EFI_BUFFER_TOO_SMALL StatisticsSize is not NULL and StatisticsTable is\r
+ NULL. The current buffer size that is needed to\r
hold all the statistics is returned in StatisticsSize.\r
- @retval EFI_BUFFER_TOO_SMALL StatisticsSize is not NULL and StatisticsTable is \r
+ @retval EFI_BUFFER_TOO_SMALL StatisticsSize is not NULL and StatisticsTable is\r
not NULL. The current buffer size that is needed\r
- to hold all the statistics is returned in \r
- StatisticsSize. A partial set of statistics is \r
+ to hold all the statistics is returned in\r
+ StatisticsSize. A partial set of statistics is\r
returned in StatisticsTable.\r
- @retval EFI_INVALID_PARAMETER StatisticsSize is NULL and StatisticsTable is not \r
+ @retval EFI_INVALID_PARAMETER StatisticsSize is NULL and StatisticsTable is not\r
NULL.\r
- @retval EFI_DEVICE_ERROR The Simple Network Protocol interface has not \r
+ @retval EFI_DEVICE_ERROR The Simple Network Protocol interface has not\r
been initialized by calling Initialize().\r
- @retval EFI_DEVICE_ERROR An error was encountered collecting statistics \r
+ @retval EFI_DEVICE_ERROR An error was encountered collecting statistics\r
from the NIC.\r
- @retval EFI_UNSUPPORTED The NIC does not support collecting statistics \r
+ @retval EFI_UNSUPPORTED The NIC does not support collecting statistics\r
from the network interface.\r
\r
**/\r
Db = Snp->Db;\r
} else {\r
Snp->Cdb.OpFlags = PXE_OPFLAGS_STATISTICS_READ;\r
- Snp->Cdb.DBsize = sizeof (PXE_DB_STATISTICS);\r
+ Snp->Cdb.DBsize = (UINT16) sizeof (PXE_DB_STATISTICS);\r
Snp->Cdb.DBaddr = (UINT64)(UINTN) (Db = Snp->Db);\r
}\r
//\r
break;\r
}\r
\r
- if (Db->Supported & Mask) {\r
+ if ((Db->Supported & Mask) != 0) {\r
*Stp = Db->Data[Index];\r
Size = Index + 1;\r
} else {\r
// Compute size up to last supported statistic.\r
//\r
while (++Index < 64) {\r
- if (Db->Supported & (Mask = LShiftU64 (Mask, 1))) {\r
+ if ((Db->Supported & (Mask = LShiftU64 (Mask, 1))) != 0) {\r
Size = Index;\r
}\r
}\r