Compare commits
3 Commits
1bdb4bbb50
...
c4828c486d
| Author | SHA1 | Date |
|---|---|---|
|
|
c4828c486d | |
|
|
8ca5fa7fe9 | |
|
|
5123a30746 |
|
|
@ -1,3 +1,6 @@
|
||||||
|
v3.1.2
|
||||||
|
Update kernel logging for dropped messages to pr_debug
|
||||||
|
Added instructions for debug message in README
|
||||||
v3.1.1
|
v3.1.1
|
||||||
Update copyright
|
Update copyright
|
||||||
Fix Ethernet interfaces
|
Fix Ethernet interfaces
|
||||||
|
|
@ -61,4 +64,4 @@ v2.0.1
|
||||||
v2.0.0
|
v2.0.0
|
||||||
Full rewrite
|
Full rewrite
|
||||||
Initial release with CAN-FD support
|
Initial release with CAN-FD support
|
||||||
Requires icsscand >= v2.0.0
|
Requires icsscand >= v2.0.0
|
||||||
|
|
|
||||||
49
README.md
49
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
Version 3.1.1
|
Version 3.1.2
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
|
@ -45,3 +45,50 @@ can_raw
|
||||||
can_dev
|
can_dev
|
||||||
intrepid
|
intrepid
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Dynamic Debug Support
|
||||||
|
|
||||||
|
The module includes debug messages that can be enabled at runtime using the kernel's dynamic debug framework. This requires your kernel to be built with `CONFIG_DYNAMIC_DEBUG=y` (most modern distributions include this).
|
||||||
|
|
||||||
|
### Enabling Debug Messages
|
||||||
|
|
||||||
|
After building and loading the module with the standard `make` and `make install`, you can enable debug output:
|
||||||
|
|
||||||
|
**Enable all debug messages for the intrepid module:**
|
||||||
|
```bash
|
||||||
|
$ echo "module intrepid +p" | sudo tee /sys/kernel/debug/dynamic_debug/control
|
||||||
|
```
|
||||||
|
|
||||||
|
**Disable debug messages:**
|
||||||
|
```bash
|
||||||
|
$ echo "module intrepid -p" | sudo tee /sys/kernel/debug/dynamic_debug/control
|
||||||
|
```
|
||||||
|
|
||||||
|
**Enable debug messages for specific functions:**
|
||||||
|
```bash
|
||||||
|
$ echo "file intrepid.c func function_name +p" | sudo tee /sys/kernel/debug/dynamic_debug/control
|
||||||
|
```
|
||||||
|
|
||||||
|
**View current debug settings:**
|
||||||
|
```bash
|
||||||
|
$ sudo cat /sys/kernel/debug/dynamic_debug/control | grep intrepid
|
||||||
|
```
|
||||||
|
|
||||||
|
**View debug output:**
|
||||||
|
```bash
|
||||||
|
$ sudo dmesg | grep intrepid
|
||||||
|
$ sudo dmesg -w # Follow live output
|
||||||
|
```
|
||||||
|
|
||||||
|
### Available Debug Messages
|
||||||
|
|
||||||
|
The debug messages provide information about:
|
||||||
|
- CAN bittiming configuration
|
||||||
|
- Frame validation and processing
|
||||||
|
- Message dropping conditions
|
||||||
|
- Error handling
|
||||||
|
|
||||||
|
Debug messages are primarily triggered during:
|
||||||
|
- CAN interface configuration
|
||||||
|
- Frame transmission/reception
|
||||||
|
- Error conditions and message drops
|
||||||
|
|
|
||||||
15
intrepid.c
15
intrepid.c
|
|
@ -58,7 +58,7 @@
|
||||||
#define KO_DESC "Netdevice driver for Intrepid CAN/Ethernet devices"
|
#define KO_DESC "Netdevice driver for Intrepid CAN/Ethernet devices"
|
||||||
#define KO_MAJOR 3
|
#define KO_MAJOR 3
|
||||||
#define KO_MINOR 1
|
#define KO_MINOR 1
|
||||||
#define KO_PATCH 1
|
#define KO_PATCH 2
|
||||||
#define KO_VERSION str(KO_MAJOR) "." str(KO_MINOR) "." str(KO_PATCH)
|
#define KO_VERSION str(KO_MAJOR) "." str(KO_MINOR) "." str(KO_PATCH)
|
||||||
#define KO_VERSION_INT (KO_MAJOR << 16) | (KO_MINOR << 8) | KO_PATCH
|
#define KO_VERSION_INT (KO_MAJOR << 16) | (KO_MINOR << 8) | KO_PATCH
|
||||||
|
|
||||||
|
|
@ -71,6 +71,7 @@ MODULE_LICENSE("GPL");
|
||||||
MODULE_AUTHOR("Paul Hollinsky <phollinsky@intrepidcs.com>");
|
MODULE_AUTHOR("Paul Hollinsky <phollinsky@intrepidcs.com>");
|
||||||
MODULE_AUTHOR("Jeffrey Quesnelle <jeffq@intrepidcs.com>");
|
MODULE_AUTHOR("Jeffrey Quesnelle <jeffq@intrepidcs.com>");
|
||||||
MODULE_AUTHOR("Kyle Schwarz <kschwarz@intrepidcs.com>");
|
MODULE_AUTHOR("Kyle Schwarz <kschwarz@intrepidcs.com>");
|
||||||
|
MODULE_AUTHOR("Thomas Stoddard <tstoddard@intrepidcs.com>");
|
||||||
MODULE_VERSION(KO_VERSION);
|
MODULE_VERSION(KO_VERSION);
|
||||||
|
|
||||||
#define INTREPID_DEVICE_NAME "intrepid_netdevice"
|
#define INTREPID_DEVICE_NAME "intrepid_netdevice"
|
||||||
|
|
@ -219,7 +220,7 @@ static netdev_tx_t intrepid_CAN_netdevice_xmit(struct sk_buff *skb, struct net_d
|
||||||
neomessage_can_t msg = {0};
|
neomessage_can_t msg = {0};
|
||||||
|
|
||||||
if (can_dropped_invalid_skb(dev, skb)) {
|
if (can_dropped_invalid_skb(dev, skb)) {
|
||||||
pr_info("intrepid: dropping invalid frame on %s\n", dev->name);
|
pr_debug("intrepid: dropping invalid frame on %s\n", dev->name);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -798,7 +799,7 @@ static int intrepid_add_eth_if(struct intrepid_netdevice **result, const char *r
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strncpy(dev->ifalias->ifalias, requestedName, aliasLen + 1);
|
strncpy(dev->ifalias->ifalias, requestedName, aliasLen + 1);
|
||||||
pr_info("intrepid: %s alias sset to %s\n", dev->name, requestedName);
|
pr_info("intrepid: %s alias set to %s\n", dev->name, requestedName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -866,7 +867,7 @@ static struct sk_buff *intrepid_skb_from_neomessage(
|
||||||
/* input validation */
|
/* input validation */
|
||||||
if (unlikely(device == NULL || msg_generic == NULL || data == NULL || stats == NULL)) {
|
if (unlikely(device == NULL || msg_generic == NULL || data == NULL || stats == NULL)) {
|
||||||
stats->rx_dropped++;
|
stats->rx_dropped++;
|
||||||
pr_warn("intrepid: Dropping message on %s, skb from neomessage input validation failed", device->name);
|
pr_debug("intrepid: Dropping message on %s, skb from neomessage input validation failed", device->name);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
switch (msg_generic->type) {
|
switch (msg_generic->type) {
|
||||||
|
|
@ -928,12 +929,12 @@ static struct sk_buff *intrepid_skb_from_neomessage(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr_warn("intrepid: Dropping message on %s, invalid type %d", device->name, msg_generic->type);
|
pr_debug("intrepid: Dropping message on %s, invalid type %d", device->name, msg_generic->type);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(ret != 0)) {
|
if (unlikely(ret != 0)) {
|
||||||
pr_warn("intrepid: Dropping message on %s, frame fill failed", device->name);
|
pr_debug("intrepid: Dropping message on %s, frame fill failed", device->name);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
|
@ -977,7 +978,7 @@ static int intrepid_read_messages(int device_index, unsigned int count)
|
||||||
ret = netif_rx(skb);
|
ret = netif_rx(skb);
|
||||||
|
|
||||||
if (ret == NET_RX_DROP)
|
if (ret == NET_RX_DROP)
|
||||||
pr_warn("intrepid: Dropping message on %s, dropped by kernel", device->name);
|
pr_debug("intrepid: Dropping message on %s, dropped by kernel", device->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_bh(&ics->lock);
|
spin_unlock_bh(&ics->lock);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue