/* This function is called when user wants to mark the socket to be a listening one.  */
static int winc1500_listen(struct net_context *context, int backlog)
/* This function is called when user wants to mark the socket to be a listening one.  */
static int winc1500_listen(struct net_context *context, int backlog)
{
	SOCKET socket = (int)context->offload_context;
	int ret;
	ret = listen((int)context->offload_context, backlog);
	if (ret) {
		LOG_ERR("listen error %d %s!",
			ret, socket_error_string(ret));
		return ret;
	}
	if (k_sem_take(&w1500_data.socket_data[socket].wait_sem,
		       WINC1500_LISTEN_TIMEOUT)) {
		return -ETIMEDOUT;
	}
	return w1500_data.socket_data[socket].ret_code;
}