Commit 5cf4d6b9 authored by Kevin McKinney's avatar Kevin McKinney Committed by Greg Kroah-Hartman

Staging: bcm: Alter name, datatype, and default value of iterator variables.

This patch renames variables used in iteration
statements with i, changes the datatype to int,
and removes any default value.
Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce4bbc2a
...@@ -30,11 +30,11 @@ static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter, B_UINT16 tid); ...@@ -30,11 +30,11 @@ static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter, B_UINT16 tid);
************************************************************/ ************************************************************/
int SearchSfid(PMINI_ADAPTER Adapter, UINT uiSfid) int SearchSfid(PMINI_ADAPTER Adapter, UINT uiSfid)
{ {
int iIndex = 0; int i;
for (iIndex = (NO_OF_QUEUES-1); iIndex >= 0; iIndex--) for (i = (NO_OF_QUEUES-1); i >= 0; i--)
if (Adapter->PackInfo[iIndex].ulSFID == uiSfid) if (Adapter->PackInfo[i].ulSFID == uiSfid)
return iIndex; return i;
return NO_OF_QUEUES+1; return NO_OF_QUEUES+1;
} }
...@@ -51,11 +51,11 @@ int SearchSfid(PMINI_ADAPTER Adapter, UINT uiSfid) ...@@ -51,11 +51,11 @@ int SearchSfid(PMINI_ADAPTER Adapter, UINT uiSfid)
****************************************************************/ ****************************************************************/
static int SearchFreeSfid(PMINI_ADAPTER Adapter) static int SearchFreeSfid(PMINI_ADAPTER Adapter)
{ {
UINT uiIndex = 0; int i;
for (uiIndex = 0; uiIndex < (NO_OF_QUEUES-1); uiIndex++) for (i = 0; i < (NO_OF_QUEUES-1); i++)
if (Adapter->PackInfo[uiIndex].ulSFID == 0) if (Adapter->PackInfo[i].ulSFID == 0)
return uiIndex; return i;
return NO_OF_QUEUES+1; return NO_OF_QUEUES+1;
} }
...@@ -70,13 +70,13 @@ static int SearchFreeSfid(PMINI_ADAPTER Adapter) ...@@ -70,13 +70,13 @@ static int SearchFreeSfid(PMINI_ADAPTER Adapter)
*/ */
static int SearchClsid(PMINI_ADAPTER Adapter, ULONG ulSFID, B_UINT16 uiClassifierID) static int SearchClsid(PMINI_ADAPTER Adapter, ULONG ulSFID, B_UINT16 uiClassifierID)
{ {
unsigned int uiClassifierIndex = 0; int i;
for (uiClassifierIndex = 0; uiClassifierIndex < MAX_CLASSIFIERS; uiClassifierIndex++) { for (i = 0; i < MAX_CLASSIFIERS; i++) {
if ((Adapter->astClassifierTable[uiClassifierIndex].bUsed) && if ((Adapter->astClassifierTable[i].bUsed) &&
(Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex == uiClassifierID) && (Adapter->astClassifierTable[i].uiClassifierRuleIndex == uiClassifierID) &&
(Adapter->astClassifierTable[uiClassifierIndex].ulSFID == ulSFID)) (Adapter->astClassifierTable[i].ulSFID == ulSFID))
return uiClassifierIndex; return i;
} }
return MAX_CLASSIFIERS+1; return MAX_CLASSIFIERS+1;
...@@ -89,11 +89,11 @@ static int SearchClsid(PMINI_ADAPTER Adapter, ULONG ulSFID, B_UINT16 uiClassifi ...@@ -89,11 +89,11 @@ static int SearchClsid(PMINI_ADAPTER Adapter, ULONG ulSFID, B_UINT16 uiClassifi
*/ */
static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/) static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/)
{ {
unsigned int uiClassifierIndex = 0; int i;
for (uiClassifierIndex = 0; uiClassifierIndex < MAX_CLASSIFIERS; uiClassifierIndex++) { for (i = 0; i < MAX_CLASSIFIERS; i++) {
if (!Adapter->astClassifierTable[uiClassifierIndex].bUsed) if (!Adapter->astClassifierTable[i].bUsed)
return uiClassifierIndex; return i;
} }
return MAX_CLASSIFIERS+1; return MAX_CLASSIFIERS+1;
...@@ -116,7 +116,7 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry, ...@@ -116,7 +116,7 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry,
B_UINT8 u8IpAddressLen, B_UINT8 *pu8IpAddressMaskSrc, B_UINT8 u8IpAddressLen, B_UINT8 *pu8IpAddressMaskSrc,
BOOLEAN bIpVersion6, E_IPADDR_CONTEXT eIpAddrContext) BOOLEAN bIpVersion6, E_IPADDR_CONTEXT eIpAddrContext)
{ {
UINT ucLoopIndex = 0; int i = 0;
UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS; UINT nSizeOfIPAddressInBytes = IP_LENGTH_OF_ADDRESS;
UCHAR *ptrClassifierIpAddress = NULL; UCHAR *ptrClassifierIpAddress = NULL;
UCHAR *ptrClassifierIpMask = NULL; UCHAR *ptrClassifierIpMask = NULL;
...@@ -154,42 +154,42 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry, ...@@ -154,42 +154,42 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry,
} }
} }
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Address Length:0x%X\n", pstClassifierEntry->ucIPDestinationAddressLength); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Address Length:0x%X\n", pstClassifierEntry->ucIPDestinationAddressLength);
while ((u8IpAddressLen >= nSizeOfIPAddressInBytes) && (ucLoopIndex < MAX_IP_RANGE_LENGTH)) { while ((u8IpAddressLen >= nSizeOfIPAddressInBytes) && (i < MAX_IP_RANGE_LENGTH)) {
memcpy(ptrClassifierIpAddress + memcpy(ptrClassifierIpAddress +
(ucLoopIndex * nSizeOfIPAddressInBytes), (i * nSizeOfIPAddressInBytes),
(pu8IpAddressMaskSrc+(ucLoopIndex*nSizeOfIPAddressInBytes*2)), (pu8IpAddressMaskSrc+(i*nSizeOfIPAddressInBytes*2)),
nSizeOfIPAddressInBytes); nSizeOfIPAddressInBytes);
if (!bIpVersion6) { if (!bIpVersion6) {
if (eIpAddrContext == eSrcIpAddress) { if (eIpAddrContext == eSrcIpAddress) {
pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]); pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Address:0x%luX ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Address:0x%luX ",
pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[ucLoopIndex]); pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]);
} else if (eIpAddrContext == eDestIpAddress) { } else if (eIpAddrContext == eDestIpAddress) {
pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]); pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Address:0x%luX ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Address:0x%luX ",
pstClassifierEntry->stDestIpAddress.ulIpv4Addr[ucLoopIndex]); pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]);
} }
} }
u8IpAddressLen -= nSizeOfIPAddressInBytes; u8IpAddressLen -= nSizeOfIPAddressInBytes;
if (u8IpAddressLen >= nSizeOfIPAddressInBytes) { if (u8IpAddressLen >= nSizeOfIPAddressInBytes) {
memcpy(ptrClassifierIpMask + memcpy(ptrClassifierIpMask +
(ucLoopIndex * nSizeOfIPAddressInBytes), (i * nSizeOfIPAddressInBytes),
(pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes + (pu8IpAddressMaskSrc+nSizeOfIPAddressInBytes +
(ucLoopIndex*nSizeOfIPAddressInBytes*2)), (i*nSizeOfIPAddressInBytes*2)),
nSizeOfIPAddressInBytes); nSizeOfIPAddressInBytes);
if (!bIpVersion6) { if (!bIpVersion6) {
if (eIpAddrContext == eSrcIpAddress) { if (eIpAddrContext == eSrcIpAddress) {
pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex] = pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i] =
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]); ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Mask Address:0x%luX ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Mask Address:0x%luX ",
pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]); pstClassifierEntry->stSrcIpAddress.ulIpv4Mask[i]);
} else if (eIpAddrContext == eDestIpAddress) { } else if (eIpAddrContext == eDestIpAddress) {
pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex] = pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i] =
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex]); ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Mask Address:0x%luX ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Mask Address:0x%luX ",
pstClassifierEntry->stDestIpAddress.ulIpv4Mask[ucLoopIndex]); pstClassifierEntry->stDestIpAddress.ulIpv4Mask[i]);
} }
} }
u8IpAddressLen -= nSizeOfIPAddressInBytes; u8IpAddressLen -= nSizeOfIPAddressInBytes;
...@@ -197,17 +197,17 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry, ...@@ -197,17 +197,17 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry,
if (u8IpAddressLen == 0) if (u8IpAddressLen == 0)
pstClassifierEntry->bDestIpValid = TRUE; pstClassifierEntry->bDestIpValid = TRUE;
ucLoopIndex++; i++;
} }
if (bIpVersion6) { if (bIpVersion6) {
/* Restore EndianNess of Struct */ /* Restore EndianNess of Struct */
for (ucLoopIndex = 0; ucLoopIndex < MAX_IP_RANGE_LENGTH * 4; ucLoopIndex++) { for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) {
if (eIpAddrContext == eSrcIpAddress) { if (eIpAddrContext == eSrcIpAddress) {
pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[ucLoopIndex] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]); pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i]);
pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[ucLoopIndex] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[ucLoopIndex]); pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i] = ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i]);
} else if (eIpAddrContext == eDestIpAddress) { } else if (eIpAddrContext == eDestIpAddress) {
pstClassifierEntry->stDestIpAddress.ulIpv6Addr[ucLoopIndex] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[ucLoopIndex]); pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i]);
pstClassifierEntry->stDestIpAddress.ulIpv6Mask[ucLoopIndex] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[ucLoopIndex]); pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i] = ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i]);
} }
} }
} }
...@@ -216,17 +216,17 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry, ...@@ -216,17 +216,17 @@ CopyIpAddrToClassifier(S_CLASSIFIER_RULE *pstClassifierEntry,
void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter, B_UINT16 TID, BOOLEAN bFreeAll) void ClearTargetDSXBuffer(PMINI_ADAPTER Adapter, B_UINT16 TID, BOOLEAN bFreeAll)
{ {
ULONG ulIndex; int i;
for (ulIndex = 0; ulIndex < Adapter->ulTotalTargetBuffersAvailable; ulIndex++) { for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) {
if (Adapter->astTargetDsxBuffer[ulIndex].valid) if (Adapter->astTargetDsxBuffer[i].valid)
continue; continue;
if ((bFreeAll) || (Adapter->astTargetDsxBuffer[ulIndex].tid == TID)) { if ((bFreeAll) || (Adapter->astTargetDsxBuffer[i].tid == TID)) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
TID, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer); TID, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer);
Adapter->astTargetDsxBuffer[ulIndex].valid = 1; Adapter->astTargetDsxBuffer[i].valid = 1;
Adapter->astTargetDsxBuffer[ulIndex].tid = 0; Adapter->astTargetDsxBuffer[i].tid = 0;
Adapter->ulFreeTargetBufferCnt++; Adapter->ulFreeTargetBufferCnt++;
} }
} }
...@@ -240,7 +240,7 @@ static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSL ...@@ -240,7 +240,7 @@ static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSL
{ {
S_CLASSIFIER_RULE *pstClassifierEntry = NULL; S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
/* VOID *pvPhsContext = NULL; */ /* VOID *pvPhsContext = NULL; */
UINT ucLoopIndex = 0; int i;
/* UCHAR ucProtocolLength=0; */ /* UCHAR ucProtocolLength=0; */
/* ULONG ulPhsStatus; */ /* ULONG ulPhsStatus; */
...@@ -264,14 +264,14 @@ static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSL ...@@ -264,14 +264,14 @@ static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSL
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Destination Port Range Length:0x%X ", pstClassifierEntry->ucDestPortRangeLength); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Destination Port Range Length:0x%X ", pstClassifierEntry->ucDestPortRangeLength);
if (psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength <= MAX_PORT_RANGE) { if (psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength <= MAX_PORT_RANGE) {
for (ucLoopIndex = 0; ucLoopIndex < (pstClassifierEntry->ucDestPortRangeLength); ucLoopIndex++) { for (i = 0; i < (pstClassifierEntry->ucDestPortRangeLength); i++) {
pstClassifierEntry->usDestPortRangeLo[ucLoopIndex] = *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+ucLoopIndex)); pstClassifierEntry->usDestPortRangeLo[i] = *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+i));
pstClassifierEntry->usDestPortRangeHi[ucLoopIndex] = pstClassifierEntry->usDestPortRangeHi[i] =
*((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+ucLoopIndex)); *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+i));
pstClassifierEntry->usDestPortRangeLo[ucLoopIndex] = ntohs(pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]); pstClassifierEntry->usDestPortRangeLo[i] = ntohs(pstClassifierEntry->usDestPortRangeLo[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Destination Port Range Lo:0x%X ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Destination Port Range Lo:0x%X ",
pstClassifierEntry->usDestPortRangeLo[ucLoopIndex]); pstClassifierEntry->usDestPortRangeLo[i]);
pstClassifierEntry->usDestPortRangeHi[ucLoopIndex] = ntohs(pstClassifierEntry->usDestPortRangeHi[ucLoopIndex]); pstClassifierEntry->usDestPortRangeHi[i] = ntohs(pstClassifierEntry->usDestPortRangeHi[i]);
} }
} else { } else {
pstClassifierEntry->ucDestPortRangeLength = 0; pstClassifierEntry->ucDestPortRangeLength = 0;
...@@ -282,18 +282,18 @@ static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSL ...@@ -282,18 +282,18 @@ static inline VOID CopyClassifierRuleToSF(PMINI_ADAPTER Adapter, stConvergenceSL
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
if (psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength <= MAX_PORT_RANGE) { if (psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength <= MAX_PORT_RANGE) {
pstClassifierEntry->ucSrcPortRangeLength = psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength/4; pstClassifierEntry->ucSrcPortRangeLength = psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength/4;
for (ucLoopIndex = 0; ucLoopIndex < (pstClassifierEntry->ucSrcPortRangeLength); ucLoopIndex++) { for (i = 0; i < (pstClassifierEntry->ucSrcPortRangeLength); i++) {
pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] = pstClassifierEntry->usSrcPortRangeLo[i] =
*((PUSHORT)(psfCSType->cCPacketClassificationRule. *((PUSHORT)(psfCSType->cCPacketClassificationRule.
u8ProtocolSourcePortRange+ucLoopIndex)); u8ProtocolSourcePortRange+i));
pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex] = pstClassifierEntry->usSrcPortRangeHi[i] =
*((PUSHORT)(psfCSType->cCPacketClassificationRule. *((PUSHORT)(psfCSType->cCPacketClassificationRule.
u8ProtocolSourcePortRange+2+ucLoopIndex)); u8ProtocolSourcePortRange+2+i));
pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex] = pstClassifierEntry->usSrcPortRangeLo[i] =
ntohs(pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]); ntohs(pstClassifierEntry->usSrcPortRangeLo[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Source Port Range Lo:0x%X ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Source Port Range Lo:0x%X ",
pstClassifierEntry->usSrcPortRangeLo[ucLoopIndex]); pstClassifierEntry->usSrcPortRangeLo[i]);
pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex] = ntohs(pstClassifierEntry->usSrcPortRangeHi[ucLoopIndex]); pstClassifierEntry->usSrcPortRangeHi[i] = ntohs(pstClassifierEntry->usSrcPortRangeHi[i]);
} }
} }
/* Destination Ip Address and Mask */ /* Destination Ip Address and Mask */
...@@ -399,7 +399,7 @@ static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter, UINT uiSear ...@@ -399,7 +399,7 @@ static inline VOID DeleteClassifierRuleFromSF(PMINI_ADAPTER Adapter, UINT uiSear
VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex) VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
{ {
S_CLASSIFIER_RULE *pstClassifierEntry = NULL; S_CLASSIFIER_RULE *pstClassifierEntry = NULL;
UINT nClassifierIndex; int i;
/* B_UINT16 u16PacketClassificationRuleIndex; */ /* B_UINT16 u16PacketClassificationRuleIndex; */
USHORT ulVCID; USHORT ulVCID;
/* VOID *pvPhsContext = NULL; */ /* VOID *pvPhsContext = NULL; */
...@@ -410,12 +410,12 @@ VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex) ...@@ -410,12 +410,12 @@ VOID DeleteAllClassifiersForSF(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
if (ulVCID == 0) if (ulVCID == 0)
return; return;
for (nClassifierIndex = 0; nClassifierIndex < MAX_CLASSIFIERS; nClassifierIndex++) { for (i = 0; i < MAX_CLASSIFIERS; i++) {
if (Adapter->astClassifierTable[nClassifierIndex].usVCID_Value == ulVCID) { if (Adapter->astClassifierTable[i].usVCID_Value == ulVCID) {
pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex]; pstClassifierEntry = &Adapter->astClassifierTable[i];
if (pstClassifierEntry->bUsed) if (pstClassifierEntry->bUsed)
DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex, nClassifierIndex); DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex, i);
} }
} }
...@@ -439,7 +439,7 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada ...@@ -439,7 +439,7 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada
UINT nClassifierIndex = 0; UINT nClassifierIndex = 0;
enum E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction; enum E_CLASSIFIER_ACTION eClassifierAction = eInvalidClassifierAction;
B_UINT16 u16PacketClassificationRuleIndex = 0; B_UINT16 u16PacketClassificationRuleIndex = 0;
UINT nIndex = 0; int i;
stConvergenceSLTypes *psfCSType = NULL; stConvergenceSLTypes *psfCSType = NULL;
S_PHS_RULE sPhsRule; S_PHS_RULE sPhsRule;
USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; USHORT uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
...@@ -527,10 +527,10 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada ...@@ -527,10 +527,10 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada
Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority; Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority;
/* copy all the classifier in the Service Flow param structure */ /* copy all the classifier in the Service Flow param structure */
for (nIndex = 0; nIndex < psfLocalSet->u8TotalClassifiers; nIndex++) { for (i = 0; i < psfLocalSet->u8TotalClassifiers; i++) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Classifier index =%d", nIndex); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Classifier index =%d", i);
psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex]; psfCSType = &psfLocalSet->cConvergenceSLTypes[i];
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Classifier index =%d", nIndex); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Classifier index =%d", i);
if (psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority) if (psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority = TRUE; Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority = TRUE;
...@@ -628,8 +628,8 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada ...@@ -628,8 +628,8 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada
} }
/* Repeat parsing Classification Entries to process PHS Rules */ /* Repeat parsing Classification Entries to process PHS Rules */
for (nIndex = 0; nIndex < psfLocalSet->u8TotalClassifiers; nIndex++) { for (i = 0; i < psfLocalSet->u8TotalClassifiers; i++) {
psfCSType = &psfLocalSet->cConvergenceSLTypes[nIndex]; psfCSType = &psfLocalSet->cConvergenceSLTypes[i];
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n", psfCSType->u8PhsDSCAction); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "psfCSType->u8PhsDSCAction : 0x%x\n", psfCSType->u8PhsDSCAction);
switch (psfCSType->u8PhsDSCAction) { switch (psfCSType->u8PhsDSCAction) {
...@@ -832,8 +832,8 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada ...@@ -832,8 +832,8 @@ static VOID CopyToAdapter(register PMINI_ADAPTER Adapter, /* <Pointer to the Ada
*************************************************************************/ *************************************************************************/
static VOID DumpCmControlPacket(PVOID pvBuffer) static VOID DumpCmControlPacket(PVOID pvBuffer)
{ {
UINT uiLoopIndex; int uiLoopIndex;
UINT nIndex; int nIndex;
stLocalSFAddIndicationAlt *pstAddIndication; stLocalSFAddIndicationAlt *pstAddIndication;
UINT nCurClassifierCnt; UINT nCurClassifierCnt;
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
...@@ -1542,7 +1542,7 @@ ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter) ...@@ -1542,7 +1542,7 @@ ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
{ {
ULONG ulTargetDsxBuffersBase = 0; ULONG ulTargetDsxBuffersBase = 0;
ULONG ulCntTargetBuffers; ULONG ulCntTargetBuffers;
ULONG ulIndex = 0; ULONG i;
int Status; int Status;
if (!Adapter) { if (!Adapter) {
...@@ -1572,13 +1572,13 @@ ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter) ...@@ -1572,13 +1572,13 @@ ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ", Adapter->ulTotalTargetBuffersAvailable); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Total Target DSX Buffer setup %lx ", Adapter->ulTotalTargetBuffersAvailable);
for (ulIndex = 0; ulIndex < Adapter->ulTotalTargetBuffersAvailable; ulIndex++) { for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) {
Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer = ulTargetDsxBuffersBase; Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer = ulTargetDsxBuffersBase;
Adapter->astTargetDsxBuffer[ulIndex].valid = 1; Adapter->astTargetDsxBuffer[i].valid = 1;
Adapter->astTargetDsxBuffer[ulIndex].tid = 0; Adapter->astTargetDsxBuffer[i].tid = 0;
ulTargetDsxBuffersBase += sizeof(stServiceFlowParamSI); ulTargetDsxBuffersBase += sizeof(stServiceFlowParamSI);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " Target DSX Buffer %lx setup at 0x%lx",
ulIndex, Adapter->astTargetDsxBuffer[ulIndex].ulTargetDsxBuffer); i, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer);
} }
Adapter->ulCurrentTargetBuffer = 0; Adapter->ulCurrentTargetBuffer = 0;
Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable; Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable;
......
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