Lines Matching refs:sockets
157 if (cfg->sockets[i].id < cfg->base_socket_id) { in modem_socket_get()
167 cfg->sockets[i].sock_fd = zvfs_reserve_fd(); in modem_socket_get()
168 if (cfg->sockets[i].sock_fd < 0) { in modem_socket_get()
173 cfg->sockets[i].family = family; in modem_socket_get()
174 cfg->sockets[i].type = type; in modem_socket_get()
175 cfg->sockets[i].ip_proto = proto; in modem_socket_get()
176 cfg->sockets[i].id = (cfg->assign_id) ? (i + cfg->base_socket_id) : in modem_socket_get()
178 zvfs_finalize_typed_fd(cfg->sockets[i].sock_fd, &cfg->sockets[i], in modem_socket_get()
182 return cfg->sockets[i].sock_fd; in modem_socket_get()
192 if (cfg->sockets[i].sock_fd == sock_fd) { in modem_socket_from_fd()
194 return &cfg->sockets[i]; in modem_socket_from_fd()
214 if (cfg->sockets[i].id == id) { in modem_socket_from_id()
216 return &cfg->sockets[i]; in modem_socket_from_id()
414 int modem_socket_init(struct modem_socket_config *cfg, struct modem_socket *sockets, in modem_socket_init() argument
419 if (cfg == NULL || sockets == NULL || sockets_len < 1 || vtable == NULL) { in modem_socket_init()
424 cfg->sockets = sockets; in modem_socket_init()
434 memset(&cfg->sockets[i], 0, sizeof(cfg->sockets[i])); in modem_socket_init()
437 k_sem_init(&cfg->sockets[i].sem_data_ready, 0, 1); in modem_socket_init()
438 k_poll_signal_init(&cfg->sockets[i].sig_data_ready); in modem_socket_init()
439 cfg->sockets[i].id = -1; in modem_socket_init()