Lines Matching refs:ictx
179 static struct wncm14a2a_iface_ctx ictx; variable
244 if (!ictx.sockets[i].context) { in socket_get()
245 sock = &ictx.sockets[i]; in socket_get()
263 if (ictx.sockets[i].socket_id == socket_id) { in socket_from_id()
264 sock = &ictx.sockets[i]; in socket_from_id()
312 ictx.last_error = 0; in send_at_cmd()
315 mdm_receiver_send(&ictx.mdm_ctx, data, strlen(data)); in send_at_cmd()
316 mdm_receiver_send(&ictx.mdm_ctx, "\r\n", 2); in send_at_cmd()
323 k_sem_reset(&ictx.response_sem); in send_at_cmd()
324 ret = k_sem_take(&ictx.response_sem, K_MSEC(timeout)); in send_at_cmd()
331 ret = ictx.last_error; in send_at_cmd()
349 ictx.last_error = 0; in send_data()
355 mdm_receiver_send(&ictx.mdm_ctx, buf, strlen(buf)); in send_data()
359 mdm_receiver_send(&ictx.mdm_ctx, in send_data()
364 mdm_receiver_send(&ictx.mdm_ctx, "\r\n", 2); in send_data()
368 ret = ictx.last_error; in send_data()
515 ictx.last_socket_id = atoi(value); in on_cmd_atcmdecho()
522 ictx.last_socket_id = 0; in on_cmd_atcmdecho_nosock()
529 out_len = net_buf_linearize(ictx.mdm_manufacturer, in on_cmd_atcmdinfo_manufacturer()
530 sizeof(ictx.mdm_manufacturer) - 1, in on_cmd_atcmdinfo_manufacturer()
532 ictx.mdm_manufacturer[out_len] = 0; in on_cmd_atcmdinfo_manufacturer()
533 LOG_INF("Manufacturer: %s", ictx.mdm_manufacturer); in on_cmd_atcmdinfo_manufacturer()
540 out_len = net_buf_linearize(ictx.mdm_model, in on_cmd_atcmdinfo_model()
541 sizeof(ictx.mdm_model) - 1, in on_cmd_atcmdinfo_model()
543 ictx.mdm_model[out_len] = 0; in on_cmd_atcmdinfo_model()
544 LOG_INF("Model: %s", ictx.mdm_model); in on_cmd_atcmdinfo_model()
551 out_len = net_buf_linearize(ictx.mdm_revision, in on_cmd_atcmdinfo_revision()
552 sizeof(ictx.mdm_revision) - 1, in on_cmd_atcmdinfo_revision()
554 ictx.mdm_revision[out_len] = 0; in on_cmd_atcmdinfo_revision()
555 LOG_INF("Revision: %s", ictx.mdm_revision); in on_cmd_atcmdinfo_revision()
585 out_len = net_buf_linearize(ictx.mdm_imei, sizeof(ictx.mdm_imei) - 1, in on_cmd_atcmdecho_nosock_imei()
587 ictx.mdm_imei[out_len] = 0; in on_cmd_atcmdecho_nosock_imei()
589 LOG_INF("IMEI: %s", ictx.mdm_imei); in on_cmd_atcmdecho_nosock_imei()
626 ictx.mdm_rssi = atoi(value); in on_cmd_atcmdinfo_rssi()
627 LOG_INF("RSSI: %d", ictx.mdm_rssi); in on_cmd_atcmdinfo_rssi()
638 ictx.last_error = 0; in on_cmd_sockok()
639 sock = socket_from_id(ictx.last_socket_id); in on_cmd_sockok()
641 k_sem_give(&ictx.response_sem); in on_cmd_sockok()
652 ictx.last_error = -EIO; in on_cmd_sockerror()
653 sock = socket_from_id(ictx.last_socket_id); in on_cmd_sockerror()
655 k_sem_give(&ictx.response_sem); in on_cmd_sockerror()
671 ictx.last_error = -atoi(value); in on_cmd_sockexterror()
672 LOG_ERR("@EXTERR:%d", ictx.last_error); in on_cmd_sockexterror()
673 sock = socket_from_id(ictx.last_socket_id); in on_cmd_sockexterror()
675 k_sem_give(&ictx.response_sem); in on_cmd_sockexterror()
689 ictx.last_error = atoi(value); in on_cmd_sockdial()
690 k_sem_give(&ictx.response_sem); in on_cmd_sockdial()
725 sock = socket_from_id(ictx.last_socket_id); in on_cmd_sockwrite()
800 sock = socket_from_id(ictx.last_socket_id); in on_cmd_sockread()
802 LOG_ERR("Socket not found! (%d)", ictx.last_socket_id); in on_cmd_sockread()
970 ictx.ev_csps = atoi(&value[p2]); in on_cmd_socknotifyev()
972 ictx.ev_rrcstate = 1; in on_cmd_socknotifyev()
973 LOG_DBG("CSPS:%d", ictx.ev_csps); in on_cmd_socknotifyev()
976 ictx.ev_rrcstate = atoi(&value[p2]); in on_cmd_socknotifyev()
977 LOG_DBG("RRCSTATE:%d", ictx.ev_rrcstate); in on_cmd_socknotifyev()
1027 ret = mdm_receiver_recv(&ictx.mdm_ctx, in wncm14a2a_read_rx()
1111 (void)k_sem_take(&ictx.mdm_ctx.rx_sem, K_FOREVER); in wncm14a2a_rx()
1270 k_work_reschedule_for_queue(&wncm14a2a_workq, &ictx.rssi_query_work, in wncm14a2a_rssi_query_work()
1279 net_if_carrier_off(ictx.iface); in wncm14a2a_modem_reset()
1283 k_work_cancel_delayable(&ictx.rssi_query_work); in wncm14a2a_modem_reset()
1346 (ictx.mdm_rssi <= -1000 || in wncm14a2a_modem_reset()
1347 ictx.mdm_rssi == 0)) { in wncm14a2a_modem_reset()
1349 k_work_cancel_delayable(&ictx.rssi_query_work); in wncm14a2a_modem_reset()
1354 if (ictx.mdm_rssi <= -1000 || ictx.mdm_rssi == 0) { in wncm14a2a_modem_reset()
1380 net_if_carrier_on(ictx.iface); in wncm14a2a_modem_reset()
1392 (void)memset(&ictx, 0, sizeof(ictx)); in wncm14a2a_init()
1394 k_work_init(&ictx.sockets[i].recv_cb_work, in wncm14a2a_init()
1396 k_sem_init(&ictx.sockets[i].sock_send_sem, 0, 1); in wncm14a2a_init()
1398 k_sem_init(&ictx.response_sem, 0, 1); in wncm14a2a_init()
1405 ictx.last_socket_id = 0; in wncm14a2a_init()
1419 ictx.mdm_ctx.data_manufacturer = ictx.mdm_manufacturer; in wncm14a2a_init()
1420 ictx.mdm_ctx.data_model = ictx.mdm_model; in wncm14a2a_init()
1421 ictx.mdm_ctx.data_revision = ictx.mdm_revision; in wncm14a2a_init()
1423 ictx.mdm_ctx.data_imei = ictx.mdm_imei; in wncm14a2a_init()
1425 ictx.mdm_ctx.data_rssi = &ictx.mdm_rssi; in wncm14a2a_init()
1427 ret = mdm_receiver_register(&ictx.mdm_ctx, MDM_UART_DEV, in wncm14a2a_init()
1441 k_work_init_delayable(&ictx.rssi_query_work, wncm14a2a_rssi_query_work); in wncm14a2a_init()
1728 ictx.last_socket_id = 0; in offload_put()
1785 &ictx, &wncm14a2a_cfg,