v2.0.1
Resolve warning on changing MTU Reviewed our locking behavior, made tweaks where necessarypull/10/head v2.0.1
parent
7c2583c938
commit
a9233ab3a2
|
|
@ -1,4 +1,4 @@
|
|||
Version 2.0.0
|
||||
Version 2.0.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.
|
||||
|
||||
|
|
|
|||
17
intrepid.c
17
intrepid.c
|
|
@ -57,7 +57,7 @@
|
|||
#define KO_DESC "Netdevice driver for Intrepid CAN/Ethernet devices"
|
||||
#define KO_MAJOR 2
|
||||
#define KO_MINOR 0
|
||||
#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
|
||||
|
||||
|
|
@ -142,12 +142,12 @@ static void intrepid_unpause_all_queues(void)
|
|||
continue;
|
||||
|
||||
ics = netdev_priv(dev);
|
||||
if (ics->is_stopped) {
|
||||
spin_lock_bh(&ics->lock);
|
||||
if (ics->is_stopped) {
|
||||
netif_wake_queue(dev);
|
||||
ics->is_stopped = 0;
|
||||
spin_unlock_bh(&ics->lock);
|
||||
}
|
||||
spin_unlock_bh(&ics->lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,12 +161,12 @@ static void intrepid_pause_all_queues(void)
|
|||
continue;
|
||||
|
||||
ics = netdev_priv(dev);
|
||||
if (!ics->is_stopped) {
|
||||
spin_lock_bh(&ics->lock);
|
||||
if (!ics->is_stopped) {
|
||||
ics->is_stopped = 1;
|
||||
netif_stop_queue(dev);
|
||||
spin_unlock_bh(&ics->lock);
|
||||
}
|
||||
spin_unlock_bh(&ics->lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -347,6 +347,7 @@ static int intrepid_add_can_if(struct intrepid_netdevice **result, const char *r
|
|||
dev->flags |= IFF_ECHO;
|
||||
dev->min_mtu = CAN_MTU;
|
||||
dev->max_mtu = CANFD_MTU;
|
||||
dev->mtu = CANFD_MTU; /* TODO: Check CAN-FD support from usermode daemon */
|
||||
dev->netdev_ops = &intrepid_netdevice_ops;
|
||||
if (requestedName && ((aliasLen = strlen(requestedName)) > 0) && aliasLen < IFALIASZ) {
|
||||
dev->ifalias = kzalloc(sizeof(struct dev_ifalias) + aliasLen + 1, GFP_KERNEL);
|
||||
|
|
@ -371,10 +372,6 @@ static int intrepid_add_can_if(struct intrepid_netdevice **result, const char *r
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if (dev_set_mtu(dev, CANFD_MTU)) {
|
||||
pr_alert("intrepid: Could not set MTU\n");
|
||||
}
|
||||
|
||||
net_devices[i] = dev;
|
||||
*result = ics;
|
||||
|
||||
|
|
@ -541,6 +538,7 @@ static int intrepid_read_messages(int device_index, unsigned int count)
|
|||
|
||||
stats = &device->stats;
|
||||
ics = netdev_priv(device);
|
||||
spin_lock_bh(&ics->lock);
|
||||
currentPosition = ics->from_user;
|
||||
if (count != 1)
|
||||
pr_info("intrepid: reading %d messages\n", count);
|
||||
|
|
@ -569,6 +567,7 @@ static int intrepid_read_messages(int device_index, unsigned int count)
|
|||
pr_warn("intrepid: Dropping message on %s, dropped by kernel", device->name);
|
||||
}
|
||||
|
||||
spin_unlock_bh(&ics->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue