From 32a33e5bbc55d5e2ccefb8089221616fdb7a59fd Mon Sep 17 00:00:00 2001 From: gitlab-runner Date: Tue, 17 Dec 2024 05:41:29 -0600 Subject: [PATCH] Upload lwip-network-interface-integration 1.5.0.385 [3108] --- README.md | 4 ++-- RELEASE.md | 12 ++++++++---- include/cy_network_mw_core.h | 21 +++++++++++++++++++++ source/cy_ethernetif.c | 10 ++++++++++ source/cy_network_mw_core.c | 25 ++++++++++++++++++++++++- version.xml | 2 +- 6 files changed, 66 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8d2e39c..c79bfff 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/RELEASE.md b/RELEASE.md index 1ca97a3..d2f4b72 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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 @@ -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 diff --git a/include/cy_network_mw_core.h b/include/cy_network_mw_core.h index bf7c6a5..b254da3 100644 --- a/include/cy_network_mw_core.h +++ b/include/cy_network_mw_core.h @@ -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 * diff --git a/source/cy_ethernetif.c b/source/cy_ethernetif.c index cab70ad..6a0101d 100644 --- a/source/cy_ethernetif.c +++ b/source/cy_ethernetif.c @@ -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) @@ -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) diff --git a/source/cy_network_mw_core.c b/source/cy_network_mw_core.c index 7dc317a..74df5e4 100644 --- a/source/cy_network_mw_core.c +++ b/source/cy_network_mw_core.c @@ -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; @@ -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) @@ -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. */ diff --git a/version.xml b/version.xml index f91ae7d..ab57211 100644 --- a/version.xml +++ b/version.xml @@ -1 +1 @@ -1.4.1.359 +1.5.0.385