33 Commits
Author SHA1 Message Date
chgabriel79andGitHub b871a0370e Merge b00c957824 into 1bdb4bbb50 2025-06-03 10:57:44 +02:00
Kyle Schwarz 1bdb4bbb50 3.1.1 2025-05-23 10:21:24 -04:00
Kyle Schwarz 8b5d92d61d Update copyright 2025-05-23 10:18:09 -04:00
Kyle Schwarz 8618f2e75e Fix Ethernet interfaces 2025-05-23 10:17:41 -04:00
Christian Gabriel b00c957824 Setting of individual bit timing and berr reporting
Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-09-25 10:40:29 +02:00
Christian GabrielandKyle Schwarz 7158af4b73 3.1.0
Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-07-23 15:22:00 -04:00
Christian GabrielandKyle Schwarz d66977868f fix: Set CAN state to ERROR_ACTIVE, init supported
Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-07-23 15:22:00 -04:00
Christian GabrielandKyle Schwarz 9dd9a74b9e Add support for bitrate setting
Allow userspace daemon to report currently set bitrates via ioctl.
Also allow setting bitrates via kernel interfaces and report the
new bitrates to userspace daemon

Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-07-23 15:22:00 -04:00
Christian GabrielandKyle Schwarz 760b9d8e34 Add compile-time size checks to neomessage sizes
All versions of the struct need to be the same size. Ensure they are.

Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-07-23 15:22:00 -04:00
Christian GabrielandKyle Schwarz c888a206d9 Save client version
This allows to use old daemons with new versions of the driver
which do not support newer features yet

Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-07-23 15:21:43 -04:00
Christian GabrielandKyle Schwarz b69aaf12ab Add can_priv to intrepid_netdevice
For CAN network devices, the kernel expects struct can_priv as first
member of netdev_priv.

Signed-off-by: Christian Gabriel <ch_gabriel@web.de>
2024-07-23 15:21:43 -04:00
Kyle Schwarz 4841b2863c 3.0.4
- Update copyright
- Add Fedora package requirements to README
2024-01-02 10:24:49 -05:00
Kyle Schwarz 8f5889e129 Add package requirements for Fedora 2024-01-02 10:20:47 -05:00
Kyle Schwarz f92a946a08 Update copyright for 2024 2024-01-02 10:20:23 -05:00
kschwarz-intrepidcsandGitHub 9caa973a5a Merge pull request #16 from genrad/master
Fix for newer 6.4.x Kernel, class_create() sig changed
2023-09-08 10:08:29 -04:00
Kyle Schwarz 67c196ddfe Update daemon version requirement
Bump to 3.1.*
2023-09-07 13:55:08 -04:00
Doug Potts 2ee6101ec2 Fix for newer 6.5 Kernel, class_create() sig changed 2023-09-01 17:00:47 -04:00
Kyle Schwarz f67b4b3620 Bump maximum device count to 64 2023-07-11 22:37:06 -04:00
Kyle Schwarz cd073b2019 3.0.1
Update copyright & changlog
2023-05-05 00:23:51 -04:00
Kyle Schwarz 198cc74e21 Fix usermode daemon version check 2022-09-01 14:29:43 -04:00
Kyle Schwarz e455a8847c Add missing brackets 2022-08-31 16:21:28 -04:00
Gary Chong 5d25e80c35 Added Functionality for Ethernet 2022-08-16 17:21:17 -04:00
Paul Hollinsky 6e9319c3f4 v2.1.1
Fix support for kernels <5.12
	Tested on 5.4.0
2022-04-01 14:24:37 -04:00
Paul Hollinsky 7c2338125f Support kernels before echo lengths were tracked
This applies to anything before 5.12.0
2022-04-01 14:24:02 -04:00
Paul Hollinsky 7924117c2a 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
2022-03-31 18:24:04 -04:00
Paul Hollinsky c515de3a25 Update copyright date to 2022 2022-03-31 18:22:54 -04:00
Paul Hollinsky a46b3c62ed Properly implement IFF_ECHO
Transmit receipts will now be properly reported as echos
upon successful transmission.
2022-03-31 15:39:03 -04:00
Paul Hollinsky 8a21b53cd1 v2.0.5
Add support for kernels 5.9+
	Tested on 5.11.0-rc5

