mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 12:10:23 -04:00
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/20240304092051.3631481-1-mkl@pengutronix.de Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -169,6 +169,7 @@ config CAN_KVASER_PCIEFD
|
||||
Kvaser Mini PCI Express 1xCAN v3
|
||||
Kvaser Mini PCI Express 2xCAN v3
|
||||
Kvaser M.2 PCIe 4xCAN
|
||||
Kvaser PCIe 8xCAN
|
||||
|
||||
config CAN_SLCAN
|
||||
tristate "Serial / USB serial CAN Adaptors (slcan)"
|
||||
|
||||
@@ -27,7 +27,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices");
|
||||
#define KVASER_PCIEFD_BEC_POLL_FREQ (jiffies + msecs_to_jiffies(200))
|
||||
#define KVASER_PCIEFD_MAX_ERR_REP 256U
|
||||
#define KVASER_PCIEFD_CAN_TX_MAX_COUNT 17U
|
||||
#define KVASER_PCIEFD_MAX_CAN_CHANNELS 4UL
|
||||
#define KVASER_PCIEFD_MAX_CAN_CHANNELS 8UL
|
||||
#define KVASER_PCIEFD_DMA_COUNT 2U
|
||||
|
||||
#define KVASER_PCIEFD_DMA_SIZE (4U * 1024U)
|
||||
@@ -49,6 +49,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices");
|
||||
|
||||
/* Xilinx based devices */
|
||||
#define KVASER_PCIEFD_M2_4CAN_DEVICE_ID 0x0017
|
||||
#define KVASER_PCIEFD_8CAN_DEVICE_ID 0x0019
|
||||
|
||||
/* Altera SerDes Enable 64-bit DMA address translation */
|
||||
#define KVASER_PCIEFD_ALTERA_DMA_64BIT BIT(0)
|
||||
@@ -496,6 +497,10 @@ static struct pci_device_id kvaser_pciefd_id_table[] = {
|
||||
PCI_DEVICE(KVASER_PCIEFD_VENDOR, KVASER_PCIEFD_M2_4CAN_DEVICE_ID),
|
||||
.driver_data = (kernel_ulong_t)&kvaser_pciefd_xilinx_driver_data,
|
||||
},
|
||||
{
|
||||
PCI_DEVICE(KVASER_PCIEFD_VENDOR, KVASER_PCIEFD_8CAN_DEVICE_ID),
|
||||
.driver_data = (kernel_ulong_t)&kvaser_pciefd_xilinx_driver_data,
|
||||
},
|
||||
{
|
||||
0,
|
||||
},
|
||||
|
||||
@@ -837,7 +837,7 @@ static int __mcp251xfd_get_berr_counter(const struct net_device *ndev,
|
||||
return err;
|
||||
|
||||
if (trec & MCP251XFD_REG_TREC_TXBO)
|
||||
bec->txerr = 256;
|
||||
bec->txerr = CAN_BUS_OFF_THRESHOLD;
|
||||
else
|
||||
bec->txerr = FIELD_GET(MCP251XFD_REG_TREC_TEC_MASK, trec);
|
||||
bec->rxerr = FIELD_GET(MCP251XFD_REG_TREC_REC_MASK, trec);
|
||||
|
||||
@@ -100,6 +100,7 @@ config CAN_KVASER_USB
|
||||
- Scania VCI2 (if you have the Kvaser logo on top)
|
||||
- Kvaser BlackBird v2
|
||||
- Kvaser Leaf Pro HS v2
|
||||
- Kvaser Leaf v3
|
||||
- Kvaser Hybrid CAN/LIN
|
||||
- Kvaser Hybrid 2xCAN/LIN
|
||||
- Kvaser Hybrid Pro CAN/LIN
|
||||
|
||||
@@ -385,7 +385,7 @@ static struct gs_tx_context *gs_get_tx_context(struct gs_can *dev,
|
||||
static int gs_cmd_reset(struct gs_can *dev)
|
||||
{
|
||||
struct gs_device_mode dm = {
|
||||
.mode = GS_CAN_MODE_RESET,
|
||||
.mode = cpu_to_le32(GS_CAN_MODE_RESET),
|
||||
};
|
||||
|
||||
return usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_MODE,
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
#define USB_USBCAN_PRO_4HS_PRODUCT_ID 0x0114
|
||||
#define USB_HYBRID_CANLIN_PRODUCT_ID 0x0115
|
||||
#define USB_HYBRID_PRO_CANLIN_PRODUCT_ID 0x0116
|
||||
#define USB_LEAF_V3_PRODUCT_ID 0x0117
|
||||
|
||||
static const struct kvaser_usb_driver_info kvaser_usb_driver_info_hydra = {
|
||||
.quirks = KVASER_USB_QUIRK_HAS_HARDWARE_TIMESTAMP,
|
||||
@@ -235,6 +236,8 @@ static const struct usb_device_id kvaser_usb_table[] = {
|
||||
.driver_info = (kernel_ulong_t)&kvaser_usb_driver_info_hydra },
|
||||
{ USB_DEVICE(KVASER_VENDOR_ID, USB_HYBRID_PRO_CANLIN_PRODUCT_ID),
|
||||
.driver_info = (kernel_ulong_t)&kvaser_usb_driver_info_hydra },
|
||||
{ USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_V3_PRODUCT_ID),
|
||||
.driver_info = (kernel_ulong_t)&kvaser_usb_driver_info_hydra },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, kvaser_usb_table);
|
||||
|
||||
Reference in New Issue
Block a user