@@ -319,35 +319,39 @@ static BaseType_t xUltrascaleNetworkInterfaceInitialise( NetworkInterface_t * px
319
319
/* Initialize the mac and set the MAC address at position 1. */
320
320
XEmacPs_SetMacAddress ( pxEMAC_PS , ( void * ) pxEndPoint -> xMACAddress .ucBytes , 1 );
321
321
322
- #if ( ipconfigUSE_LLMNR == 1 )
322
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_LLMNR ) )
323
323
{
324
- #if ( ipconfigUSE_IPv6 == 0 )
324
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv4 ) )
325
325
{
326
326
XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xLLMNR_MacAddress .ucBytes );
327
327
}
328
- #else
328
+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
329
+
330
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
329
331
{
330
332
XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xLLMNR_MacAddressIPv6 .ucBytes );
331
333
}
332
- #endif /* if ( ipconfigUSE_IPv6 == 0 ) */
334
+ #endif /* ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) ) */
333
335
}
334
- #endif /* ipconfigUSE_LLMNR == 1 */
336
+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_LLMNR ) ) */
335
337
336
- #if ( ipconfigUSE_MDNS == 1 )
338
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_MDNS ) )
337
339
{
338
- #if ( ipconfigUSE_IPv6 == 0 )
340
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv4 ) )
339
341
{
340
342
XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xMDNS_MacAddress .ucBytes );
341
343
}
342
- #else
344
+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
345
+
346
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
343
347
{
344
- XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xMDNS_MACAddressIPv6 .ucBytes );
348
+ XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xMDNS_MacAddressIPv6 .ucBytes );
345
349
}
346
- #endif /* if ( ipconfigUSE_IPv6 == 0 ) */
350
+ #endif /* ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) ) */
347
351
}
348
- #endif /* ( ipconfigUSE_MDNS == 1 ) */
352
+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_MDNS) ) */
349
353
350
- #if ( ipconfigUSE_IPv6 != 0 )
354
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
351
355
{
352
356
/* set the solicited-node multicast address */
353
357
for ( NetworkEndPoint_t * pxEndPointIter = FreeRTOS_FirstEndPoint ( pxInterface );
@@ -364,7 +368,7 @@ static BaseType_t xUltrascaleNetworkInterfaceInitialise( NetworkInterface_t * px
364
368
}
365
369
}
366
370
}
367
- #endif /* if ( ipconfigUSE_IPv6 == 0 ) */
371
+ #endif /* ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) ) */
368
372
369
373
/* allow reception of multicast addresses programmed into hash (LLMNR or mDNS) */
370
374
XEmacPs_SetOptions ( pxEMAC_PS , XEMACPS_MULTICAST_OPTION );
@@ -504,7 +508,7 @@ static BaseType_t xUltrascaleNetworkInterfaceOutput( NetworkInterface_t * pxInte
504
508
* the protocol checksum to have a value of zero. */
505
509
pxPacket = ( ProtocolPacket_t * ) ( pxBuffer -> pucEthernetBuffer );
506
510
507
- #if ( ipconfigUSE_IPv6 != 0 )
511
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
508
512
ICMPPacket_IPv6_t * pxICMPPacket = ( ICMPPacket_IPv6_t * ) pxBuffer -> pucEthernetBuffer ;
509
513
510
514
if ( ( pxPacket -> xICMPPacket .xEthernetHeader .usFrameType == ipIPv6_FRAME_TYPE ) &&
@@ -515,16 +519,20 @@ static BaseType_t xUltrascaleNetworkInterfaceOutput( NetworkInterface_t * pxInte
515
519
* so for ICMP and other protocols it must be done manually. */
516
520
usGenerateProtocolChecksum ( pxBuffer -> pucEthernetBuffer , pxBuffer -> xDataLength , pdTRUE );
517
521
}
518
- #endif /* ipconfigUSE_IPv6 */
522
+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv6 ) ) */
519
523
520
- if ( ( pxPacket -> xICMPPacket .xEthernetHeader .usFrameType == ipIPv4_FRAME_TYPE ) &&
521
- ( pxPacket -> xICMPPacket .xIPHeader .ucProtocol == ipPROTOCOL_ICMP ) )
524
+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv4 ) )
522
525
{
523
- /* The EMAC will calculate the checksum of the IP-header.
524
- * It can only calculate protocol checksums of UDP and TCP,
525
- * so for ICMP and other protocols it must be done manually. */
526
- usGenerateProtocolChecksum ( pxBuffer -> pucEthernetBuffer , pxBuffer -> xDataLength , pdTRUE );
526
+ if ( ( pxPacket -> xICMPPacket .xEthernetHeader .usFrameType == ipIPv4_FRAME_TYPE ) &&
527
+ ( pxPacket -> xICMPPacket .xIPHeader .ucProtocol == ipPROTOCOL_ICMP ) )
528
+ {
529
+ /* The EMAC will calculate the checksum of the IP-header.
530
+ * It can only calculate protocol checksums of UDP and TCP,
531
+ * so for ICMP and other protocols it must be done manually. */
532
+ usGenerateProtocolChecksum ( pxBuffer -> pucEthernetBuffer , pxBuffer -> xDataLength , pdTRUE );
533
+ }
527
534
}
535
+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
528
536
}
529
537
#endif /* ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM */
530
538
0 commit comments