Skip to content

Commit

Permalink
Restyler changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sharad-patil24 committed Apr 5, 2023
1 parent 490e0e6 commit 5f29026
Show file tree
Hide file tree
Showing 24 changed files with 180 additions and 177 deletions.
8 changes: 4 additions & 4 deletions examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_m4.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uint32_t NVIC_GetIRQEnable(IRQn_Type IRQn)
return ((NVIC->ICER[((uint32_t)(IRQn) >> 5)] & (1 << ((uint32_t)(IRQn) &0x1F))) ? 1 : 0);
}

void rsi_assertion(uint16_t assertion_val, const char *string)
void rsi_assertion(uint16_t assertion_val, const char * string)
{
uint16_t i;
if (assertion_val == 0)
Expand Down Expand Up @@ -174,7 +174,7 @@ int rsi_submit_rx_pkt(void)
* This is a common function to read response for all the command and data from Wi-Fi module.
*/

rsi_pkt_t *rsi_frame_read(void)
rsi_pkt_t * rsi_frame_read(void)
{
#ifdef ROM_WIRELESS
return ROMAPI_WL->rsi_frame_read(global_cb_p);
Expand All @@ -198,7 +198,7 @@ rsi_pkt_t *rsi_frame_read(void)
* This is a common function used to process a command to the Wi-Fi module.
*/

int16_t rsi_frame_write(rsi_frame_desc_t *uFrameDscFrame, uint8_t *payloadparam, uint16_t size_param)
int16_t rsi_frame_write(rsi_frame_desc_t * uFrameDscFrame, uint8_t * payloadparam, uint16_t size_param)
{
#ifdef ROM_WIRELESS
return ROMAPI_WL->rsi_frame_write(global_cb_p, uFrameDscFrame, payloadparam, size_param);
Expand Down Expand Up @@ -286,7 +286,7 @@ void rsi_config_m4_dma_desc_on_reset(void)
* 0 = Success
* -2 = Reg read failure
*/
int16_t rsi_device_interrupt_status(uint8_t *int_status)
int16_t rsi_device_interrupt_status(uint8_t * int_status)
{

//! Check for TA active .If it is not active Buffer full status is not valid,
Expand Down
67 changes: 34 additions & 33 deletions examples/platform/silabs/SiWx917/SiWx917/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "rsi_driver.h"
#include "rsi_wlan_non_rom.h"

#include "rsi_bootup_config.h"
#include "rsi_common_apis.h"
#include "rsi_data_types.h"
#include "rsi_error.h"
Expand All @@ -39,7 +40,6 @@
#include "rsi_wlan.h"
#include "rsi_wlan_apis.h"
#include "rsi_wlan_config.h"
#include "rsi_bootup_config.h"

#include "dhcp_client.h"
#include "wfx_rsi.h"
Expand Down Expand Up @@ -70,7 +70,7 @@ extern rsi_semaphore_handle_t sl_rs_ble_init_sem;
* This file implements the interface to the RSI SAPIs
*/
static uint8_t wfx_rsi_drv_buf[WFX_RSI_BUF_SZ];
static wfx_wifi_scan_ext_t *temp_reset;
static wfx_wifi_scan_ext_t * temp_reset;

/******************************************************************
* @fn int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t *ap)
Expand All @@ -80,7 +80,7 @@ static wfx_wifi_scan_ext_t *temp_reset;
* @return
* status
*********************************************************************/
int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t *ap)
int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap)
{
int32_t status;
uint8_t rssi;
Expand All @@ -90,7 +90,7 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t *ap)
status = rsi_wlan_get(RSI_RSSI, &rssi, sizeof(rssi));
if (status == RSI_SUCCESS)
{
ap->rssi = (-1) *rssi;
ap->rssi = (-1) * rssi;
}
return status;
}
Expand All @@ -103,7 +103,7 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t *ap)
* @return
* status
*********************************************************************/
int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t *extra_info)
int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info)
{
int32_t status;
uint8_t buff[RSI_RESPONSE_MAX_SIZE] = { 0 };
Expand All @@ -114,7 +114,7 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t *extra_info)
}
else
{
rsi_wlan_ext_stats_t *test = (rsi_wlan_ext_stats_t *)buff;
rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff;
extra_info->beacon_lost_count = test->beacon_lost_count - temp_reset->beacon_lost_count;
extra_info->beacon_rx_count = test->beacon_rx_count - temp_reset->beacon_rx_count;
extra_info->mcast_rx_count = test->mcast_rx_count - temp_reset->mcast_rx_count;
Expand Down Expand Up @@ -145,7 +145,7 @@ int32_t wfx_rsi_reset_count()
}
else
{
rsi_wlan_ext_stats_t *test = (rsi_wlan_ext_stats_t *)buff;
rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff;
temp_reset->beacon_lost_count = test->beacon_lost_count;
temp_reset->beacon_rx_count = test->beacon_rx_count;
temp_reset->mcast_rx_count = test->mcast_rx_count;
Expand Down Expand Up @@ -181,7 +181,7 @@ int32_t wfx_rsi_disconnect()
* @return
* None
*********************************************************************/
static void wfx_rsi_join_cb(uint16_t status, const uint8_t *buf, const uint16_t len)
static void wfx_rsi_join_cb(uint16_t status, const uint8_t * buf, const uint16_t len)
{
SILABS_LOG("%s: status: %02x", __func__, status);
wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING;
Expand Down Expand Up @@ -219,7 +219,7 @@ static void wfx_rsi_join_cb(uint16_t status, const uint8_t *buf, const uint16_t
* @return
* None
*********************************************************************/
static void wfx_rsi_join_fail_cb(uint16_t status, uint8_t *buf, uint32_t len)
static void wfx_rsi_join_fail_cb(uint16_t status, uint8_t * buf, uint32_t len)
{
SILABS_LOG("%s: error: failed status: %02x", __func__, status);
wfx_rsi.join_retries += 1;
Expand All @@ -238,7 +238,7 @@ static void wfx_rsi_join_fail_cb(uint16_t status, uint8_t *buf, uint32_t len)
* @return
* None
*****************************************************************************************/
static void wfx_rsi_wlan_pkt_cb(uint16_t status, uint8_t *buf, uint32_t len)
static void wfx_rsi_wlan_pkt_cb(uint16_t status, uint8_t * buf, uint32_t len)
{
if (status != RSI_SUCCESS)
{
Expand Down Expand Up @@ -310,7 +310,7 @@ static int32_t wfx_rsi_init(void)
}

SILABS_LOG("%s: WLAN: MAC %02x:%02x:%02x %02x:%02x:%02x", __func__, wfx_rsi.sta_mac.octet[0], wfx_rsi.sta_mac.octet[1],
wfx_rsi.sta_mac.octet[2], wfx_rsi.sta_mac.octet[3], wfx_rsi.sta_mac.octet[4], wfx_rsi.sta_mac.octet[5]);
wfx_rsi.sta_mac.octet[2], wfx_rsi.sta_mac.octet[3], wfx_rsi.sta_mac.octet[4], wfx_rsi.sta_mac.octet[5]);
wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
/*
* Register callbacks - We are only interested in the connectivity CBs
Expand Down Expand Up @@ -346,13 +346,15 @@ static void wfx_rsi_save_ap_info()

status =
rsi_wlan_scan_with_bitmap_options((int8_t *) &wfx_rsi.sec.ssid[0], AP_CHANNEL_NO_0, &rsp, sizeof(rsp), SCAN_BITMAP_OPTN_1);
if (status == RSI_SUCCESS) {
if (status == RSI_SUCCESS)
{
wfx_rsi.sec.security = WFX_SEC_UNSPECIFIED;
wfx_rsi.ap_chan = rsp.scan_info->rf_channel;
memcpy(&wfx_rsi.ap_mac.octet[0], &rsp.scan_info->bssid[0], BSSID_MAX_STR_LEN);
}

switch (rsp.scan_info->security_mode) {
switch (rsp.scan_info->security_mode)
{
case SME_OPEN:
wfx_rsi.sec.security = WFX_SEC_NONE;
break;
Expand All @@ -376,7 +378,7 @@ static void wfx_rsi_save_ap_info()
break;
}
SILABS_LOG("%s: WLAN: connecting to %s==%s, sec=%d, status=%02x", __func__, &wfx_rsi.sec.ssid[0], &wfx_rsi.sec.passkey[0],
wfx_rsi.sec.security, status);
wfx_rsi.sec.security, status);
}

/********************************************************************************************
Expand Down Expand Up @@ -418,7 +420,7 @@ static void wfx_rsi_do_join(void)
}

SILABS_LOG("%s: WLAN: connecting to %s==%s, sec=%d", __func__, &wfx_rsi.sec.ssid[0], &wfx_rsi.sec.passkey[0],
wfx_rsi.sec.security);
wfx_rsi.sec.security);
/*
* Join the network
*/
Expand All @@ -445,16 +447,15 @@ static void wfx_rsi_do_join(void)
{

wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING;
SILABS_LOG("%s: rsi_wlan_connect_async failed with status: %02x on try %d", __func__, status,
wfx_rsi.join_retries);
SILABS_LOG("%s: rsi_wlan_connect_async failed with status: %02x on try %d", __func__, status, wfx_rsi.join_retries);

wfx_retry_interval_handler(is_wifi_disconnection_event, wfx_rsi.join_retries);
wfx_rsi.join_retries++;
}
else
{
SILABS_LOG("%s: starting JOIN to %s after %d tries\n", __func__, (char *) &wfx_rsi.sec.ssid[0],
wfx_rsi.join_retries);
wfx_rsi.join_retries);
break; // exit while loop
}
}
Expand All @@ -473,12 +474,12 @@ static void wfx_rsi_do_join(void)
* None
**********************************************************************************/
/* ARGSUSED */
void wfx_rsi_task(void *arg)
void wfx_rsi_task(void * arg)
{
EventBits_t flags;
int32_t status = 0;
TickType_t last_dhcp_poll, now;
struct netif *sta_netif;
struct netif * sta_netif;
(void) arg;
uint32_t rsi_status = wfx_rsi_init();
if (rsi_status != RSI_SUCCESS)
Expand Down Expand Up @@ -606,13 +607,13 @@ void wfx_rsi_task(void *arg)
SILABS_LOG("%s: start SSID scan", __func__);
int x;
wfx_wifi_scan_result_t ap;
rsi_scan_info_t *scan;
rsi_scan_info_t * scan;
int32_t status;
uint8_t bgscan_results[BG_SCAN_RES_SIZE] = { 0 };
status = rsi_wlan_bgscan_profile(1, (rsi_rsp_scan_t *) bgscan_results, BG_SCAN_RES_SIZE);

SILABS_LOG("%s: status: %02x size = %d", __func__, status, BG_SCAN_RES_SIZE);
rsi_rsp_scan_t *rsp = (rsi_rsp_scan_t *) bgscan_results;
rsi_rsp_scan_t * rsp = (rsi_rsp_scan_t *) bgscan_results;
if (status)
{
/*
Expand All @@ -632,7 +633,7 @@ void wfx_rsi_task(void *arg)
{
SILABS_LOG("Inside ap details");
ap.security = scan->security_mode;
ap.rssi = (-1) *scan->rssi_val;
ap.rssi = (-1) * scan->rssi_val;
memcpy(&ap.bssid[0], &scan->bssid[0], BSSID_MAX_STR_LEN);
(*wfx_rsi.scan_cb)(&ap);
}
Expand All @@ -641,7 +642,7 @@ void wfx_rsi_task(void *arg)
{
SILABS_LOG("Inside else");
ap.security = scan->security_mode;
ap.rssi = (-1) *scan->rssi_val;
ap.rssi = (-1) * scan->rssi_val;
memcpy(&ap.bssid[0], &scan->bssid[0], BSSID_MAX_STR_LEN);
(*wfx_rsi.scan_cb)(&ap);
}
Expand Down Expand Up @@ -690,7 +691,7 @@ void wfx_dhcp_got_ipv4(uint32_t ip)
wfx_rsi.ip4_addr[2] = (ip >> 16) & HEX_VALUE_FF;
wfx_rsi.ip4_addr[3] = (ip >> 24) & HEX_VALUE_FF;
SILABS_LOG("%s: DHCP OK: IP=%d.%d.%d.%d", __func__, wfx_rsi.ip4_addr[0], wfx_rsi.ip4_addr[1], wfx_rsi.ip4_addr[2],
wfx_rsi.ip4_addr[3]);
wfx_rsi.ip4_addr[3]);
wfx_rsi.dev_state |= WFX_RSI_ST_STA_DHCP_DONE;
/* Notify the Connectivity Manager - via the app */
wfx_ip_changed_notify(IP_STATUS_SUCCESS);
Expand All @@ -714,15 +715,15 @@ void wfx_dhcp_got_ipv4(uint32_t ip)
**********************************************************************************************/
void * wfx_rsi_alloc_pkt()
{
rsi_pkt_t *pkt;
rsi_pkt_t * pkt;

// Allocate packet to send data
if ((pkt = rsi_pkt_alloc(&rsi_driver_cb->wlan_cb->wlan_tx_pool)) == NULL)
{
return (void *) 0;
}

return (void *)pkt;
return (void *) pkt;
}

/********************************************************************************************
Expand All @@ -736,11 +737,11 @@ void * wfx_rsi_alloc_pkt()
* @return
* None
**********************************************************************************************/
void wfx_rsi_pkt_add_data(void *p, uint8_t *buf, uint16_t len, uint16_t off)
void wfx_rsi_pkt_add_data(void * p, uint8_t * buf, uint16_t len, uint16_t off)
{
rsi_pkt_t *pkt;
rsi_pkt_t * pkt;

pkt = (rsi_pkt_t *)p;
pkt = (rsi_pkt_t *) p;
memcpy(((char *) pkt->data) + off, buf, len);
}

Expand All @@ -753,11 +754,11 @@ void wfx_rsi_pkt_add_data(void *p, uint8_t *buf, uint16_t len, uint16_t off)
* @return
* None
**********************************************************************************************/
int32_t wfx_rsi_send_data(void *p, uint16_t len)
int32_t wfx_rsi_send_data(void * p, uint16_t len)
{
int32_t status;
register uint8_t *host_desc;
rsi_pkt_t *pkt;
register uint8_t * host_desc;
rsi_pkt_t * pkt;

pkt = (rsi_pkt_t *) p;
host_desc = pkt->desc;
Expand Down
8 changes: 4 additions & 4 deletions examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ extern struct wfx_rsi wfx_rsi;
extern "C" {
#endif
void wfx_rsidev_init(void);
void wfx_rsi_task(void *arg);
void efr32Log(const char *aFormat, ...);
void wfx_rsi_task(void * arg);
void efr32Log(const char * aFormat, ...);
#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
void wfx_ip_changed_notify(int got_ip);
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t *ap);
int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t *extra_info);
int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap);
int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info);
int32_t wfx_rsi_reset_count();
int32_t wfx_rsi_disconnect();
#define SILABS_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
16 changes: 8 additions & 8 deletions examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ bool wfx_is_sta_mode_enabled(void)
* @return
* None
***********************************************************************/
void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t *addr)
void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr)
{
sl_wfx_mac_address_t *mac;
sl_wfx_mac_address_t * mac;

#ifdef SL_WFX_CONFIG_SOFTAP
mac = (interface == SL_WFX_SOFTAP_INTERFACE) ? &wfx_rsi.softap_mac : &wfx_rsi.sta_mac;
Expand All @@ -118,7 +118,7 @@ void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t *a
#endif
*addr = *mac;
SILABS_LOG("%s: %02x:%02x:%02x:%02x:%02x:%02x", __func__, mac->octet[0], mac->octet[1], mac->octet[2], mac->octet[3],
mac->octet[4], mac->octet[5]);
mac->octet[4], mac->octet[5]);
}

