Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eead059

Browse files
author
Paolo Abeni
committed
Merge tag 'linux-can-next-for-6.9-20240304' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
Marc Kleine-Budde says: ==================== pull-request: can-next 2024-03-04 this is a pull request of 4 patches for net-next/master. The 1st patch is by Jimmy Assarsson and adds support for the Leaf v3 to the kvaser_usb driver. Martin Jocić's patch targets the kvaser_pciefd driver and adds support for the Kvaser PCIe 8xCAN device. Followed by a patch by me that adds a missing a cpu_to_le32() to the gs_usb driver, the change is not critical as the assigned value is 0. The last patch is also by me and replaces a literal 256 with a proper define. linux-can-next-for-6.9-20240304 * tag 'linux-can-next-for-6.9-20240304' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: mcp251xfd: __mcp251xfd_get_berr_counter(): use CAN_BUS_OFF_THRESHOLD instead of open coding it can: gs_usb: gs_cmd_reset(): use cpu_to_le32() to assign mode can: kvaser_pciefd: Add support for Kvaser PCIe 8xCAN can: kvaser_usb: Add support for Leaf v3 ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 885c36e + 79f7319 commit eead059

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

drivers/net/can/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ config CAN_KVASER_PCIEFD
169169
Kvaser Mini PCI Express 1xCAN v3
170170
Kvaser Mini PCI Express 2xCAN v3
171171
Kvaser M.2 PCIe 4xCAN
172+
Kvaser PCIe 8xCAN
172173

173174
config CAN_SLCAN
174175
tristate "Serial / USB serial CAN Adaptors (slcan)"

drivers/net/can/kvaser_pciefd.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices");
2727
#define KVASER_PCIEFD_BEC_POLL_FREQ (jiffies + msecs_to_jiffies(200))
2828
#define KVASER_PCIEFD_MAX_ERR_REP 256U
2929
#define KVASER_PCIEFD_CAN_TX_MAX_COUNT 17U
30-
#define KVASER_PCIEFD_MAX_CAN_CHANNELS 4UL
30+
#define KVASER_PCIEFD_MAX_CAN_CHANNELS 8UL
3131
#define KVASER_PCIEFD_DMA_COUNT 2U
3232

3333
#define KVASER_PCIEFD_DMA_SIZE (4U * 1024U)
@@ -49,6 +49,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices");
4949

5050
/* Xilinx based devices */
5151
#define KVASER_PCIEFD_M2_4CAN_DEVICE_ID 0x0017
52+
#define KVASER_PCIEFD_8CAN_DEVICE_ID 0x0019
5253

5354
/* Altera SerDes Enable 64-bit DMA address translation */
5455
#define KVASER_PCIEFD_ALTERA_DMA_64BIT BIT(0)
@@ -496,6 +497,10 @@ static struct pci_device_id kvaser_pciefd_id_table[] = {
496497
PCI_DEVICE(KVASER_PCIEFD_VENDOR, KVASER_PCIEFD_M2_4CAN_DEVICE_ID),
497498
.driver_data = (kernel_ulong_t)&kvaser_pciefd_xilinx_driver_data,
498499
},
500+
{
501+
PCI_DEVICE(KVASER_PCIEFD_VENDOR, KVASER_PCIEFD_8CAN_DEVICE_ID),
502+
.driver_data = (kernel_ulong_t)&kvaser_pciefd_xilinx_driver_data,
503+
},
499504
{
500505
0,
501506
},

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static int __mcp251xfd_get_berr_counter(const struct net_device *ndev,
837837
return err;
838838

839839
if (trec & MCP251XFD_REG_TREC_TXBO)
840-
bec->txerr = 256;
840+
bec->txerr = CAN_BUS_OFF_THRESHOLD;
841841
else
842842
bec->txerr = FIELD_GET(MCP251XFD_REG_TREC_TEC_MASK, trec);
843843
bec->rxerr = FIELD_GET(MCP251XFD_REG_TREC_REC_MASK, trec);

drivers/net/can/usb/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ config CAN_KVASER_USB
100100
- Scania VCI2 (if you have the Kvaser logo on top)
101101
- Kvaser BlackBird v2
102102
- Kvaser Leaf Pro HS v2
103+
- Kvaser Leaf v3
103104
- Kvaser Hybrid CAN/LIN
104105
- Kvaser Hybrid 2xCAN/LIN
105106
- Kvaser Hybrid Pro CAN/LIN

drivers/net/can/usb/gs_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static struct gs_tx_context *gs_get_tx_context(struct gs_can *dev,
385385
static int gs_cmd_reset(struct gs_can *dev)
386386
{
387387
struct gs_device_mode dm = {
388-
.mode = GS_CAN_MODE_RESET,
388+
.mode = cpu_to_le32(GS_CAN_MODE_RESET),
389389
};
390390

391391
return usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_MODE,

drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
#define USB_USBCAN_PRO_4HS_PRODUCT_ID 0x0114
8989
#define USB_HYBRID_CANLIN_PRODUCT_ID 0x0115
9090
#define USB_HYBRID_PRO_CANLIN_PRODUCT_ID 0x0116
91+
#define USB_LEAF_V3_PRODUCT_ID 0x0117
9192

9293
static const struct kvaser_usb_driver_info kvaser_usb_driver_info_hydra = {
9394
.quirks = KVASER_USB_QUIRK_HAS_HARDWARE_TIMESTAMP,
@@ -235,6 +236,8 @@ static const struct usb_device_id kvaser_usb_table[] = {
235236
.driver_info = (kernel_ulong_t)&kvaser_usb_driver_info_hydra },
236237
{ USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_PRO_CANLIN_PRODUCT_ID),
237238
.driver_info = (kernel_ulong_t)&kvaser_usb_driver_info_hydra },
239+
{ USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_V3_PRODUCT_ID),
240+
.driver_info = (kernel_ulong_t)&kvaser_usb_driver_info_hydra },
238241
{ }
239242
};
240243
MODULE_DEVICE_TABLE(usb, kvaser_usb_table);

0 commit comments

Comments
 (0)