drivers: can: loopback: process TX callbacks in non-loopback mode
The TX callbacks must be processed regardless of the device being in loopback mode or not. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
af9dd5cb26
commit
a5e534a283
1 changed files with 6 additions and 5 deletions
|
@ -72,6 +72,12 @@ static void tx_thread(void *arg1, void *arg2, void *arg3)
|
|||
|
||||
while (1) {
|
||||
k_msgq_get(&data->tx_msgq, &frame, K_FOREVER);
|
||||
frame.cb(dev, 0, frame.cb_arg);
|
||||
|
||||
if (!data->loopback) {
|
||||
continue;
|
||||
}
|
||||
|
||||
k_mutex_lock(&data->mtx, K_FOREVER);
|
||||
|
||||
for (int i = 0; i < CONFIG_CAN_MAX_FILTER; i++) {
|
||||
|
@ -83,7 +89,6 @@ static void tx_thread(void *arg1, void *arg2, void *arg3)
|
|||
}
|
||||
|
||||
k_mutex_unlock(&data->mtx);
|
||||
frame.cb(dev, 0, frame.cb_arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,10 +139,6 @@ static int can_loopback_send(const struct device *dev,
|
|||
return -ENETDOWN;
|
||||
}
|
||||
|
||||
if (!data->loopback) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
loopback_frame.frame = *frame;
|
||||
loopback_frame.cb = callback;
|
||||
loopback_frame.cb_arg = user_data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue