Skip to content

Commit 995440b

Browse files
joerchankartben
authored andcommitted
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>
1 parent 0617b25 commit 995440b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

drivers/modem/modem_shell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct modem_shell_user_data {
3030
#define ms_context modem_context
3131
#define ms_max_context CONFIG_MODEM_CONTEXT_MAX_NUM
3232
#define ms_send(ctx_, buf_, size_) \
33-
(ctx_->iface.write(&ctx_->iface, buf_, size_))
33+
(modem_cmd_send_data_nolock(&ctx_->iface, buf_, size_))
3434
#define ms_context_from_id modem_context_from_id
3535
#define UART_DEV_NAME(ctx) (ctx->iface.dev->name)
3636
#elif defined(CONFIG_MODEM_RECEIVER)

drivers/modem/quectel-bg9x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ static ssize_t send_socket_data(struct modem_socket *sock,
484484
}
485485

486486
/* Write all data on the console and send CTRL+Z. */
487-
mctx.iface.write(&mctx.iface, buf, buf_len);
488-
mctx.iface.write(&mctx.iface, &ctrlz, 1);
487+
modem_cmd_send_data_nolock(&mctx.iface, buf, buf_len);
488+
modem_cmd_send_data_nolock(&mctx.iface, &ctrlz, 1);
489489

490490
/* Wait for 'SEND OK' or 'SEND FAIL' */
491491
k_sem_reset(&mdata.sem_response);

drivers/modem/simcom-sim7080.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ static ssize_t offload_sendto(void *obj, const void *buf, size_t len, int flags,
273273
}
274274

275275
/* Send data */
276-
mctx.iface.write(&mctx.iface, buf, len);
277-
mctx.iface.write(&mctx.iface, &ctrlz, 1);
276+
modem_cmd_send_data_nolock(&mctx.iface, buf, len);
277+
modem_cmd_send_data_nolock(&mctx.iface, &ctrlz, 1);
278278

279279
/* Wait for the OK */
280280
k_sem_reset(&mdata.sem_response);

drivers/modem/ublox-sara-r4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static ssize_t send_socket_data(void *obj,
415415
if (len == 0) {
416416
break;
417417
}
418-
mctx.iface.write(&mctx.iface, msg->msg_iov[i].iov_base, len);
418+
modem_cmd_send_data_nolock(&mctx.iface, msg->msg_iov[i].iov_base, len);
419419
buf_len -= len;
420420
}
421421

@@ -494,7 +494,7 @@ static ssize_t send_cert(struct modem_socket *sock,
494494

495495
/* slight pause per spec so that @ prompt is received */
496496
k_sleep(MDM_PROMPT_CMD_DELAY);
497-
mctx.iface.write(&mctx.iface, cert_data, cert_len);
497+
modem_cmd_send_data_nolock(&mctx.iface, cert_data, cert_len);
498498

499499
ret = k_sem_take(&mdata.sem_response, K_MSEC(1000));
500500

drivers/wifi/esp_at/esp_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static int _sock_send(struct esp_socket *sock, struct net_pkt *pkt)
324324
frag = pkt->frags;
325325
while (frag && pkt_len) {
326326
write_len = MIN(pkt_len, frag->len);
327-
dev->mctx.iface.write(&dev->mctx.iface, frag->data, write_len);
327+
modem_cmd_send_data_nolock(&dev->mctx.iface, frag->data, write_len);
328328
pkt_len -= write_len;
329329
frag = frag->frags;
330330
}

0 commit comments

Comments
 (0)