drivers: modem: Use modem command send_data_nolock
Use the new modem command send_data_nolock function where it was previously just written directly to the interface. Signed-off-by: Joakim Andersson <joerchan@gmail.com>
This commit is contained in:
committed by
Benjamin Cabé
parent
0617b25126
commit
995440b706
@@ -30,7 +30,7 @@ struct modem_shell_user_data {
|
||||
#define ms_context modem_context
|
||||
#define ms_max_context CONFIG_MODEM_CONTEXT_MAX_NUM
|
||||
#define ms_send(ctx_, buf_, size_) \
|
||||
(ctx_->iface.write(&ctx_->iface, buf_, size_))
|
||||
(modem_cmd_send_data_nolock(&ctx_->iface, buf_, size_))
|
||||
#define ms_context_from_id modem_context_from_id
|
||||
#define UART_DEV_NAME(ctx) (ctx->iface.dev->name)
|
||||
#elif defined(CONFIG_MODEM_RECEIVER)
|
||||
|
||||
@@ -484,8 +484,8 @@ static ssize_t send_socket_data(struct modem_socket *sock,
|
||||
}
|
||||
|
||||
/* Write all data on the console and send CTRL+Z. */
|
||||
mctx.iface.write(&mctx.iface, buf, buf_len);
|
||||
mctx.iface.write(&mctx.iface, &ctrlz, 1);
|
||||
modem_cmd_send_data_nolock(&mctx.iface, buf, buf_len);
|
||||
modem_cmd_send_data_nolock(&mctx.iface, &ctrlz, 1);
|
||||
|
||||
/* Wait for 'SEND OK' or 'SEND FAIL' */
|
||||
k_sem_reset(&mdata.sem_response);
|
||||
|
||||
@@ -273,8 +273,8 @@ static ssize_t offload_sendto(void *obj, const void *buf, size_t len, int flags,
|
||||
}
|
||||
|
||||
/* Send data */
|
||||
mctx.iface.write(&mctx.iface, buf, len);
|
||||
mctx.iface.write(&mctx.iface, &ctrlz, 1);
|
||||
modem_cmd_send_data_nolock(&mctx.iface, buf, len);
|
||||
modem_cmd_send_data_nolock(&mctx.iface, &ctrlz, 1);
|
||||
|
||||
/* Wait for the OK */
|
||||
k_sem_reset(&mdata.sem_response);
|
||||
|
||||
@@ -415,7 +415,7 @@ static ssize_t send_socket_data(void *obj,
|
||||
if (len == 0) {
|
||||
break;
|
||||
}
|
||||
mctx.iface.write(&mctx.iface, msg->msg_iov[i].iov_base, len);
|
||||
modem_cmd_send_data_nolock(&mctx.iface, msg->msg_iov[i].iov_base, len);
|
||||
buf_len -= len;
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ static ssize_t send_cert(struct modem_socket *sock,
|
||||
|
||||
/* slight pause per spec so that @ prompt is received */
|
||||
k_sleep(MDM_PROMPT_CMD_DELAY);
|
||||
mctx.iface.write(&mctx.iface, cert_data, cert_len);
|
||||
modem_cmd_send_data_nolock(&mctx.iface, cert_data, cert_len);
|
||||
|
||||
ret = k_sem_take(&mdata.sem_response, K_MSEC(1000));
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ static int _sock_send(struct esp_socket *sock, struct net_pkt *pkt)
|
||||
frag = pkt->frags;
|
||||
while (frag && pkt_len) {
|
||||
write_len = MIN(pkt_len, frag->len);
|
||||
dev->mctx.iface.write(&dev->mctx.iface, frag->data, write_len);
|
||||
modem_cmd_send_data_nolock(&dev->mctx.iface, frag->data, write_len);
|
||||
pkt_len -= write_len;
|
||||
frag = frag->frags;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user