-
Notifications
You must be signed in to change notification settings - Fork 619
Add CSI FW & Driver implementations #7045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
pillip8282
left a comment
There was a problem hiding this 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 | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024 -> 2025
ca01ba7 to
445febd
Compare
| CONFIG_WIFI_CSI_RTL8730E=y | ||
| CONFIG_CSIFW=y | ||
| # CONFIG_CSIFW_LOGS is not set | ||
| # CONFIG_CSIFW_LOGE is not set |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 @@ | |||
|
|
|||
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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(). |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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?
|
Please improve commit messages and PR description & mention the actual implementation being added. |
No description provided.