Skip to content

Commit

Permalink
Upload lwip-network-interface-integration 1.1.2.268 [1085]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Apr 11, 2023
1 parent 7d8e49c commit e51b176
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 54 deletions.
4 changes: 4 additions & 0 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.1.2

- Minor bug fixes

### v1.1.1

- Minor bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CY_RSLT_NETWORK_NOT_SUPPORTED</b>&#160;&#160;&#160;(<a class="el" href="group__generic__lwip__whd__port__defines.html#ga64411e3dd47f1879323877c2370b9eec">CY_RSLT_NETWORK_PORT_ERR_BASE</a> + 22)</td></tr>
<tr class="memdesc:ga1ae343f44b7540a45f3680ba6d1a7226"><td class="mdescLeft">&#160;</td><td class="mdescRight">Denotes that the feature is not supported. <br /></td></tr>
<tr class="separator:ga1ae343f44b7540a45f3680ba6d1a7226"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadd0ef95e5fb952dd62156060eaf25d2e"><td class="memItemLeft" align="right" valign="top"><a id="gadd0ef95e5fb952dd62156060eaf25d2e" name="gadd0ef95e5fb952dd62156060eaf25d2e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CY_RSLT_NETWORK_LINK_NOT_UP</b>&#160;&#160;&#160;(<a class="el" href="group__generic__lwip__whd__port__defines.html#ga64411e3dd47f1879323877c2370b9eec">CY_RSLT_NETWORK_PORT_ERR_BASE</a> + 23)</td></tr>
<tr class="memdesc:gadd0ef95e5fb952dd62156060eaf25d2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Denotes that the Link is not up. <br /></td></tr>
<tr class="separator:gadd0ef95e5fb952dd62156060eaf25d2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga66482668f42e202a2d493782ea856270" name="ga66482668f42e202a2d493782ea856270"></a>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/api_reference_manual/html/navtreeindex0.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var NAVTREEINDEX0 =
"group__generic__lwip__whd__port__defines.html#gabc1d83188fe0b29bbe0de950519a52a8":[1,1,14],
"group__generic__lwip__whd__port__defines.html#gabe7486b63b0e20d597c80f66b281a6c6":[1,1,3],
"group__generic__lwip__whd__port__defines.html#gac2bfa236e9261ca5bab6e78d6f32d128":[1,1,13],
"group__generic__lwip__whd__port__defines.html#gadd0ef95e5fb952dd62156060eaf25d2e":[1,1,22],
"group__generic__lwip__whd__port__defines.html#gaf293c31318d2af1d62bac43bbdf4a462":[1,1,17],
"group__generic__lwip__whd__port__defines.html#gafc24f9c602ae45614f7231508eb574bf":[1,1,11],
"group__group__lwip__network__interface__integration.html":[1,0],
Expand Down
13 changes: 7 additions & 6 deletions docs/api_reference_manual/html/search/all_1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion include/cy_network_mw_core.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
5 changes: 2 additions & 3 deletions source/cy_ethernetif.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down Expand Up @@ -1013,13 +1013,12 @@ static void ethernetif_input(void *arg)
struct pbuf *p = NULL;
struct eth_hdr *ethhdr;
struct netif *netif = (struct netif *)arg;
bool is_from_isr = false;

cm_cy_log_msg( CYLF_MIDDLEWARE, CY_LOG_DEBUG, "%s():%d netif:[%p]\n", __func__, __LINE__, netif);

