Commit 732f1eee authored by Matthias Beyer's avatar Matthias Beyer Committed by Greg Kroah-Hartman

Staging: bcm: Replaced member accessing with variable

Signed-off-by: default avatarMatthias Beyer <mail@beyermatthias.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e8a94477
...@@ -249,12 +249,15 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru ...@@ -249,12 +249,15 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru
/* UCHAR ucProtocolLength=0; */ /* UCHAR ucProtocolLength=0; */
/* ULONG ulPhsStatus; */ /* ULONG ulPhsStatus; */
struct bcm_packet_class_rules *pack_class_rule =
&psfCSType->cCPacketClassificationRule;
if (Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 || if (Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
nClassifierIndex > (MAX_CLASSIFIERS-1)) nClassifierIndex > (MAX_CLASSIFIERS-1))
return; return;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Storing Classifier Rule Index : %X", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Storing Classifier Rule Index : %X",
ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex)); ntohs(pack_class_rule->u16PacketClassificationRuleIndex));
if (nClassifierIndex > MAX_CLASSIFIERS-1) if (nClassifierIndex > MAX_CLASSIFIERS-1)
return; return;
...@@ -265,14 +268,14 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru ...@@ -265,14 +268,14 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru
pstClassifierEntry->bIpv6Protocol = (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false; pstClassifierEntry->bIpv6Protocol = (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false;
/* Destinaiton Port */ /* Destinaiton Port */
pstClassifierEntry->ucDestPortRangeLength = psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength / 4; pstClassifierEntry->ucDestPortRangeLength = pack_class_rule->u8ProtocolDestPortRangeLength / 4;
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 (pack_class_rule->u8ProtocolDestPortRangeLength <= MAX_PORT_RANGE) {
for (i = 0; i < (pstClassifierEntry->ucDestPortRangeLength); i++) { for (i = 0; i < (pstClassifierEntry->ucDestPortRangeLength); i++) {
pstClassifierEntry->usDestPortRangeLo[i] = *((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+i)); pstClassifierEntry->usDestPortRangeLo[i] = *((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+i));
pstClassifierEntry->usDestPortRangeHi[i] = pstClassifierEntry->usDestPortRangeHi[i] =
*((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+i)); *((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+2+i));
pstClassifierEntry->usDestPortRangeLo[i] = ntohs(pstClassifierEntry->usDestPortRangeLo[i]); 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[i]); pstClassifierEntry->usDestPortRangeLo[i]);
...@@ -284,15 +287,15 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru ...@@ -284,15 +287,15 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru
/* Source Port */ /* Source Port */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Source Port Range Length:0x%X ", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Source Port Range Length:0x%X ",
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); pack_class_rule->u8ProtocolSourcePortRangeLength);
if (psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength <= MAX_PORT_RANGE) { if (pack_class_rule->u8ProtocolSourcePortRangeLength <= MAX_PORT_RANGE) {
pstClassifierEntry->ucSrcPortRangeLength = psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength/4; pstClassifierEntry->ucSrcPortRangeLength = pack_class_rule->u8ProtocolSourcePortRangeLength/4;
for (i = 0; i < (pstClassifierEntry->ucSrcPortRangeLength); i++) { for (i = 0; i < (pstClassifierEntry->ucSrcPortRangeLength); i++) {
pstClassifierEntry->usSrcPortRangeLo[i] = pstClassifierEntry->usSrcPortRangeLo[i] =
*((PUSHORT)(psfCSType->cCPacketClassificationRule. *((PUSHORT)(pack_class_rule->
u8ProtocolSourcePortRange+i)); u8ProtocolSourcePortRange+i));
pstClassifierEntry->usSrcPortRangeHi[i] = pstClassifierEntry->usSrcPortRangeHi[i] =
*((PUSHORT)(psfCSType->cCPacketClassificationRule. *((PUSHORT)(pack_class_rule->
u8ProtocolSourcePortRange+2+i)); u8ProtocolSourcePortRange+2+i));
pstClassifierEntry->usSrcPortRangeLo[i] = pstClassifierEntry->usSrcPortRangeLo[i] =
ntohs(pstClassifierEntry->usSrcPortRangeLo[i]); ntohs(pstClassifierEntry->usSrcPortRangeLo[i]);
...@@ -304,8 +307,8 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru ...@@ -304,8 +307,8 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru
/* Destination Ip Address and Mask */ /* Destination Ip Address and Mask */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Destination Parameters : "); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Destination Parameters : ");
CopyIpAddrToClassifier(pstClassifierEntry, CopyIpAddrToClassifier(pstClassifierEntry,
psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength, pack_class_rule->u8IPDestinationAddressLength,
psfCSType->cCPacketClassificationRule.u8IPDestinationAddress, pack_class_rule->u8IPDestinationAddress,
(Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ?
TRUE : false, eDestIpAddress); TRUE : false, eDestIpAddress);
...@@ -313,33 +316,33 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru ...@@ -313,33 +316,33 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Source Parameters : "); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip Source Parameters : ");
CopyIpAddrToClassifier(pstClassifierEntry, CopyIpAddrToClassifier(pstClassifierEntry,
psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength, pack_class_rule->u8IPMaskedSourceAddressLength,
psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress, pack_class_rule->u8IPMaskedSourceAddress,
(Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false, (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false,
eSrcIpAddress); eSrcIpAddress);
/* TOS */ /* TOS */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "TOS Length:0x%X ", psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "TOS Length:0x%X ", pack_class_rule->u8IPTypeOfServiceLength);
if (psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength == 3) { if (pack_class_rule->u8IPTypeOfServiceLength == 3) {
pstClassifierEntry->ucIPTypeOfServiceLength = psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength; pstClassifierEntry->ucIPTypeOfServiceLength = pack_class_rule->u8IPTypeOfServiceLength;
pstClassifierEntry->ucTosLow = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0]; pstClassifierEntry->ucTosLow = pack_class_rule->u8IPTypeOfService[0];
pstClassifierEntry->ucTosHigh = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1]; pstClassifierEntry->ucTosHigh = pack_class_rule->u8IPTypeOfService[1];
pstClassifierEntry->ucTosMask = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]; pstClassifierEntry->ucTosMask = pack_class_rule->u8IPTypeOfService[2];
pstClassifierEntry->bTOSValid = TRUE; pstClassifierEntry->bTOSValid = TRUE;
} }
if (psfCSType->cCPacketClassificationRule.u8Protocol == 0) { if (pack_class_rule->u8Protocol == 0) {
/* we didn't get protocol field filled in by the BS */ /* we didn't get protocol field filled in by the BS */
pstClassifierEntry->ucProtocolLength = 0; pstClassifierEntry->ucProtocolLength = 0;
} else { } else {
pstClassifierEntry->ucProtocolLength = 1; /* 1 valid protocol */ pstClassifierEntry->ucProtocolLength = 1; /* 1 valid protocol */
} }
pstClassifierEntry->ucProtocol[0] = psfCSType->cCPacketClassificationRule.u8Protocol; pstClassifierEntry->ucProtocol[0] = pack_class_rule->u8Protocol;
pstClassifierEntry->u8ClassifierRulePriority = psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority; pstClassifierEntry->u8ClassifierRulePriority = pack_class_rule->u8ClassifierRulePriority;
/* store the classifier rule ID and set this classifier entry as valid */ /* store the classifier rule ID and set this classifier entry as valid */
pstClassifierEntry->ucDirection = Adapter->PackInfo[uiSearchRuleIndex].ucDirection; pstClassifierEntry->ucDirection = Adapter->PackInfo[uiSearchRuleIndex].ucDirection;
pstClassifierEntry->uiClassifierRuleIndex = ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); pstClassifierEntry->uiClassifierRuleIndex = ntohs(pack_class_rule->u16PacketClassificationRuleIndex);
pstClassifierEntry->usVCID_Value = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; pstClassifierEntry->usVCID_Value = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value;
pstClassifierEntry->ulSFID = Adapter->PackInfo[uiSearchRuleIndex].ulSFID; pstClassifierEntry->ulSFID = Adapter->PackInfo[uiSearchRuleIndex].ulSFID;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Search Index %d Dir: %d, Index: %d, Vcid: %d\n",
...@@ -347,21 +350,21 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru ...@@ -347,21 +350,21 @@ static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, stru
pstClassifierEntry->uiClassifierRuleIndex, pstClassifierEntry->uiClassifierRuleIndex,
pstClassifierEntry->usVCID_Value); pstClassifierEntry->usVCID_Value);
if (psfCSType->cCPacketClassificationRule.u8AssociatedPHSI) if (pack_class_rule->u8AssociatedPHSI)
pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI; pstClassifierEntry->u8AssociatedPHSI = pack_class_rule->u8AssociatedPHSI;
/* Copy ETH CS Parameters */ /* Copy ETH CS Parameters */
pstClassifierEntry->ucEthCSSrcMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength); pstClassifierEntry->ucEthCSSrcMACLen = (pack_class_rule->u8EthernetSourceMACAddressLength);
memcpy(pstClassifierEntry->au8EThCSSrcMAC, psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress, MAC_ADDRESS_SIZE); memcpy(pstClassifierEntry->au8EThCSSrcMAC, pack_class_rule->u8EthernetSourceMACAddress, MAC_ADDRESS_SIZE);
memcpy(pstClassifierEntry->au8EThCSSrcMACMask, psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE); memcpy(pstClassifierEntry->au8EThCSSrcMACMask, pack_class_rule->u8EthernetSourceMACAddress + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE);
pstClassifierEntry->ucEthCSDestMACLen = (psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); pstClassifierEntry->ucEthCSDestMACLen = (pack_class_rule->u8EthernetDestMacAddressLength);
memcpy(pstClassifierEntry->au8EThCSDestMAC, psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress, MAC_ADDRESS_SIZE); memcpy(pstClassifierEntry->au8EThCSDestMAC, pack_class_rule->u8EthernetDestMacAddress, MAC_ADDRESS_SIZE);
memcpy(pstClassifierEntry->au8EThCSDestMACMask, psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE); memcpy(pstClassifierEntry->au8EThCSDestMACMask, pack_class_rule->u8EthernetDestMacAddress + MAC_ADDRESS_SIZE, MAC_ADDRESS_SIZE);
pstClassifierEntry->ucEtherTypeLen = (psfCSType->cCPacketClassificationRule.u8EthertypeLength); pstClassifierEntry->ucEtherTypeLen = (pack_class_rule->u8EthertypeLength);
memcpy(pstClassifierEntry->au8EthCSEtherType, psfCSType->cCPacketClassificationRule.u8Ethertype, NUM_ETHERTYPE_BYTES); memcpy(pstClassifierEntry->au8EthCSEtherType, pack_class_rule->u8Ethertype, NUM_ETHERTYPE_BYTES);
memcpy(pstClassifierEntry->usUserPriority, &psfCSType->cCPacketClassificationRule.u16UserPriority, 2); memcpy(pstClassifierEntry->usUserPriority, &pack_class_rule->u16UserPriority, 2);
pstClassifierEntry->usVLANID = ntohs(psfCSType->cCPacketClassificationRule.u16VLANID); pstClassifierEntry->usVLANID = ntohs(pack_class_rule->u16VLANID);
pstClassifierEntry->usValidityBitMap = ntohs(psfCSType->cCPacketClassificationRule.u16ValidityBitMap); pstClassifierEntry->usValidityBitMap = ntohs(pack_class_rule->u16ValidityBitMap);
pstClassifierEntry->bUsed = TRUE; pstClassifierEntry->bUsed = TRUE;
} }
......
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