Skip to content

Commit 6981955

Browse files
Cleanup of NXP1060 network driver (#801)
* Update PR template to include checkbox for ut change * Empty-Commit to trigger workflow * Fix issues pointed out in PR comments * Uncrustify: triggered by comment. * Empty-Commit to trigger workflow --------- Co-authored-by: GitHub Action <[email protected]>
1 parent e5e84ef commit 6981955

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

source/portable/NetworkInterface/NXP1060/NetworkInterface.c

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@
6262
/* ENET clock frequency. */
6363
#define EXAMPLE_CLOCK_FREQ CLOCK_GetFreq( kCLOCK_IpgClk )
6464

65-
/*
66-
* Padding of ethernet frames has to be disabled for zero-copy functionality
67-
* since ENET driver requires the starting buffer addresses to be aligned.
68-
*/
69-
#if ETH_PAD_SIZE != 0
70-
#error "ETH_PAD_SIZE != 0"
71-
#endif /* ETH_PAD_SIZE != 0 */
7265

7366
/*******************************************************************************
7467
* Definitions
@@ -235,8 +228,9 @@ static phy_config_t xConfig =
235228
.speed = kPHY_Speed100M, /* Use 100 Mbps configuration (maximum possible
236229
* for this PHY). In case auto-negotiation is
237230
* turned on, this is not used. */
238-
.enableEEE = pdFALSE
239-
}; /* Disable the energy efficient PHY. */
231+
.enableEEE = pdFALSE /* Disable the energy efficient PHY. */
232+
};
233+
240234
/*-----------------------------------------------------------*/
241235
/*-----------------------------------------------------------*/
242236

@@ -409,7 +403,7 @@ BaseType_t xNetworkInterfaceOutput( NetworkBufferDescriptor_t * const pxNetworkB
409403

410404
static void prvEMACHandlerTask( void * parameter )
411405
{
412-
bool LinkUp = false;
406+
bool bLinkUp = false;
413407
status_t readStatus;
414408

415409
/* Wait for the driver to finish starting. */
@@ -424,11 +418,11 @@ static void prvEMACHandlerTask( void * parameter )
424418

425419
do
426420
{
427-
readStatus = PHY_GetLinkStatus( &phyHandle, &LinkUp );
421+
readStatus = PHY_GetLinkStatus( &phyHandle, &bLinkUp );
428422

429423
if( readStatus == kStatus_Success )
430424
{
431-
if( LinkUp == pdFALSE )
425+
if( bLinkUp == pdFALSE )
432426
{
433427
/* The link is down. */
434428
bGlobalLinkStatus = false;
@@ -625,15 +619,15 @@ static status_t xSetupPHY( phy_config_t * pxConfig )
625619
static status_t xWaitPHY( phy_config_t xConfig )
626620
{
627621
status_t xStatus;
628-
bool LinkUp;
629-
bool autoNegotiationComplete;
622+
bool bLinkUp;
623+
bool bAutoNegotiationComplete;
630624
uint8_t ucCounter = 0;
631625

632626
do
633627
{
634-
xStatus = PHY_GetLinkStatus( &phyHandle, &LinkUp );
628+
xStatus = PHY_GetLinkStatus( &phyHandle, &bLinkUp );
635629

636-
if( LinkUp == true )
630+
if( bLinkUp == true )
637631
{
638632
break;
639633
}
@@ -648,7 +642,7 @@ static status_t xWaitPHY( phy_config_t xConfig )
648642
}
649643
while( xStatus == kStatus_Success );
650644

651-
if( LinkUp == false )
645+
if( bLinkUp == false )
652646
{
653647
FreeRTOS_printf( ( "Failed to get the link up." ) );
654648
xStatus = kStatus_Fail;
@@ -659,7 +653,7 @@ static status_t xWaitPHY( phy_config_t xConfig )
659653
}
660654

661655
if( ( xStatus == kStatus_Success ) &&
662-
( LinkUp == true ) &&
656+
( bLinkUp == true ) &&
663657
( xConfig.autoNeg == true ) )
664658
{
665659
/* Reset the counter for next use. */
@@ -669,9 +663,9 @@ static status_t xWaitPHY( phy_config_t xConfig )
669663

670664
do
671665
{
672-
xStatus = PHY_GetAutoNegotiationStatus( &phyHandle, &autoNegotiationComplete );
666+
xStatus = PHY_GetAutoNegotiationStatus( &phyHandle, &bAutoNegotiationComplete );
673667

674-
if( autoNegotiationComplete == true )
668+
if( bAutoNegotiationComplete == true )
675669
{
676670
break;
677671
}
@@ -686,7 +680,7 @@ static status_t xWaitPHY( phy_config_t xConfig )
686680
}
687681
while( xStatus == kStatus_Success );
688682

689-
if( autoNegotiationComplete == false )
683+
if( bAutoNegotiationComplete == false )
690684
{
691685
FreeRTOS_printf( ( "Failed to complete auto-negotiation." ) );
692686
xStatus = kStatus_Fail;

0 commit comments

Comments
 (0)