Skip to content

Commit

Permalink
Upload lwip-network-interface-integration 1.5.0.385 [3108]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Dec 17, 2024
1 parent 158fc3b commit 32a33e5
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ To ensure that all required libraries are fetched, include [ethernet-core-freert

Create the *wifi-core-freertos-lwip-mbedtls.mtb* file with the following content:

`https://github.com/Infineon/wifi-core-freertos-lwip-mbedtls#latest-v1.X#\$$ASSET_REPO$$/wifi-core-freertos-lwip-mbedtls/latest-v1.X`
`https://github.com/Infineon/wifi-core-freertos-lwip-mbedtls#latest-v2.X#\$$ASSET_REPO$$/wifi-core-freertos-lwip-mbedtls/latest-v2.X`

- *For Ethernet applications:*

Create the *ethernet-core-freertos-lwip-mbedtls.mtb* file with the following content:

`https://github.com/Infineon/ethernet-core-freertos-lwip-mbedtls#latest-v1.X#\$$ASSET_REPO$$/ethernet-core-freertos-lwip-mbedtls/latest-v1.X`
`https://github.com/Infineon/ethernet-core-freertos-lwip-mbedtls#latest-v2.X#\$$ASSET_REPO$$/ethernet-core-freertos-lwip-mbedtls/latest-v2.X`

- Run `make getlibs` to fetch all required libraries including the lwip-network-interface-integration library.

Expand Down
12 changes: 8 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ See the [README.md](./README.md) for a complete description of the [lwIP network

## Changelog

### v1.5.0

- Added support for D-cache enablement on XMC7000 devices

### v1.4.1

- Changes to support DHCP or static IP configurations based on device configurator settings
Expand Down Expand Up @@ -57,11 +61,11 @@ This version of the library was validated for compatibility with the following s

| Software and tools | Version |
| :--- | :----: |
| ModusToolbox™ software environment | 3.2 |
| ModusToolbox™ Device Configurator | 4.20 |
| ModusToolbox™ software environment | 3.3 |
| ModusToolbox™ Device Configurator | 5.10 |
| GCC compiler | 11.3.1 |
| IAR compiler | 9.40.2 |
| Arm® compiler 6 | 6.16 |
| IAR compiler | 9.50.2 |
| Arm® compiler 6 | 6.22 |


## Additional information
Expand Down
21 changes: 21 additions & 0 deletions include/cy_network_mw_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,27 @@ typedef void (*cy_network_activity_event_callback_t)(bool event_type);
*/
void cy_network_activity_register_cb(cy_network_activity_event_callback_t cb);

/** \cond INTERNAL */
#if defined(CYBSP_WIFI_CAPABLE)
/**
* RX queue callback function prototype.
* The callback function which can be registered/unregistered to queue any RX packets
* must be of this prototype.
*/
typedef void (*cy_network_rx_queue_callback_t)(void *iface, void* buf);

/**
* Helps to register/unregister a callback function that will be invoked on RX activity on any
* network interface to queue the incoming packets until the network stack is ready to process them.
* Passing "NULL" as cb will deregister the callback.
*
* @param[in] cb RX queue callback function
*
*/
void cy_network_register_rx_queue_cb(cy_network_rx_queue_callback_t cb);
#endif
/** \endcond */

/**
* Notifies the network activity to the Low Power Assistant (LPA) module
*
Expand Down
10 changes: 10 additions & 0 deletions source/cy_ethernetif.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ static void rx_data_event_handler(void* arg)
cy_rtos_count_queue(&rx_input_buffer_queue, &num_waiting);
cm_cy_log_msg(CYLF_MIDDLEWARE, CY_LOG_DEBUG, "the number of items currently in the queue:[%d]\n", num_waiting);
#endif

/* Invalidate dcache if enabled to update dcache's contents after DMA transfer */
#if !defined (CY_DISABLE_XMC7000_DATA_CACHE) && defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
SCB_InvalidateDCache_by_Addr((void *) rx_buffer_info->rx_data_ptr, rx_buffer_info->length);
#endif

/* Call netif->input */
/* If the interface is not yet set up, drop the packet here. */
if (netif->input == NULL || netif->input(p, netif) != ERR_OK)
Expand Down Expand Up @@ -872,6 +878,10 @@ static err_t ethif_output(struct netif *netif, struct pbuf *p)
pbuf_header(p, ETH_PAD_SIZE); /* Reclaim the padding word. */
#endif

#if !defined (CY_DISABLE_XMC7000_DATA_CACHE) && defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)
SCB_CleanDCache_by_Addr((void*)data_buffer[tx_free_buf_index], framelen);
#endif

cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s(): Before Start transmitting frame p->tot_len:[%d] p->len:[%d] \n", __FUNCTION__, p->tot_len, p->len );
#if (CY_IP_MXETH_INSTANCES > 1u)
if(if_ctx->iface_idx == (uint8_t)CY_ECM_INTERFACE_ETH1)
Expand Down
25 changes: 24 additions & 1 deletion source/cy_network_mw_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ int errno;
static cy_network_activity_event_callback_t activity_callback = NULL;
static bool is_dhcp_client_required = false;
#if defined(CYBSP_WIFI_CAPABLE)
static cy_network_rx_queue_callback_t rx_queue_callback = NULL;
static cy_wifimwcore_eapol_packet_handler_t internal_eapol_packet_handler = NULL;
#endif
static cy_network_ip_change_callback_t ip_change_callback = NULL;
Expand Down Expand Up @@ -331,6 +332,15 @@ void cy_network_process_ethernet_data(whd_interface_t iface, whd_buffer_t buf)
activity_callback(false);
}

if(rx_queue_callback)
{
/* rx_queue_callback will be registered only when the network stack is being suspended.
* This will help to queue the incoming packets during the wake sequence until
* the network stack is ready to accept and process packets. */
rx_queue_callback((void*)net_interface, (void*)buf);
return;
}

cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "Send data up to LwIP \n");
/* If the interface is not yet set up, drop the packet */
if (net_interface->input == NULL || net_interface->input(buf, net_interface) != ERR_OK)
Expand Down Expand Up @@ -1680,8 +1690,21 @@ void cy_network_activity_register_cb(cy_network_activity_event_callback_t cb)
cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s(): START \n", __FUNCTION__ );
/* Update the activity callback with the argument passed */
activity_callback = cb;
cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s(): END \n", __FUNCTION__ );}
cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s(): END \n", __FUNCTION__ );
}

#if defined(CYBSP_WIFI_CAPABLE)
/*
* This function helps to register/deregister the callback for queuing the RX packets
*/
void cy_network_register_rx_queue_cb(cy_network_rx_queue_callback_t cb)
{
cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s(): START \n", __FUNCTION__ );
/* Update the RX queue callback with the argument passed */
rx_queue_callback = cb;
cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s(): END \n", __FUNCTION__ );
}
#endif
/*
* This function notifies the network activity to the LPA module.
*/
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<version>1.4.1.359</version>
<version>1.5.0.385</version>

0 comments on commit 32a33e5

Please sign in to comment.