modem: quectel-bg9x: implement 'is_supported' socket offload cb

Check if requested socket family, type and protocol are all supported by
the driver, instead of blindly acknowledging every possible variant.

There is explicit support for TCP on top of IPv4 and IPv6.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
Marcin Niestroj 2022-04-07 20:21:11 +02:00 committed by Marti Bolivar
commit f9e2fad7e3

View file

@ -1085,6 +1085,19 @@ static struct net_if_api api_funcs = {
static bool offload_is_supported(int family, int type, int proto)
{
if (family != AF_INET &&
family != AF_INET6) {
return false;
}
if (type != SOCK_STREAM) {
return false;
}
if (proto != IPPROTO_TCP) {
return false;
}
return true;
}