Commit 94abda98 authored by Diego F. Marfil's avatar Diego F. Marfil Committed by Greg Kroah-Hartman

Staging: bcm: hostmibs: White spaces and indentation fixes.

Signed-off-by: default avatarDiego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ed8e9bb7
...@@ -5,77 +5,72 @@ ...@@ -5,77 +5,72 @@
* *
* Abstract: This file contains the routines to copy the statistics used by * Abstract: This file contains the routines to copy the statistics used by
* the driver to the Host MIBS structure and giving the same to Application. * the driver to the Host MIBS structure and giving the same to Application.
*
*/ */
#include "headers.h" #include "headers.h"
INT ProcessGetHostMibs(PMINI_ADAPTER Adapter, S_MIBS_HOST_STATS_MIBS *pstHostMibs) INT ProcessGetHostMibs(PMINI_ADAPTER Adapter, S_MIBS_HOST_STATS_MIBS *pstHostMibs)
{ {
S_SERVICEFLOW_ENTRY *pstServiceFlowEntry = NULL; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry = NULL;
S_PHS_RULE *pstPhsRule = NULL; S_PHS_RULE *pstPhsRule = NULL;
S_CLASSIFIER_TABLE *pstClassifierTable = NULL; S_CLASSIFIER_TABLE *pstClassifierTable = NULL;
S_CLASSIFIER_ENTRY *pstClassifierRule = NULL; S_CLASSIFIER_ENTRY *pstClassifierRule = NULL;
PPHS_DEVICE_EXTENSION pDeviceExtension = (PPHS_DEVICE_EXTENSION)&Adapter->stBCMPhsContext; PPHS_DEVICE_EXTENSION pDeviceExtension = (PPHS_DEVICE_EXTENSION) &Adapter->stBCMPhsContext;
UINT nClassifierIndex = 0, nPhsTableIndex = 0,nSfIndex = 0, uiIndex = 0; UINT nClassifierIndex = 0, nPhsTableIndex = 0, nSfIndex = 0, uiIndex = 0;
if(pDeviceExtension == NULL) if (pDeviceExtension == NULL) {
{ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, HOST_MIBS, DBG_LVL_ALL, "Invalid Device Extension\n");
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, HOST_MIBS, DBG_LVL_ALL, "Invalid Device Extension\n");
return STATUS_FAILURE; return STATUS_FAILURE;
} }
/* Copy the classifier Table */ /* Copy the classifier Table */
for(nClassifierIndex=0; nClassifierIndex < MAX_CLASSIFIERS; for (nClassifierIndex = 0; nClassifierIndex < MAX_CLASSIFIERS; nClassifierIndex++) {
nClassifierIndex++) if (Adapter->astClassifierTable[nClassifierIndex].bUsed == TRUE)
{ memcpy((PVOID) & pstHostMibs->
if(Adapter->astClassifierTable[nClassifierIndex].bUsed == TRUE) astClassifierTable[nClassifierIndex],
memcpy((PVOID)&pstHostMibs->astClassifierTable[nClassifierIndex], (PVOID) & Adapter->
(PVOID)&Adapter->astClassifierTable[nClassifierIndex], astClassifierTable[nClassifierIndex],
sizeof(S_MIBS_CLASSIFIER_RULE)); sizeof(S_MIBS_CLASSIFIER_RULE));
} }
/* Copy the SF Table */ /* Copy the SF Table */
for(nSfIndex=0; nSfIndex < NO_OF_QUEUES ; nSfIndex++) for (nSfIndex = 0; nSfIndex < NO_OF_QUEUES; nSfIndex++) {
{ if (Adapter->PackInfo[nSfIndex].bValid) {
if(Adapter->PackInfo[nSfIndex].bValid) memcpy((PVOID) & pstHostMibs->astSFtable[nSfIndex],
{ (PVOID) & Adapter->PackInfo[nSfIndex],
memcpy((PVOID)&pstHostMibs->astSFtable[nSfIndex],(PVOID)&Adapter->PackInfo[nSfIndex],sizeof(S_MIBS_SERVICEFLOW_TABLE)); sizeof(S_MIBS_SERVICEFLOW_TABLE));
} } else {
else /* If index in not valid,
{ * don't process this for the PHS table.
/* If index in not valid, * Go For the next entry.
* don't process this for the PHS table. */
* Go For the next entry. continue;
*/ }
continue ;
}
/* Retrieve the SFID Entry Index for requested Service Flow */ /* Retrieve the SFID Entry Index for requested Service Flow */
if(PHS_INVALID_TABLE_INDEX == GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, if (PHS_INVALID_TABLE_INDEX ==
Adapter->PackInfo[nSfIndex].usVCID_Value ,&pstServiceFlowEntry)) GetServiceFlowEntry(pDeviceExtension->
{ pstServiceFlowPhsRulesTable,
Adapter->PackInfo[nSfIndex].
usVCID_Value, &pstServiceFlowEntry))
continue; continue;
}
pstClassifierTable = pstServiceFlowEntry->pstClassifierTable; pstClassifierTable = pstServiceFlowEntry->pstClassifierTable;
for (uiIndex = 0; uiIndex < MAX_PHSRULE_PER_SF; uiIndex++) {
for(uiIndex = 0; uiIndex < MAX_PHSRULE_PER_SF; uiIndex++)
{
pstClassifierRule = &pstClassifierTable->stActivePhsRulesList[uiIndex]; pstClassifierRule = &pstClassifierTable->stActivePhsRulesList[uiIndex];
if(pstClassifierRule->bUsed) if (pstClassifierRule->bUsed) {
{ pstPhsRule = pstClassifierRule->pstPhsRule;
pstPhsRule = pstClassifierRule->pstPhsRule;
pstHostMibs->astPhsRulesTable[nPhsTableIndex].ulSFID = Adapter->PackInfo[nSfIndex].ulSFID; pstHostMibs->astPhsRulesTable[nPhsTableIndex].
ulSFID = Adapter->PackInfo[nSfIndex].ulSFID;
memcpy(&pstHostMibs->astPhsRulesTable[nPhsTableIndex].u8PHSI, memcpy(&pstHostMibs->
&pstPhsRule->u8PHSI, astPhsRulesTable[nPhsTableIndex].u8PHSI,
sizeof(S_PHS_RULE)); &pstPhsRule->u8PHSI, sizeof(S_PHS_RULE));
nPhsTableIndex++; nPhsTableIndex++;
} }
...@@ -84,33 +79,29 @@ INT ProcessGetHostMibs(PMINI_ADAPTER Adapter, S_MIBS_HOST_STATS_MIBS *pstHostMi ...@@ -84,33 +79,29 @@ INT ProcessGetHostMibs(PMINI_ADAPTER Adapter, S_MIBS_HOST_STATS_MIBS *pstHostMi
} }
/* Copy other Host Statistics parameters */ /* Copy other Host Statistics parameters */
pstHostMibs->stHostInfo.GoodTransmits = Adapter->dev->stats.tx_packets; pstHostMibs->stHostInfo.GoodTransmits = Adapter->dev->stats.tx_packets;
pstHostMibs->stHostInfo.GoodReceives = Adapter->dev->stats.rx_packets; pstHostMibs->stHostInfo.GoodReceives = Adapter->dev->stats.rx_packets;
pstHostMibs->stHostInfo.CurrNumFreeDesc = pstHostMibs->stHostInfo.CurrNumFreeDesc = atomic_read(&Adapter->CurrNumFreeTxDesc);
atomic_read(&Adapter->CurrNumFreeTxDesc);
pstHostMibs->stHostInfo.BEBucketSize = Adapter->BEBucketSize; pstHostMibs->stHostInfo.BEBucketSize = Adapter->BEBucketSize;
pstHostMibs->stHostInfo.rtPSBucketSize = Adapter->rtPSBucketSize; pstHostMibs->stHostInfo.rtPSBucketSize = Adapter->rtPSBucketSize;
pstHostMibs->stHostInfo.TimerActive = Adapter->TimerActive; pstHostMibs->stHostInfo.TimerActive = Adapter->TimerActive;
pstHostMibs->stHostInfo.u32TotalDSD = Adapter->u32TotalDSD; pstHostMibs->stHostInfo.u32TotalDSD = Adapter->u32TotalDSD;
memcpy(pstHostMibs->stHostInfo.aTxPktSizeHist,Adapter->aTxPktSizeHist,sizeof(UINT32)*MIBS_MAX_HIST_ENTRIES); memcpy(pstHostMibs->stHostInfo.aTxPktSizeHist, Adapter->aTxPktSizeHist, sizeof(UINT32) * MIBS_MAX_HIST_ENTRIES);
memcpy(pstHostMibs->stHostInfo.aRxPktSizeHist,Adapter->aRxPktSizeHist,sizeof(UINT32)*MIBS_MAX_HIST_ENTRIES); memcpy(pstHostMibs->stHostInfo.aRxPktSizeHist, Adapter->aRxPktSizeHist, sizeof(UINT32) * MIBS_MAX_HIST_ENTRIES);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
VOID GetDroppedAppCntrlPktMibs(S_MIBS_HOST_STATS_MIBS *pstHostMibs, const PPER_TARANG_DATA pTarang) VOID GetDroppedAppCntrlPktMibs(S_MIBS_HOST_STATS_MIBS *pstHostMibs, const PPER_TARANG_DATA pTarang)
{ {
memcpy(&(pstHostMibs->stDroppedAppCntrlMsgs), memcpy(&(pstHostMibs->stDroppedAppCntrlMsgs),
&(pTarang->stDroppedAppCntrlMsgs),sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); &(pTarang->stDroppedAppCntrlMsgs),
sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES));
} }
VOID CopyMIBSExtendedSFParameters(PMINI_ADAPTER Adapter, CServiceFlowParamSI *psfLocalSet, UINT uiSearchRuleIndex)
VOID CopyMIBSExtendedSFParameters(PMINI_ADAPTER Adapter,
CServiceFlowParamSI *psfLocalSet, UINT uiSearchRuleIndex)
{ {
Adapter->PackInfo[uiSearchRuleIndex].stMibsExtServiceFlowTable.wmanIfSfid = psfLocalSet->u32SFID; Adapter->PackInfo[uiSearchRuleIndex].stMibsExtServiceFlowTable.wmanIfSfid = psfLocalSet->u32SFID;
Adapter->PackInfo[uiSearchRuleIndex].stMibsExtServiceFlowTable.wmanIfCmnCpsMaxSustainedRate = psfLocalSet->u32MaxSustainedTrafficRate; Adapter->PackInfo[uiSearchRuleIndex].stMibsExtServiceFlowTable.wmanIfCmnCpsMaxSustainedRate = psfLocalSet->u32MaxSustainedTrafficRate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment