Skip to content

Conversation

@dalvinder-s
Copy link

No description provided.

pillip8282
pillip8282 previously approved these changes Nov 18, 2025
Copy link
Contributor

@pillip8282 pillip8282 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,17 @@
UTC_TYPE=CHECK
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supported in public build?

#
# CONFIG_EXAMPLES_TAHI is not set
CONFIG_EXAMPLES_WIFIMANAGER_TEST=y
# CONFIG_EXAMPLES_WIFIMANAGER_TEST is not set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can avoid this change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabling this config is causing build error. So did this change to go ahead and fix the wifi manager issue separately

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's resolve build error and avoid changes apart from CSI. Please check in all build config files.

@@ -0,0 +1,276 @@
/****************************************************************************
*
* Copyright 2024 Samsung Electronics All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024 -> 2025

@rajat-samsung rajat-samsung force-pushed the master branch 5 times, most recently from ca01ba7 to 445febd Compare December 22, 2025 11:26
CONFIG_WIFI_CSI_RTL8730E=y
CONFIG_CSIFW=y
# CONFIG_CSIFW_LOGS is not set
# CONFIG_CSIFW_LOGE is not set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep error logs always ON

if (sockfd >= 0) {
struct ifreq req;
if (strlen(ifname) >= IFNAMSIZ) {
return ret;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may require close(sockfd) before return.

int start_csi_framework(csifw_context_t *p_ctx)
{

if (!p_ctx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start_csi_framework is an internal API. The caller of this API has already checked 'csifw_context_t', is it really required to check in every function call.

int csifw_task_Main(int argc, char *argv[])
{

csifw_context_t *p_csifw_ctx = get_csifw_context();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not good.

static csifw_context_t *g_pcsifw_context = NULL;

static means this should not be referenced outside the file of declaration. However, get_csifw_context is a kind of backdoor access to this function.
either remove static from g_pcsifw_context, then you can access it without any function call.
OR
change implementation to not use it outside the file of declaration

#
# CONFIG_EXAMPLES_TAHI is not set
CONFIG_EXAMPLES_WIFIMANAGER_TEST=y
# CONFIG_EXAMPLES_WIFIMANAGER_TEST is not set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's resolve build error and avoid changes apart from CSI. Please check in all build config files.


#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
}
#endif No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an empty line at end of file is guideline. please check all files

@@ -0,0 +1,17 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may remove this code. Automated utc is not supported in this repo.


if (!p_ctx) {
CSIFW_LOGE("Invalid context pointer (NULL)");
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at all other places, you are returning 0 as success and a -ve or +ve number as failure. Please follow same practice

{

csifw_context_t *p_csifw_ctx = get_csifw_context();
//p_csifw_ctx is checked for null in start_csi_framework().
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for such comments

struct icmp_echo_hdr *p_iecho; /* Echo Header */
struct sockaddr *socketAddr; /* Sokcet Address */
pthread_t csi_ping_thread; /* CSI Ping Thread */
struct addrinfo *result; /* Address Information */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'result' what does this mean?
Please use a better name which explain the purpose of this member variable.

return CSIFW_ERROR;
}

*socketAddr = rp->ai_addr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 316 & 320, Code reached this point considering socket API is successful.
is it possible 316 and 320 can fail

break;
}
}
CSIFW_LOGD("Using socket %d for ping operations", *ping_socket);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

socket is created, hence in all failure cases in this function it should be closed.

tv.tv_sec = 1;
tv.tv_usec = 0;

if (setsockopt(*ping_socket, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(struct timeval)) != ERR_OK) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why RCV_TIMEOUT is set to 1 second here?
We are sending ping every few milliseconds.


unsigned char *get_data_buffptr; /* Buffer to get data from driver */
unsigned int task_run_success; /* Track if csifw_task initialization */
unsigned int data_receiver_fd; /* Value from OPEN Driver */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it unsigned int, when using you are copying this in an int variable?
Can we not use it as int directly?

@vibhor-m vibhor-m changed the title Publish CSIFW code to openSource Add CSI FW & Driver implementations Jan 5, 2026
@vibhor-m
Copy link
Contributor

vibhor-m commented Jan 5, 2026

Please improve commit messages and PR description & mention the actual implementation being added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants