canfdtest: can_echo_gen(): introduce struct canfd_frame *tx_frame;

pull/488/head
Marc Kleine-Budde 2023-12-19 15:02:54 +01:00
parent 874b0d9fae
commit 7bb00837d0
1 changed files with 6 additions and 4 deletions

View File

@ -332,13 +332,15 @@ static int can_echo_gen(void)
while (running) { while (running) {
if (unprocessed < inflight_count) { if (unprocessed < inflight_count) {
/* still send messages */ /* still send messages */
tx_frames[send_pos].len = msg_len; struct canfd_frame *tx_frame = &tx_frames[send_pos];
tx_frames[send_pos].can_id = can_id_ping;
tx_frame->len = msg_len;
tx_frame->can_id = can_id_ping;
recv_tx[send_pos] = false; recv_tx[send_pos] = false;
for (i = 0; i < msg_len; i++) for (i = 0; i < msg_len; i++)
tx_frames[send_pos].data[i] = counter + i; tx_frame->data[i] = counter + i;
if (send_frame(&tx_frames[send_pos])) { if (send_frame(tx_frame)) {
err = -1; err = -1;
goto out_free; goto out_free;
} }