summaryrefslogtreecommitdiffstats
path: root/hw/net
diff options
context:
space:
mode:
authorJan Charvat2020-09-14 10:09:02 +0200
committerPaolo Bonzini2020-09-30 19:11:36 +0200
commitd44948ccbd56cde7be989da5cc872b0c05bf6224 (patch)
treeb57ab94f03cea57f6e75c11bac3b9b20f30a503d /hw/net
parenttarget/i386: kvm: do not use kvm_check_extension to find paravirtual capabili... (diff)
downloadqemu-d44948ccbd56cde7be989da5cc872b0c05bf6224.tar.gz
qemu-d44948ccbd56cde7be989da5cc872b0c05bf6224.tar.xz
qemu-d44948ccbd56cde7be989da5cc872b0c05bf6224.zip
net/can: Initial host SocketCan support for CAN FD.
Signed-off-by: Jan Charvat <charvj10@fel.cvut.cz> Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Reviewed-by: Vikram Garhwal <fnu.vikram@xilinx.com> Message-Id: <41383d4eb3f35586c696a8e29c4dff4031a81338.1600069689.git.pisa@cmp.felk.cvut.cz> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/can/can_sja1000.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c
index 299932998a..ec66d4232d 100644
--- a/hw/net/can/can_sja1000.c
+++ b/hw/net/can/can_sja1000.c
@@ -268,6 +268,7 @@ static void buff2frame_pel(const uint8_t *buff, qemu_can_frame *frame)
{
uint8_t i;
+ frame->flags = 0;
frame->can_id = 0;
if (buff[0] & 0x40) { /* RTR */
frame->can_id = QEMU_CAN_RTR_FLAG;
@@ -303,6 +304,7 @@ static void buff2frame_bas(const uint8_t *buff, qemu_can_frame *frame)
{
uint8_t i;
+ frame->flags = 0;
frame->can_id = ((buff[0] << 3) & (0xff << 3)) + ((buff[1] >> 5) & 0x07);
if (buff[1] & 0x10) { /* RTR */
frame->can_id = QEMU_CAN_RTR_FLAG;