Skip to content
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

Build warnings in 2.9.1 #13

Open
adam-durridge opened this issue Jan 24, 2024 · 2 comments
Open

Build warnings in 2.9.1 #13

adam-durridge opened this issue Jan 24, 2024 · 2 comments

Comments

@adam-durridge
Copy link

adam-durridge commented Jan 24, 2024

While updating from 2.8.0 to 2.9.0 I ran into these two "assignment from incompatible pointer type [-Wincompatible-pointer-types]" warnings in rsi_wlan_apis.c:

rsi_wlan_cb_non_rom->callback_list.sl_wifi_btr_80211_data_receive_cb = callback_handler_ptr;

and

rsi_wlan_cb_non_rom->callback_list.sl_wifi_btr_80211_tx_data_status_cb = callback_handler_ptr;

Both lines are in uint16_t rsi_wlan_register_callbacks().

This function takes a callback handler pointer of this type as an argument:
void (*callback_handler_ptr)(uint16_t status, uint8_t *buffer, const uint32_t length))

The two callbacks in question have these prototypes:
void (*sl_wifi_btr_80211_data_receive_cb)(RSI_STATUS status, uint8_t *buffer, uint32_t length, int8_t rssi, uint32_t rate);

and

void (*sl_wifi_btr_80211_tx_data_status_cb)(uint16_t status, uint32_t token, uint8_t priority, uint32_t rate);

I'm not currently using this feature, however I'd like to get rid of the warnings without hacking it up too badly.

@adam-durridge
Copy link
Author

adam-durridge commented Jan 24, 2024

I think the extra arguments could just be sent as the normal payload. It looks like they get set by reading into the payload using host_desc[] and reading beyond its 16 byte size:

if (rsi_wlan_cb_non_rom->callback_list.sl_wifi_btr_80211_data_receive_cb != NULL) {
rssi = host_desc[16];
rate = host_desc[18];
payload_offset = host_desc[4];
// Call asynchronous Wi-Fi BTR 802.11 data receive handler to indicate to host
rsi_wlan_cb_non_rom->callback_list.sl_wifi_btr_80211_data_receive_cb(0,
payload + payload_offset,
payload_length - payload_offset,
rssi,
rate);
} else if (rsi_wlan_cb_non_rom->callback_list.wlan_data_receive_handler != NULL) {

and

case SL_WIFI_BTR_TX_DATA_STATUS: {
uint16_t status;
uint32_t token, rate;
uint8_t priority;
status = host_desc[15];
token = rsi_bytes4R_to_uint32(&host_desc[24]);
rate = host_desc[16];
priority = host_desc[20];
if (rsi_wlan_cb_non_rom->callback_list.sl_wifi_btr_80211_tx_data_status_cb != NULL) {
// Call asynchronous response handler to indicate to host
rsi_wlan_cb_non_rom->callback_list.sl_wifi_btr_80211_tx_data_status_cb(status, token, priority, rate);
}
} break;

// host descriptor
uint8_t desc[16];
// payload
uint8_t data[1];
} rsi_pkt_t;

@adam-durridge
Copy link
Author

adam-durridge commented Mar 21, 2024

Still an issue in 2.9.1, updating title

@adam-durridge adam-durridge changed the title Build warnings in 2.9.0 Build warnings in 2.9.1 Mar 21, 2024
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

No branches or pull requests

1 participant