This patch enables BSD socket offload to a dedicated TCP/IP offload engine. This provides a simpler, more direct mechanism than going through NET_OFFLOAD (zsock -> net_context -> socket conversions) for those devices which provide complete TCP/IP offload at the BSD socket level, and whose use cases do not require IP routing between multiple network interfaces. To use, configure CONFIG_NET_SOCKETS_OFFLOAD=y, and register socket_offload_ops with this module. Fixes #3706 Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
18 lines
377 B
C
18 lines
377 B
C
/*
|
|
* Copyright (c) 2018 Linaro Limited.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <net/socket_offload.h>
|
|
|
|
/* Only one provider may register socket operations upon boot. */
|
|
const struct socket_offload *socket_ops;
|
|
|
|
void socket_offload_register(const struct socket_offload *ops)
|
|
{
|
|
__ASSERT_NO_MSG(ops);
|
|
__ASSERT_NO_MSG(socket_ops == NULL);
|
|
|
|
socket_ops = ops;
|
|
}
|