while(1)
{
cy_rtos_get_semaphore( &rx_semaphore, CY_RTOS_NEVER_TIMEOUT, is_from_isr );
cy_rtos_get_semaphore( &rx_semaphore, CY_RTOS_NEVER_TIMEOUT, false );

/* Receive data from RX descriptor, post data to queue, enable IRQ. */
NVIC_DisableIRQ((IRQn_Type)108);
Expand Down
2 changes: 1 addition & 1 deletion source/cy_internal.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/cy_lwip_dhcp_server.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/cy_lwip_dhcp_server.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion source/cy_lwip_log.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
59 changes: 23 additions & 36 deletions source/cy_network_mw_core.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down Expand Up @@ -65,7 +65,7 @@
#include "whd_network_types.h"
#include "whd_buffer_api.h"
#include "cy_wifimwcore_eapol.h"
#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
#include "whd_wlioctl.h"
#endif
#endif
Expand Down Expand Up @@ -127,7 +127,7 @@ int errno;

#define MAX_AUTO_IP_RETRIES (5)

#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
#define CY_PRNG_SEED_FEEDBACK_MAX_LOOPS (1000)
#define CY_PRNG_CRC32_POLYNOMIAL (0xEDB88320)
#define CY_PRNG_ADD_CYCLECNT_ENTROPY_EACH_N_BYTE (1024)
Expand Down Expand Up @@ -203,7 +203,7 @@ static uint8_t iface_count = 0;
static uint8_t connectivity_lib_init = 0;
static bool is_tcp_initialized = false;

#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
static uint32_t prng_well512_state[CY_PRNG_WELL512_STATE_SIZE];
static uint32_t prng_well512_index = 0;

Expand Down Expand Up @@ -248,7 +248,7 @@ static err_t ping_send(int socket_hnd, const cy_nw_ip_address_t* address, struct
static err_t ping_recv(int socket_hnd, cy_nw_ip_address_t* address, uint16_t *ping_seq_num);
#endif

#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
static uint32_t prng_well512_get_random ( void );
static void prng_well512_add_entropy( const void* buffer, uint16_t buffer_length );
cy_rslt_t cy_prng_get_random( void* buffer, uint32_t buffer_length );
Expand Down Expand Up @@ -476,9 +476,8 @@ static err_t wifiinit(struct netif *iface)

whd_mac_t macaddr;
whd_interface_t whd_iface = (whd_interface_t)if_ctx->hw_interface;
#ifdef COMPONENT_43907
whd_buffer_t buffer;
whd_buffer_t response;
#ifdef COMPONENT_4390X
uint8_t buffer[WLC_GET_RANDOM_BYTES];
uint32_t *wlan_rand = NULL;
#endif

Expand All @@ -496,35 +495,20 @@ static err_t wifiinit(struct netif *iface)
memcpy(&iface->hwaddr, &macaddr, sizeof(macaddr));
iface->hwaddr_len = sizeof(macaddr);

#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
/*
* CYW43907 kits do not have the TRNG module. Get a random number from the WLAN and feed
* it as a seed to the PRNG function.
* Before invoking whd_cdc_get_iovar_buffer, WHD interface should be initialized.
* Before invoking whd_wifi_get_iovar_buffer, WHD interface should be initialized.
* However, wcminit is called from cy_lwip_add_interface; the WHD interface is an
* input to the cy_lwip_add_interface API. So it is safe to invoke
* whd_cdc_get_iovar_buffer here.
* whd_wifi_get_iovar_buffer here.
*/
if (NULL != whd_cdc_get_iovar_buffer(whd_iface->whd_driver, &buffer, WLC_GET_RANDOM_BYTES, IOVAR_STR_RAND) )
{
whd_result_t whd_result;
whd_result = whd_cdc_send_iovar(whd_iface, CDC_GET, buffer, &response);
if (whd_result != WHD_SUCCESS)
{
whd_buffer_release(whd_iface->whd_driver, response, WHD_NETWORK_RX);
return ERR_IF;
}
wlan_rand = (uint32_t *)whd_buffer_get_current_piece_data_pointer(whd_iface->whd_driver, response);
if ( wlan_rand == NULL )
{
whd_buffer_release(whd_iface->whd_driver, response, WHD_NETWORK_RX);
return ERR_IF;
}
}
else
if(WHD_SUCCESS != whd_wifi_get_iovar_buffer(whd_iface, IOVAR_STR_RAND, buffer, WLC_GET_RANDOM_BYTES))
{
return ERR_IF;
}
wlan_rand = (uint32_t *)buffer;

/* Initialize the mutex to protect the PRNG WELL512 state */
if (cy_prng_mutex_ptr == NULL)
Expand All @@ -536,11 +520,6 @@ static err_t wifiinit(struct netif *iface)
* algorithm as the initial seed value.
*/
cy_prng_add_entropy((const void *)wlan_rand, 4);

/*
* Free the WHD buffer used to get the random number from the WLAN.
*/
whd_buffer_release(whd_iface->whd_driver, response, WHD_NETWORK_RX);
#endif
/*
* Set up the information associated with sending packets
Expand Down Expand Up @@ -1228,7 +1207,7 @@ cy_rslt_t cy_network_remove_nw_interface(cy_network_interface_context *iface_con

SET_IP_NETWORK_INITED(interface_index, false);

#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
/* cy_prng_mutex_ptr is initialized when the first network interface is initialized.
* Deinitialize the mutex only after all the interfaces are deinitialized.
*/
Expand Down Expand Up @@ -1282,6 +1261,14 @@ cy_rslt_t cy_network_ip_up(cy_network_interface_context *iface)
interface_index = (uint8_t)((iface->iface_type == CY_NETWORK_ETH_INTERFACE)? (CY_NETWORK_ETH_INTERFACE + iface->iface_idx) : iface->iface_type);
cm_cy_log_msg(CYLF_MIDDLEWARE, CY_LOG_DEBUG, "interface_index:[%d] \n", interface_index);

#ifdef COMPONENT_CAT3
if(!netif_is_up(LWIP_IP_HANDLE(interface_index)))
{
cm_cy_log_msg(CYLF_MIDDLEWARE, CY_LOG_ERR, "Link is not up \n");
return CY_RSLT_NETWORK_LINK_NOT_UP;
}
#endif

if(is_network_up(interface_index))
{
cm_cy_log_msg(CYLF_MIDDLEWARE, CY_LOG_DEBUG, "Network is already up \n");
Expand Down Expand Up @@ -1887,7 +1874,7 @@ cy_rslt_t cy_network_dhcp_renew(cy_network_interface_context *iface)
}

/* Renew DHCP */
netifapi_netif_common(LWIP_IP_HANDLE(interface_index), (netifapi_void_fn)dhcp_renew, NULL);
netifapi_netif_common(LWIP_IP_HANDLE(interface_index), NULL, dhcp_renew);

cy_rtos_delay_milliseconds(DCHP_RENEWAL_DELAY_IN_MS);

Expand Down Expand Up @@ -2126,7 +2113,7 @@ static cy_rslt_t is_interface_valid(cy_network_interface_context *iface)
return CY_RSLT_SUCCESS;
}

#ifdef COMPONENT_43907
#ifdef COMPONENT_4390X
/* CYW43907 kits do not have a TRNG module.
* The following are the functions to generate pseudorandon numbers.
* These functions are internal to the AnyCloud library; currently used
Expand Down
3 changes: 2 additions & 1 deletion source/cy_nw_mw_core_error.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down Expand Up @@ -100,6 +100,7 @@ extern "C" {
#define CY_RSLT_NETWORK_ERROR_NOMEM (CY_RSLT_NETWORK_PORT_ERR_BASE + 20) /**< Denotes the failure to allocate memory*/
#define CY_RSLT_NETWORK_ERROR_RTOS (CY_RSLT_NETWORK_PORT_ERR_BASE + 21) /**< Denotes the failure from RTOS calls*/
#define CY_RSLT_NETWORK_NOT_SUPPORTED (CY_RSLT_NETWORK_PORT_ERR_BASE + 22) /**< Denotes that the feature is not supported*/
#define CY_RSLT_NETWORK_LINK_NOT_UP (CY_RSLT_NETWORK_PORT_ERR_BASE + 23) /**< Denotes that the Link is not up*/

/**
* \}
Expand Down
2 changes: 1 addition & 1 deletion source/cy_wifimwcore_eapol.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Cypress Semiconductor Corporation (an Infineon company) or
* Copyright 2023, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<version>1.1.1.255</version>
<version>1.1.2.268</version>

0 comments on commit e51b176

Please sign in to comment.