mirror of
https://github.com/intrepidcs/intrepid-socketcan-kernel-module.git
synced 2026-09-21 16:38:39 +02:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e9319c3f4 | ||
|
|
7c2338125f | ||
|
|
7924117c2a | ||
|
|
c515de3a25 |
@@ -1,3 +1,13 @@
|
||||
v2.1.1
|
||||
Fix support for kernels <5.12
|
||||
Tested on 5.4.0
|
||||
|
||||
v2.1.0
|
||||
Implement proper functionality for echoing transmits
|
||||
Transmit errors are now reported properly
|
||||
Transmit byte count is now reported properly
|
||||
Use with icsscand >= v2.1.0 for full echo support
|
||||
|
||||
v2.0.5
|
||||
Add support for kernels 5.9+
|
||||
Tested on 5.11.0-rc5
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Version 2.0.5
|
||||
Version 2.1.0
|
||||
|
||||
This is the kernel object portion of the Intrepid Control Systems SocketCAN support. For SocketCAN to work with Intrepid devices you will need to have this kernel object loaded on your system. Once the module is built and loaded run [icsscand](https://github.com/intrepidcs/icsscand) to turn on SocketCAN support.
|
||||
|
||||
|
||||
+18
-5
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* intrepid.c - Netdevice driver for Intrepid CAN/Ethernet devices
|
||||
*
|
||||
* Copyright (c) 2016-2019 Intrepid Control Systems, Inc.
|
||||
* Copyright (c) 2016-2022 Intrepid Control Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -57,7 +57,7 @@
|
||||
#define KO_DESC "Netdevice driver for Intrepid CAN/Ethernet devices"
|
||||
#define KO_MAJOR 2
|
||||
#define KO_MINOR 1
|
||||
#define KO_PATCH 0
|
||||
#define KO_PATCH 1
|
||||
#define KO_VERSION str(KO_MAJOR) "." str(KO_MINOR) "." str(KO_PATCH)
|
||||
#define KO_VERSION_INT (KO_MAJOR << 16) | (KO_MINOR << 8) | KO_PATCH
|
||||
|
||||
@@ -93,6 +93,7 @@ MODULE_VERSION(KO_VERSION);
|
||||
#define KERNEL_FAULT_TAKES_VMA (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0))
|
||||
#define KERNEL_SUPPORTS_ALIASES (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
|
||||
#define KERNEL_DEFINES_VM_FAULT_T (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
|
||||
#define KERNEL_CAN_ECHO_TRACKS_LEN (LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0))
|
||||
|
||||
#if KERNEL_DEFINES_VM_FAULT_T == 0
|
||||
typedef int vm_fault_t;
|
||||
@@ -269,7 +270,11 @@ static netdev_tx_t intrepid_netdevice_xmit(struct sk_buff *skb, struct net_devic
|
||||
}
|
||||
|
||||
msg.description = intrepid_next_tx_description(ics, &tx_idx);
|
||||
can_put_echo_skb(skb, dev, tx_idx, msg.length);
|
||||
can_put_echo_skb(skb, dev, tx_idx
|
||||
#if KERNEL_CAN_ECHO_TRACKS_LEN
|
||||
, msg.length
|
||||
#endif
|
||||
);
|
||||
consumed = true;
|
||||
|
||||
/* Copy the message into the usermode box */
|
||||
@@ -537,11 +542,19 @@ static bool handle_transmit_receipt(
|
||||
/* unsuccessful transmits */
|
||||
/* stats are handled in intrepid_fill_canerr_frame_from_neomessage */
|
||||
if (msg->status.globalError) {
|
||||
can_free_echo_skb(device, tx_idx, NULL);
|
||||
can_free_echo_skb(device, tx_idx
|
||||
#if KERNEL_CAN_ECHO_TRACKS_LEN
|
||||
, NULL
|
||||
#endif
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
length = can_get_echo_skb(device, tx_idx, NULL);
|
||||
length = can_get_echo_skb(device, tx_idx
|
||||
#if KERNEL_CAN_ECHO_TRACKS_LEN
|
||||
, NULL
|
||||
#endif
|
||||
);
|
||||
stats->tx_packets++;
|
||||
stats->tx_bytes += length;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user