Skip to content

nrf70: Fix ret code for xmit #93060

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion drivers/wifi/nrf_wifi/src/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ enum ethernet_hw_caps nrf_wifi_if_caps_get(const struct device *dev)
int nrf_wifi_if_send(const struct device *dev,
struct net_pkt *pkt)
{
int ret = -1;
int ret = -EINVAL;
#ifdef CONFIG_NRF70_DATA_TX
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;
struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL;
Expand Down Expand Up @@ -404,6 +404,7 @@ int nrf_wifi_if_send(const struct device *dev,

if (nbuf == NULL) {
LOG_ERR("%s: allocation failed", __func__);
ret = -ENOMEM;
goto drop;
}

Expand All @@ -420,6 +421,7 @@ int nrf_wifi_if_send(const struct device *dev,
#endif /* CONFIG_NRF70_RAW_DATA_TX */
if ((vif_ctx_zep->if_carr_state != NRF_WIFI_FMAC_IF_CARR_STATE_ON) ||
(!vif_ctx_zep->authorized && !is_eapol(pkt))) {
ret = -EPERM;
goto drop;
}

Expand All @@ -432,6 +434,8 @@ int nrf_wifi_if_send(const struct device *dev,
if (ret == NRF_WIFI_STATUS_FAIL) {
/* FMAC API takes care of freeing the nbuf */
host_stats->total_tx_drop_pkts++;
/* Could be many reasons, but likely no space in the queue */
ret = -ENOBUFS;
}
goto unlock;
drop:
Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/net/net_l2.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct net_l2 {
* This function is used by net core to push a packet to lower layer
* (interface's L2), which in turn might work on the packet relevantly.
* (adding proper header etc...)
* Returns a negative error code, or the number of bytes sent otherwise.
* Returns a negative error code, or 0 if the packet was accepted.
*/
int (*send)(struct net_if *iface, struct net_pkt *pkt);

Expand Down