Commit 18b338fb3486ac91291e1f94561cb47fd0f4aef2
Committed by
Joe Hershberger
1 parent
5be00a0164
Exists in
master
and in
50 other branches
net: tsec: Fix CamelCase issues around BD code
Fix bufPtr and the rxIdx/ txIdx occurrences to solve the related checkpatch warnings for the coming patches. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Showing 2 changed files with 32 additions and 32 deletions Side-by-side Diff
drivers/net/tsec.c
... | ... | @@ -25,8 +25,8 @@ |
25 | 25 | |
26 | 26 | #define TX_BUF_CNT 2 |
27 | 27 | |
28 | -static uint rxIdx; /* index of the current RX buffer */ | |
29 | -static uint txIdx; /* index of the current TX buffer */ | |
28 | +static uint rx_idx; /* index of the current RX buffer */ | |
29 | +static uint tx_idx; /* index of the current TX buffer */ | |
30 | 30 | |
31 | 31 | typedef volatile struct rtxbd { |
32 | 32 | txbd8_t txbd[TX_BUF_CNT]; |
33 | 33 | |
34 | 34 | |
... | ... | @@ -278,20 +278,20 @@ |
278 | 278 | tsec_send(dev, (void *)pkt, sizeof(pkt)); |
279 | 279 | |
280 | 280 | /* Wait for buffer to be received */ |
281 | - for (t = 0; rtx.rxbd[rxIdx].status & RXBD_EMPTY; t++) { | |
281 | + for (t = 0; rtx.rxbd[rx_idx].status & RXBD_EMPTY; t++) { | |
282 | 282 | if (t >= 10 * TOUT_LOOP) { |
283 | 283 | printf("%s: tsec: rx error\n", dev->name); |
284 | 284 | break; |
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
288 | - if (!memcmp(pkt, (void *)NetRxPackets[rxIdx], sizeof(pkt))) | |
288 | + if (!memcmp(pkt, (void *)NetRxPackets[rx_idx], sizeof(pkt))) | |
289 | 289 | fail = 0; |
290 | 290 | |
291 | - rtx.rxbd[rxIdx].length = 0; | |
292 | - rtx.rxbd[rxIdx].status = | |
293 | - RXBD_EMPTY | (((rxIdx + 1) == PKTBUFSRX) ? RXBD_WRAP : 0); | |
294 | - rxIdx = (rxIdx + 1) % PKTBUFSRX; | |
291 | + rtx.rxbd[rx_idx].length = 0; | |
292 | + rtx.rxbd[rx_idx].status = | |
293 | + RXBD_EMPTY | (((rx_idx + 1) == PKTBUFSRX) ? RXBD_WRAP : 0); | |
294 | + rx_idx = (rx_idx + 1) % PKTBUFSRX; | |
295 | 295 | |
296 | 296 | if (in_be32(®s->ievent) & IEVENT_BSY) { |
297 | 297 | out_be32(®s->ievent, IEVENT_BSY); |
298 | 298 | |
299 | 299 | |
... | ... | @@ -324,21 +324,21 @@ |
324 | 324 | struct tsec __iomem *regs = priv->regs; |
325 | 325 | |
326 | 326 | /* reset the indices to zero */ |
327 | - rxIdx = 0; | |
328 | - txIdx = 0; | |
327 | + rx_idx = 0; | |
328 | + tx_idx = 0; | |
329 | 329 | #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_ETSEC129 |
330 | 330 | uint svr; |
331 | 331 | #endif |
332 | 332 | |
333 | 333 | /* Point to the buffer descriptors */ |
334 | - out_be32(®s->tbase, (unsigned int)(&rtx.txbd[txIdx])); | |
335 | - out_be32(®s->rbase, (unsigned int)(&rtx.rxbd[rxIdx])); | |
334 | + out_be32(®s->tbase, (unsigned int)(&rtx.txbd[tx_idx])); | |
335 | + out_be32(®s->rbase, (unsigned int)(&rtx.rxbd[rx_idx])); | |
336 | 336 | |
337 | 337 | /* Initialize the Rx Buffer descriptors */ |
338 | 338 | for (i = 0; i < PKTBUFSRX; i++) { |
339 | 339 | rtx.rxbd[i].status = RXBD_EMPTY; |
340 | 340 | rtx.rxbd[i].length = 0; |
341 | - rtx.rxbd[i].bufPtr = (uint) NetRxPackets[i]; | |
341 | + rtx.rxbd[i].bufptr = (uint) NetRxPackets[i]; | |
342 | 342 | } |
343 | 343 | rtx.rxbd[PKTBUFSRX - 1].status |= RXBD_WRAP; |
344 | 344 | |
... | ... | @@ -346,7 +346,7 @@ |
346 | 346 | for (i = 0; i < TX_BUF_CNT; i++) { |
347 | 347 | rtx.txbd[i].status = 0; |
348 | 348 | rtx.txbd[i].length = 0; |
349 | - rtx.txbd[i].bufPtr = 0; | |
349 | + rtx.txbd[i].bufptr = 0; | |
350 | 350 | } |
351 | 351 | rtx.txbd[TX_BUF_CNT - 1].status |= TXBD_WRAP; |
352 | 352 | |
353 | 353 | |
354 | 354 | |
355 | 355 | |
... | ... | @@ -378,31 +378,31 @@ |
378 | 378 | struct tsec __iomem *regs = priv->regs; |
379 | 379 | |
380 | 380 | /* Find an empty buffer descriptor */ |
381 | - for (i = 0; rtx.txbd[txIdx].status & TXBD_READY; i++) { | |
381 | + for (i = 0; rtx.txbd[tx_idx].status & TXBD_READY; i++) { | |
382 | 382 | if (i >= TOUT_LOOP) { |
383 | 383 | debug("%s: tsec: tx buffers full\n", dev->name); |
384 | 384 | return result; |
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
388 | - rtx.txbd[txIdx].bufPtr = (uint) packet; | |
389 | - rtx.txbd[txIdx].length = length; | |
390 | - rtx.txbd[txIdx].status |= | |
388 | + rtx.txbd[tx_idx].bufptr = (uint) packet; | |
389 | + rtx.txbd[tx_idx].length = length; | |
390 | + rtx.txbd[tx_idx].status |= | |
391 | 391 | (TXBD_READY | TXBD_LAST | TXBD_CRC | TXBD_INTERRUPT); |
392 | 392 | |
393 | 393 | /* Tell the DMA to go */ |
394 | 394 | out_be32(®s->tstat, TSTAT_CLEAR_THALT); |
395 | 395 | |
396 | 396 | /* Wait for buffer to be transmitted */ |
397 | - for (i = 0; rtx.txbd[txIdx].status & TXBD_READY; i++) { | |
397 | + for (i = 0; rtx.txbd[tx_idx].status & TXBD_READY; i++) { | |
398 | 398 | if (i >= TOUT_LOOP) { |
399 | 399 | debug("%s: tsec: tx error\n", dev->name); |
400 | 400 | return result; |
401 | 401 | } |
402 | 402 | } |
403 | 403 | |
404 | - txIdx = (txIdx + 1) % TX_BUF_CNT; | |
405 | - result = rtx.txbd[txIdx].status & TXBD_STATS; | |
404 | + tx_idx = (tx_idx + 1) % TX_BUF_CNT; | |
405 | + result = rtx.txbd[tx_idx].status & TXBD_STATS; | |
406 | 406 | |
407 | 407 | return result; |
408 | 408 | } |
409 | 409 | |
410 | 410 | |
411 | 411 | |
412 | 412 | |
413 | 413 | |
414 | 414 | |
... | ... | @@ -413,25 +413,25 @@ |
413 | 413 | struct tsec_private *priv = (struct tsec_private *)dev->priv; |
414 | 414 | struct tsec __iomem *regs = priv->regs; |
415 | 415 | |
416 | - while (!(rtx.rxbd[rxIdx].status & RXBD_EMPTY)) { | |
416 | + while (!(rtx.rxbd[rx_idx].status & RXBD_EMPTY)) { | |
417 | 417 | |
418 | - length = rtx.rxbd[rxIdx].length; | |
418 | + length = rtx.rxbd[rx_idx].length; | |
419 | 419 | |
420 | 420 | /* Send the packet up if there were no errors */ |
421 | - if (!(rtx.rxbd[rxIdx].status & RXBD_STATS)) { | |
422 | - NetReceive(NetRxPackets[rxIdx], length - 4); | |
421 | + if (!(rtx.rxbd[rx_idx].status & RXBD_STATS)) { | |
422 | + NetReceive(NetRxPackets[rx_idx], length - 4); | |
423 | 423 | } else { |
424 | 424 | printf("Got error %x\n", |
425 | - (rtx.rxbd[rxIdx].status & RXBD_STATS)); | |
425 | + (rtx.rxbd[rx_idx].status & RXBD_STATS)); | |
426 | 426 | } |
427 | 427 | |
428 | - rtx.rxbd[rxIdx].length = 0; | |
428 | + rtx.rxbd[rx_idx].length = 0; | |
429 | 429 | |
430 | 430 | /* Set the wrap bit if this is the last element in the list */ |
431 | - rtx.rxbd[rxIdx].status = | |
432 | - RXBD_EMPTY | (((rxIdx + 1) == PKTBUFSRX) ? RXBD_WRAP : 0); | |
431 | + rtx.rxbd[rx_idx].status = | |
432 | + RXBD_EMPTY | (((rx_idx + 1) == PKTBUFSRX) ? RXBD_WRAP : 0); | |
433 | 433 | |
434 | - rxIdx = (rxIdx + 1) % PKTBUFSRX; | |
434 | + rx_idx = (rx_idx + 1) % PKTBUFSRX; | |
435 | 435 | } |
436 | 436 | |
437 | 437 | if (in_be32(®s->ievent) & IEVENT_BSY) { |
include/tsec.h
... | ... | @@ -202,14 +202,14 @@ |
202 | 202 | { |
203 | 203 | ushort status; /* Status Fields */ |
204 | 204 | ushort length; /* Buffer length */ |
205 | - uint bufPtr; /* Buffer Pointer */ | |
205 | + uint bufptr; /* Buffer Pointer */ | |
206 | 206 | } txbd8_t; |
207 | 207 | |
208 | 208 | typedef struct rxbd8 |
209 | 209 | { |
210 | 210 | ushort status; /* Status Fields */ |
211 | 211 | ushort length; /* Buffer Length */ |
212 | - uint bufPtr; /* Buffer Pointer */ | |
212 | + uint bufptr; /* Buffer Pointer */ | |
213 | 213 | } rxbd8_t; |
214 | 214 | |
215 | 215 | typedef struct rmon_mib |