@@ -129,7 +129,7 @@ static void prvPassEthMessages( NetworkBufferDescriptor_t * pxDescriptor );
129129int is_tx_space_available ( xemacpsif_s * xemacpsif )
130130{
131131 size_t uxCount ;
132- BaseType_t xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
132+ BaseType_t xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
133133
134134 if ( xTXDescriptorSemaphores [ xEMACIndex ] != NULL )
135135 {
@@ -147,7 +147,7 @@ void emacps_check_tx( xemacpsif_s * xemacpsif )
147147{
148148 int tail = xemacpsif -> txTail ;
149149 int head = xemacpsif -> txHead ;
150- BaseType_t xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
150+ BaseType_t xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
151151 size_t uxCount = ( ( UBaseType_t ) ipconfigNIC_N_TX_DESC ) - uxSemaphoreGetCount ( xTXDescriptorSemaphores [ xEMACIndex ] );
152152
153153 /* uxCount is the number of TX descriptors that are in use by the DMA. */
@@ -210,7 +210,7 @@ void emacps_send_handler( void * arg )
210210 BaseType_t xEMACIndex ;
211211
212212 xemacpsif = ( xemacpsif_s * ) arg ;
213- xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
213+ xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
214214
215215 /* This function is called from an ISR. The Xilinx ISR-handler has already
216216 * cleared the TXCOMPL and TXSR_USEDREAD status bits in the XEMACPS_TXSR register.
@@ -254,7 +254,7 @@ XStatus emacps_send_message( xemacpsif_s * xemacpsif,
254254 int txHead = xemacpsif -> txHead ;
255255 int iHasSent = 0 ;
256256 uint32_t ulBaseAddress = xemacpsif -> emacps .Config .BaseAddress ;
257- BaseType_t xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
257+ BaseType_t xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
258258 TickType_t xBlockTimeTicks = pdMS_TO_TICKS ( 5000U );
259259
260260 /* This driver wants to own all network buffers which are to be transmitted. */
@@ -362,7 +362,7 @@ void emacps_recv_handler( void * arg )
362362
363363 xemacpsif = ( xemacpsif_s * ) arg ;
364364 xemacpsif -> isr_events |= EMAC_IF_RX_EVENT ;
365- xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
365+ xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
366366
367367 /* The driver has already cleared the FRAMERX, BUFFNA and error bits
368368 * in the XEMACPS_RXSR register,
@@ -491,7 +491,7 @@ int emacps_check_rx( xemacpsif_s * xemacpsif,
491491 int rx_bytes ;
492492 volatile int msgCount = 0 ;
493493 int rxHead = xemacpsif -> rxHead ;
494- BaseType_t xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
494+ BaseType_t xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
495495 BaseType_t xAccepted ;
496496
497497 #if ( ipconfigUSE_LINKED_RX_MESSAGES != 0 )
@@ -632,7 +632,7 @@ void clean_dma_txdescs( xemacpsif_s * xemacpsif )
632632{
633633 int index ;
634634 unsigned char * ucTxBuffer ;
635- BaseType_t xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
635+ BaseType_t xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
636636
637637 /* Clear all TX descriptors and assign uncached memory to each descriptor.
638638 * "tx_space" points to the first available TX buffer. */
@@ -653,7 +653,7 @@ void clean_dma_txdescs( xemacpsif_s * xemacpsif )
653653XStatus init_dma ( xemacpsif_s * xemacpsif )
654654{
655655 NetworkBufferDescriptor_t * pxBuffer ;
656- BaseType_t xEMACIndex = xemacpsif -> emacps . Config . DeviceId ;
656+ BaseType_t xEMACIndex = get_xEMACIndex ( & xemacpsif -> emacps ) ;
657657
658658 int iIndex ;
659659 UBaseType_t xRxSize ;
0 commit comments