|
Takashi Iwai |
e0af9e |
From 7ea56128dbf904a3359bcf9289cccdfa3c85c7e8 Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
e0af9e |
From: Jimmy Assarsson <extja@kvaser.com>
|
|
Takashi Iwai |
e0af9e |
Date: Mon, 10 Oct 2022 20:52:29 +0200
|
|
Takashi Iwai |
e0af9e |
Subject: [PATCH] can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event
|
|
Takashi Iwai |
e0af9e |
Git-commit: 7ea56128dbf904a3359bcf9289cccdfa3c85c7e8
|
|
Takashi Iwai |
e0af9e |
Patch-mainline: v6.2-rc1
|
|
Takashi Iwai |
e0af9e |
References: git-fixes
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
Prepare for handling CMD_ERROR_EVENT. Rename struct
|
|
Takashi Iwai |
e0af9e |
{leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event.
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices")
|
|
Takashi Iwai |
e0af9e |
Reported-by: Anssi Hannula <anssi.hannula@bitwise.fi>
|
|
Takashi Iwai |
e0af9e |
Tested-by: Anssi Hannula <anssi.hannula@bitwise.fi>
|
|
Takashi Iwai |
e0af9e |
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
|
|
Takashi Iwai |
e0af9e |
Link: https://lore.kernel.org/all/20221010185237.319219-4-extja@kvaser.com
|
|
Takashi Iwai |
e0af9e |
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
|
|
Takashi Iwai |
e0af9e |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
---
|
|
Takashi Iwai |
e0af9e |
.../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 38 +++++++++----------
|
|
Takashi Iwai |
e0af9e |
1 file changed, 19 insertions(+), 19 deletions(-)
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
|
|
Takashi Iwai |
e0af9e |
index c87b13dc1048..f34ca9a850aa 100644
|
|
Takashi Iwai |
e0af9e |
--- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
|
|
Takashi Iwai |
e0af9e |
+++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
|
|
Takashi Iwai |
e0af9e |
@@ -234,7 +234,7 @@ struct kvaser_cmd_tx_acknowledge_header {
|
|
Takashi Iwai |
e0af9e |
u8 tid;
|
|
Takashi Iwai |
e0af9e |
} __packed;
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
-struct leaf_cmd_error_event {
|
|
Takashi Iwai |
e0af9e |
+struct leaf_cmd_can_error_event {
|
|
Takashi Iwai |
e0af9e |
u8 tid;
|
|
Takashi Iwai |
e0af9e |
u8 flags;
|
|
Takashi Iwai |
e0af9e |
__le16 time[3];
|
|
Takashi Iwai |
e0af9e |
@@ -246,7 +246,7 @@ struct leaf_cmd_error_event {
|
|
Takashi Iwai |
e0af9e |
u8 error_factor;
|
|
Takashi Iwai |
e0af9e |
} __packed;
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
-struct usbcan_cmd_error_event {
|
|
Takashi Iwai |
e0af9e |
+struct usbcan_cmd_can_error_event {
|
|
Takashi Iwai |
e0af9e |
u8 tid;
|
|
Takashi Iwai |
e0af9e |
u8 padding;
|
|
Takashi Iwai |
e0af9e |
u8 tx_errors_count_ch0;
|
|
Takashi Iwai |
e0af9e |
@@ -319,7 +319,7 @@ struct kvaser_cmd {
|
|
Takashi Iwai |
e0af9e |
struct leaf_cmd_softinfo softinfo;
|
|
Takashi Iwai |
e0af9e |
struct leaf_cmd_rx_can rx_can;
|
|
Takashi Iwai |
e0af9e |
struct leaf_cmd_chip_state_event chip_state_event;
|
|
Takashi Iwai |
e0af9e |
- struct leaf_cmd_error_event error_event;
|
|
Takashi Iwai |
e0af9e |
+ struct leaf_cmd_can_error_event can_error_event;
|
|
Takashi Iwai |
e0af9e |
struct leaf_cmd_log_message log_message;
|
|
Takashi Iwai |
e0af9e |
struct kvaser_cmd_cap_req cap_req;
|
|
Takashi Iwai |
e0af9e |
struct kvaser_cmd_cap_res cap_res;
|
|
Takashi Iwai |
e0af9e |
@@ -329,7 +329,7 @@ struct kvaser_cmd {
|
|
Takashi Iwai |
e0af9e |
struct usbcan_cmd_softinfo softinfo;
|
|
Takashi Iwai |
e0af9e |
struct usbcan_cmd_rx_can rx_can;
|
|
Takashi Iwai |
e0af9e |
struct usbcan_cmd_chip_state_event chip_state_event;
|
|
Takashi Iwai |
e0af9e |
- struct usbcan_cmd_error_event error_event;
|
|
Takashi Iwai |
e0af9e |
+ struct usbcan_cmd_can_error_event can_error_event;
|
|
Takashi Iwai |
e0af9e |
} __packed usbcan;
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
struct kvaser_cmd_tx_can tx_can;
|
|
Takashi Iwai |
e0af9e |
@@ -351,7 +351,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = {
|
|
Takashi Iwai |
e0af9e |
[CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.leaf.rx_can),
|
|
Takashi Iwai |
e0af9e |
[CMD_LEAF_LOG_MESSAGE] = kvaser_fsize(u.leaf.log_message),
|
|
Takashi Iwai |
e0af9e |
[CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.leaf.chip_state_event),
|
|
Takashi Iwai |
e0af9e |
- [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event),
|
|
Takashi Iwai |
e0af9e |
+ [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.can_error_event),
|
|
Takashi Iwai |
e0af9e |
[CMD_GET_CAPABILITIES_RESP] = kvaser_fsize(u.leaf.cap_res),
|
|
Takashi Iwai |
e0af9e |
/* ignored events: */
|
|
Takashi Iwai |
e0af9e |
[CMD_FLUSH_QUEUE_REPLY] = CMD_SIZE_ANY,
|
|
Takashi Iwai |
e0af9e |
@@ -366,7 +366,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_usbcan[] = {
|
|
Takashi Iwai |
e0af9e |
[CMD_RX_STD_MESSAGE] = kvaser_fsize(u.usbcan.rx_can),
|
|
Takashi Iwai |
e0af9e |
[CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.usbcan.rx_can),
|
|
Takashi Iwai |
e0af9e |
[CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.usbcan.chip_state_event),
|
|
Takashi Iwai |
e0af9e |
- [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.error_event),
|
|
Takashi Iwai |
e0af9e |
+ [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.can_error_event),
|
|
Takashi Iwai |
e0af9e |
/* ignored events: */
|
|
Takashi Iwai |
e0af9e |
[CMD_USBCAN_CLOCK_OVERFLOW_EVENT] = CMD_SIZE_ANY,
|
|
Takashi Iwai |
e0af9e |
};
|
|
Takashi Iwai |
e0af9e |
@@ -1132,11 +1132,11 @@ static void kvaser_usb_leaf_usbcan_rx_error(const struct kvaser_usb *dev,
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
case CMD_CAN_ERROR_EVENT:
|
|
Takashi Iwai |
e0af9e |
es.channel = 0;
|
|
Takashi Iwai |
e0af9e |
- es.status = cmd->u.usbcan.error_event.status_ch0;
|
|
Takashi Iwai |
e0af9e |
- es.txerr = cmd->u.usbcan.error_event.tx_errors_count_ch0;
|
|
Takashi Iwai |
e0af9e |
- es.rxerr = cmd->u.usbcan.error_event.rx_errors_count_ch0;
|
|
Takashi Iwai |
e0af9e |
+ es.status = cmd->u.usbcan.can_error_event.status_ch0;
|
|
Takashi Iwai |
e0af9e |
+ es.txerr = cmd->u.usbcan.can_error_event.tx_errors_count_ch0;
|
|
Takashi Iwai |
e0af9e |
+ es.rxerr = cmd->u.usbcan.can_error_event.rx_errors_count_ch0;
|
|
Takashi Iwai |
e0af9e |
es.usbcan.other_ch_status =
|
|
Takashi Iwai |
e0af9e |
- cmd->u.usbcan.error_event.status_ch1;
|
|
Takashi Iwai |
e0af9e |
+ cmd->u.usbcan.can_error_event.status_ch1;
|
|
Takashi Iwai |
e0af9e |
kvaser_usb_leaf_usbcan_conditionally_rx_error(dev, &es);
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
/* The USBCAN firmware supports up to 2 channels.
|
|
Takashi Iwai |
e0af9e |
@@ -1144,13 +1144,13 @@ static void kvaser_usb_leaf_usbcan_rx_error(const struct kvaser_usb *dev,
|
|
Takashi Iwai |
e0af9e |
*/
|
|
Takashi Iwai |
e0af9e |
if (dev->nchannels == MAX_USBCAN_NET_DEVICES) {
|
|
Takashi Iwai |
e0af9e |
es.channel = 1;
|
|
Takashi Iwai |
e0af9e |
- es.status = cmd->u.usbcan.error_event.status_ch1;
|
|
Takashi Iwai |
e0af9e |
+ es.status = cmd->u.usbcan.can_error_event.status_ch1;
|
|
Takashi Iwai |
e0af9e |
es.txerr =
|
|
Takashi Iwai |
e0af9e |
- cmd->u.usbcan.error_event.tx_errors_count_ch1;
|
|
Takashi Iwai |
e0af9e |
+ cmd->u.usbcan.can_error_event.tx_errors_count_ch1;
|
|
Takashi Iwai |
e0af9e |
es.rxerr =
|
|
Takashi Iwai |
e0af9e |
- cmd->u.usbcan.error_event.rx_errors_count_ch1;
|
|
Takashi Iwai |
e0af9e |
+ cmd->u.usbcan.can_error_event.rx_errors_count_ch1;
|
|
Takashi Iwai |
e0af9e |
es.usbcan.other_ch_status =
|
|
Takashi Iwai |
e0af9e |
- cmd->u.usbcan.error_event.status_ch0;
|
|
Takashi Iwai |
e0af9e |
+ cmd->u.usbcan.can_error_event.status_ch0;
|
|
Takashi Iwai |
e0af9e |
kvaser_usb_leaf_usbcan_conditionally_rx_error(dev, &es);
|
|
Takashi Iwai |
e0af9e |
}
|
|
Takashi Iwai |
e0af9e |
break;
|
|
Takashi Iwai |
e0af9e |
@@ -1167,11 +1167,11 @@ static void kvaser_usb_leaf_leaf_rx_error(const struct kvaser_usb *dev,
|
|
Takashi Iwai |
e0af9e |
|
|
Takashi Iwai |
e0af9e |
switch (cmd->id) {
|
|
Takashi Iwai |
e0af9e |
case CMD_CAN_ERROR_EVENT:
|
|
Takashi Iwai |
e0af9e |
- es.channel = cmd->u.leaf.error_event.channel;
|
|
Takashi Iwai |
e0af9e |
- es.status = cmd->u.leaf.error_event.status;
|
|
Takashi Iwai |
e0af9e |
- es.txerr = cmd->u.leaf.error_event.tx_errors_count;
|
|
Takashi Iwai |
e0af9e |
- es.rxerr = cmd->u.leaf.error_event.rx_errors_count;
|
|
Takashi Iwai |
e0af9e |
- es.leaf.error_factor = cmd->u.leaf.error_event.error_factor;
|
|
Takashi Iwai |
e0af9e |
+ es.channel = cmd->u.leaf.can_error_event.channel;
|
|
Takashi Iwai |
e0af9e |
+ es.status = cmd->u.leaf.can_error_event.status;
|
|
Takashi Iwai |
e0af9e |
+ es.txerr = cmd->u.leaf.can_error_event.tx_errors_count;
|
|
Takashi Iwai |
e0af9e |
+ es.rxerr = cmd->u.leaf.can_error_event.rx_errors_count;
|
|
Takashi Iwai |
e0af9e |
+ es.leaf.error_factor = cmd->u.leaf.can_error_event.error_factor;
|
|
Takashi Iwai |
e0af9e |
break;
|
|
Takashi Iwai |
e0af9e |
case CMD_LEAF_LOG_MESSAGE:
|
|
Takashi Iwai |
e0af9e |
es.channel = cmd->u.leaf.log_message.channel;
|
|
Takashi Iwai |
e0af9e |
--
|
|
Takashi Iwai |
e0af9e |
2.35.3
|
|
Takashi Iwai |
e0af9e |
|