/*********************************************************************
Expand All @@ -129,7 +129,7 @@ void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t *a
* @return
* None
***********************************************************************/
void wfx_set_wifi_provision(wfx_wifi_provision_t *cfg)
void wfx_set_wifi_provision(wfx_wifi_provision_t * cfg)
{
SILABS_LOG("%s: SSID: %s", __func__, &wfx_rsi.sec.ssid[0]);

Expand All @@ -145,7 +145,7 @@ void wfx_set_wifi_provision(wfx_wifi_provision_t *cfg)
* @return return false if successful,
* true otherwise
***********************************************************************/
bool wfx_get_wifi_provision(wfx_wifi_provision_t *wifiConfig)
bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig)
{
if (wifiConfig != NULL)
{
Expand Down Expand Up @@ -328,7 +328,7 @@ bool wfx_hw_ready(void)
* @return
* access point information
***********************************************************************/
int32_t wfx_get_ap_info(wfx_wifi_scan_result_t *ap)
int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap)
{
return wfx_rsi_get_ap_info(ap);
}
Expand All @@ -341,7 +341,7 @@ int32_t wfx_get_ap_info(wfx_wifi_scan_result_t *ap)
* @return
* access point extra information
***********************************************************************/
int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t *extra_info)
int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info)
{
return wfx_rsi_get_ap_ext(extra_info);
}
Expand All @@ -368,7 +368,7 @@ int32_t wfx_reset_counts()
* @return returns ture if successful,
* false otherwise
*******************************************************************************/
bool wfx_start_scan(char *ssid, void (*callback)(wfx_wifi_scan_result_t *))
bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *))
{
int sz;

Expand Down
Loading

0 comments on commit 5f29026

Please sign in to comment.