Commit 00895795 authored by Gil Pitney's avatar Gil Pitney Committed by Jukka Rissanen
Browse files

net: Fix assert on net_if_api send for NET_OFFLOAD drivers.



Recently, the wifi net offload driver has been asserting
as init_iface() was checking for api->send != NULL, even in
the case of NET_OFFLOAD

This patch suggests a fix to handle the NET_OFFLOAD case.

Signed-off-by: default avatarGil Pitney <gil.pitney@linaro.org>
parent ae8649c5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -236,11 +236,16 @@ static inline void init_iface(struct net_if *iface)
{
	const struct net_if_api *api = net_if_get_device(iface)->driver_api;

	NET_ASSERT(api && api->init && api->send);
	NET_ASSERT(api && api->init);

	NET_DBG("On iface %p", iface);

	api->init(iface);

	/* Test for api->send only when ip is *not* offloaded: */
	if (!net_if_is_ip_offloaded(iface)) {
		NET_ASSERT(api->send);
	}
}

enum net_verdict net_if_send_data(struct net_if *iface, struct net_pkt *pkt)