diff options
author | Max Tottenham <mtottenh@gmail.com> | 2012-04-03 07:35:28 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-10 13:34:03 -0400 |
commit | aadb4ec271ee73b39031acb8a201f96e56d1cbf1 (patch) | |
tree | 867a9558bc2260731f98d945f1b475c12909d437 /drivers | |
parent | fac290a11694efff330c96041a7a88579c5cf8f2 (diff) |
Staging: bcm: IPv6Protocol.c coding style fix
Fith in a series of patche to fi coding syle in IPv6Protocol.c
Fixed trailing whitespaces and replaced spaces with tabs
in code indents
Signed-off-by: Max Tottenham <mtottenh@gmail.com>
Acked-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/bcm/IPv6Protocol.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/drivers/staging/bcm/IPv6Protocol.c b/drivers/staging/bcm/IPv6Protocol.c index 7bc1dc29e8e..80173e7a571 100644 --- a/drivers/staging/bcm/IPv6Protocol.c +++ b/drivers/staging/bcm/IPv6Protocol.c | |||
@@ -4,7 +4,7 @@ static BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule, IPV6Hea | |||
4 | static BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule, IPV6Header *pstIpv6Header); | 4 | static BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule, IPV6Header *pstIpv6Header); |
5 | static VOID DumpIpv6Header(IPV6Header *pstIpv6Header); | 5 | static VOID DumpIpv6Header(IPV6Header *pstIpv6Header); |
6 | 6 | ||
7 | static UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload, UCHAR *pucNextHeader, BOOLEAN *bParseDone, USHORT *pusPayloadLength) | 7 | static UCHAR *GetNextIPV6ChainedHeader(UCHAR **ppucPayload, UCHAR *pucNextHeader, BOOLEAN *bParseDone, USHORT *pusPayloadLength) |
8 | { | 8 | { |
9 | UCHAR *pucRetHeaderPtr = NULL; | 9 | UCHAR *pucRetHeaderPtr = NULL; |
10 | UCHAR *pucPayloadPtr = NULL; | 10 | UCHAR *pucPayloadPtr = NULL; |
@@ -109,7 +109,7 @@ static UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload, UCHAR *pucNextHeade | |||
109 | } | 109 | } |
110 | 110 | ||
111 | if (*bParseDone == FALSE) { | 111 | if (*bParseDone == FALSE) { |
112 | if(*pusPayloadLength <= usNextHeaderOffset) { | 112 | if (*pusPayloadLength <= usNextHeaderOffset) { |
113 | *bParseDone = TRUE; | 113 | *bParseDone = TRUE; |
114 | } else { | 114 | } else { |
115 | *pucNextHeader = *pucPayloadPtr; | 115 | *pucNextHeader = *pucPayloadPtr; |
@@ -132,7 +132,7 @@ static UCHAR GetIpv6ProtocolPorts(UCHAR *pucPayload, USHORT *pusSrcPort, USHORT | |||
132 | UCHAR *pucNextHeader = NULL; | 132 | UCHAR *pucNextHeader = NULL; |
133 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); | 133 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); |
134 | 134 | ||
135 | if ( !pucPayload || (usPayloadLength == 0)) { | 135 | if (!pucPayload || (usPayloadLength == 0)) { |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | 138 | ||
@@ -140,8 +140,8 @@ static UCHAR GetIpv6ProtocolPorts(UCHAR *pucPayload, USHORT *pusSrcPort, USHORT | |||
140 | ucHeaderType = ucNextHeader; | 140 | ucHeaderType = ucNextHeader; |
141 | while (!bDone) { | 141 | while (!bDone) { |
142 | pucNextHeader = GetNextIPV6ChainedHeader(&pIpv6HdrScanContext, &ucHeaderType, &bDone, &usPayloadLength); | 142 | pucNextHeader = GetNextIPV6ChainedHeader(&pIpv6HdrScanContext, &ucHeaderType, &bDone, &usPayloadLength); |
143 | if(bDone) { | 143 | if (bDone) { |
144 | if((ucHeaderType == TCP_HEADER_TYPE) || (ucHeaderType == UDP_HEADER_TYPE)) { | 144 | if ((ucHeaderType == TCP_HEADER_TYPE) || (ucHeaderType == UDP_HEADER_TYPE)) { |
145 | *pusSrcPort = *((PUSHORT)(pucNextHeader)); | 145 | *pusSrcPort = *((PUSHORT)(pucNextHeader)); |
146 | *pusDestPort = *((PUSHORT)(pucNextHeader+2)); | 146 | *pusDestPort = *((PUSHORT)(pucNextHeader+2)); |
147 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, " \nProtocol Ports - Src Port :0x%x Dest Port : 0x%x", ntohs(*pusSrcPort), ntohs(*pusDestPort)); | 147 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, " \nProtocol Ports - Src Port :0x%x Dest Port : 0x%x", ntohs(*pusSrcPort), ntohs(*pusDestPort)); |
@@ -159,7 +159,7 @@ static UCHAR GetIpv6ProtocolPorts(UCHAR *pucPayload, USHORT *pusSrcPort, USHORT | |||
159 | * Arg 2 PVOID pcIpHeader is a pointer to the IP header of the packet | 159 | * Arg 2 PVOID pcIpHeader is a pointer to the IP header of the packet |
160 | */ | 160 | */ |
161 | USHORT IpVersion6(PMINI_ADAPTER Adapter, PVOID pcIpHeader, | 161 | USHORT IpVersion6(PMINI_ADAPTER Adapter, PVOID pcIpHeader, |
162 | S_CLASSIFIER_RULE *pstClassifierRule ) | 162 | S_CLASSIFIER_RULE *pstClassifierRule) |
163 | { | 163 | { |
164 | USHORT ushDestPort = 0; | 164 | USHORT ushDestPort = 0; |
165 | USHORT ushSrcPort = 0; | 165 | USHORT ushSrcPort = 0; |
@@ -173,8 +173,8 @@ USHORT IpVersion6(PMINI_ADAPTER Adapter, PVOID pcIpHeader, | |||
173 | 173 | ||
174 | DumpIpv6Header(pstIpv6Header); | 174 | DumpIpv6Header(pstIpv6Header); |
175 | 175 | ||
176 | /* | 176 | /* |
177 | * Try to get the next higher layer protocol | 177 | * Try to get the next higher layer protocol |
178 | * and the Ports Nos if TCP or UDP | 178 | * and the Ports Nos if TCP or UDP |
179 | */ | 179 | */ |
180 | ucNextProtocolAboveIP = GetIpv6ProtocolPorts((UCHAR *)(pcIpHeader + sizeof(IPV6Header)), | 180 | ucNextProtocolAboveIP = GetIpv6ProtocolPorts((UCHAR *)(pcIpHeader + sizeof(IPV6Header)), |
@@ -185,38 +185,39 @@ USHORT IpVersion6(PMINI_ADAPTER Adapter, PVOID pcIpHeader, | |||
185 | 185 | ||
186 | do { | 186 | do { |
187 | if (0 == pstClassifierRule->ucDirection) { | 187 | if (0 == pstClassifierRule->ucDirection) { |
188 | /* | 188 | /* |
189 | * cannot be processed for classification. | 189 | * cannot be processed for classification. |
190 | * it is a down link connection | 190 | * it is a down link connection |
191 | */ | 191 | */ |
192 | break; | 192 | break; |
193 | } | 193 | } |
194 | 194 | ||
195 | if (!pstClassifierRule->bIpv6Protocol) { | 195 | if (!pstClassifierRule->bIpv6Protocol) { |
196 | /* | 196 | /* |
197 | * We are looking for Ipv6 Classifiers | 197 | * We are looking for Ipv6 Classifiers |
198 | * Lets ignore this classifier and try the next one | 198 | * Lets ignore this classifier and try the next one |
199 | */ | 199 | */ |
200 | break; | 200 | break; |
201 | } | 201 | } |
202 | 202 | ||
203 | bClassificationSucceed = MatchSrcIpv6Address(pstClassifierRule, pstIpv6Header); | 203 | bClassificationSucceed = MatchSrcIpv6Address(pstClassifierRule, pstIpv6Header); |
204 | if (!bClassificationSucceed) | 204 | if (!bClassificationSucceed) |
205 | break; | 205 | break; |
206 | 206 | ||
207 | bClassificationSucceed = MatchDestIpv6Address(pstClassifierRule, pstIpv6Header); | 207 | bClassificationSucceed = MatchDestIpv6Address(pstClassifierRule, pstIpv6Header); |
208 | if (!bClassificationSucceed) | 208 | if (!bClassificationSucceed) |
209 | break; | 209 | break; |
210 | 210 | ||
211 | /* | 211 | /* |
212 | * Match the protocol type. | 212 | * Match the protocol type. |
213 | * For IPv6 the next protocol at end of | 213 | * For IPv6 the next protocol at end of |
214 | * Chain of IPv6 prot headers | 214 | * Chain of IPv6 prot headers |
215 | */ | 215 | */ |
216 | bClassificationSucceed = MatchProtocol(pstClassifierRule, ucNextProtocolAboveIP); | 216 | bClassificationSucceed = MatchProtocol(pstClassifierRule, ucNextProtocolAboveIP); |
217 | if (!bClassificationSucceed) | 217 | if (!bClassificationSucceed) |
218 | break; | 218 | break; |
219 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "\nIPv6 Protocol Matched"); | 219 | |
220 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "\nIPv6 Protocol Matched"); | ||
220 | 221 | ||
221 | if ((ucNextProtocolAboveIP == TCP_HEADER_TYPE) || (ucNextProtocolAboveIP == UDP_HEADER_TYPE)) { | 222 | if ((ucNextProtocolAboveIP == TCP_HEADER_TYPE) || (ucNextProtocolAboveIP == UDP_HEADER_TYPE)) { |
222 | /* Match Src Port */ | 223 | /* Match Src Port */ |
@@ -239,7 +240,7 @@ USHORT IpVersion6(PMINI_ADAPTER Adapter, PVOID pcIpHeader, | |||
239 | if (TRUE == bClassificationSucceed) { | 240 | if (TRUE == bClassificationSucceed) { |
240 | INT iMatchedSFQueueIndex = 0; | 241 | INT iMatchedSFQueueIndex = 0; |
241 | iMatchedSFQueueIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID); | 242 | iMatchedSFQueueIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID); |
242 | if(iMatchedSFQueueIndex >= NO_OF_QUEUES) { | 243 | if (iMatchedSFQueueIndex >= NO_OF_QUEUES) { |
243 | bClassificationSucceed = FALSE; | 244 | bClassificationSucceed = FALSE; |
244 | } else { | 245 | } else { |
245 | if (FALSE == Adapter->PackInfo[iMatchedSFQueueIndex].bActive) { | 246 | if (FALSE == Adapter->PackInfo[iMatchedSFQueueIndex].bActive) { |
@@ -286,7 +287,7 @@ static BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule, IPV6Hea | |||
286 | for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) { | 287 | for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) { |
287 | if ((pstClassifierRule->stSrcIpAddress.ulIpv6Mask[uiLoopIndex+uiIpv6AddIndex] & aulSrcIP[uiIpv6AddIndex]) | 288 | if ((pstClassifierRule->stSrcIpAddress.ulIpv6Mask[uiLoopIndex+uiIpv6AddIndex] & aulSrcIP[uiIpv6AddIndex]) |
288 | != pstClassifierRule->stSrcIpAddress.ulIpv6Addr[uiLoopIndex+uiIpv6AddIndex]) { | 289 | != pstClassifierRule->stSrcIpAddress.ulIpv6Addr[uiLoopIndex+uiIpv6AddIndex]) { |
289 | /* | 290 | /* |
290 | * Match failed for current Ipv6 Address | 291 | * Match failed for current Ipv6 Address |
291 | * Try next Ipv6 Address | 292 | * Try next Ipv6 Address |
292 | */ | 293 | */ |
@@ -310,9 +311,9 @@ static BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule, IPV6He | |||
310 | UINT uiIpv6AddrNoLongWords = 4; | 311 | UINT uiIpv6AddrNoLongWords = 4; |
311 | ULONG aulDestIP[4]; | 312 | ULONG aulDestIP[4]; |
312 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); | 313 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); |
313 | /* | 314 | /* |
314 | * This is the no. of Destination Addresses | 315 | * This is the no. of Destination Addresses |
315 | * ie Range of IP Addresses contained in the classifier rule | 316 | * ie Range of IP Addresses contained in the classifier rule |
316 | * for which we need to match | 317 | * for which we need to match |
317 | */ | 318 | */ |
318 | UINT uiCountIPDestinationAddresses = (UINT)pstClassifierRule->ucIPDestinationAddressLength; | 319 | UINT uiCountIPDestinationAddresses = (UINT)pstClassifierRule->ucIPDestinationAddressLength; |
@@ -338,7 +339,7 @@ static BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule, IPV6He | |||
338 | for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) { | 339 | for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) { |
339 | if ((pstClassifierRule->stDestIpAddress.ulIpv6Mask[uiLoopIndex+uiIpv6AddIndex] & aulDestIP[uiIpv6AddIndex]) | 340 | if ((pstClassifierRule->stDestIpAddress.ulIpv6Mask[uiLoopIndex+uiIpv6AddIndex] & aulDestIP[uiIpv6AddIndex]) |
340 | != pstClassifierRule->stDestIpAddress.ulIpv6Addr[uiLoopIndex+uiIpv6AddIndex]) { | 341 | != pstClassifierRule->stDestIpAddress.ulIpv6Addr[uiLoopIndex+uiIpv6AddIndex]) { |
341 | /* | 342 | /* |
342 | * Match failed for current Ipv6 Address. | 343 | * Match failed for current Ipv6 Address. |
343 | * Try next Ipv6 Address | 344 | * Try next Ipv6 Address |
344 | */ | 345 | */ |
@@ -377,8 +378,8 @@ static VOID DumpIpv6Header(IPV6Header *pstIpv6Header) | |||
377 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Version : %x \n", ucVersion); | 378 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Version : %x \n", ucVersion); |
378 | ucPrio = pstIpv6Header->ucVersionPrio & 0x0f; | 379 | ucPrio = pstIpv6Header->ucVersionPrio & 0x0f; |
379 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Priority : %x \n", ucPrio); | 380 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Priority : %x \n", ucPrio); |
380 | /* | 381 | /* |
381 | * BCM_DEBUG_PRINT( Adapter,DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, | 382 | * BCM_DEBUG_PRINT( Adapter,DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, |
382 | * "Flow Label : %x \n",(pstIpv6Header->ucVersionPrio &0xf0); | 383 | * "Flow Label : %x \n",(pstIpv6Header->ucVersionPrio &0xf0); |
383 | */ | 384 | */ |
384 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Payload Length : %x \n", ntohs(pstIpv6Header->usPayloadLength)); | 385 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Payload Length : %x \n", ntohs(pstIpv6Header->usPayloadLength)); |