CAN frames with length > 8 from userspace are rejected rather
than truncated
2021-01-29 15:54:24 -05:00
Paul Hollinsky 9da27da69e Use non-sensitive kfree function
This is not sensitive data, kzfree was just used for symmetry.

kzfree was actually renamed to kfree_sensitive to show that
the symmetry was unfounded.

This change will allow us to compile in kernels 5.10+
2021-01-29 15:50:05 -05:00
Paul Hollinsky 6bbcf1b527 Reject CAN frames with length > 8
Previously, they were just truncated.

In any case, this is only hit if the userspace daemon
gives us more than 8 bytes for CAN, which it shouldn't.
2021-01-29 15:47:43 -05:00
ARughani-IntrepidandPaul Hollinsky 668e50d08c Typo "accomplished" 2020-08-06 18:10:07 -04:00
Paul Hollinsky 6025ea1349 v2.0.4
Ensure carrier is up on new kernels which require it
2019-11-13 22:49:35 -05:00
Paul Hollinsky d75acfa8a5 v2.0.3
Add support for kernels 5.1+
	Tested on 5.3.0 (Ubuntu 19.10)
2019-11-06 10:14:53 -05:00
5 changed files with 908 additions and 134 deletions
+4
View File
@@ -98,3 +98,7 @@ extra_certificates
signing_key.priv signing_key.priv
signing_key.x509 signing_key.x509
x509.genkey x509.genkey
.vscode
compile_commands.json
intrepid.mod
+43
View File
@@ -1,3 +1,46 @@
v3.1.1
Update copyright
Fix Ethernet interfaces
v3.0.4
Update copyright
Add Fedora package requirements to README
Fix for newer 6.4.x Kernel, class_create() sig changed (Doug Potts <dpotts@genrad.com>)
v3.0.3
Update daemon version requirement to 3.1.*
v3.0.2
Bump maximum device count to 64
v3.0.1
Update copyright
v3.0.0
Added Functionality for Ethernet
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
CAN frames with length > 8 from userspace are rejected rather than truncated
v2.0.4
Ensure carrier is up on new kernels which require it
v2.0.3
Add support for kernels 5.1+
Tested on 5.3.0 (Ubuntu 19.10)
v2.0.2 v2.0.2
Add support for older kernels Add support for older kernels
Tested working properly back to 4.4 Tested working properly back to 4.4
+4 -4
View File
@@ -1,10 +1,10 @@
Version 2.0.2 Version 3.1.1
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. 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.
First, install the necessary dependencies for building kernel modules. First, install the necessary dependencies for building kernel modules:
- Ubuntu: `sudo apt install linux-headers-generic build-essential gcc git`
On Ubuntu, this is acomplished by running `sudo apt install linux-headers-generic build-essential gcc git` - Fedora: `sudo dnf install git kernel-devel-matched`
Clone this repository by running `git clone https://github.com/intrepidcs/intrepid-socketcan-kernel-module.git` Clone this repository by running `git clone https://github.com/intrepidcs/intrepid-socketcan-kernel-module.git`
+772 -80
View File
File diff suppressed because it is too large Load Diff
+54 -19
View File
@@ -16,12 +16,12 @@ typedef union {
uint32_t extendedFrame : 1; uint32_t extendedFrame : 1;
uint32_t remoteFrame : 1; uint32_t remoteFrame : 1;
uint32_t crcError : 1; uint32_t crcError : 1;
uint32_t canErrorPassive : 1; uint32_t canErrorPassive : 1; // Occupies the same space as headerCRCError
uint32_t incompleteFrame : 1; uint32_t incompleteFrame : 1;
uint32_t lostArbitration : 1; uint32_t lostArbitration : 1;
uint32_t undefinedError : 1; uint32_t undefinedError : 1;
uint32_t canBusOff : 1; uint32_t canBusOff : 1;
uint32_t canErrorWarning : 1; uint32_t canBusRecovered : 1;
uint32_t canBusShortedPlus : 1; uint32_t canBusShortedPlus : 1;
uint32_t canBusShortedGround : 1; uint32_t canBusShortedGround : 1;
uint32_t checksumError : 1; uint32_t checksumError : 1;
@@ -98,6 +98,10 @@ typedef union {
#pragma warning(pop) #pragma warning(pop)
#endif #endif
typedef uint16_t neonetid_t;
typedef uint8_t neonettype_t;
typedef uint16_t neomessagetype_t;
#define ICSNEO_NETWORK_TYPE_INVALID ((uint8_t)0) #define ICSNEO_NETWORK_TYPE_INVALID ((uint8_t)0)
#define ICSNEO_NETWORK_TYPE_INTERNAL ((uint8_t)1) // Used for statuses that don't actually need to be transferred to the client application #define ICSNEO_NETWORK_TYPE_INTERNAL ((uint8_t)1) // Used for statuses that don't actually need to be transferred to the client application
#define ICSNEO_NETWORK_TYPE_CAN ((uint8_t)2) #define ICSNEO_NETWORK_TYPE_CAN ((uint8_t)2)
@@ -109,42 +113,73 @@ typedef union {
#define ICSNEO_NETWORK_TYPE_OTHER ((uint8_t)0xFF) #define ICSNEO_NETWORK_TYPE_OTHER ((uint8_t)0xFF)
typedef struct { typedef struct {
neomessage_statusbitfield_t status; uint8_t _reserved1[16];
uint64_t timestamp; uint64_t timestamp;
uint64_t timestampReserved; uint64_t _reservedTimestamp;
const uint8_t* data; uint8_t _reserved2[sizeof(size_t) * 2 + 7 + sizeof(neonetid_t) + sizeof(neonettype_t)];
size_t length; neomessagetype_t messageType;
uint8_t header[4]; uint8_t _reserved3[12];
uint16_t netid;
uint8_t type;
uint8_t reserved[17];
} neomessage_t; // 72 bytes total } neomessage_t; // 72 bytes total
// Any time you add another neomessage_*_t type, make sure to add it to the static_asserts below! // Any time you add another neomessage_*_t type, make sure to add it to the static_asserts below!
typedef struct { typedef struct {
neomessage_statusbitfield_t status; neomessage_statusbitfield_t status;
uint64_t timestamp; uint64_t timestamp;
uint64_t timestampReserved; uint64_t _reservedTimestamp;
const uint8_t* data;
size_t length;
uint8_t header[4];
neonetid_t netid;
neonettype_t type;
uint8_t _reserved0;
uint16_t description;
neomessagetype_t messageType;
uint8_t _reserved1[12];
} neomessage_frame_t;
typedef struct {
neomessage_statusbitfield_t status;
uint64_t timestamp;
uint64_t _reservedTimestamp;
const uint8_t* data; const uint8_t* data;
size_t length; size_t length;
uint32_t arbid; uint32_t arbid;
uint16_t netid; neonetid_t netid;
uint8_t type; neonettype_t type;
uint8_t dlcOnWire; uint8_t dlcOnWire;
uint8_t reserved[16]; uint16_t description;
neomessagetype_t messageType;
uint8_t _reserved1[12];
} neomessage_can_t; } neomessage_can_t;
typedef struct { typedef struct {
neomessage_statusbitfield_t status; neomessage_statusbitfield_t status;
uint64_t timestamp; uint64_t timestamp;
uint64_t timestampReserved; uint64_t _reservedTimestamp;
size_t _reserved2[2];
uint8_t transmitErrorCount;
uint8_t receiveErrorCount;
uint8_t _reserved3[5];
neonetid_t netid;
neonettype_t type;
neomessagetype_t messageType;
uint8_t _reserved4[12];
} neomessage_can_error_t;
typedef struct {
neomessage_statusbitfield_t status;
uint64_t timestamp;
uint64_t _reservedTimestamp;
const uint8_t* data; const uint8_t* data;
size_t length; size_t length;
uint8_t preemptionFlags; uint8_t preemptionFlags;
uint8_t reservedHeader[3]; uint8_t _reservedHeader[3];
uint16_t netid; neonetid_t netid;
uint8_t type; neonettype_t type;
uint8_t reserved[17]; uint8_t _reserved0;
uint16_t description;
neomessagetype_t messageType;
uint8_t _reserved1[12];
} neomessage_eth_t; } neomessage_eth_t;
#pragma pack(pop) #pragma pack(pop)