/* This function is called when the socket is to be opened.  */
static int winc1500_get(sa_family_t family, enum net_sock_type type, enum net_ip_protocol ip_proto, struct net_context **context)
/* This function is called when the socket is to be opened.  */
static int winc1500_get(sa_family_t family, enum net_sock_type type, enum net_ip_protocol ip_proto, struct net_context **context)
{
	struct socket_data *sd;
	SOCKET sock;
	if (family != AF_INET) {
		LOG_ERR("Only AF_INET is supported!");
		return -1;
	}
	sock = socket(2, type, 0);
	if (sock < 0) {
		LOG_ERR("socket error!");
		return -1;
	}
	(*context)->offload_context = (void *)(intptr_t)sock;
	sd = &w1500_data.socket_data[sock];
	k_sem_init(&sd->wait_sem, 0, 1);
	sd->context = *context;
	return 0;
}