Lines Matching full:socket

32 /* Default socket context (50CE) */
45 struct eswifi_off_socket *socket = user_data; in __process_received() local
48 k_fifo_cancel_wait(&socket->fifo); in __process_received()
52 k_fifo_put(&socket->fifo, pkt); in __process_received()
59 struct eswifi_off_socket *socket; in eswifi_socket_connect() local
73 socket = &eswifi->socket[sock]; in eswifi_socket_connect()
75 if (socket->state != ESWIFI_SOCKET_STATE_NONE) { in eswifi_socket_connect()
80 socket->peer_addr = *addr; in eswifi_socket_connect()
81 socket->state = ESWIFI_SOCKET_STATE_CONNECTING; in eswifi_socket_connect()
83 ret = __eswifi_off_start_client(eswifi, socket); in eswifi_socket_connect()
85 socket->state = ESWIFI_SOCKET_STATE_CONNECTED; in eswifi_socket_connect()
87 socket->state = ESWIFI_SOCKET_STATE_NONE; in eswifi_socket_connect()
96 struct eswifi_off_socket *socket; in eswifi_socket_listen() local
101 socket = &eswifi->socket[sock]; in eswifi_socket_listen()
103 ret = __eswifi_listen(eswifi, socket, backlog); in eswifi_socket_listen()
121 struct eswifi_off_socket *socket; in __eswifi_socket_accept() local
130 socket = &eswifi->socket[sock]; in __eswifi_socket_accept()
132 ret = __eswifi_accept(eswifi, socket); in __eswifi_socket_accept()
133 socket->accept_cb = __eswifi_socket_accept_cb; in __eswifi_socket_accept()
134 socket->accept_data = addr; in __eswifi_socket_accept()
135 k_sem_reset(&socket->accept_sem); in __eswifi_socket_accept()
140 k_sem_take(&socket->accept_sem, K_FOREVER); in __eswifi_socket_accept()
269 struct eswifi_off_socket *socket; in eswifi_socket_send() local
278 socket = &eswifi->socket[sock]; in eswifi_socket_send()
280 if (socket->state != ESWIFI_SOCKET_STATE_CONNECTED) { in eswifi_socket_send()
285 __select_socket(eswifi, socket->index); in eswifi_socket_send()
324 struct eswifi_off_socket *socket; in eswifi_socket_recv() local
334 socket = &eswifi->socket[sock]; in eswifi_socket_recv()
336 if (socket->prev_pkt_rem) { in eswifi_socket_recv()
337 pkt = socket->prev_pkt_rem; in eswifi_socket_recv()
341 ret = k_work_reschedule_for_queue(&eswifi->work_q, &socket->read_work, K_NO_WAIT); in eswifi_socket_recv()
343 LOG_ERR("Rescheduling socket read error"); in eswifi_socket_recv()
349 pkt = k_fifo_get(&socket->fifo, K_NO_WAIT); in eswifi_socket_recv()
357 pkt = k_fifo_get(&socket->fifo, K_FOREVER); in eswifi_socket_recv()
368 socket->prev_pkt_rem = pkt; in eswifi_socket_recv()
370 socket->prev_pkt_rem = NULL; in eswifi_socket_recv()
375 if (!socket->prev_pkt_rem) { in eswifi_socket_recv()
404 struct eswifi_off_socket *socket; in eswifi_socket_close() local
414 socket = &eswifi->socket[sock]; in eswifi_socket_close()
415 ret = __eswifi_socket_free(eswifi, socket); in eswifi_socket_close()
422 pkt = k_fifo_get(&socket->fifo, K_NO_WAIT); in eswifi_socket_close()
429 if (--socket->usage <= 0) { in eswifi_socket_close()
430 socket->context = NULL; in eswifi_socket_close()
440 struct eswifi_off_socket *socket = NULL; in eswifi_socket_open() local
450 socket = &eswifi->socket[idx]; in eswifi_socket_open()
451 k_fifo_init(&socket->fifo); in eswifi_socket_open()
452 k_sem_init(&socket->read_sem, 0, 200); in eswifi_socket_open()
453 k_sem_init(&socket->accept_sem, 1, 1); in eswifi_socket_open()
454 socket->prev_pkt_rem = NULL; in eswifi_socket_open()
455 socket->recv_cb = __process_received; in eswifi_socket_open()
456 socket->recv_data = socket; in eswifi_socket_open()
458 k_work_reschedule_for_queue(&eswifi->work_q, &socket->read_work, in eswifi_socket_open()
468 struct eswifi_off_socket *socket; in eswifi_socket_poll() local
501 socket = &eswifi->socket[sock]; in eswifi_socket_poll()
503 ret = k_work_reschedule_for_queue(&eswifi->work_q, &socket->read_work, K_NO_WAIT); in eswifi_socket_poll()
505 LOG_ERR("Rescheduling socket read error"); in eswifi_socket_poll()
513 if (socket->state != ESWIFI_SOCKET_STATE_CONNECTED) { in eswifi_socket_poll()
518 if (!k_fifo_is_empty(&socket->fifo)) { in eswifi_socket_poll()
528 ret = k_sem_take(&socket->read_sem, timeout); in eswifi_socket_poll()
545 struct eswifi_off_socket *socket; in eswifi_socket_bind() local
554 socket = &eswifi->socket[sock]; in eswifi_socket_bind()
555 ret = __eswifi_bind(eswifi, socket, addr, addrlen); in eswifi_socket_bind()