net: if: Connect interface with offloaded socket implementation
Instead of keeping a boolean informing whether a network interface is
offloaded at socket layer or not, keep a pointer to a function which
allows to create an offloaded socket. Native interfaces keep this as
NULL, while for offloaded interfaces it allows to connect an offloaded
socket implementation with an interface.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
diff --git a/drivers/modem/simcom-sim7080.c b/drivers/modem/simcom-sim7080.c
index f563706..59954bf 100644
--- a/drivers/modem/simcom-sim7080.c
+++ b/drivers/modem/simcom-sim7080.c
@@ -62,6 +62,8 @@
return data->mac_addr;
}
+static int offload_socket(int family, int type, int proto);
+
/* Setup the Modem NET Interface. */
static void modem_net_iface_init(struct net_if *iface)
{
@@ -73,6 +75,8 @@
data->netif = iface;
socket_offload_dns_register(&offload_dns_ops);
+
+ net_if_socket_offload_set(iface, offload_socket);
}
/**