Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions os/board/rtl8730e/src/component/os/tizenrt/rtk_wifi_csi.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
****************************************************************************/

#define CSI_INTERVAL_TO_TRIG_PERIOD 320 /* Conversion factor to convert interval to trig period */
#define CSI_HEADER_LEN 43 /*CSI packet header length*/

/****************************************************************************
* Private Type Definitions
Expand Down Expand Up @@ -303,6 +304,10 @@ static int rtk_wifi_csi_getcsidata(unsigned char *buffer, size_t buflen) {
if (wifi_csi_report(buflen, buffer, &len) == -1) {
csidbg("ERROR: wifi csi report call failed\n");
len = -EIO;
} else {
if(len > 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ZivLow
when wifi_csi_report returns len = 0, does buffer contains header with csi_data_len = 0

in such case we should add header without check of len > 0

Copy link
Copy Markdown
Contributor

@vibhor-m vibhor-m Apr 17, 2026

Choose a reason for hiding this comment

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

@ZivLow @jwei5
We observed, CSI header length was 44 (trig_flag added in header) when multi station is enabled. Hence adding a constant 43 cannot be done.

An alternate solution can be:
wifi_csi_report fills in 3rd parameter "len", complete buffer length including header.
in case data length is required, header can be parsed for data length

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @vibhor-m , if wifi_csi_report() returns SUCCESS, len will always return the CSI packet length without the header length, and it should not be 0.
But in the abnormal event that it does report 0, the buffer will still contain the CSI header

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ZivLow @jwei5 We observed, CSI header length was 44 (trig_flag added in header) when multi station is enabled. Hence adding a constant 43 cannot be done.

An alternate solution can be: wifi_csi_report fills in 3rd parameter "len", complete buffer length including header. in case data length is required, header can be parsed for data length

Hi @vibhor-m , we would like to clarify that the CSI header length is based on the CSI driver's version. This means that once RTK updates the driver to support multi station CSI, the header length will be 44 regardless of whether the multi-station feature is being used.

Could I check whether there will be a scenario where rtk_wifi_csi.c is not in sync with our CSI driver's version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for explanation. rtk_wifi_csi.c will always be in sync with CSI Driver version. I agree with you.

len = len + CSI_HEADER_LEN;
}
}
rtk_wifi_csi_givesem(&g_rtk_drv->devsem);
return len;
Expand Down